@mappedin/react-sdk 6.0.1-beta.44 → 6.0.1-beta.45

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.
@@ -1 +0,0 @@
1
- import{$ as Ld,A as E8,B as _8,C as Kh,D as so,E as A8,F as I3,G as Cs,H as k8,I as Dd,J as D8,K as Ps,L as w0,M as gr,N as S3,O as Sn,P as F8,Q as Iu,R as _i,S as wt,T as ut,U as Jh,V as C3,W as P3,X as B8,Y as Qh,Z as $8,_ as Fd,a as J9,aa as j8,b as Q9,ba as Eo,c as e8,ca as G8,d as j,da as U8,e as h3,ea as T3,f as S0,fa as M0,g as C8,ga as O0,h as kd,ha as V8,i as C0,ia as z8,j as P8,ja as H8,k as P0,ka as E0,l as bu,la as W8,m as Is,ma as q8,n as T8,na as Z8,o as w8,oa as X8,p as v3,pa as Ts,q as _t,qa as w3,r as Fe,ra as Y8,s as vu,sa as K8,t as x3,ta as Su,u as Ss,ua as ey,v as T0,va as Rd,w as _a,wa as _0,x as xu,xa as Nd,y as M8,ya as Bd,z as O8}from"./chunk-MZY3INHN.js";import{a as Zee,ca as N8,k as L8,v as R8}from"./chunk-WULPIMBT.js";import{a as qo}from"./chunk-VPFGFRS7.js";import{$ as d8,$a as x8,A as i8,Aa as Oi,Ba as x0,C as s8,Ca as y8,D as Ke,Da as g8,E as _e,Fa as Ei,I as a8,J as l8,K as c8,L as Yh,M as Pe,N as Jr,O as u8,P as wi,Pa as Ad,Q as Ma,R as Oa,S as Lt,Ta as I0,U as jr,Ua as b8,V as Ea,W as p8,X as ze,Y as Mi,Ya as v8,_ as gu,_a as xs,aa as y3,ab as I8,b as h0,c as y0,ca as Xl,cb as S8,d as t8,e as Ta,f as r8,g as gs,ha as f8,ka as Yl,la as m8,ma as b0,na as g3,p as n8,pa as _d,q as o8,r as g0,ua as h8,va as Kl,wa as v0,xa as b3,ya as bs,z as wa,za as vs}from"./chunk-2DFVQLLS.js";import{a as d,b}from"./chunk-VMPZPJW5.js";import{a as s,c as W,d as Pa,e as ys,f as h,g as u,h as O,i as A,j as te,k as _}from"./chunk-2OY65JNC.js";var Ty=W(Mt=>{"use strict";d();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.regexpCode=Mt.getEsmExportName=Mt.getProperty=Mt.safeStringify=Mt.stringify=Mt.strConcat=Mt.addCodeArg=Mt.str=Mt._=Mt.nil=Mt._Code=Mt.Name=Mt.IDENTIFIER=Mt._CodeOrName=void 0;var oC=class oC{};s(oC,"_CodeOrName");var Cy=oC;Mt._CodeOrName=Cy;Mt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var iC=class iC extends Cy{constructor(t){if(super(),!Mt.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};s(iC,"Name");var $u=iC;Mt.Name=$u;var sC=class sC extends Cy{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>"".concat(r).concat(n),"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof $u&&(r[n.str]=(r[n.str]||0)+1),r),{})}};s(sC,"_Code");var Qo=sC;Mt._Code=Qo;Mt.nil=new Qo("");function b_(e,...t){let r=[e[0]],n=0;for(;n<t.length;)nC(r,t[n]),r.push(e[++n]);return new Qo(r)}s(b_,"_");Mt._=b_;var rC=new Qo("+");function v_(e,...t){let r=[Py(e[0])],n=0;for(;n<t.length;)r.push(rC),nC(r,t[n]),r.push(rC,Py(e[++n]));return xte(r),new Qo(r)}s(v_,"str");Mt.str=v_;function nC(e,t){t instanceof Qo?e.push(...t._items):t instanceof $u?e.push(t):e.push(Cte(t))}s(nC,"addCodeArg");Mt.addCodeArg=nC;function xte(e){let t=1;for(;t<e.length-1;){if(e[t]===rC){let r=Ite(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}s(xte,"optimize");function Ite(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof $u||e[e.length-1]!=='"'?void 0:typeof t!="string"?"".concat(e.slice(0,-1)).concat(t,'"'):t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof $u))return'"'.concat(e).concat(t.slice(1))}s(Ite,"mergeExprItems");var y_;function Ste(e,t){return t.emptyStr()?e:e.emptyStr()?t:v_(y_||(y_=_(["","",""])),e,t)}s(Ste,"strConcat");Mt.strConcat=Ste;function Cte(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Py(Array.isArray(e)?e.join(","):e)}s(Cte,"interpolate");function Pte(e){return new Qo(Py(e))}s(Pte,"stringify");Mt.stringify=Pte;function Py(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}s(Py,"safeStringify");Mt.safeStringify=Py;var g_;function Tte(e){return typeof e=="string"&&Mt.IDENTIFIER.test(e)?new Qo(".".concat(e)):b_(g_||(g_=_(["[","]"])),e)}s(Tte,"getProperty");Mt.getProperty=Tte;function wte(e){if(typeof e=="string"&&Mt.IDENTIFIER.test(e))return new Qo("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}s(wte,"getEsmExportName");Mt.getEsmExportName=wte;function Mte(e){return new Qo(e.toString())}s(Mte,"regexpCode");Mt.regexpCode=Mte});var fC=W(po=>{"use strict";d();Object.defineProperty(po,"__esModule",{value:!0});po.ValueScope=po.ValueScopeName=po.Scope=po.varKinds=po.UsedValueState=void 0;var uo=Ty(),cC=class cC extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}};s(cC,"ValueError");var aC=cC,F0;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(F0||(po.UsedValueState=F0={}));po.varKinds={const:new uo.Name("const"),let:new uo.Name("let"),var:new uo.Name("var")};var uC=class uC{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof uo.Name?t:this.name(t)}name(t){return new uo.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return"".concat(t).concat(r.index++)}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error('CodeGen: prefix "'.concat(t,'" is not allowed in this scope'));return this._names[t]={prefix:t,index:0}}};s(uC,"Scope");var L0=uC;po.Scope=L0;var x_,pC=class pC extends uo.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,uo._)(x_||(x_=_([".","[","]"])),new uo.Name(r),n)}};s(pC,"ValueScopeName");var R0=pC;po.ValueScopeName=R0;var I_,Ote=(0,uo._)(I_||(I_=_(["\n"],["\\n"]))),S_,C_,P_,dC=class dC extends L0{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Ote:uo.nil}}get(){return this._scope}name(t){return new R0(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,a=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[i];if(l){let f=l.get(a);if(f)return f}else l=this._values[i]=new Map;l.set(a,o);let c=this._scope[i]||(this._scope[i]=[]),p=c.length;return c[p]=r.ref,o.setValue(r,{property:i,itemIndex:p}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error('CodeGen: name "'.concat(n,'" has no value'));return(0,uo._)(S_||(S_=_(["","",""])),t,n.scopePath)})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error('CodeGen: name "'.concat(o,'" has no value'));return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=uo.nil;for(let a in t){let l=t[a];if(!l)continue;let c=n[a]=n[a]||new Map;l.forEach(p=>{if(c.has(p))return;c.set(p,F0.Started);let f=r(p);if(f){let m=this.opts.es5?po.varKinds.var:po.varKinds.const;i=(0,uo._)(C_||(C_=_(["",""," "," = ",";",""])),i,m,p,f,this.opts._n)}else if(f=o==null?void 0:o(p))i=(0,uo._)(P_||(P_=_(["","","",""])),i,f,this.opts._n);else throw new aC(p);c.set(p,F0.Completed)})}return i}};s(dC,"ValueScope");var lC=dC;po.ValueScope=lC});var Xe=W(Je=>{"use strict";d();Object.defineProperty(Je,"__esModule",{value:!0});Je.or=Je.and=Je.not=Je.CodeGen=Je.operators=Je.varKinds=Je.ValueScopeName=Je.ValueScope=Je.Scope=Je.Name=Je.regexpCode=Je.stringify=Je.getProperty=Je.nil=Je.strConcat=Je.str=Je._=void 0;var pt=Ty(),Ni=fC(),uc=Ty();Object.defineProperty(Je,"_",{enumerable:!0,get:s(function(){return uc._},"get")});Object.defineProperty(Je,"str",{enumerable:!0,get:s(function(){return uc.str},"get")});Object.defineProperty(Je,"strConcat",{enumerable:!0,get:s(function(){return uc.strConcat},"get")});Object.defineProperty(Je,"nil",{enumerable:!0,get:s(function(){return uc.nil},"get")});Object.defineProperty(Je,"getProperty",{enumerable:!0,get:s(function(){return uc.getProperty},"get")});Object.defineProperty(Je,"stringify",{enumerable:!0,get:s(function(){return uc.stringify},"get")});Object.defineProperty(Je,"regexpCode",{enumerable:!0,get:s(function(){return uc.regexpCode},"get")});Object.defineProperty(Je,"Name",{enumerable:!0,get:s(function(){return uc.Name},"get")});var j0=fC();Object.defineProperty(Je,"Scope",{enumerable:!0,get:s(function(){return j0.Scope},"get")});Object.defineProperty(Je,"ValueScope",{enumerable:!0,get:s(function(){return j0.ValueScope},"get")});Object.defineProperty(Je,"ValueScopeName",{enumerable:!0,get:s(function(){return j0.ValueScopeName},"get")});Object.defineProperty(Je,"varKinds",{enumerable:!0,get:s(function(){return j0.varKinds},"get")});Je.operators={GT:new pt._Code(">"),GTE:new pt._Code(">="),LT:new pt._Code("<"),LTE:new pt._Code("<="),EQ:new pt._Code("==="),NEQ:new pt._Code("!=="),NOT:new pt._Code("!"),OR:new pt._Code("||"),AND:new pt._Code("&&"),ADD:new pt._Code("+")};var wC=class wC{optimizeNodes(){return this}optimizeNames(t,r){return this}};s(wC,"Node");var Ua=wC,MC=class MC extends Ua{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ni.varKinds.var:this.varKind,o=this.rhs===void 0?"":" = ".concat(this.rhs);return"".concat(n," ").concat(this.name).concat(o,";")+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=ff(this.rhs,t,r)),this}get names(){return this.rhs instanceof pt._CodeOrName?this.rhs.names:{}}};s(MC,"Def");var mC=MC,OC=class OC extends Ua{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return"".concat(this.lhs," = ").concat(this.rhs,";")+t}optimizeNames(t,r){if(!(this.lhs instanceof pt.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=ff(this.rhs,t,r),this}get names(){let t=this.lhs instanceof pt.Name?{}:{...this.lhs.names};return $0(t,this.rhs)}};s(OC,"Assign");var N0=OC,EC=class EC extends N0{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return"".concat(this.lhs," ").concat(this.op,"= ").concat(this.rhs,";")+t}};s(EC,"AssignOp");var hC=EC,_C=class _C extends Ua{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}};s(_C,"Label");var yC=_C,AC=class AC extends Ua{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}};s(AC,"Break");var gC=AC,kC=class kC extends Ua{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}};s(kC,"Throw");var bC=kC,DC=class DC extends Ua{constructor(t){super(),this.code=t}render({_n:t}){return"".concat(this.code,";")+t}optimizeNodes(){return"".concat(this.code)?this:void 0}optimizeNames(t,r){return this.code=ff(this.code,t,r),this}get names(){return this.code instanceof pt._CodeOrName?this.code.names:{}}};s(DC,"AnyCode");var vC=DC,FC=class FC extends Ua{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(Ete(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Uu(t,r.names),{})}};s(FC,"ParentNode");var wy=FC,LC=class LC extends wy{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};s(LC,"BlockNode");var Va=LC,RC=class RC extends wy{};s(RC,"Root");var xC=RC,NC=class NC extends Va{};s(NC,"Else");var df=NC;df.kind="else";var pf=class pf extends Va{constructor(t,r){super(r),this.condition=t}render(t){let r="if(".concat(this.condition,")")+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new df(n):n}if(r)return t===!1?r instanceof pf?r:r.nodes:this.nodes.length?this:new pf(A_(t),r instanceof pf?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=ff(this.condition,t,r),this}get names(){let t=super.names;return $0(t,this.condition),this.else&&Uu(t,this.else.names),t}};s(pf,"If");var ju=pf;ju.kind="if";var BC=class BC extends Va{};s(BC,"For");var Gu=BC;Gu.kind="for";var $C=class $C extends Gu{constructor(t){super(),this.iteration=t}render(t){return"for(".concat(this.iteration,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=ff(this.iteration,t,r),this}get names(){return Uu(super.names,this.iteration.names)}};s($C,"ForLoop");var IC=$C,jC=class jC extends Gu{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Ni.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return"for(".concat(r," ").concat(n,"=").concat(o,"; ").concat(n,"<").concat(i,"; ").concat(n,"++)")+super.render(t)}get names(){let t=$0(super.names,this.from);return $0(t,this.to)}};s(jC,"ForRange");var SC=jC,GC=class GC extends Gu{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return"for(".concat(this.varKind," ").concat(this.name," ").concat(this.loop," ").concat(this.iterable,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=ff(this.iterable,t,r),this}get names(){return Uu(super.names,this.iterable.names)}};s(GC,"ForIter");var B0=GC,UC=class UC extends Va{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){let r=this.async?"async ":"";return"".concat(r,"function ").concat(this.name,"(").concat(this.args,")")+super.render(t)}};s(UC,"Func");var My=UC;My.kind="func";var VC=class VC extends wy{render(t){return"return "+super.render(t)}};s(VC,"Return");var Oy=VC;Oy.kind="return";var zC=class zC extends Va{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Uu(t,this.catch.names),this.finally&&Uu(t,this.finally.names),t}};s(zC,"Try");var CC=zC,HC=class HC extends Va{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};s(HC,"Catch");var Ey=HC;Ey.kind="catch";var WC=class WC extends Va{render(t){return"finally"+super.render(t)}};s(WC,"Finally");var _y=WC;_y.kind="finally";var T_,w_,M_,qC=class qC{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?"\n":""},this._extScope=t,this._scope=new Ni.Scope({parent:t}),this._nodes=[new xC]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new mC(t,i,n)),i}const(t,r,n){return this._def(Ni.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ni.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ni.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new N0(t,r,n))}add(t,r){return this._leafNode(new hC(t,Je.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==pt.nil&&this._leafNode(new vC(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,pt.addCodeArg)(r,o));return r.push("}"),new pt._Code(r)}if(t,r,n){if(this._blockNode(new ju(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new ju(t))}else(){return this._elseNode(new df)}endIf(){return this._endBlockNode(ju,df)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new IC(t),r)}forRange(t,r,n,o,i=this.opts.es5?Ni.varKinds.var:Ni.varKinds.let){let a=this._scope.toName(t);return this._for(new SC(i,a,r,n),()=>o(a))}forOf(t,r,n,o=Ni.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let a=r instanceof pt.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,pt._)(T_||(T_=_(["",".length"])),a),l=>{this.var(i,(0,pt._)(w_||(w_=_(["","[","]"])),a,l)),n(i)})}return this._for(new B0("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Ni.varKinds.var:Ni.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,pt._)(M_||(M_=_(["Object.keys(",")"])),r),n);let i=this._scope.toName(t);return this._for(new B0("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Gu)}label(t){return this._leafNode(new yC(t))}break(t){return this._leafNode(new gC(t))}return(t){let r=new Oy;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Oy)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new CC;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Ey(i),r(i)}return n&&(this._currNode=o.finally=new _y,this.code(n)),this._endBlockNode(Ey,_y)}throw(t){return this._leafNode(new bC(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error("CodeGen: wrong number of nodes: ".concat(n," vs ").concat(t," expected"));return this._nodes.length=r,this}func(t,r=pt.nil,n,o){return this._blockNode(new My(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(My)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error('CodeGen: not in block "'.concat(r?"".concat(t.kind,"/").concat(r.kind):t.kind,'"'))}_elseNode(t){let r=this._currNode;if(!(r instanceof ju))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};s(qC,"CodeGen");var PC=qC;Je.CodeGen=PC;function Uu(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}s(Uu,"addNames");function $0(e,t){return t instanceof pt._CodeOrName?Uu(e,t.names):e}s($0,"addExprNames");function ff(e,t,r){if(e instanceof pt.Name)return n(e);if(!o(e))return e;return new pt._Code(e._items.reduce((i,a)=>(a instanceof pt.Name&&(a=n(a)),a instanceof pt._Code?i.push(...a._items):i.push(a),i),[]));function n(i){let a=r[i.str];return a===void 0||t[i.str]!==1?i:(delete t[i.str],a)}function o(i){return i instanceof pt._Code&&i._items.some(a=>a instanceof pt.Name&&t[a.str]===1&&r[a.str]!==void 0)}}s(ff,"optimizeExpr");function Ete(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}s(Ete,"subtractNames");var O_;function A_(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,pt._)(O_||(O_=_(["!",""])),TC(e))}s(A_,"not");Je.not=A_;var _te=k_(Je.operators.AND);function Ate(...e){return e.reduce(_te)}s(Ate,"and");Je.and=Ate;var kte=k_(Je.operators.OR);function Dte(...e){return e.reduce(kte)}s(Dte,"or");Je.or=Dte;var E_;function k_(e){return(t,r)=>t===pt.nil?r:r===pt.nil?t:(0,pt._)(E_||(E_=_([""," "," ",""])),TC(t),e,TC(r))}s(k_,"mappend");var __;function TC(e){return e instanceof pt.Name?e:(0,pt._)(__||(__=_(["(",")"])),e)}s(TC,"par")});var Ot=W(tt=>{"use strict";d();Object.defineProperty(tt,"__esModule",{value:!0});tt.checkStrictMode=tt.getErrorPath=tt.Type=tt.useFunc=tt.setEvaluated=tt.evaluatedPropsToName=tt.mergeEvaluated=tt.eachItem=tt.unescapeJsonPointer=tt.escapeJsonPointer=tt.escapeFragment=tt.unescapeFragment=tt.schemaRefOrVal=tt.schemaHasRulesButRef=tt.schemaHasRules=tt.checkUnknownRules=tt.alwaysValidSchema=tt.toHash=void 0;var qt=Xe(),Fte=Ty();function Lte(e){let t={};for(let r of e)t[r]=!0;return t}s(Lte,"toHash");tt.toHash=Lte;function Rte(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Q_(e,t),!eA(t,e.self.RULES.all))}s(Rte,"alwaysValidSchema");tt.alwaysValidSchema=Rte;function Q_(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||nA(e,'unknown keyword: "'.concat(i,'"'))}s(Q_,"checkUnknownRules");tt.checkUnknownRules=Q_;function eA(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}s(eA,"schemaHasRules");tt.schemaHasRules=eA;function Nte(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}s(Nte,"schemaHasRulesButRef");tt.schemaHasRulesButRef=Nte;var L_,R_;function Bte({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,qt._)(L_||(L_=_(["",""])),r)}return(0,qt._)(R_||(R_=_(["","","",""])),e,t,(0,qt.getProperty)(n))}s(Bte,"schemaRefOrVal");tt.schemaRefOrVal=Bte;function $te(e){return tA(decodeURIComponent(e))}s($te,"unescapeFragment");tt.unescapeFragment=$te;function jte(e){return encodeURIComponent(XC(e))}s(jte,"escapeFragment");tt.escapeFragment=jte;function XC(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}s(XC,"escapeJsonPointer");tt.escapeJsonPointer=XC;function tA(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}s(tA,"unescapeJsonPointer");tt.unescapeJsonPointer=tA;function Gte(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}s(Gte,"eachItem");tt.eachItem=Gte;function D_({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,a,l)=>{let c=a===void 0?i:a instanceof qt.Name?(i instanceof qt.Name?e(o,i,a):t(o,i,a),a):i instanceof qt.Name?(t(o,a,i),i):r(i,a);return l===qt.Name&&!(c instanceof qt.Name)?n(o,c):c}}s(D_,"makeMergeEvaluated");var N_,B_,$_,j_,G_,U_,V_,z_,H_,W_;tt.mergeEvaluated={props:D_({mergeNames:s((e,t,r)=>e.if((0,qt._)(N_||(N_=_([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,qt._)(B_||(B_=_([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,qt._)($_||($_=_([""," || {}"])),r)).code((0,qt._)(j_||(j_=_(["Object.assign(",", ",")"])),r,t)))}),"mergeNames"),mergeToName:s((e,t,r)=>e.if((0,qt._)(G_||(G_=_([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,qt._)(U_||(U_=_([""," || {}"])),r)),YC(e,r,t))}),"mergeToName"),mergeValues:s((e,t)=>e===!0?!0:{...e,...t},"mergeValues"),resultToName:rA}),items:D_({mergeNames:s((e,t,r)=>e.if((0,qt._)(V_||(V_=_([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,qt._)(z_||(z_=_([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),"mergeNames"),mergeToName:s((e,t,r)=>e.if((0,qt._)(H_||(H_=_([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,qt._)(W_||(W_=_([""," > "," ? "," : ",""])),r,t,r,t))),"mergeToName"),mergeValues:s((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:s((e,t)=>e.var("items",t),"resultToName")})};var q_;function rA(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,qt._)(q_||(q_=_(["{}"]))));return t!==void 0&&YC(e,r,t),r}s(rA,"evaluatedPropsToName");tt.evaluatedPropsToName=rA;var Z_;function YC(e,t,r){Object.keys(r).forEach(n=>e.assign((0,qt._)(Z_||(Z_=_(["","",""])),t,(0,qt.getProperty)(n)),!0))}s(YC,"setEvaluated");tt.setEvaluated=YC;var F_={};function Ute(e,t){return e.scopeValue("func",{ref:t,code:F_[t.code]||(F_[t.code]=new Fte._Code(t.code))})}s(Ute,"useFunc");tt.useFunc=Ute;var ZC;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(ZC||(tt.Type=ZC={}));var X_,Y_,K_,J_;function Vte(e,t,r){if(e instanceof qt.Name){let n=t===ZC.Num;return r?n?(0,qt._)(X_||(X_=_(['"[" + ',' + "]"'])),e):(0,qt._)(Y_||(Y_=_(['"[\'" + ',' + "\']"'])),e):n?(0,qt._)(K_||(K_=_(['"/" + ',""])),e):(0,qt._)(J_||(J_=_(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,qt.getProperty)(e).toString():"/"+XC(e)}s(Vte,"getErrorPath");tt.getErrorPath=Vte;function nA(e,t,r=e.opts.strictSchema){if(r){if(t="strict mode: ".concat(t),r===!0)throw new Error(t);e.self.logger.warn(t)}}s(nA,"checkStrictMode");tt.checkStrictMode=nA});var za=W(KC=>{"use strict";d();Object.defineProperty(KC,"__esModule",{value:!0});var Cn=Xe(),zte={data:new Cn.Name("data"),valCxt:new Cn.Name("valCxt"),instancePath:new Cn.Name("instancePath"),parentData:new Cn.Name("parentData"),parentDataProperty:new Cn.Name("parentDataProperty"),rootData:new Cn.Name("rootData"),dynamicAnchors:new Cn.Name("dynamicAnchors"),vErrors:new Cn.Name("vErrors"),errors:new Cn.Name("errors"),this:new Cn.Name("this"),self:new Cn.Name("self"),scope:new Cn.Name("scope"),json:new Cn.Name("json"),jsonPos:new Cn.Name("jsonPos"),jsonLen:new Cn.Name("jsonLen"),jsonPart:new Cn.Name("jsonPart")};KC.default=zte});var Ay=W(Pn=>{"use strict";d();Object.defineProperty(Pn,"__esModule",{value:!0});Pn.extendErrors=Pn.resetErrorsCount=Pn.reportExtraError=Pn.reportError=Pn.keyword$DataError=Pn.keywordError=void 0;var bt=Xe(),G0=Ot(),zn=za(),oA;Pn.keywordError={message:s(({keyword:e})=>(0,bt.str)(oA||(oA=_(['must pass "','" keyword validation'])),e),"message")};var iA,sA;Pn.keyword$DataError={message:s(({keyword:e,schemaType:t})=>t?(0,bt.str)(iA||(iA=_(['"','" keyword must be '," ($data)"])),e,t):(0,bt.str)(sA||(sA=_(['"','" keyword is invalid ($data)'])),e),"message")};var aA;function Hte(e,t=Pn.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:a,allErrors:l}=o,c=AA(e,t,r);(n!=null?n:a||l)?EA(i,c):_A(o,(0,bt._)(aA||(aA=_(["[","]"])),c))}s(Hte,"reportError");Pn.reportError=Hte;function Wte(e,t=Pn.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:a}=n,l=AA(e,t,r);EA(o,l),i||a||_A(n,zn.default.vErrors)}s(Wte,"reportExtraError");Pn.reportExtraError=Wte;var lA,cA;function qte(e,t){e.assign(zn.default.errors,t),e.if((0,bt._)(lA||(lA=_([""," !== null"])),zn.default.vErrors),()=>e.if(t,()=>e.assign((0,bt._)(cA||(cA=_(["",".length"])),zn.default.vErrors),t),()=>e.assign(zn.default.vErrors,null)))}s(qte,"resetErrorsCount");Pn.resetErrorsCount=qte;var uA,pA,dA,fA,mA,hA,yA;function Zte({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",o,zn.default.errors,l=>{e.const(a,(0,bt._)(uA||(uA=_(["","[","]"])),zn.default.vErrors,l)),e.if((0,bt._)(pA||(pA=_(["",".instancePath === undefined"])),a),()=>e.assign((0,bt._)(dA||(dA=_(["",".instancePath"])),a),(0,bt.strConcat)(zn.default.instancePath,i.errorPath))),e.assign((0,bt._)(fA||(fA=_(["",".schemaPath"])),a),(0,bt.str)(mA||(mA=_(["","/",""])),i.errSchemaPath,t)),i.opts.verbose&&(e.assign((0,bt._)(hA||(hA=_(["",".schema"])),a),r),e.assign((0,bt._)(yA||(yA=_(["",".data"])),a),n))})}s(Zte,"extendErrors");Pn.extendErrors=Zte;var gA,bA,vA,xA;function EA(e,t){let r=e.const("err",t);e.if((0,bt._)(gA||(gA=_([""," === null"])),zn.default.vErrors),()=>e.assign(zn.default.vErrors,(0,bt._)(bA||(bA=_(["[","]"])),r)),(0,bt._)(vA||(vA=_(["",".push(",")"])),zn.default.vErrors,r)),e.code((0,bt._)(xA||(xA=_(["","++"])),zn.default.errors))}s(EA,"addError");var IA,SA;function _A(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,bt._)(IA||(IA=_(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,bt._)(SA||(SA=_(["",".errors"])),n),t),r.return(!1))}s(_A,"returnErrors");var Vu={keyword:new bt.Name("keyword"),schemaPath:new bt.Name("schemaPath"),params:new bt.Name("params"),propertyName:new bt.Name("propertyName"),message:new bt.Name("message"),schema:new bt.Name("schema"),parentSchema:new bt.Name("parentSchema")},CA;function AA(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,bt._)(CA||(CA=_(["{}"]))):Xte(e,t,r)}s(AA,"errorObjectCode");function Xte(e,t,r={}){let{gen:n,it:o}=e,i=[Yte(o,r),Kte(e,r)];return Jte(e,t,i),n.object(...i)}s(Xte,"errorObject");var PA;function Yte({errorPath:e},{instancePath:t}){let r=t?(0,bt.str)(PA||(PA=_(["","",""])),e,(0,G0.getErrorPath)(t,G0.Type.Str)):e;return[zn.default.instancePath,(0,bt.strConcat)(zn.default.instancePath,r)]}s(Yte,"errorInstancePath");var TA,wA;function Kte({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,bt.str)(TA||(TA=_(["","/",""])),t,e);return r&&(o=(0,bt.str)(wA||(wA=_(["","",""])),o,(0,G0.getErrorPath)(r,G0.Type.Str))),[Vu.schemaPath,o]}s(Kte,"errorSchemaPath");var MA,OA;function Jte(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:a,it:l}=e,{opts:c,propertyName:p,topSchemaRef:f,schemaPath:m}=l;n.push([Vu.keyword,o],[Vu.params,typeof t=="function"?t(e):t||(0,bt._)(MA||(MA=_(["{}"])))]),c.messages&&n.push([Vu.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Vu.schema,a],[Vu.parentSchema,(0,bt._)(OA||(OA=_(["","",""])),f,m)],[zn.default.data,i]),p&&n.push([Vu.propertyName,p])}s(Jte,"extraErrorProps")});var FA=W(mf=>{"use strict";d();Object.defineProperty(mf,"__esModule",{value:!0});mf.boolOrEmptySchema=mf.topBoolOrEmptySchema=void 0;var Qte=Ay(),ere=Xe(),tre=za(),rre={message:"boolean schema is false"},kA;function nre(e){let{gen:t,schema:r,validateName:n}=e;r===!1?DA(e,!1):typeof r=="object"&&r.$async===!0?t.return(tre.default.data):(t.assign((0,ere._)(kA||(kA=_(["",".errors"])),n),null),t.return(!0))}s(nre,"topBoolOrEmptySchema");mf.topBoolOrEmptySchema=nre;function ore(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),DA(e)):r.var(t,!0)}s(ore,"boolOrEmptySchema");mf.boolOrEmptySchema=ore;function DA(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Qte.reportError)(o,rre,void 0,t)}s(DA,"falseSchemaError")});var JC=W(hf=>{"use strict";d();Object.defineProperty(hf,"__esModule",{value:!0});hf.getRules=hf.isJSONType=void 0;var ire=["string","number","integer","boolean","null","object","array"],sre=new Set(ire);function are(e){return typeof e=="string"&&sre.has(e)}s(are,"isJSONType");hf.isJSONType=are;function lre(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}s(lre,"getRules");hf.getRules=lre});var QC=W(pc=>{"use strict";d();Object.defineProperty(pc,"__esModule",{value:!0});pc.shouldUseRule=pc.shouldUseGroup=pc.schemaHasRulesForType=void 0;function cre({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&LA(e,n)}s(cre,"schemaHasRulesForType");pc.schemaHasRulesForType=cre;function LA(e,t){return t.rules.some(r=>RA(e,r))}s(LA,"shouldUseGroup");pc.shouldUseGroup=LA;function RA(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}s(RA,"shouldUseRule");pc.shouldUseRule=RA});var ky=W(Tn=>{"use strict";d();Object.defineProperty(Tn,"__esModule",{value:!0});Tn.reportTypeError=Tn.checkDataTypes=Tn.checkDataType=Tn.coerceAndCheckDataType=Tn.getJSONTypes=Tn.getSchemaTypes=Tn.DataType=void 0;var ure=JC(),pre=QC(),dre=Ay(),Ze=Xe(),yk=Ot(),yf;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(yf||(Tn.DataType=yf={}));function fre(e){let t=gk(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}s(fre,"getSchemaTypes");Tn.getSchemaTypes=fre;function gk(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(ure.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}s(gk,"getJSONTypes");Tn.getJSONTypes=gk;function mre(e,t){let{gen:r,data:n,opts:o}=e,i=hre(t,o.coerceTypes),a=t.length>0&&!(i.length===0&&t.length===1&&(0,pre.schemaHasRulesForType)(e,t[0]));if(a){let l=tP(t,n,o.strictNumbers,yf.Wrong);r.if(l,()=>{i.length?yre(e,t,i):rP(e)})}return a}s(mre,"coerceAndCheckDataType");Tn.coerceAndCheckDataType=mre;var bk=new Set(["string","number","integer","boolean","null"]);function hre(e,t){return t?e.filter(r=>bk.has(r)||t==="array"&&r==="array"):[]}s(hre,"coerceToTypes");var NA,BA,$A,jA,GA,UA,VA,zA,HA,WA,qA,ZA,XA,YA,KA,JA,QA,ek,tk,rk;function yre(e,t,r){let{gen:n,data:o,opts:i}=e,a=n.let("dataType",(0,Ze._)(NA||(NA=_(["typeof ",""])),o)),l=n.let("coerced",(0,Ze._)(BA||(BA=_(["undefined"]))));i.coerceTypes==="array"&&n.if((0,Ze._)($A||($A=_([""," == 'object' && Array.isArray(",") && ",".length == 1"])),a,o,o),()=>n.assign(o,(0,Ze._)(jA||(jA=_(["","[0]"])),o)).assign(a,(0,Ze._)(GA||(GA=_(["typeof ",""])),o)).if(tP(t,o,i.strictNumbers),()=>n.assign(l,o))),n.if((0,Ze._)(UA||(UA=_([""," !== undefined"])),l));for(let p of r)(bk.has(p)||p==="array"&&i.coerceTypes==="array")&&c(p);n.else(),rP(e),n.endIf(),n.if((0,Ze._)(VA||(VA=_([""," !== undefined"])),l),()=>{n.assign(o,l),gre(e,l)});function c(p){switch(p){case"string":n.elseIf((0,Ze._)(zA||(zA=_(["",' == "number" || ',' == "boolean"'])),a,a)).assign(l,(0,Ze._)(HA||(HA=_(['"" + ',""])),o)).elseIf((0,Ze._)(WA||(WA=_([""," === null"])),o)).assign(l,(0,Ze._)(qA||(qA=_(['""']))));return;case"number":n.elseIf((0,Ze._)(ZA||(ZA=_(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),a,o,a,o,o,o)).assign(l,(0,Ze._)(XA||(XA=_(["+",""])),o));return;case"integer":n.elseIf((0,Ze._)(YA||(YA=_(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),a,o,a,o,o,o,o)).assign(l,(0,Ze._)(KA||(KA=_(["+",""])),o));return;case"boolean":n.elseIf((0,Ze._)(JA||(JA=_(["",' === "false" || '," === 0 || "," === null"])),o,o,o)).assign(l,!1).elseIf((0,Ze._)(QA||(QA=_(["",' === "true" || '," === 1"])),o,o)).assign(l,!0);return;case"null":n.elseIf((0,Ze._)(ek||(ek=_(["",' === "" || '," === 0 || "," === false"])),o,o,o)),n.assign(l,null);return;case"array":n.elseIf((0,Ze._)(tk||(tk=_(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),a,a,a,o)).assign(l,(0,Ze._)(rk||(rk=_(["[","]"])),o))}}s(c,"coerceSpecificType")}s(yre,"coerceData");var nk,ok;function gre({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Ze._)(nk||(nk=_([""," !== undefined"])),t),()=>e.assign((0,Ze._)(ok||(ok=_(["","[","]"])),t,r),n))}s(gre,"assignParentData");var ik,sk,ak,lk,ck,uk,pk;function eP(e,t,r,n=yf.Correct){let o=n===yf.Correct?Ze.operators.EQ:Ze.operators.NEQ,i;switch(e){case"null":return(0,Ze._)(ik||(ik=_([""," "," null"])),t,o);case"array":i=(0,Ze._)(sk||(sk=_(["Array.isArray(",")"])),t);break;case"object":i=(0,Ze._)(ak||(ak=_([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":i=a((0,Ze._)(lk||(lk=_(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":i=a();break;default:return(0,Ze._)(ck||(ck=_(["typeof "," "," ",""])),t,o,e)}return n===yf.Correct?i:(0,Ze.not)(i);function a(l=Ze.nil){return(0,Ze.and)((0,Ze._)(uk||(uk=_(["typeof ",' == "number"'])),t),l,r?(0,Ze._)(pk||(pk=_(["isFinite(",")"])),t):Ze.nil)}}s(eP,"checkDataType");Tn.checkDataType=eP;var dk,fk;function tP(e,t,r,n){if(e.length===1)return eP(e[0],t,r,n);let o,i=(0,yk.toHash)(e);if(i.array&&i.object){let a=(0,Ze._)(dk||(dk=_(["typeof ",' != "object"'])),t);o=i.null?a:(0,Ze._)(fk||(fk=_(["!"," || ",""])),t,a),delete i.null,delete i.array,delete i.object}else o=Ze.nil;i.number&&delete i.integer;for(let a in i)o=(0,Ze.and)(o,eP(a,t,r,n));return o}s(tP,"checkDataTypes");Tn.checkDataTypes=tP;var mk,hk,bre={message:s(({schema:e})=>"must be ".concat(e),"message"),params:s(({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ze._)(mk||(mk=_(["{type: ","}"])),e):(0,Ze._)(hk||(hk=_(["{type: ","}"])),t),"params")};function rP(e){let t=vre(e);(0,dre.reportError)(t,bre)}s(rP,"reportTypeError");Tn.reportTypeError=rP;function vre(e){let{gen:t,data:r,schema:n}=e,o=(0,yk.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}s(vre,"getTypeErrorContext")});var Pk=W(U0=>{"use strict";d();Object.defineProperty(U0,"__esModule",{value:!0});U0.assignDefaults=void 0;var gf=Xe(),xre=Ot();function Ire(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)vk(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>vk(e,i,o.default))}s(Ire,"assignDefaults");U0.assignDefaults=Ire;var xk,Ik,Sk,Ck;function vk(e,t,r){let{gen:n,compositeRule:o,data:i,opts:a}=e;if(r===void 0)return;let l=(0,gf._)(xk||(xk=_(["","",""])),i,(0,gf.getProperty)(t));if(o){(0,xre.checkStrictMode)(e,"default is ignored for: ".concat(l));return}let c=(0,gf._)(Ik||(Ik=_([""," === undefined"])),l);a.useDefaults==="empty"&&(c=(0,gf._)(Sk||(Sk=_([""," || "," === null || ",' === ""'])),c,l,l)),n.if(c,(0,gf._)(Ck||(Ck=_([""," = ",""])),l,(0,gf.stringify)(r)))}s(vk,"assignDefault")});var ei=W(Ut=>{"use strict";d();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.validateUnion=Ut.validateArray=Ut.usePattern=Ut.callValidateCode=Ut.schemaProperties=Ut.allSchemaProperties=Ut.noPropertyInData=Ut.propertyInData=Ut.isOwnProperty=Ut.hasPropFunc=Ut.reportMissingProp=Ut.checkMissingProp=Ut.checkReportMissingProp=void 0;var rr=Xe(),nP=Ot(),dc=za(),Sre=Ot(),Tk;function Cre(e,t){let{gen:r,data:n,it:o}=e;r.if(iP(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,rr._)(Tk||(Tk=_(["",""])),t)},!0),e.error()})}s(Cre,"checkReportMissingProp");Ut.checkReportMissingProp=Cre;var wk;function Pre({gen:e,data:t,it:{opts:r}},n,o){return(0,rr.or)(...n.map(i=>(0,rr.and)(iP(e,t,i,r.ownProperties),(0,rr._)(wk||(wk=_([""," = ",""])),o,i))))}s(Pre,"checkMissingProp");Ut.checkMissingProp=Pre;function Tre(e,t){e.setParams({missingProperty:t},!0),e.error()}s(Tre,"reportMissingProp");Ut.reportMissingProp=Tre;var Mk;function jk(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,rr._)(Mk||(Mk=_(["Object.prototype.hasOwnProperty"])))})}s(jk,"hasPropFunc");Ut.hasPropFunc=jk;var Ok;function oP(e,t,r){return(0,rr._)(Ok||(Ok=_(["",".call(",", ",")"])),jk(e),t,r)}s(oP,"isOwnProperty");Ut.isOwnProperty=oP;var Ek,_k;function wre(e,t,r,n){let o=(0,rr._)(Ek||(Ek=_(["",""," !== undefined"])),t,(0,rr.getProperty)(r));return n?(0,rr._)(_k||(_k=_([""," && ",""])),o,oP(e,t,r)):o}s(wre,"propertyInData");Ut.propertyInData=wre;var Ak;function iP(e,t,r,n){let o=(0,rr._)(Ak||(Ak=_(["",""," === undefined"])),t,(0,rr.getProperty)(r));return n?(0,rr.or)(o,(0,rr.not)(oP(e,t,r))):o}s(iP,"noPropertyInData");Ut.noPropertyInData=iP;function Gk(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}s(Gk,"allSchemaProperties");Ut.allSchemaProperties=Gk;function Mre(e,t){return Gk(t).filter(r=>!(0,nP.alwaysValidSchema)(e,t[r]))}s(Mre,"schemaProperties");Ut.schemaProperties=Mre;var kk,Dk,Fk,Lk;function Ore({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:a},l,c,p){let f=p?(0,rr._)(kk||(kk=_(["",", ",", ","",""])),e,t,n,o):t,m=[[dc.default.instancePath,(0,rr.strConcat)(dc.default.instancePath,i)],[dc.default.parentData,a.parentData],[dc.default.parentDataProperty,a.parentDataProperty],[dc.default.rootData,dc.default.rootData]];a.opts.dynamicRef&&m.push([dc.default.dynamicAnchors,dc.default.dynamicAnchors]);let y=(0,rr._)(Dk||(Dk=_(["",", ",""])),f,r.object(...m));return c!==rr.nil?(0,rr._)(Fk||(Fk=_(["",".call(",", ",")"])),l,c,y):(0,rr._)(Lk||(Lk=_(["","(",")"])),l,y)}s(Ore,"callValidateCode");Ut.callValidateCode=Ore;var Rk,Ere=(0,rr._)(Rk||(Rk=_(["new RegExp"]))),Nk;function _re({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,rr._)(Nk||(Nk=_(["","(",", ",")"])),o.code==="new RegExp"?Ere:(0,Sre.useFunc)(e,o),r,n)})}s(_re,"usePattern");Ut.usePattern=_re;var Bk;function Are(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let l=t.let("valid",!0);return a(()=>t.assign(l,!1)),l}return t.var(i,!0),a(()=>t.break()),i;function a(l){let c=t.const("len",(0,rr._)(Bk||(Bk=_(["",".length"])),r));t.forRange("i",0,c,p=>{e.subschema({keyword:n,dataProp:p,dataPropType:nP.Type.Num},i),t.if((0,rr.not)(i),l)})}s(a,"validateItems")}s(Are,"validateArray");Ut.validateArray=Are;var $k;function kre(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,nP.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let a=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((c,p)=>{let f=e.subschema({keyword:n,schemaProp:p,compositeRule:!0},l);t.assign(a,(0,rr._)($k||($k=_([""," || ",""])),a,l)),e.mergeValidEvaluated(f,l)||t.if((0,rr.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}s(kre,"validateUnion");Ut.validateUnion=kre});var eD=W(Ds=>{"use strict";d();Object.defineProperty(Ds,"__esModule",{value:!0});Ds.validateKeywordUsage=Ds.validSchemaType=Ds.funcKeywordCode=Ds.macroKeywordCode=void 0;var Hn=Xe(),zu=za(),Dre=ei(),Fre=Ay();function Lre(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:a}=e,l=t.macro.call(a.self,o,i,a),c=Qk(r,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);let p=r.name("valid");e.subschema({schema:l,schemaPath:Hn.nil,errSchemaPath:"".concat(a.errSchemaPath,"/").concat(n),topSchemaRef:c,compositeRule:!0},p),e.pass(p,()=>e.error(!0))}s(Lre,"macroKeywordCode");Ds.macroKeywordCode=Lre;var Vk,zk,Hk,Wk,qk,Zk;function Rre(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:a,$data:l,it:c}=e;Bre(c,t);let p=!l&&t.compile?t.compile.call(c.self,i,a,c):t.validate,f=Qk(n,o,p),m=n.let("valid");e.block$data(m,y),e.ok((r=t.valid)!==null&&r!==void 0?r:m);function y(){if(t.errors===!1)S(),t.modifying&&Uk(e),I(()=>e.error());else{let P=t.async?v():x();t.modifying&&Uk(e),I(()=>Nre(e,P))}}s(y,"validateKeyword");function v(){let P=n.let("ruleErrs",null);return n.try(()=>S((0,Hn._)(Vk||(Vk=_(["await "])))),T=>n.assign(m,!1).if((0,Hn._)(zk||(zk=_([""," instanceof ",""])),T,c.ValidationError),()=>n.assign(P,(0,Hn._)(Hk||(Hk=_(["",".errors"])),T)),()=>n.throw(T))),P}s(v,"validateAsync");function x(){let P=(0,Hn._)(Wk||(Wk=_(["",".errors"])),f);return n.assign(P,null),S(Hn.nil),P}s(x,"validateSync");function S(P=t.async?(0,Hn._)(qk||(qk=_(["await "]))):Hn.nil){let T=c.opts.passContext?zu.default.this:zu.default.self,M=!("compile"in t&&!l||t.schema===!1);n.assign(m,(0,Hn._)(Zk||(Zk=_(["","",""])),P,(0,Dre.callValidateCode)(e,f,T,M)),t.modifying)}s(S,"assignValid");function I(P){var T;n.if((0,Hn.not)((T=t.valid)!==null&&T!==void 0?T:m),P)}s(I,"reportErrs")}s(Rre,"funcKeywordCode");Ds.funcKeywordCode=Rre;var Xk;function Uk(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Hn._)(Xk||(Xk=_(["","[","]"])),n.parentData,n.parentDataProperty)))}s(Uk,"modifyData");var Yk,Kk,Jk;function Nre(e,t){let{gen:r}=e;r.if((0,Hn._)(Yk||(Yk=_(["Array.isArray(",")"])),t),()=>{r.assign(zu.default.vErrors,(0,Hn._)(Kk||(Kk=_([""," === null ? "," : ",".concat(",")"])),zu.default.vErrors,t,zu.default.vErrors,t)).assign(zu.default.errors,(0,Hn._)(Jk||(Jk=_(["",".length"])),zu.default.vErrors)),(0,Fre.extendErrors)(e)},()=>e.error())}s(Nre,"addErrs");function Bre({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}s(Bre,"checkAsyncKeyword");function Qk(e,t,r){if(r===void 0)throw new Error('keyword "'.concat(t,'" failed to compile'));return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Hn.stringify)(r)})}s(Qk,"useKeyword");function $re(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}s($re,"validSchemaType");Ds.validSchemaType=$re;function jre({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let a=o.dependencies;if(a!=null&&a.some(l=>!Object.prototype.hasOwnProperty.call(e,l)))throw new Error("parent schema must have dependencies of ".concat(i,": ").concat(a.join(",")));if(o.validateSchema&&!o.validateSchema(e[i])){let c='keyword "'.concat(i,'" value is invalid at path "').concat(n,'": ')+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}s(jre,"validateKeywordUsage");Ds.validateKeywordUsage=jre});var aD=W(fc=>{"use strict";d();Object.defineProperty(fc,"__esModule",{value:!0});fc.extendSubschemaMode=fc.extendSubschemaData=fc.getSubschema=void 0;var Fs=Xe(),sD=Ot(),tD,rD;function Gre(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let l=e.schema[t];return r===void 0?{schema:l,schemaPath:(0,Fs._)(tD||(tD=_(["","",""])),e.schemaPath,(0,Fs.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:l[r],schemaPath:(0,Fs._)(rD||(rD=_(["","","",""])),e.schemaPath,(0,Fs.getProperty)(t),(0,Fs.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,sD.escapeFragment)(r))}}if(n!==void 0){if(o===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}s(Gre,"getSubschema");fc.getSubschema=Gre;var nD,oD,iD;function Ure(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:a}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=t;if(r!==void 0){let{errorPath:p,dataPathArr:f,opts:m}=t,y=l.let("data",(0,Fs._)(nD||(nD=_(["","",""])),t.data,(0,Fs.getProperty)(r)),!0);c(y),e.errorPath=(0,Fs.str)(oD||(oD=_(["","",""])),p,(0,sD.getErrorPath)(r,n,m.jsPropertySyntax)),e.parentDataProperty=(0,Fs._)(iD||(iD=_(["",""])),r),e.dataPathArr=[...f,e.parentDataProperty]}if(o!==void 0){let p=o instanceof Fs.Name?o:l.let("data",o,!0);c(p),a!==void 0&&(e.propertyName=a)}i&&(e.dataTypes=i);function c(p){e.data=p,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,p]}s(c,"dataContextProps")}s(Ure,"extendSubschemaData");fc.extendSubschemaData=Ure;function Vre(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}s(Vre,"extendSubschemaMode");fc.extendSubschemaMode=Vre});var sP=W((F6e,lD)=>{"use strict";d();lD.exports=s(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var a=i[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},"equal")});var uD=W((N6e,cD)=>{"use strict";d();var mc=cD.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};V0(t,n,o,e,"",e)};mc.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};mc.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};mc.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};mc.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function V0(e,t,r,n,o,i,a,l,c,p){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,a,l,c,p);for(var f in n){var m=n[f];if(Array.isArray(m)){if(f in mc.arrayKeywords)for(var y=0;y<m.length;y++)V0(e,t,r,m[y],o+"/"+f+"/"+y,i,o,f,n,y)}else if(f in mc.propsKeywords){if(m&&typeof m=="object")for(var v in m)V0(e,t,r,m[v],o+"/"+f+"/"+zre(v),i,o,f,n,v)}else(f in mc.keywords||e.allKeys&&!(f in mc.skipKeywords))&&V0(e,t,r,m,o+"/"+f,i,o,f,n)}r(n,o,i,a,l,c,p)}}s(V0,"_traverse");function zre(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}s(zre,"escapeJsonPtr")});var Dy=W(fo=>{"use strict";d();Object.defineProperty(fo,"__esModule",{value:!0});fo.getSchemaRefs=fo.resolveUrl=fo.normalizeId=fo._getFullPath=fo.getFullPath=fo.inlineRef=void 0;var Hre=Ot(),Wre=sP(),qre=uD(),Zre=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Xre(e,t=!0){return typeof e=="boolean"?!0:t===!0?!aP(e):t?pD(e)<=t:!1}s(Xre,"inlineRef");fo.inlineRef=Xre;var Yre=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function aP(e){for(let t in e){if(Yre.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(aP)||typeof r=="object"&&aP(r))return!0}return!1}s(aP,"hasRef");function pD(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Zre.has(r)&&(typeof e[r]=="object"&&(0,Hre.eachItem)(e[r],n=>t+=pD(n)),t===1/0))return 1/0}return t}s(pD,"countKeys");function dD(e,t="",r){r!==!1&&(t=bf(t));let n=e.parse(t);return fD(e,n)}s(dD,"getFullPath");fo.getFullPath=dD;function fD(e,t){return e.serialize(t).split("#")[0]+"#"}s(fD,"_getFullPath");fo._getFullPath=fD;var Kre=/#\/?$/;function bf(e){return e?e.replace(Kre,""):""}s(bf,"normalizeId");fo.normalizeId=bf;function Jre(e,t,r){return r=bf(r),e.resolve(t,r)}s(Jre,"resolveUrl");fo.resolveUrl=Jre;var Qre=/^[a-z_][-a-z0-9._]*$/i;function ene(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=bf(e[r]||t),i={"":o},a=dD(n,o,!1),l={},c=new Set;return qre(e,{allKeys:!0},(m,y,v,x)=>{if(x===void 0)return;let S=a+y,I=i[x];typeof m[r]=="string"&&(I=P.call(this,m[r])),T.call(this,m.$anchor),T.call(this,m.$dynamicAnchor),i[y]=I;function P(M){let w=this.opts.uriResolver.resolve;if(M=bf(I?w(I,M):M),c.has(M))throw f(M);c.add(M);let E=this.refs[M];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?p(m,E.schema,M):M!==bf(S)&&(M[0]==="#"?(p(m,l[M],M),l[M]=m):this.refs[M]=S),M}s(P,"addRef");function T(M){if(typeof M=="string"){if(!Qre.test(M))throw new Error('invalid anchor "'.concat(M,'"'));P.call(this,"#".concat(M))}}s(T,"addAnchor")}),l;function p(m,y,v){if(y!==void 0&&!Wre(m,y))throw f(v)}s(p,"checkAmbiguosRef");function f(m){return new Error('reference "'.concat(m,'" resolves to more than one schema'))}s(f,"ambiguos")}s(ene,"getSchemaRefs");fo.getSchemaRefs=ene});var Ry=W(hc=>{"use strict";d();Object.defineProperty(hc,"__esModule",{value:!0});hc.getData=hc.KeywordCxt=hc.validateFunctionCode=void 0;var nF=FA(),mD=ky(),cP=QC(),z0=ky(),tne=Pk(),Ly=eD(),lP=aD(),we=Xe(),Ge=za(),rne=Dy(),Ha=Ot(),Fy=Ay();function nne(e){if(sF(e)&&(aF(e),iF(e))){sne(e);return}oF(e,()=>(0,nF.topBoolOrEmptySchema)(e))}s(nne,"validateFunctionCode");hc.validateFunctionCode=nne;var bD,vD,xD;function oF({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,we._)(bD||(bD=_(["",", ",""])),Ge.default.data,Ge.default.valCxt),n.$async,()=>{e.code((0,we._)(vD||(vD=_(['"use strict"; ',""])),hD(r,o))),ine(e,o),e.code(i)}):e.func(t,(0,we._)(xD||(xD=_(["",", ",""])),Ge.default.data,one(o)),n.$async,()=>e.code(hD(r,o)).code(i))}s(oF,"validateFunction");var ID,SD;function one(e){return(0,we._)(SD||(SD=_(["{",'="", ',", ",", ","=","","}={}"])),Ge.default.instancePath,Ge.default.parentData,Ge.default.parentDataProperty,Ge.default.rootData,Ge.default.data,e.dynamicRef?(0,we._)(ID||(ID=_([", ","={}"])),Ge.default.dynamicAnchors):we.nil)}s(one,"destructureValCxt");var CD,PD,TD,wD,MD,OD,ED,_D,AD;function ine(e,t){e.if(Ge.default.valCxt,()=>{e.var(Ge.default.instancePath,(0,we._)(CD||(CD=_(["",".",""])),Ge.default.valCxt,Ge.default.instancePath)),e.var(Ge.default.parentData,(0,we._)(PD||(PD=_(["",".",""])),Ge.default.valCxt,Ge.default.parentData)),e.var(Ge.default.parentDataProperty,(0,we._)(TD||(TD=_(["",".",""])),Ge.default.valCxt,Ge.default.parentDataProperty)),e.var(Ge.default.rootData,(0,we._)(wD||(wD=_(["",".",""])),Ge.default.valCxt,Ge.default.rootData)),t.dynamicRef&&e.var(Ge.default.dynamicAnchors,(0,we._)(MD||(MD=_(["",".",""])),Ge.default.valCxt,Ge.default.dynamicAnchors))},()=>{e.var(Ge.default.instancePath,(0,we._)(OD||(OD=_(['""'])))),e.var(Ge.default.parentData,(0,we._)(ED||(ED=_(["undefined"])))),e.var(Ge.default.parentDataProperty,(0,we._)(_D||(_D=_(["undefined"])))),e.var(Ge.default.rootData,Ge.default.data),t.dynamicRef&&e.var(Ge.default.dynamicAnchors,(0,we._)(AD||(AD=_(["{}"]))))})}s(ine,"destructureValCxtES5");function sne(e){let{schema:t,opts:r,gen:n}=e;oF(e,()=>{r.$comment&&t.$comment&&cF(e),pne(e),n.let(Ge.default.vErrors,null),n.let(Ge.default.errors,0),r.unevaluated&&ane(e),lF(e),mne(e)})}s(sne,"topSchemaObjCode");var kD,DD,FD,LD,RD,ND,BD;function ane(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,we._)(kD||(kD=_(["",".evaluated"])),r)),t.if((0,we._)(DD||(DD=_(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,we._)(FD||(FD=_(["",".props"])),e.evaluated),(0,we._)(LD||(LD=_(["undefined"]))))),t.if((0,we._)(RD||(RD=_(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,we._)(ND||(ND=_(["",".items"])),e.evaluated),(0,we._)(BD||(BD=_(["undefined"])))))}s(ane,"resetEvaluated");var $D;function hD(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,we._)($D||($D=_(["/*# sourceURL="," */"])),r):we.nil}s(hD,"funcSourceUrl");function lne(e,t){if(sF(e)&&(aF(e),iF(e))){cne(e,t);return}(0,nF.boolOrEmptySchema)(e,t)}s(lne,"subschemaCode");function iF({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}s(iF,"schemaCxtHasRules");function sF(e){return typeof e.schema!="boolean"}s(sF,"isSchemaObj");var jD;function cne(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&cF(e),dne(e),fne(e);let i=n.const("_errs",Ge.default.errors);lF(e,i),n.var(t,(0,we._)(jD||(jD=_([""," === ",""])),i,Ge.default.errors))}s(cne,"subSchemaObjCode");function aF(e){(0,Ha.checkUnknownRules)(e),une(e)}s(aF,"checkKeywords");function lF(e,t){if(e.opts.jtd)return yD(e,[],!1,t);let r=(0,mD.getSchemaTypes)(e.schema),n=(0,mD.coerceAndCheckDataType)(e,r);yD(e,r,!n,t)}s(lF,"typeAndKeywords");function une(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ha.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}s(une,"checkRefsAndKeywords");function pne(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ha.checkStrictMode)(e,"default is ignored in the schema root")}s(pne,"checkNoDefault");function dne(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,rne.resolveUrl)(e.opts.uriResolver,e.baseId,t))}s(dne,"updateContext");function fne(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}s(fne,"checkAsyncSchema");var GD,UD,VD;function cF({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,we._)(GD||(GD=_(["",".logger.log(",")"])),Ge.default.self,i));else if(typeof o.$comment=="function"){let a=(0,we.str)(UD||(UD=_(["","/$comment"])),n),l=e.scopeValue("root",{ref:t.root});e.code((0,we._)(VD||(VD=_(["",".opts.$comment(",", ",", ",".schema)"])),Ge.default.self,i,a,l))}}s(cF,"commentKeyword");var zD,HD,WD,qD;function mne(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,we._)(zD||(zD=_([""," === 0"])),Ge.default.errors),()=>t.return(Ge.default.data),()=>t.throw((0,we._)(HD||(HD=_(["new ","(",")"])),o,Ge.default.vErrors))):(t.assign((0,we._)(WD||(WD=_(["",".errors"])),n),Ge.default.vErrors),i.unevaluated&&hne(e),t.return((0,we._)(qD||(qD=_([""," === 0"])),Ge.default.errors)))}s(mne,"returnResults");var ZD,XD;function hne({gen:e,evaluated:t,props:r,items:n}){r instanceof we.Name&&e.assign((0,we._)(ZD||(ZD=_(["",".props"])),t),r),n instanceof we.Name&&e.assign((0,we._)(XD||(XD=_(["",".items"])),t),n)}s(hne,"assignEvaluated");var YD;function yD(e,t,r,n){let{gen:o,schema:i,data:a,allErrors:l,opts:c,self:p}=e,{RULES:f}=p;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Ha.schemaHasRulesButRef)(i,f))){o.block(()=>pF(e,"$ref",f.all.$ref.definition));return}c.jtd||yne(e,t),o.block(()=>{for(let y of f.rules)m(y);m(f.post)});function m(y){(0,cP.shouldUseGroup)(i,y)&&(y.type?(o.if((0,z0.checkDataType)(y.type,a,c.strictNumbers)),gD(e,y),t.length===1&&t[0]===y.type&&r&&(o.else(),(0,z0.reportTypeError)(e)),o.endIf()):gD(e,y),l||o.if((0,we._)(YD||(YD=_([""," === ",""])),Ge.default.errors,n||0)))}s(m,"groupKeywords")}s(yD,"schemaKeywords");function gD(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,tne.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,cP.shouldUseRule)(n,i)&&pF(e,i.keyword,i.definition,t.type)})}s(gD,"iterateKeywords");function yne(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(gne(e,t),e.opts.allowUnionTypes||bne(e,t),vne(e,e.dataTypes))}s(yne,"checkStrictTypes");function gne(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{uF(e.dataTypes,r)||uP(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),Ine(e,t)}}s(gne,"checkContextTypes");function bne(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&uP(e,"use allowUnionTypes to allow union type keyword")}s(bne,"checkMultipleTypes");function vne(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,cP.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(a=>xne(t,a))&&uP(e,'missing type "'.concat(i.join(","),'" for keyword "').concat(n,'"'))}}}s(vne,"checkKeywordTypes");function xne(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}s(xne,"hasApplicableType");function uF(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}s(uF,"includesType");function Ine(e,t){let r=[];for(let n of e.dataTypes)uF(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}s(Ine,"narrowSchemaTypes");function uP(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,Ha.checkStrictMode)(e,t,e.opts.strictTypes)}s(uP,"strictTypesError");var KD,JD,QD,eF,pP=class pP{constructor(t,r,n){if((0,Ly.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ha.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",dF(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ly.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error("".concat(n," value must be ").concat(JSON.stringify(r.schemaType)));("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",Ge.default.errors))}result(t,r,n){this.failResult((0,we.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,we.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,we._)(KD||(KD=_([""," !== undefined && (",")"])),r,(0,we.or)(this.invalid$data(),t)))}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Fy.reportExtraError:Fy.reportError)(this,this.def.error,r)}$dataError(){(0,Fy.reportError)(this,this.def.$dataError||Fy.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Fy.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=we.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=we.nil,r=we.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:a}=this;n.if((0,we.or)((0,we._)(JD||(JD=_([""," === undefined"])),o),r)),t!==we.nil&&n.assign(t,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==we.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,we.or)(a(),l());function a(){if(n.length){if(!(r instanceof we.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,we._)(QD||(QD=_(["",""])),(0,z0.checkDataTypes)(c,r,i.opts.strictNumbers,z0.DataType.Wrong))}return we.nil}function l(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,we._)(eF||(eF=_(["!","(",")"])),c,r)}return we.nil}}subschema(t,r){let n=(0,lP.getSubschema)(this.it,t);(0,lP.extendSubschemaData)(n,this.it,t),(0,lP.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return lne(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ha.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ha.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,we.Name)),!0}};s(pP,"KeywordCxt");var H0=pP;hc.KeywordCxt=H0;function pF(e,t,r,n){let o=new H0(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,Ly.funcKeywordCode)(o,r):"macro"in r?(0,Ly.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,Ly.funcKeywordCode)(o,r)}s(pF,"keywordCode");var Sne=/^\/(?:[^~]|~0|~1)*$/,Cne=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,tF,rF;function dF(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return Ge.default.rootData;if(e[0]==="/"){if(!Sne.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));o=e,i=Ge.default.rootData}else{let p=Cne.exec(e);if(!p)throw new Error("Invalid JSON-pointer: ".concat(e));let f=+p[1];if(o=p[2],o==="#"){if(f>=t)throw new Error(c("property/index",f));return n[t-f]}if(f>t)throw new Error(c("data",f));if(i=r[t-f],!o)return i}let a=i,l=o.split("/");for(let p of l)p&&(i=(0,we._)(tF||(tF=_(["","",""])),i,(0,we.getProperty)((0,Ha.unescapeJsonPointer)(p))),a=(0,we._)(rF||(rF=_([""," && ",""])),a,i));return a;function c(p,f){return"Cannot access ".concat(p," ").concat(f," levels up, current level is ").concat(t)}}s(dF,"getData");hc.getData=dF});var W0=W(fP=>{"use strict";d();Object.defineProperty(fP,"__esModule",{value:!0});var mP=class mP extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};s(mP,"ValidationError");var dP=mP;fP.default=dP});var Ny=W(gP=>{"use strict";d();Object.defineProperty(gP,"__esModule",{value:!0});var hP=Dy(),bP=class bP extends Error{constructor(t,r,n,o){super(o||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,hP.resolveUrl)(t,r,n),this.missingSchema=(0,hP.normalizeId)((0,hP.getFullPath)(t,this.missingRef))}};s(bP,"MissingRefError");var yP=bP;gP.default=yP});var Z0=W(ti=>{"use strict";d();Object.defineProperty(ti,"__esModule",{value:!0});ti.resolveSchema=ti.getCompilingSchema=ti.resolveRef=ti.compileSchema=ti.SchemaEnv=void 0;var Bi=Xe(),Pne=W0(),Hu=za(),$i=Dy(),fF=Ot(),Tne=Ry(),IP=class IP{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,$i.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};s(IP,"SchemaEnv");var vf=IP;ti.SchemaEnv=vf;var mF,hF;function xP(e){let t=yF.call(this,e);if(t)return t;let r=(0,$i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,a=new Bi.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),l;e.$async&&(l=a.scopeValue("Error",{ref:Pne.default,code:(0,Bi._)(mF||(mF=_(['require("ajv/dist/runtime/validation_error").default'])))}));let c=a.scopeName("validate");e.validateName=c;let p={gen:a,allErrors:this.opts.allErrors,data:Hu.default.data,parentData:Hu.default.parentData,parentDataProperty:Hu.default.parentDataProperty,dataNames:[Hu.default.data],dataPathArr:[Bi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Bi.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:l,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Bi.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Bi._)(hF||(hF=_(['""']))),opts:this.opts,self:this},f;try{this._compilations.add(e),(0,Tne.validateFunctionCode)(p),a.optimize(this.opts.code.optimize);let m=a.toString();f="".concat(a.scopeRefs(Hu.default.scope),"return ").concat(m),this.opts.code.process&&(f=this.opts.code.process(f,e));let v=new Function("".concat(Hu.default.self),"".concat(Hu.default.scope),f)(this,this.scope.get());if(this.scope.value(c,{ref:v}),v.errors=null,v.schema=e.schema,v.schemaEnv=e,e.$async&&(v.$async=!0),this.opts.code.source===!0&&(v.source={validateName:c,validateCode:m,scopeValues:a._values}),this.opts.unevaluated){let{props:x,items:S}=p;v.evaluated={props:x instanceof Bi.Name?void 0:x,items:S instanceof Bi.Name?void 0:S,dynamicProps:x instanceof Bi.Name,dynamicItems:S instanceof Bi.Name},v.source&&(v.source.evaluated=(0,Bi.stringify)(v.evaluated))}return e.validate=v,e}catch(m){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),m}finally{this._compilations.delete(e)}}s(xP,"compileSchema");ti.compileSchema=xP;function wne(e,t,r){var n;r=(0,$i.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=Ene.call(this,e,r);if(i===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;a&&(i=new vf({schema:a,schemaId:l,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Mne.call(this,i)}s(wne,"resolveRef");ti.resolveRef=wne;function Mne(e){return(0,$i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:xP.call(this,e)}s(Mne,"inlineOrCompile");function yF(e){for(let t of this._compilations)if(One(t,e))return t}s(yF,"getCompilingSchema");ti.getCompilingSchema=yF;function One(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}s(One,"sameSchemaEnv");function Ene(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||q0.call(this,e,t)}s(Ene,"resolve");function q0(e,t){let r=this.opts.uriResolver.parse(t),n=(0,$i._getFullPath)(this.opts.uriResolver,r),o=(0,$i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return vP.call(this,r,e);let i=(0,$i.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let l=q0.call(this,e,a);return typeof(l==null?void 0:l.schema)!="object"?void 0:vP.call(this,r,l)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||xP.call(this,a),i===(0,$i.normalizeId)(t)){let{schema:l}=a,{schemaId:c}=this.opts,p=l[c];return p&&(o=(0,$i.resolveUrl)(this.opts.uriResolver,o,p)),new vf({schema:l,schemaId:c,root:e,baseId:o})}return vP.call(this,r,a)}}s(q0,"resolveSchema");ti.resolveSchema=q0;var _ne=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function vP(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let l of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,fF.unescapeFragment)(l)];if(c===void 0)return;r=c;let p=typeof r=="object"&&r[this.opts.schemaId];!_ne.has(l)&&p&&(t=(0,$i.resolveUrl)(this.opts.uriResolver,t,p))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,fF.schemaHasRulesButRef)(r,this.RULES)){let l=(0,$i.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=q0.call(this,n,l)}let{schemaId:a}=this.opts;if(i=i||new vf({schema:r,schemaId:a,root:n,baseId:t}),i.schema!==i.root.schema)return i}s(vP,"getJsonPointer")});var gF=W((t9e,Ane)=>{Ane.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var vF=W((r9e,bF)=>{"use strict";d();var kne={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};bF.exports={HEX:kne}});var MF=W((o9e,wF)=>{"use strict";d();var{HEX:Dne}=vF(),Fne=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function CF(e){if(TF(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(Fne)||[],[r]=t;return r?{host:Rne(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}s(CF,"normalizeIPv4");function SP(e,t=!1){let r="",n=!0;for(let o of e){if(Dne[o]===void 0)return;o!=="0"&&n===!0&&(n=!1),n||(r+=o)}return t&&r.length===0&&(r="0"),r}s(SP,"stringArrayToHexStripped");function Lne(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,a=!1,l=!1;function c(){if(o.length){if(i===!1){let p=SP(o);if(p!==void 0)n.push(p);else return r.error=!0,!1}o.length=0}return!0}s(c,"consume");for(let p=0;p<e.length;p++){let f=e[p];if(!(f==="["||f==="]"))if(f===":"){if(a===!0&&(l=!0),!c())break;if(t++,n.push(":"),t>7){r.error=!0;break}p-1>=0&&e[p-1]===":"&&(a=!0);continue}else if(f==="%"){if(!c())break;i=!0}else{o.push(f);continue}}return o.length&&(i?r.zone=o.join(""):l?n.push(o.join("")):n.push(SP(o))),r.address=n.join(""),r}s(Lne,"getIPV6");function PF(e){if(TF(e,":")<2)return{host:e,isIPV6:!1};let t=Lne(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,escapedHost:n,isIPV6:!0}}}s(PF,"normalizeIPv6");function Rne(e,t){let r="",n=!0,o=e.length;for(let i=0;i<o;i++){let a=e[i];a==="0"&&n?(i+1<=o&&e[i+1]===t||i+1===o)&&(r+=a,n=!1):(a===t?n=!0:n=!1,r+=a)}return r}s(Rne,"stripLeadingZeros");function TF(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}s(TF,"findToken");var xF=/^\.\.?\//u,IF=/^\/\.(?:\/|$)/u,SF=/^\/\.\.(?:\/|$)/u,Nne=/^\/?(?:.|\n)*?(?=\/|$)/u;function Bne(e){let t=[];for(;e.length;)if(e.match(xF))e=e.replace(xF,"");else if(e.match(IF))e=e.replace(IF,"/");else if(e.match(SF))e=e.replace(SF,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(Nne);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}s(Bne,"removeDotSegments");function $ne(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}s($ne,"normalizeComponentEncoding");function jne(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=CF(r);if(n.isIPV4)r=n.host;else{let o=PF(n.host);o.isIPV6===!0?r="[".concat(o.escapedHost,"]"):r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}s(jne,"recomposeAuthority");wF.exports={recomposeAuthority:jne,normalizeComponentEncoding:$ne,removeDotSegments:Bne,normalizeIPv4:CF,normalizeIPv6:PF,stringArrayToHexStripped:SP}});var DF=W((a9e,kF)=>{"use strict";d();var Gne=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,Une=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function OF(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}s(OF,"isSecure");function EF(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}s(EF,"httpParse");function _F(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}s(_F,"httpSerialize");function Vne(e){return e.secure=OF(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}s(Vne,"wsParse");function zne(e){if((e.port===(OF(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}s(zne,"wsSerialize");function Hne(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Une);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o="".concat(n,":").concat(t.nid||e.nid),i=CP[o];e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}s(Hne,"urnParse");function Wne(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o="".concat(r,":").concat(t.nid||n),i=CP[o];i&&(e=i.serialize(e,t));let a=e,l=e.nss;return a.path="".concat(n||t.nid,":").concat(l),t.skipEscape=!0,a}s(Wne,"urnSerialize");function qne(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Gne.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}s(qne,"urnuuidParse");function Zne(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}s(Zne,"urnuuidSerialize");var AF={scheme:"http",domainHost:!0,parse:EF,serialize:_F},Xne={scheme:"https",domainHost:AF.domainHost,parse:EF,serialize:_F},X0={scheme:"ws",domainHost:!0,parse:Vne,serialize:zne},Yne={scheme:"wss",domainHost:X0.domainHost,parse:X0.parse,serialize:X0.serialize},Kne={scheme:"urn",parse:Hne,serialize:Wne,skipNormalize:!0},Jne={scheme:"urn:uuid",parse:qne,serialize:Zne,skipNormalize:!0},CP={http:AF,https:Xne,ws:X0,wss:Yne,urn:Kne,"urn:uuid":Jne};kF.exports=CP});var LF=W((u9e,K0)=>{"use strict";d();var{normalizeIPv6:Qne,normalizeIPv4:eoe,removeDotSegments:By,recomposeAuthority:toe,normalizeComponentEncoding:Y0}=MF(),PP=DF();function roe(e,t){return typeof e=="string"?e=Ls(Wa(e,t),t):typeof e=="object"&&(e=Wa(Ls(e,t),t)),e}s(roe,"normalize");function noe(e,t,r){let n=Object.assign({scheme:"null"},r),o=FF(Wa(e,n),Wa(t,n),n,!0);return Ls(o,{...n,skipEscape:!0})}s(noe,"resolve");function FF(e,t,r,n){let o={};return n||(e=Wa(Ls(e,r),r),t=Wa(Ls(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=By(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=By(t.path||""),o.query=t.query):(t.path?(t.path.charAt(0)==="/"?o.path=By(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=By(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}s(FF,"resolveComponents");function ooe(e,t,r){return typeof e=="string"?(e=unescape(e),e=Ls(Y0(Wa(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Ls(Y0(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Ls(Y0(Wa(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Ls(Y0(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}s(ooe,"equal");function Ls(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=PP[(n.scheme||r.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let a=toe(r);if(a!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(a),r.path&&r.path.charAt(0)!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(l=By(l)),a===void 0&&(l=l.replace(/^\/\//u,"/%2F")),o.push(l)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}s(Ls,"serialize");var ioe=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function soe(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||ioe[t])return!0;return!1}s(soe,"nonSimpleDomain");var aoe=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Wa(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=e.indexOf("%")!==-1,i=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let a=e.match(aoe);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host){let c=eoe(n.host);if(c.isIPV4===!1){let p=Qne(c.host);n.host=p.host.toLowerCase(),i=p.isIPV6}else n.host=c.host,i=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let l=PP[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&n.host&&(r.domainHost||l&&l.domainHost)&&i===!1&&soe(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!l||l&&!l.skipNormalize)&&(o&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),o&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),l&&l.parse&&l.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}s(Wa,"parse");var TP={SCHEMES:PP,normalize:roe,resolve:noe,resolveComponents:FF,equal:ooe,serialize:Ls,parse:Wa};K0.exports=TP;K0.exports.default=TP;K0.exports.fastUri=TP});var NF=W(wP=>{"use strict";d();Object.defineProperty(wP,"__esModule",{value:!0});var RF=LF();RF.code='require("ajv/dist/runtime/uri").default';wP.default=RF});var HF=W(sn=>{"use strict";d();Object.defineProperty(sn,"__esModule",{value:!0});sn.CodeGen=sn.Name=sn.nil=sn.stringify=sn.str=sn._=sn.KeywordCxt=void 0;var loe=Ry();Object.defineProperty(sn,"KeywordCxt",{enumerable:!0,get:s(function(){return loe.KeywordCxt},"get")});var xf=Xe();Object.defineProperty(sn,"_",{enumerable:!0,get:s(function(){return xf._},"get")});Object.defineProperty(sn,"str",{enumerable:!0,get:s(function(){return xf.str},"get")});Object.defineProperty(sn,"stringify",{enumerable:!0,get:s(function(){return xf.stringify},"get")});Object.defineProperty(sn,"nil",{enumerable:!0,get:s(function(){return xf.nil},"get")});Object.defineProperty(sn,"Name",{enumerable:!0,get:s(function(){return xf.Name},"get")});Object.defineProperty(sn,"CodeGen",{enumerable:!0,get:s(function(){return xf.CodeGen},"get")});var coe=W0(),UF=Ny(),uoe=JC(),$y=Z0(),poe=Xe(),jy=Dy(),J0=ky(),OP=Ot(),BF=gF(),doe=NF(),VF=s((e,t)=>new RegExp(e,t),"defaultRegExp");VF.code="new RegExp";var foe=["removeAdditional","useDefaults","coerceTypes"],moe=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),hoe={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},yoe={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},$F=200;function goe(e){var t,r,n,o,i,a,l,c,p,f,m,y,v,x,S,I,P,T,M,w,E,B,D,F,L;let H=e.strict,U=(t=e.code)===null||t===void 0?void 0:t.optimize,G=U===!0||U===void 0?1:U||0,J=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:VF,X=(o=e.uriResolver)!==null&&o!==void 0?o:doe.default;return{strictSchema:(a=(i=e.strictSchema)!==null&&i!==void 0?i:H)!==null&&a!==void 0?a:!0,strictNumbers:(c=(l=e.strictNumbers)!==null&&l!==void 0?l:H)!==null&&c!==void 0?c:!0,strictTypes:(f=(p=e.strictTypes)!==null&&p!==void 0?p:H)!==null&&f!==void 0?f:"log",strictTuples:(y=(m=e.strictTuples)!==null&&m!==void 0?m:H)!==null&&y!==void 0?y:"log",strictRequired:(x=(v=e.strictRequired)!==null&&v!==void 0?v:H)!==null&&x!==void 0?x:!1,code:e.code?{...e.code,optimize:G,regExp:J}:{optimize:G,regExp:J},loopRequired:(S=e.loopRequired)!==null&&S!==void 0?S:$F,loopEnum:(I=e.loopEnum)!==null&&I!==void 0?I:$F,meta:(P=e.meta)!==null&&P!==void 0?P:!0,messages:(T=e.messages)!==null&&T!==void 0?T:!0,inlineRefs:(M=e.inlineRefs)!==null&&M!==void 0?M:!0,schemaId:(w=e.schemaId)!==null&&w!==void 0?w:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(B=e.validateSchema)!==null&&B!==void 0?B:!0,validateFormats:(D=e.validateFormats)!==null&&D!==void 0?D:!0,unicodeRegExp:(F=e.unicodeRegExp)!==null&&F!==void 0?F:!0,int32range:(L=e.int32range)!==null&&L!==void 0?L:!0,uriResolver:X}}s(goe,"requiredOptions");var EP=class EP{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...goe(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new poe.ValueScope({scope:{},prefixes:moe,es5:r,lines:n}),this.logger=Coe(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,uoe.getRules)(),jF.call(this,hoe,t,"NOT SUPPORTED"),jF.call(this,yoe,t,"DEPRECATED","warn"),this._metaOpts=Ioe.call(this),t.formats&&voe.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&xoe.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),boe.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=BF;n==="id"&&(o={...BF},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'.concat(t,'"'))}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(f,m){await i.call(this,f.$schema);let y=this._addSchema(f,m);return y.validate||a.call(this,y)}async function i(f){f&&!this.getSchema(f)&&await o.call(this,{$ref:f},!0)}async function a(f){try{return this._compileSchemaEnv(f)}catch(m){if(!(m instanceof UF.default))throw m;return l.call(this,m),await c.call(this,m.missingSchema),a.call(this,f)}}function l({missingSchema:f,missingRef:m}){if(this.refs[f])throw new Error("AnySchema ".concat(f," is loaded but ").concat(m," cannot be resolved"))}async function c(f){let m=await p.call(this,f);this.refs[f]||await i.call(this,m.$schema),this.refs[f]||this.addSchema(m,f,r)}async function p(f){let m=this._loading[f];if(m)return m;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:a}=this.opts;if(i=t[a],i!==void 0&&typeof i!="string")throw new Error("schema ".concat(a," must be string"))}return r=(0,jy.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=GF.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new $y.SchemaEnv({schema:{},schemaId:n});if(r=$y.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=GF.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,jy.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Toe.call(this,n,r),!r)return(0,OP.eachItem)(n,i=>MP.call(this,i)),this;Moe.call(this,r);let o={...r,type:(0,J0.getJSONTypes)(r.type),schemaType:(0,J0.getJSONTypes)(r.schemaType)};return(0,OP.eachItem)(n,o.type.length===0?i=>MP.call(this,i,o):i=>o.type.forEach(a=>MP.call(this,i,o,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>"".concat(n).concat(o.instancePath," ").concat(o.message)).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),a=t;for(let l of i)a=a[l];for(let l in n){let c=n[l];if(typeof c!="object")continue;let{$data:p}=c.definition,f=a[l];p&&f&&(a[l]=zF(f))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:l}=this.opts;if(typeof t=="object")a=t[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,jy.normalizeId)(a||n);let p=jy.getSchemaRefs.call(this,t,n);return c=new $y.SchemaEnv({schema:t,schemaId:l,meta:r,baseId:n,localRefs:p}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error('schema with key or id "'.concat(t,'" already exists'))}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):$y.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{$y.compileSchema.call(this,t)}finally{this.opts=r}}};s(EP,"Ajv");var Gy=EP;Gy.ValidationError=coe.default;Gy.MissingRefError=UF.default;sn.default=Gy;function jF(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n]("".concat(r,": option ").concat(o,". ").concat(e[i]))}}s(jF,"checkOptions");function GF(e){return e=(0,jy.normalizeId)(e),this.schemas[e]||this.refs[e]}s(GF,"getSchEnv");function boe(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}s(boe,"addInitialSchemas");function voe(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}s(voe,"addInitialFormats");function xoe(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}s(xoe,"addInitialKeywords");function Ioe(){let e={...this.opts};for(let t of foe)delete e[t];return e}s(Ioe,"getMetaSchemaOptions");var Soe={log(){},warn(){},error(){}};function Coe(e){if(e===!1)return Soe;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}s(Coe,"getLogger");var Poe=/^[a-z_$][a-z0-9_$:-]*$/i;function Toe(e,t){let{RULES:r}=this;if((0,OP.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!Poe.test(n))throw new Error("Keyword ".concat(n," has invalid name"))}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}s(Toe,"checkKeyword");function MP(e,t,r){var n;let o=t==null?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,a=o?i.post:i.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},i.rules.push(a)),i.keywords[e]=!0,!t)return;let l={keyword:e,definition:{...t,type:(0,J0.getJSONTypes)(t.type),schemaType:(0,J0.getJSONTypes)(t.schemaType)}};t.before?woe.call(this,a,l,t.before):a.rules.push(l),i.all[e]=l,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}s(MP,"addRule");function woe(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn("rule ".concat(r," is not defined")))}s(woe,"addBeforeRule");function Moe(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=zF(t)),e.validateSchema=this.compile(t,!0))}s(Moe,"keywordMetaschema");var Ooe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function zF(e){return{anyOf:[e,Ooe]}}s(zF,"schemaOrData")});var WF=W(_P=>{"use strict";d();Object.defineProperty(_P,"__esModule",{value:!0});var Eoe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};_P.default=Eoe});var iL=W(Wu=>{"use strict";d();Object.defineProperty(Wu,"__esModule",{value:!0});Wu.callRef=Wu.getValidate=void 0;var _oe=Ny(),qF=ei(),mo=Xe(),If=za(),ZF=Z0(),Q0=Ot(),XF,Aoe={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:a,opts:l,self:c}=n,{root:p}=i;if((r==="#"||r==="#/")&&o===p.baseId)return m();let f=ZF.resolveRef.call(c,p,o,r);if(f===void 0)throw new _oe.default(n.opts.uriResolver,o,r);if(f instanceof ZF.SchemaEnv)return y(f);return v(f);function m(){if(i===p)return ev(e,a,i,i.$async);let x=t.scopeValue("root",{ref:p});return ev(e,(0,mo._)(XF||(XF=_(["",".validate"])),x),p,p.$async)}function y(x){let S=oL(e,x);ev(e,S,x,x.$async)}function v(x){let S=t.scopeValue("schema",l.code.source===!0?{ref:x,code:(0,mo.stringify)(x)}:{ref:x}),I=t.name("valid"),P=e.subschema({schema:x,dataTypes:[],schemaPath:mo.nil,topSchemaRef:S,errSchemaPath:r},I);e.mergeEvaluated(P),e.ok(I)}}},YF;function oL(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,mo._)(YF||(YF=_(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}s(oL,"getValidate");Wu.getValidate=oL;var KF,JF,QF,eL,tL,rL,nL;function ev(e,t,r,n){let{gen:o,it:i}=e,{allErrors:a,schemaEnv:l,opts:c}=i,p=c.passContext?If.default.this:mo.nil;n?f():m();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");let x=o.let("valid");o.try(()=>{o.code((0,mo._)(KF||(KF=_(["await ",""])),(0,qF.callValidateCode)(e,t,p))),v(t),a||o.assign(x,!0)},S=>{o.if((0,mo._)(JF||(JF=_(["!("," instanceof ",")"])),S,i.ValidationError),()=>o.throw(S)),y(S),a||o.assign(x,!1)}),e.ok(x)}s(f,"callAsyncRef");function m(){e.result((0,qF.callValidateCode)(e,t,p),()=>v(t),()=>y(t))}s(m,"callSyncRef");function y(x){let S=(0,mo._)(QF||(QF=_(["",".errors"])),x);o.assign(If.default.vErrors,(0,mo._)(eL||(eL=_([""," === null ? "," : ",".concat(",")"])),If.default.vErrors,S,If.default.vErrors,S)),o.assign(If.default.errors,(0,mo._)(tL||(tL=_(["",".length"])),If.default.vErrors))}s(y,"addErrorsFrom");function v(x){var S;if(!i.opts.unevaluated)return;let I=(S=r==null?void 0:r.validate)===null||S===void 0?void 0:S.evaluated;if(i.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(i.props=Q0.mergeEvaluated.props(o,I.props,i.props));else{let P=o.var("props",(0,mo._)(rL||(rL=_(["",".evaluated.props"])),x));i.props=Q0.mergeEvaluated.props(o,P,i.props,mo.Name)}if(i.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(i.items=Q0.mergeEvaluated.items(o,I.items,i.items));else{let P=o.var("items",(0,mo._)(nL||(nL=_(["",".evaluated.items"])),x));i.items=Q0.mergeEvaluated.items(o,P,i.items,mo.Name)}}s(v,"addEvaluatedFrom")}s(ev,"callRef");Wu.callRef=ev;Wu.default=Aoe});var sL=W(AP=>{"use strict";d();Object.defineProperty(AP,"__esModule",{value:!0});var koe=WF(),Doe=iL(),Foe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",koe.default,Doe.default];AP.default=Foe});var uL=W(kP=>{"use strict";d();Object.defineProperty(kP,"__esModule",{value:!0});var tv=Xe(),yc=tv.operators,rv={maximum:{okStr:"<=",ok:yc.LTE,fail:yc.GT},minimum:{okStr:">=",ok:yc.GTE,fail:yc.LT},exclusiveMaximum:{okStr:"<",ok:yc.LT,fail:yc.GTE},exclusiveMinimum:{okStr:">",ok:yc.GT,fail:yc.LTE}},aL,lL,Loe={message:s(({keyword:e,schemaCode:t})=>(0,tv.str)(aL||(aL=_(["must be "," ",""])),rv[e].okStr,t),"message"),params:s(({keyword:e,schemaCode:t})=>(0,tv._)(lL||(lL=_(["{comparison: ",", limit: ","}"])),rv[e].okStr,t),"params")},cL,Roe={keyword:Object.keys(rv),type:"number",schemaType:"number",$data:!0,error:Loe,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,tv._)(cL||(cL=_([""," "," "," || isNaN(",")"])),r,rv[t].fail,n,r))}};kP.default=Roe});var yL=W(DP=>{"use strict";d();Object.defineProperty(DP,"__esModule",{value:!0});var Uy=Xe(),pL,dL,Noe={message:s(({schemaCode:e})=>(0,Uy.str)(pL||(pL=_(["must be multiple of ",""])),e),"message"),params:s(({schemaCode:e})=>(0,Uy._)(dL||(dL=_(["{multipleOf: ","}"])),e),"params")},fL,mL,hL,Boe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Noe,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,a=t.let("res"),l=i?(0,Uy._)(fL||(fL=_(["Math.abs(Math.round(",") - ",") > 1e-",""])),a,a,i):(0,Uy._)(mL||(mL=_([""," !== parseInt(",")"])),a,a);e.fail$data((0,Uy._)(hL||(hL=_(["("," === 0 || ("," = ","/",", ","))"])),n,a,r,n,l))}};DP.default=Boe});var bL=W(FP=>{"use strict";d();Object.defineProperty(FP,"__esModule",{value:!0});function gL(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}s(gL,"ucs2length");FP.default=gL;gL.code='require("ajv/dist/runtime/ucs2length").default'});var PL=W(LP=>{"use strict";d();Object.defineProperty(LP,"__esModule",{value:!0});var qu=Xe(),$oe=Ot(),joe=bL(),vL,xL,Goe={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,qu.str)(vL||(vL=_(["must NOT have "," than "," characters"])),r,t)},params:s(({schemaCode:e})=>(0,qu._)(xL||(xL=_(["{limit: ","}"])),e),"params")},IL,SL,CL,Uoe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Goe,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?qu.operators.GT:qu.operators.LT,a=o.opts.unicode===!1?(0,qu._)(IL||(IL=_(["",".length"])),r):(0,qu._)(SL||(SL=_(["","(",")"])),(0,$oe.useFunc)(e.gen,joe.default),r);e.fail$data((0,qu._)(CL||(CL=_([""," "," ",""])),a,i,n))}};LP.default=Uoe});var EL=W(RP=>{"use strict";d();Object.defineProperty(RP,"__esModule",{value:!0});var Voe=ei(),nv=Xe(),TL,wL,zoe={message:s(({schemaCode:e})=>(0,nv.str)(TL||(TL=_(['must match pattern "','"'])),e),"message"),params:s(({schemaCode:e})=>(0,nv._)(wL||(wL=_(["{pattern: ","}"])),e),"params")},ML,OL,Hoe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:zoe,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,a=i.opts.unicodeRegExp?"u":"",l=r?(0,nv._)(ML||(ML=_(["(new RegExp(",", ","))"])),o,a):(0,Voe.usePattern)(e,n);e.fail$data((0,nv._)(OL||(OL=_(["!",".test(",")"])),l,t))}};RP.default=Hoe});var DL=W(NP=>{"use strict";d();Object.defineProperty(NP,"__esModule",{value:!0});var Vy=Xe(),_L,AL,Woe={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Vy.str)(_L||(_L=_(["must NOT have "," than "," properties"])),r,t)},params:s(({schemaCode:e})=>(0,Vy._)(AL||(AL=_(["{limit: ","}"])),e),"params")},kL,qoe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Woe,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Vy.operators.GT:Vy.operators.LT;e.fail$data((0,Vy._)(kL||(kL=_(["Object.keys(",").length "," ",""])),r,o,n))}};NP.default=qoe});var RL=W(BP=>{"use strict";d();Object.defineProperty(BP,"__esModule",{value:!0});var zy=ei(),Hy=Xe(),Zoe=Ot(),FL,LL,Xoe={message:s(({params:{missingProperty:e}})=>(0,Hy.str)(FL||(FL=_(["must have required property '","'"])),e),"message"),params:s(({params:{missingProperty:e}})=>(0,Hy._)(LL||(LL=_(["{missingProperty: ","}"])),e),"params")},Yoe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Xoe,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:a}=e,{opts:l}=a;if(!i&&r.length===0)return;let c=r.length>=l.loopRequired;if(a.allErrors?p():f(),l.strictRequired){let v=e.parentSchema.properties,{definedProperties:x}=e.it;for(let S of r)if((v==null?void 0:v[S])===void 0&&!x.has(S)){let I=a.schemaEnv.baseId+a.errSchemaPath,P='required property "'.concat(S,'" is not defined at "').concat(I,'" (strictRequired)');(0,Zoe.checkStrictMode)(a,P,a.opts.strictRequired)}}function p(){if(c||i)e.block$data(Hy.nil,m);else for(let v of r)(0,zy.checkReportMissingProp)(e,v)}s(p,"allErrorsMode");function f(){let v=t.let("missing");if(c||i){let x=t.let("valid",!0);e.block$data(x,()=>y(v,x)),e.ok(x)}else t.if((0,zy.checkMissingProp)(e,r,v)),(0,zy.reportMissingProp)(e,v),t.else()}s(f,"exitOnErrorMode");function m(){t.forOf("prop",n,v=>{e.setParams({missingProperty:v}),t.if((0,zy.noPropertyInData)(t,o,v,l.ownProperties),()=>e.error())})}s(m,"loopAllRequired");function y(v,x){e.setParams({missingProperty:v}),t.forOf(v,n,()=>{t.assign(x,(0,zy.propertyInData)(t,o,v,l.ownProperties)),t.if((0,Hy.not)(x),()=>{e.error(),t.break()})},Hy.nil)}s(y,"loopUntilMissing")}};BP.default=Yoe});var jL=W($P=>{"use strict";d();Object.defineProperty($P,"__esModule",{value:!0});var Wy=Xe(),NL,BL,Koe={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Wy.str)(NL||(NL=_(["must NOT have "," than "," items"])),r,t)},params:s(({schemaCode:e})=>(0,Wy._)(BL||(BL=_(["{limit: ","}"])),e),"params")},$L,Joe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Koe,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?Wy.operators.GT:Wy.operators.LT;e.fail$data((0,Wy._)($L||($L=_(["",".length "," ",""])),r,o,n))}};$P.default=Joe});var ov=W(jP=>{"use strict";d();Object.defineProperty(jP,"__esModule",{value:!0});var GL=sP();GL.code='require("ajv/dist/runtime/equal").default';jP.default=GL});var iR=W(UP=>{"use strict";d();Object.defineProperty(UP,"__esModule",{value:!0});var GP=ky(),an=Xe(),Qoe=Ot(),eie=ov(),UL,VL,tie={message:s(({params:{i:e,j:t}})=>(0,an.str)(UL||(UL=_(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),"message"),params:s(({params:{i:e,j:t}})=>(0,an._)(VL||(VL=_(["{i: ",", j: ","}"])),e,t),"params")},zL,HL,WL,qL,ZL,XL,YL,KL,JL,QL,eR,tR,rR,nR,oR,rie={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:tie,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:a,it:l}=e;if(!n&&!o)return;let c=t.let("valid"),p=i.items?(0,GP.getSchemaTypes)(i.items):[];e.block$data(c,f,(0,an._)(zL||(zL=_([""," === false"])),a)),e.ok(c);function f(){let x=t.let("i",(0,an._)(HL||(HL=_(["",".length"])),r)),S=t.let("j");e.setParams({i:x,j:S}),t.assign(c,!0),t.if((0,an._)(WL||(WL=_([""," > 1"])),x),()=>(m()?y:v)(x,S))}s(f,"validateUniqueItems");function m(){return p.length>0&&!p.some(x=>x==="object"||x==="array")}s(m,"canOptimize");function y(x,S){let I=t.name("item"),P=(0,GP.checkDataTypes)(p,I,l.opts.strictNumbers,GP.DataType.Wrong),T=t.const("indices",(0,an._)(qL||(qL=_(["{}"]))));t.for((0,an._)(ZL||(ZL=_([";","--;"])),x),()=>{t.let(I,(0,an._)(XL||(XL=_(["","[","]"])),r,x)),t.if(P,(0,an._)(YL||(YL=_(["continue"])))),p.length>1&&t.if((0,an._)(KL||(KL=_(["typeof ",' == "string"'])),I),(0,an._)(JL||(JL=_(["",' += "_"'])),I)),t.if((0,an._)(QL||(QL=_(["typeof ","[",'] == "number"'])),T,I),()=>{t.assign(S,(0,an._)(eR||(eR=_(["","[","]"])),T,I)),e.error(),t.assign(c,!1).break()}).code((0,an._)(tR||(tR=_(["","[","] = ",""])),T,I,x))})}s(y,"loopN");function v(x,S){let I=(0,Qoe.useFunc)(t,eie.default),P=t.name("outer");t.label(P).for((0,an._)(rR||(rR=_([";","--;"])),x),()=>t.for((0,an._)(nR||(nR=_([""," = ","; ","--;"])),S,x,S),()=>t.if((0,an._)(oR||(oR=_(["","(","[","], ","[","])"])),I,r,x,r,S),()=>{e.error(),t.assign(c,!1).break(P)})))}s(v,"loopN2")}};UP.default=rie});var cR=W(zP=>{"use strict";d();Object.defineProperty(zP,"__esModule",{value:!0});var VP=Xe(),nie=Ot(),oie=ov(),sR,iie={message:"must be equal to constant",params:s(({schemaCode:e})=>(0,VP._)(sR||(sR=_(["{allowedValue: ","}"])),e),"params")},aR,lR,sie={keyword:"const",$data:!0,error:iie,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,VP._)(aR||(aR=_(["!","(",", ",")"])),(0,nie.useFunc)(t,oie.default),r,o)):e.fail((0,VP._)(lR||(lR=_([""," !== ",""])),i,r))}};zP.default=sie});var mR=W(HP=>{"use strict";d();Object.defineProperty(HP,"__esModule",{value:!0});var qy=Xe(),aie=Ot(),lie=ov(),uR,cie={message:"must be equal to one of the allowed values",params:s(({schemaCode:e})=>(0,qy._)(uR||(uR=_(["{allowedValues: ","}"])),e),"params")},pR,dR,fR,uie={keyword:"enum",schemaType:"array",$data:!0,error:cie,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:a}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let l=o.length>=a.opts.loopEnum,c,p=s(()=>c!=null?c:c=(0,aie.useFunc)(t,lie.default),"getEql"),f;if(l||n)f=t.let("valid"),e.block$data(f,m);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let v=t.const("vSchema",i);f=(0,qy.or)(...o.map((x,S)=>y(v,S)))}e.pass(f);function m(){t.assign(f,!1),t.forOf("v",i,v=>t.if((0,qy._)(pR||(pR=_(["","(",", ",")"])),p(),r,v),()=>t.assign(f,!0).break()))}s(m,"loopEnum");function y(v,x){let S=o[x];return typeof S=="object"&&S!==null?(0,qy._)(dR||(dR=_(["","(",", ","[","])"])),p(),r,v,x):(0,qy._)(fR||(fR=_([""," === ",""])),r,S)}s(y,"equalCode")}};HP.default=uie});var hR=W(WP=>{"use strict";d();Object.defineProperty(WP,"__esModule",{value:!0});var pie=uL(),die=yL(),fie=PL(),mie=EL(),hie=DL(),yie=RL(),gie=jL(),bie=iR(),vie=cR(),xie=mR(),Iie=[pie.default,die.default,fie.default,mie.default,hie.default,yie.default,gie.default,bie.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},vie.default,xie.default];WP.default=Iie});var ZP=W(Zy=>{"use strict";d();Object.defineProperty(Zy,"__esModule",{value:!0});Zy.validateAdditionalItems=void 0;var Zu=Xe(),qP=Ot(),yR,gR,Sie={message:s(({params:{len:e}})=>(0,Zu.str)(yR||(yR=_(["must NOT have more than "," items"])),e),"message"),params:s(({params:{len:e}})=>(0,Zu._)(gR||(gR=_(["{limit: ","}"])),e),"params")},Cie={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Sie,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,qP.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}IR(e,n)}},bR,vR,xR;function IR(e,t){let{gen:r,schema:n,data:o,keyword:i,it:a}=e;a.items=!0;let l=r.const("len",(0,Zu._)(bR||(bR=_(["",".length"])),o));if(n===!1)e.setParams({len:t.length}),e.pass((0,Zu._)(vR||(vR=_([""," <= ",""])),l,t.length));else if(typeof n=="object"&&!(0,qP.alwaysValidSchema)(a,n)){let p=r.var("valid",(0,Zu._)(xR||(xR=_([""," <= ",""])),l,t.length));r.if((0,Zu.not)(p),()=>c(p)),e.ok(p)}function c(p){r.forRange("i",t.length,l,f=>{e.subschema({keyword:i,dataProp:f,dataPropType:qP.Type.Num},p),a.allErrors||r.if((0,Zu.not)(p),()=>r.break())})}s(c,"validateItems")}s(IR,"validateAdditionalItems");Zy.validateAdditionalItems=IR;Zy.default=Cie});var XP=W(Xy=>{"use strict";d();Object.defineProperty(Xy,"__esModule",{value:!0});Xy.validateTuple=void 0;var SR=Xe(),iv=Ot(),Pie=ei(),Tie={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return TR(e,"additionalItems",t);r.items=!0,!(0,iv.alwaysValidSchema)(r,t)&&e.ok((0,Pie.validateArray)(e))}},CR,PR;function TR(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:a,it:l}=e;f(o),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=iv.mergeEvaluated.items(n,r.length,l.items));let c=n.name("valid"),p=n.const("len",(0,SR._)(CR||(CR=_(["",".length"])),i));r.forEach((m,y)=>{(0,iv.alwaysValidSchema)(l,m)||(n.if((0,SR._)(PR||(PR=_([""," > ",""])),p,y),()=>e.subschema({keyword:a,schemaProp:y,dataProp:y},c)),e.ok(c))});function f(m){let{opts:y,errSchemaPath:v}=l,x=r.length,S=x===m.minItems&&(x===m.maxItems||m[t]===!1);if(y.strictTuples&&!S){let I='"'.concat(a,'" is ').concat(x,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(v,'"');(0,iv.checkStrictMode)(l,I,y.strictTuples)}}s(f,"checkStrictTuple")}s(TR,"validateTuple");Xy.validateTuple=TR;Xy.default=Tie});var wR=W(YP=>{"use strict";d();Object.defineProperty(YP,"__esModule",{value:!0});var wie=XP(),Mie={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:s(e=>(0,wie.validateTuple)(e,"items"),"code")};YP.default=Mie});var _R=W(KP=>{"use strict";d();Object.defineProperty(KP,"__esModule",{value:!0});var MR=Xe(),Oie=Ot(),Eie=ei(),_ie=ZP(),OR,ER,Aie={message:s(({params:{len:e}})=>(0,MR.str)(OR||(OR=_(["must NOT have more than "," items"])),e),"message"),params:s(({params:{len:e}})=>(0,MR._)(ER||(ER=_(["{limit: ","}"])),e),"params")},kie={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Aie,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,Oie.alwaysValidSchema)(n,t)&&(o?(0,_ie.validateAdditionalItems)(e,o):e.ok((0,Eie.validateArray)(e)))}};KP.default=kie});var VR=W(JP=>{"use strict";d();Object.defineProperty(JP,"__esModule",{value:!0});var ri=Xe(),sv=Ot(),AR,kR,DR,FR,Die={message:s(({params:{min:e,max:t}})=>t===void 0?(0,ri.str)(AR||(AR=_(["must contain at least "," valid item(s)"])),e):(0,ri.str)(kR||(kR=_(["must contain at least "," and no more than "," valid item(s)"])),e,t),"message"),params:s(({params:{min:e,max:t}})=>t===void 0?(0,ri._)(DR||(DR=_(["{minContains: ","}"])),e):(0,ri._)(FR||(FR=_(["{minContains: ",", maxContains: ","}"])),e,t),"params")},LR,RR,NR,BR,$R,jR,GR,UR,Fie={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Die,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,a,l,{minContains:c,maxContains:p}=n;i.opts.next?(a=c===void 0?1:c,l=p):a=1;let f=t.const("len",(0,ri._)(LR||(LR=_(["",".length"])),o));if(e.setParams({min:a,max:l}),l===void 0&&a===0){(0,sv.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,sv.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,sv.alwaysValidSchema)(i,r)){let S=(0,ri._)(RR||(RR=_([""," >= ",""])),f,a);l!==void 0&&(S=(0,ri._)(NR||(NR=_([""," && "," <= ",""])),S,f,l)),e.pass(S);return}i.items=!0;let m=t.name("valid");l===void 0&&a===1?v(m,()=>t.if(m,()=>t.break())):a===0?(t.let(m,!0),l!==void 0&&t.if((0,ri._)(BR||(BR=_(["",".length > 0"])),o),y)):(t.let(m,!1),y()),e.result(m,()=>e.reset());function y(){let S=t.name("_valid"),I=t.let("count",0);v(S,()=>t.if(S,()=>x(I)))}s(y,"validateItemsWithCount");function v(S,I){t.forRange("i",0,f,P=>{e.subschema({keyword:"contains",dataProp:P,dataPropType:sv.Type.Num,compositeRule:!0},S),I()})}s(v,"validateItems");function x(S){t.code((0,ri._)($R||($R=_(["","++"])),S)),l===void 0?t.if((0,ri._)(jR||(jR=_([""," >= ",""])),S,a),()=>t.assign(m,!0).break()):(t.if((0,ri._)(GR||(GR=_([""," > ",""])),S,l),()=>t.assign(m,!1).break()),a===1?t.assign(m,!0):t.if((0,ri._)(UR||(UR=_([""," >= ",""])),S,a),()=>t.assign(m,!0)))}s(x,"checkLimits")}};JP.default=Fie});var XR=W(Rs=>{"use strict";d();Object.defineProperty(Rs,"__esModule",{value:!0});Rs.validateSchemaDeps=Rs.validatePropertyDeps=Rs.error=void 0;var QP=Xe(),Lie=Ot(),Yy=ei(),zR,HR;Rs.error={message:s(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,QP.str)(zR||(zR=_(["must have "," "," when property "," is present"])),n,r,e)},"message"),params:s(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,QP._)(HR||(HR=_(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r),"params")};var Rie={keyword:"dependencies",type:"object",schemaType:"object",error:Rs.error,code(e){let[t,r]=Nie(e);qR(e,t),ZR(e,r)}};function Nie({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}s(Nie,"splitDependencies");var WR;function qR(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let a in t){let l=t[a];if(l.length===0)continue;let c=(0,Yy.propertyInData)(r,n,a,o.opts.ownProperties);e.setParams({property:a,depsCount:l.length,deps:l.join(", ")}),o.allErrors?r.if(c,()=>{for(let p of l)(0,Yy.checkReportMissingProp)(e,p)}):(r.if((0,QP._)(WR||(WR=_([""," && (",")"])),c,(0,Yy.checkMissingProp)(e,l,i))),(0,Yy.reportMissingProp)(e,i),r.else())}}s(qR,"validatePropertyDeps");Rs.validatePropertyDeps=qR;function ZR(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,a=r.name("valid");for(let l in t)(0,Lie.alwaysValidSchema)(i,t[l])||(r.if((0,Yy.propertyInData)(r,n,l,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:l},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a))}s(ZR,"validateSchemaDeps");Rs.validateSchemaDeps=ZR;Rs.default=Rie});var JR=W(eT=>{"use strict";d();Object.defineProperty(eT,"__esModule",{value:!0});var KR=Xe(),Bie=Ot(),YR,$ie={message:"property name must be valid",params:s(({params:e})=>(0,KR._)(YR||(YR=_(["{propertyName: ","}"])),e.propertyName),"params")},jie={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:$ie,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,Bie.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),t.if((0,KR.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};eT.default=jie});var rT=W(tT=>{"use strict";d();Object.defineProperty(tT,"__esModule",{value:!0});var av=ei(),ji=Xe(),Gie=za(),lv=Ot(),QR,Uie={message:"must NOT have additional properties",params:s(({params:e})=>(0,ji._)(QR||(QR=_(["{additionalProperty: ","}"])),e.additionalProperty),"params")},eN,tN,rN,nN,Vie={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Uie,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:a}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:l,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,lv.alwaysValidSchema)(a,r))return;let p=(0,av.allSchemaProperties)(n.properties),f=(0,av.allSchemaProperties)(n.patternProperties);m(),e.ok((0,ji._)(eN||(eN=_([""," === ",""])),i,Gie.default.errors));function m(){t.forIn("key",o,I=>{!p.length&&!f.length?x(I):t.if(y(I),()=>x(I))})}s(m,"checkAdditionalProperties");function y(I){let P;if(p.length>8){let T=(0,lv.schemaRefOrVal)(a,n.properties,"properties");P=(0,av.isOwnProperty)(t,T,I)}else p.length?P=(0,ji.or)(...p.map(T=>(0,ji._)(tN||(tN=_([""," === ",""])),I,T))):P=ji.nil;return f.length&&(P=(0,ji.or)(P,...f.map(T=>(0,ji._)(rN||(rN=_(["",".test(",")"])),(0,av.usePattern)(e,T),I)))),(0,ji.not)(P)}s(y,"isAdditional");function v(I){t.code((0,ji._)(nN||(nN=_(["delete ","[","]"])),o,I))}s(v,"deleteAdditional");function x(I){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){v(I);return}if(r===!1){e.setParams({additionalProperty:I}),e.error(),l||t.break();return}if(typeof r=="object"&&!(0,lv.alwaysValidSchema)(a,r)){let P=t.name("valid");c.removeAdditional==="failing"?(S(I,P,!1),t.if((0,ji.not)(P),()=>{e.reset(),v(I)})):(S(I,P),l||t.if((0,ji.not)(P),()=>t.break()))}}s(x,"additionalPropertyCode");function S(I,P,T){let M={keyword:"additionalProperties",dataProp:I,dataPropType:lv.Type.Str};T===!1&&Object.assign(M,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(M,P)}s(S,"applyAdditionalSchema")}};tT.default=Vie});var sN=W(oT=>{"use strict";d();Object.defineProperty(oT,"__esModule",{value:!0});var zie=Ry(),oN=ei(),nT=Ot(),iN=rT(),Hie={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&iN.default.code(new zie.KeywordCxt(i,iN.default,"additionalProperties"));let a=(0,oN.allSchemaProperties)(r);for(let m of a)i.definedProperties.add(m);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=nT.mergeEvaluated.props(t,(0,nT.toHash)(a),i.props));let l=a.filter(m=>!(0,nT.alwaysValidSchema)(i,r[m]));if(l.length===0)return;let c=t.name("valid");for(let m of l)p(m)?f(m):(t.if((0,oN.propertyInData)(t,o,m,i.opts.ownProperties)),f(m),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(m),e.ok(c);function p(m){return i.opts.useDefaults&&!i.compositeRule&&r[m].default!==void 0}s(p,"hasDefault");function f(m){e.subschema({keyword:"properties",schemaProp:m,dataProp:m},c)}s(f,"applyPropertySchema")}};oT.default=Hie});var dN=W(iT=>{"use strict";d();Object.defineProperty(iT,"__esModule",{value:!0});var aN=ei(),cv=Xe(),lN=Ot(),cN=Ot(),uN,pN,Wie={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:a}=i,l=(0,aN.allSchemaProperties)(r),c=l.filter(S=>(0,lN.alwaysValidSchema)(i,r[S]));if(l.length===0||c.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;let p=a.strictSchema&&!a.allowMatchingProperties&&o.properties,f=t.name("valid");i.props!==!0&&!(i.props instanceof cv.Name)&&(i.props=(0,cN.evaluatedPropsToName)(t,i.props));let{props:m}=i;y();function y(){for(let S of l)p&&v(S),i.allErrors?x(S):(t.var(f,!0),x(S),t.if(f))}s(y,"validatePatternProperties");function v(S){for(let I in p)new RegExp(S).test(I)&&(0,lN.checkStrictMode)(i,"property ".concat(I," matches pattern ").concat(S," (use allowMatchingProperties)"))}s(v,"checkMatchingProperties");function x(S){t.forIn("key",n,I=>{t.if((0,cv._)(uN||(uN=_(["",".test(",")"])),(0,aN.usePattern)(e,S),I),()=>{let P=c.includes(S);P||e.subschema({keyword:"patternProperties",schemaProp:S,dataProp:I,dataPropType:cN.Type.Str},f),i.opts.unevaluated&&m!==!0?t.assign((0,cv._)(pN||(pN=_(["","[","]"])),m,I),!0):!P&&!i.allErrors&&t.if((0,cv.not)(f),()=>t.break())})})}s(x,"validateProperties")}};iT.default=Wie});var fN=W(sT=>{"use strict";d();Object.defineProperty(sT,"__esModule",{value:!0});var qie=Ot(),Zie={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,qie.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};sT.default=Zie});var mN=W(aT=>{"use strict";d();Object.defineProperty(aT,"__esModule",{value:!0});var Xie=ei(),Yie={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Xie.validateUnion,error:{message:"must match a schema in anyOf"}};aT.default=Yie});var bN=W(lT=>{"use strict";d();Object.defineProperty(lT,"__esModule",{value:!0});var uv=Xe(),Kie=Ot(),hN,Jie={message:"must match exactly one schema in oneOf",params:s(({params:e})=>(0,uv._)(hN||(hN=_(["{passingSchemas: ","}"])),e.passing),"params")},yN,gN,Qie={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Jie,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,a=t.let("valid",!1),l=t.let("passing",null),c=t.name("_valid");e.setParams({passing:l}),t.block(p),e.result(a,()=>e.reset(),()=>e.error(!0));function p(){i.forEach((f,m)=>{let y;(0,Kie.alwaysValidSchema)(o,f)?t.var(c,!0):y=e.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},c),m>0&&t.if((0,uv._)(yN||(yN=_([""," && ",""])),c,a)).assign(a,!1).assign(l,(0,uv._)(gN||(gN=_(["[",", ","]"])),l,m)).else(),t.if(c,()=>{t.assign(a,!0),t.assign(l,m),y&&e.mergeEvaluated(y,uv.Name)})})}s(p,"validateOneOf")}};lT.default=Qie});var vN=W(cT=>{"use strict";d();Object.defineProperty(cT,"__esModule",{value:!0});var ese=Ot(),tse={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,a)=>{if((0,ese.alwaysValidSchema)(n,i))return;let l=e.subschema({keyword:"allOf",schemaProp:a},o);e.ok(o),e.mergeEvaluated(l)})}};cT.default=tse});var TN=W(uT=>{"use strict";d();Object.defineProperty(uT,"__esModule",{value:!0});var pv=Xe(),PN=Ot(),IN,SN,rse={message:s(({params:e})=>(0,pv.str)(IN||(IN=_(['must match "','" schema'])),e.ifClause),"message"),params:s(({params:e})=>(0,pv._)(SN||(SN=_(["{failingKeyword: ","}"])),e.ifClause),"params")},CN,nse={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:rse,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,PN.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=xN(n,"then"),i=xN(n,"else");if(!o&&!i)return;let a=t.let("valid",!0),l=t.name("_valid");if(c(),e.reset(),o&&i){let f=t.let("ifClause");e.setParams({ifClause:f}),t.if(l,p("then",f),p("else",f))}else o?t.if(l,p("then")):t.if((0,pv.not)(l),p("else"));e.pass(a,()=>e.error(!0));function c(){let f=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(f)}s(c,"validateIf");function p(f,m){return()=>{let y=e.subschema({keyword:f},l);t.assign(a,l),e.mergeValidEvaluated(y,a),m?t.assign(m,(0,pv._)(CN||(CN=_(["",""])),f)):e.setParams({ifClause:f})}}s(p,"validateClause")}};function xN(e,t){let r=e.schema[t];return r!==void 0&&!(0,PN.alwaysValidSchema)(e,r)}s(xN,"hasSchema");uT.default=nse});var wN=W(pT=>{"use strict";d();Object.defineProperty(pT,"__esModule",{value:!0});var ose=Ot(),ise={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,ose.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};pT.default=ise});var MN=W(dT=>{"use strict";d();Object.defineProperty(dT,"__esModule",{value:!0});var sse=ZP(),ase=wR(),lse=XP(),cse=_R(),use=VR(),pse=XR(),dse=JR(),fse=rT(),mse=sN(),hse=dN(),yse=fN(),gse=mN(),bse=bN(),vse=vN(),xse=TN(),Ise=wN();function Sse(e=!1){let t=[yse.default,gse.default,bse.default,vse.default,xse.default,Ise.default,dse.default,fse.default,pse.default,mse.default,hse.default];return e?t.push(ase.default,cse.default):t.push(sse.default,lse.default),t.push(use.default),t}s(Sse,"getApplicator");dT.default=Sse});var HN=W(fT=>{"use strict";d();Object.defineProperty(fT,"__esModule",{value:!0});var Er=Xe(),ON,EN,Cse={message:s(({schemaCode:e})=>(0,Er.str)(ON||(ON=_(['must match format "','"'])),e),"message"),params:s(({schemaCode:e})=>(0,Er._)(EN||(EN=_(["{format: ","}"])),e),"params")},_N,AN,kN,DN,FN,LN,RN,NN,BN,$N,jN,GN,UN,VN,zN,Pse={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Cse,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:p,schemaEnv:f,self:m}=l;if(!c.validateFormats)return;o?y():v();function y(){let x=r.scopeValue("formats",{ref:m.formats,code:c.code.formats}),S=r.const("fDef",(0,Er._)(_N||(_N=_(["","[","]"])),x,a)),I=r.let("fType"),P=r.let("format");r.if((0,Er._)(AN||(AN=_(["typeof ",' == "object" && !('," instanceof RegExp)"])),S,S),()=>r.assign(I,(0,Er._)(kN||(kN=_(["",'.type || "string"'])),S)).assign(P,(0,Er._)(DN||(DN=_(["",".validate"])),S)),()=>r.assign(I,(0,Er._)(FN||(FN=_(['"string"'])))).assign(P,S)),e.fail$data((0,Er.or)(T(),M()));function T(){return c.strictSchema===!1?Er.nil:(0,Er._)(LN||(LN=_([""," && !",""])),a,P)}s(T,"unknownFmt");function M(){let w=f.$async?(0,Er._)(RN||(RN=_(["(",".async ? await ","(",") : ","(","))"])),S,P,n,P,n):(0,Er._)(NN||(NN=_(["","(",")"])),P,n),E=(0,Er._)(BN||(BN=_(["(typeof ",' == "function" ? '," : ",".test(","))"])),P,w,P,n);return(0,Er._)($N||($N=_([""," && "," !== true && "," === "," && !",""])),P,P,I,t,E)}s(M,"invalidFmt")}s(y,"validate$DataFormat");function v(){let x=m.formats[i];if(!x){T();return}if(x===!0)return;let[S,I,P]=M(x);S===t&&e.pass(w());function T(){if(c.strictSchema===!1){m.logger.warn(E());return}throw new Error(E());function E(){return'unknown format "'.concat(i,'" ignored in schema at path "').concat(p,'"')}}s(T,"unknownFormat");function M(E){let B=E instanceof RegExp?(0,Er.regexpCode)(E):c.code.formats?(0,Er._)(jN||(jN=_(["","",""])),c.code.formats,(0,Er.getProperty)(i)):void 0,D=r.scopeValue("formats",{key:i,ref:E,code:B});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,Er._)(GN||(GN=_(["",".validate"])),D)]:["string",E,D]}s(M,"getFormat");function w(){if(typeof x=="object"&&!(x instanceof RegExp)&&x.async){if(!f.$async)throw new Error("async format in sync schema");return(0,Er._)(UN||(UN=_(["await ","(",")"])),P,n)}return typeof I=="function"?(0,Er._)(VN||(VN=_(["","(",")"])),P,n):(0,Er._)(zN||(zN=_(["",".test(",")"])),P,n)}s(w,"validCondition")}s(v,"validateFormat")}};fT.default=Pse});var WN=W(mT=>{"use strict";d();Object.defineProperty(mT,"__esModule",{value:!0});var Tse=HN(),wse=[Tse.default];mT.default=wse});var qN=W(Sf=>{"use strict";d();Object.defineProperty(Sf,"__esModule",{value:!0});Sf.contentVocabulary=Sf.metadataVocabulary=void 0;Sf.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Sf.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var XN=W(hT=>{"use strict";d();Object.defineProperty(hT,"__esModule",{value:!0});var Mse=sL(),Ose=hR(),Ese=MN(),_se=WN(),ZN=qN(),Ase=[Mse.default,Ose.default,(0,Ese.default)(),_se.default,ZN.metadataVocabulary,ZN.contentVocabulary];hT.default=Ase});var KN=W(dv=>{"use strict";d();Object.defineProperty(dv,"__esModule",{value:!0});dv.DiscrError=void 0;var YN;(function(e){e.Tag="tag",e.Mapping="mapping"})(YN||(dv.DiscrError=YN={}))});var nB=W(gT=>{"use strict";d();Object.defineProperty(gT,"__esModule",{value:!0});var Cf=Xe(),yT=KN(),JN=Z0(),kse=Ny(),Dse=Ot(),QN,Fse={message:s(({params:{discrError:e,tagName:t}})=>e===yT.DiscrError.Tag?'tag "'.concat(t,'" must be string'):'value of tag "'.concat(t,'" must be in oneOf'),"message"),params:s(({params:{discrError:e,tag:t,tagName:r}})=>(0,Cf._)(QN||(QN=_(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t),"params")},eB,tB,rB,Lse={keyword:"discriminator",type:"object",schemaType:"object",error:Fse,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:a}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),p=t.const("tag",(0,Cf._)(eB||(eB=_(["","",""])),r,(0,Cf.getProperty)(l)));t.if((0,Cf._)(tB||(tB=_(["typeof ",' == "string"'])),p),()=>f(),()=>e.error(!1,{discrError:yT.DiscrError.Tag,tag:p,tagName:l})),e.ok(c);function f(){let v=y();t.if(!1);for(let x in v)t.elseIf((0,Cf._)(rB||(rB=_([""," === ",""])),p,x)),t.assign(c,m(v[x]));t.else(),e.error(!1,{discrError:yT.DiscrError.Mapping,tag:p,tagName:l}),t.endIf()}s(f,"validateMapping");function m(v){let x=t.name("valid"),S=e.subschema({keyword:"oneOf",schemaProp:v},x);return e.mergeEvaluated(S,Cf.Name),x}s(m,"applyTagSchema");function y(){var v;let x={},S=P(o),I=!0;for(let w=0;w<a.length;w++){let E=a[w];if(E!=null&&E.$ref&&!(0,Dse.schemaHasRulesButRef)(E,i.self.RULES)){let D=E.$ref;if(E=JN.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D),E instanceof JN.SchemaEnv&&(E=E.schema),E===void 0)throw new kse.default(i.opts.uriResolver,i.baseId,D)}let B=(v=E==null?void 0:E.properties)===null||v===void 0?void 0:v[l];if(typeof B!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(l,'"'));I=I&&(S||P(E)),T(B,w)}if(!I)throw new Error('discriminator: "'.concat(l,'" must be required'));return x;function P({required:w}){return Array.isArray(w)&&w.includes(l)}function T(w,E){if(w.const)M(w.const,E);else if(w.enum)for(let B of w.enum)M(B,E);else throw new Error('discriminator: "properties/'.concat(l,'" must have "const" or "enum"'))}function M(w,E){if(typeof w!="string"||w in x)throw new Error('discriminator: "'.concat(l,'" values must be unique strings'));x[w]=E}}s(y,"getMapping")}};gT.default=Lse});var oB=W((h_e,Rse)=>{Rse.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var xT=W((nr,bT)=>{"use strict";d();Object.defineProperty(nr,"__esModule",{value:!0});nr.MissingRefError=nr.ValidationError=nr.CodeGen=nr.Name=nr.nil=nr.stringify=nr.str=nr._=nr.KeywordCxt=nr.Ajv=void 0;var Nse=HF(),Bse=XN(),$se=nB(),iB=oB(),jse=["/properties"],fv="http://json-schema.org/draft-07/schema",vT=class vT extends Nse.default{_addVocabularies(){super._addVocabularies(),Bse.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword($se.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(iB,jse):iB;this.addMetaSchema(t,fv,!1),this.refs["http://json-schema.org/schema"]=fv}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(fv)?fv:void 0)}};s(vT,"Ajv");var Pf=vT;nr.Ajv=Pf;bT.exports=nr=Pf;bT.exports.Ajv=Pf;Object.defineProperty(nr,"__esModule",{value:!0});nr.default=Pf;var Gse=Ry();Object.defineProperty(nr,"KeywordCxt",{enumerable:!0,get:s(function(){return Gse.KeywordCxt},"get")});var Tf=Xe();Object.defineProperty(nr,"_",{enumerable:!0,get:s(function(){return Tf._},"get")});Object.defineProperty(nr,"str",{enumerable:!0,get:s(function(){return Tf.str},"get")});Object.defineProperty(nr,"stringify",{enumerable:!0,get:s(function(){return Tf.stringify},"get")});Object.defineProperty(nr,"nil",{enumerable:!0,get:s(function(){return Tf.nil},"get")});Object.defineProperty(nr,"Name",{enumerable:!0,get:s(function(){return Tf.Name},"get")});Object.defineProperty(nr,"CodeGen",{enumerable:!0,get:s(function(){return Tf.CodeGen},"get")});var Use=W0();Object.defineProperty(nr,"ValidationError",{enumerable:!0,get:s(function(){return Use.default},"get")});var Vse=Ny();Object.defineProperty(nr,"MissingRefError",{enumerable:!0,get:s(function(){return Vse.default},"get")})});var pB=W(Ns=>{"use strict";d();Object.defineProperty(Ns,"__esModule",{value:!0});Ns.formatNames=Ns.fastFormats=Ns.fullFormats=void 0;function wf(e,t){return{validate:e,compare:t}}s(wf,"fmtDef");Ns.fullFormats={date:wf(lB,CT),time:wf(cB,PT),"date-time":wf(qse,uB),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Yse,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:nae,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Kse,int32:{type:"number",validate:eae},int64:{type:"number",validate:tae},float:{type:"number",validate:aB},double:{type:"number",validate:aB},password:!0,binary:!0};Ns.fastFormats={...Ns.fullFormats,date:wf(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,CT),time:wf(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,PT),"date-time":wf(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uB),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Ns.formatNames=Object.keys(Ns.fullFormats);function zse(e){return e%4===0&&(e%100!==0||e%400===0)}s(zse,"isLeapYear");var Hse=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Wse=[0,31,28,31,30,31,30,31,31,30,31,30,31];function lB(e){let t=Hse.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&zse(r)?29:Wse[n])}s(lB,"date");function CT(e,t){if(e&&t)return e>t?1:e<t?-1:0}s(CT,"compareDate");var IT=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function cB(e,t){let r=IT.exec(e);if(!r)return!1;let n=+r[1],o=+r[2],i=+r[3],a=r[5];return(n<=23&&o<=59&&i<=59||n===23&&o===59&&i===60)&&(!t||a!=="")}s(cB,"time");function PT(e,t){if(!(e&&t))return;let r=IT.exec(e),n=IT.exec(t);if(r&&n)return e=r[1]+r[2]+r[3]+(r[4]||""),t=n[1]+n[2]+n[3]+(n[4]||""),e>t?1:e<t?-1:0}s(PT,"compareTime");var ST=/t|\s/i;function qse(e){let t=e.split(ST);return t.length===2&&lB(t[0])&&cB(t[1],!0)}s(qse,"date_time");function uB(e,t){if(!(e&&t))return;let[r,n]=e.split(ST),[o,i]=t.split(ST),a=CT(r,o);if(a!==void 0)return a||PT(n,i)}s(uB,"compareDateTime");var Zse=/\/|:/,Xse=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Yse(e){return Zse.test(e)&&Xse.test(e)}s(Yse,"uri");var sB=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Kse(e){return sB.lastIndex=0,sB.test(e)}s(Kse,"byte");var Jse=-(2**31),Qse=2**31-1;function eae(e){return Number.isInteger(e)&&e<=Qse&&e>=Jse}s(eae,"validateInt32");function tae(e){return Number.isInteger(e)}s(tae,"validateInt64");function aB(){return!0}s(aB,"validateNumber");var rae=/[^\\]\\Z/;function nae(e){if(rae.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}s(nae,"regex")});var xB=W(Mf=>{"use strict";d();Object.defineProperty(Mf,"__esModule",{value:!0});Mf.formatLimitDefinition=void 0;var oae=xT(),Gi=Xe(),gc=Gi.operators,mv={formatMaximum:{okStr:"<=",ok:gc.LTE,fail:gc.GT},formatMinimum:{okStr:">=",ok:gc.GTE,fail:gc.LT},formatExclusiveMaximum:{okStr:"<",ok:gc.LT,fail:gc.GTE},formatExclusiveMinimum:{okStr:">",ok:gc.GT,fail:gc.LTE}},dB,fB,iae={message:s(({keyword:e,schemaCode:t})=>Gi.str(dB||(dB=_(["should be "," ",""])),mv[e].okStr,t),"message"),params:s(({keyword:e,schemaCode:t})=>Gi._(fB||(fB=_(["{comparison: ",", limit: ","}"])),mv[e].okStr,t),"params")},mB,hB,yB,gB,bB,vB;Mf.formatLimitDefinition={keyword:Object.keys(mv),type:"string",schemaType:"string",$data:!0,error:iae,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:a,self:l}=i;if(!a.validateFormats)return;let c=new oae.KeywordCxt(i,l.RULES.all.format.definition,"format");c.$data?p():f();function p(){let y=t.scopeValue("formats",{ref:l.formats,code:a.code.formats}),v=t.const("fmt",Gi._(mB||(mB=_(["","[","]"])),y,c.schemaCode));e.fail$data(Gi.or(Gi._(hB||(hB=_(["typeof ",' != "object"'])),v),Gi._(yB||(yB=_([""," instanceof RegExp"])),v),Gi._(gB||(gB=_(["typeof ",'.compare != "function"'])),v),m(v)))}s(p,"validate$DataFormat");function f(){let y=c.schema,v=l.formats[y];if(!v||v===!0)return;if(typeof v!="object"||v instanceof RegExp||typeof v.compare!="function")throw new Error('"'.concat(o,'": format "').concat(y,'" does not define "compare" function'));let x=t.scopeValue("formats",{key:y,ref:v,code:a.code.formats?Gi._(bB||(bB=_(["","",""])),a.code.formats,Gi.getProperty(y)):void 0});e.fail$data(m(x))}s(f,"validateFormat");function m(y){return Gi._(vB||(vB=_(["",".compare(",", ",") "," 0"])),y,r,n,mv[o].fail)}s(m,"compareCode")},dependencies:["format"]};var sae=s(e=>(e.addKeyword(Mf.formatLimitDefinition),e),"formatLimitPlugin");Mf.default=sae});var TB=W((Ky,PB)=>{"use strict";d();Object.defineProperty(Ky,"__esModule",{value:!0});var Of=pB(),aae=xB(),TT=Xe(),IB=new TT.Name("fullFormats"),lae=new TT.Name("fastFormats"),wT=s((e,t={keywords:!0})=>{if(Array.isArray(t))return SB(e,t,Of.fullFormats,IB),e;let[r,n]=t.mode==="fast"?[Of.fastFormats,lae]:[Of.fullFormats,IB],o=t.formats||Of.formatNames;return SB(e,o,r,n),t.keywords&&aae.default(e),e},"formatsPlugin");wT.get=(e,t="full")=>{let n=(t==="fast"?Of.fastFormats:Of.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var CB;function SB(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=TT._(CB||(CB=_(['require("ajv-formats/dist/formats").',""])),n));for(let a of t)e.addFormat(a,r[a])}s(SB,"addFormats");PB.exports=Ky=wT;Object.defineProperty(Ky,"__esModule",{value:!0});Ky.default=wT});var mz=W((oat,P4)=>{"use strict";d();var Qx=Zee();Qx.default&&(Qx=Qx.default);P4.exports=fz;P4.exports.default=fz;function fz(e,t,r){t=t||1;for(var n,o,i,a,l=0;l<e[0].length;l++){var c=e[0][l];(!l||c[0]<n)&&(n=c[0]),(!l||c[1]<o)&&(o=c[1]),(!l||c[0]>i)&&(i=c[0]),(!l||c[1]>a)&&(a=c[1])}var p=i-n,f=a-o,m=Math.min(p,f),y=m/2;if(m===0){var v=[n,o];return v.distance=0,v}for(var x=new Qx(void 0,sbe),S=n;S<i;S+=m)for(var I=o;I<a;I+=m)x.push(new Oc(S+y,I+y,y,e));var P=lbe(e),T=new Oc(n+p/2,o+f/2,0,e);T.d>P.d&&(P=T);for(var M=x.length;x.length;){var w=x.pop();w.d>P.d&&(P=w,r&&console.log("found best %d after %d probes",Math.round(1e4*w.d)/1e4,M)),!(w.max-P.d<=t)&&(y=w.h/2,x.push(new Oc(w.x-y,w.y-y,y,e)),x.push(new Oc(w.x+y,w.y-y,y,e)),x.push(new Oc(w.x-y,w.y+y,y,e)),x.push(new Oc(w.x+y,w.y+y,y,e)),M+=4)}r&&(console.log("num probes: "+M),console.log("best distance: "+P.d));var E=[P.x,P.y];return E.distance=P.d,E}s(fz,"polylabel");function sbe(e,t){return t.max-e.max}s(sbe,"compareMax");function Oc(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=abe(e,t,n),this.max=this.d+this.h*Math.SQRT2}s(Oc,"Cell");function abe(e,t,r){for(var n=!1,o=1/0,i=0;i<r.length;i++)for(var a=r[i],l=0,c=a.length,p=c-1;l<c;p=l++){var f=a[l],m=a[p];f[1]>t!=m[1]>t&&e<(m[0]-f[0])*(t-f[1])/(m[1]-f[1])+f[0]&&(n=!n),o=Math.min(o,cbe(e,t,f,m))}return o===0?0:(n?1:-1)*Math.sqrt(o)}s(abe,"pointToPolygonDist");function lbe(e){for(var t=0,r=0,n=0,o=e[0],i=0,a=o.length,l=a-1;i<a;l=i++){var c=o[i],p=o[l],f=c[0]*p[1]-p[0]*c[1];r+=(c[0]+p[0])*f,n+=(c[1]+p[1])*f,t+=f*3}return t===0?new Oc(o[0][0],o[0][1],0,e):new Oc(r/t,n/t,0,e)}s(lbe,"getCentroidCell");function cbe(e,t,r,n){var o=r[0],i=r[1],a=n[0]-o,l=n[1]-i;if(a!==0||l!==0){var c=((e-o)*a+(t-i)*l)/(a*a+l*l);c>1?(o=n[0],i=n[1]):c>0&&(o+=a*c,i+=l*c)}return a=e-o,l=t-i,a*a+l*l}s(cbe,"getSegDistSq")});var Xz=W((H4,W4)=>{d();(function(e,t){typeof H4=="object"&&typeof W4<"u"?W4.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(H4,function(){"use strict";function e(I,P,T,M,w){s(function E(B,D,F,L,H){for(;L>F;){if(L-F>600){var U=L-F+1,G=D-F+1,J=Math.log(U),X=.5*Math.exp(2*J/3),ie=.5*Math.sqrt(J*X*(U-X)/U)*(G-U/2<0?-1:1),ee=Math.max(F,Math.floor(D-G*X/U+ie)),be=Math.min(L,Math.floor(D+(U-G)*X/U+ie));E(B,D,ee,be,H)}var ve=B[D],de=F,Ae=L;for(t(B,F,D),H(B[L],ve)>0&&t(B,F,L);de<Ae;){for(t(B,de,Ae),de++,Ae--;H(B[de],ve)<0;)de++;for(;H(B[Ae],ve)>0;)Ae--}H(B[F],ve)===0?t(B,F,Ae):t(B,++Ae,L),Ae<=D&&(F=Ae+1),D<=Ae&&(L=Ae-1)}},"t")(I,P,T||0,M||I.length-1,w||r)}s(e,"t");function t(I,P,T){var M=I[P];I[P]=I[T],I[T]=M}s(t,"i");function r(I,P){return I<P?-1:I>P?1:0}s(r,"n");var n=s(function(I){I===void 0&&(I=9),this._maxEntries=Math.max(4,I),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function o(I,P,T){if(!T)return P.indexOf(I);for(var M=0;M<P.length;M++)if(T(I,P[M]))return M;return-1}s(o,"e");function i(I,P){a(I,0,I.children.length,P,I)}s(i,"a");function a(I,P,T,M,w){w||(w=x(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var E=P;E<T;E++){var B=I.children[E];l(w,I.leaf?M(B):B)}return w}s(a,"h");function l(I,P){return I.minX=Math.min(I.minX,P.minX),I.minY=Math.min(I.minY,P.minY),I.maxX=Math.max(I.maxX,P.maxX),I.maxY=Math.max(I.maxY,P.maxY),I}s(l,"o");function c(I,P){return I.minX-P.minX}s(c,"s");function p(I,P){return I.minY-P.minY}s(p,"l");function f(I){return(I.maxX-I.minX)*(I.maxY-I.minY)}s(f,"f");function m(I){return I.maxX-I.minX+(I.maxY-I.minY)}s(m,"u");function y(I,P){return I.minX<=P.minX&&I.minY<=P.minY&&P.maxX<=I.maxX&&P.maxY<=I.maxY}s(y,"m");function v(I,P){return P.minX<=I.maxX&&P.minY<=I.maxY&&P.maxX>=I.minX&&P.maxY>=I.minY}s(v,"c");function x(I){return{children:I,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}s(x,"p");function S(I,P,T,M,w){for(var E=[P,T];E.length;)if(!((T=E.pop())-(P=E.pop())<=M)){var B=P+Math.ceil((T-P)/M/2)*M;e(I,B,P,T,w),E.push(P,B,B,T)}}return s(S,"d"),n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(I){var P=this.data,T=[];if(!v(I,P))return T;for(var M=this.toBBox,w=[];P;){for(var E=0;E<P.children.length;E++){var B=P.children[E],D=P.leaf?M(B):B;v(I,D)&&(P.leaf?T.push(B):y(I,D)?this._all(B,T):w.push(B))}P=w.pop()}return T},n.prototype.collides=function(I){var P=this.data;if(!v(I,P))return!1;for(var T=[];P;){for(var M=0;M<P.children.length;M++){var w=P.children[M],E=P.leaf?this.toBBox(w):w;if(v(I,E)){if(P.leaf||y(I,E))return!0;T.push(w)}}P=T.pop()}return!1},n.prototype.load=function(I){if(!I||!I.length)return this;if(I.length<this._minEntries){for(var P=0;P<I.length;P++)this.insert(I[P]);return this}var T=this._build(I.slice(),0,I.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var M=this.data;this.data=T,T=M}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},n.prototype.insert=function(I){return I&&this._insert(I,this.data.height-1),this},n.prototype.clear=function(){return this.data=x([]),this},n.prototype.remove=function(I,P){if(!I)return this;for(var T,M,w,E=this.data,B=this.toBBox(I),D=[],F=[];E||D.length;){if(E||(E=D.pop(),M=D[D.length-1],T=F.pop(),w=!0),E.leaf){var L=o(I,E.children,P);if(L!==-1)return E.children.splice(L,1),D.push(E),this._condense(D),this}w||E.leaf||!y(E,B)?M?(T++,E=M.children[T],w=!1):E=null:(D.push(E),F.push(T),T=0,M=E,E=E.children[0])}return this},n.prototype.toBBox=function(I){return I},n.prototype.compareMinX=function(I,P){return I.minX-P.minX},n.prototype.compareMinY=function(I,P){return I.minY-P.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(I){return this.data=I,this},n.prototype._all=function(I,P){for(var T=[];I;)I.leaf?P.push.apply(P,I.children):T.push.apply(T,I.children),I=T.pop();return P},n.prototype._build=function(I,P,T,M){var w,E=T-P+1,B=this._maxEntries;if(E<=B)return i(w=x(I.slice(P,T+1)),this.toBBox),w;M||(M=Math.ceil(Math.log(E)/Math.log(B)),B=Math.ceil(E/Math.pow(B,M-1))),(w=x([])).leaf=!1,w.height=M;var D=Math.ceil(E/B),F=D*Math.ceil(Math.sqrt(B));S(I,P,T,F,this.compareMinX);for(var L=P;L<=T;L+=F){var H=Math.min(L+F-1,T);S(I,L,H,D,this.compareMinY);for(var U=L;U<=H;U+=D){var G=Math.min(U+D-1,H);w.children.push(this._build(I,U,G,M-1))}}return i(w,this.toBBox),w},n.prototype._chooseSubtree=function(I,P,T,M){for(;M.push(P),!P.leaf&&M.length-1!==T;){for(var w=1/0,E=1/0,B=void 0,D=0;D<P.children.length;D++){var F=P.children[D],L=f(F),H=(U=I,G=F,(Math.max(G.maxX,U.maxX)-Math.min(G.minX,U.minX))*(Math.max(G.maxY,U.maxY)-Math.min(G.minY,U.minY))-L);H<E?(E=H,w=L<w?L:w,B=F):H===E&&L<w&&(w=L,B=F)}P=B||P.children[0]}var U,G;return P},n.prototype._insert=function(I,P,T){var M=T?I:this.toBBox(I),w=[],E=this._chooseSubtree(M,this.data,P,w);for(E.children.push(I),l(E,M);P>=0&&w[P].children.length>this._maxEntries;)this._split(w,P),P--;this._adjustParentBBoxes(M,w,P)},n.prototype._split=function(I,P){var T=I[P],M=T.children.length,w=this._minEntries;this._chooseSplitAxis(T,w,M);var E=this._chooseSplitIndex(T,w,M),B=x(T.children.splice(E,T.children.length-E));B.height=T.height,B.leaf=T.leaf,i(T,this.toBBox),i(B,this.toBBox),P?I[P-1].children.push(B):this._splitRoot(T,B)},n.prototype._splitRoot=function(I,P){this.data=x([I,P]),this.data.height=I.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(I,P,T){for(var M,w,E,B,D,F,L,H=1/0,U=1/0,G=P;G<=T-P;G++){var J=a(I,0,G,this.toBBox),X=a(I,G,T,this.toBBox),ie=(w=J,E=X,B=void 0,D=void 0,F=void 0,L=void 0,B=Math.max(w.minX,E.minX),D=Math.max(w.minY,E.minY),F=Math.min(w.maxX,E.maxX),L=Math.min(w.maxY,E.maxY),Math.max(0,F-B)*Math.max(0,L-D)),ee=f(J)+f(X);ie<H?(H=ie,M=G,U=ee<U?ee:U):ie===H&&ee<U&&(U=ee,M=G)}return M||T-P},n.prototype._chooseSplitAxis=function(I,P,T){var M=I.leaf?this.compareMinX:c,w=I.leaf?this.compareMinY:p;this._allDistMargin(I,P,T,M)<this._allDistMargin(I,P,T,w)&&I.children.sort(M)},n.prototype._allDistMargin=function(I,P,T,M){I.children.sort(M);for(var w=this.toBBox,E=a(I,0,P,w),B=a(I,T-P,T,w),D=m(E)+m(B),F=P;F<T-P;F++){var L=I.children[F];l(E,I.leaf?w(L):L),D+=m(E)}for(var H=T-P-1;H>=P;H--){var U=I.children[H];l(B,I.leaf?w(U):U),D+=m(B)}return D},n.prototype._adjustParentBBoxes=function(I,P,T){for(var M=T;M>=0;M--)l(P[M],I)},n.prototype._condense=function(I){for(var P=I.length-1,T=void 0;P>=0;P--)I[P].children.length===0?P>0?(T=I[P-1].children).splice(T.indexOf(I[P]),1):this.clear():i(I[P],this.toBBox)},n})});var K4=W(De=>{"use strict";d();Object.defineProperty(De,"__esModule",{value:!0});De.earthRadius=63710088e-1;De.factors={centimeters:De.earthRadius*100,centimetres:De.earthRadius*100,degrees:De.earthRadius/111325,feet:De.earthRadius*3.28084,inches:De.earthRadius*39.37,kilometers:De.earthRadius/1e3,kilometres:De.earthRadius/1e3,meters:De.earthRadius,metres:De.earthRadius,miles:De.earthRadius/1609.344,millimeters:De.earthRadius*1e3,millimetres:De.earthRadius*1e3,nauticalmiles:De.earthRadius/1852,radians:1,yards:De.earthRadius*1.0936};De.unitsFactors={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/De.earthRadius,yards:1.0936133};De.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function _c(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}s(_c,"feature");De.feature=_c;function Jbe(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return q4(t).geometry;case"LineString":return X4(t).geometry;case"Polygon":return Z4(t).geometry;case"MultiPoint":return Kz(t).geometry;case"MultiLineString":return Yz(t).geometry;case"MultiPolygon":return Jz(t).geometry;default:throw new Error(e+" is invalid")}}s(Jbe,"geometry");De.geometry=Jbe;function q4(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p2(e[0])||!p2(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return _c(n,t,r)}s(q4,"point");De.point=q4;function Qbe(e,t,r){return r===void 0&&(r={}),d2(e.map(function(n){return q4(n,t)}),r)}s(Qbe,"points");De.points=Qbe;function Z4(e,t,r){r===void 0&&(r={});for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<i[i.length-1].length;a++)if(i[i.length-1][a]!==i[0][a])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:e};return _c(l,t,r)}s(Z4,"polygon");De.polygon=Z4;function e1e(e,t,r){return r===void 0&&(r={}),d2(e.map(function(n){return Z4(n,t)}),r)}s(e1e,"polygons");De.polygons=e1e;function X4(e,t,r){if(r===void 0&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:e};return _c(n,t,r)}s(X4,"lineString");De.lineString=X4;function t1e(e,t,r){return r===void 0&&(r={}),d2(e.map(function(n){return X4(n,t)}),r)}s(t1e,"lineStrings");De.lineStrings=t1e;function d2(e,t){t===void 0&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}s(d2,"featureCollection");De.featureCollection=d2;function Yz(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return _c(n,t,r)}s(Yz,"multiLineString");De.multiLineString=Yz;function Kz(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return _c(n,t,r)}s(Kz,"multiPoint");De.multiPoint=Kz;function Jz(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return _c(n,t,r)}s(Jz,"multiPolygon");De.multiPolygon=Jz;function r1e(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return _c(n,t,r)}s(r1e,"geometryCollection");De.geometryCollection=r1e;function n1e(e,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r}s(n1e,"round");De.round=n1e;function Qz(e,t){t===void 0&&(t="kilometers");var r=De.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}s(Qz,"radiansToLength");De.radiansToLength=Qz;function Y4(e,t){t===void 0&&(t="kilometers");var r=De.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}s(Y4,"lengthToRadians");De.lengthToRadians=Y4;function o1e(e,t){return eH(Y4(e,t))}s(o1e,"lengthToDegrees");De.lengthToDegrees=o1e;function i1e(e){var t=e%360;return t<0&&(t+=360),t}s(i1e,"bearingToAzimuth");De.bearingToAzimuth=i1e;function eH(e){var t=e%(2*Math.PI);return t*180/Math.PI}s(eH,"radiansToDegrees");De.radiansToDegrees=eH;function s1e(e){var t=e%360;return t*Math.PI/180}s(s1e,"degreesToRadians");De.degreesToRadians=s1e;function a1e(e,t,r){if(t===void 0&&(t="kilometers"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return Qz(Y4(e,t),r)}s(a1e,"convertLength");De.convertLength=a1e;function l1e(e,t,r){if(t===void 0&&(t="meters"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var n=De.areaFactors[t];if(!n)throw new Error("invalid original units");var o=De.areaFactors[r];if(!o)throw new Error("invalid final units");return e/n*o}s(l1e,"convertArea");De.convertArea=l1e;function p2(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}s(p2,"isNumber");De.isNumber=p2;function c1e(e){return!!e&&e.constructor===Object}s(c1e,"isObject");De.isObject=c1e;function u1e(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(t){if(!p2(t))throw new Error("bbox must only contain numbers")})}s(u1e,"validateBBox");De.validateBBox=u1e;function p1e(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}s(p1e,"validateId");De.validateId=p1e});var iH=W(Hr=>{"use strict";d();Object.defineProperty(Hr,"__esModule",{value:!0});var Dn=K4();function Bg(e,t,r){if(e!==null)for(var n,o,i,a,l,c,p,f=0,m=0,y,v=e.type,x=v==="FeatureCollection",S=v==="Feature",I=x?e.features.length:1,P=0;P<I;P++){p=x?e.features[P].geometry:S?e.geometry:e,y=p?p.type==="GeometryCollection":!1,l=y?p.geometries.length:1;for(var T=0;T<l;T++){var M=0,w=0;if(a=y?p.geometries[T]:p,a!==null){c=a.coordinates;var E=a.type;switch(f=r&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(t(c,m,P,M,w)===!1)return!1;m++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(t(c[n],m,P,M,w)===!1)return!1;m++,E==="MultiPoint"&&M++}E==="LineString"&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-f;o++){if(t(c[n][o],m,P,M,w)===!1)return!1;m++}E==="MultiLineString"&&M++,E==="Polygon"&&w++}E==="Polygon"&&M++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(w=0,o=0;o<c[n].length;o++){for(i=0;i<c[n][o].length-f;i++){if(t(c[n][o][i],m,P,M,w)===!1)return!1;m++}w++}M++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Bg(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(Bg,"coordEach");function d1e(e,t,r,n){var o=r;return Bg(e,function(i,a,l,c,p){a===0&&r===void 0?o=i:o=t(o,i,a,l,c,p)},n),o}s(d1e,"coordReduce");function tH(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&t(e.features[r].properties,r)!==!1;r++);break;case"Feature":t(e.properties,0);break}}s(tH,"propEach");function f1e(e,t,r){var n=r;return tH(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(f1e,"propReduce");function rH(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}s(rH,"featureEach");function m1e(e,t,r){var n=r;return rH(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(m1e,"featureReduce");function h1e(e){var t=[];return Bg(e,function(r){t.push(r)}),t}s(h1e,"coordAll");function J4(e,t){var r,n,o,i,a,l,c,p,f,m,y=0,v=e.type==="FeatureCollection",x=e.type==="Feature",S=v?e.features.length:1;for(r=0;r<S;r++){for(l=v?e.features[r].geometry:x?e.geometry:e,p=v?e.features[r].properties:x?e.properties:{},f=v?e.features[r].bbox:x?e.bbox:void 0,m=v?e.features[r].id:x?e.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,o=0;o<a;o++){if(i=c?l.geometries[o]:l,i===null){if(t(null,y,p,f,m)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,y,p,f,m)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],y,p,f,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}s(J4,"geomEach");function y1e(e,t,r){var n=r;return J4(e,function(o,i,a,l,c){i===0&&r===void 0?n=o:n=t(n,o,i,a,l,c)}),n}s(y1e,"geomReduce");function f2(e,t){J4(e,function(r,n,o,i,a){var l=r===null?null:r.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(Dn.feature(r,o,{bbox:i,id:a}),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 p=0;p<r.coordinates.length;p++){var f=r.coordinates[p],m={type:c,coordinates:f};if(t(Dn.feature(m,o),n,p)===!1)return!1}})}s(f2,"flattenEach");function g1e(e,t,r){var n=r;return f2(e,function(o,i,a){i===0&&a===0&&r===void 0?n=o:n=t(n,o,i,a)}),n}s(g1e,"flattenReduce");function nH(e,t){f2(e,function(r,n,o){var i=0;if(r.geometry){var a=r.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,p=0,f=0;if(Bg(r,function(m,y,v,x,S){if(l===void 0||n>c||x>p||S>f){l=m,c=n,p=x,f=S,i=0;return}var I=Dn.lineString([l,m],r.properties);if(t(I,n,o,S,i)===!1)return!1;i++,l=m})===!1)return!1}}})}s(nH,"segmentEach");function b1e(e,t,r){var n=r,o=!1;return nH(e,function(i,a,l,c,p){o===!1&&r===void 0?n=i:n=t(n,i,a,l,c,p),o=!0}),n}s(b1e,"segmentReduce");function oH(e,t){if(!e)throw new Error("geojson is required");f2(e,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,a=r.geometry.coordinates;switch(i){case"LineString":if(t(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<a.length;l++)if(t(Dn.lineString(a[l],r.properties),n,o,l)===!1)return!1;break}}})}s(oH,"lineEach");function v1e(e,t,r){var n=r;return oH(e,function(o,i,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,a,l)}),n}s(v1e,"lineReduce");function x1e(e,t){if(t=t||{},!Dn.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.segmentIndex||0,a=t.properties,l;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,l=e.features[r].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=c.length+i-1),Dn.lineString([c[i],c[i+1]],a,t);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),Dn.lineString([c[o][i],c[o][i+1]],a,t);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i-1),Dn.lineString([c[n][i],c[n][i+1]],a,t);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i-1),Dn.lineString([c[n][o][i],c[n][o][i+1]],a,t)}throw new Error("geojson is invalid")}s(x1e,"findSegment");function I1e(e,t){if(t=t||{},!Dn.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.coordIndex||0,a=t.properties,l;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,l=e.features[r].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return Dn.point(c,a,t);case"MultiPoint":return n<0&&(n=c.length+n),Dn.point(c[n],a,t);case"LineString":return i<0&&(i=c.length+i),Dn.point(c[i],a,t);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),Dn.point(c[o][i],a,t);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),Dn.point(c[n][i],a,t);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i),Dn.point(c[n][o][i],a,t)}throw new Error("geojson is invalid")}s(I1e,"findPoint");Hr.coordAll=h1e;Hr.coordEach=Bg;Hr.coordReduce=d1e;Hr.featureEach=rH;Hr.featureReduce=m1e;Hr.findPoint=I1e;Hr.findSegment=x1e;Hr.flattenEach=f2;Hr.flattenReduce=g1e;Hr.geomEach=J4;Hr.geomReduce=y1e;Hr.lineEach=oH;Hr.lineReduce=v1e;Hr.propEach=tH;Hr.propReduce=f1e;Hr.segmentEach=nH;Hr.segmentReduce=b1e});var Q4=W((Mpt,aH)=>{"use strict";d();var sH=Object.prototype.toString;aH.exports=s(function(t){var r=sH.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&sH.call(t.callee)==="[object Function]"),n},"isArguments")});var yH=W((_pt,hH)=>{"use strict";d();var mH;Object.keys||($g=Object.prototype.hasOwnProperty,e5=Object.prototype.toString,lH=Q4(),t5=Object.prototype.propertyIsEnumerable,cH=!t5.call({toString:null},"toString"),uH=t5.call(function(){},"prototype"),jg=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],m2=s(function(e){var t=e.constructor;return t&&t.prototype===e},"equalsConstructorPrototype"),pH={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},dH=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!pH["$"+e]&&$g.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{m2(window[e])}catch{return!0}}catch{return!0}return!1}(),fH=s(function(e){if(typeof window>"u"||!dH)return m2(e);try{return m2(e)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),mH=s(function(t){var r=t!==null&&typeof t=="object",n=e5.call(t)==="[object Function]",o=lH(t),i=r&&e5.call(t)==="[object String]",a=[];if(!r&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var l=uH&&n;if(i&&t.length>0&&!$g.call(t,0))for(var c=0;c<t.length;++c)a.push(String(c));if(o&&t.length>0)for(var p=0;p<t.length;++p)a.push(String(p));else for(var f in t)!(l&&f==="prototype")&&$g.call(t,f)&&a.push(String(f));if(cH)for(var m=fH(t),y=0;y<jg.length;++y)!(m&&jg[y]==="constructor")&&$g.call(t,jg[y])&&a.push(jg[y]);return a},"keys"));var $g,e5,lH,t5,cH,uH,jg,m2,pH,dH,fH;hH.exports=mH});var y2=W((Dpt,vH)=>{"use strict";d();var S1e=Array.prototype.slice,C1e=Q4(),gH=Object.keys,h2=gH?s(function(t){return gH(t)},"keys"):yH(),bH=Object.keys;h2.shim=s(function(){if(Object.keys){var t=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);t||(Object.keys=s(function(n){return C1e(n)?bH(S1e.call(n)):bH(n)},"keys"))}else Object.keys=h2;return Object.keys||h2},"shimObjectKeys");vH.exports=h2});var IH=W((Rpt,xH)=>{"use strict";d();xH.exports=Error});var CH=W((Bpt,SH)=>{"use strict";d();SH.exports=EvalError});var TH=W((jpt,PH)=>{"use strict";d();PH.exports=RangeError});var MH=W((Upt,wH)=>{"use strict";d();wH.exports=ReferenceError});var r5=W((zpt,OH)=>{"use strict";d();OH.exports=SyntaxError});var hl=W((Wpt,EH)=>{"use strict";d();EH.exports=TypeError});var AH=W((Zpt,_H)=>{"use strict";d();_H.exports=URIError});var Gg=W((Ypt,kH)=>{"use strict";d();kH.exports=s(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==o||a.enumerable!==!0)return!1}return!0},"hasSymbols")});var g2=W((Qpt,FH)=>{"use strict";d();var DH=typeof Symbol<"u"&&Symbol,P1e=Gg();FH.exports=s(function(){return typeof DH!="function"||typeof Symbol!="function"||typeof DH("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:P1e()},"hasNativeSymbols")});var RH=W((rdt,LH)=>{"use strict";d();var n5={__proto__:null,foo:{}},T1e=Object;LH.exports=s(function(){return{__proto__:n5}.foo===n5.foo&&!(n5 instanceof T1e)},"hasProto")});var $H=W((idt,BH)=>{"use strict";d();var w1e="Function.prototype.bind called on incompatible ",M1e=Object.prototype.toString,O1e=Math.max,E1e="[object Function]",NH=s(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},"concatty"),_1e=s(function(t,r){for(var n=[],o=r||0,i=0;o<t.length;o+=1,i+=1)n[i]=t[o];return n},"slicy"),A1e=s(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");BH.exports=s(function(t){var r=this;if(typeof r!="function"||M1e.apply(r)!==E1e)throw new TypeError(w1e+r);for(var n=_1e(arguments,1),o,i=s(function(){if(this instanceof o){var f=r.apply(this,NH(n,arguments));return Object(f)===f?f:this}return r.apply(t,NH(n,arguments))},"binder"),a=O1e(0,r.length-n.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(o=Function("binder","return function ("+A1e(l,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var p=s(function(){},"Empty");p.prototype=r.prototype,o.prototype=new p,p.prototype=null}return o},"bind")});var b2=W((ldt,jH)=>{"use strict";d();var k1e=$H();jH.exports=Function.prototype.bind||k1e});var o5=W((udt,GH)=>{"use strict";d();var D1e=Function.prototype.call,F1e=Object.prototype.hasOwnProperty,L1e=b2();GH.exports=L1e.call(D1e,F1e)});var es=W((ddt,WH)=>{"use strict";d();var lt,R1e=IH(),N1e=CH(),B1e=TH(),$1e=MH(),Im=r5(),xm=hl(),j1e=AH(),HH=Function,i5=s(function(e){try{return HH('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Ip=Object.getOwnPropertyDescriptor;if(Ip)try{Ip({},"")}catch{Ip=null}var s5=s(function(){throw new xm},"throwTypeError"),G1e=Ip?function(){try{return arguments.callee,s5}catch{try{return Ip(arguments,"callee").get}catch{return s5}}}():s5,bm=g2()(),U1e=RH()(),tn=Object.getPrototypeOf||(U1e?function(e){return e.__proto__}:null),vm={},V1e=typeof Uint8Array>"u"||!tn?lt:tn(Uint8Array),Sp={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?lt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?lt:ArrayBuffer,"%ArrayIteratorPrototype%":bm&&tn?tn([][Symbol.iterator]()):lt,"%AsyncFromSyncIteratorPrototype%":lt,"%AsyncFunction%":vm,"%AsyncGenerator%":vm,"%AsyncGeneratorFunction%":vm,"%AsyncIteratorPrototype%":vm,"%Atomics%":typeof Atomics>"u"?lt:Atomics,"%BigInt%":typeof BigInt>"u"?lt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?lt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?lt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?lt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":R1e,"%eval%":eval,"%EvalError%":N1e,"%Float32Array%":typeof Float32Array>"u"?lt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?lt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?lt:FinalizationRegistry,"%Function%":HH,"%GeneratorFunction%":vm,"%Int8Array%":typeof Int8Array>"u"?lt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?lt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?lt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":bm&&tn?tn(tn([][Symbol.iterator]())):lt,"%JSON%":typeof JSON=="object"?JSON:lt,"%Map%":typeof Map>"u"?lt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!bm||!tn?lt:tn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?lt:Promise,"%Proxy%":typeof Proxy>"u"?lt:Proxy,"%RangeError%":B1e,"%ReferenceError%":$1e,"%Reflect%":typeof Reflect>"u"?lt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?lt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!bm||!tn?lt:tn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?lt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":bm&&tn?tn(""[Symbol.iterator]()):lt,"%Symbol%":bm?Symbol:lt,"%SyntaxError%":Im,"%ThrowTypeError%":G1e,"%TypedArray%":V1e,"%TypeError%":xm,"%Uint8Array%":typeof Uint8Array>"u"?lt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?lt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?lt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?lt:Uint32Array,"%URIError%":j1e,"%WeakMap%":typeof WeakMap>"u"?lt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?lt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?lt:WeakSet};if(tn)try{null.error}catch(e){UH=tn(tn(e)),Sp["%Error.prototype%"]=UH}var UH,z1e=s(function e(t){var r;if(t==="%AsyncFunction%")r=i5("async function () {}");else if(t==="%GeneratorFunction%")r=i5("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=i5("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&tn&&(r=tn(o.prototype))}return Sp[t]=r,r},"doEval"),VH={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ug=b2(),v2=o5(),H1e=Ug.call(Function.call,Array.prototype.concat),W1e=Ug.call(Function.apply,Array.prototype.splice),zH=Ug.call(Function.call,String.prototype.replace),x2=Ug.call(Function.call,String.prototype.slice),q1e=Ug.call(Function.call,RegExp.prototype.exec),Z1e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X1e=/\\(\\)?/g,Y1e=s(function(t){var r=x2(t,0,1),n=x2(t,-1);if(r==="%"&&n!=="%")throw new Im("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Im("invalid intrinsic syntax, expected opening `%`");var o=[];return zH(t,Z1e,function(i,a,l,c){o[o.length]=l?zH(c,X1e,"$1"):a||i}),o},"stringToPath"),K1e=s(function(t,r){var n=t,o;if(v2(VH,n)&&(o=VH[n],n="%"+o[0]+"%"),v2(Sp,n)){var i=Sp[n];if(i===vm&&(i=z1e(n)),typeof i>"u"&&!r)throw new xm("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new Im("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");WH.exports=s(function(t,r){if(typeof t!="string"||t.length===0)throw new xm("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new xm('"allowMissing" argument must be a boolean');if(q1e(/^%?[^%]*%?$/,t)===null)throw new Im("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Y1e(t),o=n.length>0?n[0]:"",i=K1e("%"+o+"%",r),a=i.name,l=i.value,c=!1,p=i.alias;p&&(o=p[0],W1e(n,H1e([0,1],p)));for(var f=1,m=!0;f<n.length;f+=1){var y=n[f],v=x2(y,0,1),x=x2(y,-1);if((v==='"'||v==="'"||v==="`"||x==='"'||x==="'"||x==="`")&&v!==x)throw new Im("property names with quotes must have matching quotes");if((y==="constructor"||!m)&&(c=!0),o+="."+y,a="%"+o+"%",v2(Sp,a))l=Sp[a];else if(l!=null){if(!(y in l)){if(!r)throw new xm("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ip&&f+1>=n.length){var S=Ip(l,y);m=!!S,m&&"get"in S&&!("originalValue"in S.get)?l=S.get:l=l[y]}else m=v2(l,y),l=l[y];m&&!c&&(Sp[a]=l)}}return l},"GetIntrinsic")});var S2=W((hdt,qH)=>{"use strict";d();var J1e=es(),I2=J1e("%Object.defineProperty%",!0)||!1;if(I2)try{I2({},"a",{value:1})}catch{I2=!1}qH.exports=I2});var P2=W((gdt,ZH)=>{"use strict";d();var Q1e=es(),C2=Q1e("%Object.getOwnPropertyDescriptor%",!0);if(C2)try{C2([],"length")}catch{C2=null}ZH.exports=C2});var T2=W((vdt,KH)=>{"use strict";d();var XH=S2(),e0e=r5(),Sm=hl(),YH=P2();KH.exports=s(function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Sm("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Sm("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Sm("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Sm("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Sm("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Sm("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!YH&&YH(t,r);if(XH)XH(t,r,{configurable:a===null&&c?c.configurable:!a,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:i===null&&c?c.writable:!i});else if(l||!o&&!i&&!a)t[r]=n;else throw new e0e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var w2=W((Sdt,QH)=>{"use strict";d();var a5=S2(),JH=s(function(){return!!a5},"hasPropertyDescriptors");JH.hasArrayLengthDefineBug=s(function(){if(!a5)return null;try{return a5([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");QH.exports=JH});var Ac=W((Tdt,nW)=>{"use strict";d();var t0e=y2(),r0e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n0e=Object.prototype.toString,o0e=Array.prototype.concat,eW=T2(),i0e=s(function(e){return typeof e=="function"&&n0e.call(e)==="[object Function]"},"isFunction"),tW=w2()(),s0e=s(function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!i0e(n)||!n())return}tW?eW(e,t,r,!0):eW(e,t,r)},"defineProperty"),rW=s(function(e,t){var r=arguments.length>2?arguments[2]:{},n=t0e(t);r0e&&(n=o0e.call(n,Object.getOwnPropertySymbols(t)));for(var o=0;o<n.length;o+=1)s0e(e,n[o],t[n[o]],r[n[o]])},"defineProperties");rW.supportsDescriptors=!!tW;nW.exports=rW});var lW=W((Odt,aW)=>{"use strict";d();var a0e=es(),oW=T2(),l0e=w2()(),iW=P2(),sW=hl(),c0e=a0e("%Math.floor%");aW.exports=s(function(t,r){if(typeof t!="function")throw new sW("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||c0e(r)!==r)throw new sW("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,i=!0;if("length"in t&&iW){var a=iW(t,"length");a&&!a.configurable&&(o=!1),a&&!a.writable&&(i=!1)}return(o||i||!n)&&(l0e?oW(t,"length",r,!0,!0):oW(t,"length",r)),t},"setFunctionLength")});var Cp=W((Adt,M2)=>{"use strict";d();var l5=b2(),O2=es(),u0e=lW(),p0e=hl(),pW=O2("%Function.prototype.apply%"),dW=O2("%Function.prototype.call%"),fW=O2("%Reflect.apply%",!0)||l5.call(dW,pW),cW=S2(),d0e=O2("%Math.max%");M2.exports=s(function(t){if(typeof t!="function")throw new p0e("a function is required");var r=fW(l5,dW,arguments);return u0e(r,1+d0e(0,t.length-(arguments.length-1)),!0)},"callBind");var uW=s(function(){return fW(l5,pW,arguments)},"applyBind");cW?cW(M2.exports,"apply",{value:uW}):M2.exports.apply=uW});var $o=W((Fdt,yW)=>{"use strict";d();var mW=es(),hW=Cp(),f0e=hW(mW("String.prototype.indexOf"));yW.exports=s(function(t,r){var n=mW(t,!!r);return typeof n=="function"&&f0e(t,".prototype.")>-1?hW(n):n},"callBoundIntrinsic")});var c5=W((Ndt,IW)=>{"use strict";d();var m0e=y2(),vW=Gg()(),xW=$o(),gW=Object,h0e=xW("Array.prototype.push"),bW=xW("Object.prototype.propertyIsEnumerable"),y0e=vW?Object.getOwnPropertySymbols:null;IW.exports=s(function(t,r){if(t==null)throw new TypeError("target must be an object");var n=gW(t);if(arguments.length===1)return n;for(var o=1;o<arguments.length;++o){var i=gW(arguments[o]),a=m0e(i),l=vW&&(Object.getOwnPropertySymbols||y0e);if(l)for(var c=l(i),p=0;p<c.length;++p){var f=c[p];bW(i,f)&&h0e(a,f)}for(var m=0;m<a.length;++m){var y=a[m];if(bW(i,y)){var v=i[y];n[y]=v}}}return n},"assign")});var p5=W((jdt,SW)=>{"use strict";d();var u5=c5(),g0e=s(function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var o=Object.assign({},r),i="";for(var a in o)i+=a;return e!==i},"lacksProperEnumerationOrder"),b0e=s(function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch{return e[1]==="y"}return!1},"assignHasPendingExceptions");SW.exports=s(function(){return!Object.assign||g0e()||b0e()?u5:Object.assign},"getPolyfill")});var PW=W((Vdt,CW)=>{"use strict";d();var v0e=Ac(),x0e=p5();CW.exports=s(function(){var t=x0e();return v0e(Object,{assign:t},{assign:s(function(){return Object.assign!==t},"assign")}),t},"shimAssign")});var OW=W((Wdt,MW)=>{"use strict";d();var I0e=Ac(),S0e=Cp(),C0e=c5(),TW=p5(),P0e=PW(),T0e=S0e.apply(TW()),wW=s(function(t,r){return T0e(Object,arguments)},"assign");I0e(wW,{getPolyfill:TW,implementation:C0e,shim:P0e});MW.exports=wW});var _W=W((Xdt,EW)=>{"use strict";d();var zg=s(function(){return typeof s(function(){},"f").name=="string"},"functionsHaveNames"),Vg=Object.getOwnPropertyDescriptor;if(Vg)try{Vg([],"length")}catch{Vg=null}zg.functionsHaveConfigurableNames=s(function(){if(!zg()||!Vg)return!1;var t=Vg(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var w0e=Function.prototype.bind;zg.boundFunctionsHaveNames=s(function(){return zg()&&typeof w0e=="function"&&s(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");EW.exports=zg});var DW=W((Jdt,kW)=>{"use strict";d();var AW=T2(),M0e=w2()(),O0e=_W().functionsHaveConfigurableNames(),E0e=hl();kW.exports=s(function(t,r){if(typeof t!="function")throw new E0e("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||O0e)&&(M0e?AW(t,"name",r,!0,!0):AW(t,"name",r)),t},"setFunctionName")});var d5=W((tft,FW)=>{"use strict";d();var _0e=DW(),A0e=hl(),k0e=Object;FW.exports=_0e(s(function(){if(this==null||this!==k0e(this))throw new A0e("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"flags"),"get flags",!0)});var f5=W((oft,LW)=>{"use strict";d();var D0e=d5(),F0e=Ac().supportsDescriptors,L0e=Object.getOwnPropertyDescriptor;LW.exports=s(function(){if(F0e&&/a/mig.flags==="gim"){var t=L0e(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:s(function(){r+="d"},"get")}),Object.defineProperty(n,"sticky",{get:s(function(){r+="y"},"get")}),r==="dy")return t.get}}return D0e},"getPolyfill")});var BW=W((aft,NW)=>{"use strict";d();var R0e=Ac().supportsDescriptors,N0e=f5(),B0e=Object.getOwnPropertyDescriptor,$0e=Object.defineProperty,j0e=TypeError,RW=Object.getPrototypeOf,G0e=/a/;NW.exports=s(function(){if(!R0e||!RW)throw new j0e("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=N0e(),r=RW(G0e),n=B0e(r,"flags");return(!n||n.get!==t)&&$0e(r,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var UW=W((uft,GW)=>{"use strict";d();var U0e=Ac(),V0e=Cp(),z0e=d5(),$W=f5(),H0e=BW(),jW=V0e($W());U0e(jW,{getPolyfill:$W,implementation:z0e,shim:H0e});GW.exports=jW});var kc=W((dft,VW)=>{"use strict";d();var W0e=Gg();VW.exports=s(function(){return W0e()&&!!Symbol.toStringTag},"hasToStringTagShams")});var h5=W((hft,HW)=>{"use strict";d();var q0e=kc()(),Z0e=$o(),m5=Z0e("Object.prototype.toString"),E2=s(function(t){return q0e&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:m5(t)==="[object Arguments]"},"isArguments"),zW=s(function(t){return E2(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&m5(t)!=="[object Array]"&&m5(t.callee)==="[object Function]"},"isArguments"),X0e=function(){return E2(arguments)}();E2.isLegacyArguments=zW;HW.exports=X0e?E2:zW});var WW=W(()=>{d()});var dq=W((Ift,pq)=>{d();var T5=typeof Map=="function"&&Map.prototype,y5=Object.getOwnPropertyDescriptor&&T5?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,A2=T5&&y5&&typeof y5.get=="function"?y5.get:null,qW=T5&&Map.prototype.forEach,w5=typeof Set=="function"&&Set.prototype,g5=Object.getOwnPropertyDescriptor&&w5?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,k2=w5&&g5&&typeof g5.get=="function"?g5.get:null,ZW=w5&&Set.prototype.forEach,Y0e=typeof WeakMap=="function"&&WeakMap.prototype,Wg=Y0e?WeakMap.prototype.has:null,K0e=typeof WeakSet=="function"&&WeakSet.prototype,qg=K0e?WeakSet.prototype.has:null,J0e=typeof WeakRef=="function"&&WeakRef.prototype,XW=J0e?WeakRef.prototype.deref:null,Q0e=Boolean.prototype.valueOf,eve=Object.prototype.toString,tve=Function.prototype.toString,rve=String.prototype.match,M5=String.prototype.slice,Fc=String.prototype.replace,nve=String.prototype.toUpperCase,YW=String.prototype.toLowerCase,iq=RegExp.prototype.test,KW=Array.prototype.concat,ta=Array.prototype.join,ove=Array.prototype.slice,JW=Math.floor,x5=typeof BigInt=="function"?BigInt.prototype.valueOf:null,b5=Object.getOwnPropertySymbols,I5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Cm=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Fn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Cm||!0)?Symbol.toStringTag:null,sq=Object.prototype.propertyIsEnumerable,QW=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function eq(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||iq.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-JW(-e):JW(e);if(n!==e){var o=String(n),i=M5.call(t,o.length+1);return Fc.call(o,r,"$&_")+"."+Fc.call(Fc.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Fc.call(t,r,"$&_")}s(eq,"addNumericSeparator");var S5=WW(),tq=S5.custom,rq=lq(tq)?tq:null;pq.exports=s(function e(t,r,n,o){var i=r||{};if(Dc(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Dc(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Dc(i,"customInspect")?i.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Dc(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Dc(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return uq(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return l?eq(t,c):c}if(typeof t=="bigint"){var p=String(t)+"n";return l?eq(t,p):p}var f=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof t=="object")return C5(t)?"[Array]":"[Object]";var m=Sve(i,n);if(typeof o>"u")o=[];else if(cq(o,t)>=0)return"[Circular]";function y(J,X,ie){if(X&&(o=ove.call(o),o.push(X)),ie){var ee={depth:i.depth};return Dc(i,"quoteStyle")&&(ee.quoteStyle=i.quoteStyle),e(J,ee,n+1,o)}return e(J,i,n+1,o)}if(s(y,"inspect"),typeof t=="function"&&!nq(t)){var v=fve(t),x=_2(t,y);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(x.length>0?" { "+ta.call(x,", ")+" }":"")}if(lq(t)){var S=Cm?Fc.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):I5.call(t);return typeof t=="object"&&!Cm?Hg(S):S}if(vve(t)){for(var I="<"+YW.call(String(t.nodeName)),P=t.attributes||[],T=0;T<P.length;T++)I+=" "+P[T].name+"="+aq(ive(P[T].value),"double",i);return I+=">",t.childNodes&&t.childNodes.length&&(I+="..."),I+="</"+YW.call(String(t.nodeName))+">",I}if(C5(t)){if(t.length===0)return"[]";var M=_2(t,y);return m&&!Ive(M)?"["+P5(M,m)+"]":"[ "+ta.call(M,", ")+" ]"}if(ave(t)){var w=_2(t,y);return!("cause"in Error.prototype)&&"cause"in t&&!sq.call(t,"cause")?"{ ["+String(t)+"] "+ta.call(KW.call("[cause]: "+y(t.cause),w),", ")+" }":w.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+ta.call(w,", ")+" }"}if(typeof t=="object"&&a){if(rq&&typeof t[rq]=="function"&&S5)return S5(t,{depth:f-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(mve(t)){var E=[];return qW&&qW.call(t,function(J,X){E.push(y(X,t,!0)+" => "+y(J,t))}),oq("Map",A2.call(t),E,m)}if(gve(t)){var B=[];return ZW&&ZW.call(t,function(J){B.push(y(J,t))}),oq("Set",k2.call(t),B,m)}if(hve(t))return v5("WeakMap");if(bve(t))return v5("WeakSet");if(yve(t))return v5("WeakRef");if(cve(t))return Hg(y(Number(t)));if(pve(t))return Hg(y(x5.call(t)));if(uve(t))return Hg(Q0e.call(t));if(lve(t))return Hg(y(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!sve(t)&&!nq(t)){var D=_2(t,y),F=QW?QW(t)===Object.prototype:t instanceof Object||t.constructor===Object,L=t instanceof Object?"":"null prototype",H=!F&&Fn&&Object(t)===t&&Fn in t?M5.call(Lc(t),8,-1):L?"Object":"",U=F||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",G=U+(H||L?"["+ta.call(KW.call([],H||[],L||[]),": ")+"] ":"");return D.length===0?G+"{}":m?G+"{"+P5(D,m)+"}":G+"{ "+ta.call(D,", ")+" }"}return String(t)},"inspect_");function aq(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}s(aq,"wrapQuotes");function ive(e){return Fc.call(String(e),/"/g,"&quot;")}s(ive,"quote");function C5(e){return Lc(e)==="[object Array]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(C5,"isArray");function sve(e){return Lc(e)==="[object Date]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(sve,"isDate");function nq(e){return Lc(e)==="[object RegExp]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(nq,"isRegExp");function ave(e){return Lc(e)==="[object Error]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(ave,"isError");function lve(e){return Lc(e)==="[object String]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(lve,"isString");function cve(e){return Lc(e)==="[object Number]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(cve,"isNumber");function uve(e){return Lc(e)==="[object Boolean]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(uve,"isBoolean");function lq(e){if(Cm)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!I5)return!1;try{return I5.call(e),!0}catch{}return!1}s(lq,"isSymbol");function pve(e){if(!e||typeof e!="object"||!x5)return!1;try{return x5.call(e),!0}catch{}return!1}s(pve,"isBigInt");var dve=Object.prototype.hasOwnProperty||function(e){return e in this};function Dc(e,t){return dve.call(e,t)}s(Dc,"has");function Lc(e){return eve.call(e)}s(Lc,"toStr");function fve(e){if(e.name)return e.name;var t=rve.call(tve.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}s(fve,"nameOf");function cq(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}s(cq,"indexOf");function mve(e){if(!A2||!e||typeof e!="object")return!1;try{A2.call(e);try{k2.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}s(mve,"isMap");function hve(e){if(!Wg||!e||typeof e!="object")return!1;try{Wg.call(e,Wg);try{qg.call(e,qg)}catch{return!0}return e instanceof WeakMap}catch{}return!1}s(hve,"isWeakMap");function yve(e){if(!XW||!e||typeof e!="object")return!1;try{return XW.call(e),!0}catch{}return!1}s(yve,"isWeakRef");function gve(e){if(!k2||!e||typeof e!="object")return!1;try{k2.call(e);try{A2.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}s(gve,"isSet");function bve(e){if(!qg||!e||typeof e!="object")return!1;try{qg.call(e,qg);try{Wg.call(e,Wg)}catch{return!0}return e instanceof WeakSet}catch{}return!1}s(bve,"isWeakSet");function vve(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}s(vve,"isElement");function uq(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return uq(M5.call(e,0,t.maxStringLength),t)+n}var o=Fc.call(Fc.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,xve);return aq(o,"single",t)}s(uq,"inspectString");function xve(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+nve.call(t.toString(16))}s(xve,"lowbyte");function Hg(e){return"Object("+e+")"}s(Hg,"markBoxed");function v5(e){return e+" { ? }"}s(v5,"weakCollectionOf");function oq(e,t,r,n){var o=n?P5(r,n):ta.call(r,", ");return e+" ("+t+") {"+o+"}"}s(oq,"collectionOf");function Ive(e){for(var t=0;t<e.length;t++)if(cq(e[t],"\n")>=0)return!1;return!0}s(Ive,"singleLineValues");function Sve(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=ta.call(Array(e.indent+1)," ");else return null;return{base:r,prev:ta.call(Array(t+1),r)}}s(Sve,"getIndent");function P5(e,t){if(e.length===0)return"";var r="\n"+t.prev+t.base;return r+ta.call(e,","+r)+"\n"+t.prev}s(P5,"indentedJoin");function _2(e,t){var r=C5(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=Dc(e,o)?t(e[o],e):""}var i=typeof b5=="function"?b5(e):[],a;if(Cm){a={};for(var l=0;l<i.length;l++)a["$"+i[l]]=i[l]}for(var c in e)Dc(e,c)&&(r&&String(Number(c))===c&&c<e.length||Cm&&a["$"+c]instanceof Symbol||(iq.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if(typeof b5=="function")for(var p=0;p<i.length;p++)sq.call(e,i[p])&&n.push("["+t(i[p])+"]: "+t(e[i[p]],e));return n}s(_2,"arrObjKeys")});var E5=W((Pft,mq)=>{"use strict";d();var fq=es(),Pm=$o(),Cve=dq(),Pve=hl(),D2=fq("%WeakMap%",!0),F2=fq("%Map%",!0),Tve=Pm("WeakMap.prototype.get",!0),wve=Pm("WeakMap.prototype.set",!0),Mve=Pm("WeakMap.prototype.has",!0),Ove=Pm("Map.prototype.get",!0),Eve=Pm("Map.prototype.set",!0),_ve=Pm("Map.prototype.has",!0),O5=s(function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},"listGetNode"),Ave=s(function(e,t){var r=O5(e,t);return r&&r.value},"listGet"),kve=s(function(e,t,r){var n=O5(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},"listSet"),Dve=s(function(e,t){return!!O5(e,t)},"listHas");mq.exports=s(function(){var t,r,n,o={assert:s(function(i){if(!o.has(i))throw new Pve("Side channel does not contain "+Cve(i))},"assert"),get:s(function(i){if(D2&&i&&(typeof i=="object"||typeof i=="function")){if(t)return Tve(t,i)}else if(F2){if(r)return Ove(r,i)}else if(n)return Ave(n,i)},"get"),has:s(function(i){if(D2&&i&&(typeof i=="object"||typeof i=="function")){if(t)return Mve(t,i)}else if(F2){if(r)return _ve(r,i)}else if(n)return Dve(n,i);return!1},"has"),set:s(function(i,a){D2&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new D2),wve(t,i,a)):F2?(r||(r=new F2),Eve(r,i,a)):(n||(n={key:{},next:null}),kve(n,i,a))},"set")};return o},"getSideChannel")});var yq=W((Mft,hq)=>{"use strict";d();var Fve=o5(),Zg=E5()(),yl=hl(),_5={assert:s(function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new yl("`O` is not an object");if(typeof t!="string")throw new yl("`slot` must be a string");if(Zg.assert(e),!_5.has(e,t))throw new yl("`"+t+"` is not present on `O`")},"assert"),get:s(function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new yl("`O` is not an object");if(typeof t!="string")throw new yl("`slot` must be a string");var r=Zg.get(e);return r&&r["$"+t]},"get"),has:s(function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new yl("`O` is not an object");if(typeof t!="string")throw new yl("`slot` must be a string");var r=Zg.get(e);return!!r&&Fve(r,"$"+t)},"has"),set:s(function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new yl("`O` is not an object");if(typeof t!="string")throw new yl("`slot` must be a string");var n=Zg.get(e);n||(n={},Zg.set(e,n)),n["$"+t]=r},"set")};Object.freeze&&Object.freeze(_5);hq.exports=_5});var vq=W((_ft,bq)=>{"use strict";d();var Xg=yq(),Lve=SyntaxError,gq=typeof StopIteration=="object"?StopIteration:null;bq.exports=s(function(t){if(!gq)throw new Lve("this environment lacks StopIteration");Xg.set(t,"[[Done]]",!1);var r={next:s(function(){var o=Xg.get(this,"[[Iterator]]"),i=Xg.get(o,"[[Done]]");try{return{done:i,value:i?void 0:o.next()}}catch(a){if(Xg.set(o,"[[Done]]",!0),a!==gq)throw a;return{done:!0,value:void 0}}},"next")};return Xg.set(r,"[[Iterator]]",t),r},"getStopIterationIterator")});var A5=W((Dft,xq)=>{d();var Rve={}.toString;xq.exports=Array.isArray||function(e){return Rve.call(e)=="[object Array]"}});var k5=W((Lft,Iq)=>{"use strict";d();var Nve=String.prototype.valueOf,Bve=s(function(t){try{return Nve.call(t),!0}catch{return!1}},"tryStringObject"),$ve=Object.prototype.toString,jve="[object String]",Gve=kc()();Iq.exports=s(function(t){return typeof t=="string"?!0:typeof t!="object"?!1:Gve?Bve(t):$ve.call(t)===jve},"isString")});var F5=W((Bft,Pq)=>{"use strict";d();var D5=typeof Map=="function"&&Map.prototype?Map:null,Uve=typeof Set=="function"&&Set.prototype?Set:null,L2;D5||(L2=s(function(t){return!1},"isMap"));var Cq=D5?Map.prototype.has:null,Sq=Uve?Set.prototype.has:null;!L2&&!Cq&&(L2=s(function(t){return!1},"isMap"));Pq.exports=L2||s(function(t){if(!t||typeof t!="object")return!1;try{if(Cq.call(t),Sq)try{Sq.call(t)}catch{return!0}return t instanceof D5}catch{}return!1},"isMap")});var R5=W((Gft,Mq)=>{"use strict";d();var Vve=typeof Map=="function"&&Map.prototype?Map:null,L5=typeof Set=="function"&&Set.prototype?Set:null,R2;L5||(R2=s(function(t){return!1},"isSet"));var Tq=Vve?Map.prototype.has:null,wq=L5?Set.prototype.has:null;!R2&&!wq&&(R2=s(function(t){return!1},"isSet"));Mq.exports=R2||s(function(t){if(!t||typeof t!="object")return!1;try{if(wq.call(t),Tq)try{Tq.call(t)}catch{return!0}return t instanceof L5}catch{}return!1},"isSet")});var $q=W((zft,$2)=>{"use strict";d();var Oq=h5(),Eq=vq();g2()()||Gg()()?(N2=Symbol.iterator,$2.exports=s(function(t){if(t!=null&&typeof t[N2]<"u")return t[N2]();if(Oq(t))return Array.prototype[N2].call(t)},"getIterator")):(_q=A5(),Aq=k5(),N5=es(),kq=N5("%Map%",!0),Dq=N5("%Set%",!0),bi=$o(),B5=bi("Array.prototype.push"),$5=bi("String.prototype.charCodeAt"),Fq=bi("String.prototype.slice"),Lq=s(function(t,r){var n=t.length;if(r+1>=n)return r+1;var o=$5(t,r);if(o<55296||o>56319)return r+1;var i=$5(t,r+1);return i<56320||i>57343?r+1:r+2},"advanceStringIndex"),B2=s(function(t){var r=0;return{next:s(function(){var o=r>=t.length,i;return o||(i=t[r],r+=1),{done:o,value:i}},"next")}},"getArrayIterator"),j5=s(function(t,r){if(_q(t)||Oq(t))return B2(t);if(Aq(t)){var n=0;return{next:s(function(){var i=Lq(t,n),a=Fq(t,n,i);return n=i,{done:i>t.length,value:a}},"next")}}if(r&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},"getNonCollectionIterator"),!kq&&!Dq?$2.exports=s(function(t){if(t!=null)return j5(t,!0)},"getIterator"):(Rq=F5(),Nq=R5(),G5=bi("Map.prototype.forEach",!0),U5=bi("Set.prototype.forEach",!0),(typeof b>"u"||!b.versions||!b.versions.node)&&(V5=bi("Map.prototype.iterator",!0),z5=bi("Set.prototype.iterator",!0)),H5=bi("Map.prototype.@@iterator",!0)||bi("Map.prototype._es6-shim iterator_",!0),W5=bi("Set.prototype.@@iterator",!0)||bi("Set.prototype._es6-shim iterator_",!0),Bq=s(function(t){if(Rq(t)){if(V5)return Eq(V5(t));if(H5)return H5(t);if(G5){var r=[];return G5(t,function(o,i){B5(r,[i,o])}),B2(r)}}if(Nq(t)){if(z5)return Eq(z5(t));if(W5)return W5(t);if(U5){var n=[];return U5(t,function(o){B5(n,o)}),B2(n)}}},"getCollectionIterator"),$2.exports=s(function(t){return Bq(t)||j5(t)},"getIterator")));var N2,_q,Aq,N5,kq,Dq,bi,B5,$5,Fq,Lq,B2,j5,Rq,Nq,G5,U5,V5,z5,H5,W5,Bq});var q5=W((qft,Gq)=>{"use strict";d();var jq=s(function(e){return e!==e},"numberIsNaN");Gq.exports=s(function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||jq(t)&&jq(r))},"is")});var Z5=W((Yft,Uq)=>{"use strict";d();var zve=q5();Uq.exports=s(function(){return typeof Object.is=="function"?Object.is:zve},"getPolyfill")});var zq=W((Qft,Vq)=>{"use strict";d();var Hve=Z5(),Wve=Ac();Vq.exports=s(function(){var t=Hve();return Wve(Object,{is:t},{is:s(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var Zq=W((rmt,qq)=>{"use strict";d();var qve=Ac(),Zve=Cp(),Xve=q5(),Hq=Z5(),Yve=zq(),Wq=Zve(Hq(),Object);qve(Wq,{getPolyfill:Hq,implementation:Xve,shim:Yve});qq.exports=Wq});var Y5=W((omt,Jq)=>{"use strict";d();var Kve=Cp(),Kq=$o(),Jve=es(),X5=Jve("%ArrayBuffer%",!0),j2=Kq("ArrayBuffer.prototype.byteLength",!0),Qve=Kq("Object.prototype.toString"),Xq=!!X5&&!j2&&new X5(0).slice,Yq=!!Xq&&Kve(Xq);Jq.exports=s(j2||Yq?function(t){if(!t||typeof t!="object")return!1;try{return j2?j2(t):Yq(t,0),!0}catch{return!1}}:X5?function(t){return Qve(t)==="[object ArrayBuffer]"}:function(t){return!1},"isArrayBuffer")});var eZ=W((amt,Qq)=>{"use strict";d();var exe=Date.prototype.getDay,txe=s(function(t){try{return exe.call(t),!0}catch{return!1}},"tryDateGetDayCall"),rxe=Object.prototype.toString,nxe="[object Date]",oxe=kc()();Qq.exports=s(function(t){return typeof t!="object"||t===null?!1:oxe?txe(t):rxe.call(t)===nxe},"isDateObject")});var iZ=W((umt,oZ)=>{"use strict";d();var K5=$o(),tZ=kc()(),rZ,nZ,J5,Q5;tZ&&(rZ=K5("Object.prototype.hasOwnProperty"),nZ=K5("RegExp.prototype.exec"),J5={},G2=s(function(){throw J5},"throwRegexMarker"),Q5={toString:G2,valueOf:G2},typeof Symbol.toPrimitive=="symbol"&&(Q5[Symbol.toPrimitive]=G2));var G2,ixe=K5("Object.prototype.toString"),sxe=Object.getOwnPropertyDescriptor,axe="[object RegExp]";oZ.exports=s(tZ?function(t){if(!t||typeof t!="object")return!1;var r=sxe(t,"lastIndex"),n=r&&rZ(r,"value");if(!n)return!1;try{nZ(t,Q5)}catch(o){return o===J5}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:ixe(t)===axe},"isRegex")});var lZ=W((fmt,aZ)=>{"use strict";d();var lxe=$o(),sZ=lxe("SharedArrayBuffer.prototype.byteLength",!0);aZ.exports=s(sZ?function(t){if(!t||typeof t!="object")return!1;try{return sZ(t),!0}catch{return!1}}:function(t){return!1},"isSharedArrayBuffer")});var uZ=W((ymt,cZ)=>{"use strict";d();var cxe=Number.prototype.toString,uxe=s(function(t){try{return cxe.call(t),!0}catch{return!1}},"tryNumberObject"),pxe=Object.prototype.toString,dxe="[object Number]",fxe=kc()();cZ.exports=s(function(t){return typeof t=="number"?!0:typeof t!="object"?!1:fxe?uxe(t):pxe.call(t)===dxe},"isNumberObject")});var fZ=W((vmt,dZ)=>{"use strict";d();var pZ=$o(),mxe=pZ("Boolean.prototype.toString"),hxe=pZ("Object.prototype.toString"),yxe=s(function(t){try{return mxe(t),!0}catch{return!1}},"booleanBrandCheck"),gxe="[object Boolean]",bxe=kc()();dZ.exports=s(function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:bxe&&Symbol.toStringTag in t?yxe(t):hxe(t)===gxe},"isBoolean")});var gZ=W((Smt,eO)=>{"use strict";d();var vxe=Object.prototype.toString,xxe=g2()();xxe?(mZ=Symbol.prototype.toString,hZ=/^Symbol\(.*\)$/,yZ=s(function(t){return typeof t.valueOf()!="symbol"?!1:hZ.test(mZ.call(t))},"isRealSymbolObject"),eO.exports=s(function(t){if(typeof t=="symbol")return!0;if(vxe.call(t)!=="[object Symbol]")return!1;try{return yZ(t)}catch{return!1}},"isSymbol")):eO.exports=s(function(t){return!1},"isSymbol");var mZ,hZ,yZ});var xZ=W((Tmt,vZ)=>{"use strict";d();var bZ=typeof BigInt<"u"&&BigInt;vZ.exports=s(function(){return typeof bZ=="function"&&typeof BigInt=="function"&&typeof bZ(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var CZ=W((Omt,tO)=>{"use strict";d();var Ixe=xZ()();Ixe?(IZ=BigInt.prototype.valueOf,SZ=s(function(t){try{return IZ.call(t),!0}catch{}return!1},"tryBigIntObject"),tO.exports=s(function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:SZ(t)},"isBigInt")):tO.exports=s(function(t){return!1},"isBigInt");var IZ,SZ});var TZ=W((Amt,PZ)=>{"use strict";d();var Sxe=k5(),Cxe=uZ(),Pxe=fZ(),Txe=gZ(),wxe=CZ();PZ.exports=s(function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(Sxe(t))return"String";if(Cxe(t))return"Number";if(Pxe(t))return"Boolean";if(Txe(t))return"Symbol";if(wxe(t))return"BigInt"},"whichBoxedPrimitive")});var OZ=W((Fmt,MZ)=>{"use strict";d();var U2=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,wZ=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,V2;U2||(V2=s(function(t){return!1},"isWeakMap"));var nO=U2?U2.prototype.has:null,rO=wZ?wZ.prototype.has:null;!V2&&!nO&&(V2=s(function(t){return!1},"isWeakMap"));MZ.exports=V2||s(function(t){if(!t||typeof t!="object")return!1;try{if(nO.call(t,nO),rO)try{rO.call(t,rO)}catch{return!0}return t instanceof U2}catch{}return!1},"isWeakMap")});var _Z=W((Nmt,iO)=>{"use strict";d();var Mxe=es(),EZ=$o(),Oxe=Mxe("%WeakSet%",!0),oO=EZ("WeakSet.prototype.has",!0);oO?(z2=EZ("WeakMap.prototype.has",!0),iO.exports=s(function(t){if(!t||typeof t!="object")return!1;try{if(oO(t,oO),z2)try{z2(t,z2)}catch{return!0}return t instanceof Oxe}catch{}return!1},"isWeakSet")):iO.exports=s(function(t){return!1},"isWeakSet");var z2});var kZ=W((jmt,AZ)=>{"use strict";d();var Exe=F5(),_xe=R5(),Axe=OZ(),kxe=_Z();AZ.exports=s(function(t){if(t&&typeof t=="object"){if(Exe(t))return"Map";if(_xe(t))return"Set";if(Axe(t))return"WeakMap";if(kxe(t))return"WeakSet"}return!1},"whichCollection")});var RZ=W((Vmt,LZ)=>{"use strict";d();var FZ=Function.prototype.toString,Tm=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,aO,H2;if(typeof Tm=="function"&&typeof Object.defineProperty=="function")try{aO=Object.defineProperty({},"length",{get:s(function(){throw H2},"get")}),H2={},Tm(function(){throw 42},null,aO)}catch(e){e!==H2&&(Tm=null)}else Tm=null;var Dxe=/^\s*class\b/,lO=s(function(t){try{var r=FZ.call(t);return Dxe.test(r)}catch{return!1}},"isES6ClassFunction"),sO=s(function(t){try{return lO(t)?!1:(FZ.call(t),!0)}catch{return!1}},"tryFunctionToStr"),W2=Object.prototype.toString,Fxe="[object Object]",Lxe="[object Function]",Rxe="[object GeneratorFunction]",Nxe="[object HTMLAllCollection]",Bxe="[object HTML document.all class]",$xe="[object HTMLCollection]",jxe=typeof Symbol=="function"&&!!Symbol.toStringTag,Gxe=!(0 in[,]),cO=s(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(DZ=document.all,W2.call(DZ)===W2.call(document.all)&&(cO=s(function(t){if((Gxe||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=W2.call(t);return(r===Nxe||r===Bxe||r===$xe||r===Fxe)&&t("")==null}catch{}return!1},"isDocumentDotAll")));var DZ;LZ.exports=s(Tm?function(t){if(cO(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Tm(t,null,aO)}catch(r){if(r!==H2)return!1}return!lO(t)&&sO(t)}:function(t){if(cO(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(jxe)return sO(t);if(lO(t))return!1;var r=W2.call(t);return r!==Lxe&&r!==Rxe&&!/^\[object HTML/.test(r)?!1:sO(t)},"isCallable")});var $Z=W((Wmt,BZ)=>{"use strict";d();var Uxe=RZ(),Vxe=Object.prototype.toString,NZ=Object.prototype.hasOwnProperty,zxe=s(function(t,r,n){for(var o=0,i=t.length;o<i;o++)NZ.call(t,o)&&(n==null?r(t[o],o,t):r.call(n,t[o],o,t))},"forEachArray"),Hxe=s(function(t,r,n){for(var o=0,i=t.length;o<i;o++)n==null?r(t.charAt(o),o,t):r.call(n,t.charAt(o),o,t)},"forEachString"),Wxe=s(function(t,r,n){for(var o in t)NZ.call(t,o)&&(n==null?r(t[o],o,t):r.call(n,t[o],o,t))},"forEachObject"),qxe=s(function(t,r,n){if(!Uxe(r))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=n),Vxe.call(t)==="[object Array]"?zxe(t,r,o):typeof t=="string"?Hxe(t,r,o):Wxe(t,r,o)},"forEach");BZ.exports=qxe});var GZ=W((Xmt,jZ)=>{"use strict";d();jZ.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var VZ=W((Kmt,UZ)=>{"use strict";d();var uO=GZ(),Zxe=typeof globalThis>"u"?global:globalThis;UZ.exports=s(function(){for(var t=[],r=0;r<uO.length;r++)typeof Zxe[uO[r]]=="function"&&(t[t.length]=uO[r]);return t},"availableTypedArrays")});var ZZ=W((eht,qZ)=>{"use strict";d();var Z2=$Z(),Xxe=VZ(),zZ=Cp(),fO=$o(),q2=P2(),Yxe=fO("Object.prototype.toString"),WZ=kc()(),HZ=typeof globalThis>"u"?global:globalThis,dO=Xxe(),mO=fO("String.prototype.slice"),pO=Object.getPrototypeOf,Kxe=fO("Array.prototype.indexOf",!0)||s(function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},"indexOf"),X2={__proto__:null};WZ&&q2&&pO?Z2(dO,function(e){var t=new HZ[e];if(Symbol.toStringTag in t){var r=pO(t),n=q2(r,Symbol.toStringTag);if(!n){var o=pO(r);n=q2(o,Symbol.toStringTag)}X2["$"+e]=zZ(n.get)}}):Z2(dO,function(e){var t=new HZ[e],r=t.slice||t.set;r&&(X2["$"+e]=zZ(r))});var Jxe=s(function(t){var r=!1;return Z2(X2,function(n,o){if(!r)try{"$"+n(t)===o&&(r=mO(o,1))}catch{}}),r},"tryAllTypedArrays"),Qxe=s(function(t){var r=!1;return Z2(X2,function(n,o){if(!r)try{n(t),r=mO(o,1)}catch{}}),r},"tryAllSlices");qZ.exports=s(function(t){if(!t||typeof t!="object")return!1;if(!WZ){var r=mO(Yxe(t),8,-1);return Kxe(dO,r)>-1?r:r!=="Object"?!1:Qxe(t)}return q2?Jxe(t):null},"whichTypedArray")});var KZ=W((nht,YZ)=>{"use strict";d();var e2e=$o(),XZ=e2e("ArrayBuffer.prototype.byteLength",!0),t2e=Y5();YZ.exports=s(function(t){return t2e(t)?XZ?XZ(t):t.byteLength:NaN},"byteLength")});var SX=W((sht,IX)=>{"use strict";d();var bX=OW(),ra=$o(),JZ=UW(),r2e=es(),wm=$q(),n2e=E5(),QZ=Zq(),eX=h5(),tX=A5(),rX=Y5(),nX=eZ(),oX=iZ(),iX=lZ(),sX=y2(),aX=TZ(),lX=kZ(),cX=ZZ(),uX=KZ(),pX=ra("SharedArrayBuffer.prototype.byteLength",!0),dX=ra("Date.prototype.getTime"),hO=Object.getPrototypeOf,fX=ra("Object.prototype.toString"),K2=r2e("%Set%",!0),yO=ra("Map.prototype.has",!0),J2=ra("Map.prototype.get",!0),mX=ra("Map.prototype.size",!0),Q2=ra("Set.prototype.add",!0),vX=ra("Set.prototype.delete",!0),eI=ra("Set.prototype.has",!0),Y2=ra("Set.prototype.size",!0);function hX(e,t,r,n){for(var o=wm(e),i;(i=o.next())&&!i.done;)if(ts(t,i.value,r,n))return vX(e,i.value),!0;return!1}s(hX,"setHasEqualElement");function xX(e){if(typeof e>"u")return null;if(typeof e!="object")return typeof e=="symbol"?!1:typeof e=="string"||typeof e=="number"?+e==+e:!0}s(xX,"findLooseMatchingPrimitives");function o2e(e,t,r,n,o,i){var a=xX(r);if(a!=null)return a;var l=J2(t,a),c=bX({},o,{strict:!1});return typeof l>"u"&&!yO(t,a)||!ts(n,l,c,i)?!1:!yO(e,a)&&ts(n,l,c,i)}s(o2e,"mapMightHaveLoosePrim");function i2e(e,t,r){var n=xX(r);return n!=null?n:eI(t,n)&&!eI(e,n)}s(i2e,"setMightHaveLoosePrim");function yX(e,t,r,n,o,i){for(var a=wm(e),l,c;(l=a.next())&&!l.done;)if(c=l.value,ts(r,c,o,i)&&ts(n,J2(t,c),o,i))return vX(e,c),!0;return!1}s(yX,"mapHasEqualEntry");function ts(e,t,r,n){var o=r||{};if(o.strict?QZ(e,t):e===t)return!0;var i=aX(e),a=aX(t);if(i!==a)return!1;if(!e||!t||typeof e!="object"&&typeof t!="object")return o.strict?QZ(e,t):e==t;var l=n.has(e),c=n.has(t),p;if(l&&c){if(n.get(e)===n.get(t))return!0}else p={};return l||n.set(e,p),c||n.set(t,p),l2e(e,t,o,n)}s(ts,"internalDeepEqual");function gX(e){return!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}s(gX,"isBuffer");function s2e(e,t,r,n){if(Y2(e)!==Y2(t))return!1;for(var o=wm(e),i=wm(t),a,l,c;(a=o.next())&&!a.done;)if(a.value&&typeof a.value=="object")c||(c=new K2),Q2(c,a.value);else if(!eI(t,a.value)){if(r.strict||!i2e(e,t,a.value))return!1;c||(c=new K2),Q2(c,a.value)}if(c){for(;(l=i.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!hX(c,l.value,r.strict,n))return!1}else if(!r.strict&&!eI(e,l.value)&&!hX(c,l.value,r.strict,n))return!1;return Y2(c)===0}return!0}s(s2e,"setEquiv");function a2e(e,t,r,n){if(mX(e)!==mX(t))return!1;for(var o=wm(e),i=wm(t),a,l,c,p,f,m;(a=o.next())&&!a.done;)if(p=a.value[0],f=a.value[1],p&&typeof p=="object")c||(c=new K2),Q2(c,p);else if(m=J2(t,p),typeof m>"u"&&!yO(t,p)||!ts(f,m,r,n)){if(r.strict||!o2e(e,t,p,f,r,n))return!1;c||(c=new K2),Q2(c,p)}if(c){for(;(l=i.next())&&!l.done;)if(p=l.value[0],m=l.value[1],p&&typeof p=="object"){if(!yX(c,e,p,m,r,n))return!1}else if(!r.strict&&(!e.has(p)||!ts(J2(e,p),m,r,n))&&!yX(c,e,p,m,bX({},r,{strict:!1}),n))return!1;return Y2(c)===0}return!0}s(a2e,"mapEquiv");function l2e(e,t,r,n){var o,i;if(typeof e!=typeof t||e==null||t==null||fX(e)!==fX(t)||eX(e)!==eX(t))return!1;var a=tX(e),l=tX(t);if(a!==l)return!1;var c=e instanceof Error,p=t instanceof Error;if(c!==p||(c||p)&&(e.name!==t.name||e.message!==t.message))return!1;var f=oX(e),m=oX(t);if(f!==m||(f||m)&&(e.source!==t.source||JZ(e)!==JZ(t)))return!1;var y=nX(e),v=nX(t);if(y!==v||(y||v)&&dX(e)!==dX(t)||r.strict&&hO&&hO(e)!==hO(t))return!1;var x=cX(e),S=cX(t);if(x!==S)return!1;if(x||S){if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var I=gX(e),P=gX(t);if(I!==P)return!1;if(I||P){if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var T=rX(e),M=rX(t);if(T!==M)return!1;if(T||M)return uX(e)!==uX(t)?!1:typeof Uint8Array=="function"&&ts(new Uint8Array(e),new Uint8Array(t),r,n);var w=iX(e),E=iX(t);if(w!==E)return!1;if(w||E)return pX(e)!==pX(t)?!1:typeof Uint8Array=="function"&&ts(new Uint8Array(e),new Uint8Array(t),r,n);if(typeof e!=typeof t)return!1;var B=sX(e),D=sX(t);if(B.length!==D.length)return!1;for(B.sort(),D.sort(),o=B.length-1;o>=0;o--)if(B[o]!=D[o])return!1;for(o=B.length-1;o>=0;o--)if(i=B[o],!ts(e[i],t[i],r,n))return!1;var F=lX(e),L=lX(t);return F!==L?!1:F==="Set"||L==="Set"?s2e(e,t,r,n):F==="Map"?a2e(e,t,r,n):!0}s(l2e,"objEquiv");IX.exports=s(function(t,r,n){return ts(t,r,n,n2e())},"deepEqual")});var BX=W(kt=>{"use strict";d();Object.defineProperty(kt,"__esModule",{value:!0});function c2e(e){return e&&e.__esModule?e:{default:e}}s(c2e,"_interopRequireDefault");var u2e=Object.defineProperty,jt=s((e,t)=>u2e(e,"name",{value:t,configurable:!0}),"__name"),p2e=SX(),d2e=c2e(p2e),Mm,CX=(Mm=class{constructor(t){this.direction=!1,this.compareProperties=!0;var r,n,o;this.precision=10**-((r=t==null?void 0:t.precision)!=null?r:17),this.direction=(n=t==null?void 0:t.direction)!=null?n:!1,this.compareProperties=(o=t==null?void 0:t.compareProperties)!=null?o:!0}compare(t,r){if(t.type!==r.type||!Yg(t,r))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,r.coordinates);case"LineString":return this.compareLine(t.coordinates,r.coordinates);case"Polygon":return this.comparePolygon(t,r);case"GeometryCollection":return this.compareGeometryCollection(t,r);case"Feature":return this.compareFeature(t,r);case"FeatureCollection":return this.compareFeatureCollection(t,r);default:if(t.type.startsWith("Multi")){let n=gO(t),o=gO(r);return n.every(i=>o.some(a=>this.compare(i,a)))}}return!1}compareCoord(t,r){return t.length===r.length&&t.every((n,o)=>Math.abs(n-r[o])<this.precision)}compareLine(t,r,n=0,o=!1){if(!Yg(t,r))return!1;let i=t,a=r;if(o&&!this.compareCoord(i[0],a[0])){let c=this.fixStartIndex(a,i);if(c)a=c;else return!1}let l=this.compareCoord(i[n],a[n]);return this.direction||l?this.comparePath(i,a):this.compareCoord(i[n],a[a.length-(1+n)])?this.comparePath(i.slice().reverse(),a):!1}fixStartIndex(t,r){let n,o=-1;for(let i=0;i<t.length;i++)if(this.compareCoord(t[i],r[0])){o=i;break}return o>=0&&(n=[].concat(t.slice(o,t.length),t.slice(1,o+1))),n}comparePath(t,r){return t.every((n,o)=>this.compareCoord(n,r[o]))}comparePolygon(t,r){if(this.compareLine(t.coordinates[0],r.coordinates[0],1,!0)){let n=t.coordinates.slice(1,t.coordinates.length),o=r.coordinates.slice(1,r.coordinates.length);return n.every(i=>o.some(a=>this.compareLine(i,a,1,!0)))}return!1}compareGeometryCollection(t,r){return Yg(t.geometries,r.geometries)&&this.compareBBox(t,r)&&t.geometries.every((n,o)=>this.compare(n,r.geometries[o]))}compareFeature(t,r){return t.id===r.id&&(this.compareProperties?d2e.default.call(void 0,t.properties,r.properties):!0)&&this.compareBBox(t,r)&&this.compare(t.geometry,r.geometry)}compareFeatureCollection(t,r){return Yg(t.features,r.features)&&this.compareBBox(t,r)&&t.features.every((n,o)=>this.compare(n,r.features[o]))}compareBBox(t,r){return!t.bbox&&!r.bbox||(t.bbox&&r.bbox?this.compareCoord(t.bbox,r.bbox):!1)}},s(Mm,"_GeojsonEquality"),Mm);jt(CX,"GeojsonEquality");var f2e=CX;function Yg(e,t){return e.coordinates?e.coordinates.length===t.coordinates.length:e.length===t.length}s(Yg,"sameLength");jt(Yg,"sameLength");function gO(e){return e.coordinates.map(t=>({type:e.type.replace("Multi",""),coordinates:t}))}s(gO,"explode");jt(gO,"explode");var Io=63710088e-1,vO={centimeters:Io*100,centimetres:Io*100,degrees:360/(2*Math.PI),feet:Io*3.28084,inches:Io*39.37,kilometers:Io/1e3,kilometres:Io/1e3,meters:Io,metres:Io,miles:Io/1609.344,millimeters:Io*1e3,millimetres:Io*1e3,nauticalmiles:Io/1852,radians:1,yards:Io*1.0936},bO={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function gl(e,t,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}s(gl,"feature");jt(gl,"feature");function PX(e,t,r={}){switch(e){case"Point":return tI(t).geometry;case"LineString":return nI(t).geometry;case"Polygon":return rI(t).geometry;case"MultiPoint":return IO(t).geometry;case"MultiLineString":return xO(t).geometry;case"MultiPolygon":return SO(t).geometry;default:throw new Error(e+" is invalid")}}s(PX,"geometry");jt(PX,"geometry");function tI(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Kg(e[0])||!Kg(e[1]))throw new Error("coordinates must contain numbers");return gl({type:"Point",coordinates:e},t,r)}s(tI,"point");jt(tI,"point");function TX(e,t,r={}){return Jg(e.map(n=>tI(n,t)),r)}s(TX,"points");jt(TX,"points");function rI(e,t,r={}){for(let o of e){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let i=0;i<o[o.length-1].length;i++)if(o[o.length-1][i]!==o[0][i])throw new Error("First and last Position are not equivalent.")}return gl({type:"Polygon",coordinates:e},t,r)}s(rI,"polygon");jt(rI,"polygon");function wX(e,t,r={}){return Jg(e.map(n=>rI(n,t)),r)}s(wX,"polygons");jt(wX,"polygons");function nI(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return gl({type:"LineString",coordinates:e},t,r)}s(nI,"lineString");jt(nI,"lineString");function MX(e,t,r={}){return Jg(e.map(n=>nI(n,t)),r)}s(MX,"lineStrings");jt(MX,"lineStrings");function Jg(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}s(Jg,"featureCollection");jt(Jg,"featureCollection");function xO(e,t,r={}){return gl({type:"MultiLineString",coordinates:e},t,r)}s(xO,"multiLineString");jt(xO,"multiLineString");function IO(e,t,r={}){return gl({type:"MultiPoint",coordinates:e},t,r)}s(IO,"multiPoint");jt(IO,"multiPoint");function SO(e,t,r={}){return gl({type:"MultiPolygon",coordinates:e},t,r)}s(SO,"multiPolygon");jt(SO,"multiPolygon");function OX(e,t,r={}){return gl({type:"GeometryCollection",geometries:e},t,r)}s(OX,"geometryCollection");jt(OX,"geometryCollection");function EX(e,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");let r=Math.pow(10,t||0);return Math.round(e*r)/r}s(EX,"round");jt(EX,"round");function CO(e,t="kilometers"){let r=vO[t];if(!r)throw new Error(t+" units is invalid");return e*r}s(CO,"radiansToLength");jt(CO,"radiansToLength");function oI(e,t="kilometers"){let r=vO[t];if(!r)throw new Error(t+" units is invalid");return e/r}s(oI,"lengthToRadians");jt(oI,"lengthToRadians");function _X(e,t){return PO(oI(e,t))}s(_X,"lengthToDegrees");jt(_X,"lengthToDegrees");function AX(e){let t=e%360;return t<0&&(t+=360),t}s(AX,"bearingToAzimuth");jt(AX,"bearingToAzimuth");function PO(e){return e%(2*Math.PI)*180/Math.PI}s(PO,"radiansToDegrees");jt(PO,"radiansToDegrees");function kX(e){return e%360*Math.PI/180}s(kX,"degreesToRadians");jt(kX,"degreesToRadians");function DX(e,t="kilometers",r="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return CO(oI(e,t),r)}s(DX,"convertLength");jt(DX,"convertLength");function FX(e,t="meters",r="kilometers"){if(!(e>=0))throw new Error("area must be a positive number");let n=bO[t];if(!n)throw new Error("invalid original units");let o=bO[r];if(!o)throw new Error("invalid final units");return e/n*o}s(FX,"convertArea");jt(FX,"convertArea");function Kg(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}s(Kg,"isNumber");jt(Kg,"isNumber");function LX(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}s(LX,"isObject");jt(LX,"isObject");function RX(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(t=>{if(!Kg(t))throw new Error("bbox must only contain numbers")})}s(RX,"validateBBox");jt(RX,"validateBBox");function NX(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}s(NX,"validateId");jt(NX,"validateId");kt.GeojsonEquality=f2e;kt.areaFactors=bO;kt.bearingToAzimuth=AX;kt.convertArea=FX;kt.convertLength=DX;kt.degreesToRadians=kX;kt.earthRadius=Io;kt.factors=vO;kt.feature=gl;kt.featureCollection=Jg;kt.geometry=PX;kt.geometryCollection=OX;kt.isNumber=Kg;kt.isObject=LX;kt.lengthToDegrees=_X;kt.lengthToRadians=oI;kt.lineString=nI;kt.lineStrings=MX;kt.multiLineString=xO;kt.multiPoint=IO;kt.multiPolygon=SO;kt.point=tI;kt.points=TX;kt.polygon=rI;kt.polygons=wX;kt.radiansToDegrees=PO;kt.radiansToLength=CO;kt.round=EX;kt.validateBBox=RX;kt.validateId=NX});var XX=W(Wr=>{"use strict";d();Object.defineProperty(Wr,"__esModule",{value:!0});var m2e=Object.defineProperty,hn=s((e,t)=>m2e(e,"name",{value:t,configurable:!0}),"__name"),Ln=BX();function Om(e,t,r){if(e!==null)for(var n,o,i,a,l,c,p,f=0,m=0,y,v=e.type,x=v==="FeatureCollection",S=v==="Feature",I=x?e.features.length:1,P=0;P<I;P++){p=x?e.features[P].geometry:S?e.geometry:e,y=p?p.type==="GeometryCollection":!1,l=y?p.geometries.length:1;for(var T=0;T<l;T++){var M=0,w=0;if(a=y?p.geometries[T]:p,a!==null){c=a.coordinates;var E=a.type;switch(f=r&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(t(c,m,P,M,w)===!1)return!1;m++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(t(c[n],m,P,M,w)===!1)return!1;m++,E==="MultiPoint"&&M++}E==="LineString"&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-f;o++){if(t(c[n][o],m,P,M,w)===!1)return!1;m++}E==="MultiLineString"&&M++,E==="Polygon"&&w++}E==="Polygon"&&M++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(w=0,o=0;o<c[n].length;o++){for(i=0;i<c[n][o].length-f;i++){if(t(c[n][o][i],m,P,M,w)===!1)return!1;m++}w++}M++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Om(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(Om,"coordEach");hn(Om,"coordEach");function $X(e,t,r,n){var o=r;return Om(e,function(i,a,l,c,p){a===0&&r===void 0?o=i:o=t(o,i,a,l,c,p)},n),o}s($X,"coordReduce");hn($X,"coordReduce");function TO(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&t(e.features[r].properties,r)!==!1;r++);break;case"Feature":t(e.properties,0);break}}s(TO,"propEach");hn(TO,"propEach");function jX(e,t,r){var n=r;return TO(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(jX,"propReduce");hn(jX,"propReduce");function wO(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}s(wO,"featureEach");hn(wO,"featureEach");function GX(e,t,r){var n=r;return wO(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(GX,"featureReduce");hn(GX,"featureReduce");function UX(e){var t=[];return Om(e,function(r){t.push(r)}),t}s(UX,"coordAll");hn(UX,"coordAll");function iI(e,t){var r,n,o,i,a,l,c,p,f,m,y=0,v=e.type==="FeatureCollection",x=e.type==="Feature",S=v?e.features.length:1;for(r=0;r<S;r++){for(l=v?e.features[r].geometry:x?e.geometry:e,p=v?e.features[r].properties:x?e.properties:{},f=v?e.features[r].bbox:x?e.bbox:void 0,m=v?e.features[r].id:x?e.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,o=0;o<a;o++){if(i=c?l.geometries[o]:l,i===null){if(t(null,y,p,f,m)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,y,p,f,m)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],y,p,f,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}s(iI,"geomEach");hn(iI,"geomEach");function VX(e,t,r){var n=r;return iI(e,function(o,i,a,l,c){i===0&&r===void 0?n=o:n=t(n,o,i,a,l,c)}),n}s(VX,"geomReduce");hn(VX,"geomReduce");function Qg(e,t){iI(e,function(r,n,o,i,a){var l=r===null?null:r.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(Ln.feature.call(void 0,r,o,{bbox:i,id:a}),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 p=0;p<r.coordinates.length;p++){var f=r.coordinates[p],m={type:c,coordinates:f};if(t(Ln.feature.call(void 0,m,o),n,p)===!1)return!1}})}s(Qg,"flattenEach");hn(Qg,"flattenEach");function zX(e,t,r){var n=r;return Qg(e,function(o,i,a){i===0&&a===0&&r===void 0?n=o:n=t(n,o,i,a)}),n}s(zX,"flattenReduce");hn(zX,"flattenReduce");function MO(e,t){Qg(e,function(r,n,o){var i=0;if(r.geometry){var a=r.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,p=0,f=0;if(Om(r,function(m,y,v,x,S){if(l===void 0||n>c||x>p||S>f){l=m,c=n,p=x,f=S,i=0;return}var I=Ln.lineString.call(void 0,[l,m],r.properties);if(t(I,n,o,S,i)===!1)return!1;i++,l=m})===!1)return!1}}})}s(MO,"segmentEach");hn(MO,"segmentEach");function HX(e,t,r){var n=r,o=!1;return MO(e,function(i,a,l,c,p){o===!1&&r===void 0?n=i:n=t(n,i,a,l,c,p),o=!0}),n}s(HX,"segmentReduce");hn(HX,"segmentReduce");function OO(e,t){if(!e)throw new Error("geojson is required");Qg(e,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,a=r.geometry.coordinates;switch(i){case"LineString":if(t(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<a.length;l++)if(t(Ln.lineString.call(void 0,a[l],r.properties),n,o,l)===!1)return!1;break}}})}s(OO,"lineEach");hn(OO,"lineEach");function WX(e,t,r){var n=r;return OO(e,function(o,i,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,a,l)}),n}s(WX,"lineReduce");hn(WX,"lineReduce");function qX(e,t){if(t=t||{},!Ln.isObject.call(void 0,t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.segmentIndex||0,a=t.properties,l;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,l=e.features[r].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=c.length+i-1),Ln.lineString.call(void 0,[c[i],c[i+1]],a,t);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),Ln.lineString.call(void 0,[c[o][i],c[o][i+1]],a,t);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i-1),Ln.lineString.call(void 0,[c[n][i],c[n][i+1]],a,t);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i-1),Ln.lineString.call(void 0,[c[n][o][i],c[n][o][i+1]],a,t)}throw new Error("geojson is invalid")}s(qX,"findSegment");hn(qX,"findSegment");function ZX(e,t){if(t=t||{},!Ln.isObject.call(void 0,t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.coordIndex||0,a=t.properties,l;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,l=e.features[r].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return Ln.point.call(void 0,c,a,t);case"MultiPoint":return n<0&&(n=c.length+n),Ln.point.call(void 0,c[n],a,t);case"LineString":return i<0&&(i=c.length+i),Ln.point.call(void 0,c[i],a,t);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),Ln.point.call(void 0,c[o][i],a,t);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),Ln.point.call(void 0,c[n][i],a,t);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i),Ln.point.call(void 0,c[n][o][i],a,t)}throw new Error("geojson is invalid")}s(ZX,"findPoint");hn(ZX,"findPoint");Wr.coordAll=UX;Wr.coordEach=Om;Wr.coordReduce=$X;Wr.featureEach=wO;Wr.featureReduce=GX;Wr.findPoint=ZX;Wr.findSegment=qX;Wr.flattenEach=Qg;Wr.flattenReduce=zX;Wr.geomEach=iI;Wr.geomReduce=VX;Wr.lineEach=OO;Wr.lineReduce=WX;Wr.propEach=TO;Wr.propReduce=jX;Wr.segmentEach=MO;Wr.segmentReduce=HX});var YX=W(sI=>{"use strict";d();Object.defineProperty(sI,"__esModule",{value:!0});var h2e=Object.defineProperty,y2e=s((e,t)=>h2e(e,"name",{value:t,configurable:!0}),"__name"),g2e=XX();function EO(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;let r=[1/0,1/0,-1/0,-1/0];return g2e.coordEach.call(void 0,e,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}s(EO,"bbox");y2e(EO,"bbox");var b2e=EO;sI.bbox=EO;sI.default=b2e});var tY=W((xht,_O)=>{d();var na=Xz(),JX=K4(),QX=iH(),Em=YX().default,v2e=QX.featureEach,bht=QX.coordEach,vht=JX.polygon,KX=JX.featureCollection;function eY(e){var t=new na(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:Em(r),na.prototype.insert.call(this,r)},t.load=function(r){var n=[];return Array.isArray(r)?r.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Em(o),n.push(o)}):v2e(r,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Em(o),n.push(o)}),na.prototype.load.call(this,n)},t.remove=function(r,n){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:Em(r),na.prototype.remove.call(this,r,n)},t.clear=function(){return na.prototype.clear.call(this)},t.search=function(r){var n=na.prototype.search.call(this,this.toBBox(r));return KX(n)},t.collides=function(r){return na.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=na.prototype.all.call(this);return KX(r)},t.toJSON=function(){return na.prototype.toJSON.call(this)},t.fromJSON=function(r){return na.prototype.fromJSON.call(this,r)},t.toBBox=function(r){var n;if(r.bbox)n=r.bbox;else if(Array.isArray(r)&&r.length===4)n=r;else if(Array.isArray(r)&&r.length===6)n=[r[0],r[1],r[3],r[4]];else if(r.type==="Feature")n=Em(r);else if(r.type==="FeatureCollection")n=Em(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}s(eY,"geojsonRbush");_O.exports=eY;_O.exports.default=eY});var _7=W((hb,Vm)=>{d();var LIe=200,$Y="__lodash_hash_undefined__",RIe=800,NIe=16,jY=9007199254740991,GY="[object Arguments]",BIe="[object Array]",$Ie="[object AsyncFunction]",jIe="[object Boolean]",GIe="[object Date]",UIe="[object Error]",UY="[object Function]",VIe="[object GeneratorFunction]",zIe="[object Map]",HIe="[object Number]",WIe="[object Null]",VY="[object Object]",qIe="[object Proxy]",ZIe="[object RegExp]",XIe="[object Set]",YIe="[object String]",KIe="[object Undefined]",JIe="[object WeakMap]",QIe="[object ArrayBuffer]",eSe="[object DataView]",tSe="[object Float32Array]",rSe="[object Float64Array]",nSe="[object Int8Array]",oSe="[object Int16Array]",iSe="[object Int32Array]",sSe="[object Uint8Array]",aSe="[object Uint8ClampedArray]",lSe="[object Uint16Array]",cSe="[object Uint32Array]",uSe=/[\\^$.*+?()[\]{}|]/g,pSe=/^\[object .+?Constructor\]$/,dSe=/^(?:0|[1-9]\d*)$/,lr={};lr[tSe]=lr[rSe]=lr[nSe]=lr[oSe]=lr[iSe]=lr[sSe]=lr[aSe]=lr[lSe]=lr[cSe]=!0;lr[GY]=lr[BIe]=lr[QIe]=lr[jIe]=lr[eSe]=lr[GIe]=lr[UIe]=lr[UY]=lr[zIe]=lr[HIe]=lr[VY]=lr[ZIe]=lr[XIe]=lr[YIe]=lr[JIe]=!1;var zY=typeof global=="object"&&global&&global.Object===Object&&global,fSe=typeof self=="object"&&self&&self.Object===Object&&self,bb=zY||fSe||Function("return this")(),HY=typeof hb=="object"&&hb&&!hb.nodeType&&hb,yb=HY&&typeof Vm=="object"&&Vm&&!Vm.nodeType&&Vm,WY=yb&&yb.exports===HY,x7=WY&&zY.process,_Y=function(){try{var e=yb&&yb.require&&yb.require("util").types;return e||x7&&x7.binding&&x7.binding("util")}catch{}}(),AY=_Y&&_Y.isTypedArray;function mSe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}s(mSe,"apply");function hSe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}s(hSe,"baseTimes");function ySe(e){return function(t){return e(t)}}s(ySe,"baseUnary");function gSe(e,t){return e==null?void 0:e[t]}s(gSe,"getValue");function bSe(e,t){return function(r){return e(t(r))}}s(bSe,"overArg");var vSe=Array.prototype,xSe=Function.prototype,TI=Object.prototype,I7=bb["__core-js_shared__"],wI=xSe.toString,Sl=TI.hasOwnProperty,kY=function(){var e=/[^.]+$/.exec(I7&&I7.keys&&I7.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),qY=TI.toString,ISe=wI.call(Object),SSe=RegExp("^"+wI.call(Sl).replace(uSe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),CI=WY?bb.Buffer:void 0,DY=bb.Symbol,FY=bb.Uint8Array,LY=CI?CI.allocUnsafe:void 0,ZY=bSe(Object.getPrototypeOf,Object),RY=Object.create,CSe=TI.propertyIsEnumerable,PSe=vSe.splice,Up=DY?DY.toStringTag:void 0,PI=function(){try{var e=M7(Object,"defineProperty");return e({},"",{}),e}catch{}}(),TSe=CI?CI.isBuffer:void 0,NY=Math.max,wSe=Date.now,XY=M7(bb,"Map"),gb=M7(Object,"create"),MSe=function(){function e(){}return s(e,"object"),function(t){if(!zp(t))return{};if(RY)return RY(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Vp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(Vp,"Hash");function OSe(){this.__data__=gb?gb(null):{},this.size=0}s(OSe,"hashClear");function ESe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}s(ESe,"hashDelete");function _Se(e){var t=this.__data__;if(gb){var r=t[e];return r===$Y?void 0:r}return Sl.call(t,e)?t[e]:void 0}s(_Se,"hashGet");function ASe(e){var t=this.__data__;return gb?t[e]!==void 0:Sl.call(t,e)}s(ASe,"hashHas");function kSe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=gb&&t===void 0?$Y:t,this}s(kSe,"hashSet");Vp.prototype.clear=OSe;Vp.prototype.delete=ESe;Vp.prototype.get=_Se;Vp.prototype.has=ASe;Vp.prototype.set=kSe;function Cl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(Cl,"ListCache");function DSe(){this.__data__=[],this.size=0}s(DSe,"listCacheClear");function FSe(e){var t=this.__data__,r=MI(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():PSe.call(t,r,1),--this.size,!0}s(FSe,"listCacheDelete");function LSe(e){var t=this.__data__,r=MI(t,e);return r<0?void 0:t[r][1]}s(LSe,"listCacheGet");function RSe(e){return MI(this.__data__,e)>-1}s(RSe,"listCacheHas");function NSe(e,t){var r=this.__data__,n=MI(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}s(NSe,"listCacheSet");Cl.prototype.clear=DSe;Cl.prototype.delete=FSe;Cl.prototype.get=LSe;Cl.prototype.has=RSe;Cl.prototype.set=NSe;function zm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(zm,"MapCache");function BSe(){this.size=0,this.__data__={hash:new Vp,map:new(XY||Cl),string:new Vp}}s(BSe,"mapCacheClear");function $Se(e){var t=EI(this,e).delete(e);return this.size-=t?1:0,t}s($Se,"mapCacheDelete");function jSe(e){return EI(this,e).get(e)}s(jSe,"mapCacheGet");function GSe(e){return EI(this,e).has(e)}s(GSe,"mapCacheHas");function USe(e,t){var r=EI(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}s(USe,"mapCacheSet");zm.prototype.clear=BSe;zm.prototype.delete=$Se;zm.prototype.get=jSe;zm.prototype.has=GSe;zm.prototype.set=USe;function Hm(e){var t=this.__data__=new Cl(e);this.size=t.size}s(Hm,"Stack");function VSe(){this.__data__=new Cl,this.size=0}s(VSe,"stackClear");function zSe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}s(zSe,"stackDelete");function HSe(e){return this.__data__.get(e)}s(HSe,"stackGet");function WSe(e){return this.__data__.has(e)}s(WSe,"stackHas");function qSe(e,t){var r=this.__data__;if(r instanceof Cl){var n=r.__data__;if(!XY||n.length<LIe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zm(n)}return r.set(e,t),this.size=r.size,this}s(qSe,"stackSet");Hm.prototype.clear=VSe;Hm.prototype.delete=zSe;Hm.prototype.get=HSe;Hm.prototype.has=WSe;Hm.prototype.set=qSe;function ZSe(e,t){var r=T7(e),n=!r&&P7(e),o=!r&&!n&&QY(e),i=!r&&!n&&!o&&tK(e),a=r||n||o||i,l=a?hSe(e.length,String):[],c=l.length;for(var p in e)(t||Sl.call(e,p))&&!(a&&(p=="length"||o&&(p=="offset"||p=="parent")||i&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||KY(p,c)))&&l.push(p);return l}s(ZSe,"arrayLikeKeys");function S7(e,t,r){(r!==void 0&&!_I(e[t],r)||r===void 0&&!(t in e))&&w7(e,t,r)}s(S7,"assignMergeValue");function XSe(e,t,r){var n=e[t];(!(Sl.call(e,t)&&_I(n,r))||r===void 0&&!(t in e))&&w7(e,t,r)}s(XSe,"assignValue");function MI(e,t){for(var r=e.length;r--;)if(_I(e[r][0],t))return r;return-1}s(MI,"assocIndexOf");function w7(e,t,r){t=="__proto__"&&PI?PI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}s(w7,"baseAssignValue");var YSe=c3e();function OI(e){return e==null?e===void 0?KIe:WIe:Up&&Up in Object(e)?u3e(e):y3e(e)}s(OI,"baseGetTag");function BY(e){return vb(e)&&OI(e)==GY}s(BY,"baseIsArguments");function KSe(e){if(!zp(e)||m3e(e))return!1;var t=E7(e)?SSe:pSe;return t.test(x3e(e))}s(KSe,"baseIsNative");function JSe(e){return vb(e)&&eK(e.length)&&!!lr[OI(e)]}s(JSe,"baseIsTypedArray");function QSe(e){if(!zp(e))return h3e(e);var t=JY(e),r=[];for(var n in e)n=="constructor"&&(t||!Sl.call(e,n))||r.push(n);return r}s(QSe,"baseKeysIn");function YY(e,t,r,n,o){e!==t&&YSe(t,function(i,a){if(o||(o=new Hm),zp(i))e3e(e,t,a,r,YY,n,o);else{var l=n?n(C7(e,a),i,a+"",e,t,o):void 0;l===void 0&&(l=i),S7(e,a,l)}},rK)}s(YY,"baseMerge");function e3e(e,t,r,n,o,i,a){var l=C7(e,r),c=C7(t,r),p=a.get(c);if(p){S7(e,r,p);return}var f=i?i(l,c,r+"",e,t,a):void 0,m=f===void 0;if(m){var y=T7(c),v=!y&&QY(c),x=!y&&!v&&tK(c);f=c,y||v||x?T7(l)?f=l:I3e(l)?f=s3e(l):v?(m=!1,f=n3e(c,!0)):x?(m=!1,f=i3e(c,!0)):f=[]:S3e(c)||P7(c)?(f=l,P7(l)?f=C3e(l):(!zp(l)||E7(l))&&(f=p3e(c))):m=!1}m&&(a.set(c,f),o(f,c,n,i,a),a.delete(c)),S7(e,r,f)}s(e3e,"baseMergeDeep");function t3e(e,t){return b3e(g3e(e,t,nK),e+"")}s(t3e,"baseRest");var r3e=PI?function(e,t){return PI(e,"toString",{configurable:!0,enumerable:!1,value:T3e(t),writable:!0})}:nK;function n3e(e,t){if(t)return e.slice();var r=e.length,n=LY?LY(r):new e.constructor(r);return e.copy(n),n}s(n3e,"cloneBuffer");function o3e(e){var t=new e.constructor(e.byteLength);return new FY(t).set(new FY(e)),t}s(o3e,"cloneArrayBuffer");function i3e(e,t){var r=t?o3e(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}s(i3e,"cloneTypedArray");function s3e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}s(s3e,"copyArray");function a3e(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var l=t[i],c=n?n(r[l],e[l],l,r,e):void 0;c===void 0&&(c=e[l]),o?w7(r,l,c):XSe(r,l,c)}return r}s(a3e,"copyObject");function l3e(e){return t3e(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,a&&d3e(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var l=r[n];l&&e(t,l,n,i)}return t})}s(l3e,"createAssigner");function c3e(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),l=a.length;l--;){var c=a[e?l:++o];if(r(i[c],c,i)===!1)break}return t}}s(c3e,"createBaseFor");function EI(e,t){var r=e.__data__;return f3e(t)?r[typeof t=="string"?"string":"hash"]:r.map}s(EI,"getMapData");function M7(e,t){var r=gSe(e,t);return KSe(r)?r:void 0}s(M7,"getNative");function u3e(e){var t=Sl.call(e,Up),r=e[Up];try{e[Up]=void 0;var n=!0}catch{}var o=qY.call(e);return n&&(t?e[Up]=r:delete e[Up]),o}s(u3e,"getRawTag");function p3e(e){return typeof e.constructor=="function"&&!JY(e)?MSe(ZY(e)):{}}s(p3e,"initCloneObject");function KY(e,t){var r=typeof e;return t=t==null?jY:t,!!t&&(r=="number"||r!="symbol"&&dSe.test(e))&&e>-1&&e%1==0&&e<t}s(KY,"isIndex");function d3e(e,t,r){if(!zp(r))return!1;var n=typeof t;return(n=="number"?O7(r)&&KY(t,r.length):n=="string"&&t in r)?_I(r[t],e):!1}s(d3e,"isIterateeCall");function f3e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}s(f3e,"isKeyable");function m3e(e){return!!kY&&kY in e}s(m3e,"isMasked");function JY(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||TI;return e===r}s(JY,"isPrototype");function h3e(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}s(h3e,"nativeKeysIn");function y3e(e){return qY.call(e)}s(y3e,"objectToString");function g3e(e,t,r){return t=NY(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=NY(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=n[o];return l[t]=r(a),mSe(e,this,l)}}s(g3e,"overRest");function C7(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}s(C7,"safeGet");var b3e=v3e(r3e);function v3e(e){var t=0,r=0;return function(){var n=wSe(),o=NIe-(n-r);if(r=n,o>0){if(++t>=RIe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}s(v3e,"shortOut");function x3e(e){if(e!=null){try{return wI.call(e)}catch{}try{return e+""}catch{}}return""}s(x3e,"toSource");function _I(e,t){return e===t||e!==e&&t!==t}s(_I,"eq");var P7=BY(function(){return arguments}())?BY:function(e){return vb(e)&&Sl.call(e,"callee")&&!CSe.call(e,"callee")},T7=Array.isArray;function O7(e){return e!=null&&eK(e.length)&&!E7(e)}s(O7,"isArrayLike");function I3e(e){return vb(e)&&O7(e)}s(I3e,"isArrayLikeObject");var QY=TSe||w3e;function E7(e){if(!zp(e))return!1;var t=OI(e);return t==UY||t==VIe||t==$Ie||t==qIe}s(E7,"isFunction");function eK(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=jY}s(eK,"isLength");function zp(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}s(zp,"isObject");function vb(e){return e!=null&&typeof e=="object"}s(vb,"isObjectLike");function S3e(e){if(!vb(e)||OI(e)!=VY)return!1;var t=ZY(e);if(t===null)return!0;var r=Sl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&wI.call(r)==ISe}s(S3e,"isPlainObject");var tK=AY?ySe(AY):JSe;function C3e(e){return a3e(e,rK(e))}s(C3e,"toPlainObject");function rK(e){return O7(e)?ZSe(e,!0):QSe(e)}s(rK,"keysIn");var P3e=l3e(function(e,t,r){YY(e,t,r)});function T3e(e){return function(){return e}}s(T3e,"constant");function nK(e){return e}s(nK,"identity");function w3e(){return!1}s(w3e,"stubFalse");Vm.exports=P3e});var H7=W((Sb,qm)=>{d();var eCe=200,PK="__lodash_hash_undefined__",tCe=800,rCe=16,TK=9007199254740991,wK="[object Arguments]",nCe="[object Array]",oCe="[object AsyncFunction]",iCe="[object Boolean]",sCe="[object Date]",aCe="[object Error]",MK="[object Function]",lCe="[object GeneratorFunction]",cCe="[object Map]",uCe="[object Number]",pCe="[object Null]",OK="[object Object]",dCe="[object Proxy]",fCe="[object RegExp]",mCe="[object Set]",hCe="[object String]",yCe="[object Undefined]",gCe="[object WeakMap]",bCe="[object ArrayBuffer]",vCe="[object DataView]",xCe="[object Float32Array]",ICe="[object Float64Array]",SCe="[object Int8Array]",CCe="[object Int16Array]",PCe="[object Int32Array]",TCe="[object Uint8Array]",wCe="[object Uint8ClampedArray]",MCe="[object Uint16Array]",OCe="[object Uint32Array]",ECe=/[\\^$.*+?()[\]{}|]/g,_Ce=/^\[object .+?Constructor\]$/,ACe=/^(?:0|[1-9]\d*)$/,cr={};cr[xCe]=cr[ICe]=cr[SCe]=cr[CCe]=cr[PCe]=cr[TCe]=cr[wCe]=cr[MCe]=cr[OCe]=!0;cr[wK]=cr[nCe]=cr[bCe]=cr[iCe]=cr[vCe]=cr[sCe]=cr[aCe]=cr[MK]=cr[cCe]=cr[uCe]=cr[OK]=cr[fCe]=cr[mCe]=cr[hCe]=cr[gCe]=!1;var EK=typeof global=="object"&&global&&global.Object===Object&&global,kCe=typeof self=="object"&&self&&self.Object===Object&&self,Tb=EK||kCe||Function("return this")(),_K=typeof Sb=="object"&&Sb&&!Sb.nodeType&&Sb,Cb=_K&&typeof qm=="object"&&qm&&!qm.nodeType&&qm,AK=Cb&&Cb.exports===_K,F7=AK&&EK.process,hK=function(){try{var e=Cb&&Cb.require&&Cb.require("util").types;return e||F7&&F7.binding&&F7.binding("util")}catch{}}(),yK=hK&&hK.isTypedArray;function kK(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}s(kK,"apply");function DCe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}s(DCe,"baseTimes");function FCe(e){return function(t){return e(t)}}s(FCe,"baseUnary");function LCe(e,t){return e==null?void 0:e[t]}s(LCe,"getValue");function RCe(e,t){return function(r){return e(t(r))}}s(RCe,"overArg");var NCe=Array.prototype,BCe=Function.prototype,LI=Object.prototype,L7=Tb["__core-js_shared__"],RI=BCe.toString,wl=LI.hasOwnProperty,gK=function(){var e=/[^.]+$/.exec(L7&&L7.keys&&L7.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),DK=LI.toString,$Ce=RI.call(Object),jCe=RegExp("^"+RI.call(wl).replace(ECe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),DI=AK?Tb.Buffer:void 0,bK=Tb.Symbol,vK=Tb.Uint8Array,xK=DI?DI.allocUnsafe:void 0,FK=RCe(Object.getPrototypeOf,Object),IK=Object.create,GCe=LI.propertyIsEnumerable,UCe=NCe.splice,Wp=bK?bK.toStringTag:void 0,FI=function(){try{var e=U7(Object,"defineProperty");return e({},"",{}),e}catch{}}(),VCe=DI?DI.isBuffer:void 0,SK=Math.max,zCe=Date.now,LK=U7(Tb,"Map"),Pb=U7(Object,"create"),HCe=function(){function e(){}return s(e,"object"),function(t){if(!Tl(t))return{};if(IK)return IK(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function qp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(qp,"Hash");function WCe(){this.__data__=Pb?Pb(null):{},this.size=0}s(WCe,"hashClear");function qCe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}s(qCe,"hashDelete");function ZCe(e){var t=this.__data__;if(Pb){var r=t[e];return r===PK?void 0:r}return wl.call(t,e)?t[e]:void 0}s(ZCe,"hashGet");function XCe(e){var t=this.__data__;return Pb?t[e]!==void 0:wl.call(t,e)}s(XCe,"hashHas");function YCe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Pb&&t===void 0?PK:t,this}s(YCe,"hashSet");qp.prototype.clear=WCe;qp.prototype.delete=qCe;qp.prototype.get=ZCe;qp.prototype.has=XCe;qp.prototype.set=YCe;function Ml(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(Ml,"ListCache");function KCe(){this.__data__=[],this.size=0}s(KCe,"listCacheClear");function JCe(e){var t=this.__data__,r=NI(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():UCe.call(t,r,1),--this.size,!0}s(JCe,"listCacheDelete");function QCe(e){var t=this.__data__,r=NI(t,e);return r<0?void 0:t[r][1]}s(QCe,"listCacheGet");function ePe(e){return NI(this.__data__,e)>-1}s(ePe,"listCacheHas");function tPe(e,t){var r=this.__data__,n=NI(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}s(tPe,"listCacheSet");Ml.prototype.clear=KCe;Ml.prototype.delete=JCe;Ml.prototype.get=QCe;Ml.prototype.has=ePe;Ml.prototype.set=tPe;function Zm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(Zm,"MapCache");function rPe(){this.size=0,this.__data__={hash:new qp,map:new(LK||Ml),string:new qp}}s(rPe,"mapCacheClear");function nPe(e){var t=$I(this,e).delete(e);return this.size-=t?1:0,t}s(nPe,"mapCacheDelete");function oPe(e){return $I(this,e).get(e)}s(oPe,"mapCacheGet");function iPe(e){return $I(this,e).has(e)}s(iPe,"mapCacheHas");function sPe(e,t){var r=$I(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}s(sPe,"mapCacheSet");Zm.prototype.clear=rPe;Zm.prototype.delete=nPe;Zm.prototype.get=oPe;Zm.prototype.has=iPe;Zm.prototype.set=sPe;function Xm(e){var t=this.__data__=new Ml(e);this.size=t.size}s(Xm,"Stack");function aPe(){this.__data__=new Ml,this.size=0}s(aPe,"stackClear");function lPe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}s(lPe,"stackDelete");function cPe(e){return this.__data__.get(e)}s(cPe,"stackGet");function uPe(e){return this.__data__.has(e)}s(uPe,"stackHas");function pPe(e,t){var r=this.__data__;if(r instanceof Ml){var n=r.__data__;if(!LK||n.length<eCe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Zm(n)}return r.set(e,t),this.size=r.size,this}s(pPe,"stackSet");Xm.prototype.clear=aPe;Xm.prototype.delete=lPe;Xm.prototype.get=cPe;Xm.prototype.has=uPe;Xm.prototype.set=pPe;function dPe(e,t){var r=$7(e),n=!r&&B7(e),o=!r&&!n&&jK(e),i=!r&&!n&&!o&&UK(e),a=r||n||o||i,l=a?DCe(e.length,String):[],c=l.length;for(var p in e)(t||wl.call(e,p))&&!(a&&(p=="length"||o&&(p=="offset"||p=="parent")||i&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||BK(p,c)))&&l.push(p);return l}s(dPe,"arrayLikeKeys");function R7(e,t,r){(r!==void 0&&!jI(e[t],r)||r===void 0&&!(t in e))&&j7(e,t,r)}s(R7,"assignMergeValue");function fPe(e,t,r){var n=e[t];(!(wl.call(e,t)&&jI(n,r))||r===void 0&&!(t in e))&&j7(e,t,r)}s(fPe,"assignValue");function NI(e,t){for(var r=e.length;r--;)if(jI(e[r][0],t))return r;return-1}s(NI,"assocIndexOf");function j7(e,t,r){t=="__proto__"&&FI?FI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}s(j7,"baseAssignValue");var mPe=wPe();function BI(e){return e==null?e===void 0?yCe:pCe:Wp&&Wp in Object(e)?MPe(e):DPe(e)}s(BI,"baseGetTag");function CK(e){return wb(e)&&BI(e)==wK}s(CK,"baseIsArguments");function hPe(e){if(!Tl(e)||APe(e))return!1;var t=z7(e)?jCe:_Ce;return t.test(NPe(e))}s(hPe,"baseIsNative");function yPe(e){return wb(e)&&GK(e.length)&&!!cr[BI(e)]}s(yPe,"baseIsTypedArray");function gPe(e){if(!Tl(e))return kPe(e);var t=$K(e),r=[];for(var n in e)n=="constructor"&&(t||!wl.call(e,n))||r.push(n);return r}s(gPe,"baseKeysIn");function G7(e,t,r,n,o){e!==t&&mPe(t,function(i,a){if(o||(o=new Xm),Tl(i))bPe(e,t,a,r,G7,n,o);else{var l=n?n(N7(e,a),i,a+"",e,t,o):void 0;l===void 0&&(l=i),R7(e,a,l)}},VK)}s(G7,"baseMerge");function bPe(e,t,r,n,o,i,a){var l=N7(e,r),c=N7(t,r),p=a.get(c);if(p){R7(e,r,p);return}var f=i?i(l,c,r+"",e,t,a):void 0,m=f===void 0;if(m){var y=$7(c),v=!y&&jK(c),x=!y&&!v&&UK(c);f=c,y||v||x?$7(l)?f=l:BPe(l)?f=CPe(l):v?(m=!1,f=xPe(c,!0)):x?(m=!1,f=SPe(c,!0)):f=[]:$Pe(c)||B7(c)?(f=l,B7(l)?f=jPe(l):(!Tl(l)||z7(l))&&(f=OPe(c))):m=!1}m&&(a.set(c,f),o(f,c,n,i,a),a.delete(c)),R7(e,r,f)}s(bPe,"baseMergeDeep");function RK(e,t){return LPe(FPe(e,t,zK),e+"")}s(RK,"baseRest");var vPe=FI?function(e,t){return FI(e,"toString",{configurable:!0,enumerable:!1,value:VPe(t),writable:!0})}:zK;function xPe(e,t){if(t)return e.slice();var r=e.length,n=xK?xK(r):new e.constructor(r);return e.copy(n),n}s(xPe,"cloneBuffer");function IPe(e){var t=new e.constructor(e.byteLength);return new vK(t).set(new vK(e)),t}s(IPe,"cloneArrayBuffer");function SPe(e,t){var r=t?IPe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}s(SPe,"cloneTypedArray");function CPe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}s(CPe,"copyArray");function PPe(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var l=t[i],c=n?n(r[l],e[l],l,r,e):void 0;c===void 0&&(c=e[l]),o?j7(r,l,c):fPe(r,l,c)}return r}s(PPe,"copyObject");function TPe(e){return RK(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,a&&EPe(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var l=r[n];l&&e(t,l,n,i)}return t})}s(TPe,"createAssigner");function wPe(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),l=a.length;l--;){var c=a[e?l:++o];if(r(i[c],c,i)===!1)break}return t}}s(wPe,"createBaseFor");function NK(e,t,r,n,o,i){return Tl(e)&&Tl(t)&&(i.set(t,e),G7(e,t,void 0,NK,i),i.delete(t)),e}s(NK,"customDefaultsMerge");function $I(e,t){var r=e.__data__;return _Pe(t)?r[typeof t=="string"?"string":"hash"]:r.map}s($I,"getMapData");function U7(e,t){var r=LCe(e,t);return hPe(r)?r:void 0}s(U7,"getNative");function MPe(e){var t=wl.call(e,Wp),r=e[Wp];try{e[Wp]=void 0;var n=!0}catch{}var o=DK.call(e);return n&&(t?e[Wp]=r:delete e[Wp]),o}s(MPe,"getRawTag");function OPe(e){return typeof e.constructor=="function"&&!$K(e)?HCe(FK(e)):{}}s(OPe,"initCloneObject");function BK(e,t){var r=typeof e;return t=t==null?TK:t,!!t&&(r=="number"||r!="symbol"&&ACe.test(e))&&e>-1&&e%1==0&&e<t}s(BK,"isIndex");function EPe(e,t,r){if(!Tl(r))return!1;var n=typeof t;return(n=="number"?V7(r)&&BK(t,r.length):n=="string"&&t in r)?jI(r[t],e):!1}s(EPe,"isIterateeCall");function _Pe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}s(_Pe,"isKeyable");function APe(e){return!!gK&&gK in e}s(APe,"isMasked");function $K(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||LI;return e===r}s($K,"isPrototype");function kPe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}s(kPe,"nativeKeysIn");function DPe(e){return DK.call(e)}s(DPe,"objectToString");function FPe(e,t,r){return t=SK(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=SK(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=n[o];return l[t]=r(a),kK(e,this,l)}}s(FPe,"overRest");function N7(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}s(N7,"safeGet");var LPe=RPe(vPe);function RPe(e){var t=0,r=0;return function(){var n=zCe(),o=rCe-(n-r);if(r=n,o>0){if(++t>=tCe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}s(RPe,"shortOut");function NPe(e){if(e!=null){try{return RI.call(e)}catch{}try{return e+""}catch{}}return""}s(NPe,"toSource");function jI(e,t){return e===t||e!==e&&t!==t}s(jI,"eq");var B7=CK(function(){return arguments}())?CK:function(e){return wb(e)&&wl.call(e,"callee")&&!GCe.call(e,"callee")},$7=Array.isArray;function V7(e){return e!=null&&GK(e.length)&&!z7(e)}s(V7,"isArrayLike");function BPe(e){return wb(e)&&V7(e)}s(BPe,"isArrayLikeObject");var jK=VCe||zPe;function z7(e){if(!Tl(e))return!1;var t=BI(e);return t==MK||t==lCe||t==oCe||t==dCe}s(z7,"isFunction");function GK(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=TK}s(GK,"isLength");function Tl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}s(Tl,"isObject");function wb(e){return e!=null&&typeof e=="object"}s(wb,"isObjectLike");function $Pe(e){if(!wb(e)||BI(e)!=OK)return!1;var t=FK(e);if(t===null)return!0;var r=wl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&RI.call(r)==$Ce}s($Pe,"isPlainObject");var UK=yK?FCe(yK):yPe;function jPe(e){return PPe(e,VK(e))}s(jPe,"toPlainObject");var GPe=RK(function(e){return e.push(void 0,NK),kK(UPe,void 0,e)});function VK(e){return V7(e)?dPe(e,!0):gPe(e)}s(VK,"keysIn");var UPe=TPe(function(e,t,r,n){G7(e,t,r,n)});function VPe(e){return function(){return e}}s(VPe,"constant");function zK(e){return e}s(zK,"identity");function zPe(){return!1}s(zPe,"stubFalse");qm.exports=GPe});var DJ=W((J1t,Db)=>{"use strict";d();var lTe=!1,Kp=!1,wJ=!0,MJ=!1,g={},OJ=!1;typeof Db<"u"&&Db.exports?(Db.exports=g,OJ=!0):typeof document<"u"?window.ClipperLib=g:self.ClipperLib=g;var JI;OJ?(Zr="chrome",JI="Netscape"):(Zr=navigator.userAgent.toString().toLowerCase(),JI=navigator.appName);var Zr,it={};Zr.indexOf("chrome")!=-1&&Zr.indexOf("chromium")==-1?it.chrome=1:it.chrome=0;Zr.indexOf("chromium")!=-1?it.chromium=1:it.chromium=0;Zr.indexOf("safari")!=-1&&Zr.indexOf("chrome")==-1&&Zr.indexOf("chromium")==-1?it.safari=1:it.safari=0;Zr.indexOf("firefox")!=-1?it.firefox=1:it.firefox=0;Zr.indexOf("firefox/17")!=-1?it.firefox17=1:it.firefox17=0;Zr.indexOf("firefox/15")!=-1?it.firefox15=1:it.firefox15=0;Zr.indexOf("firefox/3")!=-1?it.firefox3=1:it.firefox3=0;Zr.indexOf("opera")!=-1?it.opera=1:it.opera=0;Zr.indexOf("msie 10")!=-1?it.msie10=1:it.msie10=0;Zr.indexOf("msie 9")!=-1?it.msie9=1:it.msie9=0;Zr.indexOf("msie 8")!=-1?it.msie8=1:it.msie8=0;Zr.indexOf("msie 7")!=-1?it.msie7=1:it.msie7=0;Zr.indexOf("msie ")!=-1?it.msie=1:it.msie=0;g.biginteger_used=null;var Vc,cTe=0xdeadbeefcafe,PJ=(cTe&16777215)==15715070;function ne(e,t,r){g.biginteger_used=1,e!=null&&(typeof e=="number"&&typeof t>"u"?this.fromInt(e):typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}s(ne,"BigInteger");function yt(){return new ne(null)}s(yt,"nbi");function uTe(e,t,r,n,o,i){for(;--i>=0;){var a=t*this[e++]+r[n]+o;o=Math.floor(a/67108864),r[n++]=a&67108863}return o}s(uTe,"am1");function pTe(e,t,r,n,o,i){for(var a=t&32767,l=t>>15;--i>=0;){var c=this[e]&32767,p=this[e++]>>15,f=l*c+p*a;c=a*c+((f&32767)<<15)+r[n]+(o&1073741823),o=(c>>>30)+(f>>>15)+l*p+(o>>>30),r[n++]=c&1073741823}return o}s(pTe,"am2");function dTe(e,t,r,n,o,i){for(var a=t&16383,l=t>>14;--i>=0;){var c=this[e]&16383,p=this[e++]>>14,f=l*c+p*a;c=a*c+((f&16383)<<14)+r[n]+o,o=(c>>28)+(f>>14)+l*p,r[n++]=c&268435455}return o}s(dTe,"am3");PJ&&JI=="Microsoft Internet Explorer"?(ne.prototype.am=pTe,Vc=30):PJ&&JI!="Netscape"?(ne.prototype.am=uTe,Vc=26):(ne.prototype.am=dTe,Vc=28);ne.prototype.DB=Vc;ne.prototype.DM=(1<<Vc)-1;ne.prototype.DV=1<<Vc;var yE=52;ne.prototype.FV=Math.pow(2,yE);ne.prototype.F1=yE-Vc;ne.prototype.F2=2*Vc-yE;var fTe="0123456789abcdefghijklmnopqrstuvwxyz",eS=new Array,eh,Ii;eh=48;for(Ii=0;Ii<=9;++Ii)eS[eh++]=Ii;eh=97;for(Ii=10;Ii<36;++Ii)eS[eh++]=Ii;eh=65;for(Ii=10;Ii<36;++Ii)eS[eh++]=Ii;function TJ(e){return fTe.charAt(e)}s(TJ,"int2char");function EJ(e,t){var r=eS[e.charCodeAt(t)];return r==null?-1:r}s(EJ,"intAt");function mTe(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}s(mTe,"bnpCopyTo");function hTe(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}s(hTe,"bnpFromInt");function Uc(e){var t=yt();return t.fromInt(e),t}s(Uc,"nbv");function yTe(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,o=!1,i=0;--n>=0;){var a=r==8?e[n]&255:EJ(e,n);if(a<0){e.charAt(n)=="-"&&(o=!0);continue}o=!1,i==0?this[this.t++]=a:i+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-i)-1)<<i,this[this.t++]=a>>this.DB-i):this[this.t-1]|=a<<i,i+=r,i>=this.DB&&(i-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,i>0&&(this[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),o&&ne.ZERO.subTo(this,this)}s(yTe,"bnpFromString");function gTe(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}s(gTe,"bnpClamp");function bTe(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,o=!1,i="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0)for(l<this.DB&&(n=this[a]>>l)>0&&(o=!0,i=TJ(n));a>=0;)l<t?(n=(this[a]&(1<<l)-1)<<t-l,n|=this[--a]>>(l+=this.DB-t)):(n=this[a]>>(l-=t)&r,l<=0&&(l+=this.DB,--a)),n>0&&(o=!0),o&&(i+=TJ(n));return o?i:"0"}s(bTe,"bnToString");function vTe(){var e=yt();return ne.ZERO.subTo(this,e),e}s(vTe,"bnNegate");function xTe(){return this.s<0?this.negate():this}s(xTe,"bnAbs");function ITe(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0}s(ITe,"bnCompareTo");function tS(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}s(tS,"nbits");function STe(){return this.t<=0?0:this.DB*(this.t-1)+tS(this[this.t-1]^this.s&this.DM)}s(STe,"bnBitLength");function CTe(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}s(CTe,"bnpDLShiftTo");function PTe(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}s(PTe,"bnpDRShiftTo");function TTe(e,t){var r=e%this.DB,n=this.DB-r,o=(1<<n)-1,i=Math.floor(e/this.DB),a=this.s<<r&this.DM,l;for(l=this.t-1;l>=0;--l)t[l+i+1]=this[l]>>n|a,a=(this[l]&o)<<r;for(l=i-1;l>=0;--l)t[l]=0;t[i]=a,t.t=this.t+i+1,t.s=this.s,t.clamp()}s(TTe,"bnpLShiftTo");function wTe(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,o=this.DB-n,i=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&i)<<o,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&i)<<o),t.t=this.t-r,t.clamp()}s(wTe,"bnpRShiftTo");function MTe(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}s(MTe,"bnpSubTo");function OTe(e,t){var r=this.abs(),n=e.abs(),o=r.t;for(t.t=o+n.t;--o>=0;)t[o]=0;for(o=0;o<n.t;++o)t[o+r.t]=r.am(0,n[o],t,o,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&ne.ZERO.subTo(t,t)}s(OTe,"bnpMultiplyTo");function ETe(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}s(ETe,"bnpSquareTo");function _Te(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t<n.t){t!=null&&t.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=yt());var i=yt(),a=this.s,l=e.s,c=this.DB-tS(n[n.t-1]);c>0?(n.lShiftTo(c,i),o.lShiftTo(c,r)):(n.copyTo(i),o.copyTo(r));var p=i.t,f=i[p-1];if(f!=0){var m=f*(1<<this.F1)+(p>1?i[p-2]>>this.F2:0),y=this.FV/m,v=(1<<this.F1)/m,x=1<<this.F2,S=r.t,I=S-p,P=t==null?yt():t;for(i.dlShiftTo(I,P),r.compareTo(P)>=0&&(r[r.t++]=1,r.subTo(P,r)),ne.ONE.dlShiftTo(p,P),P.subTo(i,i);i.t<p;)i[i.t++]=0;for(;--I>=0;){var T=r[--S]==f?this.DM:Math.floor(r[S]*y+(r[S-1]+x)*v);if((r[S]+=i.am(0,T,r,I,0,p))<T)for(i.dlShiftTo(I,P),r.subTo(P,r);r[S]<--T;)r.subTo(P,r)}t!=null&&(r.drShiftTo(p,t),a!=l&&ne.ZERO.subTo(t,t)),r.t=p,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&ne.ZERO.subTo(r,r)}}}s(_Te,"bnpDivRemTo");function ATe(e){var t=yt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(ne.ZERO)>0&&e.subTo(t,t),t}s(ATe,"bnMod");function Jp(e){this.m=e}s(Jp,"Classic");function kTe(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}s(kTe,"cConvert");function DTe(e){return e}s(DTe,"cRevert");function FTe(e){e.divRemTo(this.m,null,e)}s(FTe,"cReduce");function LTe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}s(LTe,"cMulTo");function RTe(e,t){e.squareTo(t),this.reduce(t)}s(RTe,"cSqrTo");Jp.prototype.convert=kTe;Jp.prototype.revert=DTe;Jp.prototype.reduce=FTe;Jp.prototype.mulTo=LTe;Jp.prototype.sqrTo=RTe;function NTe(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}s(NTe,"bnpInvDigit");function Qp(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}s(Qp,"Montgomery");function BTe(e){var t=yt();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(ne.ZERO)>0&&this.m.subTo(t,t),t}s(BTe,"montConvert");function $Te(e){var t=yt();return e.copyTo(t),this.reduce(t),t}s($Te,"montRevert");function jTe(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}s(jTe,"montReduce");function GTe(e,t){e.squareTo(t),this.reduce(t)}s(GTe,"montSqrTo");function UTe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}s(UTe,"montMulTo");Qp.prototype.convert=BTe;Qp.prototype.revert=$Te;Qp.prototype.reduce=jTe;Qp.prototype.mulTo=UTe;Qp.prototype.sqrTo=GTe;function VTe(){return(this.t>0?this[0]&1:this.s)==0}s(VTe,"bnpIsEven");function zTe(e,t){if(e>4294967295||e<1)return ne.ONE;var r=yt(),n=yt(),o=t.convert(this),i=tS(e)-1;for(o.copyTo(r);--i>=0;)if(t.sqrTo(r,n),(e&1<<i)>0)t.mulTo(n,o,r);else{var a=r;r=n,n=a}return t.revert(r)}s(zTe,"bnpExp");function HTe(e,t){var r;return e<256||t.isEven()?r=new Jp(t):r=new Qp(t),this.exp(e,r)}s(HTe,"bnModPowInt");ne.prototype.copyTo=mTe;ne.prototype.fromInt=hTe;ne.prototype.fromString=yTe;ne.prototype.clamp=gTe;ne.prototype.dlShiftTo=CTe;ne.prototype.drShiftTo=PTe;ne.prototype.lShiftTo=TTe;ne.prototype.rShiftTo=wTe;ne.prototype.subTo=MTe;ne.prototype.multiplyTo=OTe;ne.prototype.squareTo=ETe;ne.prototype.divRemTo=_Te;ne.prototype.invDigit=NTe;ne.prototype.isEven=VTe;ne.prototype.exp=zTe;ne.prototype.toString=bTe;ne.prototype.negate=vTe;ne.prototype.abs=xTe;ne.prototype.compareTo=ITe;ne.prototype.bitLength=STe;ne.prototype.mod=ATe;ne.prototype.modPowInt=HTe;ne.ZERO=Uc(0);ne.ONE=Uc(1);function WTe(){var e=yt();return this.copyTo(e),e}s(WTe,"bnClone");function qTe(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}s(qTe,"bnIntValue");function ZTe(){return this.t==0?this.s:this[0]<<24>>24}s(ZTe,"bnByteValue");function XTe(){return this.t==0?this.s:this[0]<<16>>16}s(XTe,"bnShortValue");function YTe(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}s(YTe,"bnpChunkSize");function KTe(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}s(KTe,"bnSigNum");function JTe(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=Uc(r),o=yt(),i=yt(),a="";for(this.divRemTo(n,o,i);o.signum()>0;)a=(r+i.intValue()).toString(e).substr(1)+a,o.divRemTo(n,o,i);return i.intValue().toString(e)+a}s(JTe,"bnpToRadix");function QTe(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),o=!1,i=0,a=0,l=0;l<e.length;++l){var c=EJ(e,l);if(c<0){e.charAt(l)=="-"&&this.signum()==0&&(o=!0);continue}a=t*a+c,++i>=r&&(this.dMultiply(n),this.dAddOffset(a,0),i=0,a=0)}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(a,0)),o&&ne.ZERO.subTo(this,this)}s(QTe,"bnpFromRadix");function ewe(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(ne.ONE.shiftLeft(e-1),gE,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(ne.ONE.shiftLeft(e-1),this);else{var n=new Array,o=e&7;n.length=(e>>3)+1,t.nextBytes(n),o>0?n[0]&=(1<<o)-1:n[0]=0,this.fromString(n,256)}}s(ewe,"bnpFromNumber");function twe(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,o=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[o++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(n&128)!=0&&(n|=-256),o==0&&(this.s&128)!=(n&128)&&++o,(o>0||n!=this.s)&&(t[o++]=n);return t}s(twe,"bnToByteArray");function rwe(e){return this.compareTo(e)==0}s(rwe,"bnEquals");function nwe(e){return this.compareTo(e)<0?this:e}s(nwe,"bnMin");function owe(e){return this.compareTo(e)>0?this:e}s(owe,"bnMax");function iwe(e,t,r){var n,o,i=Math.min(e.t,this.t);for(n=0;n<i;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=i;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}s(iwe,"bnpBitwiseTo");function swe(e,t){return e&t}s(swe,"op_and");function awe(e){var t=yt();return this.bitwiseTo(e,swe,t),t}s(awe,"bnAnd");function gE(e,t){return e|t}s(gE,"op_or");function lwe(e){var t=yt();return this.bitwiseTo(e,gE,t),t}s(lwe,"bnOr");function _J(e,t){return e^t}s(_J,"op_xor");function cwe(e){var t=yt();return this.bitwiseTo(e,_J,t),t}s(cwe,"bnXor");function AJ(e,t){return e&~t}s(AJ,"op_andnot");function uwe(e){var t=yt();return this.bitwiseTo(e,AJ,t),t}s(uwe,"bnAndNot");function pwe(){for(var e=yt(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}s(pwe,"bnNot");function dwe(e){var t=yt();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}s(dwe,"bnShiftLeft");function fwe(e){var t=yt();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}s(fwe,"bnShiftRight");function mwe(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}s(mwe,"lbit");function hwe(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+mwe(this[e]);return this.s<0?this.t*this.DB:-1}s(hwe,"bnGetLowestSetBit");function ywe(e){for(var t=0;e!=0;)e&=e-1,++t;return t}s(ywe,"cbit");function gwe(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=ywe(this[r]^t);return e}s(gwe,"bnBitCount");function bwe(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}s(bwe,"bnTestBit");function vwe(e,t){var r=ne.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}s(vwe,"bnpChangeBit");function xwe(e){return this.changeBit(e,gE)}s(xwe,"bnSetBit");function Iwe(e){return this.changeBit(e,AJ)}s(Iwe,"bnClearBit");function Swe(e){return this.changeBit(e,_J)}s(Swe,"bnFlipBit");function Cwe(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}s(Cwe,"bnpAddTo");function Pwe(e){var t=yt();return this.addTo(e,t),t}s(Pwe,"bnAdd");function Twe(e){var t=yt();return this.subTo(e,t),t}s(Twe,"bnSubtract");function wwe(e){var t=yt();return this.multiplyTo(e,t),t}s(wwe,"bnMultiply");function Mwe(){var e=yt();return this.squareTo(e),e}s(Mwe,"bnSquare");function Owe(e){var t=yt();return this.divRemTo(e,t,null),t}s(Owe,"bnDivide");function Ewe(e){var t=yt();return this.divRemTo(e,null,t),t}s(Ewe,"bnRemainder");function _we(e){var t=yt(),r=yt();return this.divRemTo(e,t,r),new Array(t,r)}s(_we,"bnDivideAndRemainder");function Awe(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}s(Awe,"bnpDMultiply");function kwe(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}s(kwe,"bnpDAddOffset");function Fb(){}s(Fb,"NullExp");function kJ(e){return e}s(kJ,"nNop");function Dwe(e,t,r){e.multiplyTo(t,r)}s(Dwe,"nMulTo");function Fwe(e,t){e.squareTo(t)}s(Fwe,"nSqrTo");Fb.prototype.convert=kJ;Fb.prototype.revert=kJ;Fb.prototype.mulTo=Dwe;Fb.prototype.sqrTo=Fwe;function Lwe(e){return this.exp(e,new Fb)}s(Lwe,"bnPow");function Rwe(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;var o;for(o=r.t-this.t;n<o;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(o=Math.min(e.t,t);n<o;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}s(Rwe,"bnpMultiplyLowerTo");function Nwe(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}s(Nwe,"bnpMultiplyUpperTo");function th(e){this.r2=yt(),this.q3=yt(),ne.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}s(th,"Barrett");function Bwe(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=yt();return e.copyTo(t),this.reduce(t),t}s(Bwe,"barrettConvert");function $we(e){return e}s($we,"barrettRevert");function jwe(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}s(jwe,"barrettReduce");function Gwe(e,t){e.squareTo(t),this.reduce(t)}s(Gwe,"barrettSqrTo");function Uwe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}s(Uwe,"barrettMulTo");th.prototype.convert=Bwe;th.prototype.revert=$we;th.prototype.reduce=jwe;th.prototype.mulTo=Uwe;th.prototype.sqrTo=Gwe;function Vwe(e,t){var r=e.bitLength(),n,o=Uc(1),i;if(r<=0)return o;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?i=new Jp(t):t.isEven()?i=new th(t):i=new Qp(t);var a=new Array,l=3,c=n-1,p=(1<<n)-1;if(a[1]=i.convert(this),n>1){var f=yt();for(i.sqrTo(a[1],f);l<=p;)a[l]=yt(),i.mulTo(f,a[l-2],a[l]),l+=2}var m=e.t-1,y,v=!0,x=yt(),S;for(r=tS(e[m])-1;m>=0;){for(r>=c?y=e[m]>>r-c&p:(y=(e[m]&(1<<r+1)-1)<<c-r,m>0&&(y|=e[m-1]>>this.DB+r-c)),l=n;(y&1)==0;)y>>=1,--l;if((r-=l)<0&&(r+=this.DB,--m),v)a[y].copyTo(o),v=!1;else{for(;l>1;)i.sqrTo(o,x),i.sqrTo(x,o),l-=2;l>0?i.sqrTo(o,x):(S=o,o=x,x=S),i.mulTo(x,a[y],o)}for(;m>=0&&(e[m]&1<<r)==0;)i.sqrTo(o,x),S=o,o=x,x=S,--r<0&&(r=this.DB-1,--m)}return i.revert(o)}s(Vwe,"bnModPow");function zwe(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r}s(zwe,"bnGCD");function Hwe(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}s(Hwe,"bnpModInt");function Wwe(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return ne.ZERO;for(var r=e.clone(),n=this.clone(),o=Uc(1),i=Uc(0),a=Uc(0),l=Uc(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!o.isEven()||!i.isEven())&&(o.addTo(this,o),i.subTo(e,i)),o.rShiftTo(1,o)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);for(;n.isEven();)n.rShiftTo(1,n),t?((!a.isEven()||!l.isEven())&&(a.addTo(this,a),l.subTo(e,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(e,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),t&&o.subTo(a,o),i.subTo(l,i)):(n.subTo(r,n),t&&a.subTo(o,a),l.subTo(i,l))}if(n.compareTo(ne.ONE)!=0)return ne.ZERO;if(l.compareTo(e)>=0)return l.subtract(e);if(l.signum()<0)l.addTo(e,l);else return l;return l.signum()<0?l.add(e):l}s(Wwe,"bnModInverse");var Jn=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],qwe=(1<<26)/Jn[Jn.length-1];function Zwe(e){var t,r=this.abs();if(r.t==1&&r[0]<=Jn[Jn.length-1]){for(t=0;t<Jn.length;++t)if(r[0]==Jn[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Jn.length;){for(var n=Jn[t],o=t+1;o<Jn.length&&n<qwe;)n*=Jn[o++];for(n=r.modInt(n);t<o;)if(n%Jn[t++]==0)return!1}return r.millerRabin(e)}s(Zwe,"bnIsProbablePrime");function Xwe(e){var t=this.subtract(ne.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>Jn.length&&(e=Jn.length);for(var o=yt(),i=0;i<e;++i){o.fromInt(Jn[Math.floor(Math.random()*Jn.length)]);var a=o.modPow(n,this);if(a.compareTo(ne.ONE)!=0&&a.compareTo(t)!=0){for(var l=1;l++<r&&a.compareTo(t)!=0;)if(a=a.modPowInt(2,this),a.compareTo(ne.ONE)==0)return!1;if(a.compareTo(t)!=0)return!1}}return!0}s(Xwe,"bnpMillerRabin");ne.prototype.chunkSize=YTe;ne.prototype.toRadix=JTe;ne.prototype.fromRadix=QTe;ne.prototype.fromNumber=ewe;ne.prototype.bitwiseTo=iwe;ne.prototype.changeBit=vwe;ne.prototype.addTo=Cwe;ne.prototype.dMultiply=Awe;ne.prototype.dAddOffset=kwe;ne.prototype.multiplyLowerTo=Rwe;ne.prototype.multiplyUpperTo=Nwe;ne.prototype.modInt=Hwe;ne.prototype.millerRabin=Xwe;ne.prototype.clone=WTe;ne.prototype.intValue=qTe;ne.prototype.byteValue=ZTe;ne.prototype.shortValue=XTe;ne.prototype.signum=KTe;ne.prototype.toByteArray=twe;ne.prototype.equals=rwe;ne.prototype.min=nwe;ne.prototype.max=owe;ne.prototype.and=awe;ne.prototype.or=lwe;ne.prototype.xor=cwe;ne.prototype.andNot=uwe;ne.prototype.not=pwe;ne.prototype.shiftLeft=dwe;ne.prototype.shiftRight=fwe;ne.prototype.getLowestSetBit=hwe;ne.prototype.bitCount=gwe;ne.prototype.testBit=bwe;ne.prototype.setBit=xwe;ne.prototype.clearBit=Iwe;ne.prototype.flipBit=Swe;ne.prototype.add=Pwe;ne.prototype.subtract=Twe;ne.prototype.multiply=wwe;ne.prototype.divide=Owe;ne.prototype.remainder=Ewe;ne.prototype.divideAndRemainder=_we;ne.prototype.modPow=Vwe;ne.prototype.modInverse=Wwe;ne.prototype.pow=Lwe;ne.prototype.gcd=zwe;ne.prototype.isProbablePrime=Zwe;ne.prototype.square=Mwe;var rt=ne;rt.prototype.IsNegative=function(){return this.compareTo(rt.ZERO)==-1};rt.op_Equality=function(e,t){return e.compareTo(t)==0};rt.op_Inequality=function(e,t){return e.compareTo(t)!=0};rt.op_GreaterThan=function(e,t){return e.compareTo(t)>0};rt.op_LessThan=function(e,t){return e.compareTo(t)<0};rt.op_Addition=function(e,t){return new rt(e).add(new rt(t))};rt.op_Subtraction=function(e,t){return new rt(e).subtract(new rt(t))};rt.Int128Mul=function(e,t){return new rt(e).multiply(new rt(t))};rt.op_Division=function(e,t){return e.divide(t)};rt.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof QI>"u"&&(QI=s(function(e,t){var r;if(typeof Object.getOwnPropertyNames>"u"){for(r in t.prototype)(typeof e.prototype[r]>"u"||e.prototype[r]==Object.prototype[r])&&(e.prototype[r]=t.prototype[r]);for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}else{for(var n=Object.getOwnPropertyNames(t.prototype),o=0;o<n.length;o++)typeof Object.getOwnPropertyDescriptor(e.prototype,n[o])>"u"&&Object.defineProperty(e.prototype,n[o],Object.getOwnPropertyDescriptor(t.prototype,n[o]));for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}},"Inherit"));var QI;g.Path=function(){return[]};g.Paths=function(){return[]};g.DoublePoint=function(){var e=arguments;this.X=0,this.Y=0,e.length==1?(this.X=e[0].X,this.Y=e[0].Y):e.length==2&&(this.X=e[0],this.Y=e[1])};g.DoublePoint0=function(){this.X=0,this.Y=0};g.DoublePoint1=function(e){this.X=e.X,this.Y=e.Y};g.DoublePoint2=function(e,t){this.X=e,this.Y=t};g.PolyNode=function(){this.m_Parent=null,this.m_polygon=new g.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};g.PolyNode.prototype.IsHoleNode=function(){for(var e=!0,t=this.m_Parent;t!==null;)e=!e,t=t.m_Parent;return e};g.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};g.PolyNode.prototype.Contour=function(){return this.m_polygon};g.PolyNode.prototype.AddChild=function(e){var t=this.m_Childs.length;this.m_Childs.push(e),e.m_Parent=this,e.m_Index=t};g.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};g.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};g.PolyNode.prototype.Childs=function(){return this.m_Childs};g.PolyNode.prototype.Parent=function(){return this.m_Parent};g.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};g.PolyTree=function(){this.m_AllPolys=[],g.PolyNode.call(this)};g.PolyTree.prototype.Clear=function(){for(var e=0,t=this.m_AllPolys.length;e<t;e++)this.m_AllPolys[e]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};g.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};g.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};QI(g.PolyTree,g.PolyNode);g.Math_Abs_Int64=g.Math_Abs_Int32=g.Math_Abs_Double=function(e){return Math.abs(e)};g.Math_Max_Int32_Int32=function(e,t){return Math.max(e,t)};it.msie||it.opera||it.safari?g.Cast_Int32=function(e){return e|0}:g.Cast_Int32=function(e){return~~e};it.chrome?g.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:it.firefox&&typeof Number.toInteger=="function"?g.Cast_Int64=function(e){return Number.toInteger(e)}:it.msie7||it.msie8?g.Cast_Int64=function(e){return parseInt(e,10)}:it.msie?g.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):e|0}:g.Cast_Int64=function(e){return e<0?Math.ceil(e):Math.floor(e)};g.Clear=function(e){e.length=0};g.PI=3.141592653589793;g.PI2=2*3.141592653589793;g.IntPoint=function(){var e=arguments,t=e.length;if(this.X=0,this.Y=0,Kp)if(this.Z=0,t==3)this.X=e[0],this.Y=e[1],this.Z=e[2];else if(t==2)this.X=e[0],this.Y=e[1],this.Z=0;else if(t==1)if(e[0]instanceof g.DoublePoint){var r=e[0];this.X=g.Clipper.Round(r.X),this.Y=g.Clipper.Round(r.Y),this.Z=0}else{var n=e[0];typeof n.Z>"u"&&(n.Z=0),this.X=n.X,this.Y=n.Y,this.Z=n.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=e[0],this.Y=e[1];else if(t==1)if(e[0]instanceof g.DoublePoint){var r=e[0];this.X=g.Clipper.Round(r.X),this.Y=g.Clipper.Round(r.Y)}else{var n=e[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};g.IntPoint.op_Equality=function(e,t){return e.X==t.X&&e.Y==t.Y};g.IntPoint.op_Inequality=function(e,t){return e.X!=t.X||e.Y!=t.Y};Kp?(g.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},g.IntPoint1=function(e){this.X=e.X,this.Y=e.Y,this.Z=e.Z},g.IntPoint1dp=function(e){this.X=g.Clipper.Round(e.X),this.Y=g.Clipper.Round(e.Y),this.Z=0},g.IntPoint2=function(e,t){this.X=e,this.Y=t,this.Z=0},g.IntPoint3=function(e,t,r){this.X=e,this.Y=t,this.Z=r}):(g.IntPoint0=function(){this.X=0,this.Y=0},g.IntPoint1=function(e){this.X=e.X,this.Y=e.Y},g.IntPoint1dp=function(e){this.X=g.Clipper.Round(e.X),this.Y=g.Clipper.Round(e.Y)},g.IntPoint2=function(e,t){this.X=e,this.Y=t});g.IntRect=function(){var e=arguments,t=e.length;t==4?(this.left=e[0],this.top=e[1],this.right=e[2],this.bottom=e[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};g.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};g.IntRect1=function(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom};g.IntRect4=function(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n};g.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};g.PolyType={ptSubject:0,ptClip:1};g.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};g.JoinType={jtSquare:0,jtRound:1,jtMiter:2};g.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};MJ&&(g.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});g.EdgeSide={esLeft:0,esRight:1};g.Direction={dRightToLeft:0,dLeftToRight:1};g.TEdge=function(){this.Bot=new g.IntPoint,this.Curr=new g.IntPoint,this.Top=new g.IntPoint,this.Delta=new g.IntPoint,this.Dx=0,this.PolyTyp=g.PolyType.ptSubject,this.Side=g.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};g.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new g.IntPoint};g.MyIntersectNodeSort=function(){};g.MyIntersectNodeSort.Compare=function(e,t){return t.Pt.Y-e.Pt.Y};g.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};g.Scanbeam=function(){this.Y=0,this.Next=null};g.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};g.OutPt=function(){this.Idx=0,this.Pt=new g.IntPoint,this.Next=null,this.Prev=null};g.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new g.IntPoint};g.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};g.ClipperBase.horizontal=-9007199254740992;g.ClipperBase.Skip=-2;g.ClipperBase.Unassigned=-1;g.ClipperBase.tolerance=1e-20;lTe?(g.ClipperBase.loRange=46340,g.ClipperBase.hiRange=46340):(g.ClipperBase.loRange=47453132,g.ClipperBase.hiRange=0xfffffffffffff);g.ClipperBase.near_zero=function(e){return e>-g.ClipperBase.tolerance&&e<g.ClipperBase.tolerance};g.ClipperBase.IsHorizontal=function(e){return e.Delta.Y===0};g.ClipperBase.prototype.PointIsVertex=function(e,t){var r=t;do{if(g.IntPoint.op_Equality(r.Pt,e))return!0;r=r.Next}while(r!=t);return!1};g.ClipperBase.prototype.PointOnLineSegment=function(e,t,r,n){return n?e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&rt.op_Equality(rt.Int128Mul(e.X-t.X,r.Y-t.Y),rt.Int128Mul(r.X-t.X,e.Y-t.Y)):e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&(e.X-t.X)*(r.Y-t.Y)==(r.X-t.X)*(e.Y-t.Y)};g.ClipperBase.prototype.PointOnPolygon=function(e,t,r){for(var n=t;;){if(this.PointOnLineSegment(e,n.Pt,n.Next.Pt,r))return!0;if(n=n.Next,n==t)break}return!1};g.ClipperBase.prototype.SlopesEqual=g.ClipperBase.SlopesEqual=function(){var e=arguments,t=e.length,r,n,o,i,a,l,c;return t==3?(r=e[0],n=e[1],c=e[2],c?rt.op_Equality(rt.Int128Mul(r.Delta.Y,n.Delta.X),rt.Int128Mul(r.Delta.X,n.Delta.Y)):g.Cast_Int64(r.Delta.Y*n.Delta.X)==g.Cast_Int64(r.Delta.X*n.Delta.Y)):t==4?(o=e[0],i=e[1],a=e[2],c=e[3],c?rt.op_Equality(rt.Int128Mul(o.Y-i.Y,i.X-a.X),rt.Int128Mul(o.X-i.X,i.Y-a.Y)):g.Cast_Int64((o.Y-i.Y)*(i.X-a.X))-g.Cast_Int64((o.X-i.X)*(i.Y-a.Y))===0):(o=e[0],i=e[1],a=e[2],l=e[3],c=e[4],c?rt.op_Equality(rt.Int128Mul(o.Y-i.Y,a.X-l.X),rt.Int128Mul(o.X-i.X,a.Y-l.Y)):g.Cast_Int64((o.Y-i.Y)*(a.X-l.X))-g.Cast_Int64((o.X-i.X)*(a.Y-l.Y))===0)};g.ClipperBase.SlopesEqual3=function(e,t,r){return r?rt.op_Equality(rt.Int128Mul(e.Delta.Y,t.Delta.X),rt.Int128Mul(e.Delta.X,t.Delta.Y)):g.Cast_Int64(e.Delta.Y*t.Delta.X)==g.Cast_Int64(e.Delta.X*t.Delta.Y)};g.ClipperBase.SlopesEqual4=function(e,t,r,n){return n?rt.op_Equality(rt.Int128Mul(e.Y-t.Y,t.X-r.X),rt.Int128Mul(e.X-t.X,t.Y-r.Y)):g.Cast_Int64((e.Y-t.Y)*(t.X-r.X))-g.Cast_Int64((e.X-t.X)*(t.Y-r.Y))===0};g.ClipperBase.SlopesEqual5=function(e,t,r,n,o){return o?rt.op_Equality(rt.Int128Mul(e.Y-t.Y,r.X-n.X),rt.Int128Mul(e.X-t.X,r.Y-n.Y)):g.Cast_Int64((e.Y-t.Y)*(r.X-n.X))-g.Cast_Int64((e.X-t.X)*(r.Y-n.Y))===0};g.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var e=0,t=this.m_edges.length;e<t;++e){for(var r=0,n=this.m_edges[e].length;r<n;++r)this.m_edges[e][r]=null;g.Clear(this.m_edges[e])}g.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};g.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var e=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=e}this.m_CurrentLM=null};g.ClipperBase.prototype.RangeTest=function(e,t){t.Value?(e.X>g.ClipperBase.hiRange||e.Y>g.ClipperBase.hiRange||-e.X>g.ClipperBase.hiRange||-e.Y>g.ClipperBase.hiRange)&&g.Error("Coordinate outside allowed range in RangeTest()."):(e.X>g.ClipperBase.loRange||e.Y>g.ClipperBase.loRange||-e.X>g.ClipperBase.loRange||-e.Y>g.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(e,t))};g.ClipperBase.prototype.InitEdge=function(e,t,r,n){e.Next=t,e.Prev=r,e.Curr.X=n.X,e.Curr.Y=n.Y,e.OutIdx=-1};g.ClipperBase.prototype.InitEdge2=function(e,t){e.Curr.Y>=e.Next.Curr.Y?(e.Bot.X=e.Curr.X,e.Bot.Y=e.Curr.Y,e.Top.X=e.Next.Curr.X,e.Top.Y=e.Next.Curr.Y):(e.Top.X=e.Curr.X,e.Top.Y=e.Curr.Y,e.Bot.X=e.Next.Curr.X,e.Bot.Y=e.Next.Curr.Y),this.SetDx(e),e.PolyTyp=t};g.ClipperBase.prototype.FindNextLocMin=function(e){for(var t;;){for(;g.IntPoint.op_Inequality(e.Bot,e.Prev.Bot)||g.IntPoint.op_Equality(e.Curr,e.Top);)e=e.Next;if(e.Dx!=g.ClipperBase.horizontal&&e.Prev.Dx!=g.ClipperBase.horizontal)break;for(;e.Prev.Dx==g.ClipperBase.horizontal;)e=e.Prev;for(t=e;e.Dx==g.ClipperBase.horizontal;)e=e.Next;if(e.Top.Y!=e.Prev.Bot.Y){t.Prev.Bot.X<e.Bot.X&&(e=t);break}}return e};g.ClipperBase.prototype.ProcessBound=function(e,t){var r=e,n=e,o,i;if(e.Dx==g.ClipperBase.horizontal&&(t?i=e.Prev.Bot.X:i=e.Next.Bot.X,e.Bot.X!=i&&this.ReverseHorizontal(e)),n.OutIdx!=g.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=g.ClipperBase.Skip;)n=n.Next;if(n.Dx==g.ClipperBase.horizontal&&n.Next.OutIdx!=g.ClipperBase.Skip){for(o=n;o.Prev.Dx==g.ClipperBase.horizontal;)o=o.Prev;o.Prev.Top.X==n.Next.Top.X?t||(n=o.Prev):o.Prev.Top.X>n.Next.Top.X&&(n=o.Prev)}for(;e!=n;)e.NextInLML=e.Next,e.Dx==g.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),e=e.Next;e.Dx==g.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),n=n.Next}else{for(;n.Top.Y==n.Prev.Bot.Y&&n.Prev.OutIdx!=g.ClipperBase.Skip;)n=n.Prev;if(n.Dx==g.ClipperBase.horizontal&&n.Prev.OutIdx!=g.ClipperBase.Skip){for(o=n;o.Next.Dx==g.ClipperBase.horizontal;)o=o.Next;o.Next.Top.X==n.Prev.Top.X?t||(n=o.Next):o.Next.Top.X>n.Prev.Top.X&&(n=o.Next)}for(;e!=n;)e.NextInLML=e.Prev,e.Dx==g.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),e=e.Prev;e.Dx==g.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),n=n.Prev}if(n.OutIdx==g.ClipperBase.Skip){if(e=n,t){for(;e.Top.Y==e.Next.Bot.Y;)e=e.Next;for(;e!=n&&e.Dx==g.ClipperBase.horizontal;)e=e.Prev}else{for(;e.Top.Y==e.Prev.Bot.Y;)e=e.Prev;for(;e!=n&&e.Dx==g.ClipperBase.horizontal;)e=e.Next}if(e==n)t?n=e.Next:n=e.Prev;else{t?e=n.Next:e=n.Prev;var a=new g.LocalMinima;a.Next=null,a.Y=e.Bot.Y,a.LeftBound=null,a.RightBound=e,a.RightBound.WindDelta=0,n=this.ProcessBound(a.RightBound,t),this.InsertLocalMinima(a)}}return n};g.ClipperBase.prototype.AddPath=function(e,t,r){wJ?!r&&t==g.PolyType.ptClip&&g.Error("AddPath: Open paths must be subject."):r||g.Error("AddPath: Open paths have been disabled.");var n=e.length-1;if(r)for(;n>0&&g.IntPoint.op_Equality(e[n],e[0]);)--n;for(;n>0&&g.IntPoint.op_Equality(e[n],e[n-1]);)--n;if(r&&n<2||!r&&n<1)return!1;for(var o=new Array,i=0;i<=n;i++)o.push(new g.TEdge);var a=!0;o[1].Curr.X=e[1].X,o[1].Curr.Y=e[1].Y;var l={Value:this.m_UseFullRange};this.RangeTest(e[0],l),this.m_UseFullRange=l.Value,l.Value=this.m_UseFullRange,this.RangeTest(e[n],l),this.m_UseFullRange=l.Value,this.InitEdge(o[0],o[1],o[n],e[0]),this.InitEdge(o[n],o[0],o[n-1],e[n]);for(var i=n-1;i>=1;--i)l.Value=this.m_UseFullRange,this.RangeTest(e[i],l),this.m_UseFullRange=l.Value,this.InitEdge(o[i],o[i+1],o[i-1],e[i]);for(var c=o[0],p=c,f=c;;){if(g.IntPoint.op_Equality(p.Curr,p.Next.Curr)){if(p==p.Next)break;p==c&&(c=p.Next),p=this.RemoveEdge(p),f=p;continue}if(p.Prev==p.Next)break;if(r&&g.ClipperBase.SlopesEqual(p.Prev.Curr,p.Curr,p.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(p.Prev.Curr,p.Curr,p.Next.Curr))){p==c&&(c=p.Next),p=this.RemoveEdge(p),p=p.Prev,f=p;continue}if(p=p.Next,p==f)break}if(!r&&p==p.Next||r&&p.Prev==p.Next)return!1;r||(this.m_HasOpenPaths=!0,c.Prev.OutIdx=g.ClipperBase.Skip);var m=c;p=c;do this.InitEdge2(p,t),p=p.Next,a&&p.Curr.Y!=c.Curr.Y&&(a=!1);while(p!=c);if(a){if(r)return!1;p.Prev.OutIdx=g.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var y=new g.LocalMinima;for(y.Next=null,y.Y=p.Bot.Y,y.LeftBound=null,y.RightBound=p,y.RightBound.Side=g.EdgeSide.esRight,y.RightBound.WindDelta=0;p.Next.OutIdx!=g.ClipperBase.Skip;)p.NextInLML=p.Next,p.Bot.X!=p.Prev.Top.X&&this.ReverseHorizontal(p),p=p.Next;return this.InsertLocalMinima(y),this.m_edges.push(o),!0}this.m_edges.push(o);for(var v,x=null;p=this.FindNextLocMin(p),p!=x;){x==null&&(x=p);var y=new g.LocalMinima;y.Next=null,y.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(y.LeftBound=p.Prev,y.RightBound=p,v=!1):(y.LeftBound=p,y.RightBound=p.Prev,v=!0),y.LeftBound.Side=g.EdgeSide.esLeft,y.RightBound.Side=g.EdgeSide.esRight,r?y.LeftBound.Next==y.RightBound?y.LeftBound.WindDelta=-1:y.LeftBound.WindDelta=1:y.LeftBound.WindDelta=0,y.RightBound.WindDelta=-y.LeftBound.WindDelta,p=this.ProcessBound(y.LeftBound,v);var S=this.ProcessBound(y.RightBound,!v);y.LeftBound.OutIdx==g.ClipperBase.Skip?y.LeftBound=null:y.RightBound.OutIdx==g.ClipperBase.Skip&&(y.RightBound=null),this.InsertLocalMinima(y),v||(p=S)}return!0};g.ClipperBase.prototype.AddPaths=function(e,t,r){for(var n=!1,o=0,i=e.length;o<i;++o)this.AddPath(e[o],t,r)&&(n=!0);return n};g.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(e,t,r){return g.IntPoint.op_Equality(e,r)||g.IntPoint.op_Equality(e,t)||g.IntPoint.op_Equality(r,t)?!1:e.X!=r.X?t.X>e.X==t.X<r.X:t.Y>e.Y==t.Y<r.Y};g.ClipperBase.prototype.RemoveEdge=function(e){e.Prev.Next=e.Next,e.Next.Prev=e.Prev;var t=e.Next;return e.Prev=null,t};g.ClipperBase.prototype.SetDx=function(e){e.Delta.X=e.Top.X-e.Bot.X,e.Delta.Y=e.Top.Y-e.Bot.Y,e.Delta.Y===0?e.Dx=g.ClipperBase.horizontal:e.Dx=e.Delta.X/e.Delta.Y};g.ClipperBase.prototype.InsertLocalMinima=function(e){if(this.m_MinimaList===null)this.m_MinimaList=e;else if(e.Y>=this.m_MinimaList.Y)e.Next=this.m_MinimaList,this.m_MinimaList=e;else{for(var t=this.m_MinimaList;t.Next!==null&&e.Y<t.Next.Y;)t=t.Next;e.Next=t.Next,t.Next=e}};g.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};g.ClipperBase.prototype.ReverseHorizontal=function(e){var t=e.Top.X;e.Top.X=e.Bot.X,e.Bot.X=t,Kp&&(t=e.Top.Z,e.Top.Z=e.Bot.Z,e.Bot.Z=t)};g.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var e=this.m_MinimaList;e!=null;){var t=e.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=g.EdgeSide.esLeft,t.OutIdx=g.ClipperBase.Unassigned),t=e.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=g.EdgeSide.esRight,t.OutIdx=g.ClipperBase.Unassigned),e=e.Next}};g.Clipper=function(e){typeof e>"u"&&(e=0),this.m_PolyOuts=null,this.m_ClipType=g.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=g.PolyFillType.pftEvenOdd,this.m_SubjFillType=g.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,g.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=g.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&e)!==0,this.StrictlySimple=(2&e)!==0,this.PreserveCollinear=(4&e)!==0,Kp&&(this.ZFillFunction=null)};g.Clipper.ioReverseSolution=1;g.Clipper.ioStrictlySimple=2;g.Clipper.ioPreserveCollinear=4;g.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),g.ClipperBase.prototype.Clear.call(this))};g.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var e=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=e}};g.Clipper.prototype.Reset=function(){g.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var e=this.m_MinimaList;e!==null;)this.InsertScanbeam(e.Y),e=e.Next};g.Clipper.prototype.InsertScanbeam=function(e){if(this.m_Scanbeam===null)this.m_Scanbeam=new g.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=e;else if(e>this.m_Scanbeam.Y){var t=new g.Scanbeam;t.Y=e,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var r=this.m_Scanbeam;r.Next!==null&&e<=r.Next.Y;)r=r.Next;if(e==r.Y)return;var t=new g.Scanbeam;t.Y=e,t.Next=r.Next,r.Next=t}};g.Clipper.prototype.Execute=function(){var e=arguments,t=e.length,r=e[1]instanceof g.PolyTree;if(t==4&&!r){var n=e[0],o=e[1],i=e[2],a=e[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&g.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,g.Clear(o),this.m_SubjFillType=i,this.m_ClipFillType=a,this.m_ClipType=n,this.m_UsingPolyTree=!1;try{var l=this.ExecuteInternal();l&&this.BuildResult(o)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(t==4&&r){var n=e[0],c=e[1],i=e[2],a=e[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=i,this.m_ClipFillType=a,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var l=this.ExecuteInternal();l&&this.BuildResult2(c)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(t==2&&!r){var n=e[0],o=e[1];return this.Execute(n,o,g.PolyFillType.pftEvenOdd,g.PolyFillType.pftEvenOdd)}else if(t==2&&r){var n=e[0],c=e[1];return this.Execute(n,c,g.PolyFillType.pftEvenOdd,g.PolyFillType.pftEvenOdd)}};g.Clipper.prototype.FixHoleLinkage=function(e){if(!(e.FirstLeft===null||e.IsHole!=e.FirstLeft.IsHole&&e.FirstLeft.Pts!==null)){for(var t=e.FirstLeft;t!==null&&(t.IsHole==e.IsHole||t.Pts===null);)t=t.FirstLeft;e.FirstLeft=t}};g.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var e=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(e),g.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(e,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),e=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var o=this.m_PolyOuts[r];o.Pts===null||o.IsOpen||(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)}this.JoinCommonEdges();for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var o=this.m_PolyOuts[r];o.Pts!==null&&!o.IsOpen&&this.FixupOutPolygon(o)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{g.Clear(this.m_Joins),g.Clear(this.m_GhostJoins)}};g.Clipper.prototype.PopScanbeam=function(){var e=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,e};g.Clipper.prototype.DisposeAllPolyPts=function(){for(var e=0,t=this.m_PolyOuts.length;e<t;++e)this.DisposeOutRec(e);g.Clear(this.m_PolyOuts)};g.Clipper.prototype.DisposeOutRec=function(e){var t=this.m_PolyOuts[e];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[e]=null};g.Clipper.prototype.DisposeOutPts=function(e){if(e!==null){var t=null;for(e.Prev.Next=null;e!==null;)t=e,e=e.Next,t=null}};g.Clipper.prototype.AddJoin=function(e,t,r){var n=new g.Join;n.OutPt1=e,n.OutPt2=t,n.OffPt.X=r.X,n.OffPt.Y=r.Y,this.m_Joins.push(n)};g.Clipper.prototype.AddGhostJoin=function(e,t){var r=new g.Join;r.OutPt1=e,r.OffPt.X=t.X,r.OffPt.Y=t.Y,this.m_GhostJoins.push(r)};Kp&&(g.Clipper.prototype.SetZ=function(e,t){e.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,e):this.ZFillFunction(t.Top,t.Bot,e))});g.Clipper.prototype.InsertLocalMinimaIntoAEL=function(e){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==e;){var t=this.m_CurrentLM.LeftBound,r=this.m_CurrentLM.RightBound;this.PopLocalMinima();var n=null;if(t===null?(this.InsertEdgeIntoAEL(r,null),this.SetWindingCount(r),this.IsContributing(r)&&(n=this.AddOutPt(r,r.Bot))):r==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(n=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(r,t),this.SetWindingCount(t),r.WindCnt=t.WindCnt,r.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(n=this.AddLocalMinPoly(t,r,t.Bot)),this.InsertScanbeam(t.Top.Y)),r!=null&&(g.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(t==null||r==null)){if(n!==null&&g.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var o=0,i=this.m_GhostJoins.length;o<i;o++){var a=this.m_GhostJoins[o];this.HorzSegmentsOverlap(a.OutPt1.Pt,a.OffPt,r.Bot,r.Top)&&this.AddJoin(a.OutPt1,n,a.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&g.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,l,t.Top)}if(t.NextInAEL!=r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&g.ClipperBase.SlopesEqual(r.PrevInAEL,r,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(n,l,r.Top)}var c=t.NextInAEL;if(c!==null)for(;c!=r;)this.IntersectEdges(r,c,t.Curr,!1),c=c.NextInAEL}}}};g.Clipper.prototype.InsertEdgeIntoAEL=function(e,t){if(this.m_ActiveEdges===null)e.PrevInAEL=null,e.NextInAEL=null,this.m_ActiveEdges=e;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,e))e.PrevInAEL=null,e.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=e,this.m_ActiveEdges=e;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,e);)t=t.NextInAEL;e.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=e),e.PrevInAEL=t,t.NextInAEL=e}};g.Clipper.prototype.E2InsertsBeforeE1=function(e,t){return t.Curr.X==e.Curr.X?t.Top.Y>e.Top.Y?t.Top.X<g.Clipper.TopX(e,t.Top.Y):e.Top.X>g.Clipper.TopX(t,e.Top.Y):t.Curr.X<e.Curr.X};g.Clipper.prototype.IsEvenOddFillType=function(e){return e.PolyTyp==g.PolyType.ptSubject?this.m_SubjFillType==g.PolyFillType.pftEvenOdd:this.m_ClipFillType==g.PolyFillType.pftEvenOdd};g.Clipper.prototype.IsEvenOddAltFillType=function(e){return e.PolyTyp==g.PolyType.ptSubject?this.m_ClipFillType==g.PolyFillType.pftEvenOdd:this.m_SubjFillType==g.PolyFillType.pftEvenOdd};g.Clipper.prototype.IsContributing=function(e){var t,r;switch(e.PolyTyp==g.PolyType.ptSubject?(t=this.m_SubjFillType,r=this.m_ClipFillType):(t=this.m_ClipFillType,r=this.m_SubjFillType),t){case g.PolyFillType.pftEvenOdd:if(e.WindDelta===0&&e.WindCnt!=1)return!1;break;case g.PolyFillType.pftNonZero:if(Math.abs(e.WindCnt)!=1)return!1;break;case g.PolyFillType.pftPositive:if(e.WindCnt!=1)return!1;break;default:if(e.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case g.ClipType.ctIntersection:switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2!==0;case g.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case g.ClipType.ctUnion:switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2===0;case g.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}case g.ClipType.ctDifference:if(e.PolyTyp==g.PolyType.ptSubject)switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2===0;case g.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2!==0;case g.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case g.ClipType.ctXor:if(e.WindDelta===0)switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2===0;case g.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else return!0}return!0};g.Clipper.prototype.SetWindingCount=function(e){for(var t=e.PrevInAEL;t!==null&&(t.PolyTyp!=e.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)e.WindCnt=e.WindDelta===0?1:e.WindDelta,e.WindCnt2=0,t=this.m_ActiveEdges;else if(e.WindDelta===0&&this.m_ClipType!=g.ClipType.ctUnion)e.WindCnt=1,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(e)){if(e.WindDelta===0){for(var r=!0,n=t.PrevInAEL;n!==null;)n.PolyTyp==t.PolyTyp&&n.WindDelta!==0&&(r=!r),n=n.PrevInAEL;e.WindCnt=r?0:1}else e.WindCnt=e.WindDelta;e.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta:e.WindCnt=e.WindDelta===0?1:e.WindDelta:e.WindDelta===0?e.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(e))for(;t!=e;)t.WindDelta!==0&&(e.WindCnt2=e.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=e;)e.WindCnt2+=t.WindDelta,t=t.NextInAEL};g.Clipper.prototype.AddEdgeToSEL=function(e){this.m_SortedEdges===null?(this.m_SortedEdges=e,e.PrevInSEL=null,e.NextInSEL=null):(e.NextInSEL=this.m_SortedEdges,e.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=e,this.m_SortedEdges=e)};g.Clipper.prototype.CopyAELToSEL=function(){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e=e.NextInAEL};g.Clipper.prototype.SwapPositionsInAEL=function(e,t){if(!(e.NextInAEL==e.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(e.NextInAEL==t){var r=t.NextInAEL;r!==null&&(r.PrevInAEL=e);var n=e.PrevInAEL;n!==null&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=r}else if(t.NextInAEL==e){var r=e.NextInAEL;r!==null&&(r.PrevInAEL=t);var n=t.PrevInAEL;n!==null&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=r}else{var r=e.NextInAEL,n=e.PrevInAEL;e.NextInAEL=t.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=t.PrevInAEL,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e),t.NextInAEL=r,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=n,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}e.PrevInAEL===null?this.m_ActiveEdges=e:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};g.Clipper.prototype.SwapPositionsInSEL=function(e,t){if(!(e.NextInSEL===null&&e.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(e.NextInSEL==t){var r=t.NextInSEL;r!==null&&(r.PrevInSEL=e);var n=e.PrevInSEL;n!==null&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=r}else if(t.NextInSEL==e){var r=e.NextInSEL;r!==null&&(r.PrevInSEL=t);var n=t.PrevInSEL;n!==null&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=r}else{var r=e.NextInSEL,n=e.PrevInSEL;e.NextInSEL=t.NextInSEL,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=t.PrevInSEL,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e),t.NextInSEL=r,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=n,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}e.PrevInSEL===null?this.m_SortedEdges=e:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};g.Clipper.prototype.AddLocalMaxPoly=function(e,t,r){this.AddOutPt(e,r),t.WindDelta==0&&this.AddOutPt(t,r),e.OutIdx==t.OutIdx?(e.OutIdx=-1,t.OutIdx=-1):e.OutIdx<t.OutIdx?this.AppendPolygon(e,t):this.AppendPolygon(t,e)};g.Clipper.prototype.AddLocalMinPoly=function(e,t,r){var n,o,i;if(g.ClipperBase.IsHorizontal(t)||e.Dx>t.Dx?(n=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,e.Side=g.EdgeSide.esLeft,t.Side=g.EdgeSide.esRight,o=e,o.PrevInAEL==t?i=t.PrevInAEL:i=o.PrevInAEL):(n=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,e.Side=g.EdgeSide.esRight,t.Side=g.EdgeSide.esLeft,o=t,o.PrevInAEL==e?i=e.PrevInAEL:i=o.PrevInAEL),i!==null&&i.OutIdx>=0&&g.Clipper.TopX(i,r.Y)==g.Clipper.TopX(o,r.Y)&&g.ClipperBase.SlopesEqual(o,i,this.m_UseFullRange)&&o.WindDelta!==0&&i.WindDelta!==0){var a=this.AddOutPt(i,r);this.AddJoin(n,a,o.Top)}return n};g.Clipper.prototype.CreateOutRec=function(){var e=new g.OutRec;return e.Idx=-1,e.IsHole=!1,e.IsOpen=!1,e.FirstLeft=null,e.Pts=null,e.BottomPt=null,e.PolyNode=null,this.m_PolyOuts.push(e),e.Idx=this.m_PolyOuts.length-1,e};g.Clipper.prototype.AddOutPt=function(e,t){var r=e.Side==g.EdgeSide.esLeft;if(e.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=e.WindDelta===0;var o=new g.OutPt;return n.Pts=o,o.Idx=n.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=o,o.Prev=o,n.IsOpen||this.SetHoleState(e,n),Kp&&(g.IntPoint.op_Equality(t,e.Bot)?(o.Pt.X=e.Bot.X,o.Pt.Y=e.Bot.Y,o.Pt.Z=e.Bot.Z):g.IntPoint.op_Equality(t,e.Top)?(o.Pt.X=e.Top.X,o.Pt.Y=e.Top.Y,o.Pt.Z=e.Top.Z):this.SetZ(o.Pt,e)),e.OutIdx=n.Idx,o}else{var n=this.m_PolyOuts[e.OutIdx],i=n.Pts;if(r&&g.IntPoint.op_Equality(t,i.Pt))return i;if(!r&&g.IntPoint.op_Equality(t,i.Prev.Pt))return i.Prev;var o=new g.OutPt;return o.Idx=n.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=i,o.Prev=i.Prev,o.Prev.Next=o,i.Prev=o,r&&(n.Pts=o),Kp&&(g.IntPoint.op_Equality(t,e.Bot)?(o.Pt.X=e.Bot.X,o.Pt.Y=e.Bot.Y,o.Pt.Z=e.Bot.Z):g.IntPoint.op_Equality(t,e.Top)?(o.Pt.X=e.Top.X,o.Pt.Y=e.Top.Y,o.Pt.Z=e.Top.Z):this.SetZ(o.Pt,e)),o}};g.Clipper.prototype.SwapPoints=function(e,t){var r=new g.IntPoint(e.Value);e.Value.X=t.Value.X,e.Value.Y=t.Value.Y,t.Value.X=r.X,t.Value.Y=r.Y};g.Clipper.prototype.HorzSegmentsOverlap=function(e,t,r,n){return e.X>r.X==e.X<n.X||t.X>r.X==t.X<n.X||r.X>e.X==r.X<t.X||n.X>e.X==n.X<t.X||e.X==r.X&&t.X==n.X?!0:e.X==n.X&&t.X==r.X};g.Clipper.prototype.InsertPolyPtBetween=function(e,t,r){var n=new g.OutPt;return n.Pt.X=r.X,n.Pt.Y=r.Y,t==e.Next?(e.Next=n,t.Prev=n,n.Next=t,n.Prev=e):(t.Next=n,e.Prev=n,n.Next=e,n.Prev=t),n};g.Clipper.prototype.SetHoleState=function(e,t){for(var r=!1,n=e.PrevInAEL;n!==null;)n.OutIdx>=0&&n.WindDelta!=0&&(r=!r,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;r&&(t.IsHole=!0)};g.Clipper.prototype.GetDx=function(e,t){return e.Y==t.Y?g.ClipperBase.horizontal:(t.X-e.X)/(t.Y-e.Y)};g.Clipper.prototype.FirstIsBottomPt=function(e,t){for(var r=e.Prev;g.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Prev;var n=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=e.Next;g.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Next;var o=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=t.Prev;g.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Prev;var i=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=t.Next;g.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var a=Math.abs(this.GetDx(t.Pt,r.Pt));return n>=i&&n>=a||o>=i&&o>=a};g.Clipper.prototype.GetBottomPt=function(e){for(var t=null,r=e.Next;r!=e;)r.Pt.Y>e.Pt.Y?(e=r,t=null):r.Pt.Y==e.Pt.Y&&r.Pt.X<=e.Pt.X&&(r.Pt.X<e.Pt.X?(t=null,e=r):r.Next!=e&&r.Prev!=e&&(t=r)),r=r.Next;if(t!==null)for(;t!=r;)for(this.FirstIsBottomPt(r,t)||(e=t),t=t.Next;g.IntPoint.op_Inequality(t.Pt,e.Pt);)t=t.Next;return e};g.Clipper.prototype.GetLowermostRec=function(e,t){e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var r=e.BottomPt,n=t.BottomPt;return r.Pt.Y>n.Pt.Y?e:r.Pt.Y<n.Pt.Y?t:r.Pt.X<n.Pt.X?e:r.Pt.X>n.Pt.X||r.Next==r?t:n.Next==n||this.FirstIsBottomPt(r,n)?e:t};g.Clipper.prototype.Param1RightOfParam2=function(e,t){do if(e=e.FirstLeft,e==t)return!0;while(e!==null);return!1};g.Clipper.prototype.GetOutRec=function(e){for(var t=this.m_PolyOuts[e];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};g.Clipper.prototype.AppendPolygon=function(e,t){var r=this.m_PolyOuts[e.OutIdx],n=this.m_PolyOuts[t.OutIdx],o;this.Param1RightOfParam2(r,n)?o=n:this.Param1RightOfParam2(n,r)?o=r:o=this.GetLowermostRec(r,n);var i=r.Pts,a=i.Prev,l=n.Pts,c=l.Prev,p;e.Side==g.EdgeSide.esLeft?(t.Side==g.EdgeSide.esLeft?(this.ReversePolyPtLinks(l),l.Next=i,i.Prev=l,a.Next=c,c.Prev=a,r.Pts=c):(c.Next=i,i.Prev=c,l.Prev=a,a.Next=l,r.Pts=l),p=g.EdgeSide.esLeft):(t.Side==g.EdgeSide.esRight?(this.ReversePolyPtLinks(l),a.Next=c,c.Prev=a,l.Next=i,i.Prev=l):(a.Next=l,l.Prev=a,i.Prev=c,c.Next=i),p=g.EdgeSide.esRight),r.BottomPt=null,o==n&&(n.FirstLeft!=r&&(r.FirstLeft=n.FirstLeft),r.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=r;var f=e.OutIdx,m=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var y=this.m_ActiveEdges;y!==null;){if(y.OutIdx==m){y.OutIdx=f,y.Side=p;break}y=y.NextInAEL}n.Idx=r.Idx};g.Clipper.prototype.ReversePolyPtLinks=function(e){if(e!==null){var t,r;t=e;do r=t.Next,t.Next=t.Prev,t.Prev=r,t=r;while(t!=e)}};g.Clipper.SwapSides=function(e,t){var r=e.Side;e.Side=t.Side,t.Side=r};g.Clipper.SwapPolyIndexes=function(e,t){var r=e.OutIdx;e.OutIdx=t.OutIdx,t.OutIdx=r};g.Clipper.prototype.IntersectEdges=function(e,t,r,n){var o=!n&&e.NextInLML===null&&e.Top.X==r.X&&e.Top.Y==r.Y,i=!n&&t.NextInLML===null&&t.Top.X==r.X&&t.Top.Y==r.Y,a=e.OutIdx>=0,l=t.OutIdx>=0;if(wJ&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(o||i)&&a&&l&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==g.ClipType.ctUnion?e.WindDelta===0?l&&(this.AddOutPt(e,r),a&&(e.OutIdx=-1)):a&&(this.AddOutPt(t,r),l&&(t.OutIdx=-1)):e.PolyTyp!=t.PolyTyp&&(e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=g.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(e,r),a&&(e.OutIdx=-1)):t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=g.ClipType.ctUnion||e.WindCnt2===0)&&(this.AddOutPt(t,r),l&&(t.OutIdx=-1))),o&&(e.OutIdx<0?this.DeleteFromAEL(e):g.Error("Error intersecting polylines")),i&&(t.OutIdx<0?this.DeleteFromAEL(t):g.Error("Error intersecting polylines"));return}if(e.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(e)){var c=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=c}else e.WindCnt+t.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt+=t.WindDelta,t.WindCnt-e.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=e.WindDelta;else this.IsEvenOddFillType(t)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(e)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=e.WindDelta;var p,f,m,y;e.PolyTyp==g.PolyType.ptSubject?(p=this.m_SubjFillType,m=this.m_ClipFillType):(p=this.m_ClipFillType,m=this.m_SubjFillType),t.PolyTyp==g.PolyType.ptSubject?(f=this.m_SubjFillType,y=this.m_ClipFillType):(f=this.m_ClipFillType,y=this.m_SubjFillType);var v,x;switch(p){case g.PolyFillType.pftPositive:v=e.WindCnt;break;case g.PolyFillType.pftNegative:v=-e.WindCnt;break;default:v=Math.abs(e.WindCnt);break}switch(f){case g.PolyFillType.pftPositive:x=t.WindCnt;break;case g.PolyFillType.pftNegative:x=-t.WindCnt;break;default:x=Math.abs(t.WindCnt);break}if(a&&l)o||i||v!==0&&v!=1||x!==0&&x!=1||e.PolyTyp!=t.PolyTyp&&this.m_ClipType!=g.ClipType.ctXor?this.AddLocalMaxPoly(e,t,r):(this.AddOutPt(e,r),this.AddOutPt(t,r),g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t));else if(a)(x===0||x==1)&&(this.AddOutPt(e,r),g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t));else if(l)(v===0||v==1)&&(this.AddOutPt(t,r),g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t));else if((v===0||v==1)&&(x===0||x==1)&&!o&&!i){var S,I;switch(m){case g.PolyFillType.pftPositive:S=e.WindCnt2;break;case g.PolyFillType.pftNegative:S=-e.WindCnt2;break;default:S=Math.abs(e.WindCnt2);break}switch(y){case g.PolyFillType.pftPositive:I=t.WindCnt2;break;case g.PolyFillType.pftNegative:I=-t.WindCnt2;break;default:I=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(v==1&&x==1)switch(this.m_ClipType){case g.ClipType.ctIntersection:S>0&&I>0&&this.AddLocalMinPoly(e,t,r);break;case g.ClipType.ctUnion:S<=0&&I<=0&&this.AddLocalMinPoly(e,t,r);break;case g.ClipType.ctDifference:(e.PolyTyp==g.PolyType.ptClip&&S>0&&I>0||e.PolyTyp==g.PolyType.ptSubject&&S<=0&&I<=0)&&this.AddLocalMinPoly(e,t,r);break;case g.ClipType.ctXor:this.AddLocalMinPoly(e,t,r);break}else g.Clipper.SwapSides(e,t)}o!=i&&(o&&e.OutIdx>=0||i&&t.OutIdx>=0)&&(g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t)),o&&this.DeleteFromAEL(e),i&&this.DeleteFromAEL(t)};g.Clipper.prototype.DeleteFromAEL=function(e){var t=e.PrevInAEL,r=e.NextInAEL;t===null&&r===null&&e!=this.m_ActiveEdges||(t!==null?t.NextInAEL=r:this.m_ActiveEdges=r,r!==null&&(r.PrevInAEL=t),e.NextInAEL=null,e.PrevInAEL=null)};g.Clipper.prototype.DeleteFromSEL=function(e){var t=e.PrevInSEL,r=e.NextInSEL;t===null&&r===null&&e!=this.m_SortedEdges||(t!==null?t.NextInSEL=r:this.m_SortedEdges=r,r!==null&&(r.PrevInSEL=t),e.NextInSEL=null,e.PrevInSEL=null)};g.Clipper.prototype.UpdateEdgeIntoAEL=function(e){e.NextInLML===null&&g.Error("UpdateEdgeIntoAEL: invalid call");var t=e.PrevInAEL,r=e.NextInAEL;return e.NextInLML.OutIdx=e.OutIdx,t!==null?t.NextInAEL=e.NextInLML:this.m_ActiveEdges=e.NextInLML,r!==null&&(r.PrevInAEL=e.NextInLML),e.NextInLML.Side=e.Side,e.NextInLML.WindDelta=e.WindDelta,e.NextInLML.WindCnt=e.WindCnt,e.NextInLML.WindCnt2=e.WindCnt2,e=e.NextInLML,e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.PrevInAEL=t,e.NextInAEL=r,g.ClipperBase.IsHorizontal(e)||this.InsertScanbeam(e.Top.Y),e};g.Clipper.prototype.ProcessHorizontals=function(e){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,e),t=this.m_SortedEdges};g.Clipper.prototype.GetHorzDirection=function(e,t){e.Bot.X<e.Top.X?(t.Left=e.Bot.X,t.Right=e.Top.X,t.Dir=g.Direction.dLeftToRight):(t.Left=e.Top.X,t.Right=e.Bot.X,t.Dir=g.Direction.dRightToLeft)};g.Clipper.prototype.PrepareHorzJoins=function(e,t){var r=this.m_PolyOuts[e.OutIdx].Pts;e.Side!=g.EdgeSide.esLeft&&(r=r.Prev),t&&(g.IntPoint.op_Equality(r.Pt,e.Top)?this.AddGhostJoin(r,e.Bot):this.AddGhostJoin(r,e.Top))};g.Clipper.prototype.ProcessHorizontal=function(e,t){var r={Dir:null,Left:null,Right:null};this.GetHorzDirection(e,r);for(var n=r.Dir,o=r.Left,i=r.Right,a=e,l=null;a.NextInLML!==null&&g.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(l=this.GetMaximaPair(a));;){for(var c=e==a,p=this.GetNextInAEL(e,n);p!==null&&!(p.Curr.X==e.Top.X&&e.NextInLML!==null&&p.Dx<e.NextInLML.Dx);){var f=this.GetNextInAEL(p,n);if(n==g.Direction.dLeftToRight&&p.Curr.X<=i||n==g.Direction.dRightToLeft&&p.Curr.X>=o){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),p==l&&c){n==g.Direction.dLeftToRight?this.IntersectEdges(e,p,p.Top,!1):this.IntersectEdges(p,e,p.Top,!1),l.OutIdx>=0&&g.Error("ProcessHorizontal error");return}else if(n==g.Direction.dLeftToRight){var m=new g.IntPoint(p.Curr.X,e.Curr.Y);this.IntersectEdges(e,p,m,!0)}else{var m=new g.IntPoint(p.Curr.X,e.Curr.Y);this.IntersectEdges(p,e,m,!0)}this.SwapPositionsInAEL(e,p)}else if(n==g.Direction.dLeftToRight&&p.Curr.X>=i||n==g.Direction.dRightToLeft&&p.Curr.X<=o)break;p=f}if(e.OutIdx>=0&&e.WindDelta!==0&&this.PrepareHorzJoins(e,t),e.NextInLML!==null&&g.ClipperBase.IsHorizontal(e.NextInLML)){e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot);var r={Dir:n,Left:o,Right:i};this.GetHorzDirection(e,r),n=r.Dir,o=r.Left,i=r.Right}else break}if(e.NextInLML!==null)if(e.OutIdx>=0){var y=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var v=e.PrevInAEL,f=e.NextInAEL;if(v!==null&&v.Curr.X==e.Bot.X&&v.Curr.Y==e.Bot.Y&&v.WindDelta!==0&&v.OutIdx>=0&&v.Curr.Y>v.Top.Y&&g.ClipperBase.SlopesEqual(e,v,this.m_UseFullRange)){var x=this.AddOutPt(v,e.Bot);this.AddJoin(y,x,e.Top)}else if(f!==null&&f.Curr.X==e.Bot.X&&f.Curr.Y==e.Bot.Y&&f.WindDelta!==0&&f.OutIdx>=0&&f.Curr.Y>f.Top.Y&&g.ClipperBase.SlopesEqual(e,f,this.m_UseFullRange)){var x=this.AddOutPt(f,e.Bot);this.AddJoin(y,x,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else l!==null?l.OutIdx>=0?(n==g.Direction.dLeftToRight?this.IntersectEdges(e,l,e.Top,!1):this.IntersectEdges(l,e,e.Top,!1),l.OutIdx>=0&&g.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(l)):(e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e))};g.Clipper.prototype.GetNextInAEL=function(e,t){return t==g.Direction.dLeftToRight?e.NextInAEL:e.PrevInAEL};g.Clipper.prototype.IsMinima=function(e){return e!==null&&e.Prev.NextInLML!=e&&e.Next.NextInLML!=e};g.Clipper.prototype.IsMaxima=function(e,t){return e!==null&&e.Top.Y==t&&e.NextInLML===null};g.Clipper.prototype.IsIntermediate=function(e,t){return e.Top.Y==t&&e.NextInLML!==null};g.Clipper.prototype.GetMaximaPair=function(e){var t=null;return g.IntPoint.op_Equality(e.Next.Top,e.Top)&&e.Next.NextInLML===null?t=e.Next:g.IntPoint.op_Equality(e.Prev.Top,e.Top)&&e.Prev.NextInLML===null&&(t=e.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!g.ClipperBase.IsHorizontal(t))?null:t};g.Clipper.prototype.ProcessIntersections=function(e,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(e,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch{this.m_SortedEdges=null,this.m_IntersectList.length=0,g.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};g.Clipper.prototype.BuildIntersectList=function(e,t){if(this.m_ActiveEdges!==null){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r.Curr.X=g.Clipper.TopX(r,t),r=r.NextInAEL;for(var n=!0;n&&this.m_SortedEdges!==null;){for(n=!1,r=this.m_SortedEdges;r.NextInSEL!==null;){var o=r.NextInSEL,i=new g.IntPoint;if(r.Curr.X>o.Curr.X){!this.IntersectPoint(r,o,i)&&r.Curr.X>o.Curr.X+1&&g.Error("Intersection error"),i.Y>e&&(i.Y=e,Math.abs(r.Dx)>Math.abs(o.Dx)?i.X=g.Clipper.TopX(o,e):i.X=g.Clipper.TopX(r,e));var a=new g.IntersectNode;a.Edge1=r,a.Edge2=o,a.Pt.X=i.X,a.Pt.Y=i.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(r,o),n=!0}else r=o}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};g.Clipper.prototype.EdgesAdjacent=function(e){return e.Edge1.NextInSEL==e.Edge2||e.Edge1.PrevInSEL==e.Edge2};g.Clipper.IntersectNodeSort=function(e,t){return t.Pt.Y-e.Pt.Y};g.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var e=this.m_IntersectList.length,t=0;t<e;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var r=t+1;r<e&&!this.EdgesAdjacent(this.m_IntersectList[r]);)r++;if(r==e)return!1;var n=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[r],this.m_IntersectList[r]=n}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};g.Clipper.prototype.ProcessIntersectList=function(){for(var e=0,t=this.m_IntersectList.length;e<t;e++){var r=this.m_IntersectList[e];this.IntersectEdges(r.Edge1,r.Edge2,r.Pt,!0),this.SwapPositionsInAEL(r.Edge1,r.Edge2)}this.m_IntersectList.length=0};var Ywe=s(function(e){return e<0?Math.ceil(e-.5):Math.round(e)},"R1"),Kwe=s(function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},"R2"),Jwe=s(function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},"R3"),Qwe=s(function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)},"R4");it.msie?g.Clipper.Round=Ywe:it.chromium?g.Clipper.Round=Jwe:it.safari?g.Clipper.Round=Qwe:g.Clipper.Round=Kwe;g.Clipper.TopX=function(e,t){return t==e.Top.Y?e.Top.X:e.Bot.X+g.Clipper.Round(e.Dx*(t-e.Bot.Y))};g.Clipper.prototype.IntersectPoint=function(e,t,r){r.X=0,r.Y=0;var n,o;if(g.ClipperBase.SlopesEqual(e,t,this.m_UseFullRange)||e.Dx==t.Dx)return t.Bot.Y>e.Bot.Y?(r.X=t.Bot.X,r.Y=t.Bot.Y):(r.X=e.Bot.X,r.Y=e.Bot.Y),!1;if(e.Delta.X===0)r.X=e.Bot.X,g.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(o=t.Bot.Y-t.Bot.X/t.Dx,r.Y=g.Clipper.Round(r.X/t.Dx+o));else if(t.Delta.X===0)r.X=t.Bot.X,g.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=g.Clipper.Round(r.X/e.Dx+n));else{n=e.Bot.X-e.Bot.Y*e.Dx,o=t.Bot.X-t.Bot.Y*t.Dx;var i=(o-n)/(e.Dx-t.Dx);r.Y=g.Clipper.Round(i),Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=g.Clipper.Round(e.Dx*i+n):r.X=g.Clipper.Round(t.Dx*i+o)}if(r.Y<e.Top.Y||r.Y<t.Top.Y){if(e.Top.Y>t.Top.Y)return r.Y=e.Top.Y,r.X=g.Clipper.TopX(t,e.Top.Y),r.X<e.Top.X;r.Y=t.Top.Y,Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=g.Clipper.TopX(e,r.Y):r.X=g.Clipper.TopX(t,r.Y)}return!0};g.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(e){for(var t=this.m_ActiveEdges;t!==null;){var r=this.IsMaxima(t,e);if(r){var n=this.GetMaximaPair(t);r=n===null||!g.ClipperBase.IsHorizontal(n)}if(r){var o=t.PrevInAEL;this.DoMaxima(t),o===null?t=this.m_ActiveEdges:t=o.NextInAEL}else{if(this.IsIntermediate(t,e)&&g.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=g.Clipper.TopX(t,e),t.Curr.Y=e),this.StrictlySimple){var o=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&o!==null&&o.OutIdx>=0&&o.Curr.X==t.Curr.X&&o.WindDelta!==0){var i=this.AddOutPt(o,t.Curr),a=this.AddOutPt(t,t.Curr);this.AddJoin(i,a,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,e)){var i=null;t.OutIdx>=0&&(i=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var o=t.PrevInAEL,l=t.NextInAEL;if(o!==null&&o.Curr.X==t.Bot.X&&o.Curr.Y==t.Bot.Y&&i!==null&&o.OutIdx>=0&&o.Curr.Y>o.Top.Y&&g.ClipperBase.SlopesEqual(t,o,this.m_UseFullRange)&&t.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,t.Bot);this.AddJoin(i,a,t.Top)}else if(l!==null&&l.Curr.X==t.Bot.X&&l.Curr.Y==t.Bot.Y&&i!==null&&l.OutIdx>=0&&l.Curr.Y>l.Top.Y&&g.ClipperBase.SlopesEqual(t,l,this.m_UseFullRange)&&t.WindDelta!==0&&l.WindDelta!==0){var a=this.AddOutPt(l,t.Bot);this.AddJoin(i,a,t.Top)}}t=t.NextInAEL}};g.Clipper.prototype.DoMaxima=function(e){var t=this.GetMaximaPair(e);if(t===null){e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e);return}for(var r=e.NextInAEL,n=!0;r!==null&&r!=t;)this.IntersectEdges(e,r,e.Top,!0),this.SwapPositionsInAEL(e,r),r=e.NextInAEL;e.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(e),this.DeleteFromAEL(t)):e.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(e,t,e.Top,!1):n&&e.WindDelta===0?(e.OutIdx>=0&&(this.AddOutPt(e,e.Top),e.OutIdx=-1),this.DeleteFromAEL(e),t.OutIdx>=0&&(this.AddOutPt(t,e.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):g.Error("DoMaxima error")};g.Clipper.ReversePaths=function(e){for(var t=0,r=e.length;t<r;t++)e[t].reverse()};g.Clipper.Orientation=function(e){return g.Clipper.Area(e)>=0};g.Clipper.prototype.PointCount=function(e){if(e===null)return 0;var t=0,r=e;do t++,r=r.Next;while(r!=e);return t};g.Clipper.prototype.BuildResult=function(e){g.Clear(e);for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];if(n.Pts!==null){var o=n.Pts.Prev,i=this.PointCount(o);if(!(i<2)){for(var a=new Array(i),l=0;l<i;l++)a[l]=o.Pt,o=o.Prev;e.push(a)}}}};g.Clipper.prototype.BuildResult2=function(e){e.Clear();for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t],o=this.PointCount(n.Pts);if(!(n.IsOpen&&o<2||!n.IsOpen&&o<3)){this.FixHoleLinkage(n);var i=new g.PolyNode;e.m_AllPolys.push(i),n.PolyNode=i,i.m_polygon.length=o;for(var a=n.Pts.Prev,l=0;l<o;l++)i.m_polygon[l]=a.Pt,a=a.Prev}}for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];n.PolyNode!==null&&(n.IsOpen?(n.PolyNode.IsOpen=!0,e.AddChild(n.PolyNode)):n.FirstLeft!==null&&n.FirstLeft.PolyNode!=null?n.FirstLeft.PolyNode.AddChild(n.PolyNode):e.AddChild(n.PolyNode))}};g.Clipper.prototype.FixupOutPolygon=function(e){var t=null;e.BottomPt=null;for(var r=e.Pts;;){if(r.Prev==r||r.Prev==r.Next){this.DisposeOutPts(r),e.Pts=null;return}if(g.IntPoint.op_Equality(r.Pt,r.Next.Pt)||g.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||g.ClipperBase.SlopesEqual(r.Prev.Pt,r.Pt,r.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(r.Prev.Pt,r.Pt,r.Next.Pt))){t=null;var n=r;r.Prev.Next=r.Next,r.Next.Prev=r.Prev,r=r.Prev,n=null}else{if(r==t)break;t===null&&(t=r),r=r.Next}}e.Pts=r};g.Clipper.prototype.DupOutPt=function(e,t){var r=new g.OutPt;return r.Pt.X=e.Pt.X,r.Pt.Y=e.Pt.Y,r.Idx=e.Idx,t?(r.Next=e.Next,r.Prev=e,e.Next.Prev=r,e.Next=r):(r.Prev=e.Prev,r.Next=e,e.Prev.Next=r,e.Prev=r),r};g.Clipper.prototype.GetOverlap=function(e,t,r,n,o){return e<t?r<n?(o.Left=Math.max(e,r),o.Right=Math.min(t,n)):(o.Left=Math.max(e,n),o.Right=Math.min(t,r)):r<n?(o.Left=Math.max(t,r),o.Right=Math.min(e,n)):(o.Left=Math.max(t,n),o.Right=Math.min(e,r)),o.Left<o.Right};g.Clipper.prototype.JoinHorz=function(e,t,r,n,o,i){var a=e.Pt.X>t.Pt.X?g.Direction.dRightToLeft:g.Direction.dLeftToRight,l=r.Pt.X>n.Pt.X?g.Direction.dRightToLeft:g.Direction.dLeftToRight;if(a==l)return!1;if(a==g.Direction.dLeftToRight){for(;e.Next.Pt.X<=o.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;i&&e.Pt.X!=o.X&&(e=e.Next),t=this.DupOutPt(e,!i),g.IntPoint.op_Inequality(t.Pt,o)&&(e=t,e.Pt.X=o.X,e.Pt.Y=o.Y,t=this.DupOutPt(e,!i))}else{for(;e.Next.Pt.X>=o.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;!i&&e.Pt.X!=o.X&&(e=e.Next),t=this.DupOutPt(e,i),g.IntPoint.op_Inequality(t.Pt,o)&&(e=t,e.Pt.X=o.X,e.Pt.Y=o.Y,t=this.DupOutPt(e,i))}if(l==g.Direction.dLeftToRight){for(;r.Next.Pt.X<=o.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;i&&r.Pt.X!=o.X&&(r=r.Next),n=this.DupOutPt(r,!i),g.IntPoint.op_Inequality(n.Pt,o)&&(r=n,r.Pt.X=o.X,r.Pt.Y=o.Y,n=this.DupOutPt(r,!i))}else{for(;r.Next.Pt.X>=o.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;!i&&r.Pt.X!=o.X&&(r=r.Next),n=this.DupOutPt(r,i),g.IntPoint.op_Inequality(n.Pt,o)&&(r=n,r.Pt.X=o.X,r.Pt.Y=o.Y,n=this.DupOutPt(r,i))}return a==g.Direction.dLeftToRight==i?(e.Prev=r,r.Next=e,t.Next=n,n.Prev=t):(e.Next=r,r.Prev=e,t.Prev=n,n.Next=t),!0};g.Clipper.prototype.JoinPoints=function(e,t,r){var n=e.OutPt1,o=new g.OutPt,i=e.OutPt2,a=new g.OutPt,l=e.OutPt1.Pt.Y==e.OffPt.Y;if(l&&g.IntPoint.op_Equality(e.OffPt,e.OutPt1.Pt)&&g.IntPoint.op_Equality(e.OffPt,e.OutPt2.Pt)){for(o=e.OutPt1.Next;o!=n&&g.IntPoint.op_Equality(o.Pt,e.OffPt);)o=o.Next;var c=o.Pt.Y>e.OffPt.Y;for(a=e.OutPt2.Next;a!=i&&g.IntPoint.op_Equality(a.Pt,e.OffPt);)a=a.Next;var p=a.Pt.Y>e.OffPt.Y;return c==p?!1:c?(o=this.DupOutPt(n,!1),a=this.DupOutPt(i,!0),n.Prev=i,i.Next=n,o.Next=a,a.Prev=o,e.OutPt1=n,e.OutPt2=o,!0):(o=this.DupOutPt(n,!0),a=this.DupOutPt(i,!1),n.Next=i,i.Prev=n,o.Prev=a,a.Next=o,e.OutPt1=n,e.OutPt2=o,!0)}else if(l){for(o=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=o&&n.Prev!=i;)n=n.Prev;for(;o.Next.Pt.Y==o.Pt.Y&&o.Next!=n&&o.Next!=i;)o=o.Next;if(o.Next==n||o.Next==i)return!1;for(a=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=a&&i.Prev!=o;)i=i.Prev;for(;a.Next.Pt.Y==a.Pt.Y&&a.Next!=i&&a.Next!=n;)a=a.Next;if(a.Next==i||a.Next==n)return!1;var f={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,o.Pt.X,i.Pt.X,a.Pt.X,f))return!1;var m=f.Left,y=f.Right,v=new g.IntPoint,x;return n.Pt.X>=m&&n.Pt.X<=y?(v.X=n.Pt.X,v.Y=n.Pt.Y,x=n.Pt.X>o.Pt.X):i.Pt.X>=m&&i.Pt.X<=y?(v.X=i.Pt.X,v.Y=i.Pt.Y,x=i.Pt.X>a.Pt.X):o.Pt.X>=m&&o.Pt.X<=y?(v.X=o.Pt.X,v.Y=o.Pt.Y,x=o.Pt.X>n.Pt.X):(v.X=a.Pt.X,v.Y=a.Pt.Y,x=a.Pt.X>i.Pt.X),e.OutPt1=n,e.OutPt2=i,this.JoinHorz(n,o,i,a,v,x)}else{for(o=n.Next;g.IntPoint.op_Equality(o.Pt,n.Pt)&&o!=n;)o=o.Next;var S=o.Pt.Y>n.Pt.Y||!g.ClipperBase.SlopesEqual(n.Pt,o.Pt,e.OffPt,this.m_UseFullRange);if(S){for(o=n.Prev;g.IntPoint.op_Equality(o.Pt,n.Pt)&&o!=n;)o=o.Prev;if(o.Pt.Y>n.Pt.Y||!g.ClipperBase.SlopesEqual(n.Pt,o.Pt,e.OffPt,this.m_UseFullRange))return!1}for(a=i.Next;g.IntPoint.op_Equality(a.Pt,i.Pt)&&a!=i;)a=a.Next;var I=a.Pt.Y>i.Pt.Y||!g.ClipperBase.SlopesEqual(i.Pt,a.Pt,e.OffPt,this.m_UseFullRange);if(I){for(a=i.Prev;g.IntPoint.op_Equality(a.Pt,i.Pt)&&a!=i;)a=a.Prev;if(a.Pt.Y>i.Pt.Y||!g.ClipperBase.SlopesEqual(i.Pt,a.Pt,e.OffPt,this.m_UseFullRange))return!1}return o==n||a==i||o==a||t==r&&S==I?!1:S?(o=this.DupOutPt(n,!1),a=this.DupOutPt(i,!0),n.Prev=i,i.Next=n,o.Next=a,a.Prev=o,e.OutPt1=n,e.OutPt2=o,!0):(o=this.DupOutPt(n,!0),a=this.DupOutPt(i,!1),n.Next=i,i.Prev=n,o.Prev=a,a.Next=o,e.OutPt1=n,e.OutPt2=o,!0)}};g.Clipper.GetBounds=function(e){for(var t=0,r=e.length;t<r&&e[t].length==0;)t++;if(t==r)return new g.IntRect(0,0,0,0);var n=new g.IntRect;for(n.left=e[t][0].X,n.right=n.left,n.top=e[t][0].Y,n.bottom=n.top;t<r;t++)for(var o=0,i=e[t].length;o<i;o++)e[t][o].X<n.left?n.left=e[t][o].X:e[t][o].X>n.right&&(n.right=e[t][o].X),e[t][o].Y<n.top?n.top=e[t][o].Y:e[t][o].Y>n.bottom&&(n.bottom=e[t][o].Y);return n};g.Clipper.prototype.GetBounds2=function(e){var t=e,r=new g.IntRect;for(r.left=e.Pt.X,r.right=e.Pt.X,r.top=e.Pt.Y,r.bottom=e.Pt.Y,e=e.Next;e!=t;)e.Pt.X<r.left&&(r.left=e.Pt.X),e.Pt.X>r.right&&(r.right=e.Pt.X),e.Pt.Y<r.top&&(r.top=e.Pt.Y),e.Pt.Y>r.bottom&&(r.bottom=e.Pt.Y),e=e.Next;return r};g.Clipper.PointInPolygon=function(e,t){var r=0,n=t.length;if(n<3)return 0;for(var o=t[0],i=1;i<=n;++i){var a=i==n?t[0]:t[i];if(a.Y==e.Y&&(a.X==e.X||o.Y==e.Y&&a.X>e.X==o.X<e.X))return-1;if(o.Y<e.Y!=a.Y<e.Y){if(o.X>=e.X)if(a.X>e.X)r=1-r;else{var l=(o.X-e.X)*(a.Y-e.Y)-(a.X-e.X)*(o.Y-e.Y);if(l==0)return-1;l>0==a.Y>o.Y&&(r=1-r)}else if(a.X>e.X){var l=(o.X-e.X)*(a.Y-e.Y)-(a.X-e.X)*(o.Y-e.Y);if(l==0)return-1;l>0==a.Y>o.Y&&(r=1-r)}}o=a}return r};g.Clipper.prototype.PointInPolygon=function(e,t){for(var r=0,n=t;;){var o=t.Pt.X,i=t.Pt.Y,a=t.Next.Pt.X,l=t.Next.Pt.Y;if(l==e.Y&&(a==e.X||i==e.Y&&a>e.X==o<e.X))return-1;if(i<e.Y!=l<e.Y){if(o>=e.X)if(a>e.X)r=1-r;else{var c=(o-e.X)*(l-e.Y)-(a-e.X)*(i-e.Y);if(c==0)return-1;c>0==l>i&&(r=1-r)}else if(a>e.X){var c=(o-e.X)*(l-e.Y)-(a-e.X)*(i-e.Y);if(c==0)return-1;c>0==l>i&&(r=1-r)}}if(t=t.Next,n==t)break}return r};g.Clipper.prototype.Poly2ContainsPoly1=function(e,t){var r=e;do{var n=this.PointInPolygon(r.Pt,t);if(n>=0)return n!=0;r=r.Next}while(r!=e);return!0};g.Clipper.prototype.FixupFirstLefts1=function(e,t){for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var o=this.m_PolyOuts[r];o.Pts!==null&&o.FirstLeft==e&&this.Poly2ContainsPoly1(o.Pts,t.Pts)&&(o.FirstLeft=t)}};g.Clipper.prototype.FixupFirstLefts2=function(e,t){for(var r=0,n=this.m_PolyOuts,o=n.length,i=n[r];r<o;r++,i=n[r])i.FirstLeft==e&&(i.FirstLeft=t)};g.Clipper.ParseFirstLeft=function(e){for(;e!=null&&e.Pts==null;)e=e.FirstLeft;return e};g.Clipper.prototype.JoinCommonEdges=function(){for(var e=0,t=this.m_Joins.length;e<t;e++){var r=this.m_Joins[e],n=this.GetOutRec(r.OutPt1.Idx),o=this.GetOutRec(r.OutPt2.Idx);if(!(n.Pts==null||o.Pts==null)){var i;if(n==o?i=n:this.Param1RightOfParam2(n,o)?i=o:this.Param1RightOfParam2(o,n)?i=n:i=this.GetLowermostRec(n,o),!!this.JoinPoints(r,n,o))if(n==o){if(n.Pts=r.OutPt1,n.BottomPt=null,o=this.CreateOutRec(),o.Pts=r.OutPt2,this.UpdateOutPtIdxs(o),this.m_UsingPolyTree)for(var a=0,l=this.m_PolyOuts.length;a<l-1;a++){var c=this.m_PolyOuts[a];c.Pts==null||g.Clipper.ParseFirstLeft(c.FirstLeft)!=n||c.IsHole==n.IsHole||this.Poly2ContainsPoly1(c.Pts,r.OutPt2)&&(c.FirstLeft=o)}this.Poly2ContainsPoly1(o.Pts,n.Pts)?(o.IsHole=!n.IsHole,o.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,n),(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)):this.Poly2ContainsPoly1(n.Pts,o.Pts)?(o.IsHole=n.IsHole,n.IsHole=!o.IsHole,o.FirstLeft=n.FirstLeft,n.FirstLeft=o,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,o),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):(o.IsHole=n.IsHole,o.FirstLeft=n.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(n,o))}else o.Pts=null,o.BottomPt=null,o.Idx=n.Idx,n.IsHole=i.IsHole,i==o&&(n.FirstLeft=o.FirstLeft),o.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,n)}}};g.Clipper.prototype.UpdateOutPtIdxs=function(e){var t=e.Pts;do t.Idx=e.Idx,t=t.Prev;while(t!=e.Pts)};g.Clipper.prototype.DoSimplePolygons=function(){for(var e=0;e<this.m_PolyOuts.length;){var t=this.m_PolyOuts[e++],r=t.Pts;if(r!==null)do{for(var n=r.Next;n!=t.Pts;){if(g.IntPoint.op_Equality(r.Pt,n.Pt)&&n.Next!=r&&n.Prev!=r){var o=r.Prev,i=n.Prev;r.Prev=i,i.Next=r,n.Prev=o,o.Next=n,t.Pts=r;var a=this.CreateOutRec();a.Pts=n,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,t.Pts)?(a.IsHole=!t.IsHole,a.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,a.Pts)?(a.IsHole=t.IsHole,t.IsHole=!a.IsHole,a.FirstLeft=t.FirstLeft,t.FirstLeft=a):(a.IsHole=t.IsHole,a.FirstLeft=t.FirstLeft),n=r}n=n.Next}r=r.Next}while(r!=t.Pts)}};g.Clipper.Area=function(e){var t=e.length;if(t<3)return 0;for(var r=0,n=0,o=t-1;n<t;++n)r+=(e[o].X+e[n].X)*(e[o].Y-e[n].Y),o=n;return-r*.5};g.Clipper.prototype.Area=function(e){var t=e.Pts;if(t==null)return 0;var r=0;do r=r+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=e.Pts);return r*.5};MJ&&(g.Clipper.OffsetPaths=function(e,t,r,n,o){var i=new g.Paths,a=new g.ClipperOffset(o,o);return a.AddPaths(e,r,n),a.Execute(i,t),i});g.Clipper.SimplifyPolygon=function(e,t){var r=new Array,n=new g.Clipper(0);return n.StrictlySimple=!0,n.AddPath(e,g.PolyType.ptSubject,!0),n.Execute(g.ClipType.ctUnion,r,t,t),r};g.Clipper.SimplifyPolygons=function(e,t){typeof t>"u"&&(t=g.PolyFillType.pftEvenOdd);var r=new Array,n=new g.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(e,g.PolyType.ptSubject,!0),n.Execute(g.ClipType.ctUnion,r,t,t),r};g.Clipper.DistanceSqrd=function(e,t){var r=e.X-t.X,n=e.Y-t.Y;return r*r+n*n};g.Clipper.DistanceFromLineSqrd=function(e,t,r){var n=t.Y-r.Y,o=r.X-t.X,i=n*t.X+o*t.Y;return i=n*e.X+o*e.Y-i,i*i/(n*n+o*o)};g.Clipper.SlopesNearCollinear=function(e,t,r,n){return g.Clipper.DistanceFromLineSqrd(t,e,r)<n};g.Clipper.PointsAreClose=function(e,t,r){var n=e.X-t.X,o=e.Y-t.Y;return n*n+o*o<=r};g.Clipper.ExcludeOp=function(e){var t=e.Prev;return t.Next=e.Next,e.Next.Prev=t,t.Idx=0,t};g.Clipper.CleanPolygon=function(e,t){typeof t>"u"&&(t=1.415);var r=e.length;if(r==0)return new Array;for(var n=new Array(r),o=0;o<r;++o)n[o]=new g.OutPt;for(var o=0;o<r;++o)n[o].Pt=e[o],n[o].Next=n[(o+1)%r],n[o].Next.Prev=n[o],n[o].Idx=0;for(var i=t*t,a=n[0];a.Idx==0&&a.Next!=a.Prev;)g.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,i)?(a=g.Clipper.ExcludeOp(a),r--):g.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,i)?(g.Clipper.ExcludeOp(a.Next),a=g.Clipper.ExcludeOp(a),r-=2):g.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,i)?(a=g.Clipper.ExcludeOp(a),r--):(a.Idx=1,a=a.Next);r<3&&(r=0);for(var l=new Array(r),o=0;o<r;++o)l[o]=new g.IntPoint(a.Pt),a=a.Next;return n=null,l};g.Clipper.CleanPolygons=function(e,t){for(var r=new Array(e.length),n=0,o=e.length;n<o;n++)r[n]=g.Clipper.CleanPolygon(e[n],t);return r};g.Clipper.Minkowski=function(e,t,r,n){var o=n?1:0,i=e.length,a=t.length,l=new Array;if(r)for(var c=0;c<a;c++){for(var p=new Array(i),f=0,m=e.length,y=e[f];f<m;f++,y=e[f])p[f]=new g.IntPoint(t[c].X+y.X,t[c].Y+y.Y);l.push(p)}else for(var c=0;c<a;c++){for(var p=new Array(i),f=0,m=e.length,y=e[f];f<m;f++,y=e[f])p[f]=new g.IntPoint(t[c].X-y.X,t[c].Y-y.Y);l.push(p)}for(var v=new Array,c=0;c<a-1+o;c++)for(var f=0;f<i;f++){var x=new Array;x.push(l[c%a][f%i]),x.push(l[(c+1)%a][f%i]),x.push(l[(c+1)%a][(f+1)%i]),x.push(l[c%a][(f+1)%i]),g.Clipper.Orientation(x)||x.reverse(),v.push(x)}var S=new g.Clipper(0);return S.AddPaths(v,g.PolyType.ptSubject,!0),S.Execute(g.ClipType.ctUnion,l,g.PolyFillType.pftNonZero,g.PolyFillType.pftNonZero),l};g.Clipper.MinkowskiSum=function(){var e=arguments,t=e.length;if(t==3){var r=e[0],n=e[1],o=e[2];return g.Clipper.Minkowski(r,n,!0,o)}else if(t==4){for(var r=e[0],i=e[1],a=e[2],o=e[3],l=new g.Clipper,c,p=0,f=i.length;p<f;++p){var c=g.Clipper.Minkowski(r,i[p],!0,o);l.AddPaths(c,g.PolyType.ptSubject,!0)}o&&l.AddPaths(i,g.PolyType.ptClip,!0);var m=new g.Paths;return l.Execute(g.ClipType.ctUnion,m,a,a),m}};g.Clipper.MinkowskiDiff=function(e,t,r){return g.Clipper.Minkowski(e,t,!1,r)};g.Clipper.PolyTreeToPaths=function(e){var t=new Array;return g.Clipper.AddPolyNodeToPaths(e,g.Clipper.NodeType.ntAny,t),t};g.Clipper.AddPolyNodeToPaths=function(e,t,r){var n=!0;switch(t){case g.Clipper.NodeType.ntOpen:return;case g.Clipper.NodeType.ntClosed:n=!e.IsOpen;break;default:break}e.m_polygon.length>0&&n&&r.push(e.m_polygon);for(var o=0,i=e.Childs(),a=i.length,l=i[o];o<a;o++,l=i[o])g.Clipper.AddPolyNodeToPaths(l,t,r)};g.Clipper.OpenPathsFromPolyTree=function(e){for(var t=new g.Paths,r=0,n=e.ChildCount();r<n;r++)e.Childs()[r].IsOpen&&t.push(e.Childs()[r].m_polygon);return t};g.Clipper.ClosedPathsFromPolyTree=function(e){var t=new g.Paths;return g.Clipper.AddPolyNodeToPaths(e,g.Clipper.NodeType.ntClosed,t),t};QI(g.Clipper,g.ClipperBase);g.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};g.ClipperOffset=function(e,t){typeof e>"u"&&(e=2),typeof t>"u"&&(t=g.ClipperOffset.def_arc_tolerance),this.m_destPolys=new g.Paths,this.m_srcPoly=new g.Path,this.m_destPoly=new g.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new g.IntPoint,this.m_polyNodes=new g.PolyNode,this.MiterLimit=e,this.ArcTolerance=t,this.m_lowest.X=-1};g.ClipperOffset.two_pi=6.28318530717959;g.ClipperOffset.def_arc_tolerance=.25;g.ClipperOffset.prototype.Clear=function(){g.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};g.ClipperOffset.Round=g.Clipper.Round;g.ClipperOffset.prototype.AddPath=function(e,t,r){var n=e.length-1;if(!(n<0)){var o=new g.PolyNode;if(o.m_jointype=t,o.m_endtype=r,r==g.EndType.etClosedLine||r==g.EndType.etClosedPolygon)for(;n>0&&g.IntPoint.op_Equality(e[0],e[n]);)n--;o.m_polygon.push(e[0]);for(var i=0,a=0,l=1;l<=n;l++)g.IntPoint.op_Inequality(o.m_polygon[i],e[l])&&(i++,o.m_polygon.push(e[l]),(e[l].Y>o.m_polygon[a].Y||e[l].Y==o.m_polygon[a].Y&&e[l].X<o.m_polygon[a].X)&&(a=i));if(!(r==g.EndType.etClosedPolygon&&i<2||r!=g.EndType.etClosedPolygon&&i<0)&&(this.m_polyNodes.AddChild(o),r==g.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new g.IntPoint(0,a);else{var c=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(o.m_polygon[a].Y>c.Y||o.m_polygon[a].Y==c.Y&&o.m_polygon[a].X<c.X)&&(this.m_lowest=new g.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};g.ClipperOffset.prototype.AddPaths=function(e,t,r){for(var n=0,o=e.length;n<o;n++)this.AddPath(e[n],t,r)};g.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!g.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];(t.m_endtype==g.EndType.etClosedPolygon||t.m_endtype==g.EndType.etClosedLine&&g.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==g.EndType.etClosedLine&&!g.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};g.ClipperOffset.GetUnitNormal=function(e,t){var r=t.X-e.X,n=t.Y-e.Y;if(r==0&&n==0)return new g.DoublePoint(0,0);var o=1/Math.sqrt(r*r+n*n);return r*=o,n*=o,new g.DoublePoint(n,-r)};g.ClipperOffset.prototype.DoOffset=function(e){if(this.m_destPolys=new Array,this.m_delta=e,g.ClipperBase.near_zero(e)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];r.m_endtype==g.EndType.etClosedPolygon&&this.m_destPolys.push(r.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var n;this.ArcTolerance<=0?n=g.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(e)*g.ClipperOffset.def_arc_tolerance?n=Math.abs(e)*g.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var o=3.14159265358979/Math.acos(1-n/Math.abs(e));this.m_sin=Math.sin(g.ClipperOffset.two_pi/o),this.m_cos=Math.cos(g.ClipperOffset.two_pi/o),this.m_StepsPerRad=o/g.ClipperOffset.two_pi,e<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];this.m_srcPoly=r.m_polygon;var i=this.m_srcPoly.length;if(!(i==0||e<=0&&(i<3||r.m_endtype!=g.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,i==1){if(r.m_jointype==g.JoinType.jtRound)for(var a=1,l=0,c=1;c<=o;c++){this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[0].X+a*e),g.ClipperOffset.Round(this.m_srcPoly[0].Y+l*e)));var p=a;a=a*this.m_cos-this.m_sin*l,l=p*this.m_sin+l*this.m_cos}else for(var a=-1,l=-1,c=0;c<4;++c)this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[0].X+a*e),g.ClipperOffset.Round(this.m_srcPoly[0].Y+l*e))),a<0?a=1:l<0?l=1:a=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var c=0;c<i-1;c++)this.m_normals.push(g.ClipperOffset.GetUnitNormal(this.m_srcPoly[c],this.m_srcPoly[c+1]));if(r.m_endtype==g.EndType.etClosedLine||r.m_endtype==g.EndType.etClosedPolygon?this.m_normals.push(g.ClipperOffset.GetUnitNormal(this.m_srcPoly[i-1],this.m_srcPoly[0])):this.m_normals.push(new g.DoublePoint(this.m_normals[i-2])),r.m_endtype==g.EndType.etClosedPolygon){for(var f=i-1,c=0;c<i;c++)f=this.OffsetPoint(c,f,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==g.EndType.etClosedLine){for(var f=i-1,c=0;c<i;c++)f=this.OffsetPoint(c,f,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var m=this.m_normals[i-1],c=i-1;c>0;c--)this.m_normals[c]=new g.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new g.DoublePoint(-m.X,-m.Y),f=0;for(var c=i-1;c>=0;c--)f=this.OffsetPoint(c,f,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var f=0,c=1;c<i-1;++c)f=this.OffsetPoint(c,f,r.m_jointype);var y;if(r.m_endtype==g.EndType.etOpenButt){var c=i-1;y=new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[c].X+this.m_normals[c].X*e),g.ClipperOffset.Round(this.m_srcPoly[c].Y+this.m_normals[c].Y*e)),this.m_destPoly.push(y),y=new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[c].X-this.m_normals[c].X*e),g.ClipperOffset.Round(this.m_srcPoly[c].Y-this.m_normals[c].Y*e)),this.m_destPoly.push(y)}else{var c=i-1;f=i-2,this.m_sinA=0,this.m_normals[c]=new g.DoublePoint(-this.m_normals[c].X,-this.m_normals[c].Y),r.m_endtype==g.EndType.etOpenSquare?this.DoSquare(c,f):this.DoRound(c,f)}for(var c=i-1;c>0;c--)this.m_normals[c]=new g.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new g.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),f=i-1;for(var c=f-1;c>0;--c)f=this.OffsetPoint(c,f,r.m_jointype);r.m_endtype==g.EndType.etOpenButt?(y=new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*e),g.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*e)),this.m_destPoly.push(y),y=new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*e),g.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*e)),this.m_destPoly.push(y)):(f=1,this.m_sinA=0,r.m_endtype==g.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};g.ClipperOffset.prototype.Execute=function(){var e=arguments,t=e[0]instanceof g.PolyTree;if(t){var r=e[0],n=e[1];r.Clear(),this.FixOrientations(),this.DoOffset(n);var o=new g.Clipper(0);if(o.AddPaths(this.m_destPolys,g.PolyType.ptSubject,!0),n>0)o.Execute(g.ClipType.ctUnion,r,g.PolyFillType.pftPositive,g.PolyFillType.pftPositive);else{var i=g.Clipper.GetBounds(this.m_destPolys),a=new g.Path;if(a.push(new g.IntPoint(i.left-10,i.bottom+10)),a.push(new g.IntPoint(i.right+10,i.bottom+10)),a.push(new g.IntPoint(i.right+10,i.top-10)),a.push(new g.IntPoint(i.left-10,i.top-10)),o.AddPath(a,g.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(g.ClipType.ctUnion,r,g.PolyFillType.pftNegative,g.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var l=r.Childs()[0];r.Childs()[0]=l.Childs()[0];for(var c=1;c<l.ChildCount();c++)r.AddChild(l.Childs()[c])}else r.Clear()}}else{var r=e[0],n=e[1];g.Clear(r),this.FixOrientations(),this.DoOffset(n);var o=new g.Clipper(0);if(o.AddPaths(this.m_destPolys,g.PolyType.ptSubject,!0),n>0)o.Execute(g.ClipType.ctUnion,r,g.PolyFillType.pftPositive,g.PolyFillType.pftPositive);else{var i=g.Clipper.GetBounds(this.m_destPolys),a=new g.Path;a.push(new g.IntPoint(i.left-10,i.bottom+10)),a.push(new g.IntPoint(i.right+10,i.bottom+10)),a.push(new g.IntPoint(i.right+10,i.top-10)),a.push(new g.IntPoint(i.left-10,i.top-10)),o.AddPath(a,g.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(g.ClipType.ctUnion,r,g.PolyFillType.pftNegative,g.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};g.ClipperOffset.prototype.OffsetPoint=function(e,t,r){if(this.m_sinA=this.m_normals[t].X*this.m_normals[e].Y-this.m_normals[e].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[t].X*this.m_delta),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new g.IntPoint(this.m_srcPoly[e])),this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)));else switch(r){case g.JoinType.jtMiter:{var n=1+(this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y);n>=this.m_miterLim?this.DoMiter(e,t,n):this.DoSquare(e,t);break}case g.JoinType.jtSquare:this.DoSquare(e,t);break;case g.JoinType.jtRound:this.DoRound(e,t);break}return t=e,t};g.ClipperOffset.prototype.DoSquare=function(e,t){var r=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y)/4);this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*r)),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*r)))),this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[e].X+this.m_normals[e].Y*r)),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[e].Y-this.m_normals[e].X*r))))};g.ClipperOffset.prototype.DoMiter=function(e,t,r){var n=this.m_delta/r;this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+(this.m_normals[t].X+this.m_normals[e].X)*n),g.ClipperOffset.Round(this.m_srcPoly[e].Y+(this.m_normals[t].Y+this.m_normals[e].Y)*n)))};g.ClipperOffset.prototype.DoRound=function(e,t){for(var r=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y),n=g.Cast_Int32(g.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),o=this.m_normals[t].X,i=this.m_normals[t].Y,a,l=0;l<n;++l)this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+o*this.m_delta),g.ClipperOffset.Round(this.m_srcPoly[e].Y+i*this.m_delta))),a=o,o=o*this.m_cos-this.m_sin*i,i=a*this.m_sin+i*this.m_cos;this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)))};g.Error=function(e){try{throw new Error(e)}catch(t){alert(t.message)}};g.JS={};g.JS.AreaOfPolygon=function(e,t){return t||(t=1),g.Clipper.Area(e)/(t*t)};g.JS.AreaOfPolygons=function(e,t){t||(t=1);for(var r=0,n=0;n<e.length;n++)r+=g.Clipper.Area(e[n]);return r/(t*t)};g.JS.BoundsOfPath=function(e,t){return g.JS.BoundsOfPaths([e],t)};g.JS.BoundsOfPaths=function(e,t){t||(t=1);var r=g.Clipper.GetBounds(e);return r.left/=t,r.bottom/=t,r.right/=t,r.top/=t,r};g.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var r=n[0]instanceof Array,n=g.JS.Clone(n);if(typeof t!="number"||t===null)return g.Error("Delta is not a number in Clean()."),n;if(n.length===0||n.length==1&&n[0].length===0||t<0)return n;r||(n=[n]);for(var o=n.length,i,a,l,c,p,f,m,y=[],v=0;v<o;v++)if(a=n[v],i=a.length,i!==0){if(i<3){l=a,y.push(l);continue}for(l=a,c=t*t,p=a[0],f=1,m=1;m<i;m++)(a[m].X-p.X)*(a[m].X-p.X)+(a[m].Y-p.Y)*(a[m].Y-p.Y)<=c||(l[f]=a[m],p=a[m],f++);p=a[f-1],(a[0].X-p.X)*(a[0].X-p.X)+(a[0].Y-p.Y)*(a[0].Y-p.Y)<=c&&f--,f<i&&l.splice(f,i-f),l.length&&y.push(l)}return!r&&y.length?y=y[0]:!r&&y.length===0?y=[]:r&&y.length===0&&(y=[[]]),y};g.JS.Clone=function(e){if(!(e instanceof Array))return[];if(e.length===0)return[];if(e.length==1&&e[0].length===0)return[[]];var t=e[0]instanceof Array;t||(e=[e]);var r=e.length,n,o,i,a,l=new Array(r);for(o=0;o<r;o++){for(n=e[o].length,a=new Array(n),i=0;i<n;i++)a[i]={X:e[o][i].X,Y:e[o][i].Y};l[o]=a}return t||(l=l[0]),l};g.JS.Lighten=function(e,t){if(!(e instanceof Array))return[];if(typeof t!="number"||t===null)return g.Error("Tolerance is not a number in Lighten()."),g.JS.Clone(e);if(e.length===0||e.length==1&&e[0].length===0||t<0)return g.JS.Clone(e);e[0]instanceof Array||(e=[e]);var r,n,o,i,a,l,c,p,f,m,y,v,x,S,I,P,T,M=e.length,w=t*t,E=[];for(r=0;r<M;r++)if(o=e[r],l=o.length,l!=0){for(i=0;i<1e6;i++){for(a=[],l=o.length,o[l-1].X!=o[0].X||o[l-1].Y!=o[0].Y?(v=1,o.push({X:o[0].X,Y:o[0].Y}),l=o.length):v=0,y=[],n=0;n<l-2;n++)c=o[n],f=o[n+1],p=o[n+2],P=c.X,T=c.Y,x=p.X-P,S=p.Y-T,(x!==0||S!==0)&&(I=((f.X-P)*x+(f.Y-T)*S)/(x*x+S*S),I>1?(P=p.X,T=p.Y):I>0&&(P+=x*I,T+=S*I)),x=f.X-P,S=f.Y-T,m=x*x+S*S,m<=w&&(y[n+1]=1,n++);for(a.push({X:o[0].X,Y:o[0].Y}),n=1;n<l-1;n++)y[n]||a.push({X:o[n].X,Y:o[n].Y});if(a.push({X:o[l-1].X,Y:o[l-1].Y}),v&&o.pop(),y.length)o=a;else break}l=a.length,a[l-1].X==a[0].X&&a[l-1].Y==a[0].Y&&a.pop(),a.length>2&&E.push(a)}return!e[0]instanceof Array&&(E=E[0]),typeof E>"u"&&(E=[[]]),E};g.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,o=0,i,a,l=0,c=0,p=0,f=0,m=e.length;if(m<2)return 0;for(t&&(e[m]=e[0],m++);--m;)i=e[m],l=i.X,c=i.Y,a=e[m-1],p=a.X,f=a.Y,o+=n((l-p)*(l-p)+(c-f)*(c-f));return t&&e.pop(),o/r};g.JS.PerimeterOfPaths=function(e,t,r){r||(r=1);for(var n=0,o=0;o<e.length;o++)n+=g.JS.PerimeterOfPath(e[o],t,r);return n};g.JS.ScaleDownPath=function(e,t){var r,n;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=n.X/t,n.Y=n.Y/t};g.JS.ScaleDownPaths=function(e,t){var r,n,o,i=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)o=e[r][n],o.X=o.X/t,o.Y=o.Y/t};g.JS.ScaleUpPath=function(e,t){var r,n,o=Math.round;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=o(n.X*t),n.Y=o(n.Y*t)};g.JS.ScaleUpPaths=function(e,t){var r,n,o,i=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)o=e[r][n],o.X=i(o.X*t),o.Y=i(o.Y*t)};g.ExPolygons=function(){return[]};g.ExPolygon=function(){this.outer=null,this.holes=null};g.JS.AddOuterPolyNodeToExPolygons=function(e,t){var r=new g.ExPolygon;r.outer=e.Contour();var n=e.Childs(),o=n.length;r.holes=new Array(o);var i,a,l,c,p,f;for(l=0;l<o;l++)for(i=n[l],r.holes[l]=i.Contour(),c=0,p=i.Childs(),f=p.length;c<f;c++)a=p[c],g.JS.AddOuterPolyNodeToExPolygons(a,t);t.push(r)};g.JS.ExPolygonsToPaths=function(e){var t,r,n,o,i=new g.Paths;for(t=0,n=e.length;t<n;t++)for(i.push(e[t].outer),r=0,o=e[t].holes.length;r<o;r++)i.push(e[t].holes[r]);return i};g.JS.PolyTreeToExPolygons=function(e){var t=new g.ExPolygons,r,n,o,i;for(n=0,o=e.Childs(),i=o.length;n<i;n++)r=o[n],g.JS.AddOuterPolyNodeToExPolygons(r,t);return t};Db.exports=g});var tee=W((nMt,KS)=>{d();(function(){"use strict";function e(a,l){var c=a.x-l.x,p=a.y-l.y;return c*c+p*p}s(e,"getSqDist");function t(a,l,c){var p=l.x,f=l.y,m=c.x-p,y=c.y-f;if(m!==0||y!==0){var v=((a.x-p)*m+(a.y-f)*y)/(m*m+y*y);v>1?(p=c.x,f=c.y):v>0&&(p+=m*v,f+=y*v)}return m=a.x-p,y=a.y-f,m*m+y*y}s(t,"getSqSegDist");function r(a,l){for(var c=a[0],p=[c],f,m=1,y=a.length;m<y;m++)f=a[m],e(f,c)>l&&(p.push(f),c=f);return c!==f&&p.push(f),p}s(r,"simplifyRadialDist");function n(a,l,c,p,f){for(var m=p,y,v=l+1;v<c;v++){var x=t(a[v],a[l],a[c]);x>m&&(y=v,m=x)}m>p&&(y-l>1&&n(a,l,y,p,f),f.push(a[y]),c-y>1&&n(a,y,c,p,f))}s(n,"simplifyDPStep");function o(a,l){var c=a.length-1,p=[a[0]];return n(a,0,c,l,p),p.push(a[c]),p}s(o,"simplifyDouglasPeucker");function i(a,l,c){if(a.length<=2)return a;var p=l!==void 0?l*l:1;return a=c?a:r(a,p),a=o(a,p),a}s(i,"simplify"),typeof define=="function"&&define.amd?define(function(){return i}):typeof KS<"u"?(KS.exports=i,KS.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});d();d();var $d=class $d{constructor(t,r,n){h(this,"__type",$d.__type);h(this,"id",_t());h(this,"latitude");h(this,"longitude");h(this,"floorId");h(this,"verticalOffset");var o;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(o=t.verticalOffset)!=null?o:0;else{if(r==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=r,this.floorId=n,this.verticalOffset=0}}static is(t){return t.__type===$d.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};s($d,"Coordinate"),h($d,"__type","coordinate");var M3=$d,Le=M3;d();var O3=class O3{constructor(t){h(this,"id");this.id=t}};s(O3,"BaseMetaData");var Gr=O3;var ws,Un,Cu,Jl,jd=class jd extends Gr{constructor(r,n){super(n.mvfData.properties.id);h(this,"__type",jd.__type);O(this,ws);O(this,Un,{});O(this,Cu);O(this,Jl);A(this,ws,r),A(this,Cu,n.floorId),A(this,Jl,n.mvfData)}static is(r){return r.__type===jd.__type}get locations(){return u(this,Un).locations?u(this,Un).locations:(u(this,Un).locations=(u(this,ws).locationIdsByNodeId[this.id]||[]).map(r=>u(this,ws).getById("enterprise-location",r)).filter(Boolean),u(this,Un).locations)}get space(){var r;return u(this,ws).getById("space",(r=u(this,ws).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=u(this,ws).getById("floor",u(this,Cu));if(r==null)throw new Error("Floor ".concat(u(this,Cu)," not found!"));return r}get coordinate(){if(u(this,Un).coordinate==null){let[r,n]=u(this,Jl).geometry.coordinates;u(this,Un).coordinate=new Le(n,r,u(this,Cu))}return u(this,Un).coordinate}get externalId(){var r;return(r=u(this,Jl).properties.externalId)!=null?r:""}get neighbors(){if(u(this,Un).neighbours==null){let r=u(this,Jl).properties.neighbors.map(n=>{let o=u(this,ws).getById("node",n.id);if(o==null)throw new Error("Node ".concat(n.id," not found!"));return o});u(this,Un).neighbours=r}return u(this,Un).neighbours}get geoJSON(){return{...u(this,Jl),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(r=>r.id)}}destroy(){for(let r of Object.keys(u(this,Un)))delete u(this,Un)[r]}};ws=new WeakMap,Un=new WeakMap,Cu=new WeakMap,Jl=new WeakMap,s(jd,"Node"),h(jd,"__type","node");var E3=jd,Aa=E3;d();d();var Pu,_3=class _3{constructor(t,r){h(this,"id");O(this,Pu);this.id=t}get geoJSONBoundingBox(){return u(this,Pu)?u(this,Pu):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(A(this,Pu,Dd(this.geoJSON)),u(this,Pu))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};Pu=new WeakMap,s(_3,"BaseMapData");var Ai=_3;var Ql,Zo,ki,Ud,ty,k3,Gd=class Gd extends Ai{constructor(r,n){super(n.mvfData.id,r);O(this,ty);h(this,"__type",Gd.__type);O(this,Ql);O(this,Zo,{});O(this,ki);O(this,Ud);A(this,Ql,r),A(this,ki,n.mvfData),A(this,Ud,n.facadeId)}static is(r){return r.__type===Gd.__type}get type(){return u(this,ki).type}get name(){var r;return(r=te(this,ty,k3).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=te(this,ty,k3).call(this,"shortName"))!=null?r:""}get externalId(){var r;return(r=u(this,ki).externalId)!=null?r:""}get floors(){var r,n;if(u(this,Zo).floors==null){let o=((n=(r=u(this,ki).floors)!=null?r:u(this,ki).maps)!=null?n:[]).reduce((i,a)=>{let l=u(this,Ql).floorsById[a];return l&&i.push(l),i},[]);o.length===0&&j.error("Floor stack ".concat(this.id," has no floors")),u(this,Zo).floors=o}return u(this,Zo).floors}get defaultFloor(){if(u(this,Zo).defaultFloor!=null)return u(this,Zo).defaultFloor;let r=u(this,ki).defaultFloor?u(this,Ql).getById("floor",u(this,ki).defaultFloor):void 0;return u(this,Zo).defaultFloor=r||this.floors.reduce((n,o)=>Math.abs(o.elevation)<Math.abs(n.elevation)?o:n),u(this,Zo).defaultFloor}get facade(){return u(this,Ud)?u(this,Ql).facadesById[u(this,Ud)]:void 0}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(u(this,Zo)))delete u(this,Zo)[r]}};Ql=new WeakMap,Zo=new WeakMap,ki=new WeakMap,Ud=new WeakMap,ty=new WeakSet,k3=s(function(r){return u(this,Ql).getPropTranslation(this.__type,r,this.id,u(this,ki)[r])},"#translate"),s(Gd,"FloorStack"),h(Gd,"__type","floor-stack");var A3=Gd,ry=A3;d();d();d();d();d();d();var oy,ka,ny=class ny extends Gr{constructor(r){super(String(_t()));O(this,oy,{});O(this,ka);A(this,ka,r.mvfData)}static is(r){return r.__type===ny.__type}get url(){return u(this,ka).url}get name(){if("displayName"in u(this,ka))return u(this,ka).displayName;if("label"in u(this,ka))return u(this,ka).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(u(this,oy)))delete u(this,oy)[r]}};oy=new WeakMap,ka=new WeakMap,s(ny,"Hyperlink"),h(ny,"__type","hyperlink");var D3=ny,ec=D3;d();d();function iy(e){return typeof e=="string"?e:e.id}s(iy,"getId");function L3(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}s(L3,"isPosition");var F3=8,Ms=s(e=>typeof e=="number"?e.toFixed(F3):L3(e)?e[1].toFixed(F3)+"-"+e[0].toFixed(F3):e.map(t=>Ms(t)).join("-"),"serializeCoords"),Xee=s(e=>{let t=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,r=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return t.test(e)||r.test(e)},"isPrivateCdnAsset"),A0=s(e=>{if(!Xee(e))return null;let t="";e.startsWith("https://")?(t="https://",e=e.slice(8)):e.startsWith("http://")&&(t="http://",e=e.slice(7));let[r,n,o]=e.split("/");return{origin:t+r,mapId:n,fileName:o}},"parseCdnAssetUrl");var ay,tc,Tu,sy=class sy extends Gr{constructor(r){super(String(_t()));O(this,ay,{});O(this,tc);O(this,Tu);A(this,tc,r.mvfData),A(this,Tu,r.mapData)}static is(r){return r.__type===sy.__type}get url(){let r=u(this,tc).url;if(u(this,Tu).tokenManager==null)return r;let n=A0(u(this,tc).url);if(n==null)return r;let o=n.mapId;try{if(u(this,Tu).tokenManager.isEnterpriseMode())return r;let i=u(this,Tu).tokenManager.getSasToken(o).token;if(i==null||i==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(i)}catch(i){return j.error("Error getting SAS token for image",{error:i,url:r}),r}}get name(){return u(this,tc).altText}get altText(){return u(this,tc).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(u(this,ay)))delete u(this,ay)[r]}};ay=new WeakMap,tc=new WeakMap,Tu=new WeakMap,s(sy,"ImageMetaData"),h(sy,"__type","image");var R3=sy,rc=R3;var Vd,Di,Da,N3=class N3 extends Ai{constructor(r,n){super(n.properties.id,r);O(this,Vd);O(this,Di);O(this,Da,{});A(this,Vd,r),A(this,Di,n)}get externalId(){var r;return(r=u(this,Di).properties.externalId)!=null?r:""}get name(){var n,o,i,a,l;let r="";return"details"in u(this,Di).properties||(r=(n=u(this,Di).properties.externalId)!=null?n:""),r===""&&(r=(i=(o=u(this,Di).properties.details)==null?void 0:o.name)!=null?i:""),r===""&&(r=(l=(a=this.locationProfiles.find(c=>c.name&&c.name.length>0))==null?void 0:a.name)!=null?l:""),r}get description(){var n,o,i,a;let r=(o=(n=u(this,Di).properties.details)==null?void 0:n.description)!=null?o:"";return r===""&&(r=(a=(i=this.locationProfiles.find(l=>l.description&&l.description.length>0))==null?void 0:i.description)!=null?a:""),r}get images(){var n,o,i,a,l;if(u(this,Da).images!=null)return u(this,Da).images;let r=(i=(o=(n=u(this,Di).properties.details)==null?void 0:n.images)==null?void 0:o.map(c=>new rc({mvfData:c,mapData:u(this,Vd)})))!=null?i:[];return(r==null||r.length===0)&&(r=(l=(a=this.locationProfiles.find(c=>c.images.length>0))==null?void 0:a.images)!=null?l:[]),u(this,Da).images=r,r}get links(){var n,o,i,a,l;if(u(this,Da).links!=null)return u(this,Da).links;let r=(i=(o=(n=u(this,Di).properties.details)==null?void 0:n.links)==null?void 0:o.map(c=>new ec({mvfData:c})))!=null?i:[];return(r==null||r.length===0)&&(r=(l=(a=this.locationProfiles.find(c=>c.links.length>0))==null?void 0:a.links)!=null?l:[]),u(this,Da).links=r,r}get locationProfiles(){var r;return(r=u(this,Vd).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};Vd=new WeakMap,Di=new WeakMap,Da=new WeakMap,s(N3,"DetailedMapData");var on=N3;var ly,wu,Hd,Wd,zd=class zd extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",zd.__type);O(this,ly);O(this,wu);O(this,Hd,{});O(this,Wd);A(this,ly,r),A(this,wu,n.floorId),A(this,Wd,n.mvfData)}static is(r){return r.__type===zd.__type}get center(){var r;if(u(this,Hd).center==null){let[n,o]=(r=u(this,Wd).properties.center)!=null?r:[0,0];u(this,Hd).center=new Le(o,n,u(this,wu))}return u(this,Hd).center}get floor(){let r=u(this,ly).getById("floor",u(this,wu));if(r==null)throw new Error("Floor ".concat(u(this,wu)," not found!"));return r}get geoJSON(){return{...u(this,Wd),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};ly=new WeakMap,wu=new WeakMap,Hd=new WeakMap,Wd=new WeakMap,s(zd,"Area"),h(zd,"__type","area");var B3=zd,Fa=B3;d();var Mu,La,Ou,Zd,qd=class qd extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",qd.__type);O(this,Mu);O(this,La);O(this,Ou);O(this,Zd);A(this,La,{}),A(this,Zd,n.mvfData),A(this,Mu,r),A(this,Ou,n.floorId)}static is(r){return r.__type===qd.__type}get floor(){let r=u(this,Mu).getById("floor",u(this,Ou));if(r==null)throw new Error("Floor ".concat(u(this,Ou)," not found!"));return r}get center(){if(u(this,La).center==null){let[[r,n],[o,i]]=u(this,Zd).geometry.coordinates,a=(r+o)/2,l=(n+i)/2;u(this,La).center=new Le(l,a,u(this,Ou))}return u(this,La).center}get isExterior(){var o;let r=u(this,Mu).obstructionIdByEntranceId[this.id],n=u(this,Mu).getMVFFeatureById("obstruction",r);return(o=n==null?void 0:n.properties.footprintComponent)!=null?o:!1}get geoJSON(){return{...u(this,Zd),properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(u(this,La)))delete u(this,La)[r]}};Mu=new WeakMap,La=new WeakMap,Ou=new WeakMap,Zd=new WeakMap,s(qd,"Door"),h(qd,"__type","door");var $3=qd,Fi=$3;d();var nc,Eu,_o,Os,Xd=class Xd extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",Xd.__type);O(this,nc);O(this,Eu);O(this,_o,{});O(this,Os);A(this,nc,r),A(this,Eu,n.floorId),A(this,Os,n.mvfData)}getMvfData(){return u(this,Os)}static is(r){return r.__type===Xd.__type}get type(){return Kee(u(this,Os).properties.kind)}get locations(){if(u(this,_o).locations)return u(this,_o).locations;u(this,_o).locations=[];let r=u(this,nc).mvfLocationsBySpaceId[u(this,Os).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let o=u(this,nc).getById("enterprise-location",n.id);o&&u(this,_o).locations.push(o)}return u(this,_o).locations}get floor(){let r=u(this,nc).getById("floor",u(this,Eu));if(r==null)throw new Error("Floor ".concat(u(this,Eu)," not found!"));return r}get doors(){return u(this,Os).properties.destinationNodes.reduce((r,n)=>{let o=u(this,nc).doorsByNodeId[n];return o&&r.push(o),r},[])}get center(){var r;if(u(this,_o).center==null){let[n,o]=(r=u(this,Os).properties.center)!=null?r:[0,0];u(this,_o).center=new Le(o,n,u(this,Eu))}return u(this,_o).center}get geoJSON(){return{...u(this,Os),properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(u(this,_o)))delete u(this,_o)[r]}};nc=new WeakMap,Eu=new WeakMap,_o=new WeakMap,Os=new WeakMap,s(Xd,"Space"),h(Xd,"__type","space");var j3=Xd,Yee=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function Kee(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return Yee.includes(t)?t:"room"}s(Kee,"validateSpaceType");var Ur=j3;d();var Xo,Yt,Yo,cy,U3,Yd=class Yd extends Ai{constructor(r,n){super(n.mvfData.properties.id,r);O(this,cy);h(this,"__type",Yd.__type);O(this,Xo);O(this,Yt,{});O(this,Yo);A(this,Xo,r),A(this,Yo,n.mvfData)}static is(r){return r.__type===Yd.__type}get focusTarget(){return this}get name(){var r,n;return"name"in u(this,Yo).properties?(n=te(this,cy,U3).call(this,"name"))!=null?n:"":(r=u(this,Yo).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in u(this,Yo).properties?(n=te(this,cy,U3).call(this,"shortName"))!=null?n:"":(r=u(this,Yo).properties.externalId)!=null?r:""}get externalId(){var r;return(r=u(this,Yo).properties.externalId)!=null?r:""}get elevation(){return u(this,Yo).properties.elevation}get spaces(){if(u(this,Yt).spaces==null){let r=u(this,Xo).spaces.filter(n=>n.floor.id===this.id);u(this,Yt).spaces=r}return u(this,Yt).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=u(this,Yo).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(u(this,Yt).objects==null){let r=u(this,Xo).objects.filter(n=>n.floor.id===this.id);u(this,Yt).objects=r}return u(this,Yt).objects}get connections(){if(u(this,Yt).connections==null){let r=u(this,Xo).connections.filter(n=>n.floors.includes(this));u(this,Yt).connections=r}return u(this,Yt).connections}get doors(){if(u(this,Yt).doors==null){let r=u(this,Xo).doors.filter(n=>n.floor.id===this.id);u(this,Yt).doors=r}return u(this,Yt).doors}get annotations(){if(u(this,Yt).annotations==null){let r=u(this,Xo).annotations.filter(n=>n.floor.id===this.id);u(this,Yt).annotations=r}return u(this,Yt).annotations}get pois(){if(u(this,Yt).pois==null){let r=u(this,Xo).pointsOfInterest.filter(n=>n.floor.id===this.id);u(this,Yt).pois=r}return u(this,Yt).pois}get floorStack(){if(u(this,Yt).floorStack==null){let r=u(this,Xo).floorStacks.find(n=>n.floors.includes(this));u(this,Yt).floorStack=r}return u(this,Yt).floorStack}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,elevation:this.elevation,spaces:this.spaces.map(r=>r.id),objects:this.objects.map(r=>r.id),connections:this.connections.map(r=>r.id),doors:this.doors.map(r=>r.id),annotations:this.annotations.map(r=>r.id),pois:this.pois.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(u(this,Yt)))delete u(this,Yt)[r]}};Xo=new WeakMap,Yt=new WeakMap,Yo=new WeakMap,cy=new WeakSet,U3=s(function(r){let n=u(this,Yo).properties[r];return u(this,Xo).getPropTranslation(this.__type,r,this.id,n)},"#translate"),s(Yd,"Floor"),h(Yd,"__type","floor");var G3=Yd,ao=G3;d();d();d();var uy=s(e=>e!=null,"notNull");d();function py(e){let t;if(Ur.is(e)||Fi.is(e)||lo.is(e)||Fa.is(e)||Ko.is(e))t=e.center;else if(Ra.is(e)||Na.is(e))t=e.coordinate;else if(Le.is(e))t=e;else if(Aa.is(e))t=e.coordinate;else if(Es.is(e))t=e.coordinates[0];else return;return t}s(py,"getCoordinateFromStuffs");d();d();var _u={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},_s="ExteriorWalls",oc="Walls",J8=0,Kd="InteriorDoors",Jd="ExteriorDoors",Or="GeometryLayer",Ba="LabelsLayer",As="MarkersLayer",dy="FootprintLayer",Qd="OcclusionLayer",Q8="ImagesLayer",Au="FacadesLayer";var e_=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],t_={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function V3(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&j.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}s(V3,"validateOptions");function z3(e,t){var o,i,a,l,c,p;let r=((o=e==null?void 0:e.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,n={..._u,...e,outdoorView:{enabled:((i=e==null?void 0:e.outdoorView)==null?void 0:i.enabled)===void 0?!!r:(a=e==null?void 0:e.outdoorView)==null?void 0:a.enabled,layersHiddenByGeometry:(l=_u.outdoorView)==null?void 0:l.layersHiddenByGeometry,...e==null?void 0:e.outdoorView},bearing:(p=(c=e==null?void 0:e.bearing)!=null?c:t.naturalBearing)!=null?p:0,imagePlacementOptions:{..._u.imagePlacementOptions,...e==null?void 0:e.imagePlacementOptions},multiFloorView:{..._u.multiFloorView,...e==null?void 0:e.multiFloorView}};return r&&n.outdoorView&&(n.outdoorView.token=r),n}s(z3,"handleShow3DMapOptionDefault");function r_(e){let t={remove_watermark:!1};if(e)try{let r=S0(e);Object.assign(t,r.capabilities)}catch(r){j.error("Error decoding capabilities from token",r)}return t}s(r_,"handleTokenCapabilities");var ic,Jo,$a,ef=class ef extends on{constructor(r,n){let o=Object.values(n.mvfDataByFloorId)[0];super(r,o);h(this,"__type",ef.__type);O(this,ic);O(this,Jo);O(this,$a);A(this,Jo,{}),A(this,ic,r),A(this,$a,n.mvfDataByFloorId)}static is(r){return r.__type===ef.__type}get accessible(){var r;return(r=Object.values(u(this,$a))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(u(this,$a))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(u(this,$a))[0].properties.extra}get coordinates(){return u(this,Jo).coordinates==null&&(u(this,Jo).coordinates=Object.entries(u(this,$a)).map(([r,n])=>new Le(n.geometry.coordinates[1],n.geometry.coordinates[0],r))),u(this,Jo).coordinates}get nodes(){return Object.values(u(this,$a))[0].properties.nodes.map(r=>u(this,ic).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?u(this,ic).getById("floor",r.floorId):void 0).filter(uy)}get locationProfiles(){var n,o,i,a,l;if(u(this,Jo).locationProfiles!=null)return u(this,Jo).locationProfiles;let r=super.locationProfiles;if(r==null||r.length===0){let c=[(o=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?o:0,(a=(i=this.coordinates[0])==null?void 0:i.latitude)!=null?a:0],p=Ms(c),f=(l=u(this,ic).mvfConnectionIdsByLatLon[p])!=null?l:[];for(let m of f){let y=u(this,ic).locationProfilesByAttachedFeatureId[m];if(y!=null){r=y;break}}}return u(this,Jo).locationProfiles=r!=null?r:[],r}get focusTarget(){return this.coordinates}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(r=>r.toJSON()),floors:this.floors.map(r=>r.id),extra:this.extra}}destroy(){for(let r of Object.keys(u(this,Jo)))delete u(this,Jo)[r]}};ic=new WeakMap,Jo=new WeakMap,$a=new WeakMap,s(ef,"Connection"),h(ef,"__type","connection");var H3=ef,sc=H3;d();var fy,ku,ac,Du,tf=class tf extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",tf.__type);O(this,fy);O(this,ku);O(this,ac,{});O(this,Du);A(this,fy,r),A(this,ku,n.floorId),A(this,Du,n.mvfData)}static is(r){return r.__type===tf.__type}get type(){let r=u(this,Du).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=u(this,fy).getById("floor",u(this,ku));if(r==null)throw new Error("Floor ".concat(u(this,ku)," not found!"));return r}get center(){var r;if(u(this,ac).center==null){let[n,o]=(r=u(this,Du).properties.center)!=null?r:[0,0];u(this,ac).center=new Le(o,n,u(this,ku))}return u(this,ac).center}get geoJSON(){return{...u(this,Du),properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of globalThis.Object.keys(u(this,ac)))u(this,ac)[r]=null}};fy=new WeakMap,ku=new WeakMap,ac=new WeakMap,Du=new WeakMap,s(tf,"MapObject"),h(tf,"__type","object");var W3=tf,lo=W3;d();var my,Fu,lc,nf,rf=class rf extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",rf.__type);O(this,my);O(this,Fu);O(this,lc,{});O(this,nf);A(this,my,r),A(this,nf,n.mvfData),A(this,Fu,n.floorId)}static is(r){return r.__type===rf.__type}get floor(){let r=u(this,my).getById("floor",u(this,Fu));if(r==null)throw new Error("Floor ".concat(u(this,Fu)," not found!"));return r}get coordinate(){var r;if(u(this,lc).coordinate==null){let[n,o]=(r=u(this,nf).geometry.coordinates)!=null?r:[0,0];u(this,lc).coordinate=new Le(o,n,u(this,Fu))}return u(this,lc).coordinate}get geoJSON(){return{...u(this,nf),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let r in u(this,lc))u(this,lc)[r]=null}};my=new WeakMap,Fu=new WeakMap,lc=new WeakMap,nf=new WeakMap,s(rf,"PointOfInterest"),h(rf,"__type","point-of-interest");var q3=rf,Ra=q3;d();var hy,Lu,cc,Ru,yy,X3,of=class of extends on{constructor(r,n){super(r,n.mvfData);O(this,yy);h(this,"__type",of.__type);O(this,hy);O(this,Lu);O(this,cc,{});O(this,Ru);A(this,hy,r),A(this,Lu,n.floorId),A(this,Ru,n.mvfData)}static is(r){return r.__type===of.__type}get group(){return te(this,yy,X3).call(this).group}get type(){return te(this,yy,X3).call(this).type}get coordinate(){if(u(this,cc).coordinate==null){let[r,n]=u(this,Ru).geometry.coordinates;u(this,cc).coordinate=new Le(n,r,u(this,Lu))}return u(this,cc).coordinate}get floor(){let r=u(this,hy).getById("floor",u(this,Lu));if(r==null)throw new Error("Floor ".concat(u(this,Lu)," not found!"));return r}get geoJSON(){return{...u(this,Ru),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let r of Object.keys(u(this,cc)))delete u(this,cc)[r]}};hy=new WeakMap,Lu=new WeakMap,cc=new WeakMap,Ru=new WeakMap,yy=new WeakSet,X3=s(function(){let[r,n]=u(this,Ru).properties.symbolId.split("--");return{group:r,type:n}},"#getGroupAndTypeFromSymbolId"),s(of,"Annotation"),h(of,"__type","annotation");var Z3=of,Na=Z3;d();var Jee=s((e,t)=>{var c,p,f,m,y,v,x,S,I,P,T;let r={},n={},o={},i={},a={},l={};for(let M of e["location.json"]||[]){let w=new Nu(t,{mvfData:M});if(r[M.id]=w,M.externalId&&(i[M.externalId]==null&&(i[M.externalId]=[]),i[M.externalId].push(w)),M.categories)for(let B of M.categories)a[B]==null&&(a[B]=[]),a[B].push(w);let E=[...(p=(c=M.obstructions)==null?void 0:c.map(B=>B.id))!=null?p:[],...(m=(f=M.spaces)==null?void 0:f.map(B=>B.id))!=null?m:[],...(v=(y=M.annotations)==null?void 0:y.map(B=>B.id))!=null?v:[],...(x=M.connections)!=null?x:[],...(I=(S=M.entrances)==null?void 0:S.map(B=>B.id))!=null?I:[],...(T=(P=M.areas)==null?void 0:P.map(B=>B.id))!=null?T:[]];for(let B of E)B&&(l[B]==null&&(l[B]=[]),l[B].push(w))}for(let M of e["category.json"]||[]){let w=new by(t,{mvfData:M});n[M.id]=w,M.parent&&(o[M.parent]==null&&(o[M.parent]=[]),o[M.parent].push(w))}return{locationCategoriesByParentId:o,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:i,locationProfilesByCategoryId:a,locationProfilesByAttachedFeatureId:l}},"processMVFLocationProfilesAndCategories"),Qee=s((e,t,r)=>{var I,P;let n={},o={},i={},a={},l={},c={},p={},f={},m={},y={},v={},x={},S=globalThis.Object.keys(e.space);for(let T of S){let M=e.space[T];if(M!=null)for(let w of M.features){x[w.properties.id]=T,p[w.properties.id]=w;for(let E of w.properties.destinationNodes)l[E]==null&&(l[E]=[]),l[E].push(w.properties.id);if(w.properties.kind==="desk-entrance"&&(c[w.properties.externalId]==null&&(c[w.properties.externalId]=[]),c[w.properties.externalId].push(...w.properties.destinationNodes)),!["void","desk-entrance"].includes((I=w.properties.kind)!=null?I:"")){if((P=w.properties.kind)!=null&&P.includes("connection")){let E=Ms(w.geometry.coordinates);y[E]==null&&(y[E]=[]),y[E].push(w.properties.id);continue}if(w.properties.kind==="poi"){let E=new Ra(r,{floorId:T,mvfData:w});i[w.properties.id]=E,m[T]||(m[T]=[]),m[T].push(w),w.properties.externalId&&(a[w.properties.externalId]==null&&(a[w.properties.externalId]=[]),a[w.properties.externalId].push(E))}else{let E=new Ur(r,{floorId:T,mvfData:w});n[w.properties.id]=E,w.properties.externalId&&(o[w.properties.externalId]==null&&(o[w.properties.externalId]=[]),o[w.properties.externalId].push(E)),f[T]||(f[T]=[]),f[T].push(w)}}}}for(let T in y){let M=y[T],w={};for(let B of M){let D=x[B],F=p[B],L=t==null?void 0:t["n_"+F.properties.id.split("s_")[1]];w[D]={...F,properties:{...F.properties,accessible:(L==null?void 0:L.accessible)===!0}}}let E=new sc(r,{mvfDataByFloorId:w});v[E.id]=E}return{spacesById:n,spacesByExternalId:o,poisById:i,poisByExternalId:a,connectionsById:v,spaceIdsByDestinationNodeId:l,objectEntranceNodeIdsByObstructionId:c,mvfSpacesById:p,connectionIdsByLatLon:y,mvfSpacesByFloorId:f,mvfPoisByFloorId:m}},"processMVFSpaces"),ete=s((e,t)=>{var a,l;let r={},n={},o={},i={};for(let c of e["node.geojson"].features){o[c.properties.id]=c;let p=new Aa(t,{mvfData:c,floorId:(a=c.properties.floor)!=null?a:c.properties.map});r[c.properties.id]=p,c.properties.externalId&&(n[c.properties.externalId]==null&&(n[c.properties.externalId]=[]),n[c.properties.externalId].push(p));let f=(l=c.properties.floor)!=null?l:c.properties.map;i[f]||(i[f]=[]),i[f].push(c)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}},"processMVFNodes"),tte=s((e,t)=>{let r={},n={},o={},i={},a=globalThis.Object.keys(e.obstruction);for(let l of a){let c=e.obstruction[l];if(c!=null)for(let p of c.features){o[p.properties.id]=p;for(let m of p.properties.entrances)i[m]=p.properties.id;if(p.properties.kind==="Wall")continue;let f=new lo(t,{floorId:l,mvfData:p});r[p.properties.id]=f,p.properties.externalId&&(n[p.properties.externalId]==null&&(n[p.properties.externalId]=[]),n[p.properties.externalId].push(f))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:o,obstructionIdByEntranceId:i}},"processMVFObstructions"),rte=s((e,t)=>{let r={},n={},o={};if("floor.geojson"in e&&e["floor.geojson"]!=null)for(let i of e["floor.geojson"].features){o[i.properties.id]=i.properties;let a=new ao(t,{mvfData:i});r[i.properties.id]=a,i.properties.externalId&&(n[i.properties.externalId]==null&&(n[i.properties.externalId]=[]),n[i.properties.externalId].push(a))}else for(let i of e["map.geojson"]){o[i.id]=i;let a=new ao(t,{mvfData:{properties:i}});r[i.id]=a}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:o}},"processMVFFloors"),nte=s((e,t)=>{var c;let r={},n={},o={},i={},a={},l=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(l!=null)for(let p of l){let f=(c=e.facade)==null?void 0:c[p.id],m=new ry(t,{mvfData:p,facadeId:f==null?void 0:f.id});if(r[p.id]=m,p.externalId&&(n[p.externalId]==null&&(n[p.externalId]=[]),n[p.externalId].push(m)),o[p.id]=p,f){let y=new Ko(t,{mvfData:f,floorStackId:p.id});i[f.id]=y;for(let v of f.spaces)a[v.spaceId]=y}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:o,facadesById:i,facadesBySpaceId:a}},"processMVFFloorStacks"),ote=s((e,t)=>{let r={},n={},o=e["connection.json"].reduce((i,a)=>{a.nodes.forEach(c=>i[c]=a),r[a.id]=a;let l=t==null?void 0:t[a.nodes[0]];if(l!=null){let c=Ms(l.geometry.coordinates);n[c]==null&&(n[c]=[]),n[c].push(a.id)}return i},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:o,mvfConnectionIdsByLatLon:n}},"processMVFConnections"),ite=s((e,t)=>{let r={},n={},o={},i={},a={},l=globalThis.Object.keys(e.entrance);for(let c of l){let p=e.entrance[c];if(p!=null)for(let f of p.features){i[f.properties.id]=f;let m=new Fi(t,{floorId:c,mvfData:f});f.properties.node&&(o[f.properties.node]=m),r[f.properties.id]=m,f.properties.externalId&&(n[f.properties.externalId]==null&&(n[f.properties.externalId]=[]),n[f.properties.externalId].push(m)),a[c]||(a[c]=[]),a[c].push(f)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:o,mvfEntrancesById:i,mvfEntrancesByFloorId:a}},"processMVFEntrances"),ste=s((e,t,r)=>{var n;if(e.textAreas!=null)for(let o in e.textAreas){let i=(n=e.textAreas[o])==null?void 0:n.features;if(i!=null){for(let a of i)if("anchorId"in a.properties){let l=a==null?void 0:a.properties,c=t[l.anchorId]||r[l.anchorId];if(c!=null&&l!=null){let p=c.properties;p.textArea=l,p.textArea&&(p.textArea.position=a.geometry.coordinates)}}}}},"processMVFTextAreas"),ate=s((e,t,r)=>{var n;if(e.floorImages!=null)for(let o in e.floorImages){let i=(n=e.floorImages[o])==null?void 0:n.features;if(i!=null){for(let a of i)if("anchorId"in a.properties){let l=a==null?void 0:a.properties,c=t[l.anchorId]||r[l.anchorId];if(c!=null&&l!=null){let p=c.properties;p.image=l,p.image&&(p.image.position=a.geometry.coordinates)}}}}},"processMVFPolygonImages"),lte=s((e,t)=>{var n,o;if(((n=e.enterprise)==null?void 0:n.enterpriseStyles)==null)return;let r=(o=e.enterprise)==null?void 0:o.enterpriseStyles;for(let i in r){let a=r[i];a.geometryAnchors.forEach(l=>{let c=t[l.geometryId];if(c!=null){let p=c.properties;p.style={styleId:i,edgeOffset:a.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),cte=s((e,t,r)=>{if(!(e.enterprise==null||e.enterprise.textures==null))for(let n of e.enterprise.textures)for(let o of n.geometryAnchors){let i=t[o.geometryId]||r[o.geometryId];if(i!=null){let a=i.properties;a.textures==null&&(a.textures=[]),a.textures.push(n)}}},"processMVFEnterpriseTextures"),ute=s((e,t)=>{let r={},n={},o={};if(e.annotation==null)return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:o};let i=globalThis.Object.keys(e.annotation);for(let a of i){let l=e.annotation[a];if(l!=null)for(let c of l.features){n[c.properties.id]=c;let p=new Na(t,{floorId:a,mvfData:c});r[c.properties.id]=p,o[a]||(o[a]=[]),o[a].push(c)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:o}},"processMVFAnnotations"),pte=s((e,t)=>{let r={},n={},o={};if(e.area==null)return{areasById:r,areasByExternalId:n,mvfAreasById:o};let i=globalThis.Object.keys(e.area);for(let a of i){let l=e.area[a];if(l!=null)for(let c of l.features){o[c.properties.id]=c;let p=new Fa(t,{floorId:a,mvfData:c});r[c.properties.id]=p,c.properties.externalId&&(n[c.properties.externalId]==null&&(n[c.properties.externalId]=[]),n[c.properties.externalId].push(p))}}return{areasById:r,areasByExternalId:n,mvfAreasById:o}},"processMVFAreas"),n_=s((e,t)=>{var P,T,M,w,E,B,D,F,L,H,U,G,J;let r={},n={},o={},i={},a=((T=(P=e.enterprise)==null?void 0:P.locations)!=null?T:[]).reduce((X,ie)=>(X[ie.id]=ie,X),{}),l={},c={},p={},f={},m={},y={},v=((M=e.enterprise)==null?void 0:M.venue)||{},x={},S={};for(let X of(E=(w=e.enterprise)==null?void 0:w.categories)!=null?E:[]){let ie=new gy(t,{mvfData:X});l[X.id]=ie,X.externalId&&(c[X.externalId]==null&&(c[X.externalId]=[]),c[X.externalId].push(ie)),p[X.id]=X,X.locations.forEach(ee=>{m[ee]==null&&(m[ee]=[]),m[ee].push(X.id)})}let I={};for(let X of(D=(B=e.enterprise)==null?void 0:B.locationInstances)!=null?D:[]){let ie=a[X.parent],ee=Object.keys(ie),be={};for(let de of ee)be[de]=void 0;let ve={...be,polygons:[],nodes:[],...X};I[ve.parent]==null&&(I[ve.parent]=[]),I[ve.parent].push(new Es(t,{mvfData:ve,categoryIds:((L=(F=e.enterprise)==null?void 0:F.categoryPriorities)==null?void 0:L[ve.id])||m[ve.id],parentId:X.parent})),x[ve.id]=X}for(let X in e.space){let ie=e.space[X];if(ie!=null)for(let ee of ie.features)for(let be of ee.properties.destinationNodes)S[be]==null&&(S[be]=[]),S[be].push(ee.properties.id)}for(let X of(U=(H=e.enterprise)==null?void 0:H.locations)!=null?U:[]){let ie=new Es(t,{mvfData:X,categoryIds:((J=(G=e.enterprise)==null?void 0:G.categoryPriorities)==null?void 0:J[X.id])||m[X.id],locationInstances:I[X.id]});o[X.id]=ie,X.externalId&&(i[X.externalId]==null&&(i[X.externalId]=[]),i[X.externalId].push(ie)),X.nodes.forEach(ee=>{y[ee.id]==null&&(y[ee.id]=[]),y[ee.id].push(X.id)});for(let ee of X.polygons)f[ee.id]==null&&(f[ee.id]=[]),f[ee.id].push(X)}if(t.enterpriseMode===!0){for(let X in t.mvfConnectionsById){let ie={},ee=t.mvfConnectionsById[X];for(let be of t.mvfConnectionsById[X].nodes){let ve=t.nodesById[be];ve!=null&&(ie[ve.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[ve.coordinate.longitude,ve.coordinate.latitude]},properties:{id:X,externalId:ee.externalId,kind:"enterprise."+ee.type,destinationNodes:[],flags:"",type:ee.type,nodes:ee.nodes,accessible:ee.accessible,extra:ee.extra,details:ee.details}})}Object.keys(ie).length>0&&(r[X]=new sc(t,{mvfDataByFloorId:ie}),ee.externalId&&(n[ee.externalId]==null&&(n[ee.externalId]=[]),n[ee.externalId].push(r[X])))}t.connectionsById=r}return{spaceIdsByNodeId:S,connectionsByExternalId:n,locationIdsByNodeId:y,mvfLocationsBySpaceId:f,mvfLocationsById:a,mvfCategoriesById:p,locationsById:o,locationsByExternalId:i,locationInstancesById:x,categoriesById:l,categoriesByExternalId:c,venue:v}},"createEnterpriseDataFromMVF"),o_=s((e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}=ete(e,t),{mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfConnectionIdsByLatLon:c}=ote(e,o),{spacesById:p,spacesByExternalId:f,spaceIdsByDestinationNodeId:m,poisById:y,poisByExternalId:v,mvfSpacesById:x,objectEntranceNodeIdsByObstructionId:S,connectionsById:I,connectionIdsByLatLon:P,mvfSpacesByFloorId:T,mvfPoisByFloorId:M}=Qee(e,l,t),{objectsById:w,objectsByExternalId:E,mvfObstructionById:B,obstructionIdByEntranceId:D}=tte(e,t),{floorsById:F,floorsByExternalId:L,mvfFloorsById:H}=rte(e,t),{floorStacksById:U,floorStacksByExternalId:G,mvfFloorStacksById:J,facadesById:X,facadesBySpaceId:ie}=nte(e,t),{doorsById:ee,doorsByExternalId:be,doorsByNodeId:ve,mvfEntrancesById:de,mvfEntrancesByFloorId:Ae}=ite(e,t),{annotationsById:gt,mvfAnnotationsById:st,mvfAnnotationsByFloorId:Ye}=ute(e,t),{areasById:Ve,areasByExternalId:fe,mvfAreasById:he}=pte(e,t);ate(e,x,B),ste(e,x,B),lte(e,x),cte(e,x,B);let{locationCategoriesByParentId:re,locationProfilesById:se,locationCategoriesById:k,locationProfilesByExternalId:K,locationProfilesByCategoryId:R,locationProfilesByAttachedFeatureId:ce}=Jee(e,t);return{spacesById:p,spacesByExternalId:f,nodesById:r,nodesByExternalId:n,objectsById:w,objectsByExternalId:E,floorsById:F,floorsByExternalId:L,floorStacksById:U,floorStacksByExternalId:G,facadesById:X,facadesBySpaceId:ie,connectionsById:I,doorsById:ee,doorsByExternalId:be,doorsByNodeId:ve,poisById:y,poisByExternalId:v,annotationsById:gt,areasById:Ve,areasByExternalId:fe,spaceIdsByDestinationNodeId:m,objectEntranceNodeIdsByObstructionId:S,obstructionIdByEntranceId:D,connectionIdsByLatLon:P,locationProfilesById:se,locationCategoriesById:k,locationProfilesByExternalId:K,locationProfilesByCategoryId:R,locationCategoriesByParentId:re,mvfSpacesById:x,mvfNodesById:o,mvfObstructionById:B,mvfFloorsById:H,mvfFloorStacksById:J,mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfEntrancesById:de,mvfAnnotationsById:st,mvfNodesByFloorId:i,mvfSpacesByFloorId:T,mvfPoisByFloorId:M,mvfAreasById:he,mvfEntrancesByFloorId:Ae,mvfAnnotationsByFloorId:Ye,locationProfilesByAttachedFeatureId:ce,mvfConnectionIdsByLatLon:c}},"createDataFromMVF");d();d();d();var dte=s(function(){let t=globalThis.fetch;return{fetch(...r){if(!uy(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...r)},setFetch(r){t=r}}},"createFetchControl")(),i_=dte.fetch;var c_=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],s_=c_[0],u_="https://api-gateway.mappedin.com/track-analytics/a/",p_="deny-watchposition",d_="load-mapview",f_="load-mapdata",m_="change-language",h_="query-directions";var ja,Li,sf,k0,K3=class K3{constructor(){O(this,sf);O(this,ja,Object.freeze({}));O(this,Li);h(this,"oneTimeEventsSent",new Set);h(this,"sendGetDirectionsEvent",w8((t,r)=>this.sendAnalyticEvent(h_,{start:t,end:r,type:"location_to_location"}),2500));A(this,Li,te(this,sf,k0).call(this,u(this,ja)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){A(this,ja,{}),A(this,Li,te(this,sf,k0).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return A(this,ja,Object.freeze(Object.assign({},u(this,ja),t))),A(this,Li,te(this,sf,k0).call(this,t)),u(this,Li)}updateState(t){let r={...t};r.mapId&&(r.analyticsBaseUrl=Y3({...u(this,Li),mapId:r.mapId})),r.context&&(r.context=l_(r.context)),r.baseUri&&(r.analyticsBaseUrl=Y3({baseUri:r.baseUri,mapId:u(this,Li).mapId})),Object.assign(u(this,Li),r),this.handleStateUpdate(t)}handleStateUpdate(t){var r;(r=t.userPosition)!=null&&r.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:r,accessToken:n}=this.getState();return!!(t&&r)||!!n}getState(){return u(this,Li)}getContext(){return this.getState().context||u(this,ja).context||s_}getSessionId(){return this.getState().sessionId||u(this,ja).sessionId||a_()}sendAnalyticEvent(t,r={}){let n=this.getState(),o=mte(n.analyticsBaseUrl,t),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":n.deviceId};if(n.logEvents&&j.log("Analytics.track",o,i),!n.sendEvents)return Promise.resolve();if(!this.authReady)return j.warn("Auth needs to be ready to send analytics.");let a={...r,g:n.geolocationMode,sdk_version:n.version};return n.userPosition&&Object.assign(a,n.userPosition),i["Content-Type"]="application/json",n.accessToken?i.Authorization="Bearer ".concat(n.accessToken):n.noAuth||n.secret&&n.key&&(i["x-mappedin-key"]=btoa(n.key),i["x-mappedin-secret"]=btoa(n.secret)),i_(o,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(a)})}capture(t,r){if(yte.includes(t))return j.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=hte.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(f_,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(m_,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(p_)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r}){return this.sendAnalyticEvent(d_,{type:"3d",firstRenderDuration:t,width:r.width,height:r.height,devicePixelRatio:window.devicePixelRatio})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};ja=new WeakMap,Li=new WeakMap,sf=new WeakSet,k0=s(function(t){var n,o,i,a;let r=(n=t.baseUri)!=null?n:u_;return{baseUri:r,analyticsBaseUrl:Y3({...t,baseUri:r}),version:((o=b==null?void 0:b.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||fte(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||a_(),platformString:t.platformString||"",context:l_(t.context)||s_,geolocationMode:!1,sendEvents:(i=t.sendEvents)!=null?i:!0,logEvents:(a=t.logEvents)!=null?a:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),s(K3,"AnalyticsInternal");var af=K3;function Y3({mapId:e,baseUri:t=u_}){return"".concat(t).concat(e,"/")}s(Y3,"getBaseUrl");function fte(){return vu.getInstance().loadLocalData("deviceId")}s(fte,"getDeviceIDFromStorage");function a_(){return vu.getInstance().loadSessionData("id")}s(a_,"getSessionIDFromStorage");function mte(e,t){return e+t}s(mte,"buildUrl");function l_(e){return c_.find(t=>t===e)}s(l_,"getValidContext");var hte=["$select-location","$select-category","$query-suggest","$query-search"],yte=[d_,f_,h_,p_,m_],F7e=new af,Ga,J3=class J3{constructor(t){O(this,Ga);h(this,"capture");h(this,"updateState");A(this,Ga,t),this.capture=u(this,Ga).capture.bind(u(this,Ga)),this.updateState=u(this,Ga).updateState.bind(u(this,Ga))}getState(){return Object.assign({},u(this,Ga).getState())}};Ga=new WeakMap,s(J3,"Analytics");var vy=J3;d();var gte=new Set(["polygons"]),Ri,dr,co,xy,lf=class lf extends Gr{constructor(r,n){super(n.mvfData.externalId);h(this,"__type",lf.__type);h(this,"description");h(this,"name","");h(this,"amenity");h(this,"externalId","");h(this,"extra");h(this,"gallery");h(this,"instances");h(this,"logo");h(this,"operationHours");h(this,"phone");h(this,"picture");h(this,"shortName");h(this,"showFloatingLabelWhenImagePresent");h(this,"showLogo");h(this,"siblingGroups");h(this,"social");h(this,"sortOrder",-1);h(this,"states");h(this,"tags");h(this,"type","");O(this,Ri);O(this,dr,{});O(this,co);O(this,xy);A(this,Ri,r),A(this,co,n.mvfData),A(this,xy,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let o in n.mvfData)!gte.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(n.parentId){let i=u(this,Ri).locationsById[n.parentId];return u(this,co)[o]!=null?u(this,Ri).getPropTranslation(this.__type,o,u(this,co).id,u(this,co)[o]):u(this,Ri).getPropTranslation(this.__type,o,u(this,co).id,i[o])}return u(this,Ri).getPropTranslation(this.__type,o,u(this,co).id,u(this,co)[o])}})}static is(r){return r.__type===lf.__type}get focusTarget(){return this.spaces}get categories(){return u(this,dr).categories?u(this,dr).categories:(u(this,dr).categories=(u(this,xy).map(r=>u(this,Ri).getById("enterprise-category",r))||[]).filter(Boolean),u(this,dr).categories)}get coordinates(){if(u(this,dr).coordinates)return u(this,dr).coordinates;u(this,dr).coordinates=[];for(let r=0;r<this.nodes.length;r++)u(this,dr).coordinates.push(this.nodes[r].coordinate);return u(this,dr).coordinates}get nodes(){if(u(this,dr).nodes)return u(this,dr).nodes;u(this,dr).nodes=[];for(let r=0;r<u(this,co).nodes.length;r++){let n=u(this,Ri).getById("node",u(this,co).nodes[r].id);n&&u(this,dr).nodes.push(n)}return u(this,dr).nodes}get spaces(){if(u(this,dr).spaces)return u(this,dr).spaces;u(this,dr).spaces=[];for(let r=0;r<u(this,co).polygons.length;r++){let n=u(this,Ri).getById("space",u(this,co).polygons[r].id);n&&u(this,dr).spaces.push(n)}return u(this,dr).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(u(this,dr)))delete u(this,dr)[r]}};Ri=new WeakMap,dr=new WeakMap,co=new WeakMap,xy=new WeakMap,s(lf,"EnterpriseLocation"),h(lf,"__type","enterprise-location");var Q3=lf,Es=Q3;d();var bte=new Set,Bu,Vn,ks,cf=class cf extends Gr{constructor(r,n){super(n.mvfData.externalId);h(this,"__type",cf.__type);h(this,"name","");h(this,"color");h(this,"externalId","");h(this,"extra");h(this,"icon");h(this,"iconFromDefaultList");h(this,"sortOrder",-1);h(this,"picture");O(this,Bu);O(this,Vn,{});O(this,ks);A(this,Bu,r),A(this,ks,n.mvfData);for(let o in n.mvfData)!bte.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return u(this,Bu).getPropTranslation(this.__type,o,u(this,ks).id,u(this,ks)[o])}})}static is(r){return r.__type===cf.__type}get children(){if(u(this,Vn).children)return u(this,Vn).children;u(this,Vn).children=[];for(let r=0;r<u(this,ks).children.length;r++){let n=u(this,Bu).getById("enterprise-category",u(this,ks).children[r]);n&&u(this,Vn).children.push(n)}return u(this,Vn).children}get locations(){if(u(this,Vn).locations)return u(this,Vn).locations;u(this,Vn).locations=[];for(let r=0;r<u(this,ks).locations.length;r++){let n=u(this,Bu).getById("enterprise-location",u(this,ks).locations[r]);n&&u(this,Vn).locations.push(n)}return u(this,Vn).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(u(this,Vn)))delete u(this,Vn)[r]}};Bu=new WeakMap,Vn=new WeakMap,ks=new WeakMap,s(cf,"EnterpriseCategory"),h(cf,"__type","enterprise-category");var eC=cf,gy=eC;d();var vte=new Set,Iy,Sy,uf=class uf extends Gr{constructor(r,n){super(n.mvfData.externalId);h(this,"__type",uf.__type);h(this,"countrycode");h(this,"externalId","");h(this,"defaultLanguage",{code:"en",name:"English"});h(this,"defaultMap");h(this,"extra");h(this,"icon");h(this,"languages",[]);h(this,"links",[]);h(this,"logo");h(this,"mappedinWebUrl");h(this,"slug","");h(this,"topLocations");h(this,"tzid");O(this,Iy,{});O(this,Sy);A(this,Sy,n.mvfData);for(let o in n.mvfData)!vte.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=n.mvfData[o])}static is(r){return r.__type===uf.__type}get name(){var r;return(r=u(this,Sy).name)!=null?r:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(u(this,Iy)))delete u(this,Iy)[r]}};Iy=new WeakMap,Sy=new WeakMap,s(uf,"EnterpriseVenue"),h(uf,"__type","enterprise-venue");var tC=uf,D0=tC;d();d();d();d();d();d();var MB=ys(xT(),1),OB=ys(TB(),1);d();var cae=s(e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2},"isPotentiallyBadSchema");function hv(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(hv);let t={...e};for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let o=hv(n);if(cae(o)){let i=o.allOf.findIndex(l=>l.type==="array"),a=o.allOf.findIndex(l=>l.type==="object");if(i!==-1&&a!==-1){t[r]={...o,allOf:[o.allOf[i]]};continue}}t[r]=o}return t}s(hv,"cleanupInvalidArrayAllOf");var wB={$ref:"#/definitions/ParsedMVF",$schema:"http://json-schema.org/draft-07/schema#",definitions:{AnchoredFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},geometryId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text belongs. It will be displayed on top of it."},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","geometryId","rotation","text","visible"],type:"object"},AnchoredImageProperties:{additionalProperties:!1,properties:{anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this image belongs. It will be displayed on top of it."},height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["anchorId","height","path","rotation","width"],type:"object"},AnchoredTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text area belongs. It will be displayed on top of it."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"}},required:["align","anchorId","maxHeight","maxWidth","rotation"],type:"object"},AnnotationCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/AnnotationProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AnnotationId:{pattern:"^a_[A-Za-z0-9_-]{8,}$",type:"string"},AnnotationProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},id:{$ref:"#/definitions/AnnotationId"},symbolId:{type:"string"}},required:["id","symbolId"],type:"object"},Area:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/AreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},AreaCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Area"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AreaId:{pattern:"^ar_[A-Za-z0-9_-]{8,}$",type:"string"},AreaProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this area."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this area.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/AreaId"}},required:["id"],type:"object"},Category:{additionalProperties:!1,properties:{icon:{description:"The category's icon",format:"uri",type:"string"},id:{$ref:"#/definitions/CategoryId"},name:{type:"string"},parent:{$ref:"#/definitions/CategoryId"}},required:["id","name","icon"],type:"object"},CategoryId:{description:"A category ID",pattern:"^cat_[A-Za-z0-9_-]{8,}$",type:"string"},Connection:{additionalProperties:!1,properties:{accessible:{type:"boolean"},details:{additionalProperties:!1,properties:{name:{type:"string"}},type:"object"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},id:{$ref:"#/definitions/ConnectionId"},metadata:{$ref:"#/definitions/Metadata"},nodes:{description:"A list of node IDs corresponding to nodes that are a part of this connection.",items:{$ref:"#/definitions/NodeId"},type:"array"},type:{type:"string"}},required:["id","type","nodes","externalId"],type:"object"},ConnectionId:{pattern:"^c_[A-Za-z0-9_-]{8,}$",type:"string"},Connections:{items:{$ref:"#/definitions/Connection"},type:"array"},Day:{enum:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],type:"string"},DayOrPublicHoliday:{anyOf:[{$ref:"#/definitions/Day"},{const:"PublicHolidays",type:"string"}]},Details:{additionalProperties:!1,description:"Additional information about a given entity.",properties:{description:{type:"string"},images:{items:{$ref:"#/definitions/Image"},type:"array"},links:{items:{$ref:"#/definitions/Hyperlink"},type:"array"},name:{type:"string"}},type:"object"},EnterpriseCategory:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},color:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The category's icon",format:"uri",type:"string"},iconFromDefaultList:{type:["string","null"]},id:{$ref:"#/definitions/EnterpriseCategoryId"},locations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},name:{type:"string"},picture:{description:"The category's picture",format:"uri",type:"string"},sortOrder:{type:"number"}},required:["children","externalId","id","locations","name","sortOrder"],type:"object"},EnterpriseCategoryId:{description:"An ID for an enterprise category",pattern:"^ec_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseCategoryPriority:{additionalProperties:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},description:"The ordered list of category ids that this location belongs to The order here determines the priority of the categories, with the first category being the highest priority for determining application logic like icon and color preference.",propertyNames:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$"},type:"object"},EnterpriseCollection:{additionalProperties:!1,properties:{categories:{items:{$ref:"#/definitions/EnterpriseCategory"},type:"array"},categoryPriorities:{$ref:"#/definitions/EnterpriseCategoryPriority"},enterpriseStyles:{$ref:"#/definitions/EnterpriseStyles"},floorText:{$ref:"#/definitions/EnterpriseFloorText"},layers:{items:{$ref:"#/definitions/EnterpriseLayer"},type:"array"},locationInstances:{items:{$ref:"#/definitions/EnterpriseLocationInstance"},type:"array"},locations:{items:{$ref:"#/definitions/EnterpriseLocation"},type:"array"},textures:{items:{$ref:"#/definitions/EnterpriseTexture"},type:"array"},venue:{$ref:"#/definitions/EnterpriseVenue"}},required:["locations","categories","venue","locationInstances","layers"],type:"object"},EnterpriseFloorText:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorTextFeatureCollection"},{not:{}}]},description:"The text to display on a map, split into feature collection per floor.",type:"object"},EnterpriseLayer:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/EnterpriseLayerId"},name:{type:"string"},spaces:{items:{$ref:"#/definitions/EnterpriseLayerSpace"},minItems:1,type:"array"}},required:["id","name","spaces"],type:"object"},EnterpriseLayerId:{pattern:"^ely_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLayerSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},EnterpriseLocation:{additionalProperties:!1,properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["externalId","id","name","nodes","polygons","sortOrder","spaces","type"],type:"object"},EnterpriseLocationId:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLocationInstance:{additionalProperties:!1,description:"A locationInstance is a particular instace of an Enterprise Location that has some properties different from the parent. Eg, it may have different hours, or a slightly different name.\n\nA LocationInstance:\n- MUST have a parent, referring to an Enterprise Location.\n- MUST have a unique ID, for localization to work.\n- SHOULD have AT LEAST ONE polygon or node to anchor it in space.\n- SHOULD have AT LEAST ONE other Enterprise Location property set.\n\nIt is otherwise a Partial<EnterpriseLocation>\n\nUsage examples:\n- A locationInstance for a location with a different externalId so a customer can identify them individually.\n- A locationInstance with different operationHours, that might indicate different hours for that particular entrace.",properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationInstanceId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},parent:{$ref:"#/definitions/EnterpriseLocationId"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["id","parent"],type:"object"},EnterpriseLocationInstanceId:{description:"An ID for an enterprise location instance",pattern:"^eli_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseStyles:{additionalProperties:{additionalProperties:!1,properties:{edgeOffset:{type:"number"},geometryAnchors:{items:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},type:"array"}},required:["geometryAnchors"],type:"object"},type:"object"},EnterpriseTexture:{additionalProperties:!1,properties:{bounds:{description:"Coordinates of the texture's bounding box in format: [minLon, minLat, maxLon, maxLat].",items:{type:"number"},maxItems:4,minItems:4,type:"array"},face:{$ref:"#/definitions/EnterpriseTextureFace",description:"Face of the polygon that the texture will be applied to.\n\n'top' means that the texture will be applied to the upward-pointing face of the polygon.\n\n'side' means that the texture will be applied to every side face of the polygon."},geometryAnchors:{description:"Anchors for the texture on the geometry of the polygon.",items:{$ref:"#/definitions/EnterpriseTextureGeometryAnchor"},minItems:1,type:"array"},offset:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls the starting position of the texture on the surface. The u value shifts the texture horizontally and v shifts vertically."},path:{description:"Path to the texture image. Must be either a PNG or JPG format.",type:"string"},repeat:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls how many times the texture repeats across the surface. The u value controls horizontal repetition and v controls vertical repetition."},rotation:{description:"Rotation of the texture in degrees clockwise.\n\nFor top textures this is relative to north. North is 0, east is 90.\n\nFor side textures this is relative to the upward direction, with 0 degrees being upright.",maximum:360,minimum:0,type:"number"},surface:{$ref:"#/definitions/EnterpriseTextureSurface",description:"Surface of the polygon that the texture will be applied to.\n\n'inside' means that the texture will only be applied to the interior surface of the polygon.\n\n'outside' means that the texture will only be applied to the exterior surface of the polygon.\n\n'both' means that the texture will be applied to both interior and exterior surfaces of the polygon."}},required:["repeat","offset","rotation","path","face","surface","bounds","geometryAnchors"],type:"object"},EnterpriseTextureFace:{enum:["top","side"],type:"string"},EnterpriseTextureGeometryAnchor:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},EnterpriseTextureSurface:{enum:["inside","outside","both"],type:"string"},EnterpriseTextureUV:{additionalProperties:!1,properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},EnterpriseVenue:{additionalProperties:!1,properties:{countrycode:{description:"The ISO 3166-1 alpha-2 country code of the venue, if known\n\nEg. `US` or `GB`",type:"string"},coverImage:{description:"The venue's cover image",format:"uri",type:"string"},defaultFloor:{$ref:"#/definitions/FloorId",description:"The venue's default floor"},defaultLanguage:{$ref:"#/definitions/Language"},defaultMap:{$ref:"#/definitions/FloorId",deprecated:"Use `defaultFloor` instead"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The venue's icon",format:"uri",type:"string"},languages:{items:{$ref:"#/definitions/Language"},type:"array"},logo:{description:"The venue's logo",format:"uri",type:"string"},mappedinWebUrl:{description:"The base URL for Mappedin Web for this venue\n\nBetter name?",type:"string"},name:{type:"string"},operationHours:{description:"When this venue is open.",items:{$ref:"#/definitions/OperationHours"},type:"array"},slug:{type:"string"},topLocations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},tzid:{description:"The venue's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",pattern:"^[A-Za-z0-9\\/_-]+$",type:"string"}},required:["defaultLanguage","externalId","languages","name","slug"],type:"object"},EntranceCollection:{$ref:"#/definitions/FeatureCollection%3CLineString%2CEntranceProperties%3E"},EntranceId:{pattern:"^e_[A-Za-z0-9_-]{8,}$",type:"string"},EntranceProperties:{additionalProperties:!1,properties:{details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/EntranceId"},isExterior:{type:"boolean"},metadata:{$ref:"#/definitions/Metadata"},node:{$ref:"#/definitions/NodeId"}},required:["id","externalId"],type:"object"},Facade:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/FacadeId"},spaces:{items:{$ref:"#/definitions/FacadeSpace"},minItems:1,type:"array"}},required:["id","spaces"],type:"object"},FacadeId:{pattern:"^fc_[A-Za-z0-9_-]{8,}$",type:"string"},FacadeSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},"Feature<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"}]},properties:{$ref:"#/definitions/ObstructionProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"},{$ref:"#/definitions/Point"}]},properties:{$ref:"#/definitions/SpaceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/MultiPolygon"},{type:"null"}]},properties:{$ref:"#/definitions/FloorProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<LineString,EntranceProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/EntranceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorImageProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorImageProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorTextProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorTextProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,NodeProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/NodeProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,TextAreaProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/TextAreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/FloorStackFootprintProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"FeatureCollection<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<LineString,EntranceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CLineString%2CEntranceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorImageProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorImageProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorTextProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorTextProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,NodeProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CNodeProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,TextAreaProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CTextAreaProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPolygon%2CFloorStackFootprintProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},FeatureCollectionType:{const:"FeatureCollection",description:"The type field used for a collection of GeoJSON features.",type:"string"},FeatureType:{const:"Feature",description:"The type field used for individual GeoJSON features.",type:"string"},FloatingFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},verticalOffset:{description:"The vertical offset of the text, in meters.",type:"number"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","rotation","text","verticalOffset","visible"],type:"object"},FloatingImageProperties:{additionalProperties:!1,properties:{height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the image, in meters, relative to the ground plane.",minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["height","path","rotation","verticalOffset","width"],type:"object"},FloatingTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the text area, in meters, relative to the ground plane.",minimum:0,type:"number"}},required:["align","maxHeight","maxWidth","rotation","verticalOffset"],type:"object"},FloorCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},FloorId:{description:"The m_ prefix is deprecated, from when floors were previously called maps. Use f_ as the prefix instead.",pattern:"^[mf]_[A-Za-z0-9_-]{8,}$",type:"string"},FloorImageFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorImageProperties%3E",description:"A collection of images to be displayed on a map. They are either attached to a polygon or are floating in space."},FloorImageProperties:{anyOf:[{$ref:"#/definitions/AnchoredImageProperties"},{$ref:"#/definitions/FloatingImageProperties"}]},FloorProperties:{additionalProperties:!1,properties:{elevation:{description:"The elevation of this map relative to other maps in the stack. Must be an integer.",type:"integer"},externalId:{description:"Use of this property as the name of the map is deprecated. Use the name property instead.",type:"string"},id:{$ref:"#/definitions/FloorId"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map, if it exists. Usually one or two characters (eg, 3, F1, L, etc.) For display in very small spaces, like a floor selector dropdown. Might line up with what is shown on elevator buttons in the physical world.",type:"string"},subtitle:{description:'A subtitle for the map, for display in larger spaces, usually beneath the full name. Provides additional context for what is actually on the map, if the name is not clear. For example, if the full name is "Level 1", the subtitle might be "Arrivals and Baggage Claim".\n\nShould be no more than a few words.',type:"string"}},required:["id","externalId","elevation"],type:"object"},FloorStack:{additionalProperties:!1,properties:{defaultFloor:{$ref:"#/definitions/FloorId",description:"The default floor to use when a floor is not specified."},externalId:{type:"string"},floors:{description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},footprint:{$ref:"#/definitions/FeatureCollection%3CPolygon%2CFloorStackFootprintProperties%3E",description:"Provides a footprint for the map stack based on the geometry of the maps it contains. This is useful for rendering a map stack without loading all of its maps."},id:{$ref:"#/definitions/FloorStackId"},maps:{deprecated:"Use `floors` instead.",description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map stack, if it exists. For display in small spaces, like a floor selector dropdown.",type:"string"},type:{description:"The type of MapStack, e.g. Building, Outdoor. Defaults to Building.",enum:["Building","Outdoor"],type:"string"}},required:["id","externalId","name","maps"],type:"object"},FloorStackFootprintProperties:{additionalProperties:{not:{}},type:"object"},FloorStackId:{description:"The mg_ prefix is deprecated, from when floor stacks were previously called map groups. Use fs_ as the prefix instead.",pattern:"^fs_[A-Za-z0-9_-]{8,}$",type:"string"},FloorStacks:{items:{$ref:"#/definitions/FloorStack"},type:"array"},FloorTextFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorTextProperties%3E",description:"A collection of text to be displayed on a map. They are either attached to a space or are floating."},FloorTextProperties:{anyOf:[{$ref:"#/definitions/AnchoredFloorTextProperties"},{$ref:"#/definitions/FloatingFloorTextProperties"}]},Hyperlink:{additionalProperties:!1,properties:{displayName:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Image:{additionalProperties:!1,properties:{altText:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Language:{additionalProperties:!1,properties:{code:{type:"string"},name:{type:"string"}},required:["name","code"],type:"object"},Latitude:{description:"A WGS 84-compatible latitude coordinate value.",maximum:90,minimum:-90,type:"number"},LineString:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON LineString geometry.",properties:{coordinates:{items:{$ref:"#/definitions/Position"},minItems:2,type:"array"},type:{const:"LineString",type:"string"}},required:["coordinates","type"],type:"object"},LineStringStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},lineStrings:{description:"The line strings which this style applies to.",items:{anyOf:[{$ref:"#/definitions/EntranceId"},{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},opacity:{maximum:1,minimum:0,type:"number"},width:{description:"The thickness of the line when rendered, in meters, measured from the center to the edge.",exclusiveMinimum:0,type:"number"}},required:["altitude","color","height","lineStrings","opacity","width"],type:"object"},LocalPosition:{description:"A position for a local coordinate system, measured in metres.",items:{type:"number"},maxItems:2,minItems:2,type:"array"},Location:{additionalProperties:!1,properties:{annotations:{items:{$ref:"#/definitions/LocationAnnotationMapping"},type:"array"},areas:{items:{$ref:"#/definitions/LocationAreaMapping"},type:"array"},categories:{items:{$ref:"#/definitions/CategoryId"},type:"array"},connections:{items:{$ref:"#/definitions/ConnectionId"},type:"array"},description:{type:"string"},entrances:{items:{$ref:"#/definitions/LocationEntranceMapping"},type:"array"},externalId:{type:"string"},icon:{description:"The location's icon, one of picture/category/logo",format:"uri",type:"string"},id:{$ref:"#/definitions/LocationId"},links:{description:"Web links for the location",items:{$ref:"#/definitions/LocationLink"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},obstructions:{items:{$ref:"#/definitions/LocationObstructionMapping"},type:"array"},openingHoursSpecification:{description:"The location's opening hours",items:{$ref:"#/definitions/OpeningHoursSpecification"},type:"array"},phone:{type:"string"},pictures:{description:"The location's pictures",items:{$ref:"#/definitions/LocationPicture"},type:"array"},social:{description:"The location's social media links.",items:{$ref:"#/definitions/LocationSocial"},type:"array"},spaces:{items:{$ref:"#/definitions/LocationSpaceMapping"},type:"array"},website:{$ref:"#/definitions/LocationLink",description:"The location's website"}},required:["id","name","categories","spaces","obstructions","entrances","connections","annotations","areas","social","pictures","links","openingHoursSpecification"],type:"object"},LocationAnnotationMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AnnotationId"}},required:["floor","id"],type:"object"},LocationAreaMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AreaId"}},required:["floor","id"],type:"object"},LocationEntranceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/EntranceId"}},required:["floor","id"],type:"object"},LocationId:{description:"An ID for a location",pattern:"^loc_[A-Za-z0-9_-]{8,}$",type:"string"},LocationLink:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},LocationObstructionMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/ObstructionId"}},required:["floor","id"],type:"object"},LocationPicture:{additionalProperties:!1,description:"The location's pictures Single-field object, because it's plausible we might add captions or comments in the future",properties:{url:{format:"uri",type:"string"}},type:"object"},LocationSocial:{additionalProperties:!1,properties:{name:{description:"The name of the social media platform.",type:"string"},url:{description:"The URL of the social media profile",format:"uri",type:"string"}},required:["name","url"],type:"object"},LocationSpaceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},LocationState:{additionalProperties:!1,description:"The state of a location. Start and end dates are optional.",properties:{end:{description:"The start date of the state",format:"date",type:"string"},start:{description:"The start date of the state",format:"date",type:"string"},type:{description:"The type of the location state. Technically not limited, but should be one of the following:\n- closed-temporarily\n- new\n- pop-up\n- coming-soon\n- relocated",type:"string"}},required:["type"],type:"object"},Longitude:{description:"A WGS 84-compatible longitude coordinate value.",maximum:180,minimum:-180,type:"number"},ManifestCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/ManifestFeature"},maxItems:1,minItems:1,type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},ManifestFeature:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/ManifestProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},ManifestFile:{additionalProperties:!1,properties:{name:{type:"string"},type:{const:"file",type:"string"}},required:["type","name"],type:"object"},ManifestFolder:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/ManifestFile"},minItems:1,type:"array"},name:{type:"string"},type:{const:"folder",type:"string"}},required:["type","name","children"],type:"object"},ManifestProperties:{additionalProperties:!1,properties:{folder_struct:{items:{anyOf:[{$ref:"#/definitions/ManifestFolder"},{$ref:"#/definitions/ManifestFile"}]},type:"array"},language:{description:"The RFC 5646 language tag of the MVF. https://datatracker.ietf.org/doc/html/rfc5646",examples:["en-US"],type:"string"},map:{description:"The identifier of the map that this MVF is for.",type:"string"},name:{type:"string"},naturalBearing:{description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"',maximum:360,minimum:0,type:"number"},org_id:{type:"string"},time:{description:"An ISO 8601 date-time string, including timezone offset.",format:"date-time",type:"string"},tzid:{description:"The map's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",examples:["America/New_York"],pattern:"^[A-Za-z0-9_-]+\\/[A-Za-z0-9_-]+$",type:"string"},version:{const:"2.0.0",type:"string"}},required:["name","folder_struct","version","time"],type:"object"},Maps:{deprecated:"This is only present on `map.geojson` which is deprecated. Use\nthe collection on `floor.geojson` instead.",items:{$ref:"#/definitions/FloorProperties"},type:"array"},Material:{additionalProperties:!1,description:"The color and/or texture that should be applied to an instance of a Shape.\n\nIf both a color and a texture are provided, the color will be applied to the texture via a multiply operation. If neither are provided, the shape will be white.",properties:{color:{description:"The color of this mateial as a hex code.",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},texture:{$ref:"#/definitions/Texture"}},type:"object"},Metadata:{additionalProperties:{},description:"Can be any extra metadata that is not part of the main MVF spec. Presence of any key or value is not guaranteed. Values are expected to be JSON-serializable.",type:"object"},ModelInstance:{additionalProperties:!1,description:"An instance of a 3D model.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},path:{description:"The path to this asset, relative to the MVF's models folder. Supports GLTF and OBJ.",minLength:1,type:"string"},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","path","position","rotation","scale"],type:"object"},ModelInstanceCollection:{additionalProperties:{$ref:"#/definitions/ModelInstance"},description:"A map of model instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},MultiPolygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry.",properties:{coordinates:{items:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:"array"},type:{const:"MultiPolygon",type:"string"}},required:["coordinates","type"],type:"object"},NodeCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CNodeProperties%3E"},NodeId:{pattern:"^n_[A-Za-z0-9_-]{8,}$",type:"string"},NodeProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},floor:{$ref:"#/definitions/FloorId",description:"The ID of the floor this node is found on."},id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId",deprecated:"use `floor` instead.",description:"The ID of the floor this node is found on."},neighbors:{description:"A list of nodes that can be navigated to from this node.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},weight:{description:"The cost of navigating to this node.",minimum:0,type:"number"}},required:["id","weight"],type:"object"},type:"array"},preventSmoothing:{description:"Flag that may optionally indicate that a node is part of a custom path network rather than auto generated and should not be removed during smoothing/simplifcation.",type:"boolean"},space:{description:"The IDs of any spaces this node may be contained within.",items:{$ref:"#/definitions/SpaceId"},type:"array"}},required:["id","externalId","map","space","neighbors"],type:"object"},ObstructionCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},ObstructionId:{pattern:"^o_[A-Za-z0-9_-]{8,}$",type:"string"},ObstructionProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this obstruction, if it is a polygon. This is undefined for line strings as this can be trivially derived."},details:{$ref:"#/definitions/Details"},entrances:{description:"A list of entrance IDs corresponding to entrances that can be used to navigate through this obstruction.",items:{$ref:"#/definitions/EntranceId"},type:"array"},externalId:{type:"string"},footprintComponent:{description:"Indicates whether this obstruction is considered part of the footprint of the building it is a part of. For example, an exterior wall would be considered part of the building footprint.",type:"boolean"},id:{$ref:"#/definitions/ObstructionId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"}},required:["id","externalId","entrances"],type:"object"},OpeningHoursSpecification:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.\n\nBehavioral notes:\n- if the \"opens\" property is not present, the location is closed, and the closes property is ignored (Schema.org style)\n- if opens/closes are both set to 00:00, the location is closed (Google style)\n- If special hours do not specifiy certain weekdays being open, those weekdays are closed.\n- Not specifying dayOfWeek is equivalent to specifying every day of the week.\n- we will omit the '@type' property when producing MVFs. But we won't reject 3rd party MVFs that include it.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of opening hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the opening hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the opening hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the opening hours start"},validFrom:{description:"The date the opening hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the opening hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},OperationHours:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of operation hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the operation hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the operation hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the operation hours start"},validFrom:{description:"The date the operation hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the operation hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},ParsedMVF:{additionalProperties:!1,properties:{annotation:{additionalProperties:{anyOf:[{$ref:"#/definitions/AnnotationCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},area:{additionalProperties:{anyOf:[{$ref:"#/definitions/AreaCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"category.json":{items:{$ref:"#/definitions/Category"},type:"array"},"connection.json":{$ref:"#/definitions/Connections"},enterprise:{$ref:"#/definitions/EnterpriseCollection"},entrance:{additionalProperties:{anyOf:[{$ref:"#/definitions/EntranceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},facade:{additionalProperties:{anyOf:[{$ref:"#/definitions/Facade"},{not:{}}]},propertyNames:{pattern:"^fs_[A-Za-z0-9_-]{8,}$"},type:"object"},"floor.geojson":{$ref:"#/definitions/FloorCollection"},floorImages:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorImageFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"floorstack.json":{$ref:"#/definitions/FloorStacks"},"location.json":{items:{$ref:"#/definitions/Location"},type:"array"},"manifest.geojson":{$ref:"#/definitions/ManifestCollection"},"map.geojson":{$ref:"#/definitions/Maps",deprecated:"Use `floor.geojson` instead."},"mapstack.geojson":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},"mapstack.json":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},modelInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ModelInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"node.geojson":{$ref:"#/definitions/NodeCollection"},obstruction:{additionalProperties:{anyOf:[{$ref:"#/definitions/ObstructionCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},shapeInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ShapeInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"shapes.json":{$ref:"#/definitions/ShapeCollection"},space:{additionalProperties:{anyOf:[{$ref:"#/definitions/SpaceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"styles.json":{$ref:"#/definitions/StyleCollection"},textAreas:{additionalProperties:{anyOf:[{$ref:"#/definitions/TextAreaFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"tileset.json":{$ref:"#/definitions/TilesetCollection"},window:{additionalProperties:{anyOf:[{$ref:"#/definitions/WindowCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"}},required:["manifest.geojson","mapstack.geojson","map.geojson","space","obstruction","connection.json","node.geojson","entrance"],type:"object"},Point:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Point geometry.",properties:{coordinates:{$ref:"#/definitions/Position"},type:{const:"Point",type:"string"}},required:["coordinates","type"],type:"object"},PointStyle:{additionalProperties:!1,properties:{points:{description:"The points which this style applies to.",items:{$ref:"#/definitions/SpaceId"},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the point.",type:"boolean"}},required:["points"],type:"object"},Polygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Polygon geometry.",properties:{coordinates:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:{const:"Polygon",type:"string"}},required:["coordinates","type"],type:"object"},PolygonStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},opacity:{maximum:1,minimum:0,type:"number"},polygons:{description:"The polygons which this style applies to.",items:{anyOf:[{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the polygon.",type:"boolean"}},required:["altitude","color","height","opacity","polygons"],type:"object"},Position:{description:"A valid WGS 84 position consisting of a longitude coodinate, followed by a latitude coordinate.",items:[{$ref:"#/definitions/Longitude"},{$ref:"#/definitions/Latitude"}],maxItems:2,minItems:2,type:"array"},Ring:{description:"A simple shape for part of a complex polygon",items:{$ref:"#/definitions/LocalPosition"},minItems:3,type:"array"},Shape:{description:"A 3D object made from extruded 2D polygons, that can be rendered to the map as a ShapeInstance.",items:{$ref:"#/definitions/ShapeComponent"},minItems:1,type:"array"},ShapeCollection:{additionalProperties:{$ref:"#/definitions/Shape"},description:"A group of Shapes, without any information as to how they will be placed in a scene.",propertyNames:{pattern:"^sh_[A-Za-z0-9_-]{8,}$"},type:"object"},ShapeComponent:{additionalProperties:!1,description:"A single extruded 2D polygon.",properties:{altitude:{description:"In metres.",type:"number"},geometry:{description:"Can contain holes, like GeoJSON.",items:{$ref:"#/definitions/Ring"},minItems:1,type:"array"},height:{description:"In metres.",exclusiveMinimum:0,type:"number"}},required:["geometry","altitude","height"],type:"object"},ShapeId:{pattern:"^sh_[A-Za-z0-9_-]{8,}$",type:"string"},ShapeInstance:{additionalProperties:!1,description:"An instance of a Shape.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},id:{$ref:"#/definitions/ShapeId",description:"The identifier of the Shape to be placed."},material:{$ref:"#/definitions/Material",description:"The color and/or texture to apply to this shape instance."},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","id","material","position","rotation","scale"],type:"object"},ShapeInstanceCollection:{additionalProperties:{$ref:"#/definitions/ShapeInstance"},description:"A map of shape instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},SiblingGroup:{additionalProperties:!1,properties:{label:{type:"string"},siblings:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"}},required:["label","siblings"],type:"object"},SpaceCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},SpaceId:{pattern:"^s_[A-Za-z0-9_-]{8,}$",type:"string"},SpaceProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this space, if it is a polygon. This is undefined for line string and point spaces as these can be trivially derived."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this space.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/SpaceId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"},tags:{description:"A list of tags that may apply to categorize the space, e.g. Void",items:{type:"string"},type:"array"}},required:["id","externalId","destinationNodes"],type:"object"},StyleCollection:{additionalProperties:{anyOf:[{$ref:"#/definitions/PolygonStyle"},{$ref:"#/definitions/LineStringStyle"},{$ref:"#/definitions/PointStyle"},{not:{}}]},description:"A map of layer styles, where keys represent the group IDs of each style.",type:"object"},TextAreaAlignment:{enum:["near","center"],type:"string"},TextAreaFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CTextAreaProperties%3E",description:"A collection of text areas to be displayed on a map. They are either attached to a polygon or are floating in space."},TextAreaProperties:{anyOf:[{$ref:"#/definitions/AnchoredTextAreaProperties"},{$ref:"#/definitions/FloatingTextAreaProperties"}]},Texture:{additionalProperties:!1,description:"A reference to an image texture and how it should be applied to a Component.",properties:{path:{description:"The path to this asset, relative to the MVF's images folder.",minLength:1,type:"string"},repeat:{$ref:"#/definitions/TextureRepeat"}},required:["path"],type:"object"},TextureRepeat:{additionalProperties:!1,description:"How a texture should be placed on a Component.",properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},TilesetCollection:{additionalProperties:!1,description:"Collection of tileset styles",properties:{default:{$ref:"#/definitions/TilesetStyle",description:"Default tileset style that should be used"},others:{description:"Additional tileset styles that can be used",items:{$ref:"#/definitions/TilesetStyle"},type:"array"}},required:["default"],type:"object"},TilesetStyle:{additionalProperties:!1,description:"A tileset style definition",properties:{key:{description:"Unique identifier for this tileset style",minLength:1,type:"string"},name:{description:"Display name for this tileset style",minLength:1,type:"string"},url:{description:"URL to the tileset style definition. This should be a JSON file matching the MapLibre style specification.",format:"uri",type:"string"}},required:["key","name","url"],type:"object"},Time:{description:"A time in the format of HH:MM:SS",pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",type:"string"},Vector3:{description:"A three-number tuple.",items:{type:"number"},maxItems:3,minItems:3,type:"array"},WindowCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/WindowProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},WindowId:{pattern:"^w_[A-Za-z0-9_-]{8,}$",type:"string"},WindowProperties:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/WindowId"}},required:["id"],type:"object"}}};var k_e=OB.default.default(new MB.default.default).compile(hv(wB));d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();var dt={};Pa(dt,{HasPropertyKey:()=>pae,IsArray:()=>wn,IsAsyncIterator:()=>MT,IsBigInt:()=>Jy,IsBoolean:()=>bc,IsDate:()=>Xu,IsFunction:()=>OT,IsIterator:()=>ET,IsNull:()=>_T,IsNumber:()=>Ui,IsObject:()=>Vt,IsRegExp:()=>Qy,IsString:()=>Kt,IsSymbol:()=>AT,IsUint8Array:()=>qa,IsUndefined:()=>br});d();function pae(e,t){return t in e}s(pae,"HasPropertyKey");function MT(e){return Vt(e)&&!wn(e)&&!qa(e)&&Symbol.asyncIterator in e}s(MT,"IsAsyncIterator");function wn(e){return Array.isArray(e)}s(wn,"IsArray");function Jy(e){return typeof e=="bigint"}s(Jy,"IsBigInt");function bc(e){return typeof e=="boolean"}s(bc,"IsBoolean");function Xu(e){return e instanceof globalThis.Date}s(Xu,"IsDate");function OT(e){return typeof e=="function"}s(OT,"IsFunction");function ET(e){return Vt(e)&&!wn(e)&&!qa(e)&&Symbol.iterator in e}s(ET,"IsIterator");function _T(e){return e===null}s(_T,"IsNull");function Ui(e){return typeof e=="number"}s(Ui,"IsNumber");function Vt(e){return typeof e=="object"&&e!==null}s(Vt,"IsObject");function Qy(e){return e instanceof globalThis.RegExp}s(Qy,"IsRegExp");function Kt(e){return typeof e=="string"}s(Kt,"IsString");function AT(e){return typeof e=="symbol"}s(AT,"IsSymbol");function qa(e){return e instanceof globalThis.Uint8Array}s(qa,"IsUint8Array");function br(e){return e===void 0}s(br,"IsUndefined");function dae(e){return e.map(t=>yv(t))}s(dae,"ArrayType");function fae(e){return new Date(e.getTime())}s(fae,"DateType");function mae(e){return new Uint8Array(e)}s(mae,"Uint8ArrayType");function hae(e){return new RegExp(e.source,e.flags)}s(hae,"RegExpType");function yae(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=yv(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=yv(e[r]);return t}s(yae,"ObjectType");function yv(e){return wn(e)?dae(e):Xu(e)?fae(e):qa(e)?mae(e):Qy(e)?hae(e):Vt(e)?yae(e):e}s(yv,"Visit");function or(e){return yv(e)}s(or,"Clone");function EB(e){return e.map(t=>eg(t))}s(EB,"CloneRest");function eg(e,t){return t===void 0?or(e):or({...t,...e})}s(eg,"CloneType");d();d();d();function gv(e){return He(e)&&Symbol.asyncIterator in e}s(gv,"IsAsyncIterator");function bv(e){return He(e)&&Symbol.iterator in e}s(bv,"IsIterator");function kT(e){return He(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}s(kT,"IsStandardObject");function vv(e){return e instanceof Promise}s(vv,"IsPromise");function Wn(e){return e instanceof Date&&Number.isFinite(e.getTime())}s(Wn,"IsDate");function _B(e){return e instanceof globalThis.Map}s(_B,"IsMap");function AB(e){return e instanceof globalThis.Set}s(AB,"IsSet");function ni(e){return ArrayBuffer.isView(e)}s(ni,"IsTypedArray");function Ef(e){return e instanceof globalThis.Uint8Array}s(Ef,"IsUint8Array");function Re(e,t){return t in e}s(Re,"HasPropertyKey");function He(e){return e!==null&&typeof e=="object"}s(He,"IsObject");function Ue(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}s(Ue,"IsArray");function vr(e){return e===void 0}s(vr,"IsUndefined");function Za(e){return e===null}s(Za,"IsNull");function Bs(e){return typeof e=="boolean"}s(Bs,"IsBoolean");function Me(e){return typeof e=="number"}s(Me,"IsNumber");function xv(e){return Number.isInteger(e)}s(xv,"IsInteger");function ln(e){return typeof e=="bigint"}s(ln,"IsBigInt");function ft(e){return typeof e=="string"}s(ft,"IsString");function vc(e){return typeof e=="function"}s(vc,"IsFunction");function Xa(e){return typeof e=="symbol"}s(Xa,"IsSymbol");function cn(e){return ln(e)||Bs(e)||Za(e)||Me(e)||ft(e)||Xa(e)||vr(e)}s(cn,"IsValueType");var Ft;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(a,l){return e.ExactOptionalPropertyTypes?l in a:a[l]!==void 0}s(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(a){let l=He(a);return e.AllowArrayObject?l:l&&!Ue(a)}s(r,"IsObjectLike"),e.IsObjectLike=r;function n(a){return r(a)&&!(a instanceof Date)&&!(a instanceof Uint8Array)}s(n,"IsRecordLike"),e.IsRecordLike=n;function o(a){return e.AllowNaN?Me(a):Number.isFinite(a)}s(o,"IsNumberLike"),e.IsNumberLike=o;function i(a){let l=vr(a);return e.AllowNullVoid?l||a===null:l}s(i,"IsVoidLike"),e.IsVoidLike=i})(Ft||(Ft={}));d();function gae(e){return globalThis.Object.freeze(e).map(t=>tg(t))}s(gae,"ImmutableArray");function bae(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=tg(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=tg(e[r]);return globalThis.Object.freeze(t)}s(bae,"ImmutableObject");function tg(e){return wn(e)?gae(e):Xu(e)?e:qa(e)?e:Qy(e)?e:Vt(e)?bae(e):e}s(tg,"Immutable");function Q(e,t){let r=t!==void 0?{...t,...e}:e;switch(Ft.InstanceMode){case"freeze":return tg(r);case"clone":return or(r);default:return r}}s(Q,"CreateType");d();var DT=class DT extends Error{constructor(t){super(t)}};s(DT,"TypeBoxError");var ke=DT;d();d();d();var sr=Symbol.for("TypeBox.Transform"),Ya=Symbol.for("TypeBox.Readonly"),qn=Symbol.for("TypeBox.Optional"),oi=Symbol.for("TypeBox.Hint"),q=Symbol.for("TypeBox.Kind");function kB(e){return Vt(e)&&e[Ya]==="Readonly"}s(kB,"IsReadonly");function $s(e){return Vt(e)&&e[qn]==="Optional"}s($s,"IsOptional");function FT(e){return vt(e,"Any")}s(FT,"IsAny");function Ka(e){return vt(e,"Array")}s(Ka,"IsArray");function rg(e){return vt(e,"AsyncIterator")}s(rg,"IsAsyncIterator");function LT(e){return vt(e,"BigInt")}s(LT,"IsBigInt");function RT(e){return vt(e,"Boolean")}s(RT,"IsBoolean");function ng(e){return vt(e,"Constructor")}s(ng,"IsConstructor");function vae(e){return vt(e,"Date")}s(vae,"IsDate");function og(e){return vt(e,"Function")}s(og,"IsFunction");function Yu(e){return vt(e,"Integer")}s(Yu,"IsInteger");function _r(e){return vt(e,"Intersect")}s(_r,"IsIntersect");function ig(e){return vt(e,"Iterator")}s(ig,"IsIterator");function vt(e,t){return Vt(e)&&q in e&&e[q]===t}s(vt,"IsKindOf");function Ja(e){return vt(e,"Literal")}s(Ja,"IsLiteral");function Ao(e){return vt(e,"MappedKey")}s(Ao,"IsMappedKey");function ar(e){return vt(e,"MappedResult")}s(ar,"IsMappedResult");function xc(e){return vt(e,"Never")}s(xc,"IsNever");function xae(e){return vt(e,"Not")}s(xae,"IsNot");function Iae(e){return vt(e,"Null")}s(Iae,"IsNull");function Ku(e){return vt(e,"Number")}s(Ku,"IsNumber");function Vr(e){return vt(e,"Object")}s(Vr,"IsObject");function Ju(e){return vt(e,"Promise")}s(Ju,"IsPromise");function NT(e){return vt(e,"Record")}s(NT,"IsRecord");function BT(e){return vt(e,"Ref")}s(BT,"IsRef");function $T(e){return vt(e,"RegExp")}s($T,"IsRegExp");function sg(e){return vt(e,"String")}s(sg,"IsString");function Sae(e){return vt(e,"Symbol")}s(Sae,"IsSymbol");function ko(e){return vt(e,"TemplateLiteral")}s(ko,"IsTemplateLiteral");function Cae(e){return vt(e,"This")}s(Cae,"IsThis");function _f(e){return Vt(e)&&sr in e}s(_f,"IsTransform");function Vi(e){return vt(e,"Tuple")}s(Vi,"IsTuple");function Pae(e){return vt(e,"Undefined")}s(Pae,"IsUndefined");function Et(e){return vt(e,"Union")}s(Et,"IsUnion");function Tae(e){return vt(e,"Uint8Array")}s(Tae,"IsUint8Array");function wae(e){return vt(e,"Unknown")}s(wae,"IsUnknown");function Mae(e){return vt(e,"Unsafe")}s(Mae,"IsUnsafe");function Oae(e){return vt(e,"Void")}s(Oae,"IsVoid");function Ic(e){return Vt(e)&&q in e&&Kt(e[q])}s(Ic,"IsKind");function zi(e){return FT(e)||Ka(e)||RT(e)||LT(e)||rg(e)||ng(e)||vae(e)||og(e)||Yu(e)||_r(e)||ig(e)||Ja(e)||Ao(e)||ar(e)||xc(e)||xae(e)||Iae(e)||Ku(e)||Vr(e)||Ju(e)||NT(e)||BT(e)||$T(e)||sg(e)||Sae(e)||ko(e)||Cae(e)||Vi(e)||Pae(e)||Et(e)||Tae(e)||wae(e)||Mae(e)||Oae(e)||Ic(e)}s(zi,"IsSchema");var N={};Pa(N,{IsAny:()=>RB,IsArray:()=>NB,IsAsyncIterator:()=>BB,IsBigInt:()=>$B,IsBoolean:()=>jB,IsConstructor:()=>GB,IsDate:()=>UB,IsFunction:()=>VB,IsInteger:()=>zB,IsIntersect:()=>HB,IsIterator:()=>WB,IsKind:()=>y$,IsKindOf:()=>ht,IsLiteral:()=>lg,IsLiteralBoolean:()=>Fae,IsLiteralNumber:()=>ZB,IsLiteralString:()=>qB,IsLiteralValue:()=>XB,IsMappedKey:()=>YB,IsMappedResult:()=>KB,IsNever:()=>JB,IsNot:()=>QB,IsNull:()=>e$,IsNumber:()=>t$,IsObject:()=>r$,IsOptional:()=>Dae,IsPromise:()=>n$,IsProperties:()=>VT,IsReadonly:()=>kae,IsRecord:()=>o$,IsRecursive:()=>Lae,IsRef:()=>i$,IsRegExp:()=>s$,IsSchema:()=>mt,IsString:()=>a$,IsSymbol:()=>l$,IsTemplateLiteral:()=>c$,IsThis:()=>u$,IsTransform:()=>Jt,IsTuple:()=>p$,IsUint8Array:()=>d$,IsUndefined:()=>Af,IsUnion:()=>zT,IsUnionLiteral:()=>Rae,IsUnknown:()=>f$,IsUnsafe:()=>m$,IsVoid:()=>h$,TypeGuardUnknownTypeError:()=>jT});d();var HT=class HT extends ke{};s(HT,"TypeGuardUnknownTypeError");var jT=HT,Eae=["Any","Array","AsyncIterator","BigInt","Boolean","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function DB(e){try{return new RegExp(e),!0}catch{return!1}}s(DB,"IsPattern");function GT(e){if(!Kt(e))return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}s(GT,"IsControlCharacterFree");function FB(e){return UT(e)||mt(e)}s(FB,"IsAdditionalProperties");function ag(e){return br(e)||Jy(e)}s(ag,"IsOptionalBigInt");function Zt(e){return br(e)||Ui(e)}s(Zt,"IsOptionalNumber");function UT(e){return br(e)||bc(e)}s(UT,"IsOptionalBoolean");function Rt(e){return br(e)||Kt(e)}s(Rt,"IsOptionalString");function _ae(e){return br(e)||Kt(e)&&GT(e)&&DB(e)}s(_ae,"IsOptionalPattern");function Aae(e){return br(e)||Kt(e)&&GT(e)}s(Aae,"IsOptionalFormat");function LB(e){return br(e)||mt(e)}s(LB,"IsOptionalSchema");function kae(e){return Vt(e)&&e[Ya]==="Readonly"}s(kae,"IsReadonly");function Dae(e){return Vt(e)&&e[qn]==="Optional"}s(Dae,"IsOptional");function RB(e){return ht(e,"Any")&&Rt(e.$id)}s(RB,"IsAny");function NB(e){return ht(e,"Array")&&e.type==="array"&&Rt(e.$id)&&mt(e.items)&&Zt(e.minItems)&&Zt(e.maxItems)&&UT(e.uniqueItems)&&LB(e.contains)&&Zt(e.minContains)&&Zt(e.maxContains)}s(NB,"IsArray");function BB(e){return ht(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Rt(e.$id)&&mt(e.items)}s(BB,"IsAsyncIterator");function $B(e){return ht(e,"BigInt")&&e.type==="bigint"&&Rt(e.$id)&&ag(e.exclusiveMaximum)&&ag(e.exclusiveMinimum)&&ag(e.maximum)&&ag(e.minimum)&&ag(e.multipleOf)}s($B,"IsBigInt");function jB(e){return ht(e,"Boolean")&&e.type==="boolean"&&Rt(e.$id)}s(jB,"IsBoolean");function GB(e){return ht(e,"Constructor")&&e.type==="Constructor"&&Rt(e.$id)&&wn(e.parameters)&&e.parameters.every(t=>mt(t))&&mt(e.returns)}s(GB,"IsConstructor");function UB(e){return ht(e,"Date")&&e.type==="Date"&&Rt(e.$id)&&Zt(e.exclusiveMaximumTimestamp)&&Zt(e.exclusiveMinimumTimestamp)&&Zt(e.maximumTimestamp)&&Zt(e.minimumTimestamp)&&Zt(e.multipleOfTimestamp)}s(UB,"IsDate");function VB(e){return ht(e,"Function")&&e.type==="Function"&&Rt(e.$id)&&wn(e.parameters)&&e.parameters.every(t=>mt(t))&&mt(e.returns)}s(VB,"IsFunction");function zB(e){return ht(e,"Integer")&&e.type==="integer"&&Rt(e.$id)&&Zt(e.exclusiveMaximum)&&Zt(e.exclusiveMinimum)&&Zt(e.maximum)&&Zt(e.minimum)&&Zt(e.multipleOf)}s(zB,"IsInteger");function VT(e){return Vt(e)&&Object.entries(e).every(([t,r])=>GT(t)&&mt(r))}s(VT,"IsProperties");function HB(e){return ht(e,"Intersect")&&!(Kt(e.type)&&e.type!=="object")&&wn(e.allOf)&&e.allOf.every(t=>mt(t)&&!Jt(t))&&Rt(e.type)&&(UT(e.unevaluatedProperties)||LB(e.unevaluatedProperties))&&Rt(e.$id)}s(HB,"IsIntersect");function WB(e){return ht(e,"Iterator")&&e.type==="Iterator"&&Rt(e.$id)&&mt(e.items)}s(WB,"IsIterator");function ht(e,t){return Vt(e)&&q in e&&e[q]===t}s(ht,"IsKindOf");function qB(e){return lg(e)&&Kt(e.const)}s(qB,"IsLiteralString");function ZB(e){return lg(e)&&Ui(e.const)}s(ZB,"IsLiteralNumber");function Fae(e){return lg(e)&&bc(e.const)}s(Fae,"IsLiteralBoolean");function lg(e){return ht(e,"Literal")&&Rt(e.$id)&&XB(e.const)}s(lg,"IsLiteral");function XB(e){return bc(e)||Ui(e)||Kt(e)}s(XB,"IsLiteralValue");function YB(e){return ht(e,"MappedKey")&&wn(e.keys)&&e.keys.every(t=>Ui(t)||Kt(t))}s(YB,"IsMappedKey");function KB(e){return ht(e,"MappedResult")&&VT(e.properties)}s(KB,"IsMappedResult");function JB(e){return ht(e,"Never")&&Vt(e.not)&&Object.getOwnPropertyNames(e.not).length===0}s(JB,"IsNever");function QB(e){return ht(e,"Not")&&mt(e.not)}s(QB,"IsNot");function e$(e){return ht(e,"Null")&&e.type==="null"&&Rt(e.$id)}s(e$,"IsNull");function t$(e){return ht(e,"Number")&&e.type==="number"&&Rt(e.$id)&&Zt(e.exclusiveMaximum)&&Zt(e.exclusiveMinimum)&&Zt(e.maximum)&&Zt(e.minimum)&&Zt(e.multipleOf)}s(t$,"IsNumber");function r$(e){return ht(e,"Object")&&e.type==="object"&&Rt(e.$id)&&VT(e.properties)&&FB(e.additionalProperties)&&Zt(e.minProperties)&&Zt(e.maxProperties)}s(r$,"IsObject");function n$(e){return ht(e,"Promise")&&e.type==="Promise"&&Rt(e.$id)&&mt(e.item)}s(n$,"IsPromise");function o$(e){return ht(e,"Record")&&e.type==="object"&&Rt(e.$id)&&FB(e.additionalProperties)&&Vt(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&DB(r[0])&&Vt(t.patternProperties)&&mt(t.patternProperties[r[0]])})(e)}s(o$,"IsRecord");function Lae(e){return Vt(e)&&oi in e&&e[oi]==="Recursive"}s(Lae,"IsRecursive");function i$(e){return ht(e,"Ref")&&Rt(e.$id)&&Kt(e.$ref)}s(i$,"IsRef");function s$(e){return ht(e,"RegExp")&&Rt(e.$id)&&Kt(e.source)&&Kt(e.flags)&&Zt(e.maxLength)&&Zt(e.minLength)}s(s$,"IsRegExp");function a$(e){return ht(e,"String")&&e.type==="string"&&Rt(e.$id)&&Zt(e.minLength)&&Zt(e.maxLength)&&_ae(e.pattern)&&Aae(e.format)}s(a$,"IsString");function l$(e){return ht(e,"Symbol")&&e.type==="symbol"&&Rt(e.$id)}s(l$,"IsSymbol");function c$(e){return ht(e,"TemplateLiteral")&&e.type==="string"&&Kt(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}s(c$,"IsTemplateLiteral");function u$(e){return ht(e,"This")&&Rt(e.$id)&&Kt(e.$ref)}s(u$,"IsThis");function Jt(e){return Vt(e)&&sr in e}s(Jt,"IsTransform");function p$(e){return ht(e,"Tuple")&&e.type==="array"&&Rt(e.$id)&&Ui(e.minItems)&&Ui(e.maxItems)&&e.minItems===e.maxItems&&(br(e.items)&&br(e.additionalItems)&&e.minItems===0||wn(e.items)&&e.items.every(t=>mt(t)))}s(p$,"IsTuple");function Af(e){return ht(e,"Undefined")&&e.type==="undefined"&&Rt(e.$id)}s(Af,"IsUndefined");function Rae(e){return zT(e)&&e.anyOf.every(t=>qB(t)||ZB(t))}s(Rae,"IsUnionLiteral");function zT(e){return ht(e,"Union")&&Rt(e.$id)&&Vt(e)&&wn(e.anyOf)&&e.anyOf.every(t=>mt(t))}s(zT,"IsUnion");function d$(e){return ht(e,"Uint8Array")&&e.type==="Uint8Array"&&Rt(e.$id)&&Zt(e.minByteLength)&&Zt(e.maxByteLength)}s(d$,"IsUint8Array");function f$(e){return ht(e,"Unknown")&&Rt(e.$id)}s(f$,"IsUnknown");function m$(e){return ht(e,"Unsafe")}s(m$,"IsUnsafe");function h$(e){return ht(e,"Void")&&e.type==="void"&&Rt(e.$id)}s(h$,"IsVoid");function y$(e){return Vt(e)&&q in e&&Kt(e[q])&&!Eae.includes(e[q])}s(y$,"IsKind");function mt(e){return Vt(e)&&(RB(e)||NB(e)||jB(e)||$B(e)||BB(e)||GB(e)||UB(e)||VB(e)||zB(e)||HB(e)||WB(e)||lg(e)||YB(e)||KB(e)||JB(e)||QB(e)||e$(e)||t$(e)||r$(e)||n$(e)||o$(e)||i$(e)||s$(e)||a$(e)||l$(e)||c$(e)||u$(e)||p$(e)||Af(e)||zT(e)||d$(e)||f$(e)||m$(e)||h$(e)||y$(e))}s(mt,"IsSchema");d();var WT="(true|false)",cg="(0|[1-9][0-9]*)",qT="(.*)",Nae="(?!.*)",tke="^".concat(WT,"$"),Qa="^".concat(cg,"$"),el="^".concat(qT,"$"),g$="^".concat(Nae,"$");d();var Zn={};Pa(Zn,{Clear:()=>$ae,Delete:()=>jae,Entries:()=>Bae,Get:()=>Vae,Has:()=>Gae,Set:()=>Uae});d();var kf=new Map;function Bae(){return new Map(kf)}s(Bae,"Entries");function $ae(){return kf.clear()}s($ae,"Clear");function jae(e){return kf.delete(e)}s(jae,"Delete");function Gae(e){return kf.has(e)}s(Gae,"Has");function Uae(e,t){kf.set(e,t)}s(Uae,"Set");function Vae(e){return kf.get(e)}s(Vae,"Get");var zr={};Pa(zr,{Clear:()=>Hae,Delete:()=>Wae,Entries:()=>zae,Get:()=>Xae,Has:()=>qae,Set:()=>Zae});d();var Df=new Map;function zae(){return new Map(Df)}s(zae,"Entries");function Hae(){return Df.clear()}s(Hae,"Clear");function Wae(e){return Df.delete(e)}s(Wae,"Delete");function qae(e){return Df.has(e)}s(qae,"Has");function Zae(e,t){Df.set(e,t)}s(Zae,"Set");function Xae(e){return Df.get(e)}s(Xae,"Get");d();function b$(e,t){return e.includes(t)}s(b$,"SetIncludes");function v$(e){return[...new Set(e)]}s(v$,"SetDistinct");function Yae(e,t){return e.filter(r=>t.includes(r))}s(Yae,"SetIntersect");function Kae(e,t){return e.reduce((r,n)=>Yae(r,n),t)}s(Kae,"SetIntersectManyResolve");function x$(e){return e.length===1?e[0]:e.length>1?Kae(e.slice(1),e[0]):[]}s(x$,"SetIntersectMany");function I$(e){let t=[];for(let r of e)t.push(...r);return t}s(I$,"SetUnionMany");d();function Sc(e){return Q({[q]:"Any"},e)}s(Sc,"Any");d();function Iv(e,t){return Q({[q]:"Array",type:"array",items:e},t)}s(Iv,"Array");d();function Sv(e,t){return Q({[q]:"AsyncIterator",type:"AsyncIterator",items:e},t)}s(Sv,"AsyncIterator");d();d();d();function Jae(e,t){let{[t]:r,...n}=e;return n}s(Jae,"DiscardKey");function Pr(e,t){return t.reduce((r,n)=>Jae(r,n),e)}s(Pr,"Discard");d();function Nt(e){return Q({[q]:"Never",not:{}},e)}s(Nt,"Never");d();d();function xt(e){return Q({[q]:"MappedResult",properties:e})}s(xt,"MappedResult");d();d();function Cv(e,t,r){return Q({[q]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}s(Cv,"Constructor");d();function Cc(e,t,r){return Q({[q]:"Function",type:"Function",parameters:e,returns:t},r)}s(Cc,"Function");d();d();d();d();function ug(e,t){return Q({[q]:"Union",anyOf:e},t)}s(ug,"UnionCreate");function Qae(e){return e.some(t=>$s(t))}s(Qae,"IsUnionOptional");function S$(e){return e.map(t=>$s(t)?ele(t):t)}s(S$,"RemoveOptionalFromRest");function ele(e){return Pr(e,[qn])}s(ele,"RemoveOptionalFromType");function tle(e,t){return Qae(e)?ho(ug(S$(e),t)):ug(S$(e),t)}s(tle,"ResolveUnion");function js(e,t){return e.length===0?Nt(t):e.length===1?Q(e[0],t):tle(e,t)}s(js,"UnionEvaluated");d();function Bt(e,t){return e.length===0?Nt(t):e.length===1?Q(e[0],t):ug(e,t)}s(Bt,"Union");d();d();d();var XT=class XT extends ke{};s(XT,"TemplateLiteralParserError");var Pv=XT;function rle(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}s(rle,"Unescape");function ZT(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}s(ZT,"IsNonEscaped");function tl(e,t){return ZT(e,t,"(")}s(tl,"IsOpenParen");function pg(e,t){return ZT(e,t,")")}s(pg,"IsCloseParen");function C$(e,t){return ZT(e,t,"|")}s(C$,"IsSeparator");function nle(e){if(!(tl(e,0)&&pg(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(tl(e,r)&&(t+=1),pg(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}s(nle,"IsGroup");function ole(e){return e.slice(1,e.length-1)}s(ole,"InGroup");function ile(e){let t=0;for(let r=0;r<e.length;r++)if(tl(e,r)&&(t+=1),pg(e,r)&&(t-=1),C$(e,r)&&t===0)return!0;return!1}s(ile,"IsPrecedenceOr");function sle(e){for(let t=0;t<e.length;t++)if(tl(e,t))return!0;return!1}s(sle,"IsPrecedenceAnd");function ale(e){let[t,r]=[0,0],n=[];for(let i=0;i<e.length;i++)if(tl(e,i)&&(t+=1),pg(e,i)&&(t-=1),C$(e,i)&&t===0){let a=e.slice(r,i);a.length>0&&n.push(Ff(a)),r=i+1}let o=e.slice(r);return o.length>0&&n.push(Ff(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}s(ale,"Or");function lle(e){function t(o,i){if(!tl(o,i))throw new Pv("TemplateLiteralParser: Index must point to open parens");let a=0;for(let l=i;l<o.length;l++)if(tl(o,l)&&(a+=1),pg(o,l)&&(a-=1),a===0)return[i,l];throw new Pv("TemplateLiteralParser: Unclosed group parens in expression")}s(t,"Group");function r(o,i){for(let a=i;a<o.length;a++)if(tl(o,a))return[i,a];return[i,o.length]}s(r,"Range");let n=[];for(let o=0;o<e.length;o++)if(tl(e,o)){let[i,a]=t(e,o),l=e.slice(i,a+1);n.push(Ff(l)),o=a}else{let[i,a]=r(e,o),l=e.slice(i,a);l.length>0&&n.push(Ff(l)),o=a-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}s(lle,"And");function Ff(e){return nle(e)?Ff(ole(e)):ile(e)?ale(e):sle(e)?lle(e):{type:"const",const:rle(e)}}s(Ff,"TemplateLiteralParse");function Lf(e){return Ff(e.slice(1,e.length-1))}s(Lf,"TemplateLiteralParseExact");var KT=class KT extends ke{};s(KT,"TemplateLiteralFiniteError");var YT=KT;function cle(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}s(cle,"IsNumberExpression");function ule(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}s(ule,"IsBooleanExpression");function ple(e){return e.type==="const"&&e.const===".*"}s(ple,"IsStringExpression");function Qu(e){return cle(e)||ple(e)?!1:ule(e)?!0:e.type==="and"?e.expr.every(t=>Qu(t)):e.type==="or"?e.expr.every(t=>Qu(t)):e.type==="const"?!0:(()=>{throw new YT("Unknown expression type")})()}s(Qu,"IsTemplateLiteralExpressionFinite");function Tv(e){let t=Lf(e.pattern);return Qu(t)}s(Tv,"IsTemplateLiteralFinite");d();var QT=class QT extends ke{};s(QT,"TemplateLiteralGenerateError");var JT=QT;function*P$(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let r of P$(e.slice(1)))yield"".concat(t).concat(r)}s(P$,"GenerateReduce");function*dle(e){return yield*P$(e.expr.map(t=>[...dg(t)]))}s(dle,"GenerateAnd");function*fle(e){for(let t of e.expr)yield*dg(t)}s(fle,"GenerateOr");function*mle(e){return yield e.const}s(mle,"GenerateConst");function*dg(e){return e.type==="and"?yield*dle(e):e.type==="or"?yield*fle(e):e.type==="const"?yield*mle(e):(()=>{throw new JT("Unknown expression")})()}s(dg,"TemplateLiteralExpressionGenerate");function Rf(e){let t=Lf(e.pattern);return Qu(t)?[...dg(t)]:[]}s(Rf,"TemplateLiteralGenerate");d();d();function At(e,t){return Q({[q]:"Literal",const:e,type:typeof e},t)}s(At,"Literal");d();function wv(e){return Q({[q]:"Boolean",type:"boolean"},e)}s(wv,"Boolean");d();function Nf(e){return Q({[q]:"BigInt",type:"bigint"},e)}s(Nf,"BigInt");d();function Gs(e){return Q({[q]:"Number",type:"number"},e)}s(Gs,"Number");d();function ii(e){return Q({[q]:"String",type:"string"},e)}s(ii,"String");function*hle(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield wv():t==="number"?yield Gs():t==="bigint"?yield Nf():t==="string"?yield ii():yield(()=>{let r=t.split("|").map(n=>At(n.trim()));return r.length===0?Nt():r.length===1?r[0]:js(r)})()}s(hle,"FromUnion");function*yle(e){if(e[1]!=="{"){let t=At("$"),r=ew(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=hle(e.slice(2,t)),n=ew(e.slice(t+1));return yield*[...r,...n]}yield At(e)}s(yle,"FromTerminal");function*ew(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=At(e.slice(0,t)),n=yle(e.slice(t));return yield*[r,...n]}yield At(e)}s(ew,"FromSyntax");function T$(e){return[...ew(e)]}s(T$,"TemplateLiteralSyntax");d();var nw=class nw extends ke{};s(nw,"TemplateLiteralPatternError");var tw=nw;function gle(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(gle,"Escape");function w$(e,t){return ko(e)?e.pattern.slice(1,e.pattern.length-1):Et(e)?"(".concat(e.anyOf.map(r=>w$(r,t)).join("|"),")"):Ku(e)?"".concat(t).concat(cg):Yu(e)?"".concat(t).concat(cg):LT(e)?"".concat(t).concat(cg):sg(e)?"".concat(t).concat(qT):Ja(e)?"".concat(t).concat(gle(e.const.toString())):RT(e)?"".concat(t).concat(WT):(()=>{throw new tw("Unexpected Kind '".concat(e[q],"'"))})()}s(w$,"Visit");function rw(e){return"^".concat(e.map(t=>w$(t,"")).join(""),"$")}s(rw,"TemplateLiteralPattern");d();function ep(e){let r=Rf(e).map(n=>At(n));return js(r)}s(ep,"TemplateLiteralToUnion");d();function Mv(e,t){let r=Kt(e)?rw(T$(e)):rw(e);return Q({[q]:"TemplateLiteral",type:"string",pattern:r},t)}s(Mv,"TemplateLiteral");function ble(e){return Rf(e).map(r=>r.toString())}s(ble,"FromTemplateLiteral");function vle(e){let t=[];for(let r of e)t.push(...yo(r));return t}s(vle,"FromUnion");function xle(e){return[e.toString()]}s(xle,"FromLiteral");function yo(e){return[...new Set(ko(e)?ble(e):Et(e)?vle(e.anyOf):Ja(e)?xle(e.const):Ku(e)?["[number]"]:Yu(e)?["[number]"]:[])]}s(yo,"IndexPropertyKeys");d();function Ile(e,t,r){let n={};for(let o of Object.getOwnPropertyNames(t))n[o]=Bf(e,yo(t[o]),r);return n}s(Ile,"FromProperties");function Sle(e,t,r){return Ile(e,t.properties,r)}s(Sle,"FromMappedResult");function M$(e,t,r){let n=Sle(e,t,r);return xt(n)}s(M$,"IndexFromMappedResult");function E$(e,t){return e.map(r=>_$(r,t))}s(E$,"FromRest");function Cle(e){return e.filter(t=>!xc(t))}s(Cle,"FromIntersectRest");function Ple(e,t){return Ov(Cle(E$(e,t)))}s(Ple,"FromIntersect");function Tle(e){return e.some(t=>xc(t))?[]:e}s(Tle,"FromUnionRest");function wle(e,t){return js(Tle(E$(e,t)))}s(wle,"FromUnion");function Mle(e,t){return t in e?e[t]:t==="[number]"?js(e):Nt()}s(Mle,"FromTuple");function Ole(e,t){return t==="[number]"?e:Nt()}s(Ole,"FromArray");function Ele(e,t){return t in e?e[t]:Nt()}s(Ele,"FromProperty");function _$(e,t){var r;return _r(e)?Ple(e.allOf,t):Et(e)?wle(e.anyOf,t):Vi(e)?Mle((r=e.items)!=null?r:[],t):Ka(e)?Ole(e.items,t):Vr(e)?Ele(e.properties,t):Nt()}s(_$,"IndexFromPropertyKey");function fg(e,t){return t.map(r=>_$(e,r))}s(fg,"IndexFromPropertyKeys");function O$(e,t){return js(fg(e,t))}s(O$,"FromSchema");function Bf(e,t,r){return ar(t)?M$(e,t,r):Ao(t)?A$(e,t,r):Q(zi(t)?O$(e,yo(t)):O$(e,t),r)}s(Bf,"Index");function _le(e,t,r){return{[t]:Bf(e,[t],or(r))}}s(_le,"MappedIndexPropertyKey");function Ale(e,t,r){return t.reduce((n,o)=>({...n,..._le(e,o,r)}),{})}s(Ale,"MappedIndexPropertyKeys");function kle(e,t,r){return Ale(e,t.keys,r)}s(kle,"MappedIndexProperties");function A$(e,t,r){let n=kle(e,t,r);return xt(n)}s(A$,"IndexFromMappedKey");d();function Ev(e,t){return Q({[q]:"Iterator",type:"Iterator",items:e},t)}s(Ev,"Iterator");d();function Dle(e){let t=[];for(let r in e)$s(e[r])||t.push(r);return t}s(Dle,"RequiredKeys");function Fle(e,t){let r=Dle(e),n=r.length>0?{[q]:"Object",type:"object",properties:e,required:r}:{[q]:"Object",type:"object",properties:e};return Q(n,t)}s(Fle,"_Object");var zt=Fle;d();function _v(e,t){return Q({[q]:"Promise",type:"Promise",item:e},t)}s(_v,"Promise");d();d();function Lle(e){return Q(Pr(e,[Ya]))}s(Lle,"RemoveReadonly");function Rle(e){return Q({...e,[Ya]:"Readonly"})}s(Rle,"AddReadonly");function Nle(e,t){return t===!1?Lle(e):Rle(e)}s(Nle,"ReadonlyWithFlag");function si(e,t){let r=t!=null?t:!0;return ar(e)?k$(e,r):Nle(e,r)}s(si,"Readonly");function Ble(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=si(e[n],t);return r}s(Ble,"FromProperties");function $le(e,t){return Ble(e.properties,t)}s($le,"FromMappedResult");function k$(e,t){let r=$le(e,t);return xt(r)}s(k$,"ReadonlyFromMappedResult");d();function Us(e,t){return Q(e.length>0?{[q]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[q]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}s(Us,"Tuple");function D$(e,t){return e in t?ai(e,t[e]):xt(t)}s(D$,"FromMappedResult");function jle(e){return{[e]:At(e)}}s(jle,"MappedKeyToKnownMappedResultProperties");function Gle(e){let t={};for(let r of e)t[r]=At(r);return t}s(Gle,"MappedKeyToUnknownMappedResultProperties");function Ule(e,t){return b$(t,e)?jle(e):Gle(t)}s(Ule,"MappedKeyToMappedResultProperties");function Vle(e,t){let r=Ule(e,t);return D$(e,r)}s(Vle,"FromMappedKey");function mg(e,t){return t.map(r=>ai(e,r))}s(mg,"FromRest");function zle(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=ai(e,t[n]);return r}s(zle,"FromProperties");function ai(e,t){var n;let r={...t};return $s(t)?ho(ai(e,Pr(t,[qn]))):kB(t)?si(ai(e,Pr(t,[Ya]))):ar(t)?D$(e,t.properties):Ao(t)?Vle(e,t.keys):ng(t)?Cv(mg(e,t.parameters),ai(e,t.returns),r):og(t)?Cc(mg(e,t.parameters),ai(e,t.returns),r):rg(t)?Sv(ai(e,t.items),r):ig(t)?Ev(ai(e,t.items),r):_r(t)?go(mg(e,t.allOf),r):Et(t)?Bt(mg(e,t.anyOf),r):Vi(t)?Us(mg(e,(n=t.items)!=null?n:[]),r):Vr(t)?zt(zle(e,t.properties),r):Ka(t)?Iv(ai(e,t.items),r):Ju(t)?_v(ai(e,t.item),r):t}s(ai,"FromSchemaType");function Hle(e,t){let r={};for(let n of e)r[n]=ai(n,t);return r}s(Hle,"MappedFunctionReturnType");function F$(e,t,r){let n=zi(e)?yo(e):e,o=t({[q]:"MappedKey",keys:n}),i=Hle(n,o);return zt(i,r)}s(F$,"Mapped");d();function Wle(e){return Q(Pr(e,[qn]))}s(Wle,"RemoveOptional");function qle(e){return Q({...e,[qn]:"Optional"})}s(qle,"AddOptional");function Zle(e,t){return t===!1?Wle(e):qle(e)}s(Zle,"OptionalWithFlag");function ho(e,t){let r=t!=null?t:!0;return ar(e)?L$(e,r):Zle(e,r)}s(ho,"Optional");function Xle(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ho(e[n],t);return r}s(Xle,"FromProperties");function Yle(e,t){return Xle(e.properties,t)}s(Yle,"FromMappedResult");function L$(e,t){let r=Yle(e,t);return xt(r)}s(L$,"OptionalFromMappedResult");d();function hg(e,t={}){let r=e.every(o=>Vr(o)),n=zi(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return Q(t.unevaluatedProperties===!1||zi(t.unevaluatedProperties)||r?{...n,[q]:"Intersect",type:"object",allOf:e}:{...n,[q]:"Intersect",allOf:e},t)}s(hg,"IntersectCreate");function Kle(e){return e.every(t=>$s(t))}s(Kle,"IsIntersectOptional");function Jle(e){return Pr(e,[qn])}s(Jle,"RemoveOptionalFromType");function R$(e){return e.map(t=>$s(t)?Jle(t):t)}s(R$,"RemoveOptionalFromRest");function Qle(e,t){return Kle(e)?ho(hg(R$(e),t)):hg(R$(e),t)}s(Qle,"ResolveIntersect");function Ov(e,t={}){if(e.length===0)return Nt(t);if(e.length===1)return Q(e[0],t);if(e.some(r=>_f(r)))throw new Error("Cannot intersect transform types");return Qle(e,t)}s(Ov,"IntersectEvaluated");d();function go(e,t){if(e.length===0)return Nt(t);if(e.length===1)return Q(e[0],t);if(e.some(r=>_f(r)))throw new Error("Cannot intersect transform types");return hg(e,t)}s(go,"Intersect");function N$(e){return e.map(t=>ow(t))}s(N$,"FromRest");function ece(e){return go(N$(e))}s(ece,"FromIntersect");function tce(e){return Bt(N$(e))}s(tce,"FromUnion");function rce(e){return ow(e)}s(rce,"FromPromise");function ow(e){return _r(e)?ece(e.allOf):Et(e)?tce(e.anyOf):Ju(e)?rce(e.item):e}s(ow,"AwaitedResolve");function B$(e,t){return Q(ow(e),t)}s(B$,"Awaited");d();d();d();d();function $$(e){let t=[];for(let r of e)t.push(Qr(r));return t}s($$,"FromRest");function nce(e){let t=$$(e);return I$(t)}s(nce,"FromIntersect");function oce(e){let t=$$(e);return x$(t)}s(oce,"FromUnion");function ice(e){return e.map((t,r)=>r.toString())}s(ice,"FromTuple");function sce(e){return["[number]"]}s(sce,"FromArray");function ace(e){return globalThis.Object.getOwnPropertyNames(e)}s(ace,"FromProperties");function lce(e){return iw?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}s(lce,"FromPatternProperties");function Qr(e){var t;return _r(e)?nce(e.allOf):Et(e)?oce(e.anyOf):Vi(e)?ice((t=e.items)!=null?t:[]):Ka(e)?sce(e.items):Vr(e)?ace(e.properties):NT(e)?lce(e.patternProperties):[]}s(Qr,"KeyOfPropertyKeys");var iw=!1;function rl(e){iw=!0;let t=Qr(e);iw=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}s(rl,"KeyOfPattern");function cce(e){return e.map(t=>t==="[number]"?Gs():At(t))}s(cce,"KeyOfPropertyKeysToRest");function Av(e,t){if(ar(e))return j$(e,t);{let r=Qr(e),n=cce(r),o=js(n);return Q(o,t)}}s(Av,"KeyOf");function uce(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Av(e[n],or(t));return r}s(uce,"FromProperties");function pce(e,t){return uce(e.properties,t)}s(pce,"FromMappedResult");function j$(e,t){let r=pce(e,t);return xt(r)}s(j$,"KeyOfFromMappedResult");d();function Pc(e){let t=Qr(e),r=fg(e,t);return t.map((n,o)=>[t[o],r[o]])}s(Pc,"KeyOfPropertyEntries");function dce(e){let t=[];for(let r of e)t.push(...Qr(r));return v$(t)}s(dce,"CompositeKeys");function fce(e){return e.filter(t=>!xc(t))}s(fce,"FilterNever");function mce(e,t){let r=[];for(let n of e)r.push(...fg(n,[t]));return fce(r)}s(mce,"CompositeProperty");function hce(e,t){let r={};for(let n of t)r[n]=Ov(mce(e,n));return r}s(hce,"CompositeProperties");function G$(e,t){let r=dce(e),n=hce(e,r);return zt(n,t)}s(G$,"Composite");d();d();function kv(e){return Q({[q]:"Date",type:"Date"},e)}s(kv,"Date");d();function Dv(e){return Q({[q]:"Null",type:"null"},e)}s(Dv,"Null");d();function Fv(e){return Q({[q]:"Symbol",type:"symbol"},e)}s(Fv,"Symbol");d();function Lv(e){return Q({[q]:"Undefined",type:"undefined"},e)}s(Lv,"Undefined");d();function Rv(e){return Q({[q]:"Uint8Array",type:"Uint8Array"},e)}s(Rv,"Uint8Array");d();function nl(e){return Q({[q]:"Unknown"},e)}s(nl,"Unknown");function yce(e){return e.map(t=>sw(t,!1))}s(yce,"FromArray");function gce(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=si(sw(e[r],!1));return t}s(gce,"FromProperties");function Nv(e,t){return t===!0?e:si(e)}s(Nv,"ConditionalReadonly");function sw(e,t){return MT(e)?Nv(Sc(),t):ET(e)?Nv(Sc(),t):wn(e)?si(Us(yce(e))):qa(e)?Rv():Xu(e)?kv():Vt(e)?Nv(zt(gce(e)),t):OT(e)?Nv(Cc([],nl()),t):br(e)?Lv():_T(e)?Dv():AT(e)?Fv():Jy(e)?Nf():Ui(e)?At(e):bc(e)?At(e):Kt(e)?At(e):zt({})}s(sw,"FromValue");function U$(e,t){return Q(sw(e,!0),t)}s(U$,"Const");d();function V$(e,t){return Us(e.parameters,t)}s(V$,"ConstructorParameters");d();function yg(e,t){return e.map(r=>Hi(r,t))}s(yg,"FromRest");function bce(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Hi(e[n],t);return r}s(bce,"FromProperties");function vce(e,t){return e.parameters=yg(e.parameters,t),e.returns=Hi(e.returns,t),e}s(vce,"FromConstructor");function xce(e,t){return e.parameters=yg(e.parameters,t),e.returns=Hi(e.returns,t),e}s(xce,"FromFunction");function Ice(e,t){return e.allOf=yg(e.allOf,t),e}s(Ice,"FromIntersect");function Sce(e,t){return e.anyOf=yg(e.anyOf,t),e}s(Sce,"FromUnion");function Cce(e,t){return br(e.items)||(e.items=yg(e.items,t)),e}s(Cce,"FromTuple");function Pce(e,t){return e.items=Hi(e.items,t),e}s(Pce,"FromArray");function Tce(e,t){return e.properties=bce(e.properties,t),e}s(Tce,"FromObject");function wce(e,t){return e.item=Hi(e.item,t),e}s(wce,"FromPromise");function Mce(e,t){return e.items=Hi(e.items,t),e}s(Mce,"FromAsyncIterator");function Oce(e,t){return e.items=Hi(e.items,t),e}s(Oce,"FromIterator");function Ece(e,t){let r=t.find(o=>o.$id===e.$ref);if(r===void 0)throw Error("Unable to dereference schema with $id ".concat(e.$ref));let n=Pr(r,["$id"]);return Hi(n,t)}s(Ece,"FromRef");function _ce(e,t){return ng(e)?vce(e,t):og(e)?xce(e,t):_r(e)?Ice(e,t):Et(e)?Sce(e,t):Vi(e)?Cce(e,t):Ka(e)?Pce(e,t):Vr(e)?Tce(e,t):Ju(e)?wce(e,t):rg(e)?Mce(e,t):ig(e)?Oce(e,t):BT(e)?Ece(e,t):e}s(_ce,"DerefResolve");function Hi(e,t){return _ce(eg(e),EB(t))}s(Hi,"Deref");d();function z$(e,t){if(br(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(i=>isNaN(i)).map(i=>e[i]),o=[...new Set(r)].map(i=>At(i));return Bt(o,{...t,[oi]:"Enum"})}s(z$,"Enum");d();d();d();var fw=class fw extends ke{};s(fw,"ExtendsResolverError");var lw=fw,Y;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(Y||(Y={}));function li(e){return e===Y.False?e:Y.True}s(li,"IntoBooleanResult");function $f(e){throw new lw(e)}s($f,"Throw");function Lr(e){return N.IsNever(e)||N.IsIntersect(e)||N.IsUnion(e)||N.IsUnknown(e)||N.IsAny(e)}s(Lr,"IsStructuralRight");function Rr(e,t){return N.IsNever(t)?K$(e,t):N.IsIntersect(t)?Bv(e,t):N.IsUnion(t)?dw(e,t):N.IsUnknown(t)?tj(e,t):N.IsAny(t)?pw(e,t):$f("StructuralRight")}s(Rr,"StructuralRight");function pw(e,t){return Y.True}s(pw,"FromAnyRight");function Ace(e,t){return N.IsIntersect(t)?Bv(e,t):N.IsUnion(t)&&t.anyOf.some(r=>N.IsAny(r)||N.IsUnknown(r))?Y.True:N.IsUnion(t)?Y.Union:N.IsUnknown(t)||N.IsAny(t)?Y.True:Y.Union}s(Ace,"FromAny");function kce(e,t){return N.IsUnknown(e)?Y.False:N.IsAny(e)?Y.Union:N.IsNever(e)?Y.True:Y.False}s(kce,"FromArrayRight");function Dce(e,t){return N.IsObject(t)&&$v(t)?Y.True:Lr(t)?Rr(e,t):N.IsArray(t)?li($t(e.items,t.items)):Y.False}s(Dce,"FromArray");function Fce(e,t){return Lr(t)?Rr(e,t):N.IsAsyncIterator(t)?li($t(e.items,t.items)):Y.False}s(Fce,"FromAsyncIterator");function Lce(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsBigInt(t)?Y.True:Y.False}s(Lce,"FromBigInt");function X$(e,t){return N.IsLiteralBoolean(e)||N.IsBoolean(e)?Y.True:Y.False}s(X$,"FromBooleanRight");function Rce(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsBoolean(t)?Y.True:Y.False}s(Rce,"FromBoolean");function Nce(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsConstructor(t)?e.parameters.length>t.parameters.length?Y.False:e.parameters.every((r,n)=>li($t(t.parameters[n],r))===Y.True)?li($t(e.returns,t.returns)):Y.False:Y.False}s(Nce,"FromConstructor");function Bce(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsDate(t)?Y.True:Y.False}s(Bce,"FromDate");function $ce(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsFunction(t)?e.parameters.length>t.parameters.length?Y.False:e.parameters.every((r,n)=>li($t(t.parameters[n],r))===Y.True)?li($t(e.returns,t.returns)):Y.False:Y.False}s($ce,"FromFunction");function Y$(e,t){return N.IsLiteral(e)&&dt.IsNumber(e.const)||N.IsNumber(e)||N.IsInteger(e)?Y.True:Y.False}s(Y$,"FromIntegerRight");function jce(e,t){return N.IsInteger(t)||N.IsNumber(t)?Y.True:Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):Y.False}s(jce,"FromInteger");function Bv(e,t){return t.allOf.every(r=>$t(e,r)===Y.True)?Y.True:Y.False}s(Bv,"FromIntersectRight");function Gce(e,t){return e.allOf.some(r=>$t(r,t)===Y.True)?Y.True:Y.False}s(Gce,"FromIntersect");function Uce(e,t){return Lr(t)?Rr(e,t):N.IsIterator(t)?li($t(e.items,t.items)):Y.False}s(Uce,"FromIterator");function Vce(e,t){return N.IsLiteral(t)&&t.const===e.const?Y.True:Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsString(t)?ej(e,t):N.IsNumber(t)?J$(e,t):N.IsInteger(t)?Y$(e,t):N.IsBoolean(t)?X$(e,t):Y.False}s(Vce,"FromLiteral");function K$(e,t){return Y.False}s(K$,"FromNeverRight");function zce(e,t){return Y.True}s(zce,"FromNever");function H$(e){let[t,r]=[e,0];for(;N.IsNot(t);)t=t.not,r+=1;return r%2===0?t:nl()}s(H$,"UnwrapTNot");function Hce(e,t){return N.IsNot(e)?$t(H$(e),t):N.IsNot(t)?$t(e,H$(t)):$f("Invalid fallthrough for Not")}s(Hce,"FromNot");function Wce(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsNull(t)?Y.True:Y.False}s(Wce,"FromNull");function J$(e,t){return N.IsLiteralNumber(e)||N.IsNumber(e)||N.IsInteger(e)?Y.True:Y.False}s(J$,"FromNumberRight");function qce(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsInteger(t)||N.IsNumber(t)?Y.True:Y.False}s(qce,"FromNumber");function bo(e,t){return Object.getOwnPropertyNames(e.properties).length===t}s(bo,"IsObjectPropertyCount");function W$(e){return $v(e)}s(W$,"IsObjectStringLike");function q$(e){return bo(e,0)||bo(e,1)&&"description"in e.properties&&N.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(N.IsString(e.properties.description.anyOf[0])&&N.IsUndefined(e.properties.description.anyOf[1])||N.IsString(e.properties.description.anyOf[1])&&N.IsUndefined(e.properties.description.anyOf[0]))}s(q$,"IsObjectSymbolLike");function aw(e){return bo(e,0)}s(aw,"IsObjectNumberLike");function Z$(e){return bo(e,0)}s(Z$,"IsObjectBooleanLike");function Zce(e){return bo(e,0)}s(Zce,"IsObjectBigIntLike");function Xce(e){return bo(e,0)}s(Xce,"IsObjectDateLike");function Yce(e){return $v(e)}s(Yce,"IsObjectUint8ArrayLike");function Kce(e){let t=Gs();return bo(e,0)||bo(e,1)&&"length"in e.properties&&li($t(e.properties.length,t))===Y.True}s(Kce,"IsObjectFunctionLike");function Jce(e){return bo(e,0)}s(Jce,"IsObjectConstructorLike");function $v(e){let t=Gs();return bo(e,0)||bo(e,1)&&"length"in e.properties&&li($t(e.properties.length,t))===Y.True}s($v,"IsObjectArrayLike");function Qce(e){let t=Cc([Sc()],Sc());return bo(e,0)||bo(e,1)&&"then"in e.properties&&li($t(e.properties.then,t))===Y.True}s(Qce,"IsObjectPromiseLike");function Q$(e,t){return $t(e,t)===Y.False||N.IsOptional(e)&&!N.IsOptional(t)?Y.False:Y.True}s(Q$,"Property");function Mn(e,t){return N.IsUnknown(e)?Y.False:N.IsAny(e)?Y.Union:N.IsNever(e)||N.IsLiteralString(e)&&W$(t)||N.IsLiteralNumber(e)&&aw(t)||N.IsLiteralBoolean(e)&&Z$(t)||N.IsSymbol(e)&&q$(t)||N.IsBigInt(e)&&Zce(t)||N.IsString(e)&&W$(t)||N.IsSymbol(e)&&q$(t)||N.IsNumber(e)&&aw(t)||N.IsInteger(e)&&aw(t)||N.IsBoolean(e)&&Z$(t)||N.IsUint8Array(e)&&Yce(t)||N.IsDate(e)&&Xce(t)||N.IsConstructor(e)&&Jce(t)||N.IsFunction(e)&&Kce(t)?Y.True:N.IsRecord(e)&&N.IsString(cw(e))?t[oi]==="Record"?Y.True:Y.False:N.IsRecord(e)&&N.IsNumber(cw(e))?bo(t,0)?Y.True:Y.False:Y.False}s(Mn,"FromObjectRight");function eue(e,t){return Lr(t)?Rr(e,t):N.IsRecord(t)?ci(e,t):N.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!N.IsOptional(t.properties[r]))return Y.False;if(N.IsOptional(t.properties[r]))return Y.True;if(Q$(e.properties[r],t.properties[r])===Y.False)return Y.False}return Y.True})():Y.False}s(eue,"FromObject");function tue(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)&&Qce(t)?Y.True:N.IsPromise(t)?li($t(e.item,t.item)):Y.False}s(tue,"FromPromise");function cw(e){return Qa in e.patternProperties?Gs():el in e.patternProperties?ii():$f("Unknown record key pattern")}s(cw,"RecordKey");function uw(e){return Qa in e.patternProperties?e.patternProperties[Qa]:el in e.patternProperties?e.patternProperties[el]:$f("Unable to get record value schema")}s(uw,"RecordValue");function ci(e,t){let[r,n]=[cw(t),uw(t)];return N.IsLiteralString(e)&&N.IsNumber(r)&&li($t(e,n))===Y.True?Y.True:N.IsUint8Array(e)&&N.IsNumber(r)||N.IsString(e)&&N.IsNumber(r)||N.IsArray(e)&&N.IsNumber(r)?$t(e,n):N.IsObject(e)?(()=>{for(let o of Object.getOwnPropertyNames(e.properties))if(Q$(n,e.properties[o])===Y.False)return Y.False;return Y.True})():Y.False}s(ci,"FromRecordRight");function rue(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?$t(uw(e),uw(t)):Y.False}s(rue,"FromRecord");function nue(e,t){let r=N.IsRegExp(e)?ii():e,n=N.IsRegExp(t)?ii():t;return $t(r,n)}s(nue,"FromRegExp");function ej(e,t){return N.IsLiteral(e)&&dt.IsString(e.const)||N.IsString(e)?Y.True:Y.False}s(ej,"FromStringRight");function oue(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsString(t)?Y.True:Y.False}s(oue,"FromString");function iue(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsSymbol(t)?Y.True:Y.False}s(iue,"FromSymbol");function sue(e,t){return N.IsTemplateLiteral(e)?$t(ep(e),t):N.IsTemplateLiteral(t)?$t(e,ep(t)):$f("Invalid fallthrough for TemplateLiteral")}s(sue,"FromTemplateLiteral");function aue(e,t){return N.IsArray(t)&&e.items!==void 0&&e.items.every(r=>$t(r,t.items)===Y.True)}s(aue,"IsArrayOfTuple");function lue(e,t){return N.IsNever(e)?Y.True:N.IsUnknown(e)?Y.False:N.IsAny(e)?Y.Union:Y.False}s(lue,"FromTupleRight");function cue(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)&&$v(t)||N.IsArray(t)&&aue(e,t)?Y.True:N.IsTuple(t)?dt.IsUndefined(e.items)&&!dt.IsUndefined(t.items)||!dt.IsUndefined(e.items)&&dt.IsUndefined(t.items)?Y.False:dt.IsUndefined(e.items)&&!dt.IsUndefined(t.items)||e.items.every((r,n)=>$t(r,t.items[n])===Y.True)?Y.True:Y.False:Y.False}s(cue,"FromTuple");function uue(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsUint8Array(t)?Y.True:Y.False}s(uue,"FromUint8Array");function pue(e,t){return Lr(t)?Rr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?ci(e,t):N.IsVoid(t)?mue(e,t):N.IsUndefined(t)?Y.True:Y.False}s(pue,"FromUndefined");function dw(e,t){return t.anyOf.some(r=>$t(e,r)===Y.True)?Y.True:Y.False}s(dw,"FromUnionRight");function due(e,t){return e.anyOf.every(r=>$t(r,t)===Y.True)?Y.True:Y.False}s(due,"FromUnion");function tj(e,t){return Y.True}s(tj,"FromUnknownRight");function fue(e,t){return N.IsNever(t)?K$(e,t):N.IsIntersect(t)?Bv(e,t):N.IsUnion(t)?dw(e,t):N.IsAny(t)?pw(e,t):N.IsString(t)?ej(e,t):N.IsNumber(t)?J$(e,t):N.IsInteger(t)?Y$(e,t):N.IsBoolean(t)?X$(e,t):N.IsArray(t)?kce(e,t):N.IsTuple(t)?lue(e,t):N.IsObject(t)?Mn(e,t):N.IsUnknown(t)?Y.True:Y.False}s(fue,"FromUnknown");function mue(e,t){return N.IsUndefined(e)||N.IsUndefined(e)?Y.True:Y.False}s(mue,"FromVoidRight");function hue(e,t){return N.IsIntersect(t)?Bv(e,t):N.IsUnion(t)?dw(e,t):N.IsUnknown(t)?tj(e,t):N.IsAny(t)?pw(e,t):N.IsObject(t)?Mn(e,t):N.IsVoid(t)?Y.True:Y.False}s(hue,"FromVoid");function $t(e,t){return N.IsTemplateLiteral(e)||N.IsTemplateLiteral(t)?sue(e,t):N.IsRegExp(e)||N.IsRegExp(t)?nue(e,t):N.IsNot(e)||N.IsNot(t)?Hce(e,t):N.IsAny(e)?Ace(e,t):N.IsArray(e)?Dce(e,t):N.IsBigInt(e)?Lce(e,t):N.IsBoolean(e)?Rce(e,t):N.IsAsyncIterator(e)?Fce(e,t):N.IsConstructor(e)?Nce(e,t):N.IsDate(e)?Bce(e,t):N.IsFunction(e)?$ce(e,t):N.IsInteger(e)?jce(e,t):N.IsIntersect(e)?Gce(e,t):N.IsIterator(e)?Uce(e,t):N.IsLiteral(e)?Vce(e,t):N.IsNever(e)?zce(e,t):N.IsNull(e)?Wce(e,t):N.IsNumber(e)?qce(e,t):N.IsObject(e)?eue(e,t):N.IsRecord(e)?rue(e,t):N.IsString(e)?oue(e,t):N.IsSymbol(e)?iue(e,t):N.IsTuple(e)?cue(e,t):N.IsPromise(e)?tue(e,t):N.IsUint8Array(e)?uue(e,t):N.IsUndefined(e)?pue(e,t):N.IsUnion(e)?due(e,t):N.IsUnknown(e)?fue(e,t):N.IsVoid(e)?hue(e,t):$f("Unknown left type operand '".concat(e[q],"'"))}s($t,"Visit");function Tc(e,t){return $t(e,t)}s(Tc,"ExtendsCheck");d();d();d();function yue(e,t,r,n,o){let i={};for(let a of globalThis.Object.getOwnPropertyNames(e))i[a]=jf(e[a],t,r,n,or(o));return i}s(yue,"FromProperties");function gue(e,t,r,n,o){return yue(e.properties,t,r,n,o)}s(gue,"FromMappedResult");function rj(e,t,r,n,o){let i=gue(e,t,r,n,o);return xt(i)}s(rj,"ExtendsFromMappedResult");function bue(e,t,r,n){let o=Tc(e,t);return o===Y.Union?Bt([r,n]):o===Y.True?r:n}s(bue,"ExtendsResolve");function jf(e,t,r,n,o){return ar(e)?rj(e,t,r,n,o):Ao(e)?Q(nj(e,t,r,n,o)):Q(bue(e,t,r,n),o)}s(jf,"Extends");function vue(e,t,r,n,o){return{[e]:jf(At(e),t,r,n,or(o))}}s(vue,"FromPropertyKey");function xue(e,t,r,n,o){return e.reduce((i,a)=>({...i,...vue(a,t,r,n,o)}),{})}s(xue,"FromPropertyKeys");function Iue(e,t,r,n,o){return xue(e.keys,t,r,n,o)}s(Iue,"FromMappedKey");function nj(e,t,r,n,o){let i=Iue(e,t,r,n,o);return xt(i)}s(nj,"ExtendsFromMappedKey");d();function Sue(e){return e.allOf.every(t=>ol(t))}s(Sue,"Intersect");function Cue(e){return e.anyOf.some(t=>ol(t))}s(Cue,"Union");function Pue(e){return!ol(e.not)}s(Pue,"Not");function ol(e){return e[q]==="Intersect"?Sue(e):e[q]==="Union"?Cue(e):e[q]==="Not"?Pue(e):e[q]==="Undefined"}s(ol,"ExtendsUndefinedCheck");d();function oj(e,t){return Gf(ep(e),t)}s(oj,"ExcludeFromTemplateLiteral");function Tue(e,t){let r=e.filter(n=>Tc(n,t)===Y.False);return r.length===1?r[0]:Bt(r)}s(Tue,"ExcludeRest");function Gf(e,t,r={}){return ko(e)?Q(oj(e,t),r):ar(e)?Q(ij(e,t),r):Q(Et(e)?Tue(e.anyOf,t):Tc(e,t)!==Y.False?Nt():e,r)}s(Gf,"Exclude");function wue(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Gf(e[n],t);return r}s(wue,"FromProperties");function Mue(e,t){return wue(e.properties,t)}s(Mue,"FromMappedResult");function ij(e,t){let r=Mue(e,t);return xt(r)}s(ij,"ExcludeFromMappedResult");d();d();d();function sj(e,t){return Uf(ep(e),t)}s(sj,"ExtractFromTemplateLiteral");function Oue(e,t){let r=e.filter(n=>Tc(n,t)!==Y.False);return r.length===1?r[0]:Bt(r)}s(Oue,"ExtractRest");function Uf(e,t,r){return ko(e)?Q(sj(e,t),r):ar(e)?Q(aj(e,t),r):Q(Et(e)?Oue(e.anyOf,t):Tc(e,t)!==Y.False?e:Nt(),r)}s(Uf,"Extract");function Eue(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Uf(e[n],t);return r}s(Eue,"FromProperties");function _ue(e,t){return Eue(e.properties,t)}s(_ue,"FromMappedResult");function aj(e,t){let r=_ue(e,t);return xt(r)}s(aj,"ExtractFromMappedResult");d();function lj(e,t){return Q(e.returns,t)}s(lj,"InstanceType");d();function cj(e){return Q({[q]:"Integer",type:"integer"},e)}s(cj,"Integer");d();d();d();function Aue(e,t,r){return{[e]:Wi(At(e),t,or(r))}}s(Aue,"MappedIntrinsicPropertyKey");function kue(e,t,r){return e.reduce((o,i)=>({...o,...Aue(i,t,r)}),{})}s(kue,"MappedIntrinsicPropertyKeys");function Due(e,t,r){return kue(e.keys,t,r)}s(Due,"MappedIntrinsicProperties");function uj(e,t,r){let n=Due(e,t,r);return xt(n)}s(uj,"IntrinsicFromMappedKey");function Fue(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}s(Fue,"ApplyUncapitalize");function Lue(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}s(Lue,"ApplyCapitalize");function Rue(e){return e.toUpperCase()}s(Rue,"ApplyUppercase");function Nue(e){return e.toLowerCase()}s(Nue,"ApplyLowercase");function Bue(e,t,r){let n=Lf(e.pattern);if(!Qu(n))return{...e,pattern:pj(e.pattern,t)};let a=[...dg(n)].map(p=>At(p)),l=dj(a,t),c=Bt(l);return Mv([c],r)}s(Bue,"FromTemplateLiteral");function pj(e,t){return typeof e=="string"?t==="Uncapitalize"?Fue(e):t==="Capitalize"?Lue(e):t==="Uppercase"?Rue(e):t==="Lowercase"?Nue(e):e:e.toString()}s(pj,"FromLiteralValue");function dj(e,t){return e.map(r=>Wi(r,t))}s(dj,"FromRest");function Wi(e,t,r={}){return Ao(e)?uj(e,t,r):ko(e)?Bue(e,t,r):Et(e)?Bt(dj(e.anyOf,t),r):Ja(e)?At(pj(e.const,t),r):Q(e,r)}s(Wi,"Intrinsic");function fj(e,t={}){return Wi(e,"Capitalize",t)}s(fj,"Capitalize");d();function mj(e,t={}){return Wi(e,"Lowercase",t)}s(mj,"Lowercase");d();function hj(e,t={}){return Wi(e,"Uncapitalize",t)}s(hj,"Uncapitalize");d();function yj(e,t={}){return Wi(e,"Uppercase",t)}s(yj,"Uppercase");d();function gj(e,t){return Q({[q]:"Not",not:e},t)}s(gj,"Not");d();d();d();function $ue(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Vf(e[o],t,or(r));return n}s($ue,"FromProperties");function jue(e,t,r){return $ue(e.properties,t,r)}s(jue,"FromMappedResult");function bj(e,t,r){let n=jue(e,t,r);return xt(n)}s(bj,"OmitFromMappedResult");function Gue(e,t){return e.map(r=>mw(r,t))}s(Gue,"FromIntersect");function Uue(e,t){return e.map(r=>mw(r,t))}s(Uue,"FromUnion");function Vue(e,t){let{[t]:r,...n}=e;return n}s(Vue,"FromProperty");function zue(e,t){return t.reduce((r,n)=>Vue(r,n),e)}s(zue,"FromProperties");function Hue(e,t){let r=Pr(e,[sr,"$id","required","properties"]),n=zue(e.properties,t);return zt(n,r)}s(Hue,"FromObject");function mw(e,t){return _r(e)?go(Gue(e.allOf,t)):Et(e)?Bt(Uue(e.anyOf,t)):Vr(e)?Hue(e,t):zt({})}s(mw,"OmitResolve");function Vf(e,t,r){if(Ao(t))return vj(e,t,r);if(ar(e))return bj(e,t,r);let n=zi(t)?yo(t):t;return Q({...mw(e,n),...r})}s(Vf,"Omit");function Wue(e,t,r){return{[t]:Vf(e,[t],or(r))}}s(Wue,"FromPropertyKey");function que(e,t,r){return t.reduce((n,o)=>({...n,...Wue(e,o,r)}),{})}s(que,"FromPropertyKeys");function Zue(e,t,r){return que(e,t.keys,r)}s(Zue,"FromMappedKey");function vj(e,t,r){let n=Zue(e,t,r);return xt(n)}s(vj,"OmitFromMappedKey");d();function xj(e,t){return Us(e.parameters,t)}s(xj,"Parameters");d();d();function Ij(e){return e.map(t=>Sj(t))}s(Ij,"FromRest");function Xue(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=ho(e[r]);return t}s(Xue,"FromProperties");function Yue(e){let t=Pr(e,[sr,"$id","required","properties"]),r=Xue(e.properties);return zt(r,t)}s(Yue,"FromObject");function Sj(e){return _r(e)?go(Ij(e.allOf)):Et(e)?Bt(Ij(e.anyOf)):Vr(e)?Yue(e):zt({})}s(Sj,"PartialResolve");function jv(e,t){return ar(e)?Cj(e,t):Q({...Sj(e),...t})}s(jv,"Partial");function Kue(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=jv(e[n],or(t));return r}s(Kue,"FromProperties");function Jue(e,t){return Kue(e.properties,t)}s(Jue,"FromMappedResult");function Cj(e,t){let r=Jue(e,t);return xt(r)}s(Cj,"PartialFromMappedResult");d();d();d();function Que(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=zf(e[o],t,or(r));return n}s(Que,"FromProperties");function epe(e,t,r){return Que(e.properties,t,r)}s(epe,"FromMappedResult");function Pj(e,t,r){let n=epe(e,t,r);return xt(n)}s(Pj,"PickFromMappedResult");function tpe(e,t){return e.map(r=>hw(r,t))}s(tpe,"FromIntersect");function rpe(e,t){return e.map(r=>hw(r,t))}s(rpe,"FromUnion");function npe(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}s(npe,"FromProperties");function ope(e,t){let r=Pr(e,[sr,"$id","required","properties"]),n=npe(e.properties,t);return zt(n,r)}s(ope,"FromObject");function hw(e,t){return _r(e)?go(tpe(e.allOf,t)):Et(e)?Bt(rpe(e.anyOf,t)):Vr(e)?ope(e,t):zt({})}s(hw,"PickResolve");function zf(e,t,r){if(Ao(t))return Tj(e,t,r);if(ar(e))return Pj(e,t,r);let n=zi(t)?yo(t):t;return Q({...hw(e,n),...r})}s(zf,"Pick");function ipe(e,t,r){return{[t]:zf(e,[t],or(r))}}s(ipe,"FromPropertyKey");function spe(e,t,r){return t.reduce((n,o)=>({...n,...ipe(e,o,r)}),{})}s(spe,"FromPropertyKeys");function ape(e,t,r){return spe(e,t.keys,r)}s(ape,"FromMappedKey");function Tj(e,t,r){let n=ape(e,t,r);return xt(n)}s(Tj,"PickFromMappedKey");d();function wj(e){return si(ho(e))}s(wj,"ReadonlyOptional");d();function tp(e,t,r){return Q({[q]:"Record",type:"object",patternProperties:{[e]:t}},r)}s(tp,"RecordCreateFromPattern");function yw(e,t,r){let n={};for(let o of e)n[o]=t;return zt(n,{...r,[oi]:"Record"})}s(yw,"RecordCreateFromKeys");function lpe(e,t,r){return Tv(e)?yw(yo(e),t,r):tp(e.pattern,t,r)}s(lpe,"FromTemplateLiteralKey");function cpe(e,t,r){return yw(yo(Bt(e)),t,r)}s(cpe,"FromUnionKey");function upe(e,t,r){return yw([e.toString()],t,r)}s(upe,"FromLiteralKey");function ppe(e,t,r){return tp(e.source,t,r)}s(ppe,"FromRegExpKey");function dpe(e,t,r){let n=br(e.pattern)?el:e.pattern;return tp(n,t,r)}s(dpe,"FromStringKey");function fpe(e,t,r){return tp(el,t,r)}s(fpe,"FromAnyKey");function mpe(e,t,r){return tp(g$,t,r)}s(mpe,"FromNeverKey");function hpe(e,t,r){return tp(Qa,t,r)}s(hpe,"FromIntegerKey");function ype(e,t,r){return tp(Qa,t,r)}s(ype,"FromNumberKey");function Mj(e,t,r={}){return Et(e)?cpe(e.anyOf,t,r):ko(e)?lpe(e,t,r):Ja(e)?upe(e.const,t,r):Yu(e)?hpe(e,t,r):Ku(e)?ype(e,t,r):$T(e)?ppe(e,t,r):sg(e)?dpe(e,t,r):FT(e)?fpe(e,t,r):xc(e)?mpe(e,t,r):Nt(r)}s(Mj,"Record");d();var gpe=0;function Oj(e,t={}){br(t.$id)&&(t.$id="T".concat(gpe++));let r=eg(e({[q]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,Q({[oi]:"Recursive",...r},t)}s(Oj,"Recursive");d();function Ej(e,t){if(Kt(e))return Q({[q]:"Ref",$ref:e},t);if(br(e.$id))throw new Error("Reference target type must specify an $id");return Q({[q]:"Ref",$ref:e.$id},t)}s(Ej,"Ref");d();function _j(e,t){let r=Kt(e)?new globalThis.RegExp(e):e;return Q({[q]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}s(_j,"RegExp");d();d();function Aj(e){return e.map(t=>kj(t))}s(Aj,"FromRest");function bpe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Pr(e[r],[qn]);return t}s(bpe,"FromProperties");function vpe(e){let t=Pr(e,[sr,"$id","required","properties"]),r=bpe(e.properties);return zt(r,t)}s(vpe,"FromObject");function kj(e){return _r(e)?go(Aj(e.allOf)):Et(e)?Bt(Aj(e.anyOf)):Vr(e)?vpe(e):zt({})}s(kj,"RequiredResolve");function Gv(e,t){return ar(e)?Dj(e,t):Q({...kj(e),...t})}s(Gv,"Required");function xpe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Gv(e[n],t);return r}s(xpe,"FromProperties");function Ipe(e,t){return xpe(e.properties,t)}s(Ipe,"FromMappedResult");function Dj(e,t){let r=Ipe(e,t);return xt(r)}s(Dj,"RequiredFromMappedResult");d();function Spe(e){var t;return _r(e)?e.allOf:Et(e)?e.anyOf:Vi(e)?(t=e.items)!=null?t:[]:[]}s(Spe,"RestResolve");function Fj(e){return Spe(e)}s(Fj,"Rest");d();function Lj(e,t){return Q(e.returns,t)}s(Lj,"ReturnType");d();function Rj(e){return JSON.parse(JSON.stringify(e))}s(Rj,"Strict");d();var vw=class vw{constructor(t){this.schema=t}Decode(t){return new bw(this.schema,t)}};s(vw,"TransformDecodeBuilder");var gw=vw,xw=class xw{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let i={Encode:s(a=>r[sr].Encode(t(a)),"Encode"),Decode:s(a=>this.decode(r[sr].Decode(a)),"Decode")};return{...r,[sr]:i}}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return{...r,[sr]:n}}Encode(t){return _f(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};s(xw,"TransformEncodeBuilder");var bw=xw;function Nj(e){return new gw(e)}s(Nj,"Transform");d();function Uv(e={}){var t;return Q({[q]:(t=e[q])!=null?t:"Unsafe"},e)}s(Uv,"Unsafe");d();function Bj(e){return Q({[q]:"Void",type:"void"},e)}s(Bj,"Void");d();var Iw={};Pa(Iw,{Any:()=>Sc,Array:()=>Iv,AsyncIterator:()=>Sv,Awaited:()=>B$,BigInt:()=>Nf,Boolean:()=>wv,Capitalize:()=>fj,Composite:()=>G$,Const:()=>U$,Constructor:()=>Cv,ConstructorParameters:()=>V$,Date:()=>kv,Deref:()=>Hi,Enum:()=>z$,Exclude:()=>Gf,Extends:()=>jf,Extract:()=>Uf,Function:()=>Cc,Index:()=>Bf,InstanceType:()=>lj,Integer:()=>cj,Intersect:()=>go,Iterator:()=>Ev,KeyOf:()=>Av,Literal:()=>At,Lowercase:()=>mj,Mapped:()=>F$,Never:()=>Nt,Not:()=>gj,Null:()=>Dv,Number:()=>Gs,Object:()=>zt,Omit:()=>Vf,Optional:()=>ho,Parameters:()=>xj,Partial:()=>jv,Pick:()=>zf,Promise:()=>_v,Readonly:()=>si,ReadonlyOptional:()=>wj,Record:()=>Mj,Recursive:()=>Oj,Ref:()=>Ej,RegExp:()=>_j,Required:()=>Gv,Rest:()=>Fj,ReturnType:()=>Lj,Strict:()=>Rj,String:()=>ii,Symbol:()=>Fv,TemplateLiteral:()=>Mv,Transform:()=>Nj,Tuple:()=>Us,Uint8Array:()=>Rv,Uncapitalize:()=>hj,Undefined:()=>Lv,Union:()=>Bt,Unknown:()=>nl,Unsafe:()=>Uv,Uppercase:()=>yj,Void:()=>Bj});d();var C=Iw;var Qt=s((e,t)=>C.Unsafe(C.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),"Ident"),On=Qt("g","GeometryId"),at=Qt("f","FloorId"),Sw=[On,at];d();d();var gg=C.Object({externalId:C.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:C.String({description:"The name of the entity."}),shortName:C.String({description:"A short name for the entity."}),description:C.String({description:"A description of the entity."}),icon:C.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),Cw=C.Partial(gg,{$id:"Details",description:"Additional information about a given entity."}),qi=C.Object({details:C.Optional(C.Ref(Cw))},{$id:"WithDetails"}),rp=s(e=>{let t=[...e].sort(),r=C.Pick(gg,e),n=C.Omit(gg,e);return C.Object({details:C.Intersect([r,C.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},"WithRequiredDetails"),Pw=[gg,Cw];d();d();var Tw=C.Record(C.String(),C.Unknown(),{$id:"Extra"}),Zi=C.Object({extra:C.Optional(C.Ref(Tw))}),ww=[Tw];d();d();var Hf=C.Object({geometryId:C.Ref(On),floorId:C.Ref(at)},{$id:"GeometryAnchor"}),Cpe=C.Object({geometryAnchor:C.Ref(Hf)}),np=s((e,t)=>C.Object({geometryAnchors:C.Array(C.Ref(Hf),e)},t),"WithGeometryAnchors"),Mw=[Hf];d();d();d();d();d();var Wf=C.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),qf=C.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),op=C.Tuple([C.Ref(Wf),C.Ref(qf)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),En=C.Object({type:C.Literal("Point"),coordinates:C.Ref(op)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),Vv=C.Object({type:C.Literal("MultiPoint"),coordinates:C.Array(C.Ref(op))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),zv=C.Object({type:C.Literal("LineString"),coordinates:C.Array(C.Ref(op),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),Hv=C.Object({type:C.Literal("MultiLineString"),coordinates:C.Array(C.Array(C.Ref(op),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),$j=C.Array(C.Ref(op),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),Ow=C.Array(C.Ref($j),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),Zf=C.Object({type:C.Literal("Polygon"),coordinates:C.Ref(Ow)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),Xf=C.Object({type:C.Literal("MultiPolygon"),coordinates:C.Array(C.Ref(Ow))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),un=s((e,t,r)=>C.Object({type:C.Literal("Feature"),geometry:e,properties:t},r),"Feature"),Xn=s((e,t,r)=>C.Object({type:C.Literal("FeatureCollection"),features:C.Array(e,r)},t),"FeatureCollection"),Ew=[Wf,qf,op,En,Vv,zv,Hv,$j,Ow,Zf,Xf];var jj=C.Intersect([C.Object({id:C.Ref(at),elevation:C.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:C.Optional(C.String({description:"The subtitle of the floor."}))}),qi],{$id:"FloorProperties"}),Gj=un(C.Union([C.Ref(Zf),C.Ref(Xf),C.Null()]),C.Ref(jj),{$id:"FloorFeature"}),Uj=Xn(C.Ref(Gj),{$id:"FloorCollection"}),Ppe=C.Object({floors:C.Ref(Uj)}),Vj={name:"core:floors",intoBundle:s(function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e==="floors.geojson")return{floors:r(t)}},"fromBundle"),schema:Ppe,references:[jj,Gj,Uj]};d();d();d();var _w=class _w{constructor(t){h(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};s(_w,"OptionIterator");var Wv=_w,Aw=class Aw{constructor(t){h(this,"_tag","Some");h(this,"_value");this._value=t}get value(){return this._value}isSome(){return!0}isSomeAnd(t){return t(this.value)}isNone(){return!1}equals(t){return t.isSome()&&t.value===this.value}expect(t){return this.value}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectNone(t){return this}map(t){return zj(t(this.value))}mapAsync(t){return t(this.value).then(r=>zj(r))}mapOr(t,r){return this.map(t).unwrapOr(r)}mapOrAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOr(r))}mapOrElse(t,r){return this.map(t).unwrapOrElse(r)}mapOrElseAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOrElse(r))}and(t){return t}andThen(t){return t(this.value)}andThenAsync(t){return t(this.value)}filter(t){return t(this.value)?this:wc()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?wc():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return pe(this.value)}okOrElse(t){return pe(this.value)}iter(){return new Wv(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?Yf([this.value,t.value]):wc()}zipWith(t,r){return t.isSome()?Yf(r(this.value,t.value)):wc()}static[Symbol.hasInstance](t){let r=t;return r!=null&&r._tag==="Some"}get[Symbol.toStringTag](){return"Some"}};s(Aw,"Some");var qv=Aw,kw=class kw{constructor(){h(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(t){return!1}isNone(){return!0}equals(t){return t.isNone()}expect(t){throw new Error(t)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(t){return this}inspectNone(t){return t(),this}map(t){return this}mapAsync(t){return Promise.resolve(this)}mapOr(t,r){return r}mapOrAsync(t,r){return Promise.resolve(r)}mapOrElse(t,r){return r()}mapOrElseAsync(t,r){return r()}and(t){return this}andThen(t){return this}andThenAsync(t){return Promise.resolve(this)}filter(t){return this}or(t){return t}orElse(t){return t()}xor(t){return t}toString(){return"None"}okOr(t){return ge(t)}okOrElse(t){return ge(t())}iter(){return new Wv(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}static[Symbol.hasInstance](t){let r=t;return r!=null&&r._tag==="None"}get[Symbol.toStringTag](){return"None"}};s(kw,"None");var Zv=kw,Yf=s(e=>new qv(e),"some"),wc=s(()=>new Zv,"none"),zj=s(e=>e instanceof qv||e instanceof Zv?e:e==null?wc():Yf(e),"option");var Lw=class Lw{constructor(t){h(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};s(Lw,"ResultIterator");var Xv=Lw,Rw=class Rw{constructor(t){h(this,"_tag","Ok");h(this,"_value");this._value=t}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(t){return t(this.value)}isErr(){return!1}isErrAnd(t){return!1}ok(){return Yf(this.value)}err(){return wc()}expect(t){return this.value}expectErr(t){throw new Error(t)}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectErr(){return this}map(t){return pe(t(this.value))}async mapAsync(t){return t(this.value).then(pe)}mapOr(t,r){return t(this.value)}async mapOrAsync(t,r){return t(this.value)}mapOrElse(t,r){return t(this.value)}async mapOrElseAsync(t,r){return t(this.value)}mapErr(t){return this}iter(){return new Xv(this.value)}[Symbol.iterator](){return this.iter()}and(t){return t}andThen(t){return t(this.value)}or(t){return this}orElse(t){return this}async andThenAsync(t){return t(this.value)}toString(){return"Ok(".concat(this.value,")")}static[Symbol.hasInstance](t){let r=t;return r!=null&&r._tag==="Ok"}get[Symbol.toStringTag](){return"Ok"}};s(Rw,"Ok");var Dw=Rw,Yv=class Yv{constructor(t){h(this,"_tag","Err");h(this,"_error");this._error=t}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(t){return!1}isErr(){return!0}isErrAnd(t){return t(this.error)}ok(){return wc()}err(){return Yf(this.error)}expect(t){throw new Error(t)}expectErr(t){return this.error}unwrap(){throw this.error}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(){return this}inspectErr(t){return t(this.error),this}map(t){return this}iter(){return new Xv(null)}[Symbol.iterator](){return this.iter()}async mapAsync(t){return this}mapOr(t,r){return r}async mapOrAsync(t,r){return r}mapOrElse(t,r){return r()}async mapOrElseAsync(t,r){return r()}mapErr(t){return new Yv(t(this.error))}and(t){return this}andThen(t){return this}async andThenAsync(t){return this}or(t){return t}orElse(t){return t(this.error)}toString(){return"Err(".concat(this.error,")")}static[Symbol.hasInstance](t){let r=t;return r!=null&&r._tag==="Err"}get[Symbol.toStringTag](){return"Err"}};s(Yv,"Err");var Fw=Yv,pe=s(e=>new Dw(e),"ok"),ge=s(e=>new Fw(e),"err");d();var Vs;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(Vs||(Vs={}));var Tpe=s(e=>{var t,r;return new Map((r=(t=e.floors)==null?void 0:t.features.map(n=>[n.properties.id,n]))!=null?r:[])},"createFloorMap"),il=s(e=>{let t=Tpe(e);return s(n=>{let o=t.get(n);return o==null?ge({kind:Vs.UnknownFloorError,properties:{floorId:n}}):pe(o)},"floorLookup")},"createFloorLookup");d();d();d();d();var fr=s(e=>C.Unsafe(e),"PartialRecord");d();var Qe=s(e=>Object.keys(e),"typedKeys");d();var Hj=s(e=>{if(e.floors==null)return ge({kind:Vs.FloorMissingError,properties:null});if(e.geometry==null)return ge({kind:Vs.GeometryMissingError,properties:null});let t=il(e);for(let r of Qe(e.geometry)){let n=t(r);if(n.isErr())return n}return pe(!0)},"validateGeometry");var Wj=C.Intersect([C.Object({id:C.Ref(On)}),qi],{$id:"GeometryProperties"}),qj=un(C.Union([C.Ref(En),C.Ref(Vv),C.Ref(zv),C.Ref(Hv),C.Ref(Zf),C.Ref(Xf)]),C.Ref(Wj),{$id:"GeometryFeature"}),Zj=Xn(C.Ref(qj),{$id:"GeometryCollection"}),wpe=C.Object({geometry:fr(C.Record(at,C.Ref(Zj),{additionalProperties:!1}))},{$id:"GeometrySchema"}),Mpe=/^geometry\/(.*)\.geojson$/,Xj={name:"core:geometry",schema:wpe,intoBundle:s(function*(e){if(e.geometry!=null)for(let t of Qe(e.geometry))yield{path:"geometry/".concat(t,".geojson"),contents:e.geometry[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Mpe))==null?void 0:o[1];if(n)return{geometry:{[n]:r(t)}}},"fromBundle"),references:[Wj,qj,Zj],integrityCheck:Hj};d();d();var It=s(e=>Object.entries(e),"typedEntries");var Ope=s(e=>{var r;let t=new Map;for(let[n,o]of It((r=e.geometry)!=null?r:{}))t.set(n,new Map(o==null?void 0:o.features.map(i=>[i.properties.id,i])));return t},"createLookupMap"),Ar=s(e=>{let t=Ope(e);return s((n,o)=>{let i=t.get(n);if(i==null)return ge({kind:Vs.UnknownFloorError,properties:{floorId:n}});let a=i.get(o);return a==null?ge({kind:Vs.UnknownGeometryError,properties:{floorId:n,geometryId:o}}):pe(a)},"geometryLookup")},"createGeometryLookup");d();var Nw=C.Object({type:C.Literal("file"),name:C.String({description:"The name of the file."})},{$id:"ManifestFile"}),Yj=C.Recursive(e=>C.Object({type:C.Literal("folder"),name:C.String({description:"The name of the folder."}),children:C.Array(C.Union([e,C.Ref(Nw)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),Kj=C.Object({name:C.String({description:"The name of the map."}),version:C.Literal("3.0.0",{description:"The version of the manifest."}),orgId:C.Optional(C.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:C.Optional(C.String({description:"The identifier of the map that this MVF is for."})),contents:C.Array(C.Union([C.Ref(Yj),C.Ref(Nw)]),{minItems:1,description:"The contents of the MVF bundle."}),time:C.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:C.Optional(C.Unsafe(C.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:C.Optional(C.Number({minimum:0,maximum:360,description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"'})),defaultFloor:C.Optional(C.Ref(at,{description:"The default floor ID of the map."})),language:C.Optional(C.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),Jj=Xn(un(En,C.Ref(Kj)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),Epe=C.Object({manifest:C.Ref(Jj)}),Qj={name:"core:manifest",intoBundle:s(function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e==="manifest.geojson")return{manifest:r(t)}},"fromBundle"),schema:Epe,references:[Nw,Yj,Kj,Jj]};var vo=C.Object({geometryId:C.Ref(On)},{$id:"WithGeometryId"}),Kv=C.Object({geometryIds:C.Array(C.Ref(On))},{$id:"WithGeometryIds"}),Bw=[vo,Kv];d();d();var eG=s((e,t)=>C.Unsafe(C.Transform(C.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),"SafeStringEnumSchema"),xo=s((e,t)=>{let r=eG(e,t),n=[...e,"unknown"],o=Object.freeze(Object.fromEntries([...e,"unknown"].map(i=>[i,i])));return{schema:r,values:n,record:o}},"SafeStringEnum");d();d();d();var bg;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(bg||(bg={}));var tG=s(e=>{var n;if(e.annotations==null)return pe(!0);let t=Ar(e),r=new Set(Qe((n=e.annotationSymbols)!=null?n:{}));for(let o of Qe(e.annotations)){let i=e.annotations[o];if(i!=null)for(let a of i){if(!r.has(a.symbolKey))return ge({kind:bg.AnnotationUnknownSymbolError,properties:{annotationId:a.id,symbolKey:a.symbolKey}});let l=t(o,a.geometryId);if(l.isErr())return l;if(l.value.geometry.type!=="Point")return ge({kind:bg.AnnotationNonPointGeometryError,properties:{annotationId:a.id,floorId:o,geometryId:a.geometryId}})}}return pe(!0)},"validateAnnotations");var rG=Qt("a","AnnotationId"),$w=C.Intersect([vo,C.Object({id:C.Ref(rG,{description:"The unique identifier for the annotation."}),externalId:C.Optional(C.String({description:"The external identifier for the annotation."})),symbolKey:C.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),nG=C.Object({url:C.String({format:"uri",description:"The URL for the symbol."}),name:C.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),_pe=C.Object({annotations:fr(C.Record(at,C.Array(C.Ref($w)),{additionalProperties:!1})),annotationSymbols:fr(C.Record(C.Index($w,["symbolKey"]),C.Ref(nG)))},{$id:"AnnotationsSchema"}),Ape=/^annotations\/(.*)\.json$/,oG={name:"ext:mvf-annotations",schema:_pe,intoBundle:s(function*(e){if(e.annotations!=null)for(let t of Qe(e.annotations))yield{path:"annotations/".concat(t,".json"),contents:e.annotations[t]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},"intoBundle"),fromBundle:s((e,t,r)=>{var o;if(e==="annotation-symbols.json")return{annotationSymbols:r(t)};let n=(o=e.match(Ape))==null?void 0:o[1];if(n)return{annotations:{[n]:r(t)}}},"fromBundle"),references:[rG,$w,nG],integrityCheck:tG};d();d();d();d();d();d();var Gw=class Gw extends ke{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}};s(Gw,"TypeSystemDuplicateTypeKind");var jw=Gw,Uw=class Uw extends ke{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}};s(Uw,"TypeSystemDuplicateFormat");var vg=Uw,Jv;(function(e){function t(n,o){if(zr.Has(n))throw new jw(n);return zr.Set(n,o),(i={})=>Uv({...i,[q]:n})}s(t,"Type"),e.Type=t;function r(n,o){if(Zn.Has(n))throw new vg(n);return Zn.Set(n,o),n}s(r,"Format"),e.Format=r})(Jv||(Jv={}));d();d();d();function kpe(e){switch(e.errorType){case Z.ArrayContains:return"Expected array to contain at least one matching value";case Z.ArrayMaxContains:return"Expected array to contain no more than ".concat(e.schema.maxContains," matching values");case Z.ArrayMinContains:return"Expected array to contain at least ".concat(e.schema.minContains," matching values");case Z.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(e.schema.maxItems);case Z.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(e.schema.minItems);case Z.ArrayUniqueItems:return"Expected array elements to be unique";case Z.Array:return"Expected array";case Z.AsyncIterator:return"Expected AsyncIterator";case Z.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(e.schema.exclusiveMaximum);case Z.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(e.schema.exclusiveMinimum);case Z.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(e.schema.maximum);case Z.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(e.schema.minimum);case Z.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(e.schema.multipleOf);case Z.BigInt:return"Expected bigint";case Z.Boolean:return"Expected boolean";case Z.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(e.schema.exclusiveMinimumTimestamp);case Z.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(e.schema.exclusiveMaximumTimestamp);case Z.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(e.schema.minimumTimestamp);case Z.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(e.schema.maximumTimestamp);case Z.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(e.schema.multipleOfTimestamp);case Z.Date:return"Expected Date";case Z.Function:return"Expected function";case Z.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(e.schema.exclusiveMaximum);case Z.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(e.schema.exclusiveMinimum);case Z.IntegerMaximum:return"Expected integer to be less or equal to ".concat(e.schema.maximum);case Z.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(e.schema.minimum);case Z.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(e.schema.multipleOf);case Z.Integer:return"Expected integer";case Z.IntersectUnevaluatedProperties:return"Unexpected property";case Z.Intersect:return"Expected all values to match";case Z.Iterator:return"Expected Iterator";case Z.Literal:return"Expected ".concat(typeof e.schema.const=="string"?"'".concat(e.schema.const,"'"):e.schema.const);case Z.Never:return"Never";case Z.Not:return"Value should not match";case Z.Null:return"Expected null";case Z.NumberExclusiveMaximum:return"Expected number to be less than ".concat(e.schema.exclusiveMaximum);case Z.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(e.schema.exclusiveMinimum);case Z.NumberMaximum:return"Expected number to be less or equal to ".concat(e.schema.maximum);case Z.NumberMinimum:return"Expected number to be greater or equal to ".concat(e.schema.minimum);case Z.NumberMultipleOf:return"Expected number to be a multiple of ".concat(e.schema.multipleOf);case Z.Number:return"Expected number";case Z.Object:return"Expected object";case Z.ObjectAdditionalProperties:return"Unexpected property";case Z.ObjectMaxProperties:return"Expected object to have no more than ".concat(e.schema.maxProperties," properties");case Z.ObjectMinProperties:return"Expected object to have at least ".concat(e.schema.minProperties," properties");case Z.ObjectRequiredProperty:return"Expected required property";case Z.Promise:return"Expected Promise";case Z.RegExp:return"Expected string to match regular expression";case Z.StringFormatUnknown:return"Unknown format '".concat(e.schema.format,"'");case Z.StringFormat:return"Expected string to match '".concat(e.schema.format,"' format");case Z.StringMaxLength:return"Expected string length less or equal to ".concat(e.schema.maxLength);case Z.StringMinLength:return"Expected string length greater or equal to ".concat(e.schema.minLength);case Z.StringPattern:return"Expected string to match '".concat(e.schema.pattern,"'");case Z.String:return"Expected string";case Z.Symbol:return"Expected symbol";case Z.TupleLength:return"Expected tuple to have ".concat(e.schema.maxItems||0," elements");case Z.Tuple:return"Expected tuple";case Z.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(e.schema.maxByteLength);case Z.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(e.schema.minByteLength);case Z.Uint8Array:return"Expected Uint8Array";case Z.Undefined:return"Expected undefined";case Z.Union:return"Expected union value";case Z.Void:return"Expected void";case Z.Kind:return"Expected kind '".concat(e.schema[q],"'");default:return"Unknown error type"}}s(kpe,"DefaultErrorFunction");var Dpe=kpe;function iG(){return Dpe}s(iG,"GetErrorFunction");d();var zw=class zw extends ke{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};s(zw,"TypeDereferenceError");var Vw=zw;function Fpe(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new Vw(e);return St(r,t)}s(Fpe,"Resolve");function ui(e,t){return!ft(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}s(ui,"Pushref");function St(e,t){return e[q]==="This"||e[q]==="Ref"?Fpe(e,t):e}s(St,"Deref");d();var Ww=class Ww extends ke{constructor(t){super("Unable to hash value"),this.value=t}};s(Ww,"ValueHashError");var Hw=Ww,Do;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(Do||(Do={}));var Kf=BigInt("14695981039346656037"),[Lpe,Rpe]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Npe=Array.from({length:256}).map((e,t)=>BigInt(t)),sG=new Float64Array(1),aG=new DataView(sG.buffer),lG=new Uint8Array(sG.buffer);function*Bpe(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}s(Bpe,"NumberToBytes");function $pe(e){_n(Do.Array);for(let t of e)Jf(t)}s($pe,"ArrayType");function jpe(e){_n(Do.Boolean),_n(e?1:0)}s(jpe,"BooleanType");function Gpe(e){_n(Do.BigInt),aG.setBigInt64(0,e);for(let t of lG)_n(t)}s(Gpe,"BigIntType");function Upe(e){_n(Do.Date),Jf(e.getTime())}s(Upe,"DateType");function Vpe(e){_n(Do.Null)}s(Vpe,"NullType");function zpe(e){_n(Do.Number),aG.setFloat64(0,e);for(let t of lG)_n(t)}s(zpe,"NumberType");function Hpe(e){_n(Do.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Jf(t),Jf(e[t])}s(Hpe,"ObjectType");function Wpe(e){_n(Do.String);for(let t=0;t<e.length;t++)for(let r of Bpe(e.charCodeAt(t)))_n(r)}s(Wpe,"StringType");function qpe(e){_n(Do.Symbol),Jf(e.description)}s(qpe,"SymbolType");function Zpe(e){_n(Do.Uint8Array);for(let t=0;t<e.length;t++)_n(e[t])}s(Zpe,"Uint8ArrayType");function Xpe(e){return _n(Do.Undefined)}s(Xpe,"UndefinedType");function Jf(e){if(Ue(e))return $pe(e);if(Bs(e))return jpe(e);if(ln(e))return Gpe(e);if(Wn(e))return Upe(e);if(Za(e))return Vpe(e);if(Me(e))return zpe(e);if(He(e))return Hpe(e);if(ft(e))return Wpe(e);if(Xa(e))return qpe(e);if(Ef(e))return Zpe(e);if(vr(e))return Xpe(e);throw new Hw(e)}s(Jf,"Visit");function _n(e){Kf=Kf^Npe[e],Kf=Kf*Lpe%Rpe}s(_n,"FNV1A64");function Mc(e){return Kf=BigInt("14695981039346656037"),Jf(e),Kf}s(Mc,"Hash");d();var Zw=class Zw extends ke{constructor(t){super("Unknown type"),this.schema=t}};s(Zw,"ValueCheckUnknownTypeError");var qw=Zw;function Ype(e){return e[q]==="Any"||e[q]==="Unknown"}s(Ype,"IsAnyOrUnknown");function nt(e){return e!==void 0}s(nt,"IsDefined");function Kpe(e,t,r){return!0}s(Kpe,"FromAny");function Jpe(e,t,r){if(!Ue(r)||nt(e.minItems)&&!(r.length>=e.minItems)||nt(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(i=>pn(e.items,t,i))||e.uniqueItems===!0&&!function(){let i=new Set;for(let a of r){let l=Mc(a);if(i.has(l))return!1;i.add(l)}return!0}())return!1;if(!(nt(e.contains)||Me(e.minContains)||Me(e.maxContains)))return!0;let n=nt(e.contains)?e.contains:Nt(),o=r.reduce((i,a)=>pn(n,t,a)?i+1:i,0);return!(o===0||Me(e.minContains)&&o<e.minContains||Me(e.maxContains)&&o>e.maxContains)}s(Jpe,"FromArray");function Qpe(e,t,r){return gv(r)}s(Qpe,"FromAsyncIterator");function ede(e,t,r){return!(!ln(r)||nt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||nt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||nt(e.maximum)&&!(r<=e.maximum)||nt(e.minimum)&&!(r>=e.minimum)||nt(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}s(ede,"FromBigInt");function tde(e,t,r){return Bs(r)}s(tde,"FromBoolean");function rde(e,t,r){return pn(e.returns,t,r.prototype)}s(rde,"FromConstructor");function nde(e,t,r){return!(!Wn(r)||nt(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||nt(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||nt(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||nt(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||nt(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}s(nde,"FromDate");function ode(e,t,r){return vc(r)}s(ode,"FromFunction");function ide(e,t,r){return!(!xv(r)||nt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||nt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||nt(e.maximum)&&!(r<=e.maximum)||nt(e.minimum)&&!(r>=e.minimum)||nt(e.multipleOf)&&r%e.multipleOf!==0)}s(ide,"FromInteger");function sde(e,t,r){let n=e.allOf.every(o=>pn(o,t,r));if(e.unevaluatedProperties===!1){let o=new RegExp(rl(e)),i=Object.getOwnPropertyNames(r).every(a=>o.test(a));return n&&i}else if(mt(e.unevaluatedProperties)){let o=new RegExp(rl(e)),i=Object.getOwnPropertyNames(r).every(a=>o.test(a)||pn(e.unevaluatedProperties,t,r[a]));return n&&i}else return n}s(sde,"FromIntersect");function ade(e,t,r){return bv(r)}s(ade,"FromIterator");function lde(e,t,r){return r===e.const}s(lde,"FromLiteral");function cde(e,t,r){return!1}s(cde,"FromNever");function ude(e,t,r){return!pn(e.not,t,r)}s(ude,"FromNot");function pde(e,t,r){return Za(r)}s(pde,"FromNull");function dde(e,t,r){return!(!Ft.IsNumberLike(r)||nt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||nt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||nt(e.minimum)&&!(r>=e.minimum)||nt(e.maximum)&&!(r<=e.maximum)||nt(e.multipleOf)&&r%e.multipleOf!==0)}s(dde,"FromNumber");function fde(e,t,r){if(!Ft.IsObjectLike(r)||nt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||nt(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let n=Object.getOwnPropertyNames(e.properties);for(let o of n){let i=e.properties[o];if(e.required&&e.required.includes(o)){if(!pn(i,t,r[o])||(ol(i)||Ype(i))&&!(o in r))return!1}else if(Ft.IsExactOptionalProperty(r,o)&&!pn(i,t,r[o]))return!1}if(e.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return e.required&&e.required.length===n.length&&o.length===n.length?!0:o.every(i=>n.includes(i))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(i=>n.includes(i)||pn(e.additionalProperties,t,r[i])):!0}s(fde,"FromObject");function mde(e,t,r){return vv(r)}s(mde,"FromPromise");function hde(e,t,r){if(!Ft.IsRecordLike(r)||nt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||nt(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,o]=Object.entries(e.patternProperties)[0],i=new RegExp(n),a=Object.entries(r).every(([p,f])=>i.test(p)?pn(o,t,f):!0),l=typeof e.additionalProperties=="object"?Object.entries(r).every(([p,f])=>i.test(p)?!0:pn(e.additionalProperties,t,f)):!0,c=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(p=>i.test(p)):!0;return a&&l&&c}s(hde,"FromRecord");function yde(e,t,r){return pn(St(e,t),t,r)}s(yde,"FromRef");function gde(e,t,r){let n=new RegExp(e.source,e.flags);return nt(e.minLength)&&!(r.length>=e.minLength)||nt(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}s(gde,"FromRegExp");function bde(e,t,r){return!ft(r)||nt(e.minLength)&&!(r.length>=e.minLength)||nt(e.maxLength)&&!(r.length<=e.maxLength)||nt(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:nt(e.format)?Zn.Has(e.format)?Zn.Get(e.format)(r):!1:!0}s(bde,"FromString");function vde(e,t,r){return Xa(r)}s(vde,"FromSymbol");function xde(e,t,r){return ft(r)&&new RegExp(e.pattern).test(r)}s(xde,"FromTemplateLiteral");function Ide(e,t,r){return pn(St(e,t),t,r)}s(Ide,"FromThis");function Sde(e,t,r){if(!Ue(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let n=0;n<e.items.length;n++)if(!pn(e.items[n],t,r[n]))return!1;return!0}s(Sde,"FromTuple");function Cde(e,t,r){return vr(r)}s(Cde,"FromUndefined");function Pde(e,t,r){return e.anyOf.some(n=>pn(n,t,r))}s(Pde,"FromUnion");function Tde(e,t,r){return!(!Ef(r)||nt(e.maxByteLength)&&!(r.length<=e.maxByteLength)||nt(e.minByteLength)&&!(r.length>=e.minByteLength))}s(Tde,"FromUint8Array");function wde(e,t,r){return!0}s(wde,"FromUnknown");function Mde(e,t,r){return Ft.IsVoidLike(r)}s(Mde,"FromVoid");function Ode(e,t,r){return zr.Has(e[q])?zr.Get(e[q])(e,r):!1}s(Ode,"FromKind");function pn(e,t,r){let n=nt(e.$id)?[...t,e]:t,o=e;switch(o[q]){case"Any":return Kpe(o,n,r);case"Array":return Jpe(o,n,r);case"AsyncIterator":return Qpe(o,n,r);case"BigInt":return ede(o,n,r);case"Boolean":return tde(o,n,r);case"Constructor":return rde(o,n,r);case"Date":return nde(o,n,r);case"Function":return ode(o,n,r);case"Integer":return ide(o,n,r);case"Intersect":return sde(o,n,r);case"Iterator":return ade(o,n,r);case"Literal":return lde(o,n,r);case"Never":return cde(o,n,r);case"Not":return ude(o,n,r);case"Null":return pde(o,n,r);case"Number":return dde(o,n,r);case"Object":return fde(o,n,r);case"Promise":return mde(o,n,r);case"Record":return hde(o,n,r);case"Ref":return yde(o,n,r);case"RegExp":return gde(o,n,r);case"String":return bde(o,n,r);case"Symbol":return vde(o,n,r);case"TemplateLiteral":return xde(o,n,r);case"This":return Ide(o,n,r);case"Tuple":return Sde(o,n,r);case"Undefined":return Cde(o,n,r);case"Union":return Pde(o,n,r);case"Uint8Array":return Tde(o,n,r);case"Unknown":return wde(o,n,r);case"Void":return Mde(o,n,r);default:if(!zr.Has(o[q]))throw new qw(o);return Ode(o,n,r)}}s(pn,"Visit");function et(...e){return e.length===3?pn(e[0],e[1],e[2]):pn(e[0],[],e[1])}s(et,"Check");var Z;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(Z||(Z={}));var Yw=class Yw extends ke{constructor(t){super("Unknown type"),this.schema=t}};s(Yw,"ValueErrorsUnknownTypeError");var Xw=Yw;function sl(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}s(sl,"EscapeKey");function ot(e){return e!==void 0}s(ot,"IsDefined");var Kw=class Kw{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};s(Kw,"ValueErrorIterator");var pi=Kw;function ue(e,t,r,n,o=[]){return{type:e,schema:t,path:r,value:n,message:iG()({errorType:e,path:r,schema:t,value:n,errors:o}),errors:o}}s(ue,"Create");function*Ede(e,t,r,n){}s(Ede,"FromAny");function*_de(e,t,r,n){if(!Ue(n))return yield ue(Z.Array,e,r,n);ot(e.minItems)&&!(n.length>=e.minItems)&&(yield ue(Z.ArrayMinItems,e,r,n)),ot(e.maxItems)&&!(n.length<=e.maxItems)&&(yield ue(Z.ArrayMaxItems,e,r,n));for(let a=0;a<n.length;a++)yield*dn(e.items,t,"".concat(r,"/").concat(a),n[a]);if(e.uniqueItems===!0&&!function(){let a=new Set;for(let l of n){let c=Mc(l);if(a.has(c))return!1;a.add(c)}return!0}()&&(yield ue(Z.ArrayUniqueItems,e,r,n)),!(ot(e.contains)||ot(e.minContains)||ot(e.maxContains)))return;let o=ot(e.contains)?e.contains:Nt(),i=n.reduce((a,l,c)=>dn(o,t,"".concat(r).concat(c),l).next().done===!0?a+1:a,0);i===0&&(yield ue(Z.ArrayContains,e,r,n)),Me(e.minContains)&&i<e.minContains&&(yield ue(Z.ArrayMinContains,e,r,n)),Me(e.maxContains)&&i>e.maxContains&&(yield ue(Z.ArrayMaxContains,e,r,n))}s(_de,"FromArray");function*Ade(e,t,r,n){gv(n)||(yield ue(Z.AsyncIterator,e,r,n))}s(Ade,"FromAsyncIterator");function*kde(e,t,r,n){if(!ln(n))return yield ue(Z.BigInt,e,r,n);ot(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ue(Z.BigIntExclusiveMaximum,e,r,n)),ot(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ue(Z.BigIntExclusiveMinimum,e,r,n)),ot(e.maximum)&&!(n<=e.maximum)&&(yield ue(Z.BigIntMaximum,e,r,n)),ot(e.minimum)&&!(n>=e.minimum)&&(yield ue(Z.BigIntMinimum,e,r,n)),ot(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield ue(Z.BigIntMultipleOf,e,r,n))}s(kde,"FromBigInt");function*Dde(e,t,r,n){Bs(n)||(yield ue(Z.Boolean,e,r,n))}s(Dde,"FromBoolean");function*Fde(e,t,r,n){yield*dn(e.returns,t,r,n.prototype)}s(Fde,"FromConstructor");function*Lde(e,t,r,n){if(!Wn(n))return yield ue(Z.Date,e,r,n);ot(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield ue(Z.DateExclusiveMaximumTimestamp,e,r,n)),ot(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield ue(Z.DateExclusiveMinimumTimestamp,e,r,n)),ot(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield ue(Z.DateMaximumTimestamp,e,r,n)),ot(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield ue(Z.DateMinimumTimestamp,e,r,n)),ot(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield ue(Z.DateMultipleOfTimestamp,e,r,n))}s(Lde,"FromDate");function*Rde(e,t,r,n){vc(n)||(yield ue(Z.Function,e,r,n))}s(Rde,"FromFunction");function*Nde(e,t,r,n){if(!xv(n))return yield ue(Z.Integer,e,r,n);ot(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ue(Z.IntegerExclusiveMaximum,e,r,n)),ot(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ue(Z.IntegerExclusiveMinimum,e,r,n)),ot(e.maximum)&&!(n<=e.maximum)&&(yield ue(Z.IntegerMaximum,e,r,n)),ot(e.minimum)&&!(n>=e.minimum)&&(yield ue(Z.IntegerMinimum,e,r,n)),ot(e.multipleOf)&&n%e.multipleOf!==0&&(yield ue(Z.IntegerMultipleOf,e,r,n))}s(Nde,"FromInteger");function*Bde(e,t,r,n){let o=!1;for(let i of e.allOf)for(let a of dn(i,t,r,n))o=!0,yield a;if(o)return yield ue(Z.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let i=new RegExp(rl(e));for(let a of Object.getOwnPropertyNames(n))i.test(a)||(yield ue(Z.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(a),n))}if(typeof e.unevaluatedProperties=="object"){let i=new RegExp(rl(e));for(let a of Object.getOwnPropertyNames(n))if(!i.test(a)){let l=dn(e.unevaluatedProperties,t,"".concat(r,"/").concat(a),n[a]).next();l.done||(yield l.value)}}}s(Bde,"FromIntersect");function*$de(e,t,r,n){bv(n)||(yield ue(Z.Iterator,e,r,n))}s($de,"FromIterator");function*jde(e,t,r,n){n!==e.const&&(yield ue(Z.Literal,e,r,n))}s(jde,"FromLiteral");function*Gde(e,t,r,n){yield ue(Z.Never,e,r,n)}s(Gde,"FromNever");function*Ude(e,t,r,n){dn(e.not,t,r,n).next().done===!0&&(yield ue(Z.Not,e,r,n))}s(Ude,"FromNot");function*Vde(e,t,r,n){Za(n)||(yield ue(Z.Null,e,r,n))}s(Vde,"FromNull");function*zde(e,t,r,n){if(!Ft.IsNumberLike(n))return yield ue(Z.Number,e,r,n);ot(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ue(Z.NumberExclusiveMaximum,e,r,n)),ot(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ue(Z.NumberExclusiveMinimum,e,r,n)),ot(e.maximum)&&!(n<=e.maximum)&&(yield ue(Z.NumberMaximum,e,r,n)),ot(e.minimum)&&!(n>=e.minimum)&&(yield ue(Z.NumberMinimum,e,r,n)),ot(e.multipleOf)&&n%e.multipleOf!==0&&(yield ue(Z.NumberMultipleOf,e,r,n))}s(zde,"FromNumber");function*Hde(e,t,r,n){if(!Ft.IsObjectLike(n))return yield ue(Z.Object,e,r,n);ot(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield ue(Z.ObjectMinProperties,e,r,n)),ot(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield ue(Z.ObjectMaxProperties,e,r,n));let o=Array.isArray(e.required)?e.required:[],i=Object.getOwnPropertyNames(e.properties),a=Object.getOwnPropertyNames(n);for(let l of o)a.includes(l)||(yield ue(Z.ObjectRequiredProperty,e.properties[l],"".concat(r,"/").concat(sl(l)),void 0));if(e.additionalProperties===!1)for(let l of a)i.includes(l)||(yield ue(Z.ObjectAdditionalProperties,e,"".concat(r,"/").concat(sl(l)),n[l]));if(typeof e.additionalProperties=="object")for(let l of a)i.includes(l)||(yield*dn(e.additionalProperties,t,"".concat(r,"/").concat(sl(l)),n[l]));for(let l of i){let c=e.properties[l];e.required&&e.required.includes(l)?(yield*dn(c,t,"".concat(r,"/").concat(sl(l)),n[l]),ol(e)&&!(l in n)&&(yield ue(Z.ObjectRequiredProperty,c,"".concat(r,"/").concat(sl(l)),void 0))):Ft.IsExactOptionalProperty(n,l)&&(yield*dn(c,t,"".concat(r,"/").concat(sl(l)),n[l]))}}s(Hde,"FromObject");function*Wde(e,t,r,n){vv(n)||(yield ue(Z.Promise,e,r,n))}s(Wde,"FromPromise");function*qde(e,t,r,n){if(!Ft.IsRecordLike(n))return yield ue(Z.Object,e,r,n);ot(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield ue(Z.ObjectMinProperties,e,r,n)),ot(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield ue(Z.ObjectMaxProperties,e,r,n));let[o,i]=Object.entries(e.patternProperties)[0],a=new RegExp(o);for(let[l,c]of Object.entries(n))a.test(l)&&(yield*dn(i,t,"".concat(r,"/").concat(sl(l)),c));if(typeof e.additionalProperties=="object")for(let[l,c]of Object.entries(n))a.test(l)||(yield*dn(e.additionalProperties,t,"".concat(r,"/").concat(sl(l)),c));if(e.additionalProperties===!1){for(let[l,c]of Object.entries(n))if(!a.test(l))return yield ue(Z.ObjectAdditionalProperties,e,"".concat(r,"/").concat(sl(l)),c)}}s(qde,"FromRecord");function*Zde(e,t,r,n){yield*dn(St(e,t),t,r,n)}s(Zde,"FromRef");function*Xde(e,t,r,n){if(!ft(n))return yield ue(Z.String,e,r,n);if(ot(e.minLength)&&!(n.length>=e.minLength)&&(yield ue(Z.StringMinLength,e,r,n)),ot(e.maxLength)&&!(n.length<=e.maxLength)&&(yield ue(Z.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield ue(Z.RegExp,e,r,n)}s(Xde,"FromRegExp");function*Yde(e,t,r,n){if(!ft(n))return yield ue(Z.String,e,r,n);ot(e.minLength)&&!(n.length>=e.minLength)&&(yield ue(Z.StringMinLength,e,r,n)),ot(e.maxLength)&&!(n.length<=e.maxLength)&&(yield ue(Z.StringMaxLength,e,r,n)),ft(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield ue(Z.StringPattern,e,r,n))),ft(e.format)&&(Zn.Has(e.format)?Zn.Get(e.format)(n)||(yield ue(Z.StringFormat,e,r,n)):yield ue(Z.StringFormatUnknown,e,r,n))}s(Yde,"FromString");function*Kde(e,t,r,n){Xa(n)||(yield ue(Z.Symbol,e,r,n))}s(Kde,"FromSymbol");function*Jde(e,t,r,n){if(!ft(n))return yield ue(Z.String,e,r,n);new RegExp(e.pattern).test(n)||(yield ue(Z.StringPattern,e,r,n))}s(Jde,"FromTemplateLiteral");function*Qde(e,t,r,n){yield*dn(St(e,t),t,r,n)}s(Qde,"FromThis");function*efe(e,t,r,n){if(!Ue(n))return yield ue(Z.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield ue(Z.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield ue(Z.TupleLength,e,r,n);if(e.items)for(let o=0;o<e.items.length;o++)yield*dn(e.items[o],t,"".concat(r,"/").concat(o),n[o])}s(efe,"FromTuple");function*tfe(e,t,r,n){vr(n)||(yield ue(Z.Undefined,e,r,n))}s(tfe,"FromUndefined");function*rfe(e,t,r,n){if(et(e,t,n))return;let o=e.anyOf.map(i=>new pi(dn(i,t,r,n)));yield ue(Z.Union,e,r,n,o)}s(rfe,"FromUnion");function*nfe(e,t,r,n){if(!Ef(n))return yield ue(Z.Uint8Array,e,r,n);ot(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield ue(Z.Uint8ArrayMaxByteLength,e,r,n)),ot(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield ue(Z.Uint8ArrayMinByteLength,e,r,n))}s(nfe,"FromUint8Array");function*ofe(e,t,r,n){}s(ofe,"FromUnknown");function*ife(e,t,r,n){Ft.IsVoidLike(n)||(yield ue(Z.Void,e,r,n))}s(ife,"FromVoid");function*sfe(e,t,r,n){zr.Get(e[q])(e,n)||(yield ue(Z.Kind,e,r,n))}s(sfe,"FromKind");function*dn(e,t,r,n){let o=ot(e.$id)?[...t,e]:t,i=e;switch(i[q]){case"Any":return yield*Ede(i,o,r,n);case"Array":return yield*_de(i,o,r,n);case"AsyncIterator":return yield*Ade(i,o,r,n);case"BigInt":return yield*kde(i,o,r,n);case"Boolean":return yield*Dde(i,o,r,n);case"Constructor":return yield*Fde(i,o,r,n);case"Date":return yield*Lde(i,o,r,n);case"Function":return yield*Rde(i,o,r,n);case"Integer":return yield*Nde(i,o,r,n);case"Intersect":return yield*Bde(i,o,r,n);case"Iterator":return yield*$de(i,o,r,n);case"Literal":return yield*jde(i,o,r,n);case"Never":return yield*Gde(i,o,r,n);case"Not":return yield*Ude(i,o,r,n);case"Null":return yield*Vde(i,o,r,n);case"Number":return yield*zde(i,o,r,n);case"Object":return yield*Hde(i,o,r,n);case"Promise":return yield*Wde(i,o,r,n);case"Record":return yield*qde(i,o,r,n);case"Ref":return yield*Zde(i,o,r,n);case"RegExp":return yield*Xde(i,o,r,n);case"String":return yield*Yde(i,o,r,n);case"Symbol":return yield*Kde(i,o,r,n);case"TemplateLiteral":return yield*Jde(i,o,r,n);case"This":return yield*Qde(i,o,r,n);case"Tuple":return yield*efe(i,o,r,n);case"Undefined":return yield*tfe(i,o,r,n);case"Union":return yield*rfe(i,o,r,n);case"Uint8Array":return yield*nfe(i,o,r,n);case"Unknown":return yield*ofe(i,o,r,n);case"Void":return yield*ife(i,o,r,n);default:if(!zr.Has(i[q]))throw new Xw(e);return yield*sfe(i,o,r,n)}}s(dn,"Visit");function zs(...e){let t=e.length===3?dn(e[0],e[1],"",e[2]):dn(e[0],[],"",e[1]);return new pi(t)}s(zs,"Errors");d();var afe=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},uG=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Jw,Qv,pG,eM=class eM extends ke{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),Jw.add(this),Qv.set(this,void 0),afe(this,Qv,t,"f"),this.error=r}Errors(){return new pi(uG(this,Jw,"m",pG).call(this))}};s(eM,"AssertError");var Qw=eM;Qv=new WeakMap,Jw=new WeakSet,pG=s(function*(){this.error&&(yield this.error),yield*uG(this,Qv,"f")},"_AssertError_Iterator");function cG(e,t,r){if(!et(e,t,r))throw new Qw(zs(e,t,r))}s(cG,"AssertValue");function ex(...e){return e.length===3?cG(e[0],e[1],e[2]):cG(e[0],[],e[1])}s(ex,"Assert");d();d();d();function lfe(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Ct(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Ct(e[r]);return t}s(lfe,"FromObject");function cfe(e){return e.map(t=>Ct(t))}s(cfe,"FromArray");function ufe(e){return e.slice()}s(ufe,"FromTypedArray");function pfe(e){return new Map(Ct([...e.entries()]))}s(pfe,"FromMap");function dfe(e){return new Set(Ct([...e.entries()]))}s(dfe,"FromSet");function ffe(e){return new Date(e.toISOString())}s(ffe,"FromDate");function Ct(e){if(Ue(e))return cfe(e);if(Wn(e))return ffe(e);if(ni(e))return ufe(e);if(_B(e))return pfe(e);if(AB(e))return dfe(e);if(He(e))return lfe(e);if(cn(e))return e;throw new Error("ValueClone: Unable to clone value")}s(Ct,"Clone");var tM=class tM extends ke{constructor(t,r){super(r),this.schema=t}};s(tM,"ValueCreateError");var Fo=tM;function Pt(e){return vc(e)?e():Ct(e)}s(Pt,"FromDefault");function mfe(e,t){return Re(e,"default")?Pt(e.default):{}}s(mfe,"FromAny");function hfe(e,t){if(e.uniqueItems===!0&&!Re(e,"default"))throw new Fo(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!Re(e,"default"))throw new Fo(e,"Array with the contains constraint requires a default value");return"default"in e?Pt(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>Lo(e.items,t)):[]}s(hfe,"FromArray");function yfe(e,t){return Re(e,"default")?Pt(e.default):async function*(){}()}s(yfe,"FromAsyncIterator");function gfe(e,t){return Re(e,"default")?Pt(e.default):BigInt(0)}s(gfe,"FromBigInt");function bfe(e,t){return Re(e,"default")?Pt(e.default):!1}s(bfe,"FromBoolean");function vfe(e,t){if(Re(e,"default"))return Pt(e.default);{let r=Lo(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let i=this;i[n]=o}}}:class{}}}s(vfe,"FromConstructor");function xfe(e,t){return Re(e,"default")?Pt(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}s(xfe,"FromDate");function Ife(e,t){return Re(e,"default")?Pt(e.default):()=>Lo(e.returns,t)}s(Ife,"FromFunction");function Sfe(e,t){return Re(e,"default")?Pt(e.default):e.minimum!==void 0?e.minimum:0}s(Sfe,"FromInteger");function Cfe(e,t){if(Re(e,"default"))return Pt(e.default);{let r=e.allOf.reduce((n,o)=>{let i=Lo(o,t);return typeof i=="object"?{...n,...i}:i},{});if(!et(e,t,r))throw new Fo(e,"Intersect produced invalid value. Consider using a default value.");return r}}s(Cfe,"FromIntersect");function Pfe(e,t){return Re(e,"default")?Pt(e.default):function*(){}()}s(Pfe,"FromIterator");function Tfe(e,t){return Re(e,"default")?Pt(e.default):e.const}s(Tfe,"FromLiteral");function wfe(e,t){if(Re(e,"default"))return Pt(e.default);throw new Fo(e,"Never types cannot be created. Consider using a default value.")}s(wfe,"FromNever");function Mfe(e,t){if(Re(e,"default"))return Pt(e.default);throw new Fo(e,"Not types must have a default value")}s(Mfe,"FromNot");function Ofe(e,t){return Re(e,"default")?Pt(e.default):null}s(Ofe,"FromNull");function Efe(e,t){return Re(e,"default")?Pt(e.default):e.minimum!==void 0?e.minimum:0}s(Efe,"FromNumber");function _fe(e,t){if(Re(e,"default"))return Pt(e.default);{let r=new Set(e.required),n={};for(let[o,i]of Object.entries(e.properties))r.has(o)&&(n[o]=Lo(i,t));return n}}s(_fe,"FromObject");function Afe(e,t){return Re(e,"default")?Pt(e.default):Promise.resolve(Lo(e.item,t))}s(Afe,"FromPromise");function kfe(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(Re(e,"default"))return Pt(e.default);if(r===el||r===Qa)return{};{let o=r.slice(1,r.length-1).split("|"),i={};for(let a of o)i[a]=Lo(n,t);return i}}s(kfe,"FromRecord");function Dfe(e,t){return Re(e,"default")?Pt(e.default):Lo(St(e,t),t)}s(Dfe,"FromRef");function Ffe(e,t){if(Re(e,"default"))return Pt(e.default);throw new Fo(e,"RegExp types cannot be created. Consider using a default value.")}s(Ffe,"FromRegExp");function Lfe(e,t){if(e.pattern!==void 0){if(Re(e,"default"))return Pt(e.default);throw new Fo(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(Re(e,"default"))return Pt(e.default);throw new Fo(e,"String types with formats must specify a default value")}else return Re(e,"default")?Pt(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}s(Lfe,"FromString");function Rfe(e,t){return Re(e,"default")?Pt(e.default):"value"in e?Symbol.for(e.value):Symbol()}s(Rfe,"FromSymbol");function Nfe(e,t){if(Re(e,"default"))return Pt(e.default);if(!Tv(e))throw new Fo(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Rf(e)[0]}s(Nfe,"FromTemplateLiteral");function Bfe(e,t){if(dG++>Wfe)throw new Fo(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Re(e,"default")?Pt(e.default):Lo(St(e,t),t)}s(Bfe,"FromThis");function $fe(e,t){return Re(e,"default")?Pt(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>Lo(e.items[n],t))}s($fe,"FromTuple");function jfe(e,t){if(Re(e,"default"))return Pt(e.default)}s(jfe,"FromUndefined");function Gfe(e,t){if(Re(e,"default"))return Pt(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return Lo(e.anyOf[0],t)}s(Gfe,"FromUnion");function Ufe(e,t){return Re(e,"default")?Pt(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}s(Ufe,"FromUint8Array");function Vfe(e,t){return Re(e,"default")?Pt(e.default):{}}s(Vfe,"FromUnknown");function zfe(e,t){if(Re(e,"default"))return Pt(e.default)}s(zfe,"FromVoid");function Hfe(e,t){if(Re(e,"default"))return Pt(e.default);throw new Error("User defined types must specify a default value")}s(Hfe,"FromKind");function Lo(e,t){let r=ui(e,t),n=e;switch(n[q]){case"Any":return mfe(n,r);case"Array":return hfe(n,r);case"AsyncIterator":return yfe(n,r);case"BigInt":return gfe(n,r);case"Boolean":return bfe(n,r);case"Constructor":return vfe(n,r);case"Date":return xfe(n,r);case"Function":return Ife(n,r);case"Integer":return Sfe(n,r);case"Intersect":return Cfe(n,r);case"Iterator":return Pfe(n,r);case"Literal":return Tfe(n,r);case"Never":return wfe(n,r);case"Not":return Mfe(n,r);case"Null":return Ofe(n,r);case"Number":return Efe(n,r);case"Object":return _fe(n,r);case"Promise":return Afe(n,r);case"Record":return kfe(n,r);case"Ref":return Dfe(n,r);case"RegExp":return Ffe(n,r);case"String":return Lfe(n,r);case"Symbol":return Rfe(n,r);case"TemplateLiteral":return Nfe(n,r);case"This":return Bfe(n,r);case"Tuple":return $fe(n,r);case"Undefined":return jfe(n,r);case"Union":return Gfe(n,r);case"Uint8Array":return Ufe(n,r);case"Unknown":return Vfe(n,r);case"Void":return zfe(n,r);default:if(!zr.Has(n[q]))throw new Fo(n,"Unknown type");return Hfe(n,r)}}s(Lo,"Visit");var Wfe=512,dG=0;function di(...e){return dG=0,e.length===2?Lo(e[0],e[1]):Lo(e[0],[])}s(di,"Create");var nM=class nM extends ke{constructor(t,r){super(r),this.schema=t}};s(nM,"ValueCastError");var tx=nM;function qfe(e,t,r){if(e[q]==="Object"&&typeof r=="object"&&!Za(r)){let n=e,o=Object.getOwnPropertyNames(r),i=Object.entries(n.properties),[a,l]=[1/i.length,i.length];return i.reduce((c,[p,f])=>{let m=f[q]==="Literal"&&f.const===r[p]?l:0,y=et(f,t,r[p])?a:0,v=o.includes(p)?a:0;return c+(m+y+v)},0)}else return et(e,t,r)?1:0}s(qfe,"ScoreUnion");function Zfe(e,t,r){let n=e.anyOf.map(a=>St(a,t)),[o,i]=[n[0],0];for(let a of n){let l=qfe(a,t,r);l>i&&(o=a,i=l)}return o}s(Zfe,"SelectUnion");function Xfe(e,t,r){if("default"in e)return typeof r=="function"?e.default:Ct(e.default);{let n=Zfe(e,t,r);return rM(n,t,r)}}s(Xfe,"CastUnion");function Yfe(e,t,r){return et(e,t,r)?Ct(r):di(e,t)}s(Yfe,"DefaultClone");function Kfe(e,t,r){return et(e,t,r)?r:di(e,t)}s(Kfe,"Default");function Jfe(e,t,r){if(et(e,t,r))return Ct(r);let n=Ue(r)?Ct(r):di(e,t),o=Me(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,a=(Me(e.maxItems)&&o.length>e.maxItems?o.slice(0,e.maxItems):o).map(c=>Hs(e.items,t,c));if(e.uniqueItems!==!0)return a;let l=[...new Set(a)];if(!et(e,t,l))throw new tx(e,"Array cast produced invalid data due to uniqueItems constraint");return l}s(Jfe,"FromArray");function Qfe(e,t,r){if(et(e,t,r))return di(e,t);let n=new Set(e.returns.required||[]),o=s(function(){},"result");for(let[i,a]of Object.entries(e.returns.properties))!n.has(i)&&r.prototype[i]===void 0||(o.prototype[i]=Hs(a,t,r.prototype[i]));return o}s(Qfe,"FromConstructor");function eme(e,t,r){let n=di(e,t),o=He(n)&&He(r)?{...n,...r}:r;return et(e,t,o)?o:di(e,t)}s(eme,"FromIntersect");function tme(e,t,r){throw new tx(e,"Never types cannot be cast")}s(tme,"FromNever");function rme(e,t,r){if(et(e,t,r))return r;if(r===null||typeof r!="object")return di(e,t);let n=new Set(e.required||[]),o={};for(let[i,a]of Object.entries(e.properties))!n.has(i)&&r[i]===void 0||(o[i]=Hs(a,t,r[i]));if(typeof e.additionalProperties=="object"){let i=Object.getOwnPropertyNames(e.properties);for(let a of Object.getOwnPropertyNames(r))i.includes(a)||(o[a]=Hs(e.additionalProperties,t,r[a]))}return o}s(rme,"FromObject");function nme(e,t,r){if(et(e,t,r))return Ct(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return di(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[n],i={};for(let[a,l]of Object.entries(r))i[a]=Hs(o,t,l);return i}s(nme,"FromRecord");function ome(e,t,r){return Hs(St(e,t),t,r)}s(ome,"FromRef");function ime(e,t,r){return Hs(St(e,t),t,r)}s(ime,"FromThis");function sme(e,t,r){return et(e,t,r)?Ct(r):Ue(r)?e.items===void 0?[]:e.items.map((n,o)=>Hs(n,t,r[o])):di(e,t)}s(sme,"FromTuple");function ame(e,t,r){return et(e,t,r)?Ct(r):Xfe(e,t,r)}s(ame,"FromUnion");function Hs(e,t,r){let n=ft(e.$id)?[...t,e]:t,o=e;switch(e[q]){case"Array":return Jfe(o,n,r);case"Constructor":return Qfe(o,n,r);case"Intersect":return eme(o,n,r);case"Never":return tme(o,n,r);case"Object":return rme(o,n,r);case"Record":return nme(o,n,r);case"Ref":return ome(o,n,r);case"This":return ime(o,n,r);case"Tuple":return sme(o,n,r);case"Union":return ame(o,n,r);case"Date":case"Symbol":case"Uint8Array":return Yfe(e,t,r);default:return Kfe(o,n,r)}}s(Hs,"Visit");function rM(...e){return e.length===3?Hs(e[0],e[1],e[2]):Hs(e[0],[],e[1])}s(rM,"Cast");d();function lme(e){return Ic(e)&&e[q]!=="Unsafe"}s(lme,"IsCheckable");function cme(e,t,r){return Ue(r)?r.map(n=>Ro(e.items,t,n)):r}s(cme,"FromArray");function ume(e,t,r){let n=e.unevaluatedProperties,i=e.allOf.map(l=>Ro(l,t,Ct(r))).reduce((l,c)=>He(c)?{...l,...c}:c,{});if(!He(r)||!He(i)||!Ic(n))return i;let a=Qr(e);for(let l of Object.getOwnPropertyNames(r))a.includes(l)||et(n,t,r[l])&&(i[l]=Ro(n,t,r[l]));return i}s(ume,"FromIntersect");function pme(e,t,r){if(!He(r)||Ue(r))return r;let n=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Re(e.properties,o)){r[o]=Ro(e.properties[o],t,r[o]);continue}if(Ic(n)&&et(n,t,r[o])){r[o]=Ro(n,t,r[o]);continue}delete r[o]}return r}s(pme,"FromObject");function dme(e,t,r){if(!He(r))return r;let n=e.additionalProperties,o=Object.getOwnPropertyNames(r),[i,a]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let c of o){if(l.test(c)){r[c]=Ro(a,t,r[c]);continue}if(Ic(n)&&et(n,t,r[c])){r[c]=Ro(n,t,r[c]);continue}delete r[c]}return r}s(dme,"FromRecord");function fme(e,t,r){return Ro(St(e,t),t,r)}s(fme,"FromRef");function mme(e,t,r){return Ro(St(e,t),t,r)}s(mme,"FromThis");function hme(e,t,r){if(!Ue(r))return r;if(vr(e.items))return[];let n=Math.min(r.length,e.items.length);for(let o=0;o<n;o++)r[o]=Ro(e.items[o],t,r[o]);return r.length>n?r.slice(0,n):r}s(hme,"FromTuple");function yme(e,t,r){for(let n of e.anyOf)if(lme(n)&&et(n,t,r))return Ro(n,t,r);return r}s(yme,"FromUnion");function Ro(e,t,r){let n=ft(e.$id)?[...t,e]:t,o=e;switch(o[q]){case"Array":return cme(o,n,r);case"Intersect":return ume(o,n,r);case"Object":return pme(o,n,r);case"Record":return dme(o,n,r);case"Ref":return fme(o,n,r);case"This":return mme(o,n,r);case"Tuple":return hme(o,n,r);case"Union":return yme(o,n,r);default:return r}}s(Ro,"Visit");function rx(...e){return e.length===3?Ro(e[0],e[1],e[2]):Ro(e[0],[],e[1])}s(rx,"Clean");d();function nx(e){return ft(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}s(nx,"IsStringNumeric");function gme(e){return ln(e)||Bs(e)||Me(e)}s(gme,"IsValueToString");function xg(e){return e===!0||Me(e)&&e===1||ln(e)&&e===BigInt("1")||ft(e)&&(e.toLowerCase()==="true"||e==="1")}s(xg,"IsValueTrue");function Ig(e){return e===!1||Me(e)&&(e===0||Object.is(e,-0))||ln(e)&&e===BigInt("0")||ft(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}s(Ig,"IsValueFalse");function bme(e){return ft(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}s(bme,"IsTimeStringWithTimeZone");function vme(e){return ft(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}s(vme,"IsTimeStringWithoutTimeZone");function xme(e){return ft(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}s(xme,"IsDateTimeStringWithTimeZone");function Ime(e){return ft(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}s(Ime,"IsDateTimeStringWithoutTimeZone");function Sme(e){return ft(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}s(Sme,"IsDateString");function Cme(e,t){let r=mG(e);return r===t?r:e}s(Cme,"TryConvertLiteralString");function Pme(e,t){let r=hG(e);return r===t?r:e}s(Pme,"TryConvertLiteralNumber");function Tme(e,t){let r=fG(e);return r===t?r:e}s(Tme,"TryConvertLiteralBoolean");function wme(e,t){return ft(e.const)?Cme(t,e.const):Me(e.const)?Pme(t,e.const):Bs(e.const)?Tme(t,e.const):t}s(wme,"TryConvertLiteral");function fG(e){return xg(e)?!0:Ig(e)?!1:e}s(fG,"TryConvertBoolean");function Mme(e){let t=s(r=>r.split(".")[0],"truncateInteger");return nx(e)?BigInt(t(e)):Me(e)?BigInt(Math.trunc(e)):Ig(e)?BigInt(0):xg(e)?BigInt(1):e}s(Mme,"TryConvertBigInt");function mG(e){return gme(e)?e.toString():Xa(e)&&e.description!==void 0?e.description.toString():e}s(mG,"TryConvertString");function hG(e){return nx(e)?parseFloat(e):xg(e)?1:Ig(e)?0:e}s(hG,"TryConvertNumber");function Ome(e){return nx(e)?parseInt(e):Me(e)?e|0:xg(e)?1:Ig(e)?0:e}s(Ome,"TryConvertInteger");function Eme(e){return ft(e)&&e.toLowerCase()==="null"?null:e}s(Eme,"TryConvertNull");function _me(e){return ft(e)&&e==="undefined"?void 0:e}s(_me,"TryConvertUndefined");function Ame(e){return Wn(e)?e:Me(e)?new Date(e):xg(e)?new Date(1):Ig(e)?new Date(0):nx(e)?new Date(parseInt(e)):vme(e)?new Date("1970-01-01T".concat(e,".000Z")):bme(e)?new Date("1970-01-01T".concat(e)):Ime(e)?new Date("".concat(e,".000Z")):xme(e)?new Date(e):Sme(e)?new Date("".concat(e,"T00:00:00.000Z")):e}s(Ame,"TryConvertDate");function kme(e,t,r){return(Ue(r)?r:[r]).map(o=>Ws(e.items,t,o))}s(kme,"FromArray");function Dme(e,t,r){return Mme(r)}s(Dme,"FromBigInt");function Fme(e,t,r){return fG(r)}s(Fme,"FromBoolean");function Lme(e,t,r){return Ame(r)}s(Lme,"FromDate");function Rme(e,t,r){return Ome(r)}s(Rme,"FromInteger");function Nme(e,t,r){return e.allOf.reduce((n,o)=>Ws(o,t,n),r)}s(Nme,"FromIntersect");function Bme(e,t,r){return wme(e,r)}s(Bme,"FromLiteral");function $me(e,t,r){return Eme(r)}s($me,"FromNull");function jme(e,t,r){return hG(r)}s(jme,"FromNumber");function Gme(e,t,r){if(!He(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))Re(r,n)&&(r[n]=Ws(e.properties[n],t,r[n]));return r}s(Gme,"FromObject");function Ume(e,t,r){if(!He(r))return r;let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[o];for(let[a,l]of Object.entries(r))r[a]=Ws(i,t,l);return r}s(Ume,"FromRecord");function Vme(e,t,r){return Ws(St(e,t),t,r)}s(Vme,"FromRef");function zme(e,t,r){return mG(r)}s(zme,"FromString");function Hme(e,t,r){return ft(r)||Me(r)?Symbol(r):r}s(Hme,"FromSymbol");function Wme(e,t,r){return Ws(St(e,t),t,r)}s(Wme,"FromThis");function qme(e,t,r){return Ue(r)&&!vr(e.items)?r.map((o,i)=>i<e.items.length?Ws(e.items[i],t,o):o):r}s(qme,"FromTuple");function Zme(e,t,r){return _me(r)}s(Zme,"FromUndefined");function Xme(e,t,r){for(let n of e.anyOf){let o=Ws(n,t,Ct(r));if(et(n,t,o))return o}return r}s(Xme,"FromUnion");function Ws(e,t,r){let n=ui(e,t),o=e;switch(e[q]){case"Array":return kme(o,n,r);case"BigInt":return Dme(o,n,r);case"Boolean":return Fme(o,n,r);case"Date":return Lme(o,n,r);case"Integer":return Rme(o,n,r);case"Intersect":return Nme(o,n,r);case"Literal":return Bme(o,n,r);case"Null":return $me(o,n,r);case"Number":return jme(o,n,r);case"Object":return Gme(o,n,r);case"Record":return Ume(o,n,r);case"Ref":return Vme(o,n,r);case"String":return zme(o,n,r);case"Symbol":return Hme(o,n,r);case"This":return Wme(o,n,r);case"Tuple":return qme(o,n,r);case"Undefined":return Zme(o,n,r);case"Union":return Xme(o,n,r);default:return r}}s(Ws,"Visit");function ox(...e){return e.length===3?Ws(e[0],e[1],e[2]):Ws(e[0],[],e[1])}s(ox,"Convert");d();d();var oM=class oM extends ke{constructor(t,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};s(oM,"TransformDecodeCheckError");var Qf=oM,iM=class iM extends ke{constructor(t,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=t,this.path=r,this.value=n,this.error=o}};s(iM,"TransformDecodeError");var ip=iM;function xr(e,t,r){try{return Jt(e)?e[sr].Decode(r):r}catch(n){throw new ip(e,t,r,n)}}s(xr,"Default");function Yme(e,t,r,n){return Ue(n)?xr(e,r,n.map((o,i)=>qs(e.items,t,"".concat(r,"/").concat(i),o))):xr(e,r,n)}s(Yme,"FromArray");function Kme(e,t,r,n){if(!He(n)||cn(n))return xr(e,r,n);let o=Pc(e),i=o.map(f=>f[0]),a={...n};for(let[f,m]of o)f in a&&(a[f]=qs(m,t,"".concat(r,"/").concat(f),a[f]));if(!Jt(e.unevaluatedProperties))return xr(e,r,a);let l=Object.getOwnPropertyNames(a),c=e.unevaluatedProperties,p={...a};for(let f of l)i.includes(f)||(p[f]=xr(c,"".concat(r,"/").concat(f),p[f]));return xr(e,r,p)}s(Kme,"FromIntersect");function Jme(e,t,r,n){return xr(e,r,qs(e.not,t,r,n))}s(Jme,"FromNot");function Qme(e,t,r,n){if(!He(n))return xr(e,r,n);let o=Qr(e),i={...n};for(let p of o)Re(i,p)&&(vr(i[p])&&(!Af(e.properties[p])||Ft.IsExactOptionalProperty(i,p))||(i[p]=qs(e.properties[p],t,"".concat(r,"/").concat(p),i[p])));if(!mt(e.additionalProperties))return xr(e,r,i);let a=Object.getOwnPropertyNames(i),l=e.additionalProperties,c={...i};for(let p of a)o.includes(p)||(c[p]=xr(l,"".concat(r,"/").concat(p),c[p]));return xr(e,r,c)}s(Qme,"FromObject");function ehe(e,t,r,n){if(!He(n))return xr(e,r,n);let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(o),a={...n};for(let f of Object.getOwnPropertyNames(n))i.test(f)&&(a[f]=qs(e.patternProperties[o],t,"".concat(r,"/").concat(f),a[f]));if(!mt(e.additionalProperties))return xr(e,r,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let f of l)i.test(f)||(p[f]=xr(c,"".concat(r,"/").concat(f),p[f]));return xr(e,r,p)}s(ehe,"FromRecord");function the(e,t,r,n){let o=St(e,t);return xr(e,r,qs(o,t,r,n))}s(the,"FromRef");function rhe(e,t,r,n){let o=St(e,t);return xr(e,r,qs(o,t,r,n))}s(rhe,"FromThis");function nhe(e,t,r,n){return Ue(n)&&Ue(e.items)?xr(e,r,e.items.map((o,i)=>qs(o,t,"".concat(r,"/").concat(i),n[i]))):xr(e,r,n)}s(nhe,"FromTuple");function ohe(e,t,r,n){for(let o of e.anyOf){if(!et(o,t,n))continue;let i=qs(o,t,r,n);return xr(e,r,i)}return xr(e,r,n)}s(ohe,"FromUnion");function qs(e,t,r,n){let o=ui(e,t),i=e;switch(e[q]){case"Array":return Yme(i,o,r,n);case"Intersect":return Kme(i,o,r,n);case"Not":return Jme(i,o,r,n);case"Object":return Qme(i,o,r,n);case"Record":return ehe(i,o,r,n);case"Ref":return the(i,o,r,n);case"Symbol":return xr(i,r,n);case"This":return rhe(i,o,r,n);case"Tuple":return nhe(i,o,r,n);case"Union":return ohe(i,o,r,n);default:return xr(i,r,n)}}s(qs,"Visit");function em(e,t,r){return qs(e,t,"",r)}s(em,"TransformDecode");d();var sM=class sM extends ke{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};s(sM,"TransformEncodeCheckError");var tm=sM,aM=class aM extends ke{constructor(t,r,n,o){super("".concat(o instanceof Error?o.message:"Unknown error")),this.schema=t,this.path=r,this.value=n,this.error=o}};s(aM,"TransformEncodeError");var sp=aM;function An(e,t,r){try{return Jt(e)?e[sr].Encode(r):r}catch(n){throw new sp(e,t,r,n)}}s(An,"Default");function ihe(e,t,r,n){let o=An(e,r,n);return Ue(o)?o.map((i,a)=>Zs(e.items,t,"".concat(r,"/").concat(a),i)):o}s(ihe,"FromArray");function she(e,t,r,n){let o=An(e,r,n);if(!He(n)||cn(n))return o;let i=Pc(e),a=i.map(m=>m[0]),l={...o};for(let[m,y]of i)m in l&&(l[m]=Zs(y,t,"".concat(r,"/").concat(m),l[m]));if(!Jt(e.unevaluatedProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,f={...l};for(let m of c)a.includes(m)||(f[m]=An(p,"".concat(r,"/").concat(m),f[m]));return f}s(she,"FromIntersect");function ahe(e,t,r,n){return An(e.not,r,An(e,r,n))}s(ahe,"FromNot");function lhe(e,t,r,n){let o=An(e,r,n);if(!He(o))return o;let i=Qr(e),a={...o};for(let f of i)Re(a,f)&&(vr(a[f])&&(!Af(e.properties[f])||Ft.IsExactOptionalProperty(a,f))||(a[f]=Zs(e.properties[f],t,"".concat(r,"/").concat(f),a[f])));if(!mt(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let f of l)i.includes(f)||(p[f]=An(c,"".concat(r,"/").concat(f),p[f]));return p}s(lhe,"FromObject");function che(e,t,r,n){let o=An(e,r,n);if(!He(n))return o;let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l={...o};for(let m of Object.getOwnPropertyNames(n))a.test(m)&&(l[m]=Zs(e.patternProperties[i],t,"".concat(r,"/").concat(m),l[m]));if(!mt(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,f={...l};for(let m of c)a.test(m)||(f[m]=An(p,"".concat(r,"/").concat(m),f[m]));return f}s(che,"FromRecord");function uhe(e,t,r,n){let o=St(e,t),i=Zs(o,t,r,n);return An(e,r,i)}s(uhe,"FromRef");function phe(e,t,r,n){let o=St(e,t),i=Zs(o,t,r,n);return An(e,r,i)}s(phe,"FromThis");function dhe(e,t,r,n){let o=An(e,r,n);return Ue(e.items)?e.items.map((i,a)=>Zs(i,t,"".concat(r,"/").concat(a),o[a])):[]}s(dhe,"FromTuple");function fhe(e,t,r,n){for(let o of e.anyOf){if(!et(o,t,n))continue;let i=Zs(o,t,r,n);return An(e,r,i)}for(let o of e.anyOf){let i=Zs(o,t,r,n);if(et(e,t,i))return An(e,r,i)}return An(e,r,n)}s(fhe,"FromUnion");function Zs(e,t,r,n){let o=ui(e,t),i=e;switch(e[q]){case"Array":return ihe(i,o,r,n);case"Intersect":return she(i,o,r,n);case"Not":return ahe(i,o,r,n);case"Object":return lhe(i,o,r,n);case"Record":return che(i,o,r,n);case"Ref":return uhe(i,o,r,n);case"This":return phe(i,o,r,n);case"Tuple":return dhe(i,o,r,n);case"Union":return fhe(i,o,r,n);default:return An(i,r,n)}}s(Zs,"Visit");function ix(e,t,r){return Zs(e,t,"",r)}s(ix,"TransformEncode");d();function mhe(e,t){return Jt(e)||en(e.items,t)}s(mhe,"FromArray");function hhe(e,t){return Jt(e)||en(e.items,t)}s(hhe,"FromAsyncIterator");function yhe(e,t){return Jt(e)||en(e.returns,t)||e.parameters.some(r=>en(r,t))}s(yhe,"FromConstructor");function ghe(e,t){return Jt(e)||en(e.returns,t)||e.parameters.some(r=>en(r,t))}s(ghe,"FromFunction");function bhe(e,t){return Jt(e)||Jt(e.unevaluatedProperties)||e.allOf.some(r=>en(r,t))}s(bhe,"FromIntersect");function vhe(e,t){return Jt(e)||en(e.items,t)}s(vhe,"FromIterator");function xhe(e,t){return Jt(e)||en(e.not,t)}s(xhe,"FromNot");function Ihe(e,t){return Jt(e)||Object.values(e.properties).some(r=>en(r,t))||mt(e.additionalProperties)&&en(e.additionalProperties,t)}s(Ihe,"FromObject");function She(e,t){return Jt(e)||en(e.item,t)}s(She,"FromPromise");function Che(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return Jt(e)||en(n,t)||mt(e.additionalProperties)&&Jt(e.additionalProperties)}s(Che,"FromRecord");function Phe(e,t){return Jt(e)?!0:en(St(e,t),t)}s(Phe,"FromRef");function The(e,t){return Jt(e)?!0:en(St(e,t),t)}s(The,"FromThis");function whe(e,t){return Jt(e)||!vr(e.items)&&e.items.some(r=>en(r,t))}s(whe,"FromTuple");function Mhe(e,t){return Jt(e)||e.anyOf.some(r=>en(r,t))}s(Mhe,"FromUnion");function en(e,t){let r=ui(e,t),n=e;if(e.$id&&lM.has(e.$id))return!1;switch(e.$id&&lM.add(e.$id),e[q]){case"Array":return mhe(n,r);case"AsyncIterator":return hhe(n,r);case"Constructor":return yhe(n,r);case"Function":return ghe(n,r);case"Intersect":return bhe(n,r);case"Iterator":return vhe(n,r);case"Not":return xhe(n,r);case"Object":return Ihe(n,r);case"Promise":return She(n,r);case"Record":return Che(n,r);case"Ref":return Phe(n,r);case"This":return The(n,r);case"Tuple":return whe(n,r);case"Union":return Mhe(n,r);default:return Jt(e)}}s(en,"Visit");var lM=new Set;function Xs(e,t){return lM.clear(),en(e,t)}s(Xs,"HasTransform");function yG(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!et(t,r,n))throw new Qf(t,n,zs(t,r,n).First());return Xs(t,r)?em(t,r,n):n}s(yG,"Decode");d();function al(e,t){let r=Re(e,"default")?e.default:void 0,n=vc(r)?r():Ct(r);return vr(t)?n:He(t)&&He(n)?Object.assign(n,t):t}s(al,"ValueOrDefault");function cM(e){return Ic(e)&&"default"in e}s(cM,"HasDefaultProperty");function Ohe(e,t,r){let n=al(e,r);if(!Ue(n))return n;for(let o=0;o<n.length;o++)n[o]=No(e.items,t,n[o]);return n}s(Ohe,"FromArray");function Ehe(e,t,r){return Wn(r)?r:al(e,r)}s(Ehe,"FromDate");function _he(e,t,r){let n=al(e,r);return e.allOf.reduce((o,i)=>{let a=No(i,t,n);return He(a)?{...o,...a}:a},{})}s(_he,"FromIntersect");function Ahe(e,t,r){let n=al(e,r);if(!He(n))return n;let o=Object.getOwnPropertyNames(e.properties);for(let i of o){let a=No(e.properties[i],t,n[i]);vr(a)||(n[i]=No(e.properties[i],t,n[i]))}if(!cM(e.additionalProperties))return n;for(let i of Object.getOwnPropertyNames(n))o.includes(i)||(n[i]=No(e.additionalProperties,t,n[i]));return n}s(Ahe,"FromObject");function khe(e,t,r){let n=al(e,r);if(!He(n))return n;let o=e.additionalProperties,[i,a]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let c of Object.getOwnPropertyNames(n))l.test(c)&&cM(a)&&(n[c]=No(a,t,n[c]));if(!cM(o))return n;for(let c of Object.getOwnPropertyNames(n))l.test(c)||(n[c]=No(o,t,n[c]));return n}s(khe,"FromRecord");function Dhe(e,t,r){return No(St(e,t),t,al(e,r))}s(Dhe,"FromRef");function Fhe(e,t,r){return No(St(e,t),t,r)}s(Fhe,"FromThis");function Lhe(e,t,r){let n=al(e,r);if(!Ue(n)||vr(e.items))return n;let[o,i]=[e.items,Math.max(e.items.length,n.length)];for(let a=0;a<i;a++)a<o.length&&(n[a]=No(o[a],t,n[a]));return n}s(Lhe,"FromTuple");function Rhe(e,t,r){let n=al(e,r);for(let o of e.anyOf){let i=No(o,t,Ct(n));if(et(o,t,i))return i}return n}s(Rhe,"FromUnion");function No(e,t,r){let n=ui(e,t),o=e;switch(o[q]){case"Array":return Ohe(o,n,r);case"Date":return Ehe(o,n,r);case"Intersect":return _he(o,n,r);case"Object":return Ahe(o,n,r);case"Record":return khe(o,n,r);case"Ref":return Dhe(o,n,r);case"This":return Fhe(o,n,r);case"Tuple":return Lhe(o,n,r);case"Union":return Rhe(o,n,r);default:return al(o,r)}}s(No,"Visit");function sx(...e){return e.length===3?No(e[0],e[1],e[2]):No(e[0],[],e[1])}s(sx,"Default");d();d();var fi={};Pa(fi,{Delete:()=>Bhe,Format:()=>Sg,Get:()=>jhe,Has:()=>$he,Set:()=>Nhe,ValuePointerRootDeleteError:()=>lx,ValuePointerRootSetError:()=>ax});d();var uM=class uM extends ke{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}};s(uM,"ValuePointerRootSetError");var ax=uM,pM=class pM extends ke{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};s(pM,"ValuePointerRootDeleteError");var lx=pM;function gG(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}s(gG,"Escape");function*Sg(e){if(e==="")return;let[t,r]=[0,0];for(let n=0;n<e.length;n++)e.charAt(n)==="/"?(n===0||(r=n,yield gG(e.slice(t,r))),t=n+1):r=n;yield gG(e.slice(t))}s(Sg,"Format");function Nhe(e,t,r){if(t==="")throw new ax(e,t,r);let[n,o,i]=[null,e,""];for(let a of Sg(t))o[a]===void 0&&(o[a]={}),n=o,o=o[a],i=a;n[i]=r}s(Nhe,"Set");function Bhe(e,t){if(t==="")throw new lx(e,t);let[r,n,o]=[null,e,""];for(let i of Sg(t)){if(n[i]===void 0||n[i]===null)return;r=n,n=n[i],o=i}if(Array.isArray(r)){let i=parseInt(o);r.splice(i,1)}else delete r[o]}s(Bhe,"Delete");function $he(e,t){if(t==="")return!0;let[r,n,o]=[null,e,""];for(let i of Sg(t)){if(n[i]===void 0)return!1;r=n,n=n[i],o=i}return Object.getOwnPropertyNames(r).includes(o)}s($he,"Has");function jhe(e,t){if(t==="")return e;let r=e;for(let n of Sg(t)){if(r[n]===void 0)return;r=r[n]}return r}s(jhe,"Get");d();function Ghe(e,t){if(!He(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==n.length?!1:r.every(o=>ap(e[o],t[o]))}s(Ghe,"ObjectType");function Uhe(e,t){return Wn(t)&&e.getTime()===t.getTime()}s(Uhe,"DateType");function Vhe(e,t){return!Ue(t)||e.length!==t.length?!1:e.every((r,n)=>ap(r,t[n]))}s(Vhe,"ArrayType");function zhe(e,t){return!ni(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>ap(r,t[n]))}s(zhe,"TypedArrayType");function Hhe(e,t){return e===t}s(Hhe,"ValueType");function ap(e,t){if(Wn(e))return Uhe(e,t);if(ni(e))return zhe(e,t);if(Ue(e))return Vhe(e,t);if(He(e))return Ghe(e,t);if(cn(e))return Hhe(e,t);throw new Error("ValueEquals: Unable to compare value")}s(ap,"Equal");var Whe=zt({type:At("insert"),path:ii(),value:nl()}),qhe=zt({type:At("update"),path:ii(),value:nl()}),Zhe=zt({type:At("delete"),path:ii()}),vG=Bt([Whe,qhe,Zhe]),dM=class dM extends ke{constructor(t,r){super(r),this.value=t}};s(dM,"ValueDiffError");var cx=dM;function ux(e,t){return{type:"update",path:e,value:t}}s(ux,"CreateUpdate");function xG(e,t){return{type:"insert",path:e,value:t}}s(xG,"CreateInsert");function IG(e){return{type:"delete",path:e}}s(IG,"CreateDelete");function bG(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new cx(e,"Cannot diff objects with symbols")}s(bG,"AssertDiffable");function*Xhe(e,t,r){if(bG(t),bG(r),!kT(r))return yield ux(e,r);let n=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let i of o)Re(t,i)||(yield xG("".concat(e,"/").concat(i),r[i]));for(let i of n)Re(r,i)&&(ap(t,r)||(yield*px("".concat(e,"/").concat(i),t[i],r[i])));for(let i of n)Re(r,i)||(yield IG("".concat(e,"/").concat(i)))}s(Xhe,"ObjectType");function*Yhe(e,t,r){if(!Ue(r))return yield ux(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*px("".concat(e,"/").concat(n),t[n],r[n]);for(let n=0;n<r.length;n++)n<t.length||(yield xG("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield IG("".concat(e,"/").concat(n)))}s(Yhe,"ArrayType");function*Khe(e,t,r){if(!ni(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield ux(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*px("".concat(e,"/").concat(n),t[n],r[n])}s(Khe,"TypedArrayType");function*Jhe(e,t,r){t!==r&&(yield ux(e,r))}s(Jhe,"ValueType");function*px(e,t,r){if(kT(t))return yield*Xhe(e,t,r);if(Ue(t))return yield*Yhe(e,t,r);if(ni(t))return yield*Khe(e,t,r);if(cn(t))return yield*Jhe(e,t,r);throw new cx(t,"Unable to diff value")}s(px,"Visit");function SG(e,t){return[...px("",e,t)]}s(SG,"Diff");function Qhe(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}s(Qhe,"IsRootUpdate");function eye(e){return e.length===0}s(eye,"IsIdentity");function CG(e,t){if(Qhe(t))return Ct(t[0].value);if(eye(t))return Ct(e);let r=Ct(e);for(let n of t)switch(n.type){case"insert":{fi.Set(r,n.path,n.value);break}case"update":{fi.Set(r,n.path,n.value);break}case"delete":{fi.Delete(r,n.path);break}}return r}s(CG,"Patch");d();function PG(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=Xs(t,r)?ix(t,r,n):n;if(!et(t,r,o))throw new tm(t,o,zs(t,r,o).First());return o}s(PG,"Encode");d();var mM=class mM extends ke{constructor(t){super(t)}};s(mM,"ValueMutateError");var dx=mM;function tye(e,t,r,n){if(!He(r))fi.Set(e,t,Ct(n));else{let o=Object.getOwnPropertyNames(r),i=Object.getOwnPropertyNames(n);for(let a of o)i.includes(a)||delete r[a];for(let a of i)o.includes(a)||(r[a]=null);for(let a of i)fM(e,"".concat(t,"/").concat(a),r[a],n[a])}}s(tye,"ObjectType");function rye(e,t,r,n){if(!Ue(r))fi.Set(e,t,Ct(n));else{for(let o=0;o<n.length;o++)fM(e,"".concat(t,"/").concat(o),r[o],n[o]);r.splice(n.length)}}s(rye,"ArrayType");function nye(e,t,r,n){if(ni(r)&&r.length===n.length)for(let o=0;o<r.length;o++)r[o]=n[o];else fi.Set(e,t,Ct(n))}s(nye,"TypedArrayType");function oye(e,t,r,n){r!==n&&fi.Set(e,t,n)}s(oye,"ValueType");function fM(e,t,r,n){if(Ue(n))return rye(e,t,r,n);if(ni(n))return nye(e,t,r,n);if(He(n))return tye(e,t,r,n);if(cn(n))return oye(e,t,r,n)}s(fM,"Visit");function TG(e){return ni(e)||cn(e)}s(TG,"IsNonMutableValue");function iye(e,t){return He(e)&&Ue(t)||Ue(e)&&He(t)}s(iye,"IsMismatchedValue");function wG(e,t){if(TG(e)||TG(t))throw new dx("Only object and array types can be mutated at the root level");if(iye(e,t))throw new dx("Cannot assign due type mismatch of assignable values");fM(e,"",e,t)}s(wG,"Mutate");d();var sye=[(e,t,r)=>Ct(r),(e,t,r)=>sx(e,t,r),(e,t,r)=>rx(e,t,r),(e,t,r)=>ox(e,t,r),(e,t,r)=>(ex(e,t,r),r),(e,t,r)=>Xs(e,t)?em(e,t,r):r];function MG(e,t,r){return sye.reduce((n,o)=>o(e,t,n),r)}s(MG,"ParseValue");function OG(...e){return e.length===3?MG(e[0],e[1],e[2]):MG(e[0],[],e[1])}s(OG,"Parse");d();var ll={};Pa(ll,{Assert:()=>ex,Cast:()=>rM,Check:()=>et,Clean:()=>rx,Clone:()=>Ct,Convert:()=>ox,Create:()=>di,Decode:()=>yG,Default:()=>sx,Diff:()=>SG,Edit:()=>vG,Encode:()=>PG,Equal:()=>ap,Errors:()=>zs,Hash:()=>Mc,Mutate:()=>wG,Parse:()=>OG,Patch:()=>CG,ValueErrorIterator:()=>pi});d();d();var yM=class yM extends ke{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));h(this,"schema");this.schema=r}};s(yM,"TypeDereferenceError");var hM=yM;function aye(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new hM(e);return lp(r,t)}s(aye,"Resolve");function fx(e,t){return!dt.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}s(fx,"Pushref");function lp(e,t){return e[q]==="This"||e[q]==="Ref"?aye(e,t):e}s(lp,"Deref");d();function lye(e,t,r){let n=e.get(t);if(n!==void 0)return n;let o=Xs(t,r);return e.set(t,o),o}s(lye,"HasTransformCached");function mx(){let e=new WeakMap;return{HasTransform:s((t,r)=>lye(e,t,r),"HasTransform")}}s(mx,"CreateTransformCache");function Ir(e,t,r){try{return N.IsTransform(e)?e[sr].Decode(r):r}catch(n){throw new ip(e,t,r,n)}}s(Ir,"Default");function cye(e,t,r,n,o){return dt.IsArray(n)?Ir(e,r,n.map((i,a)=>Ys(e.items,t,"".concat(r,"/").concat(a),i,o))):Ir(e,r,n)}s(cye,"FromArray");function uye(e,t,r,n,o){if(!dt.IsObject(n)||cn(n))return Ir(e,r,n);let i=Pc(e),a=i.map(m=>m[0]),l={...n};for(let[m,y]of i)m in l&&(l[m]=Ys(y,t,"".concat(r,"/").concat(m),l[m],o));if(!N.IsTransform(e.unevaluatedProperties))return Ir(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,f={...l};for(let m of c)a.includes(m)||(f[m]=Ir(p,"".concat(r,"/").concat(m),f[m]));return Ir(e,r,f)}s(uye,"FromIntersect");function pye(e,t,r,n,o){return Ir(e,r,Ys(e.not,t,r,n,o))}s(pye,"FromNot");function dye(e,t,r,n,o){if(!dt.IsObject(n))return Ir(e,r,n);let i=Qr(e),a={...n};for(let f of i)dt.HasPropertyKey(a,f)&&(dt.IsUndefined(a[f])&&(!N.IsUndefined(e.properties[f])||Ft.IsExactOptionalProperty(a,f))||(a[f]=Ys(e.properties[f],t,"".concat(r,"/").concat(f),a[f],o)));if(!N.IsSchema(e.additionalProperties))return Ir(e,r,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let f of l)i.includes(f)||(p[f]=Ir(c,"".concat(r,"/").concat(f),p[f]));return Ir(e,r,p)}s(dye,"FromObject");function fye(e,t,r,n,o){if(!dt.IsObject(n))return Ir(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l={...n};for(let m of Object.getOwnPropertyNames(n))a.test(m)&&(l[m]=Ys(e.patternProperties[i],t,"".concat(r,"/").concat(m),l[m],o));if(!N.IsSchema(e.additionalProperties))return Ir(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,f={...l};for(let m of c)a.test(m)||(f[m]=Ir(p,"".concat(r,"/").concat(m),f[m]));return Ir(e,r,f)}s(fye,"FromRecord");function mye(e,t,r,n,o){let i=lp(e,t);return Ir(e,r,Ys(i,t,r,n,o))}s(mye,"FromRef");function hye(e,t,r,n,o){let i=lp(e,t);return Ir(e,r,Ys(i,t,r,n,o))}s(hye,"FromThis");function yye(e,t,r,n,o){return dt.IsArray(n)&&dt.IsArray(e.items)?Ir(e,r,e.items.map((i,a)=>Ys(i,t,"".concat(r,"/").concat(a),n[a],o))):Ir(e,r,n)}s(yye,"FromTuple");function gye(e,t,r,n,o){for(let i of e.anyOf){if(!ll.Check(i,t,n))continue;let a=Ys(i,t,r,n,o);return Ir(e,r,a)}return Ir(e,r,n)}s(gye,"FromUnion");function Ys(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=fx(e,t),a=e;switch(e[q]){case"Array":return cye(a,i,r,n,o);case"Intersect":return uye(a,i,r,n,o);case"Not":return pye(a,i,r,n,o);case"Object":return dye(a,i,r,n,o);case"Record":return fye(a,i,r,n,o);case"Ref":return mye(a,i,r,n,o);case"Symbol":return Ir(a,r,n);case"This":return hye(a,i,r,n,o);case"Tuple":return yye(a,i,r,n,o);case"Union":return gye(a,i,r,n,o);default:return Ir(a,r,n)}}s(Ys,"Visit");function EG(e,t,r){let n=mx();return Ys(e,t,"",r,n)}s(EG,"FastTransformDecode");d();function kn(e,t,r){try{return N.IsTransform(e)?e[sr].Encode(r):r}catch(n){throw new sp(e,t,r,n)}}s(kn,"Default");function bye(e,t,r,n,o){let i=kn(e,r,n);return dt.IsArray(i)?i.map((a,l)=>Ks(e.items,t,"".concat(r,"/").concat(l),a,o)):i}s(bye,"FromArray");function vye(e,t,r,n,o){let i=kn(e,r,n);if(!dt.IsObject(n)||cn(n))return i;let a=Pc(e),l=a.map(y=>y[0]),c={...i};for(let[y,v]of a)y in c&&(c[y]=Ks(v,t,"".concat(r,"/").concat(y),c[y],o));if(!N.IsTransform(e.unevaluatedProperties))return c;let p=Object.getOwnPropertyNames(c),f=e.unevaluatedProperties,m={...c};for(let y of p)l.includes(y)||(m[y]=kn(f,"".concat(r,"/").concat(y),m[y]));return m}s(vye,"FromIntersect");function xye(e,t,r,n){return kn(e.not,r,kn(e,r,n))}s(xye,"FromNot");function Iye(e,t,r,n,o){let i=kn(e,r,n);if(!dt.IsObject(i))return i;let a=Qr(e),l={...i};for(let m of a)dt.HasPropertyKey(l,m)&&(dt.IsUndefined(l[m])&&(!N.IsUndefined(e.properties[m])||Ft.IsExactOptionalProperty(l,m))||(l[m]=Ks(e.properties[m],t,"".concat(r,"/").concat(m),l[m],o)));if(!N.IsSchema(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,f={...l};for(let m of c)a.includes(m)||(f[m]=kn(p,"".concat(r,"/").concat(m),f[m]));return f}s(Iye,"FromObject");function Sye(e,t,r,n,o){let i=kn(e,r,n);if(!dt.IsObject(n))return i;let a=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(a),c={...i};for(let y of Object.getOwnPropertyNames(n))l.test(y)&&(c[y]=Ks(e.patternProperties[a],t,"".concat(r,"/").concat(y),c[y],o));if(!N.IsSchema(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),f=e.additionalProperties,m={...c};for(let y of p)l.test(y)||(m[y]=kn(f,"".concat(r,"/").concat(y),m[y]));return m}s(Sye,"FromRecord");function Cye(e,t,r,n,o){let i=lp(e,t),a=Ks(i,t,r,n,o);return kn(e,r,a)}s(Cye,"FromRef");function Pye(e,t,r,n,o){let i=lp(e,t),a=Ks(i,t,r,n,o);return kn(e,r,a)}s(Pye,"FromThis");function Tye(e,t,r,n,o){let i=kn(e,r,n);return dt.IsArray(e.items)?e.items.map((a,l)=>Ks(a,t,"".concat(r,"/").concat(l),i[l],o)):[]}s(Tye,"FromTuple");function wye(e,t,r,n,o){for(let i of e.anyOf){if(!ll.Check(i,t,n))continue;let a=Ks(i,t,r,n,o);return kn(e,r,a)}for(let i of e.anyOf){let a=Ks(i,t,r,n,o);if(ll.Check(e,t,a))return kn(e,r,a)}return kn(e,r,n)}s(wye,"FromUnion");function Ks(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=fx(e,t),a=e;switch(e[q]){case"Array":return bye(a,i,r,n,o);case"Intersect":return vye(a,i,r,n,o);case"Not":return xye(a,i,r,n);case"Object":return Iye(a,i,r,n,o);case"Record":return Sye(a,i,r,n,o);case"Ref":return Cye(a,i,r,n,o);case"This":return Pye(a,i,r,n,o);case"Tuple":return Tye(a,i,r,n,o);case"Union":return wye(a,i,r,n,o);default:return kn(a,r,n)}}s(Ks,"Visit");function _G(e,t,r){let n=mx();return Ks(e,t,"",r,n)}s(_G,"FastTransformEncode");d();var IM=class IM{constructor(t,r,n,o){this.schema=t,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=Xs(t,r)}Code(){return this.code}Errors(t){return zs(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new Qf(this.schema,t,this.Errors(t).First());return this.hasTransform?em(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?ix(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new tm(this.schema,t,this.Errors(t).First());return r}};s(IM,"TypeCheck");var gM=IM,cl;(function(e){function t(i){return i===36}s(t,"DollarSign"),e.DollarSign=t;function r(i){return i===95}s(r,"IsUnderscore"),e.IsUnderscore=r;function n(i){return i>=65&&i<=90||i>=97&&i<=122}s(n,"IsAlpha"),e.IsAlpha=n;function o(i){return i>=48&&i<=57}s(o,"IsNumeric"),e.IsNumeric=o})(cl||(cl={}));var hx;(function(e){function t(i){return i.length===0?!1:cl.IsNumeric(i.charCodeAt(0))}s(t,"IsFirstCharacterNumeric");function r(i){if(t(i))return!1;for(let a=0;a<i.length;a++){let l=i.charCodeAt(a);if(!(cl.IsAlpha(l)||cl.IsNumeric(l)||cl.DollarSign(l)||cl.IsUnderscore(l)))return!1}return!0}s(r,"IsAccessor");function n(i){return i.replace(/'/g,"\\'")}s(n,"EscapeHyphen");function o(i,a){return r(a)?"".concat(i,".").concat(a):"".concat(i,"['").concat(n(a),"']")}s(o,"Encode"),e.Encode=o})(hx||(hx={}));var bM;(function(e){function t(r){let n=[];for(let o=0;o<r.length;o++){let i=r.charCodeAt(o);cl.IsNumeric(i)||cl.IsAlpha(i)?n.push(r.charAt(o)):n.push("_".concat(i,"_"))}return n.join("").replace(/__/g,"_")}s(t,"Encode"),e.Encode=t})(bM||(bM={}));var vM;(function(e){function t(r){return r.replace(/'/g,"\\'")}s(t,"Escape"),e.Escape=t})(vM||(vM={}));var SM=class SM extends ke{constructor(t){super("Unknown type"),this.schema=t}};s(SM,"TypeCompilerUnknownTypeError");var xM=SM,CM=class CM extends ke{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};s(CM,"TypeCompilerTypeGuardError");var yx=CM,cp;(function(e){function t(a,l,c){return Ft.ExactOptionalPropertyTypes?"('".concat(l,"' in ").concat(a," ? ").concat(c," : true)"):"(".concat(hx.Encode(a,l)," !== undefined ? ").concat(c," : true)")}s(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(a){return Ft.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null)"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,"))")}s(r,"IsObjectLike"),e.IsObjectLike=r;function n(a){return Ft.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,") && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))")}s(n,"IsRecordLike"),e.IsRecordLike=n;function o(a){return Ft.AllowNaN?"typeof ".concat(a," === 'number'"):"Number.isFinite(".concat(a,")")}s(o,"IsNumberLike"),e.IsNumberLike=o;function i(a){return Ft.AllowNullVoid?"(".concat(a," === undefined || ").concat(a," === null)"):"".concat(a," === undefined")}s(i,"IsVoidLike"),e.IsVoidLike=i})(cp||(cp={}));var gx;(function(e){function t(k){return k[q]==="Any"||k[q]==="Unknown"}s(t,"IsAnyOrUnknown");function*r(k,K,R){yield"true"}s(r,"FromAny");function*n(k,K,R){yield"Array.isArray(".concat(R,")");let[ce,oe]=[Ve("value","any"),Ve("acc","number")];Me(k.maxItems)&&(yield"".concat(R,".length <= ").concat(k.maxItems)),Me(k.minItems)&&(yield"".concat(R,".length >= ").concat(k.minItems));let le=Ae(k.items,K,"value");if(yield"".concat(R,".every((").concat(ce,") => ").concat(le,")"),mt(k.contains)||Me(k.minContains)||Me(k.maxContains)){let xe=mt(k.contains)?k.contains:Nt(),pr=Ae(xe,K,"value"),Gn=Me(k.minContains)?["(count >= ".concat(k.minContains,")")]:[],nn=Me(k.maxContains)?["(count <= ".concat(k.maxContains,")")]:[],In="const count = value.reduce((".concat(oe,", ").concat(ce,") => ").concat(pr," ? acc + 1 : acc, 0)"),yu=["(count > 0)",...Gn,...nn].join(" && ");yield"((".concat(ce,") => { ").concat(In,"; return ").concat(yu,"})(").concat(R,")")}if(k.uniqueItems===!0){let pr="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(ce,") => { ").concat(pr," )(").concat(R,")")}}s(n,"FromArray");function*o(k,K,R){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(R,")")}s(o,"FromAsyncIterator");function*i(k,K,R){yield"(typeof ".concat(R," === 'bigint')"),ln(k.exclusiveMaximum)&&(yield"".concat(R," < BigInt(").concat(k.exclusiveMaximum,")")),ln(k.exclusiveMinimum)&&(yield"".concat(R," > BigInt(").concat(k.exclusiveMinimum,")")),ln(k.maximum)&&(yield"".concat(R," <= BigInt(").concat(k.maximum,")")),ln(k.minimum)&&(yield"".concat(R," >= BigInt(").concat(k.minimum,")")),ln(k.multipleOf)&&(yield"(".concat(R," % BigInt(").concat(k.multipleOf,")) === 0"))}s(i,"FromBigInt");function*a(k,K,R){yield"(typeof ".concat(R," === 'boolean')")}s(a,"FromBoolean");function*l(k,K,R){yield*ve(k.returns,K,"".concat(R,".prototype"))}s(l,"FromConstructor");function*c(k,K,R){yield"(".concat(R," instanceof Date) && Number.isFinite(").concat(R,".getTime())"),Me(k.exclusiveMaximumTimestamp)&&(yield"".concat(R,".getTime() < ").concat(k.exclusiveMaximumTimestamp)),Me(k.exclusiveMinimumTimestamp)&&(yield"".concat(R,".getTime() > ").concat(k.exclusiveMinimumTimestamp)),Me(k.maximumTimestamp)&&(yield"".concat(R,".getTime() <= ").concat(k.maximumTimestamp)),Me(k.minimumTimestamp)&&(yield"".concat(R,".getTime() >= ").concat(k.minimumTimestamp)),Me(k.multipleOfTimestamp)&&(yield"(".concat(R,".getTime() % ").concat(k.multipleOfTimestamp,") === 0"))}s(c,"FromDate");function*p(k,K,R){yield"(typeof ".concat(R," === 'function')")}s(p,"FromFunction");function*f(k,K,R){yield"Number.isInteger(".concat(R,")"),Me(k.exclusiveMaximum)&&(yield"".concat(R," < ").concat(k.exclusiveMaximum)),Me(k.exclusiveMinimum)&&(yield"".concat(R," > ").concat(k.exclusiveMinimum)),Me(k.maximum)&&(yield"".concat(R," <= ").concat(k.maximum)),Me(k.minimum)&&(yield"".concat(R," >= ").concat(k.minimum)),Me(k.multipleOf)&&(yield"(".concat(R," % ").concat(k.multipleOf,") === 0"))}s(f,"FromInteger");function*m(k,K,R){let ce=k.allOf.map(oe=>Ae(oe,K,R)).join(" && ");if(k.unevaluatedProperties===!1){let oe=st("".concat(new RegExp(rl(k)),";")),le="Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(oe,".test(key))");yield"(".concat(ce," && ").concat(le,")")}else if(mt(k.unevaluatedProperties)){let oe=st("".concat(new RegExp(rl(k)),";")),le="Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(oe,".test(key) || ").concat(Ae(k.unevaluatedProperties,K,"".concat(R,"[key]")),")");yield"(".concat(ce," && ").concat(le,")")}else yield"(".concat(ce,")")}s(m,"FromIntersect");function*y(k,K,R){yield"(typeof value === 'object' && Symbol.iterator in ".concat(R,")")}s(y,"FromIterator");function*v(k,K,R){typeof k.const=="number"||typeof k.const=="boolean"?yield"(".concat(R," === ").concat(k.const,")"):yield"(".concat(R," === '").concat(vM.Escape(k.const),"')")}s(v,"FromLiteral");function*x(k,K,R){yield"false"}s(x,"FromNever");function*S(k,K,R){let ce=Ae(k.not,K,R);yield"(!".concat(ce,")")}s(S,"FromNot");function*I(k,K,R){yield"(".concat(R," === null)")}s(I,"FromNull");function*P(k,K,R){yield cp.IsNumberLike(R),Me(k.exclusiveMaximum)&&(yield"".concat(R," < ").concat(k.exclusiveMaximum)),Me(k.exclusiveMinimum)&&(yield"".concat(R," > ").concat(k.exclusiveMinimum)),Me(k.maximum)&&(yield"".concat(R," <= ").concat(k.maximum)),Me(k.minimum)&&(yield"".concat(R," >= ").concat(k.minimum)),Me(k.multipleOf)&&(yield"(".concat(R," % ").concat(k.multipleOf,") === 0"))}s(P,"FromNumber");function*T(k,K,R){yield cp.IsObjectLike(R),Me(k.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length >= ").concat(k.minProperties)),Me(k.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length <= ").concat(k.maxProperties));let ce=Object.getOwnPropertyNames(k.properties);for(let oe of ce){let le=hx.Encode(R,oe),xe=k.properties[oe];if(k.required&&k.required.includes(oe))yield*ve(xe,K,le),(ol(xe)||t(xe))&&(yield"('".concat(oe,"' in ").concat(R,")"));else{let pr=Ae(xe,K,le);yield cp.IsExactOptionalProperty(R,oe,pr)}}if(k.additionalProperties===!1)if(k.required&&k.required.length===ce.length)yield"Object.getOwnPropertyNames(".concat(R,").length === ").concat(ce.length);else{let oe="[".concat(ce.map(le=>"'".concat(le,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(oe,".includes(key))")}if(typeof k.additionalProperties=="object"){let oe=Ae(k.additionalProperties,K,"".concat(R,"[key]")),le="[".concat(ce.map(xe=>"'".concat(xe,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(le,".includes(key) || ").concat(oe,"))")}}s(T,"FromObject");function*M(k,K,R){yield"(typeof value === 'object' && typeof ".concat(R,".then === 'function')")}s(M,"FromPromise");function*w(k,K,R){yield cp.IsRecordLike(R),Me(k.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length >= ").concat(k.minProperties)),Me(k.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length <= ").concat(k.maxProperties));let[ce,oe]=Object.entries(k.patternProperties)[0],le=st("".concat(new RegExp(ce))),xe=Ae(oe,K,"value"),pr=mt(k.additionalProperties)?Ae(k.additionalProperties,K,R):k.additionalProperties===!1?"false":"true",Gn="(".concat(le,".test(key) ? ").concat(xe," : ").concat(pr,")");yield"(Object.entries(".concat(R,").every(([key, value]) => ").concat(Gn,"))")}s(w,"FromRecord");function*E(k,K,R){let ce=St(k,K);if(de.functions.has(k.$ref))return yield"".concat(gt(k.$ref),"(").concat(R,")");yield*ve(ce,K,R)}s(E,"FromRef");function*B(k,K,R){let ce=st("".concat(new RegExp(k.source,k.flags),";"));yield"(typeof ".concat(R," === 'string')"),Me(k.maxLength)&&(yield"".concat(R,".length <= ").concat(k.maxLength)),Me(k.minLength)&&(yield"".concat(R,".length >= ").concat(k.minLength)),yield"".concat(ce,".test(").concat(R,")")}s(B,"FromRegExp");function*D(k,K,R){if(yield"(typeof ".concat(R," === 'string')"),Me(k.maxLength)&&(yield"".concat(R,".length <= ").concat(k.maxLength)),Me(k.minLength)&&(yield"".concat(R,".length >= ").concat(k.minLength)),k.pattern!==void 0){let ce=st("".concat(new RegExp(k.pattern),";"));yield"".concat(ce,".test(").concat(R,")")}k.format!==void 0&&(yield"format('".concat(k.format,"', ").concat(R,")"))}s(D,"FromString");function*F(k,K,R){yield"(typeof ".concat(R," === 'symbol')")}s(F,"FromSymbol");function*L(k,K,R){yield"(typeof ".concat(R," === 'string')");let ce=st("".concat(new RegExp(k.pattern),";"));yield"".concat(ce,".test(").concat(R,")")}s(L,"FromTemplateLiteral");function*H(k,K,R){yield"".concat(gt(k.$ref),"(").concat(R,")")}s(H,"FromThis");function*U(k,K,R){if(yield"Array.isArray(".concat(R,")"),k.items===void 0)return yield"".concat(R,".length === 0");yield"(".concat(R,".length === ").concat(k.maxItems,")");for(let ce=0;ce<k.items.length;ce++){let oe=Ae(k.items[ce],K,"".concat(R,"[").concat(ce,"]"));yield"".concat(oe)}}s(U,"FromTuple");function*G(k,K,R){yield"".concat(R," === undefined")}s(G,"FromUndefined");function*J(k,K,R){let ce=k.anyOf.map(oe=>Ae(oe,K,R));yield"(".concat(ce.join(" || "),")")}s(J,"FromUnion");function*X(k,K,R){yield"".concat(R," instanceof Uint8Array"),Me(k.maxByteLength)&&(yield"(".concat(R,".length <= ").concat(k.maxByteLength,")")),Me(k.minByteLength)&&(yield"(".concat(R,".length >= ").concat(k.minByteLength,")"))}s(X,"FromUint8Array");function*ie(k,K,R){yield"true"}s(ie,"FromUnknown");function*ee(k,K,R){yield cp.IsVoidLike(R)}s(ee,"FromVoid");function*be(k,K,R){let ce=de.instances.size;de.instances.set(ce,k),yield"kind('".concat(k[q],"', ").concat(ce,", ").concat(R,")")}s(be,"FromKind");function*ve(k,K,R,ce=!0){let oe=ft(k.$id)?[...K,k]:K,le=k;if(ce&&ft(k.$id)){let xe=gt(k.$id);if(de.functions.has(xe))return yield"".concat(xe,"(").concat(R,")");{let pr=Ye(xe,k,K,"value",!1);return de.functions.set(xe,pr),yield"".concat(xe,"(").concat(R,")")}}switch(le[q]){case"Any":return yield*r(le,oe,R);case"Array":return yield*n(le,oe,R);case"AsyncIterator":return yield*o(le,oe,R);case"BigInt":return yield*i(le,oe,R);case"Boolean":return yield*a(le,oe,R);case"Constructor":return yield*l(le,oe,R);case"Date":return yield*c(le,oe,R);case"Function":return yield*p(le,oe,R);case"Integer":return yield*f(le,oe,R);case"Intersect":return yield*m(le,oe,R);case"Iterator":return yield*y(le,oe,R);case"Literal":return yield*v(le,oe,R);case"Never":return yield*x(le,oe,R);case"Not":return yield*S(le,oe,R);case"Null":return yield*I(le,oe,R);case"Number":return yield*P(le,oe,R);case"Object":return yield*T(le,oe,R);case"Promise":return yield*M(le,oe,R);case"Record":return yield*w(le,oe,R);case"Ref":return yield*E(le,oe,R);case"RegExp":return yield*B(le,oe,R);case"String":return yield*D(le,oe,R);case"Symbol":return yield*F(le,oe,R);case"TemplateLiteral":return yield*L(le,oe,R);case"This":return yield*H(le,oe,R);case"Tuple":return yield*U(le,oe,R);case"Undefined":return yield*G(le,oe,R);case"Union":return yield*J(le,oe,R);case"Uint8Array":return yield*X(le,oe,R);case"Unknown":return yield*ie(le,oe,R);case"Void":return yield*ee(le,oe,R);default:if(!zr.Has(le[q]))throw new xM(k);return yield*be(le,oe,R)}}s(ve,"Visit");let de={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Ae(k,K,R,ce=!0){return"(".concat([...ve(k,K,R,ce)].join(" && "),")")}s(Ae,"CreateExpression");function gt(k){return"check_".concat(bM.Encode(k))}s(gt,"CreateFunctionName");function st(k){let K="local_".concat(de.variables.size);return de.variables.set(K,"const ".concat(K," = ").concat(k)),K}s(st,"CreateVariable");function Ye(k,K,R,ce,oe=!0){let[le,xe]=["\n",In=>"".padStart(In," ")],pr=Ve("value","any"),Gn=fe("boolean"),nn=[...ve(K,R,ce,oe)].map(In=>"".concat(xe(4)).concat(In)).join(" &&".concat(le));return"function ".concat(k,"(").concat(pr,")").concat(Gn," {").concat(le).concat(xe(2),"return (").concat(le).concat(nn).concat(le).concat(xe(2),")\n}")}s(Ye,"CreateFunction");function Ve(k,K){let R=de.language==="typescript"?": ".concat(K):"";return"".concat(k).concat(R)}s(Ve,"CreateParameter");function fe(k){return de.language==="typescript"?": ".concat(k):""}s(fe,"CreateReturns");function he(k,K,R){let ce=Ye("check",k,K,"value"),oe=Ve("value","any"),le=fe("boolean"),xe=[...de.functions.values()],pr=[...de.variables.values()],Gn=ft(k.$id)?"return function check(".concat(oe,")").concat(le," {\n return ").concat(gt(k.$id),"(value)\n}"):"return ".concat(ce);return[...pr,...xe,Gn].join("\n")}s(he,"Build");function re(...k){let K={language:"javascript"},[R,ce,oe]=k.length===2&&Ue(k[1])?[k[0],k[1],K]:k.length===2&&!Ue(k[1])?[k[0],[],k[1]]:k.length===3?[k[0],k[1],k[2]]:k.length===1?[k[0],[],K]:[null,[],K];if(de.language=oe.language,de.variables.clear(),de.functions.clear(),de.instances.clear(),!mt(R))throw new yx(R);for(let le of ce)if(!mt(le))throw new yx(le);return he(R,ce,oe)}s(re,"Code"),e.Code=re;function se(k,K=[]){let R=re(k,K,{language:"javascript"}),ce=globalThis.Function("kind","format","hash",R),oe=new Map(de.instances);function le(nn,In,yu){if(!zr.Has(nn)||!oe.has(In))return!1;let f3=zr.Get(nn),m3=oe.get(In);return f3(m3,yu)}s(le,"typeRegistryFunction");function xe(nn,In){return Zn.Has(nn)?Zn.Get(nn)(In):!1}s(xe,"formatRegistryFunction");function pr(nn){return Mc(nn)}s(pr,"hashFunction");let Gn=ce(le,xe,pr);return new gM(k,K,Gn,R)}s(se,"Compile"),e.Compile=se})(gx||(gx={}));d();d();var AG={},Mye=s(function(e,t,r,n,o){var i=new Worker(AG[t]||(AG[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(a){var l=a.data,c=l.$e$;if(c){var p=new Error(c[0]);p.code=c[1],p.stack=c[2],o(p,null)}else o(null,l)},i.postMessage(r,n),i},"wk"),er=Uint8Array,Yn=Uint16Array,Tg=Int32Array,im=new er([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sm=new er([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Cg=new er([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),LG=s(function(e,t){for(var r=new Yn(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Tg(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},"freb"),RG=LG(im,2),_M=RG.b,Sx=RG.r;_M[28]=258,Sx[258]=28;var NG=LG(sm,0),BG=NG.b,TM=NG.r,Pg=new Yn(32768);for(Dt=0;Dt<32768;++Dt)ul=(Dt&43690)>>1|(Dt&21845)<<1,ul=(ul&52428)>>2|(ul&13107)<<2,ul=(ul&61680)>>4|(ul&3855)<<4,Pg[Dt]=((ul&65280)>>8|(ul&255)<<8)>>1;var ul,Dt,hi=s(function(e,t,r){for(var n=e.length,o=0,i=new Yn(t);o<n;++o)e[o]&&++i[e[o]-1];var a=new Yn(t);for(o=1;o<t;++o)a[o]=a[o-1]+i[o-1]<<1;var l;if(r){l=new Yn(1<<t);var c=15-t;for(o=0;o<n;++o)if(e[o])for(var p=o<<4|e[o],f=t-e[o],m=a[e[o]-1]++<<f,y=m|(1<<f)-1;m<=y;++m)l[Pg[m]>>c]=p}else for(l=new Yn(n),o=0;o<n;++o)e[o]&&(l[o]=Pg[a[e[o]-1]++]>>15-e[o]);return l},"hMap"),pl=new er(288);for(Dt=0;Dt<144;++Dt)pl[Dt]=8;var Dt;for(Dt=144;Dt<256;++Dt)pl[Dt]=9;var Dt;for(Dt=256;Dt<280;++Dt)pl[Dt]=7;var Dt;for(Dt=280;Dt<288;++Dt)pl[Dt]=8;var Dt,om=new er(32);for(Dt=0;Dt<32;++Dt)om[Dt]=5;var Dt,$G=hi(pl,9,0),jG=hi(pl,9,1),GG=hi(om,5,0),UG=hi(om,5,1),vx=s(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),mi=s(function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),xx=s(function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),wg=s(function(e){return(e+7)/8|0},"shft"),up=s(function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new er(e.subarray(t,r))},"slc"),wx={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},VG=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Nr=s(function(e,t,r){var n=new Error(t||VG[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Nr),!r)throw n;return n},"err"),zG=s(function(e,t,r,n){var o=e.length,i=n?n.length:0;if(!o||t.f&&!t.l)return r||new er(0);var a=!r,l=a||t.i!=2,c=t.i;a&&(r=new er(o*3));var p=s(function(R){var ce=r.length;if(R>ce){var oe=new er(Math.max(ce*2,R));oe.set(r),r=oe}},"cbuf"),f=t.f||0,m=t.p||0,y=t.b||0,v=t.l,x=t.d,S=t.m,I=t.n,P=o*8;do{if(!v){f=mi(e,m,1);var T=mi(e,m+1,3);if(m+=3,T)if(T==1)v=jG,x=UG,S=9,I=5;else if(T==2){var B=mi(e,m,31)+257,D=mi(e,m+10,15)+4,F=B+mi(e,m+5,31)+1;m+=14;for(var L=new er(F),H=new er(19),U=0;U<D;++U)H[Cg[U]]=mi(e,m+U*3,7);m+=D*3;for(var G=vx(H),J=(1<<G)-1,X=hi(H,G,1),U=0;U<F;){var ie=X[mi(e,m,J)];m+=ie&15;var M=ie>>4;if(M<16)L[U++]=M;else{var ee=0,be=0;for(M==16?(be=3+mi(e,m,3),m+=2,ee=L[U-1]):M==17?(be=3+mi(e,m,7),m+=3):M==18&&(be=11+mi(e,m,127),m+=7);be--;)L[U++]=ee}}var ve=L.subarray(0,B),de=L.subarray(B);S=vx(ve),I=vx(de),v=hi(ve,S,1),x=hi(de,I,1)}else Nr(1);else{var M=wg(m)+4,w=e[M-4]|e[M-3]<<8,E=M+w;if(E>o){c&&Nr(0);break}l&&p(y+w),r.set(e.subarray(M,E),y),t.b=y+=w,t.p=m=E*8,t.f=f;continue}if(m>P){c&&Nr(0);break}}l&&p(y+131072);for(var Ae=(1<<S)-1,gt=(1<<I)-1,st=m;;st=m){var ee=v[xx(e,m)&Ae],Ye=ee>>4;if(m+=ee&15,m>P){c&&Nr(0);break}if(ee||Nr(2),Ye<256)r[y++]=Ye;else if(Ye==256){st=m,v=null;break}else{var Ve=Ye-254;if(Ye>264){var U=Ye-257,fe=im[U];Ve=mi(e,m,(1<<fe)-1)+_M[U],m+=fe}var he=x[xx(e,m)&gt],re=he>>4;he||Nr(3),m+=he&15;var de=BG[re];if(re>3){var fe=sm[re];de+=xx(e,m)&(1<<fe)-1,m+=fe}if(m>P){c&&Nr(0);break}l&&p(y+131072);var se=y+Ve;if(y<de){var k=i-de,K=Math.min(de,se);for(k+y<0&&Nr(3);y<K;++y)r[y]=n[k+y]}for(;y<se;++y)r[y]=r[y-de]}}t.l=v,t.p=st,t.b=y,t.f=f,v&&(f=1,t.m=S,t.d=x,t.n=I)}while(!f);return y!=r.length&&a?up(r,0,y):r.subarray(0,y)},"inflt"),Js=s(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},"wbits"),rm=s(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},"wbits16"),Ix=s(function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:kM,l:0};if(o==1){var a=new er(r[0].s+1);return a[r[0].s]=1,{t:a,l:1}}r.sort(function(E,B){return E.f-B.f}),r.push({s:-1,f:25001});var l=r[0],c=r[1],p=0,f=1,m=2;for(r[0]={s:-1,f:l.f+c.f,l,r:c};f!=o-1;)l=r[r[p].f<r[m].f?p++:m++],c=r[p!=f&&r[p].f<r[m].f?p++:m++],r[f++]={s:-1,f:l.f+c.f,l,r:c};for(var y=i[0].s,n=1;n<o;++n)i[n].s>y&&(y=i[n].s);var v=new Yn(y+1),x=Cx(r[f-1],v,0);if(x>t){var n=0,S=0,I=x-t,P=1<<I;for(i.sort(function(B,D){return v[D.s]-v[B.s]||B.f-D.f});n<o;++n){var T=i[n].s;if(v[T]>t)S+=P-(1<<x-v[T]),v[T]=t;else break}for(S>>=I;S>0;){var M=i[n].s;v[M]<t?S-=1<<t-v[M]++-1:++n}for(;n>=0&&S;--n){var w=i[n].s;v[w]==t&&(--v[w],++S)}x=t}return{t:new er(v),l:x}},"hTree"),Cx=s(function(e,t,r){return e.s==-1?Math.max(Cx(e.l,t,r+1),Cx(e.r,t,r+1)):t[e.s]=r},"ln"),wM=s(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Yn(++t),n=0,o=e[0],i=1,a=s(function(c){r[n++]=c},"w"),l=1;l<=t;++l)if(e[l]==o&&l!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[l]}return{c:r.subarray(0,n),n:t}},"lc"),nm=s(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),AM=s(function(e,t,r){var n=r.length,o=wg(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},"wfblk"),MM=s(function(e,t,r,n,o,i,a,l,c,p,f){Js(t,f++,r),++o[256];for(var m=Ix(o,15),y=m.t,v=m.l,x=Ix(i,15),S=x.t,I=x.l,P=wM(y),T=P.c,M=P.n,w=wM(S),E=w.c,B=w.n,D=new Yn(19),F=0;F<T.length;++F)++D[T[F]&31];for(var F=0;F<E.length;++F)++D[E[F]&31];for(var L=Ix(D,7),H=L.t,U=L.l,G=19;G>4&&!H[Cg[G-1]];--G);var J=p+5<<3,X=nm(o,pl)+nm(i,om)+a,ie=nm(o,y)+nm(i,S)+a+14+3*G+nm(D,H)+2*D[16]+3*D[17]+7*D[18];if(c>=0&&J<=X&&J<=ie)return AM(t,f,e.subarray(c,c+p));var ee,be,ve,de;if(Js(t,f,1+(ie<X)),f+=2,ie<X){ee=hi(y,v,0),be=y,ve=hi(S,I,0),de=S;var Ae=hi(H,U,0);Js(t,f,M-257),Js(t,f+5,B-1),Js(t,f+10,G-4),f+=14;for(var F=0;F<G;++F)Js(t,f+3*F,H[Cg[F]]);f+=3*G;for(var gt=[T,E],st=0;st<2;++st)for(var Ye=gt[st],F=0;F<Ye.length;++F){var Ve=Ye[F]&31;Js(t,f,Ae[Ve]),f+=H[Ve],Ve>15&&(Js(t,f,Ye[F]>>5&127),f+=Ye[F]>>12)}}else ee=$G,be=pl,ve=GG,de=om;for(var F=0;F<l;++F){var fe=n[F];if(fe>255){var Ve=fe>>18&31;rm(t,f,ee[Ve+257]),f+=be[Ve+257],Ve>7&&(Js(t,f,fe>>23&31),f+=im[Ve]);var he=fe&31;rm(t,f,ve[he]),f+=de[he],he>3&&(rm(t,f,fe>>5&8191),f+=sm[he])}else rm(t,f,ee[fe]),f+=be[fe]}return rm(t,f,ee[256]),f+be[256]},"wblk"),HG=new Tg([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kM=new er(0),WG=s(function(e,t,r,n,o,i){var a=i.z||e.length,l=new er(n+a+5*(1+Math.ceil(a/7e3))+o),c=l.subarray(n,l.length-o),p=i.l,f=(i.r||0)&7;if(t){f&&(c[0]=i.r>>3);for(var m=HG[t-1],y=m>>13,v=m&8191,x=(1<<r)-1,S=i.p||new Yn(32768),I=i.h||new Yn(x+1),P=Math.ceil(r/3),T=2*P,M=s(function(le){return(e[le]^e[le+1]<<P^e[le+2]<<T)&x},"hsh"),w=new Tg(25e3),E=new Yn(288),B=new Yn(32),D=0,F=0,L=i.i||0,H=0,U=i.w||0,G=0;L+2<a;++L){var J=M(L),X=L&32767,ie=I[J];if(S[X]=ie,I[J]=X,U<=L){var ee=a-L;if((D>7e3||H>24576)&&(ee>423||!p)){f=MM(e,c,0,w,E,B,F,H,G,L-G,f),H=D=F=0,G=L;for(var be=0;be<286;++be)E[be]=0;for(var be=0;be<30;++be)B[be]=0}var ve=2,de=0,Ae=v,gt=X-ie&32767;if(ee>2&&J==M(L-gt))for(var st=Math.min(y,ee)-1,Ye=Math.min(32767,L),Ve=Math.min(258,ee);gt<=Ye&&--Ae&&X!=ie;){if(e[L+ve]==e[L+ve-gt]){for(var fe=0;fe<Ve&&e[L+fe]==e[L+fe-gt];++fe);if(fe>ve){if(ve=fe,de=gt,fe>st)break;for(var he=Math.min(gt,fe-2),re=0,be=0;be<he;++be){var se=L-gt+be&32767,k=S[se],K=se-k&32767;K>re&&(re=K,ie=se)}}}X=ie,ie=S[X],gt+=X-ie&32767}if(de){w[H++]=268435456|Sx[ve]<<18|TM[de];var R=Sx[ve]&31,ce=TM[de]&31;F+=im[R]+sm[ce],++E[257+R],++B[ce],U=L+ve,++D}else w[H++]=e[L],++E[e[L]]}}for(L=Math.max(L,U);L<a;++L)w[H++]=e[L],++E[e[L]];f=MM(e,c,p,w,E,B,F,H,G,L-G,f),p||(i.r=f&7|c[f/8|0]<<3,f-=7,i.h=I,i.p=S,i.i=L,i.w=U)}else{for(var L=i.w||0;L<a+p;L+=65535){var oe=L+65535;oe>=a&&(c[f/8|0]=p,oe=a),f=AM(c,f+1,e.subarray(L,oe))}i.i=a}return up(l,0,n+wg(f)+o)},"dflt"),Oye=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e}(),Eye=s(function(){var e=-1;return{p:s(function(t){for(var r=e,n=0;n<t.length;++n)r=Oye[r&255^t[n]]^r>>>8;e=r},"p"),d:s(function(){return~e},"d")}},"crc");var qG=s(function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new er(i.length+e.length);a.set(i),a.set(e,i.length),e=a,o.w=i.length}return WG(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)},"dopt"),DM=s(function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},"mrg"),kG=s(function(e,t,r){for(var n=e(),o=e.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<n.length;++a){var l=n[a],c=i[a];if(typeof l=="function"){t+=";"+c+"=";var p=l.toString();if(l.prototype)if(p.indexOf("[native code]")!=-1){var f=p.indexOf(" ",8)+1;t+=p.slice(f,p.indexOf("(",f))}else{t+=p;for(var m in l.prototype)t+=";"+c+".prototype."+m+"="+l.prototype[m].toString()}else t+=p}else r[c]=l}return t},"wcln"),bx=[],_ye=s(function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},"cbfs"),Aye=s(function(e,t,r,n){if(!bx[r]){for(var o="",i={},a=e.length-1,l=0;l<a;++l)o=kG(e[l],o,i);bx[r]={c:kG(e[a],o,i),e:i}}var c=DM({},bx[r].e);return Mye(bx[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,c,_ye(c),n)},"wrkr"),kye=s(function(){return[er,Yn,Tg,im,sm,Cg,_M,BG,jG,UG,Pg,VG,hi,vx,mi,xx,wg,up,Nr,zG,LM,Mx,ZG]},"bInflt"),Dye=s(function(){return[er,Yn,Tg,im,sm,Cg,Sx,TM,$G,pl,GG,om,Pg,HG,kM,hi,Js,rm,Ix,Cx,wM,nm,AM,MM,wg,up,WG,qG,FM,Mx]},"bDflt");var Mx=s(function(e){return postMessage(e,[e.buffer])},"pbf"),ZG=s(function(e){return e&&{out:e.size&&new er(e.size),dictionary:e.dictionary}},"gopt"),XG=s(function(e,t,r,n,o,i){var a=Aye(r,n,o,function(l,c){a.terminate(),i(l,c)});return a.postMessage([e,t],t.consume?[e.buffer]:[]),function(){a.terminate()}},"cbify");var Qs=s(function(e,t){return e[t]|e[t+1]<<8},"b2"),Xi=s(function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),PM=s(function(e,t){return Xi(e,t)+Xi(e,t+4)*4294967296},"b8"),fn=s(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},"wbytes");function Fye(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Nr(7),XG(e,t,[Dye],function(n){return Mx(FM(n.data[0],n.data[1]))},0,r)}s(Fye,"deflate");function FM(e,t){return qG(e,t||{},0,0)}s(FM,"deflateSync");function Lye(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Nr(7),XG(e,t,[kye],function(n){return Mx(LM(n.data[0],ZG(n.data[1])))},1,r)}s(Lye,"inflate");function LM(e,t){return zG(e,{i:2},t&&t.out,t&&t.dictionary)}s(LM,"inflateSync");var YG=s(function(e,t,r,n){for(var o in e){var i=e[o],a=t+o,l=n;Array.isArray(i)&&(l=DM(n,i[1]),i=i[0]),i instanceof er?r[a]=[i,l]:(r[a+="/"]=[new er(0),l],YG(i,a,r,n))}},"fltn"),DG=typeof TextEncoder<"u"&&new TextEncoder,OM=typeof TextDecoder<"u"&&new TextDecoder,Rye=0;try{OM.decode(kM,{stream:!0}),Rye=1}catch{}var Nye=s(function(e){for(var t="",r=0;;){var n=e[r++],o=(n>127)+(n>223)+(n>239);if(r+o>e.length)return{s:t,r:up(e,r-1)};o?o==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}},"dutf8");function Px(e,t){if(t){for(var r=new er(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(DG)return DG.encode(e);for(var o=e.length,i=new er(e.length+(e.length>>1)),a=0,l=s(function(f){i[a++]=f},"w"),n=0;n<o;++n){if(a+5>i.length){var c=new er(a+8+(o-n<<1));c.set(i),i=c}var p=e.charCodeAt(n);p<128||t?l(p):p<2048?(l(192|p>>6),l(128|p&63)):p>55295&&p<57344?(p=65536+(p&1047552)|e.charCodeAt(++n)&1023,l(240|p>>18),l(128|p>>12&63),l(128|p>>6&63),l(128|p&63)):(l(224|p>>12),l(128|p>>6&63),l(128|p&63))}return up(i,0,a)}s(Px,"strToU8");function RM(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(OM)return OM.decode(e);var o=Nye(e),i=o.s,r=o.r;return r.length&&Nr(8),i}}s(RM,"strFromU8");var Bye=s(function(e,t){return t+30+Qs(e,t+26)+Qs(e,t+28)},"slzh"),$ye=s(function(e,t,r){var n=Qs(e,t+28),o=RM(e.subarray(t+46,t+46+n),!(Qs(e,t+8)&2048)),i=t+46+n,a=Xi(e,t+20),l=r&&a==4294967295?jye(e,i):[a,Xi(e,t+24),Xi(e,t+42)],c=l[0],p=l[1],f=l[2];return[Qs(e,t+10),c,p,o,i+Qs(e,t+30)+Qs(e,t+32),f]},"zh"),jye=s(function(e,t){for(;Qs(e,t)!=1;t+=4+Qs(e,t+2));return[PM(e,t+12),PM(e,t+4),PM(e,t+20)]},"z64e"),EM=s(function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&Nr(9),t+=n+4}return t},"exfl"),FG=s(function(e,t,r,n,o,i,a,l){var c=n.length,p=r.extra,f=l&&l.length,m=EM(p);fn(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(i<0&&8),e[t++]=o&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var y=new Date(r.mtime==null?Date.now():r.mtime),v=y.getFullYear()-1980;if((v<0||v>119)&&Nr(10),fn(e,t,v<<25|y.getMonth()+1<<21|y.getDate()<<16|y.getHours()<<11|y.getMinutes()<<5|y.getSeconds()>>1),t+=4,i!=-1&&(fn(e,t,r.crc),fn(e,t+4,i<0?-i-2:i),fn(e,t+8,r.size)),fn(e,t+12,c),fn(e,t+14,m),t+=16,a!=null&&(fn(e,t,f),fn(e,t+6,r.attrs),fn(e,t+10,a),t+=14),e.set(n,t),t+=c,m)for(var x in p){var S=p[x],I=S.length;fn(e,t,+x),fn(e,t+2,I),e.set(S,t+4),t+=4+I}return f&&(e.set(l,t),t+=f),t},"wzh"),Gye=s(function(e,t,r,n,o){fn(e,t,101010256),fn(e,t+8,r),fn(e,t+10,r),fn(e,t+12,n),fn(e,t+16,o)},"wzf");function KG(e,t,r){r||(r=t,t={}),typeof r!="function"&&Nr(7);var n={};YG(e,"",n,t);var o=Object.keys(n),i=o.length,a=0,l=0,c=i,p=new Array(i),f=[],m=s(function(){for(var I=0;I<f.length;++I)f[I]()},"tAll"),y=s(function(I,P){Tx(function(){r(I,P)})},"cbd");Tx(function(){y=r});var v=s(function(){var I=new er(l+22),P=a,T=l-a;l=0;for(var M=0;M<c;++M){var w=p[M];try{var E=w.c.length;FG(I,l,w,w.f,w.u,E);var B=30+w.f.length+EM(w.extra),D=l+B;I.set(w.c,D),FG(I,a,w,w.f,w.u,E,l,w.m),a+=16+B+(w.m?w.m.length:0),l=D+E}catch(F){return y(F,null)}}Gye(I,a,p.length,T,P),y(null,I)},"cbf");i||v();for(var x=s(function(I){var P=o[I],T=n[P],M=T[0],w=T[1],E=Eye(),B=M.length;E.p(M);var D=Px(P),F=D.length,L=w.comment,H=L&&Px(L),U=H&&H.length,G=EM(w.extra),J=w.level==0?0:8,X=s(function(ie,ee){if(ie)m(),y(ie,null);else{var be=ee.length;p[I]=DM(w,{size:B,crc:E.d(),c:ee,f:D,m:H,u:F!=P.length||H&&L.length!=U,compression:J}),a+=30+F+G+be,l+=76+2*(F+G)+(U||0)+be,--i||v()}},"cbl");if(F>65535&&X(Nr(11,0,1),null),!J)X(null,M);else if(B<16e4)try{X(null,FM(M,w))}catch(ie){X(ie,null)}else f.push(Fye(M,w,X))},"_loop_1"),S=0;S<c;++S)x(S);return m}s(KG,"zip");var Tx=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function JG(e,t,r){r||(r=t,t={}),typeof r!="function"&&Nr(7);var n=[],o=s(function(){for(var I=0;I<n.length;++I)n[I]()},"tAll"),i={},a=s(function(I,P){Tx(function(){r(I,P)})},"cbd");Tx(function(){a=r});for(var l=e.length-22;Xi(e,l)!=101010256;--l)if(!l||e.length-l>65558)return a(Nr(13,0,1),null),o;var c=Qs(e,l+8);if(c){var p=c,f=Xi(e,l+16),m=f==4294967295||p==65535;if(m){var y=Xi(e,l-12);m=Xi(e,y)==101075792,m&&(p=c=Xi(e,y+32),f=Xi(e,y+48))}for(var v=t&&t.filter,x=s(function(I){var P=$ye(e,f,m),T=P[0],M=P[1],w=P[2],E=P[3],B=P[4],D=P[5],F=Bye(e,D);f=B;var L=s(function(U,G){U?(o(),a(U,null)):(G&&(i[E]=G),--c||a(null,i))},"cbl");if(!v||v({name:E,size:M,originalSize:w,compression:T}))if(!T)L(null,up(e,F,F+M));else if(T==8){var H=e.subarray(F,F+M);if(w<524288||M>.8*w)try{L(null,LM(H,{out:new er(w)}))}catch(U){L(U,null)}else n.push(Lye(H,{size:w},L))}else L(Nr(14,"unknown compression type "+T,1),null);else L(null,null)},"_loop_3"),S=0;S<p;++S)x(S)}else a(null,{});return o}s(JG,"unzip");d();var Uye=s(e=>{if(e!=null)return e.trim()===""?void 0:e},"maybePath"),Vye=s(e=>e!=null,"notNull"),Ox=s((e,t,r=0)=>{var n;if(N.IsNull(e))return"null";if(N.IsUndefined(e))return"undefined";if(N.IsString(e))return"<string>";if(N.IsNumber(e))return"<number>";if(N.IsBoolean(e))return"<boolean>";if(N.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(N.IsRef(e)){let o=t.find(i=>i.$id===e.$ref);return o==null?e.$ref:Ox(o,t,r)}if(N.IsArray(e))return"".concat(Ox(e.items,t,r+1),"[]");if(N.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let i="".concat(e.anyOf.map(a=>Ox(a,t,r+1)).filter(Vye).join(" | "));return r>0?"(".concat(i,")"):i}return(n=e.$id)!=null?n:""},"resolveSchemaIdent"),zye=s((e,t,r)=>{var i;let n=t.message;N.IsUnion(t.schema)&&(n="Expected one of: ".concat(Ox(t.schema,r)));let o="#/definitions/".concat(e).concat((i=Uye(t.path))!=null?i:"");return"".concat(o,": ").concat(n)},"errorHandler"),Ex=s((e,t,r)=>{let n=t.First();if(n!=null)return zye(e,n,r)},"shortError");var am;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(am||(am={}));var BM=class BM extends Error{constructor(r,n){super(n);h(this,"name");h(this,"kind");this.name="CompressError",this.kind=r}};s(BM,"CompressError");var lm=BM,Hye=s(e=>new lm(am.Archive,e.message),"flateErrorIntoCompressError"),Wye=s(e=>{let t=Object.values(wx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),qye=s((e,t,r)=>{var n;return new lm(am.Validate,(n=Ex(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoCompressError"),Zye=s(e=>new lm(am.Encode,e.message),"encodeErrorIntoCompressError"),Xye=s(e=>new lm(am.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoCompressError"),NM=s((e,t,r)=>t instanceof sp?Zye(t):t instanceof pi?qye(e,t,r):Wye(t)?Hye(t):Xye(t),"intoCompressError");d();var cm;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(cm||(cm={}));var jM=class jM extends Error{constructor(r,n){super(n);h(this,"name");h(this,"kind");this.name="DecompressError",this.kind=r}};s(jM,"DecompressError");var um=jM,Yye=s(e=>new um(cm.Unarchive,e.message),"flateErrorIntoDecompressError"),Kye=s(e=>{let t=Object.values(wx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),Jye=s((e,t,r)=>{var n;return new um(cm.Validate,(n=Ex(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoDecompressError"),Qye=s(e=>new um(cm.Decode,e.message),"decodeErrorIntoDecompressError"),ege=s(e=>new um(cm.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoDecompressError"),$M=s((e,t,r)=>t instanceof ip?Qye(t):t instanceof pi?Jye(e,t,r):Kye(t)?Yye(t):ege(t),"intoDecompressError");d();d();d();var tge=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,rge=[0,31,28,31,30,31,30,31,31,30,31,30,31],nge=s(e=>e%4===0&&(e%100!==0||e%400===0),"isLeapYear"),_x=s(e=>{let t=tge.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&nge(r)?29:rge[n])},"date");d();var oge=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,Ax=s(e=>{let t=oge.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3],i=t[4],a=t[5]==="-"?-1:1,l=+(t[6]||0),c=+(t[7]||0);if(l>23||c>59||!i)return!1;if(r<=23&&n<=59&&o<60)return!0;let p=n-c*a,f=r-l*a-(p<0?1:0);return(f===23||f===-1)&&(p===59||p===-1)&&o<61},"time");var ige=/t|\s/i,QG=s(e=>{let t=e.split(ige);return t.length===2&&_x(t[0])&&Ax(t[1])},"dateTime");d();var sge=/\/|:/,age=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,eU=s(e=>sge.test(e)&&age.test(e),"uri");var lge=[["date",_x],["time",Ax],["date-time",QG],["uri",eU]],tU=s(()=>{for(let[e,t]of lge)try{Jv.Format(e,t)}catch(r){if(r instanceof vg)continue;throw r}},"registerFormats");d();d();d();var rU=s(e=>e instanceof Error?e:new Error(String(e)),"asError");var kx=s(e=>(...t)=>{try{return pe(e(...t))}catch(r){return ge(rU(r))}},"safeFn");var cge=kx((e,t)=>{let r={};for(let n of t)for(let o of n.intoBundle(e))r[o.path]=Px(JSON.stringify(o.contents));return r}),GM=s(async(e,t,r)=>cge(e,t).andThenAsync(n=>new Promise(o=>{KG(n,{...r,consume:!0},(i,a)=>{o(i?ge(i):pe(a))})})),"compress");d();d();function Dx(e,t,r=[]){let n={...e};for(let[o,i]of Object.entries(t))if(i!==void 0)if(o in n){let a=o;if(Array.isArray(i)&&i.length>0){let l=uge(i[0],r);if(l){let c=n[a];if(!Array.isArray(c))throw new Error("Expected array at ".concat(o,", got ").concat(typeof c));let p=new Map(i.map(y=>[nU(y,l),y])),m=c.map(y=>{let v=p.get(nU(y,l));return v?Dx(y,v,r):y});n[a]=m}else n[a]=i}else{let l=n[a];typeof l=="object"&&l!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?n[a]=i:n[a]=Dx(l,i,r):n[o]=i}}else n[o]=i;return n}s(Dx,"deepMergeOn");function uge(e,t){function r(n){if(typeof n!="object"||n===null)return null;for(let o of t)if(o in n&&typeof n[o]<"u")return[o];if(Array.isArray(n))return null;for(let[o,i]of Object.entries(n)){let a=r(i);if(a)return[o,...a]}return null}return s(r,"search"),r(e)}s(uge,"findIdentifierKey");function nU(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}s(nU,"getValueByKeyPath");var pge=s(e=>e,"identity"),dge=s(e=>JSON.parse(RM(e)),"jsonDecode"),fge=s((e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,pge)!==void 0),"isFileExpected"),mge=kx((e,t)=>{let r={};for(let n of Object.keys(e)){let o=e[n];for(let i of t){let a=i.fromBundle(n,o,dge);if(a){r=Dx(r,a,[]);break}}}return r}),UM=s(async(e,t)=>new Promise(r=>JG(e,{filter:s(n=>fge(n,t),"filter")},(n,o)=>{r(n?ge(n):pe(o))})).then(r=>r.andThen(n=>mge(n,t))),"decompress");d();var hge=s(e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string","isRef"),yge=s(e=>{if(e.length<2)return!1;let t=e.filter(hge);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},"isDuplicateRef"),Fx=s(e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&yge(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Fx(r)])):Array.isArray(e)?e.map(Fx):e,"fixDuplicateAllOf");d();var Lx=s(e=>typeof e=="object"&&e!=null&&"$ref"in e?{...e,$ref:"#/definitions/".concat(e.$ref)}:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Lx(r)])):Array.isArray(e)?e.map(Lx):e,"prefixReferences");var pm;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(pm||(pm={}));var gge=s(e=>({next(){for(let r of e){let n=r.next();if(!n.done)return n}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),"join"),bge=s((...e)=>{let t=new Map;for(let r of gge(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return ge({kind:pm.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:r});t.set(r.$id,r)}return pe(t)},"computeReferenceMap"),yi,pp,dl,Yi,Nx=class Nx{constructor(t,r,n,o){O(this,yi);O(this,pp);O(this,dl,[]);O(this,Yi);A(this,yi,t),A(this,pp,r),A(this,dl,n),A(this,Yi,o),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(t,r="CoreMVF"){let n=C.Composite(t.extensions.map(i=>i.schema),{$id:r});if(!N.IsSchema(n))return ge({kind:pm.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let o=bge(Ew.values(),Sw.values(),Pw.values(),ww.values(),Mw.values(),Bw.values(),t.extensions.flatMap(i=>{var a;return(a=i.references)!=null?a:[]}).values());if(!o.isOk())return o;try{tU();let i=gx.Compile(n,[...o.value.values()]);return pe(new Nx(n,i,t.extensions,o.value))}catch(i){return i instanceof ke?ge({kind:pm.TypeboxError,message:i.message,original:i}):ge({kind:pm.UnknownError,message:"An unknown error occurred while compiling the schema",original:i})}}is(t){return u(this,pp).Check(t)}parse(t){return u(this,pp).Check(t)?pe(t):ge(u(this,pp).Errors(t))}decode(t){try{return pe(EG(u(this,yi),[...u(this,Yi).values()],t))}catch(r){return ge(r)}}encode(t){try{return pe(_G(u(this,yi),[...u(this,Yi).values()],t))}catch(r){return ge(r)}}verify(t){for(let r of u(this,dl))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return ge(n.error)}return pe(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([u(this,yi),...u(this,Yi).values()])),r=Fx(Lx({$id:"#/definitions/".concat((n=u(this,yi).$id)!=null?n:"CoreMVF"),$schema:"http://json-schema.org/draft-07/schema#",references:t}));return JSON.stringify(r,null,2)}async compress(t){return this.encode(t).andThen(r=>this.parse(r)).andThenAsync(r=>GM(r,u(this,dl))).then(r=>r.mapErr(n=>{var o;return NM((o=u(this,yi).$id)!=null?o:"CoreMVF",n,[...u(this,Yi).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>GM(r,u(this,dl))).then(r=>r.mapErr(n=>{var o;return NM((o=u(this,yi).$id)!=null?o:"CoreMVF",n,[...u(this,Yi).values()])}))}async decompress(t){return UM(t,u(this,dl)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var o;return $M((o=u(this,yi).$id)!=null?o:"CoreMVF",n,[...u(this,Yi).values()])}))}async decompressUnsafe(t){return UM(t,u(this,dl)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var o;return $M((o=u(this,yi).$id)!=null?o:"CoreMVF",n,[...u(this,Yi).values()])}))}};yi=new WeakMap,pp=new WeakMap,dl=new WeakMap,Yi=new WeakMap,s(Nx,"MVFParser");var Rx=Nx;var dm,VM=class VM{constructor(){O(this,dm,[]);this.extend=this.extend.bind(this)}extend(t){return u(this,dm).push(t),this}extendOptional(t){let r={...t,schema:C.Partial(t.schema)};return u(this,dm).push(r),this}build(){return Rx.create(this)}get extensions(){return u(this,dm)}};dm=new WeakMap,s(VM,"MVFParserBuilder");var Bx=VM;var oU=s(()=>new Bx().extend(Vj).extend(Xj).extend(Qj),"createParser");d();d();d();var Ki;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Ki||(Ki={}));var iU=s(e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return pe(!0);let r=Object.entries(t).map(([i,a])=>({key:i,...a})).sort((i,a)=>i.index!==a.index?i.index-a.index:i.bit-a.bit),n=0,o=-1;for(let i of r){if(i.bit===o)return ge({kind:Ki.NavigationFlagDuplicateBit,properties:{index:i.index,bit:i.bit,path:"navigationFlags.".concat(i.key)}});if(i.index!=n){if(o!=31)return ge({kind:Ki.NavigationFlagMissingDeclaration,properties:{index:n,bit:o+1,path:"navigationFlags"}});if(i.index!=n+1||i.bit!=0)return ge({kind:Ki.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=i.index,o=0}else{if(i.bit!==o+1)return ge({kind:Ki.NavigationFlagMissingDeclaration,properties:{index:i.index,bit:o+1,path:"navigationFlags"}});o=i.bit}}return pe(!0)},"validateNavigationFlags");d();var sU=2**32-1,$x=s(e=>{var o;let t=Object.keys((o=e.navigationFlags)!=null?o:{}).length;if(t===0)return{index:-1,flag:0};let r=Math.floor(t/32),n=t%32;return{index:r,flag:2**n-1}},"determineMaxNavigationFlags"),Mg=s((e,t,r)=>{if(t.index==-1&&e.length===0)return pe(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return ge({kind:Ki.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:e.length,path:r}});for(let o=0;o<e.length;o++){let i=e[o];if(o<t.index){if(i>sU)return ge({kind:Ki.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:sU,path:r}});continue}else if(i>t.flag)return ge({kind:Ki.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:t.flag,path:r}})}return pe(!0)},"validateFlags");d();function Og(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}s(Og,"hasFlag");var vge=C.Object({index:C.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:C.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),aU=C.Intersect([vge,qi],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'}),zM={accessible:"accessible",outdoors:"outdoors"},lU=C.Record(C.String(),aU,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),xge=C.Object({navigationFlags:C.Ref(lU)},{$id:"NavigationFlagsSchema"}),jx=C.Array(C.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),HM=C.Object({flags:C.Ref(jx)},{$id:"WithFlags"}),dp=C.Intersect([Hf,HM],{$id:"FlaggedGeometryAnchor"}),Ige=C.Object({geometryAnchor:dp},{$id:"WithFlaggedGeometryAnchor"}),Sge=C.Object({geometryAnchors:C.Array(dp)},{$id:"WithFlaggedGeometryAnchors"}),cU={name:"ext:mvf-navigation-flags",schema:xge,intoBundle:s(function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},"intoBundle"),fromBundle:s((e,t,r)=>e!=="navigationFlags.json"?void 0:{navigationFlags:r(t)},"fromBundle"),references:[aU,lU,jx,dp,Ige,Sge],integrityCheck:iU};d();var uU=s(e=>{if(e.connections==null)return pe(!0);let t=Ar(e),r=$x(e);for(let[n,o]of e.connections.entries()){for(let[i,a]of o.entrances.entries()){let l=t(a.floorId,a.geometryId);if(l.isErr())return l;let c=Mg(a.flags,r,"connections[".concat(n,"].entrances[").concat(i,"]"));if(c.isErr())return c}for(let[i,a]of o.exits.entries()){let l=t(a.floorId,a.geometryId);if(l.isErr())return l;let c=Mg(a.flags,r,"connections[".concat(n,"].exits[").concat(i,"]"));if(c.isErr())return c}}return pe(!0)},"validateConnections");var dU=Qt("c","ConnectionId"),{schema:Cge,values:Mtt,record:Pge}=xo(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),fU=Cge;var WM=Pge,mU=C.Intersect([C.Object({id:C.Ref(dU,{description:"The unique identifier for the connection."}),entrances:C.Array(C.Ref(dp)),exits:C.Array(C.Ref(dp)),entryCost:C.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:C.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:C.Ref(fU,{description:"The type of connection."})}),qi,Zi],{$id:"ConnectionsProperties"}),hU=C.Array(C.Ref(mU),{$id:"ConnectionsCollection"}),Tge=C.Object({connections:C.Ref(hU)},{$id:"ConnectionsExtensionSchema"}),pU="connections.json",yU={name:"ext:connections",schema:Tge,intoBundle:s(function*(e){e.connections!=null&&(yield{path:pU,contents:e.connections})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===pU)return{connections:r(t)}},"fromBundle"),references:[mU,hU,fU,dU,dp,jx],integrityCheck:uU};d();d();var gU=s(e=>{if(e.defaultStyle==null)return pe(!0);let t=Ar(e);for(let r of Object.values(e.defaultStyle))if(r!=null)for(let n of r.geometryAnchors){let o=t(n.floorId,n.geometryId);if(o.isErr())return o}return pe(!0)},"validateDefaultStyle");var bU=C.Intersect([np(),Zi,C.Object({altitude:C.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:C.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:C.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:C.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:C.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:C.Optional(C.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),vU=C.Record(C.String(),C.Ref(bU),{$id:"DefaultStyleCollection",additionalProperties:!1}),wge=C.Object({defaultStyle:C.Ref(vU)},{$id:"DefaultStyleSchema"}),xU={name:"ext:mvf-default-style",schema:wge,intoBundle:s(function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e==="default-style.json")return{defaultStyle:r(t)}},"fromBundle"),references:[bU,vU],integrityCheck:gU};d();d();d();var fp=Qt("lcat","LocationCategoryId"),qM=C.Intersect([C.Object({id:C.Ref(fp),parent:C.Optional(C.Ref(fp))}),rp(["name"]),Zi],{$id:"LocationCategory"}),IU=[fp,qM];d();d();var mp;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(mp||(mp={}));var SU=s(e=>{var o,i,a,l,c,p,f,m,y;if(e.locationCategories==null&&e.locations==null)return pe(!0);let t=new Set((i=(o=e.locationCategories)==null?void 0:o.map(v=>v.id))!=null?i:[]);for(let v of(a=e.locationCategories)!=null?a:[])if(v.parent!=null&&!t.has(v.parent))return ge({kind:mp.UnknownParentCategoryError,properties:{categoryId:v.id,parentCategoryId:v.parent}});let r=Ar(e);for(let v of(l=e.locations)!=null?l:[]){for(let x of v.categories)if(!t.has(x))return ge({kind:mp.UnknownCategoryError,properties:{locationId:v.id,categoryId:x}});for(let x of v.geometryAnchors){let S=r(x.floorId,x.geometryId);if(S.isErr())return S}}let n=new Set((p=(c=e.locations)==null?void 0:c.map(v=>v.id))!=null?p:[]);for(let v of(f=e.locationInstances)!=null?f:[]){if(!n.has(v.parentId))return ge({kind:mp.UnknownParentLocationError,properties:{locationInstanceId:v.id,parentLocationId:v.parentId}});for(let x of(m=v.categories)!=null?m:[])if(!t.has(x))return ge({kind:mp.UnknownCategoryError,properties:{locationId:v.id,categoryId:x}});for(let x of(y=v.geometryAnchors)!=null?y:[]){let S=r(x.floorId,x.geometryId);if(S.isErr())return S}}return pe(!0)},"validateLocations");d();var hp=Qt("loc","LocationId"),Gx=Qt("loci","LocationInstanceId"),CU=C.Object({name:C.String(),url:C.String({format:"uri"})},{$id:"LocationSocial"}),PU=C.Object({url:C.String({format:"uri"})},{$id:"LocationImage"}),ZM=C.Object({label:C.String(),url:C.String({format:"uri"})},{$id:"LocationLink"}),XM=C.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),TU=C.Union([C.Literal("Sunday"),C.Literal("Monday"),C.Literal("Tuesday"),C.Literal("Wednesday"),C.Literal("Thursday"),C.Literal("Friday"),C.Literal("Saturday")],{$id:"OpeningHoursDay"}),Mge="PublicHolidays",YM=C.Union([TU,C.Literal(Mge)],{$id:"OpeningHoursDayOrPublicHoliday"}),Ux=C.Object({"@type":C.Optional(C.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:C.Optional(C.Ref(XM,{description:"The time the opening hours start"})),closes:C.Optional(C.Ref(XM,{description:"The time the opening hours end"})),dayOfWeek:C.Optional(C.Union([C.Ref(YM),C.Array(C.Ref(YM))],{description:"The days of the week the opening hours apply to"})),validFrom:C.Optional(C.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:C.Optional(C.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),Vx=C.Intersect([C.Object({id:C.Ref(hp),categories:C.Array(C.Ref(fp)),logo:C.Optional(C.String({format:"uri"})),phone:C.Optional(C.String()),social:C.Array(C.Ref(CU)),images:C.Array(C.Ref(PU)),links:C.Array(C.Ref(ZM)),website:C.Optional(C.Ref(ZM)),openingHours:C.Optional(C.Array(C.Ref(Ux)))}),rp(["name"]),np(),Zi],{$id:"Location"}),KM=C.Intersect([C.Object({id:C.Ref(Gx),parentId:C.Ref(hp)}),C.Partial(C.Omit(Vx,["id","parentId"]))],{$id:"LocationInstance"}),zx=[hp,Gx,CU,PU,ZM,XM,TU,YM,Ux,Vx,KM];var Oge=C.Object({locations:C.Array(C.Ref(Vx)),locationCategories:C.Array(C.Ref(qM)),locationInstances:C.Optional(C.Array(C.Ref(KM)))},{$id:"LocationsExtensionSchema"}),wU="locations.json",MU="location-categories.json",OU="location-instances.json",EU={name:"ext:locations",schema:Oge,intoBundle:s(function*(e){e.locations!=null&&(yield{path:wU,contents:e.locations}),e.locationCategories!=null&&(yield{path:MU,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:OU,contents:e.locationInstances})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===wU)return{locations:r(t)};if(e===MU)return{locationCategories:r(t)};if(e===OU)return{locationInstances:r(t)}},"fromBundle"),references:[...IU,...zx],integrityCheck:SU};d();d();var ea;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(ea||(ea={}));var _U=s(e=>{var c,p,f,m,y,v,x,S,I,P,T,M,w,E,B,D,F,L,H,U;if(e.enterprise==null)return pe(!0);let t=e.enterprise,r=new Set((p=(c=e.locationCategories)==null?void 0:c.map(G=>G.id))!=null?p:[]);for(let G of(f=t.categories)!=null?f:[])if(!r.has(G.categoryId))return ge({kind:ea.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:G.id,locationCategoryId:G.categoryId}});let n=new Set((y=(m=e.locations)==null?void 0:m.map(G=>G.id))!=null?y:[]);for(let G of(v=t.locations)!=null?v:[]){if(!n.has(G.locationId))return ge({kind:ea.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:G.id,locationId:G.locationId}});for(let J of(x=G.siblingGroups)!=null?x:[])for(let X of(S=J.siblings)!=null?S:[])if(!n.has(X))return ge({kind:ea.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:G.id,siblingLocationId:X,label:J.label}})}let o=new Set((P=(I=e.enterprise.locations)==null?void 0:I.map(G=>G.id))!=null?P:[]);if(((T=t.venue)==null?void 0:T.topLocations)!=null){for(let G of t.venue.topLocations)if(!o.has(G))return ge({kind:ea.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:G}})}let i=new Set((w=(M=e.locationInstances)==null?void 0:M.map(G=>G.id))!=null?w:[]);for(let G of(E=t.locationInstances)!=null?E:[]){if(!o.has(G.parentId))return ge({kind:ea.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:G.id,enterpriseLocationId:G.parentId}});if(!i.has(G.locationInstanceId))return ge({kind:ea.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:G.id,locationInstanceId:G.locationInstanceId}});for(let J of(B=G.siblingGroups)!=null?B:[])for(let X of(D=J.siblings)!=null?D:[])if(!n.has(X))return ge({kind:ea.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:G.id,siblingLocationId:X,label:J.label}})}let a=il(e),l=Ar(e);for(let[G,J]of It((F=t.floorText)!=null?F:{})){let X=a(G);if(X.isErr())return X;for(let ie of J.features){if(!("geometryId"in ie.properties))continue;let ee=l(G,ie.properties.geometryId);if(ee.isErr())return ee}}for(let[G,J]of It((L=t.textures)!=null?L:{})){let X=a(G);if(X.isErr())return X;for(let ie of J){let ee=l(G,ie.geometryId);if(ee.isErr())return ee}}for(let[G,J]of It((H=t.layers)!=null?H:{})){let X=a(G);if(X.isErr())return X;for(let ie of Qe(J!=null?J:{})){let ee=l(G,ie);if(ee.isErr())return ee}}for(let[G,J]of It((U=t.textAreas)!=null?U:{})){let X=a(G);if(X.isErr())return X;for(let ie of J.features)if("geometryId"in ie.properties){let ee=l(G,ie.properties.geometryId);if(ee.isErr())return ee}}return pe(!0)},"validateEnterprise");d();d();var yp=Qt("el","EnterpriseLocationId"),JM=Qt("ec","EnterpriseCategoryId"),QM=Qt("eli","EnterpriseLocationInstanceId"),e4=Qt("ev","EnterpriseVenueId"),t4=Qt("eft","EnterpriseFloorTextId"),AU=[yp,JM,QM,e4,t4];var kU=C.Object({id:C.Ref(JM),categoryId:C.Ref(fp),color:C.Optional(C.String()),sortOrder:C.Number(),iconFromDefaultList:C.Optional(C.Union([C.String(),C.Null()])),picture:C.Optional(C.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),r4=C.Object({categories:C.Optional(C.Array(C.Ref(kU)))},{$id:"EnterpriseCategoriesSchema"}),DU=[kU,r4];d();var FU=xo(["left","center","right"]),Ege=FU.schema,Nrt=FU.values,n4=C.Object({id:C.Ref(t4),text:C.String(),visible:C.Boolean({default:!0}),fontSize:C.Number({default:12,minimum:1}),fontFamily:C.String({default:"Droid Sans"}),color:C.String({default:"black"}),rotation:C.Number({minimum:0,maximum:360}),align:Ege},{$id:"FloorTextCommonProperties"}),o4=C.Intersect([C.Ref(n4),vo],{$id:"AnchoredFloorTextProperties"}),i4=C.Intersect([C.Ref(n4),C.Object({verticalOffset:C.Number()})],{$id:"FloatingFloorTextProperties"}),LU=C.Union([C.Ref(o4),C.Ref(i4)],{$id:"FloorTextProperties"}),RU=un(En,C.Ref(LU),{$id:"FloorTextFeature"}),_ge=un(En,C.Ref(o4),{$id:"AnchoredFloorTextFeature"}),Age=un(En,C.Ref(i4),{$id:"FloatingFloorTextFeature"}),NU=Xn(C.Ref(RU),{$id:"EnterpriseFloorTextFeatureCollection"}),BU=C.Record(at,C.Ref(NU),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),s4=C.Object({floorText:C.Optional(C.Ref(BU))},{$id:"EnterpriseFloorTextSchema"}),$U=[n4,o4,i4,LU,RU,_ge,Age,NU,BU,s4];d();var jU=fr(C.Record(On,C.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),GU=fr(C.Record(at,C.Ref(jU),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),a4=C.Object({layers:C.Optional(C.Ref(GU))},{$id:"EnterpriseLayersSchema"}),UU=[jU,GU,a4];d();d();d();var l4=xo(["closed-temporarily","new","pop-up","coming-soon","relocated"]),kge=l4.schema,Zrt=l4.values,Xrt=l4.record,c4=C.Object({type:kge,start:C.Optional(C.String({format:"date",description:"The start date of the state"})),end:C.Optional(C.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),u4=C.Object({label:C.String(),siblings:C.Array(C.Ref(hp))},{$id:"SiblingGroup"}),Hx=C.Object({name:C.String(),code:C.String()},{$id:"Language"}),VU=[c4,u4,Hx];var Wx=C.Object({id:C.Ref(yp),locationId:C.Ref(hp),type:C.String(),sortOrder:C.Number(),tags:C.Optional(C.Array(C.String())),picture:C.Optional(C.String({format:"uri",description:"The picture of the location"})),states:C.Optional(C.Array(C.Ref(c4),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:C.Optional(C.Array(C.Ref(u4))),gallery:C.Optional(C.Array(C.Object({caption:C.Optional(C.String()),image:C.String({format:"uri"}),embeddedUrl:C.Optional(C.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:C.Optional(C.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:C.Optional(C.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:C.Optional(C.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),p4=C.Object({locations:C.Optional(C.Array(C.Ref(Wx)))},{$id:"EnterpriseLocationsSchema"}),zU=[Wx,p4];var HU=C.Intersect([C.Object({id:C.Ref(QM),parentId:C.Ref(yp),locationInstanceId:C.Ref(Gx)}),C.Partial(C.Omit(Wx,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),d4=C.Object({locationInstances:C.Optional(C.Array(C.Ref(HU)))},{$id:"EnterpriseLocationInstancesSchema"}),WU=[HU,d4];d();var f4=xo(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),qU=f4.schema,mnt=f4.values,hnt=f4.record,m4=C.Object({maxWidth:C.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:C.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:C.Ref(qU),rotation:C.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),ZU=C.Intersect([C.Ref(m4),vo],{$id:"EnterpriseAnchoredTextAreaProperties"}),XU=C.Intersect([C.Ref(m4),C.Object({verticalOffset:C.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),YU=C.Union([ZU,XU],{$id:"EnterpriseTextAreaProperties"}),KU=un(C.Ref(En),YU,{$id:"EnterpriseTextAreaFeature"}),JU=Xn(C.Ref(KU),{$id:"EnterpriseTextAreaCollection"}),QU=C.Record(at,C.Ref(JU),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),eV=C.Object({textAreas:C.Optional(C.Ref(QU))},{$id:"EnterpriseTextAreasSchema"}),tV=[qU,m4,ZU,XU,YU,KU,JU,QU];d();var h4=C.Object({u:C.Number(),v:C.Number()},{$id:"EnterpriseTextureUV"}),y4=xo(["top","side"],{$id:"EnterpriseTextureFace"}),rV=y4.schema,xnt=y4.values,Int=y4.record,g4=xo(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),nV=g4.schema,Snt=g4.values,Cnt=g4.record,oV=C.Tuple([Wf,qf,Wf,qf],{$id:"EnterpriseTextureBounds"}),iV=C.Intersect([C.Object({repeat:C.Ref(h4),offset:C.Ref(h4),rotation:C.Number({minimum:0,maximum:360}),path:C.String({format:"uri"}),face:C.Ref(rV),surface:C.Ref(nV),bounds:C.Ref(oV)},{$id:"EnterpriseTextureProperties"}),vo],{$id:"EnterpriseTexture"}),sV=C.Array(C.Ref(iV),{$id:"EnterpriseTextures"}),aV=C.Record(at,C.Ref(sV),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),b4=C.Object({textures:C.Optional(C.Ref(aV))},{$id:"EnterpriseTexturesSchema"}),lV=[iV,sV,b4,h4,rV,nV,oV,aV];d();var cV=C.Intersect([C.Object({id:C.Ref(e4),slug:C.String(),defaultLanguage:C.Ref(Hx),languages:C.Array(C.Ref(Hx)),countrycode:C.Optional(C.String()),logo:C.Optional(C.String({format:"uri"})),mappedinWebUrl:C.Optional(C.String({format:"uri"})),topLocations:C.Optional(C.Array(C.Ref(yp))),operationHours:C.Optional(C.Array(C.Ref(Ux))),coverImage:C.Optional(C.String({format:"uri"}))}),rp(["name"]),Zi],{$id:"EnterpriseVenue"}),v4=C.Object({venue:C.Optional(C.Ref(cV))},{$id:"EnterpriseVenueSchema"}),uV=[cV,v4];var dV=C.Intersect([v4,p4,d4,r4,b4,s4,a4,eV],{$id:"EnterpriseProperties"}),pV=C.Object({enterprise:C.Optional(C.Ref(dV))},{$id:"EnterpriseExtensionSchema"}),Dge=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,fV={name:"ext:enterprise",schema:pV,intoBundle:s(function*(e){var r,n,o,i,a,l;if(e.enterprise==null)return;let t=e.enterprise;for(let c of Qe(t))switch(c){case"floorText":for(let p of Qe((r=t.floorText)!=null?r:{}))yield{path:"enterprise/floorText/".concat(p,".geojson"),contents:((n=t.floorText)!=null?n:{})[p]};continue;case"textures":for(let p of Qe((o=t.textures)!=null?o:{}))yield{path:"enterprise/textures/".concat(p,".json"),contents:((i=t.textures)!=null?i:{})[p]};continue;case"textAreas":for(let p of Qe((a=t.textAreas)!=null?a:{}))yield{path:"enterprise/textAreas/".concat(p,".geojson"),contents:((l=t.textAreas)!=null?l:{})[p]};continue;default:yield{path:"enterprise/".concat(c,".json"),contents:t[c]};continue}},"intoBundle"),fromBundle:s((e,t,r)=>{let n=e.match(Dge);if(!n)return;let[,o,i]=n,a=r(t);switch(o){case"floorText":case"textures":case"textAreas":return{enterprise:{[o]:{[i]:a}}};default:return{enterprise:{[i]:a}}}},"fromBundle"),references:[dV,pV,...uV,...zU,...WU,...DU,...lV,...UU,...$U,...tV,...AU,...VU,...zx],integrityCheck:_U};d();d();d();d();var qx;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(qx||(qx={}));var mV=s(e=>{if(e.floorStacks==null)return pe(!0);let t=il(e);for(let r of e.floorStacks){for(let n of r.floors){let o=t(n);if(o.isErr())return o}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return ge({kind:qx.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return pe(!0)},"validateFloorStacks");var Zx=Qt("fs","FloorStackId"),yV=C.Intersect([C.Object({id:C.Ref(Zx,{description:"The unique identifier for the floor stack."}),floors:C.Array(C.Ref(at),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:C.Optional(C.Ref(at,{description:"The default floor for the floor stack."}))}),qi],{$id:"FloorStacksProperties"}),gV=C.Array(C.Ref(yV),{$id:"FloorStackCollection"}),Fge=C.Object({floorStacks:C.Ref(gV)},{$id:"FloorStackExtensionSchema"}),hV="floor-stacks.json",bV={name:"ext:floor-stacks",schema:Fge,intoBundle:s(function*(e){e.floorStacks!=null&&(yield{path:hV,contents:e.floorStacks})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===hV)return{floorStacks:r(t)}},"fromBundle"),references:[Zx,yV,gV],integrityCheck:mV};d();d();var Eg;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(Eg||(Eg={}));var vV=s(e=>{if(e.facade==null)return pe(!0);if(e.floorStacks==null)return ge({kind:Eg.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=Ar(e);for(let[n,o]of It(e.facade))if(o!=null){if(!t.has(n))return ge({kind:Eg.UnknownFloorStackError,properties:{floorStackId:n}});for(let i of o.geometryAnchors){let a=r(i.floorId,i.geometryId);if(a.isErr())return a}}return pe(!0)},"validateFacade");var xV=Qt("fc","FacadeId"),IV=C.Intersect([C.Object({id:C.Ref(xV)}),np({minItems:1})],{$id:"FacadeProperties"}),Lge=C.Object({facade:fr(C.Record(Zx,C.Ref(IV),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),Rge=/^facade\/(.*)\.json$/,SV={name:"ext:facade",schema:Lge,intoBundle:s(function*(e){if(e.facade!=null)for(let t of Qe(e.facade))yield{path:"facade/".concat(t,".json"),contents:e.facade[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Rge))==null?void 0:o[1];if(n)return{facade:{[n]:r(t)}}},"fromBundle"),references:[xV,IV],integrityCheck:vV};d();d();var CV=s(e=>{if(e.floorImages==null)return pe(!0);let t=Ar(e);for(let[r,n]of It(e.floorImages))if(n!=null)for(let o of n.features){if(!("geometryId"in o.properties))continue;let i=o.properties.geometryId,a=t(r,i);if(a.isErr())return a}return pe(!0)},"validateFloorImages");var x4=C.Object({path:C.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:C.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:C.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:C.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),PV=C.Intersect([C.Ref(x4),vo],{$id:"AnchoredFloorImageProperties"}),TV=C.Intersect([C.Ref(x4),C.Object({verticalOffset:C.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),wV=C.Union([PV,TV],{$id:"FloorImageProperties"}),MV=un(C.Ref(En),wV,{$id:"FloorImageFeature"}),OV=Xn(C.Ref(MV),{$id:"FloorImageCollection"}),Nge=C.Object({floorImages:fr(C.Record(at,C.Ref(OV),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),Bge=/^floorImages\/(.*)\.geojson$/,EV={name:"ext:floor-images",schema:Nge,intoBundle:s(function*(e){if(e.floorImages!=null)for(let t of Qe(e.floorImages))yield{path:"floorImages/".concat(t,".geojson"),contents:e.floorImages[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Bge))==null?void 0:o[1];if(n)return{floorImages:{[n]:r(t)}}},"fromBundle"),references:[x4,PV,TV,wV,MV,OV],integrityCheck:CV};d();d();var _V=s(e=>{if(e.kinds==null)return pe(!0);let t=Ar(e);for(let[r,n]of It(e.kinds))if(n!=null)for(let o of Qe(n)){let i=t(r,o);if(i.isErr())return i}return pe(!0)},"validateKinds");var{values:tit,schema:$ge,record:rit}=xo(["room","hallway","wall","desk","poi","area"],{$id:"Kind"}),AV=$ge;var kV=fr(C.Record(On,C.Ref(AV),{additionalProperties:!1,$id:"GeometryKinds"})),jge=C.Object({kinds:fr(C.Record(at,C.Ref(kV),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),Gge=/^kinds\/(.*)\.json$/,DV={name:"ext:kinds",schema:jge,intoBundle:s(function*(e){if(e.kinds!=null)for(let t of Qe(e.kinds))yield{path:"kinds/".concat(t,".json"),contents:e.kinds[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Gge))==null?void 0:o[1];if(n)return{kinds:{[n]:r(t)}}},"fromBundle"),references:[AV,kV],integrityCheck:_V};d();d();d();var Xx;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(Xx||(Xx={}));var FV=s(e=>{if(e.nodes==null)return pe(!0);let t=Ar(e),r=$x(e);for(let[n,o]of It(e.nodes)){if(o==null)continue;let i=new Set(o.features.map(a=>a.properties.id));for(let[a,l]of o.features.entries()){for(let c of l.properties.geometryIds){let p=t(n,c);if(p.isErr())return p}for(let[c,p]of l.properties.neighbors.entries()){if(!i.has(p.id))return ge({kind:Xx.UnknownNeighbor,properties:{floorId:n,nodeId:l.properties.id,neighborId:p.id}});let f=Mg(p.flags,r,'nodes["'.concat(n,'"].features[').concat(a,"].properties.neighbors[").concat(c,"]"));if(f.isErr())return f}}}return pe(!0)},"validateNodes");var I4=Qt("n","NodeId"),LV=C.Intersect([C.Object({id:C.Ref(I4,{description:"The unique identifier for the node."}),extraCost:C.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),HM],{$id:"NodeNeighbor"}),RV=C.Intersect([C.Object({id:C.Ref(I4,{description:"The unique identifier for the node."}),neighbors:C.Array(C.Ref(LV),{description:"The neighbors of the node."})}),Kv],{$id:"NodeProperties"}),NV=un(C.Ref(En),RV,{$id:"NodeFeature"}),BV=Xn(C.Ref(NV),{$id:"NodeCollection"}),Uge=C.Object({nodes:fr(C.Record(at,C.Ref(BV),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),Vge=/^nodes\/(.*)\.json$/,$V={name:"ext:nodes",schema:Uge,intoBundle:s(function*(e){if(e.nodes!=null)for(let t of Qe(e.nodes))yield{path:"nodes/".concat(t,".json"),contents:e.nodes[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Vge))==null?void 0:o[1];if(n)return{nodes:{[n]:r(t)}}},"fromBundle"),references:[I4,LV,RV,NV,BV],integrityCheck:FV};d();d();d();var Yx;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(Yx||(Yx={}));var jV=s(e=>{if(e.outdoors==null)return pe(!0);let t=il(e);for(let r of e.outdoors.floors){let n=t(r);if(n.isErr())return n;if(e.floorStacks!=null){for(let o of e.floorStacks)if(o.floors.includes(r))return ge({kind:Yx.FloorInFloorStackError,properties:{floorId:r,floorStackId:o.id}})}}return pe(!0)},"validateOutdoors");var UV=C.Object({floors:C.Array(C.Ref(at),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"OutdoorsProperties"}),zge=C.Object({outdoors:C.Ref(UV)},{$id:"OutdoorsExtensionSchema"}),GV="outdoors.json",VV={name:"ext:outdoors",schema:zge,intoBundle:s(function*(e){e.outdoors!=null&&(yield{path:GV,contents:e.outdoors})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===GV)return{outdoors:r(t)}},"fromBundle"),references:[UV],integrityCheck:jV};d();d();d();var Kx;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(Kx||(Kx={}));var zV=s(e=>{if(e.tileset==null)return pe(!0);let t=new Set;if(t.add(e.tileset.default.key),e.tileset.others)for(let r of e.tileset.others){if(t.has(r.key))return ge({kind:Kx.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return pe(!0)},"validateTilesets");var S4=C.Object({key:C.String({minLength:1,description:"Unique identifier for the tileset style."}),name:C.String({minLength:1,description:"Display name of the tileset style."}),url:C.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),HV=C.Object({default:C.Ref(S4,{description:"The default tileset style, which should be used."}),others:C.Optional(C.Array(C.Ref(S4,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),Hge=C.Object({tileset:C.Ref(HV)},{$id:"TilesetExtensionSchema"}),WV={name:"ext:mvf-tileset",schema:Hge,intoBundle:s(function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e==="tileset.json")return{tileset:r(t)}},"fromBundle"),references:[S4,HV],integrityCheck:zV};d();var qV=C.Object({},{$id:"WalkableProperties"}),ZV=C.Object({},{$id:"NonWalkableProperties"}),XV=fr(C.Record(On,C.Ref(qV),{$id:"WalkableGeometries",additionalProperties:!1})),YV=fr(C.Record(On,C.Ref(ZV),{$id:"NonWalkableGeometries",additionalProperties:!1})),Wge=C.Object({walkable:fr(C.Record(at,C.Ref(XV),{additionalProperties:!1})),nonwalkable:fr(C.Record(at,C.Ref(YV),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),qge=/^walkable\/(.*)\.json$/,Zge=/^nonwalkable\/(.*)\.json$/,KV={name:"ext:mvf-traversability",schema:Wge,intoBundle:s(function*(e){if(e.walkable!=null)for(let t of Qe(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of Qe(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var i,a;let n=(i=e.match(qge))==null?void 0:i[1];if(n!=null)return{walkable:{[n]:r(t)}};let o=(a=e.match(Zge))==null?void 0:a[1];if(o!=null)return{nonwalkable:{[o]:r(t)}}},"fromBundle"),references:[qV,ZV,XV,YV]};d();d();d();var Jx;(function(e){e.WindowNonLineStringGeometryError="WindowNonLineStringGeometryError"})(Jx||(Jx={}));var JV=s(e=>{if(e.windows==null)return pe(!0);let t=Ar(e);for(let r of Qe(e.windows)){let n=e.windows[r];if(n!=null)for(let o of n){let i=t(r,o.geometryId);if(i.isErr())return i;if(i.value.geometry.type!=="LineString")return ge({kind:Jx.WindowNonLineStringGeometryError,properties:{windowId:o.id,floorId:r,geometryId:o.geometryId}})}}return pe(!0)},"validateWindows");var QV=Qt("w","WindowId"),ez=C.Intersect([C.Object({id:C.Ref(QV,{description:"The unique identifier for the window."})}),vo],{$id:"WindowProperties"}),Xge=C.Object({windows:fr(C.Record(at,C.Array(C.Ref(ez)),{additionalProperties:!1}))},{$id:"WindowsSchema"}),Yge=/^windows\/(.*)\.json$/,tz={name:"ext:mvf-windows",schema:Xge,intoBundle:s(function*(e){if(e.windows!=null)for(let t of Qe(e.windows))yield{path:"windows/".concat(t,".json"),contents:e.windows[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Yge))==null?void 0:o[1];if(n)return{windows:{[n]:r(t)}}},"fromBundle"),references:[QV,ez],integrityCheck:JV};d();d();function rz(e){return e.replace(/^g_/,"s_")}s(rz,"toSpaceId");function Kge(e){return e.replace(/^g_/,"o_")}s(Kge,"toObstructionId");function Jge(e){return e.replace(/^g_/,"w_")}s(Jge,"toWindowId");function Qge(e){return e.replace(/^g_/,"ar_")}s(Qge,"convertAreaId");function ebe(e,t,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],o=0,i=e.geometry.type.replace("Multi","");for(let a of e.geometry.coordinates)n.push({...e,geometry:{type:i,coordinates:a},properties:{...e.properties,id:"".concat(t,"-").concat(o++),kind:r}});return n}default:return[{...e,properties:{...e.properties,id:t,kind:r}}]}}s(ebe,"splitMultiPartGeometryFeatureWithNewId");function _g(e,t,r,n){let o=new Map;for(let{feature:i,floorId:a}of e){let l=i.properties.id,c=n.get(l);if(t.has(l)){let p=ebe(i,r(l),c),f=p.map(y=>y.properties.id),m=f.map(y=>({geometryId:y,floorId:a}));o.set(l,{ids:f,features:p,anchors:m})}}return o}s(_g,"mapGeometryToOtherIds");function nz(e){var c,p,f,m;let t={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!e.geometry)return t;let r=new Map(Object.values((c=e.kinds)!=null?c:{}).filter(y=>y!==void 0).flatMap(It)),n=It(e.geometry).flatMap(([y,v])=>{var x;return((x=v==null?void 0:v.features)!=null?x:[]).map(S=>({feature:S,floorId:y}))}).flat(),o=new Set(Object.values((p=e.walkable)!=null?p:{}).filter(y=>y!==void 0).flatMap(Qe)),i=new Set(Object.values((f=e.nonwalkable)!=null?f:{}).filter(y=>y!==void 0).flatMap(Qe)),a=new Set(Array.from(r.entries()).filter(([y,v])=>v==="area").map(([y])=>y)),l=new Set(Object.values((m=e.windows)!=null?m:{}).filter(y=>y!==void 0).flatMap(y=>y.map(v=>v.geometryId)));return o.size>0&&(t.space=_g(n,o,rz,r)),i.size>0&&(t.obstruction=_g(n,i,Kge,r)),a.size>0&&(t.area=_g(n,a,Qge,r)),l.size>0&&(t.window=_g(n,l,Jge,r)),o.size===0&&i.size===0&&a.size===0&&(t.space=_g(n,new Set(n.map(y=>y.feature.properties.id)),rz,r)),t}s(nz,"createGeometryMaps");function oz(e){let t=tbe(e),r=nz(e),n=rbe(e);return{geometryMaps:r,nodesByGeometryId:t,geometryFeatureById:n}}s(oz,"buildBuilderOptions");function tbe(e){var r,n,o;let t=new Map;for(let i of Object.values((r=e.nodes)!=null?r:{}))for(let a of(n=i==null?void 0:i.features)!=null?n:[])if(a.properties.geometryIds.length>0)for(let l of a.properties.geometryIds){let c=(o=t.get(l))!=null?o:[];c.push(a.properties.id),t.set(l,c)}return t}s(tbe,"buildNodesByGeometryId");function rbe(e){var r,n;let t=new Map;for(let o of Object.values((r=e.geometry)!=null?r:{}))for(let i of(n=o==null?void 0:o.features)!=null?n:[])t.set(i.properties.id,i);return t}s(rbe,"buildGeometryFeatureById");d();function iz(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,o]of It(e.annotations)){if(!o||o.length===0||!e.geometry[n]||e.geometry[n].features.length===0)continue;let i=new Map(e.geometry[n].features.map(l=>[l.properties.id,l])),a={type:"FeatureCollection",features:[]};for(let l of o){let c=i.get(l.geometryId);if(!c||c.geometry.type!=="Point")continue;let p={id:l.id,externalId:l.externalId,symbolId:l.symbolKey};a.features.push({type:"Feature",geometry:c.geometry,properties:p})}r[n]=a}return{annotation:r}}s(iz,"buildAnnotations");d();function sz(e,{nodesByGeometryId:t}){var a,l,c,p,f,m,y;let r={"connection.json":[],entrance:{}},n=(a=e.navigationFlags)==null?void 0:a[zM.accessible],o=(l=e.navigationFlags)==null?void 0:l[zM.outdoors],i=new Map(Object.values((c=e.geometry)!=null?c:{}).flatMap(v=>{var x;return(x=v==null?void 0:v.features)!=null?x:[]}).map(v=>[v.properties.id,v]));for(let v of(p=e.connections)!=null?p:[]){if(C4(v,i)){let P=nbe(v,i,t,o);for(let[T,M]of P)r.entrance[T]||(r.entrance[T]={type:"FeatureCollection",features:[]}),r.entrance[T].features.push(M);continue}let x=n!=null&&v.entrances.every(P=>Og(P,n))&&v.exits.every(P=>Og(P,n)),S=Array.from(new Set([...v.entrances.map(P=>t.get(P.geometryId)),...v.exits.map(P=>t.get(P.geometryId))].flat().filter(P=>P!=null))),I={id:v.id,externalId:(m=(f=v.details)==null?void 0:f.externalId)!=null?m:"",type:v.type,accessible:x,nodes:S};(y=v.details)!=null&&y.name&&(I.details={name:v.details.name}),v.extra&&(I.extra=v.extra),r["connection.json"].push(I)}return r}s(sz,"buildConnections");function C4(e,t){return e.type==WM.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}s(C4,"isLineDoor");function nbe(e,t,r,n){var i,a;if(e.type!==WM.door)return[];let o=[];for(let l of e.entrances){let c=t.get(l.geometryId);if((c==null?void 0:c.geometry.type)==="LineString"){let p={type:"Feature",geometry:c.geometry,properties:{id:e.id,externalId:(a=(i=e.details)==null?void 0:i.externalId)!=null?a:"",isExterior:obe(e,n)}},f=e.details;f&&(p.properties.details={name:f.name,description:f.description},f.icon&&(p.properties.details.images=[{url:f.icon,altText:"".concat(f.name," icon")}]));let m=r.get(l.geometryId);m&&m.length>0&&(p.properties.node=m[0]),o.push([l.floorId,p])}}return o}s(nbe,"buildEntranceFeaturesFromConnection");function obe(e,t){return e.entrances.some(r=>Og(r,t))||e.exits.some(r=>Og(r,t))}s(obe,"isExterior");d();function lz(e,{geometryMaps:t,nodesByGeometryId:r}){var T,M,w,E,B,D,F,L,H,U,G,J,X,ie,ee,be,ve,de,Ae,gt,st,Ye,Ve;if(!e.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},o=(T=e.manifest)==null?void 0:T.features[0];if(o&&(n.venue.defaultFloor=o.properties.defaultFloor,n.venue.tzid=o.properties.tzid,n.venue.name=o.properties.name),e.enterprise.venue){let fe=e.enterprise.venue;n.venue={...n.venue,slug:fe.slug,name:(M=fe.details.name)!=null?M:n.venue.name,externalId:(w=fe.details.externalId)!=null?w:"",defaultLanguage:fe.defaultLanguage,languages:fe.languages,countrycode:fe.countrycode,coverImage:fe.coverImage,logo:fe.logo,icon:fe.details.icon,extra:fe.extra,mappedinWebUrl:fe.mappedinWebUrl,operationHours:fe.operationHours,topLocations:fe.topLocations}}let i=new Map,a=new Map,l=e.locations,c=e.enterprise.locations;if(l&&c){let fe=new Map(l.map(he=>[he.id,he]));for(let he of c){let re=fe.get(he.locationId);if(re){let se=re.details,k={id:he.id,name:se.name,externalId:(E=se.externalId)!=null?E:"",type:he.type,sortOrder:he.sortOrder,amenity:he.amenity,description:se.description,extra:re.extra,links:re.links,operationHours:re.openingHours,gallery:he.gallery,logo:re.logo,shortName:se.shortName,picture:he.picture,showFloatingLabelWhenImagePresent:he.showFloatingLabelWhenImagePresent,showLogo:he.showLogo,siblingGroups:he.siblingGroups,states:he.states,tags:he.tags,spaces:[],nodes:[],polygons:[]};re.phone&&(k.phone={number:re.phone});let K=az(re.social);re.website&&(K.website=re.website.url),k.social=K;for(let R of re.geometryAnchors){let ce=t.space.get(R.geometryId);if(ce){let le=new Set(ce.features.filter(xe=>xe.geometry.type==="Polygon").map(xe=>xe.properties.id));for(let xe of ce.anchors)k.spaces.push({floor:xe.floorId,id:xe.geometryId}),le.has(xe.geometryId)&&k.polygons.push({map:xe.floorId,id:xe.geometryId})}let oe=r.get(R.geometryId);for(let le of oe!=null?oe:[])k.nodes.push({map:R.floorId,id:le})}n.locations.push(k);for(let R of re.categories)i.set(R,[...(B=i.get(R))!=null?B:[],he.id]);a.set(he.id,re.categories)}}}let p=e.enterprise.locationInstances,f=e.locationInstances;if(p&&f){let fe=new Map(f.map(re=>[re.id,re])),he=[];for(let re of p){let se=fe.get(re.locationInstanceId);if(se){let k={id:re.id,parent:re.parentId,name:(D=se.details)==null?void 0:D.name,externalId:(F=se.details)==null?void 0:F.externalId,type:re.type,sortOrder:re.sortOrder,amenity:re.amenity,description:(L=se.details)==null?void 0:L.description,extra:se.extra,links:se.links,operationHours:se.openingHours,gallery:re.gallery,picture:re.picture,showFloatingLabelWhenImagePresent:re.showFloatingLabelWhenImagePresent,showLogo:re.showLogo,siblingGroups:re.siblingGroups,states:re.states,tags:re.tags,logo:se.logo,shortName:(H=se.details)==null?void 0:H.shortName};se.phone&&(k.phone={number:se.phone});let K=az((U=se.social)!=null?U:[]);if(se.website&&(K.website=se.website.url),Object.keys(K).length>0&&(k.social=K),(G=se.geometryAnchors)!=null&&G.length){let R=se.geometryAnchors.flatMap(ce=>{var oe,le;return(le=(oe=t.space.get(ce.geometryId))==null?void 0:oe.anchors)!=null?le:[]});R.length>0&&(k.spaces=R.map(ce=>({floor:ce.floorId,id:ce.geometryId})))}if(se.geometryAnchors){k.spaces=[],k.polygons=[],k.nodes=[];for(let R of se.geometryAnchors){let ce=t.space.get(R.geometryId);if(ce){let le=new Set(ce.features.filter(xe=>xe.geometry.type==="Polygon").map(xe=>xe.properties.id));for(let xe of ce.anchors)k.spaces.push({floor:xe.floorId,id:xe.geometryId}),le.has(xe.geometryId)&&k.polygons.push({map:xe.floorId,id:xe.geometryId})}let oe=r.get(R.geometryId);for(let le of oe!=null?oe:[])k.nodes.push({map:R.floorId,id:le})}}he.push(k)}}he.length>0&&(n.locationInstances=he)}let m=e.locationCategories,y=e.enterprise.categories;if(m&&y){let fe=[],he=new Map(m.map(K=>[K.id,K])),re=new Map(y.map(K=>[K.categoryId,K.id])),se=new Map;for(let K of m){let R=re.get(K.parent);if(R){let ce=(J=se.get(R))!=null?J:[];ce.push(K.id),se.set(R,ce)}}for(let K of y){let R=he.get(K.categoryId);if(R){let oe=((X=se.get(K.id))!=null?X:[]).map(xe=>re.get(xe)).filter(xe=>xe!==void 0),le={id:K.id,name:R.details.name,externalId:(ie=R.details.externalId)!=null?ie:"",sortOrder:K.sortOrder,children:oe,locations:(ee=i.get(K.categoryId))!=null?ee:[],icon:R.details.icon,picture:K.picture,color:K.color,extra:R.extra,iconFromDefaultList:K.iconFromDefaultList};fe.push(le)}}n.categories=fe;let k={};for(let[K,R]of a.entries())k[K]=R.map(ce=>re.get(ce)).filter(ce=>ce!==void 0);n.categoryPriorities=k}let v={};for(let[fe,he]of Object.entries((be=e.defaultStyle)!=null?be:{}))if(he.buffer>0){let re=he.geometryAnchors.flatMap(se=>{var k,K;return(K=(k=t.space.get(se.geometryId))==null?void 0:k.anchors)!=null?K:[]});v[fe]={edgeOffset:he.buffer,geometryAnchors:re}}Object.keys(v).length>0&&(n.enterpriseStyles=v);let x=new Map;for(let fe of Object.values((ve=e.enterprise.layers)!=null?ve:{}))if(fe)for(let[he,re]of It(fe)){if(typeof re!="string")continue;let se=(de=x.get(re))!=null?de:{name:re,id:"ely_".concat(re),spaces:[]};se.spaces.push(...(gt=(Ae=t.space.get(he))==null?void 0:Ae.anchors.map(k=>({floorId:k.floorId,spaceId:k.geometryId})))!=null?gt:[]),x.set(re,se)}x.size>0&&(n.layers=Array.from(x.values()));let S=[];for(let fe of Object.values((st=e.enterprise.textures)!=null?st:{}))for(let he of fe){let re=(Ye=t.space.get(he.geometryId))==null?void 0:Ye.anchors;!re||re.length<1||he.face==="unknown"||he.surface==="unknown"||S.push({repeat:he.repeat,offset:he.offset,rotation:he.rotation,path:he.path,face:he.face,surface:he.surface,bounds:he.bounds,geometryAnchors:re})}S.length>0&&(n.textures=S);let I={};for(let[fe,he]of Object.entries((Ve=e.enterprise.floorText)!=null?Ve:{})){let re={type:"FeatureCollection",features:[]};for(let se of he.features){if(se.properties.align==="unknown")continue;let k={align:se.properties.align,color:se.properties.color,fontFamily:se.properties.fontFamily,fontSize:se.properties.fontSize,rotation:se.properties.rotation,text:se.properties.text,visible:se.properties.visible};"geometryId"in se.properties?k.geometryId=se.properties.geometryId:k.verticalOffset=se.properties.verticalOffset,re.features.push({type:"Feature",geometry:se.geometry,properties:k})}re.features.length>0&&(I[fe]=re)}Object.keys(I).length>0&&(n.floorText=I);let P={enterprise:n};if(e.enterprise.textAreas){let fe={};for(let[he,re]of It(e.enterprise.textAreas)){let se={type:"FeatureCollection",features:[]};for(let k of re.features){if(k.properties.align==="unknown")continue;let K={align:k.properties.align,maxWidth:k.properties.maxWidth,maxHeight:k.properties.maxHeight,rotation:k.properties.rotation};"geometryId"in k.properties?K.anchorId=k.properties.geometryId:K.verticalOffset=k.properties.verticalOffset;let R={type:"Feature",geometry:k.geometry,properties:K};se.features.push(R)}fe[he]=se}P.textAreas=fe}return P}s(lz,"buildEnterprise");var ibe=["facebook","instagram","twitter"];function az(e){let t={};for(let{name:r,url:n}of e){let o=r.toLowerCase();ibe.includes(o)&&(t[o]=n)}return t}s(az,"convertSocials");d();function cz(e,{geometryMaps:t}){if(!e.facade)return{};let r={},n={};for(let[o,i]of It(e.facade))i&&(n[o]={id:i.id,spaces:i.geometryAnchors.flatMap(({floorId:a,geometryId:l})=>{var c;return(c=t.space.get(l))==null?void 0:c.ids.map(p=>({floorId:a,spaceId:p}))}).filter(a=>a!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}s(cz,"buildFacade");d();function uz(e,t={}){var o,i,a,l,c,p,f,m,y,v,x,S;let r={type:"FeatureCollection",features:[]},n=[];for(let I of e.floors.features)n.push({id:I.properties.id.replace(/^f_/,"m_"),externalId:(i=(o=I.properties.details)==null?void 0:o.externalId)!=null?i:"",elevation:I.properties.elevation,name:(l=(a=I.properties.details)==null?void 0:a.name)!=null?l:"",shortName:(p=(c=I.properties.details)==null?void 0:c.shortName)!=null?p:"",subtitle:I.properties.subtitle}),r.features.push({type:"Feature",geometry:I.geometry,properties:{id:I.properties.id,externalId:(m=(f=I.properties.details)==null?void 0:f.externalId)!=null?m:"",elevation:I.properties.elevation,name:(v=(y=I.properties.details)==null?void 0:y.name)!=null?v:"",shortName:(S=(x=I.properties.details)==null?void 0:x.shortName)!=null?S:"",subtitle:I.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}s(uz,"buildFloors");d();function pz(e,{geometryMaps:t}){var o,i,a,l,c;let r={},n={};for(let[p,f]of It((o=e.floorImages)!=null?o:{})){let m={features:[],type:"FeatureCollection"};for(let y of(i=f==null?void 0:f.features)!=null?i:[])if("verticalOffset"in y.properties)m.features.push(y);else{let{geometryId:v,...x}=y.properties,S=(c=(a=t.space.get(v))==null?void 0:a.ids[0])!=null?c:(l=t.obstruction.get(v))==null?void 0:l.ids[0];if(!S)continue;let I={geometry:y.geometry,properties:{...x,anchorId:S},type:y.type};m.features.push(I)}n[p]=m}return Object.keys(n).length>0&&(r.floorImages=n),r}s(pz,"buildFloorImages");d();function dz(e,t={}){var o,i,a,l,c,p,f;let r=[];for(let m of(o=e==null?void 0:e.floorStacks)!=null?o:[]){let y={id:m.id,floors:m.floors,maps:m.floors,externalId:(a=(i=m.details)==null?void 0:i.externalId)!=null?a:"",name:(c=(l=m.details)==null?void 0:l.name)!=null?c:"",shortName:(f=(p=m.details)==null?void 0:p.shortName)!=null?f:"",type:"Building"};m.defaultFloor&&(y.defaultFloor=m.defaultFloor),r.push(y)}if(e.outdoors){let m={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(m)}return{"floorstack.json":r,"mapstack.geojson":r}}s(dz,"buildFloorStacks");d();d();var hz=ys(mz(),1);var ube=s(e=>{let t=e.geometry.coordinates[0],r=0;for(let n=0;n<t.length-1;n++)r+=t[n][0]*t[n+1][1]-t[n+1][0]*t[n][1];return Math.abs(r/2)},"calculateArea"),pbe=s((e,t)=>{let[r,n]=e,o=t.geometry.coordinates[0],i=!1;for(let a=0,l=o.length-1;a<o.length;l=a++){let[c,p]=o[a],[f,m]=o[l];p>n!=m>n&&r<(f-c)*(n-p)/(m-p)+c&&(i=!i)}return i},"pointInPolygon"),dbe=s(e=>{let t=e.geometry.coordinates[0],r=0,n=0;for(let o=0;o<t.length-1;o++)r+=t[o][0],n+=t[o][1];return{geometry:{coordinates:[r/(t.length-1),n/(t.length-1)]}}},"calculateCenterOfMass"),fbe=s(e=>{let t=ube(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},"estimatePrecision"),e2=s(e=>{try{let r=dbe(e).geometry.coordinates;if(!pbe(r,e)){let o=(0,hz.default)(e.geometry.coordinates,fbe(e));return pe([o[0],o[1]])}return pe(r)}catch{return ge(new Error("Unable to calculate center of polygon"))}},"labelCenter");function T4(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}s(T4,"isPolygonFeature");function yz(e,{geometryMaps:t,nodesByGeometryId:r}){var p,f,m,y,v,x,S,I,P;let n=bbe(e.defaultStyle),o={},i={},a={},l={};for(let T of Qe(e.geometry)){let M=e.geometry[T];if(!M)continue;let w=[],E=[],B=[],D=[];for(let F of M.features){let L=F.properties.id,H=n.has(L),U=(p=r.get(L))!=null?p:[];for(let G of(m=(f=t.space.get(L))==null?void 0:f.features)!=null?m:[])w.push(mbe(G,U));for(let G of(v=(y=t.obstruction.get(L))==null?void 0:y.features)!=null?v:[])E.push(hbe(G,H));for(let G of(S=(x=t.area.get(L))==null?void 0:x.features)!=null?S:[])B.push(ybe(G,U));for(let G of(P=(I=t.window.get(L))==null?void 0:I.features)!=null?P:[])D.push(gbe(G))}w.length>0&&(o[T]={type:"FeatureCollection",features:w.filter(F=>F!==null)}),E.length>0&&(i[T]={type:"FeatureCollection",features:E.filter(F=>F!==null)}),B.length>0&&(a[T]={type:"FeatureCollection",features:B.filter(F=>F!==null)}),D.length>0&&(l[T]={type:"FeatureCollection",features:D.filter(F=>F!==null)})}let c={space:o,obstruction:i};return Object.keys(a).length>0&&(c.area=a),Object.keys(l).length>0&&(c.window=l),c}s(yz,"buildGeometry");function mbe(e,t){var n,o;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let r={type:"Feature",geometry:e.geometry,properties:{destinationNodes:t,id:e.properties.id,externalId:(o=(n=e.properties.details)==null?void 0:n.externalId)!=null?o:"",kind:e.properties.kind}};return e.properties.details&&(r.properties.details={name:e.properties.details.name,description:e.properties.details.description,images:e.properties.details.icon?[{url:e.properties.details.icon,altText:e.properties.details.name?"".concat(e.properties.details.name," icon"):"icon"}]:void 0}),T4(r)&&(r.properties.center=e2(r).unwrapOr(void 0)),r}s(mbe,"buildSpace");function hbe(e,t){var o,i;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(i=(o=r.details)==null?void 0:o.externalId)!=null?i:"",entrances:[],kind:r.kind,footprintComponent:t}};return T4(n)&&(n.properties.center=e2(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}s(hbe,"buildObstruction");function ybe(e,t){var o,i;if(e.geometry.type!=="Polygon")return null;let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(i=(o=r.details)==null?void 0:o.externalId)!=null?i:"",destinationNodes:t}};return T4(n)&&(n.properties.center=e2(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}s(ybe,"buildArea");function gbe(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}s(gbe,"buildWindow");function bbe(e){var n,o,i,a;let t=[...(o=(n=e==null?void 0:e.ExteriorWalls)==null?void 0:n.geometryAnchors)!=null?o:[],...(a=(i=e==null?void 0:e.Walls)==null?void 0:i.geometryAnchors)!=null?a:[]];return new Set(t.map(l=>l.geometryId))}s(bbe,"calculateFootprintGeometry");d();function gz(e,{geometryMaps:t,geometryFeatureById:r}){var o,i,a,l,c,p,f,m,y,v,x,S,I;if(!e.locationCategories&&!e.locations)return{};let n={};if((o=e.locationCategories)!=null&&o.length){let P=[];for(let T of e.locationCategories){let M={id:T.id,name:T.details.name,icon:(i=T.details.icon)!=null?i:""};T.parent&&(M.parent=T.parent),P.push(M)}n["category.json"]=P}if((a=e.locations)!=null&&a.length){let P=vbe(e,{geometryFeatureById:r}),T=[];for(let M of e.locations){let w={id:M.id,name:M.details.name,categories:M.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:M.links,openingHoursSpecification:(l=M.openingHours)!=null?l:[],pictures:M.images,social:M.social,description:M.details.description,externalId:M.details.externalId,icon:M.details.icon,logo:M.logo,phone:M.phone,website:M.website};T.push(w);for(let{geometryId:E,floorId:B}of M.geometryAnchors)w.spaces.push(...(p=(c=t.space.get(E))==null?void 0:c.ids.map(D=>({id:D,floor:B})))!=null?p:[]),w.obstructions.push(...(m=(f=t.obstruction.get(E))==null?void 0:f.ids.map(D=>({id:D,floor:B})))!=null?m:[]),w.areas.push(...(v=(y=t.area.get(E))==null?void 0:y.ids.map(D=>({id:D,floor:B})))!=null?v:[]),w.entrances.push(...(x=P.entrancesByGeometryId.get(E))!=null?x:[]),w.connections.push(...(S=P.connectionsByGeometryId.get(E))!=null?S:[]),w.annotations.push(...(I=P.annotationsByGeometryId.get(E))!=null?I:[])}n["location.json"]=T}return n}s(gz,"buildLocations");function vbe(e,{geometryFeatureById:t}){var n,o,i;let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[a,l]of It(e.annotations))for(let c of l!=null?l:[]){let p=c.geometryId,f=c.id,m=(n=r.annotationsByGeometryId.get(p))!=null?n:[];m.push({floor:a,id:f}),r.annotationsByGeometryId.set(p,m)}if(e.connections)for(let a of e.connections){let l=C4(a,t),c=Array.from(new Map([...a.entrances,...a.exits].map(p=>["".concat(p.geometryId,"_").concat(p.floorId),p])).values());for(let p of c){let f=p.geometryId;if(l){let m=(o=r.entrancesByGeometryId.get(f))!=null?o:[];m.push({floor:p.floorId,id:a.id}),r.entrancesByGeometryId.set(f,m)}else{let m=(i=r.connectionsByGeometryId.get(f))!=null?i:[];m.push(a.id),r.connectionsByGeometryId.set(f,m)}}}return r}s(vbe,"buildLocationAttachmentMaps");d();function bz(e,t){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},o=e.manifest;if(o.features.length>0){let i=o.features[0],a=i.properties,l={type:"Feature",geometry:i.geometry,properties:{folder_struct:[],version:"2.0.0",time:a.time,name:a.name,naturalBearing:a.naturalBearing,tzid:a.tzid,map:a.mapId,org_id:a.orgId,language:a.language}};r.features.push(l)}return n}s(bz,"buildManifest");d();function vz(e,{geometryMaps:t}){var l,c,p,f,m,y,v,x,S,I,P,T,M,w,E;let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,o=new Map;for(let B of(c=(l=e.floors)==null?void 0:l.features)!=null?c:[])o.set(B.properties.id,B.properties.elevation);let i=new Map;for(let B of Object.values((p=e.nodes)!=null?p:{}))for(let D of(f=B==null?void 0:B.features)!=null?f:[])for(let F of D.properties.geometryIds)i.set(F,[...(m=i.get(F))!=null?m:[],D.properties.id]);let a=new Map;for(let B of(y=e.connections)!=null?y:[]){let D=B.exits.map(F=>{var L;return{...F,nodes:(L=i.get(F.geometryId))!=null?L:[]}});for(let F of B.entrances){let L=(v=i.get(F.geometryId))!=null?v:[];for(let H of L)for(let U of D){let G=Math.abs(((x=o.get(F.floorId))!=null?x:0)-((S=o.get(U.floorId))!=null?S:0))*B.floorCostMultiplier,J=(I=a.get(H))!=null?I:[];J.push(...U.nodes.map(X=>({id:X,weight:G+B.entryCost}))),a.set(H,J)}}}for(let[B,D]of It((P=e.nodes)!=null?P:{}))for(let F of(T=D==null?void 0:D.features)!=null?T:[]){let L=(M=t.space.get(F.properties.geometryIds[0]))==null?void 0:M.features[0],H=(L==null?void 0:L.geometry.type)==="Point"&&((w=L==null?void 0:L.properties.details)!=null&&w.externalId)?L.properties.details.externalId:"",U={type:"Feature",geometry:F.geometry,properties:{id:F.properties.id,floor:B,space:F.properties.geometryIds.map(G=>{var J;return(J=t.space.get(G))==null?void 0:J.ids}).flat().filter(G=>G!==void 0),neighbors:[...F.properties.neighbors.map(G=>({id:G.id,weight:G.extraCost})),...(E=a.get(F.properties.id))!=null?E:[]],map:B,externalId:H}};n.push(U)}return r}s(vz,"buildNodes");d();function xbe(e,t){var n;let r={};for(let o of e){let i=t.get(o);i&&((n=r[i])!=null||(r[i]=[]),r[i].push(o))}return r}s(xbe,"groupGeometryByType");function xz(e,{geometryMaps:t}){var a,l,c;if(!e.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let o=[...Array.from(t.space.values()).map(p=>p.features),...Array.from(t.obstruction.values()).map(p=>p.features)],i=new Map(o.flatMap(p=>p.map(f=>[f.properties.id,f.geometry.type])));for(let[p,f]of It(e.defaultStyle)){let m=xbe(f.geometryAnchors.flatMap(y=>{var v,x,S,I;return[...(x=(v=t.space.get(y.geometryId))==null?void 0:v.ids)!=null?x:[],...(I=(S=t.obstruction.get(y.geometryId))==null?void 0:S.ids)!=null?I:[]]}),i);if(m.Point&&m.Point.length>0){let y={points:Array.from(m.Point.values()),showImage:((a=f.extra)==null?void 0:a.showImage)!==void 0?((l=f.extra)==null?void 0:l.showImage)===!0:f.opacity!==0};n["".concat(p,".Point")]=y}if(m.LineString&&m.LineString.length>0){let y={lineStrings:Array.from(m.LineString.values()),altitude:f.altitude,color:f.color,height:f.height,opacity:f.opacity,width:f.buffer};n["".concat(p,".LineString")]=y}if(m.Polygon&&m.Polygon.length>0){let y={polygons:Array.from(m.Polygon.values()),altitude:f.altitude,color:f.color,height:f.height,opacity:f.opacity};((c=f.extra)==null?void 0:c.showImage)!==void 0&&(y.showImage=f.extra.showImage===!0),n["".concat(p,".Polygon")]=y}}return r}s(xz,"buildStyles");var Ibe=oU().extendOptional(cU).extendOptional($V).extendOptional(yU).extendOptional(DV).extendOptional(KV).extendOptional(xU).extendOptional(bV).extendOptional(VV).extendOptional(WV).extendOptional(EV).extendOptional(SV).extendOptional(oG).extendOptional(EU).extendOptional(fV).extendOptional(tz).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function Sbe(e){let t=oz(e),r=uz(e,t),n=yz(e,t),o=vz(e,t),i=sz(e,t),a=xz(e,t),l=dz(e,t),c=pz(e,t),p=cz(e,t),f=iz(e,t),m=gz(e,t),y=lz(e,t),v=bz(e,t);return{...r,...n,...o,...i,...a,...l,"tileset.json":e.tileset,...c,...p,...f,...m,...y,...v}}s(Sbe,"convertUnzippedStandardMVFv3ToParsedMVFv2");async function w4(e){let t=await Ibe.decompress(e);return t.isOk()?pe(Sbe(t.value)):ge(t.error)}s(w4,"extractAndConvertMVFv3");d();function fm(e){return e.endsWith("/")?e:"".concat(e,"/")}s(fm,"normalizeUrl");d();var mm="https://app.mappedin.com/",Iz="https://auth.mappedin.com/";d();d();var Cbe=s(e=>{let t=Date.now();return e-t},"fromNow"),t2=s((e,t)=>Cbe(e)<=t*60*1e3,"shouldRefreshToken");var Cz=60,Pz=Cz*60*1e3,Sz="accessTokens";async function Ag(e,t=!1){let r="".concat(e.key),n=vu.getInstance(),o=(n==null?void 0:n.loadSessionData(Sz))||{},i=Math.floor(Date.now()/1e3);if(o[r]&&!t2(o[r].expiresTimestamp*1e3,Cz))return o[r];let a=t?await Pbe(e,i):await Tbe(e,i),l={...o,[r]:a};return n==null||n.saveSessionData(Sz,l),a}s(Ag,"getAccessToken");async function Pbe(e,t){var i;let r="".concat((i=e.baseAuthUri)!=null?i:Iz,"oauth2/token"),n=await Ji()(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:e.key,client_secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let o=await n.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}s(Pbe,"fetchAccessTokenEnterprise");async function Tbe(e,t){let r="".concat(e.baseAuthUri?fm(e.baseAuthUri):mm,"api/api-key/token"),n=await Ji()(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e.key,secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let o=await n.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}s(Tbe,"fetchAccessToken");d();var wz=60,Mz=wz*60*1e3,Tz="miSasTokens";async function M4(e,t){let r="".concat(t,"__").concat(e.mapId),n=vu.getInstance(),o=(n==null?void 0:n.loadSessionData(Tz))||{};if(o[r]&&!t2(o[r].expires,wz))return o[r];let i=await wbe(e,t),a={...o,[r]:{token:i.token,expires:new Date(i.expires).getTime()}};return n==null||n.saveSessionData(Tz,a),i}s(M4,"getSasToken");async function wbe(e,t){let r="".concat(e.baseUri?fm(e.baseUri):mm,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await Ji()(r,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let o=await n.json();return{token:o.token,expires:new Date(o.expires).getTime()}}s(wbe,"fetchSasToken");var Oz=globalThis.fetch,Az,Mbe=(Az=b==null?void 0:b.env)==null?void 0:Az.npm_package_version;function Ji(){if(Oz==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Oz}s(Ji,"isomorphicFetch");var O4={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function kz(e){var r;let t={...O4,...e};return t.headers={...t.headers,"mappedin-sdk-version":Mbe},t.things=[],"platformString"in e&&(t.headers={...t.headers,"mappedin-platform-version":e.platformString}),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(r=t.language)==null?void 0:r.toLowerCase(),t}s(kz,"parseOptions");function Obe(e,t,r=!1){let n={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};r&&delete n.language;let{headers:o}=e;o["Content-Type"]=o["Content-Type"]||"text/json",e.accessToken?o.Authorization="Bearer ".concat(e.accessToken):e.noAuth||e.clientId&&e.clientSecret&&(o["x-mappedin-key"]=btoa(e.clientId),o["x-mappedin-secret"]=btoa(e.clientSecret));let i={method:"GET",headers:o};return e.secure&&(t+="&withcdntoken"),{req:i,url:t}}s(Obe,"constructParamsForRequest");async function Ebe(e,t,r=!1){let n=Obe(e,t,r),o=await Ji()(n.url,n.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}s(Ebe,"generateAPIRequest");var _be=s(e=>{let t=e!=null&&typeof e=="object"&&"perspectives"in e&&e.perspectives!=null&&typeof e.perspectives=="object"?e.perspectives:null;if(t==null||Object.keys(t).length===0)return j.warn("No perspectives available in response!"),null;let r={};for(let[n,o]of Object.entries(t)){let i="url"in o&&typeof o.url=="string"?o.url:null,a="locale_packs"in o&&typeof o.locale_packs=="object"?o.locale_packs:null;if(i==null||a==null){j.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:i,locale_packs:a}}return r},"getPerspectivesFromResponse");async function Abe(e,t="exports/mvf/1/bundle"){var p,f;let r=kz({baseUri:"https://api-gateway.mappedin.com/",...O4,...e}),n="".concat(r.baseUri+t,"?venue=").concat(r.venue,"&version=").concat((p=r.version)!=null?p:"2.0.0");r.headers["Content-Type"]="application/zip";let o=await Ebe(r,n),i=o.url,a=o.locale_packs,l=(f=r.perspective)!=null?f:O4.perspective,c=_be(o);if(l!=null&&l!==""&&c!=null){let m=c[l];m==null?j.warn("Perspective ".concat(l," not found in response! Loading default perspective instead.")):(j.log('Loading perspective "'.concat(l,'"')),i=m.url,a=m.locale_packs)}return{url:i,localePacks:a,updated_at:o.updated_at}}s(Abe,"getVenueMVFURL");var kg=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function E4(e,{signal:t}){let r=await(await Ji()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}s(E4,"getLanguagePackUnitArray");async function hm(e){let r=(await import("./browser-STB2T6NP.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let o=r["enterprise/locations.json"];o&&(n.enterprise.locations=JSON.parse(kg().decode(o)));let i=r["enterprise/categories.json"];i&&(n.enterprise.categories=JSON.parse(kg().decode(i)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(kg().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(kg().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(kg().decode(r["manifest.json"]))),n}s(hm,"parseLanguagePack");async function Dz(e,{signal:t}){try{let r=await(await Ji()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await hm(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}s(Dz,"downloadLanguagePack");async function _4(e){return new Promise(async(t,r)=>{try{let n=e.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:o,localePacks:i}=await Abe(e,n),a=await Ji()(o).then(c=>c.arrayBuffer()),l=new Uint8Array(a);t({compressed:l,localePacks:i})}catch(n){r(n)}})}s(_4,"downloadVenueBundleMVFAPIGateway");async function A4(e,t){return new Promise(async(r,n)=>{try{let{url:o}=await kbe(e,t),i=await Ji()(o).then(l=>l.arrayBuffer()),a=new Uint8Array(i);r(a)}catch(o){n(o)}})}s(A4,"downloadMVF");async function kbe(e,t){let r=new URL("".concat(e.baseUri?fm(e.baseUri):mm,"api/venue/").concat(e.mapId,"/mvf"));e.viewId&&r.searchParams.set("configId",e.viewId),e.mvfVersion&&r.searchParams.set("version",e.mvfVersion);let n=await Ji()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}s(kbe,"getMakerBundleURL");function r2(e){var n,o,i,a,l,c,p,f,m,y,v,x,S,I,P,T,M,w;let t=new TextDecoder,r=t.decode.bind(t);try{let E={"connection.json":JSON.parse(r(e["connection.json"])),"manifest.geojson":JSON.parse(r(e["manifest.geojson"])),"map.geojson":e["map.geojson"]?JSON.parse(r(e["map.geojson"])):void 0,"mapstack.geojson":e["mapstack.geojson"]?JSON.parse(r(e["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(r(e["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":e["tileset.json"]?JSON.parse(r(e["tileset.json"])):void 0};if(e.enterprise!=null&&(E.enterprise={},(n=e.enterprise)!=null&&n["locations.json"]&&(E.enterprise.locations=JSON.parse(r((o=e.enterprise)==null?void 0:o["locations.json"]))),(i=e.enterprise)!=null&&i["categories.json"]&&(E.enterprise.categories=JSON.parse(r((a=e.enterprise)==null?void 0:a["categories.json"]))),(l=e.enterprise)!=null&&l["venue.json"]&&(E.enterprise.venue=JSON.parse(r((c=e.enterprise)==null?void 0:c["venue.json"]))),(p=e.enterprise)!=null&&p["layers.json"]&&(E.enterprise.layers=JSON.parse(r((f=e.enterprise)==null?void 0:f["layers.json"]))),(m=e.enterprise)!=null&&m["locationInstances.json"]&&(E.enterprise.locationInstances=JSON.parse(r((y=e.enterprise)==null?void 0:y["locationInstances.json"]))),(v=e.enterprise)!=null&&v["enterpriseStyles.json"]&&(E.enterprise.enterpriseStyles=JSON.parse(r((x=e.enterprise)==null?void 0:x["enterpriseStyles.json"]))),(S=e.enterprise)!=null&&S["textures.json"]&&(E.enterprise.textures=JSON.parse(r((I=e.enterprise)==null?void 0:I["textures.json"]))),(P=e.enterprise)!=null&&P["floorText.json"]&&(E.enterprise.floorText=JSON.parse(r((T=e.enterprise)==null?void 0:T["floorText.json"]))),(M=e.enterprise)!=null&&M["categoryPriorities.json"]&&(E.enterprise.categoryPriorities=JSON.parse(r((w=e.enterprise)==null?void 0:w["categoryPriorities.json"])))),e["floorstack.json"]!=null?E["floorstack.json"]=JSON.parse(r(e["floorstack.json"])):e["mapstack.json"]!=null&&(E["mapstack.json"]=JSON.parse(r(e["mapstack.json"]))),E["floorstack.json"]==null&&E["mapstack.json"]==null&&E["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(E["floor.geojson"]=JSON.parse(r(e["floor.geojson"]))),E["floor.geojson"]==null&&E["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(E["styles.json"]=JSON.parse(r(e["styles.json"]))),"shapes.json"in e&&(E["shapes.json"]=JSON.parse(r(e["shapes.json"]))),"location.json"in e&&(E["location.json"]=JSON.parse(r(e["location.json"]))),"category.json"in e&&(E["category.json"]=JSON.parse(r(e["category.json"]))),e.annotation!=null){E.annotation={};let D=Object.keys(e.annotation);for(let F of D){let L=F.replace(/\.json|\.geojson/g,"");E.annotation[L]=JSON.parse(r(e.annotation[F]))}}let B=Object.keys(e.space);for(let D of B){let F=D.replace(/\.json|\.geojson/g,"");E.space[F]=JSON.parse(r(e.space[D]))}if(e.obstruction!=null){let D=Object.keys(e.obstruction);for(let F of D){let L=F.replace(/\.json|\.geojson/g,"");E.obstruction[L]=JSON.parse(r(e.obstruction[F]))}}else E.obstruction={};if(e.entrance!=null){let D=Object.keys(e.entrance);for(let F of D){let L=F.replace(/\.json|\.geojson/g,"");E.entrance[L]=JSON.parse(r(e.entrance[F]))}}else E.entrance={};if("floorImages"in e&&e.floorImages!=null){E.floorImages={};for(let D of Object.keys(e.floorImages)){let F=D.replace(/\.json|\.geojson/g,"");E.floorImages[F]=JSON.parse(r(e.floorImages[D]))}}if("textAreas"in e&&e.textAreas!=null){E.textAreas={};for(let D of Object.keys(e.textAreas)){let F=D.replace(/\.json|\.geojson/g,"");E.textAreas[F]=JSON.parse(r(e.textAreas[D]))}}if("facade"in e&&e.facade!=null){E.facade={};for(let D of Object.keys(e.facade)){let F=D.replace(/\.json|\.geojson/g,"");E.facade[F]=JSON.parse(r(e.facade[D]))}}if("area"in e&&e.area!=null){E.area={};for(let D of Object.keys(e.area)){let F=D.replace(/\.json|\.geojson/g,"");E.area[F]=JSON.parse(r(e.area[D]))}}return E}catch(E){throw j.error(E),new Error("MVF parsing failed! Probably encountered a bad file.")}}s(r2,"parseMVF");function Dbe(e){if(e==null||typeof e!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in e?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in e?"floorstack.json":"mapstack.json"in e?"mapstack.json":"mapstack.geojson"];"styles.json"in e&&t.push("styles.json"),"shapes.json"in e&&t.push("shapes.json");for(let r of t)if(e[r]==null||e[r][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}s(Dbe,"validateStaticMVFFiles");async function n2(e){return new Promise(async(t,r)=>{try{if(e==null||typeof e!="object")throw new Error("Error parsing data! Unzipping failed.");if(e[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let o=(await import("./browser-STB2T6NP.js")).unzipSync(e);if(!Dbe(o))throw new Error("MVF is missing some expect static files. Unzipping failed.");let i={},a=Object.keys(o);for(let l of a){if(o[l].length===0)continue;let c=l.split("/");if(c.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(c.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(c.length===1){i[c[0]]=o[l];continue}if(c[0]==="image"){j.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else i[c[0]]==null&&(i[c[0]]={}),i[c[0]][c[1]]=o[l]}t(i)}catch(n){r(n)}})}s(n2,"unzipMVF");function gp(){let e="us",t={};function r(){return Nbe($be(e),t)}return s(r,"getState"),{updateByUserOption(n){var o,i;n.environment&&(e=n.environment),n.baseUri&&(t.baseUri=n.baseUri),n.baseAuthUri&&(t.baseAuthUri=n.baseAuthUri),(o=n.analytics)!=null&&o.baseUri&&(t.analyticsBaseUri=(i=n.analytics)==null?void 0:i.baseUri)},updateTileServerBaseUrl(n){t.tileServerUri=n},updateEnvironment(n){e=n},getBaseUri(n){return e==="us"&&n?Ez.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?Ez.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}s(gp,"createEnvControl");var Fz=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Ez=Object.freeze({...Fz,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),Fbe=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),Lbe=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Rbe=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function Nbe(e,t){return{...e,...t}}s(Nbe,"getAuthStateByEnvironment");var Bbe={eu:Fbe,us:Fz,"us-staging-enterprise":Lbe,"us-staging-self-serve":Rbe};function $be(e){return Bbe[e]}s($be,"getEnvironmentAuthState");var k4=s(e=>{var r,n;let t=Object.values((n=(r=e["floorstack.json"])!=null?r:e["mapstack.json"])!=null?n:{});return t.length===1?[]:t.filter(o=>o.type!=="Outdoor").map(o=>o.id.replace("fs_","").replace("ms_",""))},"getBuildingIds"),_z=s(async e=>{let t=performance.now(),r=await w4(e);return j.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(n=>{throw j.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()},"unzipAndParseMVFv3ToMVFv2");async function D4(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await n2(e);return r2(r)}catch{return _z(e)}case"3.0.0":return _z(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}s(D4,"unzipAndParseMVFv2");d();function F4(e){var o,i,a,l,c,p;let t=((i=(o=e.enterprise)==null?void 0:o.locations)==null?void 0:i.reduce((f,m)=>(f[m.id]=m,f),{}))||{};for(let f of((a=e.enterprise)==null?void 0:a.locationInstances)||[])t[f.id]=f;let r={};for(let f of e["floorstack.json"]||[])r[f.id]=f;let n={};for(let f of((l=e["floor.geojson"])==null?void 0:l.features)||[])f.properties&&f.properties.id&&(n[f.properties.id]=f.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((p=(c=e.enterprise)==null?void 0:c.categories)==null?void 0:p.reduce((f,m)=>(f[m.id]=m,f),{}))||{},"floor-stack":r,floor:n}}}s(F4,"parseLocalePackToLanguagePack");function Lz(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}s(Lz,"isMappedinCdnUrl");function Rz(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}s(Rz,"hasSasToken");d();d();d();d();d();d();d();var L4=class L4{constructor({origin:t,destination:r,distance:n=0,angle:o=0,pathWeight:i=0,multiplicativeDistanceWeightScaling:a=!0}){h(this,"origin");h(this,"destination");h(this,"distance");h(this,"angle");h(this,"weight");if(this.origin=t,this.destination=r,this.distance=n,this.angle=o,this.weight=i||0,a?t.properties.floor===r.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===r.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};s(L4,"Edge");var bp=L4;d();d();d();d();function gi(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}s(gi,"getCoord");function Bo(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}s(Bo,"getCoords");function ym(e){return e.type==="Feature"?e.geometry:e}s(ym,"getGeom");function Nz(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}s(Nz,"getType");function fl(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=gi(e),o=ym(t),i=o.type,a=t.bbox,l=o.coordinates;if(a&&jbe(n,a)===!1)return!1;i==="Polygon"&&(l=[l]);for(var c=!1,p=0;p<l.length&&!c;p++)if(Bz(n,l[p][0],r.ignoreBoundary)){for(var f=!1,m=1;m<l[p].length&&!f;)Bz(n,l[p][m],!r.ignoreBoundary)&&(f=!0),m++;f||(c=!0)}return c}s(fl,"booleanPointInPolygon");function Bz(e,t,r){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var o=0,i=t.length-1;o<t.length;i=o++){var a=t[o][0],l=t[o][1],c=t[i][0],p=t[i][1],f=e[1]*(a-c)+l*(c-e[0])+p*(e[0]-a)===0&&(a-e[0])*(c-e[0])<=0&&(l-e[1])*(p-e[1])<=0;if(f)return!r;var m=l>e[1]!=p>e[1]&&e[0]<(c-a)*(e[1]-l)/(p-l)+a;m&&(n=!n)}return n}s(Bz,"inRing");function jbe(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}s(jbe,"inBBox");d();d();function ml([e,t],[r,n]){let o=t-n,i=e-r;return(Math.atan2(i,o)+Math.PI*3)%(Math.PI*2)}s(ml,"getAngle");d();var Gbe=63710088e-1;function Qi(e,t){let[r,n]=e.map(f=>f*Math.PI/180),[o,i]=t.map(f=>f*Math.PI/180),a=i-n,l=o-r,c=Math.sin(a/2)*Math.sin(a/2)+Math.cos(n)*Math.cos(i)*Math.sin(l/2)*Math.sin(l/2),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return Gbe*p}s(Qi,"getDistance");d();d();function o2(e,t,r,n){let[o,i]=e,[a,l]=t,[c,p]=r,[f,m]=n;if(i===l&&o===a||p===m&&c===f)return null;let y=(f-c)*(l-i)-(m-p)*(a-o);if(y===0)return null;let v=((m-p)*(o-c)-(f-c)*(i-p))/y,x=((l-i)*(o-c)-(a-o)*(i-p))/y;if(v<0||v>1||x<0||x>1)return null;let S=i+v*(l-i);return[o+v*(a-o),S]}s(o2,"getLineIntersection");d();d();function vp(e,t,r,n){n===void 0&&(n={});var o=gi(e),i=so(o[0]),a=so(o[1]),l=so(r),c=_8(t,n.units),p=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(l)),f=i+Math.atan2(Math.sin(l)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(p)),m=Kh(f),y=Kh(p);return Ss([m,y],n.properties)}s(vp,"destination");function R4(e,t,r,n){let o=vp(e,r/1e3,n),i=vp(t,r/1e3,n);return[o.geometry.coordinates,i.geometry.coordinates]}s(R4,"getOffsetLine");d();function N4(e){let t=e*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}s(N4,"radToDegNormalized");var $z=111e3;function jz(e,t,r=[],n=0){let o=!0,i=e.geometry.coordinates,a=t.geometry.coordinates,l=N4(ml(i,a)-Math.PI/2),c=N4(ml(i,a)+Math.PI/2),p=n/$z,f=n/($z*Math.cos(i[1]*Math.PI/180)),m=Math.min(i[1],a[1])-p,y=Math.max(i[1],a[1])+p,v=Math.min(i[0],a[0])-f,x=Math.max(i[0],a[0])+f;for(let S of r)if(!(Math.max(S[0][1],S[1][1])<m||Math.min(S[0][1],S[1][1])>y||Math.max(S[0][0],S[1][0])<v||Math.min(S[0][0],S[1][0])>x)){if(n>0){let I=R4(i,a,n,l),P=R4(i,a,n,c);if(o2(I[0],I[1],S[0],S[1])||o2(P[0],P[1],S[0],S[1])){o=!1;return}}else if(o2(i,a,S[0],S[1])){o=!1;return}}return o}s(jz,"hasLineOfSight");var xp,mn,B4,Gz,Uz,Vz,zz,Hz,Wz,s2,$4=class $4{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){O(this,mn);h(this,"edges",{});h(this,"nodesById");h(this,"nodesByGroup",new Map);O(this,xp);O(this,s2,s((t,r)=>{let n=0;for(let o of r)(!o[u(this,xp)]||o[u(this,xp)]===t.properties[u(this,xp)])&&fl(t.geometry.coordinates,o.geometry.geometry)&&(n+=Math.max(0,o.cost));return n},"#getZonalCost"));A(this,xp,r);let{features:o}=t;this.nodesById=te(this,mn,Gz).call(this,o),te(this,mn,Uz).call(this),te(this,mn,Vz).call(this,o,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,o)=>{let i=Qi(t.geometry.coordinates,o.geometry.coordinates);return Math.min(n,i)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:r,excludedNodeIds:n,disabledConnectionNodeIds:o,zones:i}){let a=te(this,mn,B4).call(this,t),l=te(this,mn,B4).call(this,r);if(a.length===0||l.length===0)return[];let{frontier:c,cameFrom:p,costSoFar:f}=te(this,mn,zz).call(this,a,l);for(;c.length>0;){let m=c.shift();if(!m)break;if(te(this,mn,Hz).call(this,m.origin,l))return te(this,mn,Wz).call(this,p,m.origin.properties.id);for(let y of this.edges[m.origin.properties.id]){if(o!=null&&o.has(y.origin.properties.id)&&y.destination.properties.map!==y.origin.properties.map)continue;let v=f[m.origin.properties.id]+y.weight+u(this,s2).call(this,y.destination,i);if(!(v===1/0||n!=null&&n.has(y.destination.properties.id))&&(f[y.destination.properties.id]==null||v<f[y.destination.properties.id])){let x=v+this.getShortestEuclideanDistance(y.destination,l);f[y.destination.properties.id]=v,p[y.destination.properties.id]=y,c.push({origin:y.destination,priority:x})}}c.sort((y,v)=>y.priority-v.priority)}return[]}};xp=new WeakMap,mn=new WeakSet,B4=s(function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},"#filterValidNodes"),Gz=s(function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},"#createNodesById"),Uz=s(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:r})=>!!this.nodesById[r]))},"#removeInvalidNeighbors"),Vz=s(function(t,r,n){t.forEach(o=>{let i=r==="default"?r:o.properties[r];this.nodesByGroup.has(i)||this.nodesByGroup.set(i,[]),this.nodesByGroup.get(i).push(o),this.edges[o.properties.id]=o.properties.neighbors.map(({id:a,weight:l})=>{let c=this.nodesById[a],p=Qi(o.geometry.coordinates,c.geometry.coordinates),f=ml(o.geometry.coordinates,c.geometry.coordinates);return new bp({origin:o,destination:c,pathWeight:l,distance:p,angle:f,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),zz=s(function(t,r){let n=[],o={},i={};return t.forEach(a=>{let l=this.getShortestEuclideanDistance(a,r);n.push({origin:a,priority:l}),o[a.properties.id]=null,i[a.properties.id]=0}),n.sort((a,l)=>a.priority-l.priority),{frontier:n,cameFrom:o,costSoFar:i}},"#initializeSearch"),Hz=s(function(t,r){return r.some(n=>n.properties.id===t.properties.id)},"#isDestinationNode"),Wz=s(function(t,r){let n=[],o=t[r];for(;o;)n.push(o),o=t[o.origin.properties.id];return n.reverse()},"#reconstructPath"),s2=new WeakMap,s($4,"NavigationGraph");var i2=$4;var Ube=.4,j4=class j4{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:o}){h(this,"groupBy");h(this,"graph");h(this,"geometryEdgesByMapId",new Map);h(this,"generatePath",s(t=>{let{destination:r}=t[t.length-1],n={type:"FeatureCollection",features:[]};for(let i=0;i<t.length;i++){let{origin:a,destination:l}=t[i],c={id:a.properties.id,angle:t[i].angle,distance:t[i].distance,destination:l.properties.id,edges:this.graph.edges[a.properties.id]};this.groupBy!=="default"&&(c.groupBy=a.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:c})}let o={id:r.properties.id,edges:this.graph.edges[r.properties.id]};return this.groupBy!=="default"&&(o.groupBy=r.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[r.geometry.coordinates[0],r.geometry.coordinates[1]]},properties:o}),n},"generatePath"));h(this,"getDistance",s((t,r)=>Qi(t,r),"getDistance"));h(this,"getAngle",s((t,r)=>ml(t,r),"getAngle"));this.groupBy=n,this.graph=new i2({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:o}),((r==null?void 0:r.features)||[]).forEach(a=>{let l=null;if(a.geometry.type==="LineString"?l=a.geometry.coordinates:a.geometry.type==="Polygon"&&(l=a.geometry.coordinates.flat()),l){let c=this.groupBy==="default"?this.groupBy:a.properties[this.groupBy];this.geometryEdgesByMapId.has(c)||this.geometryEdgesByMapId.set(c,[]),l.forEach((p,f)=>{this.geometryEdgesByMapId.get(c).push([p,l[f+1]||l[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:o,disabledConnectionNodeIds:i,simplify:a,multiplicativeDistanceWeightScaling:l}){var m,y;let c=(m=a==null?void 0:a.enabled)!=null?m:!0,p=t!=null?t:[],f=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:p,excludedNodeIds:new Set(o),disabledConnectionNodeIds:new Set(i)});return f.length===0?{type:"FeatureCollection",features:[]}:(c&&(f=this.simplifyAllSteps(f,(y=a==null?void 0:a.bufferRadius)!=null?y:Ube,l)),this.generatePath(f))}simplifyAllSteps(t,r,n){var p,f;let o=[],i=[t[0]];for(let m=1;m<t.length;m++)if(this.groupBy!=="default"&&t[m].origin.properties[this.groupBy]!==t[m-1].origin.properties[this.groupBy]){let y=t[m-1].origin.properties[this.groupBy],v=(p=this.geometryEdgesByMapId.get(y))!=null?p:[];o.push(...this.simplifySteps(i,v,r,n)),i=[t[m]]}else i.push(t[m]);let a=t[t.length-1],l=this.groupBy==="default"?this.groupBy:a.origin.properties[this.groupBy],c=(f=this.geometryEdgesByMapId.get(l))!=null?f:[];return o.push(...this.simplifySteps(i,c,r,n)),o}simplifySteps(t,r,n,o){if(t.length<3)return t;let i=[t[0]],a=1;for(let l=a+2;l<t.length;l++)if(t[a].origin.properties.preventSmoothing||!jz(t[a].origin,t[l].origin,r,n)){let c=l-1;i.push(new bp({...t[a],destination:t[c].origin,distance:Qi(t[a].origin.geometry.coordinates,t[c].origin.geometry.coordinates),angle:ml(t[a].origin.geometry.coordinates,t[c].origin.geometry.coordinates)})),a=c}return i.push(new bp({...t[a],destination:t[t.length-1].origin,distance:Qi(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:ml(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:o}),t[t.length-1]),i}};s(j4,"Navigator");var gm=j4;d();var x5e={};Pa(x5e,{Annotation:()=>Na,Area:()=>Fa,Connection:()=>sc,Coordinate:()=>Le,DOORS:()=>m1,Door:()=>Fi,E_SDK_LOG_LEVEL:()=>Q9,EnterpriseCategory:()=>gy,EnterpriseLocation:()=>Es,EnterpriseVenue:()=>D0,Facade:()=>Ko,Floor:()=>ao,FloorStack:()=>ry,Hyperlink:()=>ec,ImageMetaData:()=>rc,LocationCategory:()=>by,LocationProfile:()=>Nu,MAPPEDIN_COLORS:()=>t_,MapObject:()=>lo,Node:()=>Aa,PointOfInterest:()=>Ra,Space:()=>Ur,WALLS:()=>f1,__setWatermarkOnClickFn:()=>f5e,createMapLibreOverlay:()=>b5e,disableText3DWorker:()=>see,enableTestMode:()=>FO,getMapData:()=>Mee,getMapDataEnterprise:()=>g5e,hydrateMapData:()=>y5e,hydrateMapDataFromMVF:()=>m5e,parseMVF:()=>r2,preloadFont:()=>J7,setLoggerLevel:()=>e8,setUseEnterpriseAPI:()=>h5e,setWorkersUrl:()=>dee,show3dMap:()=>Oee,show3dMapGeojson:()=>v5e,unzipMVF:()=>n2});d();d();d();d();var Fg,Lg,Rg,G4=class G4{constructor(t,r,{enabled:n=!1}={}){O(this,Fg);h(this,"searchInstance");O(this,Lg);O(this,Rg);h(this,"enabled",!1);A(this,Fg,t),A(this,Lg,r),A(this,Rg,()=>{var o;(o=this.searchInstance)==null||o.then(i=>i.populate())}),n&&this.enable()}async query(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return j.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return j.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return j.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return j.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-BKHYFNI6.js").then(({InternalSearch:t})=>new t(u(this,Fg)))),u(this,Lg).on("language-change",u(this,Rg)),await this.searchInstance)}};Fg=new WeakMap,Lg=new WeakMap,Rg=new WeakMap,s(G4,"Search");var Dg=G4;var qz=new WeakMap,Tr,V4=class V4 extends Fe{constructor(r,{search:n}={}){super();O(this,Tr);h(this,"Analytics");h(this,"Search");h(this,"Query");h(this,"getDirections",s((r,n,o)=>u(this,Tr).getDirections(r,n,o),"getDirections"));h(this,"getDirectionsMultiDestination",s((r,n,o)=>u(this,Tr).getDirectionsMultiDestination(r,n,o),"getDirectionsMultiDestination"));A(this,Tr,r),qz.set(this,r),this.Analytics=new vy(r.Analytics),this.Query=r.Query,this.Search=new Dg(this,r,{enabled:n==null?void 0:n.enabled}),u(this,Tr).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return u(this,Tr).getEnv()}getAccessToken(){var r;return(r=u(this,Tr).tokenManager)==null?void 0:r.getAccessToken().token}get mapName(){return u(this,Tr).mapName}get mapCenter(){return u(this,Tr).mapCenter}get organizationId(){return u(this,Tr).organizationId}get outdoorViewToken(){return u(this,Tr).outdoorViewToken}getByType(r){return u(this,Tr).getByType(r)}getById(r,n){return u(this,Tr).getById(r,n)}getByExternalId(r,n){return u(this,Tr).getByExternalId(r,n)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return u(this,Tr).changeLanguage(r)}get currentLanguage(){return u(this,Tr).currentLanguage}get naturalBearing(){var r;return(r=u(this,Tr).naturalBearing)!=null?r:0}getDistance(r,n){return u(this,Tr).getDistance(r,n)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return u(this,Tr).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return u(this,Tr).toJSONBundle({downloadLanguagePacks:r})}};Tr=new WeakMap,s(V4,"MapData");var U4=V4,a2=U4;function Ng(e){let t=qz.get(e);if(!t)throw new Error("MapDataInternal not found");return t}s(Ng,"getMapDataInternal");d();d();d();d();d();function Vbe(e,t,r){r===void 0&&(r={});for(var n=gi(e),o=Bo(t),i=0;i<o.length-1;i++){var a=!1;if(r.ignoreEndVertices&&(i===0&&(a="start"),i===o.length-2&&(a="end"),i===0&&i+1===o.length-1&&(a="both")),zbe(o[i],o[i+1],n,a,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}s(Vbe,"booleanPointOnLine");function zbe(e,t,r,n,o){var i=r[0],a=r[1],l=e[0],c=e[1],p=t[0],f=t[1],m=r[0]-l,y=r[1]-c,v=p-l,x=f-c,S=m*x-y*v;if(o!==null){if(Math.abs(S)>o)return!1}else if(S!==0)return!1;if(n){if(n==="start")return Math.abs(v)>=Math.abs(x)?v>0?l<i&&i<=p:p<=i&&i<l:x>0?c<a&&a<=f:f<=a&&a<c;if(n==="end")return Math.abs(v)>=Math.abs(x)?v>0?l<=i&&i<p:p<i&&i<=l:x>0?c<=a&&a<f:f<a&&a<=c;if(n==="both")return Math.abs(v)>=Math.abs(x)?v>0?l<i&&i<p:p<i&&i<l:x>0?c<a&&a<f:f<a&&a<c}else return Math.abs(v)>=Math.abs(x)?v>0?l<=i&&i<=p:p<=i&&i<=l:x>0?c<=a&&a<=f:f<=a&&a<=c;return!1}s(zbe,"isPointOnLineSegment");var Zz=Vbe;d();function Hbe(e,t){t===void 0&&(t={});var r=Dd(e),n=(r[0]+r[2])/2,o=(r[1]+r[3])/2;return Ss([n,o],t.properties,t)}s(Hbe,"center");var l2=Hbe;d();d();function Wbe(e,t,r){r===void 0&&(r={});var n=gi(e),o=gi(t),i=so(o[1]-n[1]),a=so(o[0]-n[0]),l=so(n[1]),c=so(o[1]),p=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(l)*Math.cos(c);return E8(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),r.units)}s(Wbe,"distance");var Ec=Wbe;function c2(e,t){return t===void 0&&(t={}),k8(e,function(r,n){var o=n.geometry.coordinates;return r+Ec(o[0],o[1],t)},0)}s(c2,"length");d();d();d();function u2(e,t,r){if(r===void 0&&(r={}),r.final===!0)return qbe(e,t);var n=gi(e),o=gi(t),i=so(n[0]),a=so(o[0]),l=so(n[1]),c=so(o[1]),p=Math.sin(a-i)*Math.cos(c),f=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(a-i);return Kh(Math.atan2(p,f))}s(u2,"bearing");function qbe(e,t){var r=u2(t,e);return r=(r+180)%360,r}s(qbe,"calculateFinalBearing");d();d();function Zbe(e){if(!e)throw new Error("geojson is required");var t=[];return Cs(e,function(r){Xbe(r,t)}),xu(t)}s(Zbe,"lineSegment");function Xbe(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=Bo(n);break;case"LineString":r=[Bo(n)]}r.forEach(function(o){var i=Ybe(o,e.properties);i.forEach(function(a){a.id=t.length,t.push(a)})})}}s(Xbe,"lineSegmentFeature");function Ybe(e,t){var r=[];return e.reduce(function(n,o){var i=_a([n,o],t);return i.bbox=Kbe(n,o),r.push(i),o}),r}s(Ybe,"createSegments");function Kbe(e,t){var r=e[0],n=e[1],o=t[0],i=t[1],a=r<o?r:o,l=n<i?n:i,c=r>o?r:o,p=n>i?n:i;return[a,l,c,p]}s(Kbe,"bbox");var z4=Zbe;var nY=ys(tY(),1);function x2e(e,t){var r={},n=[];if(e.type==="LineString"&&(e=x3(e)),t.type==="LineString"&&(t=x3(t)),e.type==="Feature"&&t.type==="Feature"&&e.geometry!==null&&t.geometry!==null&&e.geometry.type==="LineString"&&t.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var o=rY(e,t);return o&&n.push(o),xu(n)}var i=(0,nY.default)();return i.load(z4(t)),I3(z4(e),function(a){I3(i.search(a),function(l){var c=rY(a,l);if(c){var p=Bo(c).join(",");r[p]||(r[p]=!0,n.push(c))}})}),xu(n)}s(x2e,"lineIntersect");function rY(e,t){var r=Bo(e),n=Bo(t);if(r.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=r[0][0],i=r[0][1],a=r[1][0],l=r[1][1],c=n[0][0],p=n[0][1],f=n[1][0],m=n[1][1],y=(m-p)*(a-o)-(f-c)*(l-i),v=(f-c)*(i-p)-(m-p)*(o-c),x=(a-o)*(i-p)-(l-i)*(o-c);if(y===0)return null;var S=v/y,I=x/y;if(S>=0&&S<=1&&I>=0&&I<=1){var P=o+S*(a-o),T=i+S*(l-i);return Ss([P,T])}return null}s(rY,"intersects");var _m=x2e;function I2e(e,t,r){r===void 0&&(r={});var n=Ss([1/0,1/0],{dist:1/0}),o=0;return Cs(e,function(i){for(var a=Bo(i),l=0;l<a.length-1;l++){var c=Ss(a[l]);c.properties.dist=Ec(t,c,r);var p=Ss(a[l+1]);p.properties.dist=Ec(t,p,r);var f=Ec(c,p,r),m=Math.max(c.properties.dist,p.properties.dist),y=u2(c,p),v=vp(t,m,y+90,r),x=vp(t,m,y-90,r),S=_m(_a([v.geometry.coordinates,x.geometry.coordinates]),_a([c.geometry.coordinates,p.geometry.coordinates])),I=null;S.features.length>0&&(I=S.features[0],I.properties.dist=Ec(t,I,r),I.properties.location=o+Ec(c,I,r)),c.properties.dist<n.properties.dist&&(n=c,n.properties.index=l,n.properties.location=o),p.properties.dist<n.properties.dist&&(n=p,n.properties.index=l+1,n.properties.location=o+f),I&&I.properties.dist<n.properties.dist&&(n=I,n.properties.index=l),o+=f}}),n}s(I2e,"nearestPointOnLine");var eb=I2e;function S2e(e,t,r){var n=Bo(r);if(Nz(r)!=="LineString")throw new Error("line must be a LineString");var o=eb(r,e),i=eb(r,t),a;o.properties.index<=i.properties.index?a=[o,i]:a=[i,o];for(var l=[a[0].geometry.coordinates],c=a[0].properties.index+1;c<a[1].properties.index+1;c++)l.push(n[c]);return l.push(a[1].geometry.coordinates),_a(l,r.properties)}s(S2e,"lineSlice");var AO=S2e;var C2e=1e-7;function kO(e){return{type:"Point",coordinates:e}}s(kO,"point");function P2e(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,o=r.map(i=>eb(e,kO(i)));return n.reduce((i,a)=>{let l=AO(kO(a),o[0],e),c=AO(kO(a),o[1],e),p=c2(l)<c2(c)?l:c;return p.properties={...e.properties,entrances:[]},i.concat([p])},[])}s(P2e,"splitObstructionByEntrance");function DO(e,t){return t.reduce((r,n)=>{let o={epsilon:C2e},i=r.obstructions.findIndex(l=>Zz(l2(n),l,o)),a=r.obstructions[i];if(a){let[l,c]=P2e(a,n);r.entrances.push(n),r.obstructions.splice(i,1,l,c)}return r},{obstructions:[e],entrances:[]})}s(DO,"findAndSplitObstructionByAllEntrances");d();d();d();d();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:s(function(){return this},"get"),configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var oY="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAkGBwgHBgkICAgKCgkLDhcPDg0NDhwUFREXIh4jIyEeICAlKjUtJScyKCAgLj8vMjc5PDw8JC1CRkE6RjU7PDn/2wBDAQoKCg4MDhsPDxs5JiAmOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTn/wgARCAIABAADAREAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAECAwQFBgf/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAP3EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAIAAAJAFAAAAAAAAAAAAAAAAAAAAAAAAABAgAAEgCgAAAAAAAAAAAAAAAAAAAABERLSM1zM4zXMzjMoUIqCCSSS8XNC9mpoaVomharWTQAAAAAAAAAAAAAAAAEREtIoZrnGZkucUKFStQQSTFixdNDStF0TWrmiWqbJoAAAAAAAAAAAAAIgiWkZy4HNLzHLXKcxzpzmFYmRkUKFSCCSSxcuampsbR0HSdK9R1R1HTZvWll0mlAAAAAAAAAAAIiKLnLjHNLynLXKcycxzmNYmJmUKFSCAWLFy5qamxvHQvSdJ0nVHUdFm1aparWKAjNWSKAAAAARBEtYzlyXnjmOSuM4U4q4jjOM5a5k5zAyMjOqFCCCCSSS5c0jU1NzoOk6pew7TtjuO1e0646jezWr2WSaUAAAAAECIqtZco55eY464zhTirhOI5Dks5jAwMTIzqhUqQASWLFzSNTY3Og6V646zsO2O47V7DrjqNzWy9nlZ1c0LlrLEk0EQQVipRczIyMU5q5F4U8+vOPOrgThOOuU5jAxMjMzKpUggigJiSSxY0XQ1Njc6TqjtO49CX0D0T0Y7l7E6JdzU1NEvViSalBAWIqVKLSMjIxOauM4U86vPPOrz04TjrkOYwMTIzKJQqQQCKmBJJYutzQ1Njc6TrOyO475fRPRPQjuXsToXWPn6kkkEkhCkEAgggqVMjlrzzzDy7PMPPrhOQ5jBMqoVIIIAAIAJAAJJJLFzWN16TsO49CPTPUl9Q9A6o1LFiSSSSQpCwQQCCCpVMjlrzzyzy7PMPPrhOM5kwM6zKlQQAAQASAASCxY0NI3XpOw7j0I9M9SX0z0DqjU+UqpQqVIBFgEyixJYuWLFDkrzE8o8yvOONOasipBAAAAAAAAAAABJJY2OiO1fQPUj1T0pewuVKlCCqQsBIUSSSSWLlyTM5K808pPLrzziTnrEqQQAAAAAAAAAAASSWNjojtX0D1I9VfSOuND4uzMzqhQqVIALEli5c1jUuQc1vnp5pwJzVmQQAAAAAAAAAAAAAASSaHTHevpHoHTFjMyM6zKlSpABJJcsaGkamhU5q88804E5qzIIAAAAAAAAAAAAAAJJNDpjvX0j0Dqix8dVDMolSpAqCYElixc0XU0IMjlTlrIqAAAAAAAAAAAAAAAAAWNTqjqXYGZkZpUoQQRSFIsSXLroaGhBkcqctZFQAAAAAAAAAAAAAAAACxqdUdS7EngWQCAAQASACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYFSCCAACCQACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYGIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAJABAAAAAAAAAJBILEli5Y0LlzQ0Lly5csWLAkgFSChUoUMyhmUMyhQqVKkEEAEAAAAAAAAAkEgsSWLljQuXNDQuXLlyxYsCSAVIKFShQzKGZQzKFCpUqQe+ZmZkUKFCpUEEAAkksWLFzQ0NTU2NzY3Og3NzoNzc2NjU1NS5csSAQVKmZmZGRiYmBgYHOYGBgYGBiZGRkUMypUqQCAASSWLFi5oaGpqbG5sbnQbm50G5ubGxqampcuWJAIIKGZmZGRiYmBgYHOYGBgYGR+jmBzmBzmJiZGZQoQQSSWLmhqbGxudB0nSdJ1HSdR1HSdJ0G5qamhcsWJJJBIIIBUqVKFDIyMDA5jmOU5TlOY5TmOc5znMTEyMyhQggFixc0NTY2NzoOk6TpOo6TqOo6TpOg3NTU0LlixJJIJBAIKkFChQyMjAwOY5jlOU5jnP00yMTnOc5zAwMjMoVIJJLmhqbmx0HQdBubmxqXLkkgAAAAAAAAAAAAAEEFTMzMTEwOc5znMDAyMyhUgkkuaGpsbnQdB0G5ubGpcuSSAAAAAAAAAAAAAAQQVKGZ1gAEEEEFSCACSSxJJJIAAAAAAAAAAAAAAAAAAAAAAABBBBBUggAkkksSSSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSSSSAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSWBIAAKFiQAAAAAAAAACCpUoUMzIyMzMzMyhQoVKkEEAgkEkklixYuXNDQ0NTQ1NC5cuWJAAAAAAAAAAIKlShQzMjIzMzMzKFChUqQQQCCQSSSWLFyxoXNDQ1NDU0LljUkkAAAAAAAAAAggggEEAgAAAAAAAAAAAAAEkgkkkkkAAAAAAAAAAgggggEAgAAAAAEgEAAAAAAEkgkkuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADyyCCCCCCCCAQASCSQWJJJJLEkkkkkgkkEgkAEgAAEAAgEAggEEEEEEEFSCCCCCCAQASCSQWJJJJLEkkkkkgkkEgEgEgAAEAAgEAggEEEEEH5AQQQQVBBAIAAJBIJJJLEkkkkliSSSSSQSSCQSAAAQAQQCCCCCCCCCpBBBBBUEEEAgAAkEgkkksSSSSSWJJJJJJBJIJBIAABABBAIIIIIIIIKg/LCAQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQAQQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQfPgAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/xAApEAAABQUBAQACAwACAwAAAAABAgQFFQMGERQWEhNAUAAgMGCAkKCw/9oACAEBAAECAP8AwTZznOf3mc5/YZE41xVivFyM6i7C8C8C8zMzMzMyDyDyDyDwV4K7ldSuZV5VgVwqZ/SCca4qxXmcjOouwvAvEzMzMzMzMyDyDyDwV4K7ldSuRVwKgrgf88TDWMrO4VHOo61Hao7ndzvB3k7yZ5M8i8i8zMzMzMyDyDyDyV5K8keSPJHmm8U3em70nam603Mi8qotUDfk5GqZUdfUc6jrUdqjvUeDvB3kzyZ5M8i8i8zMzMzMzMg8g8leSvJHkjyR5pvFN4pu9N2pOtNzIvKqLWA39PX+/saplJlh1tRfVcKrlVdKrrVdqrvVdzu53Y7sZ2M6mdRdRdBdJSUk5SUB0B0B1K6kdSOxHam7Unek70nei7UXWi6UXKk40l9NaRWWuB8/75E41zKjraq+q41nOq6VXas7VXeq71Hc7ud2O7GdRdRdZQXSUlJSUlAdCugOpXUjqR2I7U3em70nek70nai60XSk5UnGkvItIrKoCsC0FwLgXAuBbube3ubm7uiuFcZcZaZYdZUWVl1dwruVdzrulZ0qulVzqOR3EzgZeZcZcK0Vm3t7W1tbW1tgrBYC0q0q4q8jgRxpuVJzoulB0oOlBzoOVBworqa0iwi0i0q4FwLQWAr2trZ2trb3RWiuFcZaZadbUW1l1ZwruVd0rulZ0qulVzqOR3E7gZeZeK4VorNzb29ra2tsFe2CwFpVxVxV5HAjjTcqTnRdKDpQdKDnQcqDhRXU1pFhVm/ISUnKSkrLSsrKyspJyUhvitOtrLq69Q4qHGu41nGqvqLjrDKhUDW+nv1nP+Oc+vYVArFUEVEWUl1FfQcU7imckzinX0VxFoLgXyMlJykrLS0tLS0rKSclI74rjraq6uvUuKhxruNdxqr6i46wysVA1vp79Zz/AI5z6A4VArFUEVkWUl1FfQcU7imcUzinX0VxFoLZKTlJWVlpaXl5eWlpWUB0BzBxkDr669SvUr666stqqz1xqes/j5AxahFFJXRWp1yZemX0F5HCQkpOUlZaWlpeXl5aWB2lQdAcwcZE7hWcFLgpXqF1ZbVVnUDU9Z/HyBi1CV6SuitTrky9MvoLyL5AXEXEXIXIXKSkpKSkpIHIHIHIrkVxK4yJnCsvrra6uqpPVE354GJVpKaCtOtoryuEiZxM5C5C5C5SUnJSclJSQOQORXIrkVxBxM4VV9dbXV1VJ6om/PAxKtFTQVp1tFeRwkRWitFYKvb2tra2draBUCsFgLCrSrQWitOsqqT1RN+jAxKtJTTWFWitMtMtFYKzb29ra2tnaBUCsFZVhVpVoLRWnWVFJ6om/RgYlWkpprAW73v36zn++c+gOFQKv1GoJv04GCp9Rq/T36zn++c+gOFT7fUagm/TgYKn1+3/AKEeMefHjx8/n8vl8vn8/Hjx5xj9bjHnx48fP5/L5fL5/Px48ecY/wAvOPxceQIFIKIJgSAiBAVuK2FaitINAM4MwMwMsJCQkJCQkJCwosws4tAtItQtgtot4oRSCm+Hy8ecfi48gQKQUQTAkBECArcVsK1FaQaAZwZgZgZYSEhISEhISFhRZhZxaBaRahbBbRbxQikFN8BpfMWgWozWLaLcKAUWpq62vr/DX19YEoJARAhBvK2laytRGgjORlIyEYiMJLfJbxLdJbhLbJbRLaJbJbZLbAWxzHMcxzHMcxzHMDbBrYNbJraNbRrbPbh7dPbx7fOwHYjsZ2UzMZoM0maxbRbhQCi1NXW19fX19fW1QSAiBCDeVtK1laiNBGYjKRkIxEYSW+S3iW6S3CW2S2iW0S2S2yW2AtgLY5jmOY5jmOY5gbYNbJrZNbRraPbZ7cPbp7ePb52A7EdjOymZjW4e3D26e3j2+ZgMwmYhYxY4SEhISEBjKxlYiMJGAjAS3iW9TtynblO26dtUrap2zTtmnbNO2SW2S3isRWYGkG0EAItTW1/h8Phr6+rp6AtwtQs5mI9vntw9tHtk9s1LZqWzUto9tnts9uHt09vHt8zAZhMxCxixwkJCQkIDGVjKxEYSMBGAlvEt6nblO3Kdt0rap21TtmnbNO2SWyS2yW8ViKzA1A2ggBFqa2v8Ph8NfW1dPRFuFqMzGYjW+e3D20e2T2zUtk9tHto1tCzHYj2+e3T24e3D24a3DW4Nuc5znOc4FuBbhbcLbhLcJblO3CW4S3iMRGcrYVECcKYB+cJBoCjM2maDsZ7fPbp7cPbh7cNbhrcG3Oc5znOcC3C24W3C24S3CW5TtwluEt4jERnK2FRAnCmAfnCQaAoxb/7ePl8NbU09PT1NYKHy8Y/ZePl8NbU09PT1NYKHy8Y/4Z6+g1tjb3d+Rk5SVlZWVlZSTkd8Fu3s/b6es/pvX0Gtsbe7vyMnKSkrKysrKSciC8Fu3s/YKnrP9gqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqoqsqsqoFIVwqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqkqsqsqsFIV/Hn8XHj5/H4a+traurq6mpqampqampqampqampqampqampqamrq62tr/D4/Lx5/Fx4+fx+Gvra2rq6upqampqampqamrq6upqampqampqamrq6utra/w+Py/wCgEzNTc5OTs7PT09PT8/Pz09PT07Ozk3Ng9TMxLy0rKSclJSMhIb+9vbu9u7u7u7u7u729vb2/vyEjJSUnKSstLzEzNTc5OTs7Oz09PT8/Pz09PT07Ozk5NzUzMS8tKyknJSUjISG/v727vbu7u7u7u7u9u729v78hIyUlJykrLS8x0nR9H0fR9H0XRdF0XRdD0PQ9F0XRdF0XRdF0fR9H0nSdJ0vS9L0vTdN03TdP0/T9P0/T9P0/T9P0/T9R0/T9P0/T9P0/TdN03S9L0vS9J0nSdJ0fR9H0XRdF0PRdD0PQ9D0PRdF0XRdF0XR9H0fSdJ0nS9L0vS9N03TdN0/T9P0/T9P0/T9P0/T9P1HT9P0/T9P0/T9N03TdL0vS9L0vSS8tLy0tLS0rKysrKysrKysrKystLS0vLS8vLy8vMTExMTExMzMzMTMzMzM1NTUzMzMzMzMzMzExMTExMS8vLy8vLy8tKy0tKysrKysrKysrKysrLS0tLy0vLy8vLzExMTExMTMzMzEzMzMzNTU1MzMzMzMzMzMxMTExMTEvLy8vnOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5znOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5z/9YD//xAArEAEAAgIDAQABBAICAQUAAAAAAVICYgNRYQRBEEBQUzFCIDARYICQoLD/2gAIAQEAAz8A/wDgmhCEI/nYQj+RhjH5ccflxw44YMe0dtmzZs2bNmzZs2bIsjtiwlxy45/Ljn8se0fwuPbjj8uOPy44YQxR2izZs2bNmzZs2bNkWR2xYS45cc/lhP5Y9/wEQwj8sIRD1s2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNmyLMZYZMZ/KJ/dRDCPywhjCI/LZs2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNkWYywlhP5RP/ABj9hDGGMIh69bNmzZs2bNmzZsmybJsmybJsmybJsmybJsmybJs2bNmzZs2bNmzZ7+mMsZYyj9hDGGMIj9NmzZs2bNmzZs2bJsmybJsmybJs2TZNk2TZNk2bJs2bNmzZs2bNmzZ6iWMsXr16hiwYMGDBgwYo/T169/T162bNmzZs2TZNk2T2ntPae09pSlKUpSlPae09p7T2mybJsmzZs2bNmz17+nr16hiwYOPtx9uPtx9sO2DBih69evXr1s2bNmzZsmybJsmye09p7T2lKUpSlKU9p7T2ntNk2TZNmzZs2bNmz17+vr1s2bNmzZs2bNmzZs2evXr169bNmye09p7SlKUp/wC6UpSlKe09p7etmzZs9evWzZs2bNmzZs2bNmzZs2bPXr1s9bNmye09p7SlKUp/7pSlKUp7T29bPWz169evWzZs2bNmzZs2bNmzZs2bNmzZs2evU9plM/vJhMJ7T29bNnrZ62bNmzZs2bNmzZs2bNmzZs2bNnr39J7TKZ/eTCYT3+nr162bNnrZs2bJsntNk2TZPabNmzZs2etnr39JlM/wUwmP09etmzZs2bNk2TZNk2TZNk2bNmzZs2bNnv6TKZ/gphMfp69etk9p7T2ntKUpSlKUp7T2nt69e/pMpn+GmH/j9PXr1Pae09pSySlklKU9p7T29evf0mUz/DTCY/T16lP/AHSlKU/xUpSlP/dKUpT/ABUpT/8AQllKWTJl0y6ZdMumXTLpl0y6ZJSn+QlKWTJl0y6ZdMumXTLpl0y6ZJSn/sn9xKWXTLpn0z6Z9M+mXTLplVlVlVlVlVlVlVlVlVlVlRlVlVlRlVlVlVlVlVlVlVl0z6Z9M4/DPpn0z6ZdMkp/byll0y6Z9M+mfTPpn0y6ZVZVZVZVZVZVZVZVZUZVZUZVZVZVZVZVZVZVZVZVZVZdM+mfTOPwz6Z9M+mTJlVlVlVl0yZ9M2fTPpn0z6Z9M+mbPpn0z6Z9M2fTPpl0yqyqyqyqyqyomiaJomiaJomiaJomjRo0aNGjRo0aNGjRNE0TRNE0TRNE0TRNE0ZVZVZVZVZVZVZM+mbPpn0z6Z9M+mfTNn0z6Z9M+mfTPpl0y6ZVZVZVTVlVlRNE0TRlRNE0TRNE0TRo0aNGjRo0aNGjRomiaJomiaJomiaJomqaJqyq0TRNE0TRNE0TVNE1TVNU1TRNE1TVNU0TRNE0TRNGjRo0aNGjRhWHFHTgh88Pmj8Pnj/V89HBRwf1w4f64cNMXFSHFTFxUxcVIcP9cOGkOCkPno+ej55/D55cEuKemHUIo0aNGjRo0TRNE0TRNE0TVNE0TVNE1TVNE1TRNU0TRNE0TRNGjRo0aNGjRhWHFHThh88Pnj8Pnq+ejgo4P64cP9cOKkOKkOKmLipi4aYuH+uHBSHBSHz0fPR88/h88uCXFNWHUIo0aNGjRo4ZcU9MOoRRFGjRo0aNGjRo0aNGjRo0RRhVxR04IcGP4cGP+jij/GEMI/xjCP3+M/5xhxT/AJwhwT/o4Mv9XBk4p6YdQiiKNGjRo0aNGjRo0aNGjRoijGsOKOnBi4Mfw4I/0cUf4whhH+MYR+/xn/OMOKf84Q4J/wBHBP8Ar/zxrDCsOKkOKjhq4auGrhq4auGjipDjpDGsI/k8awwrDipDio4aOGrhq4auGrho4qQ46QxrCP8A0bHcMLQ47w4rw4buCzgs4O3A4HA4XA4HA4HA4O3BZwWcN3Fdx3hhaGNoR/Dx3DC0OO8OK8OG7gs4LODtwOBwOFwOBwOBwODtwWcFnDdxXcd4YWhjaEf88UftoQh4y6ZuRyuVzOZzeudz+uf1z+uf1z+uf1z+uf1zuf1z+uf1z+uf1z+udzR25nM5o7c3rlcrlZsniOkSj9tCEPGXTNyuVy+uZzOb1z+uf1z+uf1z+uf1z+uf1z+udz+uf1z+uf1z+uf1z+ueO3O5nM5vXK5XKzZPEdMUftoYsemHTDpx9OPpxVcVXDVw1cNXDVw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDVw1cNXFVxVcVXFVx9OPph0w6Yo/bQxY9MOnH04+nH04quKrhq4auGrhq4aOGjho4aOGjho4aOGkOGkOGkOGjho4aOGjho4aOGjhq4auGriq4quKriq4+nH0w6Ydf+wHgcLhcLicTjYdww7hh3DDuGPcMe4Y9ww7hh3DDuGHcONxuJxOFwuBwOB8753z2fPZ89nz3fNd893zXfPd893z3fP/Y+e757uC75/wCyHz/2Q+f+yHBd893z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDgcLhcLicTjYdww7hh3DDuGHcMe4Ydww7hh3DDuGHcONxuJxOFwuBwPnfO+d89nz2fPZ893zXfPd813z3fPd893z/2Pnu+e7gu+f8Ash8/9kPn/shwXcF3z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDdu3bt03bt26bpum6bpum6bt27du3bt26bt26bpum6bpum6bpum6bt03TdN26bpum6bpum7dN03TdN03TdN03TdN03Tdum7dum7dN27dum6bpum6bpum6bpum7du3bt03bpu3bpum6bpum6bpum6bpu3TdN03bpum6bpum6bt03TdN03TdN03TdN03TdN03TduysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysmzKzKzKybMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrJT+2lKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpSn9tKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpT/wDrA//EAB0RAAMBAAMBAQEAAAAAAAAAAAABERIwQFAgkMD/2gAIAQIBAT8A/COlKioqKioqKi+zSoqKioqL59Ro0aKyvpVlZWaNFXiVGkaNFZWV9CsrNGjRpFXepo0V8c69Zo0u1pGilfVnJWaNF+NFXNUaNFfmU0aReamkaNPzNM19VlZWaKysrK/XrKzTNGjRWaKyv+u0/8QAHREBAQACAQUAAAAAAAAAAAAAEQBAUCAQITCQwP/aAAgBAwEBPwD1NkRER07eYiIiNMRERGARERGgIiNAREZRERoCIjiYBERqiIwiI1REcCIiIiIjbkREREREfXZ//9k=";d();d();var iY=!1;function FO(){iY=!0}s(FO,"enableTestMode");function sY(){return iY}s(sY,"isTestMode");var LO=class LO{constructor(t){h(this,"backgroundAlpha",1);h(this,"backgroundColor",new Lt);h(this,"width",0);h(this,"height",0);h(this,"options",{});h(this,"renderer");h(this,"enabledLayers",new Set([0,1]));h(this,"handleWebGLContextCreationError",s(t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)},"handleWebGLContextCreationError"));h(this,"handleWebGLContextLost",s(t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)},"handleWebGLContextLost"));h(this,"handleWebGLContextRestored",s(t=>{var r,n;(n=(r=this.options).onWebGLContextRestored)==null||n.call(r,t)},"handleWebGLContextRestored"));var r,n,o,i,a;try{this.options=t,sY()?(this.renderer={setSize:s(()=>{},"setSize"),state:{reset:s(()=>{},"reset")},properties:{get:s(()=>{},"get")},getSize:s(()=>({width:window.innerWidth,height:innerHeight}),"getSize"),getDrawingBufferSize:s(()=>({width:window.innerWidth,height:innerHeight}),"getDrawingBufferSize"),getClearAlpha:s(()=>1,"getClearAlpha"),getClearColor:s(()=>new Lt,"getClearColor"),autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:s(()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),"getContext"),readRenderTargetPixelsAsync:s(()=>Promise.resolve([]),"readRenderTargetPixelsAsync"),setRenderTarget:s(()=>{},"setRenderTarget"),setClearColor:s(()=>{},"setClearColor"),clear:s(()=>{},"clear"),render:s(()=>{},"render"),domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new S8({canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Lt((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(l){j.error(l),t.onWebGLRendererError&&t.onWebGLRendererError(l)}(o=this.domElement())==null||o.addEventListener("webglcontextlost",this.handleWebGLContextLost),(i=this.domElement())==null||i.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(a=this.domElement())==null||a.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,r,n,o,i;this.renderer&&((r=(t=this.renderer).dispose)==null||r.call(t)),(n=this.domElement())==null||n.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(o=this.domElement())==null||o.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(i=this.domElement())==null||i.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,r){if(this.renderer){this.renderer.state.reset();for(let n of this.enabledLayers.values())r.layers.enable(n);this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,r),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,r){b.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=r,this.renderer.setSize(t,r,!1))}setBackgroundColor(t,r){this.backgroundColor=t,this.backgroundAlpha=r}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};s(LO,"Renderer");var aI=LO;d();d();var aY='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';d();d();d();d();d();function lY(e,t){return t.x+t.w<e.x+e.w&&t.x>e.x&&t.y>e.y&&t.y+t.h<e.y+e.h}s(lY,"contains");d();function cY(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}s(cY,"intersectPoint");d();function uY(e,t){let r=t.x,n=t.y,o=t.x+t.w,i=t.y+t.h,a=e.x,l=e.y,c=e.x+e.w,p=e.y+e.h;return r<c&&a<o&&n<p&&l<i}s(uY,"intersects");d();function bl(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}s(bl,"appendItems");d();var RO=class RO{constructor(t,r,n,o,i){h(this,"x");h(this,"y");h(this,"w");h(this,"h");h(this,"userData");this.userData=typeof i>"u"?null:i,this.x=t,this.y=r,this.w=n,this.h=o}contains(t){return t===this?!1:lY(this,t)}intersects(t){return uY(this,t)}intersectsPoint(t){return cY(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};s(RO,"Rectangle");var qr=RO;var Pp=class Pp{constructor(t,r){h(this,"topLeft");h(this,"topRight");h(this,"bottomLeft");h(this,"bottomRight");h(this,"divided",!1);h(this,"boundary");h(this,"capacity",16);h(this,"objects",[]);h(this,"parent");this.parent=r,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:r,w:n,h:o}=this.boundary;this.topLeft=new Pp(new qr(t,r,n/2,o/2),this),this.topRight=new Pp(new qr(t+n/2,r,n/2,o/2),this),this.bottomLeft=new Pp(new qr(t,r+o/2,n/2,o/2),this),this.bottomRight=new Pp(new qr(t+n/2,r+o/2,n/2,o/2),this),this.divided=!0}queryRect(t){let r=[];if(this.boundary.intersects(t))r.push(...this.objects);else return[];return this.divided&&(bl(r,this.topLeft.queryRect(t)),bl(r,this.topRight.queryRect(t)),bl(r,this.bottomLeft.queryRect(t)),bl(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(bl(r,this.topLeft.queryPoint(t)),bl(r,this.topRight.queryPoint(t)),bl(r,this.bottomLeft.queryPoint(t)),bl(r,this.bottomRight.queryPoint(t))),r}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(r=>r.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};s(Pp,"QuadTree");var oa=Pp;d();d();var pY=["","","low","medium","high","always-visible"];function dY(e){return Math.min(5,Math.max(2,e))}s(dY,"clampTierNumber");function Am(e){if(typeof e=="number")return dY(e);let t=pY.indexOf(e);return t===-1?3:t}s(Am,"convertCollisionRankingTierToNumber");function tb(e){let t=dY(e);return pY[t]}s(tb,"convertNumberToCollisionRankingTier");function mY(e,t,r){let n,o,i,a=null,l=0;r||(r={});let c=s(function(){l=r.leading===!1?0:Date.now(),a=null,i=e.apply(n,o),a||(n=o=null)},"later");return function(){let p=Date.now();!l&&r.leading===!1&&(l=p);let f=t-(p-l);return n=globalThis,o=arguments,f<=0||f>t?(a&&(clearTimeout(a),a=null),l=p,i=e.apply(n,o),a||(n=o=null)):!a&&r.trailing!==!1&&(a=setTimeout(c,f)),i}}s(mY,"throttle");var Tp=!1,NO="",w2e=150,$O=class $O extends Fe{constructor(r,n,o=NO?new Worker(NO):new Worker(URL.createObjectURL(new Blob([aY],{type:"text/javascript"})))){super();h(this,"worker");h(this,"debugContext");h(this,"debugCanvas");h(this,"collidersDirty",!0);h(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);h(this,"visibleCollidersQTree",new oa(new qr(0,0,0,0)));h(this,"interactiveCollidersQTree",new oa(new qr(0,0,0,0)));h(this,"coreState");h(this,"postMessage");h(this,"showCollisionBoxes",s(()=>{Tp=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));h(this,"hideCollisionBoxes",s(()=>{Tp=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));h(this,"currentMsgId","");h(this,"working",!1);h(this,"_postMessage",s(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));h(this,"componentArray",[]);h(this,"update",s((r,n,o="bottom-left",i=!1)=>{let a=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let l;for(let c of this.coreState.geometry2DIdsInScene){let p=this.coreState.geometry2DMap.get(c);p&&(l=p.components[0],this.componentArray.push(l))}this.resize(r,n,o),this.collidersDirty=!1,a=!0}else a=this.componentArray.some(l=>l.collisionDirty===!0);a&&this.componentArray.sort((l,c)=>c.rank-l.rank);for(let l=0;l<this.componentArray.length;l++)if(this.packedMessage){let c=this.componentArray[l].toPackedMessage(i&&!a);this.packedMessage[0][l]==null&&(this.packedMessage[0][l]=[]),this.packedMessage[0][l][0]==null&&(this.packedMessage[0][l][0]=[]),this.packedMessage[0][l][0]=c.bboxes,this.packedMessage[0][l][1]=c.enabled&&this.componentArray[l].visible&&!this.componentArray[l].isOccluded?1:0,this.packedMessage[0][l][2]=c.rank===5?1:0,this.packedMessage[0][l][3]=c.x,this.packedMessage[0][l][4]=c.y,this.packedMessage[0][l][5]=c.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][l][6]=c.lockedToStrategyIndex}this.working||this.postMessage()},"update"));h(this,"resolve",s(r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,o=-1,i,a,l;Tp&&(this.visibleCollidersQTree=new oa(new qr(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new oa(new qr(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let c=0;c<this.componentArray.length;c++){let p=this.componentArray[c];n[c]!=null&&(o=n[c][0],i=n[c][2],p.offscreen=n[c][1]===1,o!==-1&&i!=null?(l=new qr(i.x,i.y,i.w,i.h,{entityId:p.id}),Tp&&this.visibleCollidersQTree.insert(l),a=this.coreState.geometry2DMap.get(p.id),(a==null?void 0:a.components[1])!=null&&this.interactiveCollidersQTree.insert(new qr(i.x,i.y,i.w,i.h,{entityId:p.id})),(p.canShow===!1||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="show"),o!==-1&&o!==p.currentStrategyIndex&&(p.activeBoundingBox=l,p.onStrategySelected(o))):((p.canShow===!0||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="hide"),o!==-1&&o!==p.currentStrategyIndex&&p.onStrategySelected(o)))}Tp&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));h(this,"drawDebug",s(()=>{Tp&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));h(this,"destroy",s(()=>{this.worker.terminate()},"destroy"));this.coreState=n,this.debugCanvas=r,this.debugContext=r.getContext("2d"),this.worker=o,this.worker.onmessage=i=>this.resolve(i),this.postMessage=mY(this._postMessage,w2e,!1),Tp?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(r,n,o){this.packedMessage[6]=o,this.packedMessage[5]=n,this.packedMessage[4]=r,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};s($O,"CollisionSystem");var lI=$O;function BO(e){NO=e}s(BO,"setWorkerUrl");d();d();d();d();var GO=class GO{constructor(t){h(this,"type");h(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};s(GO,"Tap");var cI=GO,UO=class UO{constructor(){h(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,r;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((r=this.taps[1])==null?void 0:r.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(r=>t-r.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};s(UO,"TapsController");var uI=UO;d();function hY(e){let t=new Set;for(let r of e){let n=r.object;for(;n.parent&&!t.has(n.parent);)n=n.parent,n instanceof ut&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}s(hY,"getUniqueIntersectedGroupContainers");var km,VO=class VO extends Fe{constructor(r,n,o,i,a){super();h(this,"raycaster",new xs);h(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});h(this,"coreState");h(this,"camera");h(this,"worldPlane");h(this,"_quadtree",new oa(new qr(0,0,0,0)));h(this,"_container");h(this,"lastPointerEvent");h(this,"cursor","grab");h(this,"touchesCount",0);h(this,"isUserInteracting");h(this,"hasTouched",!1);O(this,km);h(this,"onPointerMoveRaf",s(r=>{this.lastPointerEvent=r,u(this,km)&&cancelAnimationFrame(u(this,km)),A(this,km,requestAnimationFrame(()=>{this.onPointerMove(r)}))},"onPointerMoveRaf"));h(this,"onPointerMove",s(r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()},"onPointerMove"));h(this,"tapsControl",new uI);h(this,"onPointerDown",s(r=>{r.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:r.timeStamp,clientX:r.clientX,clientY:r.clientY},this.lastPointerEvent=r,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),r.pointerType==="touch"&&(this.tapsControl.add(new cI(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));h(this,"clickTimeout");h(this,"onPointerUp",s(r=>{this.tapsControl.discardOutsideOfWaitWindow(r.timeStamp),this.lastPointerEvent=r,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(r);let{mouseDownStart:n}=this.state.interaction;!n||this.state.interaction.distanceFromMouseDown==null||(Date.now()<n.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(r.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",r),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(r),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",r),this.flush()):this.handleClick(r)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));h(this,"dirty3D",!0);h(this,"cachedHitBoxes",{entities:[],groups:[]});h(this,"ndcPoint",new _e);h(this,"debugPanel");this.isUserInteracting=a,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=o,this._container=r,this.coreState=n,this.worldPlane=i,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(r){this._quadtree=r}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let r=this.state.hovered3DEntity.components[2];r&&(r.dirty=!0)}}getThreeDIntersectsFromXY(r){return this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0),this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(o=>{var i,a;return((i=o.object)==null?void 0:i.name)==="worldPlane"||((a=o.object)==null?void 0:a.visible)})}getGroupContainerIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(i=>i.object.visible),o;return n!=null&&n.length>0&&(o=hY(n)),o}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(r){let n=r||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!n||this.isUserInteracting())return;let{entity3D:o,entity2D:i,position:a,groupContainers:l}=this.intersect(n);(this.detect3DEntityHover(o)||this.detect2DEntityHover(i)||this.detect3DContainerHover(l))&&(this.state.hovered3DEntity=o,this.state.lastHover=o,this.state.hovered2DEntity=i,this.state.hovered3DContainers=l,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:l})),this.handleCursor()}handleCursor(){var a;let r=!!(this.state.hovered3DEntity&&((a=this.state.hovered3DEntity)!=null&&a.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,o=this.state.interaction.isPanning,i=_2e(r,o,n);this.cursor!==i&&(this.cursor=i,i==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(r){return this.state.hovered2DEntity!==r}handleClick(r){let n=this.intersect(r);this.publish("click",{entity2D:n.entity2D,entity3D:n.entity3D,position:n.position,groupContainers:n.groupContainers,pointerEvent:{button:r.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let r;for(let n of this.coreState.geometry3DIdsInScene)r=this.coreState.geometry3DMap.get(n),(r==null?void 0:r.type)==="geometry"||(r==null?void 0:r.type)==="model"||(r==null?void 0:r.type)==="path"||(r==null?void 0:r.type)==="custom-geometry"?r.components[0].mesh&&!this.cachedHitBoxes.entities.includes(r.components[0].mesh)&&this.cachedHitBoxes.entities.push(r.components[0].mesh):(r==null?void 0:r.type)==="group-container"&&r.components[1]&&!this.cachedHitBoxes.groups.includes(r)&&this.cachedHitBoxes.groups.push(r);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(r){var I,P,T,M,w;let n=[r.offsetX,r.offsetY],o=this._quadtree.queryPoint(n),[i]=o.filter(E=>E.intersectsPoint(n)),a=this.coreState.containerOffset[0],l=this.coreState.containerOffset[1];this.ndcPoint.x=(r.clientX-l)/this._container.clientWidth*2-1,this.ndcPoint.y=-((r.clientY-a)/this._container.clientHeight)*2+1;let c=this.getThreeDIntersectsFromXY(this.ndcPoint),p=(I=c[0])==null?void 0:I.point,f=[],m=[];for(let E of c.filter(B=>B.object.name!=="worldPlane"))E.object instanceof ze&&E.object.material.depthTest===!1?f.push(E):m.push(E);let y=(T=(P=f[0])!=null?P:m[0])!=null?T:void 0,v,x;if(y!=null){if(v=k2e(y.object,this.coreState.geometry3DMap),!v){let E=(M=y==null?void 0:y.instanceId)!=null?M:y==null?void 0:y.batchId;v=E!=null&&(y!=null&&y.object.userData.entities)?this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entities[E]):this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entityId)}v!=null&&v.components[2]&&(x=v)}let S=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((w=i==null?void 0:i.userData)==null?void 0:w.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(i==null?void 0:i.userData.entityId),entity3D:x,position:p,groupContainers:S}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&gY(this.state.lastHover,!1,this.coreState),r&&gY(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!T8(this.state.hovered3DContainers,r)}updateInteractionStateIfPanning(r){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(r.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(r.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let r=document.createElement("div");r.style.position="absolute",r.style.top="0",r.style.right="0",r.style.backgroundColor="white",r.style.padding="10px",document.body.append(r),r.id="interaction-debug-panel",this.debugPanel=r,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",n=>{var o,i,a;this.queueDebugMessage("CLICK \n3D: ".concat((o=n.entity3D)==null?void 0:o.id," \n2D: ").concat((i=n.entity2D)==null?void 0:i.id," \nPos: ").concat((a=n.position)==null?void 0:a.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var o,i,a;this.queueDebugMessage("HOVER \n3D: ".concat((o=n.entity3D)==null?void 0:o.id," \n2D: ").concat((i=n.entity2D)==null?void 0:i.id," \nPos: ").concat((a=n.position)==null?void 0:a.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(r,n){var i;let o=document.createElement("pre");o.style.maxWidth="300px",o.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",o.style.backgroundColor=n,o.textContent=r,(i=this.debugPanel)==null||i.prepend(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>{o.remove()},500)},2500)}getCursor(){return this.cursor}};km=new WeakMap,s(VO,"InteractionSystem");var nb=VO;function gY(e,t,r){var a;let n=e.components[2];n&&n.hover!==!0&&(n.hover=t?"user-interaction":!1,n.dirty=!0);let o=(a=e.components[0].textMesh)==null?void 0:a.userData.entityId;if(!o)return;let i=r.geometry3DMap.get(o);(i==null?void 0:i.type)==="text3d"&&(i.components[1].hoverByPolygon=t,i.components[1].dirty=!0)}s(gY,"updateHover");function _2e(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}s(_2e,"processCursor");function A2e(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof Xl)return;if(t.userData.isSingleModel)return t;t=t.parent}}s(A2e,"findModelParent");function k2e(e,t){let r=A2e(e);return r?t.get(r.userData.entityId):void 0}s(k2e,"findModelParentEntity");d();d();var Tt;(function(e){e.assertEqual=o=>o;function t(o){}s(t,"assertIs"),e.assertIs=t;function r(o){throw new Error}s(r,"assertNever"),e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),a={};for(let l of i)a[l]=o[l];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(i)}s(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Tt||(Tt={}));var HO;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(HO||(HO={}));var ye=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Rc=s(e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:e===null?ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},"getParsedType"),ae=Tt.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"]),D2e=s(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),gI=class gI extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=s(i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let l=n,c=0;for(;c<a.path.length;){let p=a.path[c];c===a.path.length-1?(l[p]=l[p]||{_errors:[]},l[p]._errors.push(r(a))):l[p]=l[p]||{_errors:[]},l=l[p],c++}}},"processError");return o(this),n}static assert(t){if(!(t instanceof gI))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};s(gI,"ZodError");var Go=gI;Go.create=e=>new Go(e);var Nm=s((e,t)=>{let r;switch(e.code){case ae.invalid_type:e.received===ye.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case ae.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,Tt.jsonStringifyReplacer));break;case ae.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(Tt.joinValues(e.keys,", "));break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(Tt.joinValues(e.options));break;case ae.invalid_enum_value:r="Invalid enum value. Expected ".concat(Tt.joinValues(e.options),", received '").concat(e.received,"'");break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),typeof e.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):Tt.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case ae.too_small:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):r="Invalid input";break;case ae.too_big:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="bigint"?r="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):r="Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case ae.not_finite:r="Number must be finite";break;default:r=t.defaultError,Tt.assertNever(e)}return{message:r}},"errorMap"),xY=Nm;function F2e(e){xY=e}s(F2e,"setErrorMap");function pI(){return xY}s(pI,"getErrorMap");var dI=s(e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let l="",c=n.filter(p=>!!p).slice().reverse();for(let p of c)l=p(a,{data:t,defaultError:l}).message;return{...o,path:i,message:l}},"makeIssue"),L2e=[];function me(e,t){let r=pI(),n=dI({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Nm?void 0:Nm].filter(o=>!!o)});e.common.issues.push(n)}s(me,"addIssueToContext");var bI=class bI{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return $e;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,a=await o.value;n.push({key:i,value:a})}return bI.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return $e;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}};s(bI,"ParseStatus");var Rn=bI,$e=Object.freeze({status:"aborted"}),Fm=s(e=>({status:"dirty",value:e}),"DIRTY"),Kn=s(e=>({status:"valid",value:e}),"OK"),WO=s(e=>e.status==="aborted","isAborted"),qO=s(e=>e.status==="dirty","isDirty"),pb=s(e=>e.status==="valid","isValid"),db=s(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");function fI(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}s(fI,"__classPrivateFieldGet");function IY(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}s(IY,"__classPrivateFieldSet");var Oe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Oe||(Oe={}));var ob,ib,XO=class XO{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}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}};s(XO,"ParseInputLazyPath");var xi=XO,bY=s((e,t)=>{if(pb(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Go(e.common.issues);return this._error=r,this._error}}},"handleResult");function We(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:s((a,l)=>{var c,p;let{message:f}=e;return a.code==="invalid_enum_value"?{message:f!=null?f:l.defaultError}:typeof l.data>"u"?{message:(c=f!=null?f:n)!==null&&c!==void 0?c:l.defaultError}:a.code!=="invalid_type"?{message:l.defaultError}:{message:(p=f!=null?f:r)!==null&&p!==void 0?p:l.defaultError}},"customMap"),description:o}}s(We,"processCreateParams");var YO=class YO{constructor(t){this.spa=this.safeParseAsync,this._def=t,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(t){return Rc(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Rc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rn,ctx:{common:t.parent.common,data:t.data,parsedType:Rc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(db(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let o={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Rc(t)},i=this._parseSync({data:t,path:o.path,parent:o});return bY(o,i)}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Rc(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(db(o)?o:Promise.resolve(o));return bY(n,i)}refine(t,r){let n=s(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"getIssueProperties");return this._refinement((o,i)=>{let a=t(o),l=s(()=>i.addIssue({code:ae.custom,...n(o)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(l(),!1)):a?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Uo({schema:this,typeName:Ne.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return vi.create(this,this._def)}nullable(){return aa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Il.create(this,this._def)}promise(){return $c.create(this,this._def)}or(t){return Dp.create([this,t],this._def)}and(t){return Fp.create(this,t,this._def)}transform(t){return new Uo({...We(this._def),schema:this,typeName:Ne.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new $p({...We(this._def),innerType:this,defaultValue:r,typeName:Ne.ZodDefault})}brand(){return new fb({typeName:Ne.ZodBranded,type:this,...We(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new jp({...We(this._def),innerType:this,catchValue:r,typeName:Ne.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return mb.create(this,t)}readonly(){return Gp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};s(YO,"ZodType");var qe=YO,R2e=/^c[^\s-]{8,}$/i,N2e=/^[0-9a-z]+$/,B2e=/^[0-9A-HJKMNP-TV-Z]{26}$/,$2e=/^[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,j2e=/^[a-z0-9_-]{21}$/i,G2e=/^[-+]?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)?)??$/,U2e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,V2e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",zO,z2e=/^(?:(?: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])$/,H2e=/^(([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})))$/,W2e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,SY="((\\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])))",q2e=new RegExp("^".concat(SY,"$"));function CY(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?")),t}s(CY,"timeRegexSource");function Z2e(e){return new RegExp("^".concat(CY(e),"$"))}s(Z2e,"timeRegex");function PY(e){let t="".concat(SY,"T").concat(CY(e)),r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))}s(PY,"datetimeRegex");function X2e(e,t){return!!((t==="v4"||!t)&&z2e.test(e)||(t==="v6"||!t)&&H2e.test(e))}s(X2e,"isValidIP");var wp=class wp extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){let i=this._getOrReturnCtx(t);return me(i,{code:ae.invalid_type,expected:ye.string,received:i.parsedType}),$e}let n=new Rn,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),me(o,{code:ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),me(o,{code:ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,l=t.data.length<i.value;(a||l)&&(o=this._getOrReturnCtx(t,o),a?me(o,{code:ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&me(o,{code:ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")U2e.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"email",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")zO||(zO=new RegExp(V2e,"u")),zO.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"emoji",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")$2e.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"uuid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")j2e.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"nanoid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")R2e.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"cuid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")N2e.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"cuid2",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")B2e.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"ulid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),me(o,{validation:"url",code:ae.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"regex",code:ae.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),me(o,{code:ae.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),me(o,{code:ae.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),me(o,{code:ae.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?PY(i).test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{code:ae.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?q2e.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{code:ae.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?Z2e(i).test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{code:ae.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?G2e.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"duration",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?X2e(t.data,i.version)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"ip",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?W2e.test(t.data)||(o=this._getOrReturnCtx(t,o),me(o,{validation:"base64",code:ae.invalid_string,message:i.message}),n.dirty()):Tt.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ae.invalid_string,...Oe.errToObj(n)})}_addCheck(t){return new wp({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Oe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Oe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Oe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Oe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Oe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Oe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Oe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Oe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Oe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Oe.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...Oe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Oe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Oe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Oe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Oe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Oe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Oe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Oe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Oe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Oe.errToObj(r)})}nonempty(t){return this.min(1,Oe.errToObj(t))}trim(){return new wp({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wp({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wp({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};s(wp,"ZodString");var Nc=wp;Nc.create=e=>{var t;return new Nc({checks:[],typeName:Ne.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...We(e)})};function Y2e(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=parseInt(e.toFixed(o).replace(".","")),a=parseInt(t.toFixed(o).replace(".",""));return i%a/Math.pow(10,o)}s(Y2e,"floatSafeRemainder");var sb=class sb extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ye.number){let i=this._getOrReturnCtx(t);return me(i,{code:ae.invalid_type,expected:ye.number,received:i.parsedType}),$e}let n,o=new Rn;for(let i of this._def.checks)i.kind==="int"?Tt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),me(n,{code:ae.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:ae.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:ae.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Y2e(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),me(n,{code:ae.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),me(n,{code:ae.not_finite,message:i.message}),o.dirty()):Tt.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Oe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Oe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Oe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Oe.toString(r))}setLimit(t,r,n,o){return new sb({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Oe.toString(o)}]})}_addCheck(t){return new sb({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Oe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Oe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Oe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Oe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Oe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Oe.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Tt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};s(sb,"ZodNumber");var Mp=sb;Mp.create=e=>new Mp({checks:[],typeName:Ne.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...We(e)});var ab=class ab extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ye.bigint){let i=this._getOrReturnCtx(t);return me(i,{code:ae.invalid_type,expected:ye.bigint,received:i.parsedType}),$e}let n,o=new Rn;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:ae.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:ae.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),me(n,{code:ae.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Tt.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Oe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Oe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Oe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Oe.toString(r))}setLimit(t,r,n,o){return new ab({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Oe.toString(o)}]})}_addCheck(t){return new ab({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Oe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Oe.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};s(ab,"ZodBigInt");var Op=ab;Op.create=e=>{var t;return new Op({checks:[],typeName:Ne.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...We(e)})};var KO=class KO extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){let n=this._getOrReturnCtx(t);return me(n,{code:ae.invalid_type,expected:ye.boolean,received:n.parsedType}),$e}return Kn(t.data)}};s(KO,"ZodBoolean");var Ep=KO;Ep.create=e=>new Ep({typeName:Ne.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...We(e)});var vI=class vI extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){let i=this._getOrReturnCtx(t);return me(i,{code:ae.invalid_type,expected:ye.date,received:i.parsedType}),$e}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return me(i,{code:ae.invalid_date}),$e}let n=new Rn,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),me(o,{code:ae.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),me(o,{code:ae.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Tt.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new vI({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Oe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Oe.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};s(vI,"ZodDate");var _p=vI;_p.create=e=>new _p({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ne.ZodDate,...We(e)});var JO=class JO extends qe{_parse(t){if(this._getType(t)!==ye.symbol){let n=this._getOrReturnCtx(t);return me(n,{code:ae.invalid_type,expected:ye.symbol,received:n.parsedType}),$e}return Kn(t.data)}};s(JO,"ZodSymbol");var Bm=JO;Bm.create=e=>new Bm({typeName:Ne.ZodSymbol,...We(e)});var QO=class QO extends qe{_parse(t){if(this._getType(t)!==ye.undefined){let n=this._getOrReturnCtx(t);return me(n,{code:ae.invalid_type,expected:ye.undefined,received:n.parsedType}),$e}return Kn(t.data)}};s(QO,"ZodUndefined");var Ap=QO;Ap.create=e=>new Ap({typeName:Ne.ZodUndefined,...We(e)});var e7=class e7 extends qe{_parse(t){if(this._getType(t)!==ye.null){let n=this._getOrReturnCtx(t);return me(n,{code:ae.invalid_type,expected:ye.null,received:n.parsedType}),$e}return Kn(t.data)}};s(e7,"ZodNull");var kp=e7;kp.create=e=>new kp({typeName:Ne.ZodNull,...We(e)});var t7=class t7 extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return Kn(t.data)}};s(t7,"ZodAny");var Bc=t7;Bc.create=e=>new Bc({typeName:Ne.ZodAny,...We(e)});var r7=class r7 extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Kn(t.data)}};s(r7,"ZodUnknown");var xl=r7;xl.create=e=>new xl({typeName:Ne.ZodUnknown,...We(e)});var n7=class n7 extends qe{_parse(t){let r=this._getOrReturnCtx(t);return me(r,{code:ae.invalid_type,expected:ye.never,received:r.parsedType}),$e}};s(n7,"ZodNever");var rs=n7;rs.create=e=>new rs({typeName:Ne.ZodNever,...We(e)});var o7=class o7 extends qe{_parse(t){if(this._getType(t)!==ye.undefined){let n=this._getOrReturnCtx(t);return me(n,{code:ae.invalid_type,expected:ye.void,received:n.parsedType}),$e}return Kn(t.data)}};s(o7,"ZodVoid");var $m=o7;$m.create=e=>new $m({typeName:Ne.ZodVoid,...We(e)});var Lm=class Lm extends qe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ye.array)return me(r,{code:ae.invalid_type,expected:ye.array,received:r.parsedType}),$e;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,l=r.data.length<o.exactLength.value;(a||l)&&(me(r,{code:a?ae.too_big:ae.too_small,minimum:l?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(me(r,{code:ae.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(me(r,{code:ae.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,l)=>o.type._parseAsync(new xi(r,a,r.path,l)))).then(a=>Rn.mergeArray(n,a));let i=[...r.data].map((a,l)=>o.type._parseSync(new xi(r,a,r.path,l)));return Rn.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Lm({...this._def,minLength:{value:t,message:Oe.toString(r)}})}max(t,r){return new Lm({...this._def,maxLength:{value:t,message:Oe.toString(r)}})}length(t,r){return new Lm({...this._def,exactLength:{value:t,message:Oe.toString(r)}})}nonempty(t){return this.min(1,t)}};s(Lm,"ZodArray");var Il=Lm;Il.create=(e,t)=>new Il({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ne.ZodArray,...We(t)});function Dm(e){if(e instanceof So){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=vi.create(Dm(n))}return new So({...e._def,shape:s(()=>t,"shape")})}else return e instanceof Il?new Il({...e._def,type:Dm(e.element)}):e instanceof vi?vi.create(Dm(e.unwrap())):e instanceof aa?aa.create(Dm(e.unwrap())):e instanceof sa?sa.create(e.items.map(t=>Dm(t))):e}s(Dm,"deepPartialify");var jo=class jo extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Tt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ye.object){let p=this._getOrReturnCtx(t);return me(p,{code:ae.invalid_type,expected:ye.object,received:p.parsedType}),$e}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),l=[];if(!(this._def.catchall instanceof rs&&this._def.unknownKeys==="strip"))for(let p in o.data)a.includes(p)||l.push(p);let c=[];for(let p of a){let f=i[p],m=o.data[p];c.push({key:{status:"valid",value:p},value:f._parse(new xi(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof rs){let p=this._def.unknownKeys;if(p==="passthrough")for(let f of l)c.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(p==="strict")l.length>0&&(me(o,{code:ae.unrecognized_keys,keys:l}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let f of l){let m=o.data[f];c.push({key:{status:"valid",value:f},value:p._parse(new xi(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let p=[];for(let f of c){let m=await f.key,y=await f.value;p.push({key:m,value:y,alwaysSet:f.alwaysSet})}return p}).then(p=>Rn.mergeObjectSync(n,p)):Rn.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return Oe.errToObj,new jo({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:s((r,n)=>{var o,i,a,l;let c=(a=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,r,n).message)!==null&&a!==void 0?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=Oe.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}},"errorMap")}:{}})}strip(){return new jo({...this._def,unknownKeys:"strip"})}passthrough(){return new jo({...this._def,unknownKeys:"passthrough"})}extend(t){return new jo({...this._def,shape:s(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new jo({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:s(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:Ne.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new jo({...this._def,catchall:t})}pick(t){let r={};return Tt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new jo({...this._def,shape:s(()=>r,"shape")})}omit(t){let r={};return Tt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new jo({...this._def,shape:s(()=>r,"shape")})}deepPartial(){return Dm(this)}partial(t){let r={};return Tt.objectKeys(this.shape).forEach(n=>{let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}),new jo({...this._def,shape:s(()=>r,"shape")})}required(t){let r={};return Tt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof vi;)i=i._def.innerType;r[n]=i}}),new jo({...this._def,shape:s(()=>r,"shape")})}keyof(){return TY(Tt.objectKeys(this.shape))}};s(jo,"ZodObject");var So=jo;So.create=(e,t)=>new So({shape:s(()=>e,"shape"),unknownKeys:"strip",catchall:rs.create(),typeName:Ne.ZodObject,...We(t)});So.strictCreate=(e,t)=>new So({shape:s(()=>e,"shape"),unknownKeys:"strict",catchall:rs.create(),typeName:Ne.ZodObject,...We(t)});So.lazycreate=(e,t)=>new So({shape:e,unknownKeys:"strip",catchall:rs.create(),typeName:Ne.ZodObject,...We(t)});var i7=class i7 extends qe{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let l of i)if(l.result.status==="valid")return l.result;for(let l of i)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let a=i.map(l=>new Go(l.ctx.common.issues));return me(r,{code:ae.invalid_union,unionErrors:a}),$e}if(s(o,"handleResults"),r.common.async)return Promise.all(n.map(async i=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let c of n){let p={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:p});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:p}),p.common.issues.length&&a.push(p.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let l=a.map(c=>new Go(c));return me(r,{code:ae.invalid_union,unionErrors:l}),$e}}get options(){return this._def.options}};s(i7,"ZodUnion");var Dp=i7;Dp.create=(e,t)=>new Dp({options:e,typeName:Ne.ZodUnion,...We(t)});var vl=s(e=>e instanceof Lp?vl(e.schema):e instanceof Uo?vl(e.innerType()):e instanceof Rp?[e.value]:e instanceof Np?e.options:e instanceof Bp?Tt.objectValues(e.enum):e instanceof $p?vl(e._def.innerType):e instanceof Ap?[void 0]:e instanceof kp?[null]:e instanceof vi?[void 0,...vl(e.unwrap())]:e instanceof aa?[null,...vl(e.unwrap())]:e instanceof fb||e instanceof Gp?vl(e.unwrap()):e instanceof jp?vl(e._def.innerType):[],"getDiscriminator"),xI=class xI extends qe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.object)return me(r,{code:ae.invalid_type,expected:ye.object,received:r.parsedType}),$e;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(me(r,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),$e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let a=vl(i.shape[t]);if(!a.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let l of a){if(o.has(l))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(l)));o.set(l,i)}}return new xI({typeName:Ne.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...We(n)})}};s(xI,"ZodDiscriminatedUnion");var mI=xI;function ZO(e,t){let r=Rc(e),n=Rc(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){let o=Tt.objectKeys(t),i=Tt.objectKeys(e).filter(l=>o.indexOf(l)!==-1),a={...e,...t};for(let l of i){let c=ZO(e[l],t[l]);if(!c.valid)return{valid:!1};a[l]=c.data}return{valid:!0,data:a}}else if(r===ye.array&&n===ye.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],l=t[i],c=ZO(a,l);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===ye.date&&n===ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}s(ZO,"mergeValues");var s7=class s7 extends qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=s((i,a)=>{if(WO(i)||WO(a))return $e;let l=ZO(i.value,a.value);return l.valid?((qO(i)||qO(a))&&r.dirty(),{status:r.value,value:l.data}):(me(n,{code:ae.invalid_intersection_types}),$e)},"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(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};s(s7,"ZodIntersection");var Fp=s7;Fp.create=(e,t,r)=>new Fp({left:e,right:t,typeName:Ne.ZodIntersection,...We(r)});var II=class II extends qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return me(n,{code:ae.invalid_type,expected:ye.array,received:n.parsedType}),$e;if(n.data.length<this._def.items.length)return me(n,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$e;!this._def.rest&&n.data.length>this._def.items.length&&(me(n,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,l)=>{let c=this._def.items[l]||this._def.rest;return c?c._parse(new xi(n,a,n.path,l)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>Rn.mergeArray(r,a)):Rn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new II({...this._def,rest:t})}};s(II,"ZodTuple");var sa=II;sa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sa({items:e,typeName:Ne.ZodTuple,rest:null,...We(t)})};var lb=class lb extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.object)return me(n,{code:ae.invalid_type,expected:ye.object,received:n.parsedType}),$e;let o=[],i=this._def.keyType,a=this._def.valueType;for(let l in n.data)o.push({key:i._parse(new xi(n,l,n.path,l)),value:a._parse(new xi(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Rn.mergeObjectAsync(r,o):Rn.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof qe?new lb({keyType:t,valueType:r,typeName:Ne.ZodRecord,...We(n)}):new lb({keyType:Nc.create(),valueType:t,typeName:Ne.ZodRecord,...We(r)})}};s(lb,"ZodRecord");var hI=lb,a7=class a7 extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.map)return me(n,{code:ae.invalid_type,expected:ye.map,received:n.parsedType}),$e;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([l,c],p)=>({key:o._parse(new xi(n,l,n.path,[p,"key"])),value:i._parse(new xi(n,c,n.path,[p,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let c of a){let p=await c.key,f=await c.value;if(p.status==="aborted"||f.status==="aborted")return $e;(p.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(p.value,f.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let c of a){let p=c.key,f=c.value;if(p.status==="aborted"||f.status==="aborted")return $e;(p.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(p.value,f.value)}return{status:r.value,value:l}}}};s(a7,"ZodMap");var jm=a7;jm.create=(e,t,r)=>new jm({valueType:t,keyType:e,typeName:Ne.ZodMap,...We(r)});var cb=class cb extends qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return me(n,{code:ae.invalid_type,expected:ye.set,received:n.parsedType}),$e;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(me(n,{code:ae.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(me(n,{code:ae.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(c){let p=new Set;for(let f of c){if(f.status==="aborted")return $e;f.status==="dirty"&&r.dirty(),p.add(f.value)}return{status:r.value,value:p}}s(a,"finalizeSet");let l=[...n.data.values()].map((c,p)=>i._parse(new xi(n,c,n.path,p)));return n.common.async?Promise.all(l).then(c=>a(c)):a(l)}min(t,r){return new cb({...this._def,minSize:{value:t,message:Oe.toString(r)}})}max(t,r){return new cb({...this._def,maxSize:{value:t,message:Oe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};s(cb,"ZodSet");var Gm=cb;Gm.create=(e,t)=>new Gm({valueType:e,minSize:null,maxSize:null,typeName:Ne.ZodSet,...We(t)});var Rm=class Rm extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.function)return me(r,{code:ae.invalid_type,expected:ye.function,received:r.parsedType}),$e;function n(l,c){return dI({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,pI(),Nm].filter(p=>!!p),issueData:{code:ae.invalid_arguments,argumentsError:c}})}s(n,"makeArgsIssue");function o(l,c){return dI({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,pI(),Nm].filter(p=>!!p),issueData:{code:ae.invalid_return_type,returnTypeError:c}})}s(o,"makeReturnsIssue");let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof $c){let l=this;return Kn(async function(...c){let p=new Go([]),f=await l._def.args.parseAsync(c,i).catch(v=>{throw p.addIssue(n(c,v)),p}),m=await Reflect.apply(a,this,f);return await l._def.returns._def.type.parseAsync(m,i).catch(v=>{throw p.addIssue(o(m,v)),p})})}else{let l=this;return Kn(function(...c){let p=l._def.args.safeParse(c,i);if(!p.success)throw new Go([n(c,p.error)]);let f=Reflect.apply(a,this,p.data),m=l._def.returns.safeParse(f,i);if(!m.success)throw new Go([o(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Rm({...this._def,args:sa.create(t).rest(xl.create())})}returns(t){return new Rm({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Rm({args:t||sa.create([]).rest(xl.create()),returns:r||xl.create(),typeName:Ne.ZodFunction,...We(n)})}};s(Rm,"ZodFunction");var yI=Rm,l7=class l7 extends qe{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};s(l7,"ZodLazy");var Lp=l7;Lp.create=(e,t)=>new Lp({getter:e,typeName:Ne.ZodLazy,...We(t)});var c7=class c7 extends qe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return me(r,{received:r.data,code:ae.invalid_literal,expected:this._def.value}),$e}return{status:"valid",value:t.data}}get value(){return this._def.value}};s(c7,"ZodLiteral");var Rp=c7;Rp.create=(e,t)=>new Rp({value:e,typeName:Ne.ZodLiteral,...We(t)});function TY(e,t){return new Np({values:e,typeName:Ne.ZodEnum,...We(t)})}s(TY,"createZodEnum");var ub=class ub extends qe{constructor(){super(...arguments),ob.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return me(r,{expected:Tt.joinValues(n),received:r.parsedType,code:ae.invalid_type}),$e}if(fI(this,ob,"f")||IY(this,ob,new Set(this._def.values),"f"),!fI(this,ob,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return me(r,{received:r.data,code:ae.invalid_enum_value,options:n}),$e}return Kn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ub.create(t,{...this._def,...r})}exclude(t,r=this._def){return ub.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};s(ub,"ZodEnum");var Np=ub;ob=new WeakMap;Np.create=TY;var u7=class u7 extends qe{constructor(){super(...arguments),ib.set(this,void 0)}_parse(t){let r=Tt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){let o=Tt.objectValues(r);return me(n,{expected:Tt.joinValues(o),received:n.parsedType,code:ae.invalid_type}),$e}if(fI(this,ib,"f")||IY(this,ib,new Set(Tt.getValidEnumValues(this._def.values)),"f"),!fI(this,ib,"f").has(t.data)){let o=Tt.objectValues(r);return me(n,{received:n.data,code:ae.invalid_enum_value,options:o}),$e}return Kn(t.data)}get enum(){return this._def.values}};s(u7,"ZodNativeEnum");var Bp=u7;ib=new WeakMap;Bp.create=(e,t)=>new Bp({values:e,typeName:Ne.ZodNativeEnum,...We(t)});var p7=class p7 extends qe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return me(r,{code:ae.invalid_type,expected:ye.promise,received:r.parsedType}),$e;let n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return Kn(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};s(p7,"ZodPromise");var $c=p7;$c.create=(e,t)=>new $c({type:e,typeName:Ne.ZodPromise,...We(t)});var d7=class d7 extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s(a=>{me(n,a),a.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(async l=>{if(r.value==="aborted")return $e;let c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?$e:c.status==="dirty"||r.value==="dirty"?Fm(c.value):c});{if(r.value==="aborted")return $e;let l=this._def.schema._parseSync({data:a,path:n.path,parent:n});return l.status==="aborted"?$e:l.status==="dirty"||r.value==="dirty"?Fm(l.value):l}}if(o.type==="refinement"){let a=s(l=>{let c=o.refinement(l,i);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"?$e:(l.status==="dirty"&&r.dirty(),a(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?$e:(l.status==="dirty"&&r.dirty(),a(l.value).then(()=>({status:r.value,value:l.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!pb(a))return a;let l=o.transform(a.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>pb(a)?Promise.resolve(o.transform(a.value,i)).then(l=>({status:r.value,value:l})):a);Tt.assertNever(o)}};s(d7,"ZodEffects");var Uo=d7;Uo.create=(e,t,r)=>new Uo({schema:e,typeName:Ne.ZodEffects,effect:t,...We(r)});Uo.createWithPreprocess=(e,t,r)=>new Uo({schema:t,effect:{type:"preprocess",transform:e},typeName:Ne.ZodEffects,...We(r)});var f7=class f7 extends qe{_parse(t){return this._getType(t)===ye.undefined?Kn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};s(f7,"ZodOptional");var vi=f7;vi.create=(e,t)=>new vi({innerType:e,typeName:Ne.ZodOptional,...We(t)});var m7=class m7 extends qe{_parse(t){return this._getType(t)===ye.null?Kn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};s(m7,"ZodNullable");var aa=m7;aa.create=(e,t)=>new aa({innerType:e,typeName:Ne.ZodNullable,...We(t)});var h7=class h7 extends qe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};s(h7,"ZodDefault");var $p=h7;$p.create=(e,t)=>new $p({innerType:e,typeName:Ne.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...We(t)});var y7=class y7 extends qe{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return db(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Go(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Go(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};s(y7,"ZodCatch");var jp=y7;jp.create=(e,t)=>new jp({innerType:e,typeName:Ne.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...We(t)});var g7=class g7 extends qe{_parse(t){if(this._getType(t)!==ye.nan){let n=this._getOrReturnCtx(t);return me(n,{code:ae.invalid_type,expected:ye.nan,received:n.parsedType}),$e}return{status:"valid",value:t.data}}};s(g7,"ZodNaN");var Um=g7;Um.create=e=>new Um({typeName:Ne.ZodNaN,...We(e)});var K2e=Symbol("zod_brand"),b7=class b7 extends qe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};s(b7,"ZodBranded");var fb=b7,SI=class SI extends qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return s(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?$e:i.status==="dirty"?(r.dirty(),Fm(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})},"handleAsync")();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?$e:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new SI({in:t,out:r,typeName:Ne.ZodPipeline})}};s(SI,"ZodPipeline");var mb=SI,v7=class v7 extends qe{_parse(t){let r=this._def.innerType._parse(t),n=s(o=>(pb(o)&&(o.value=Object.freeze(o.value)),o),"freeze");return db(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};s(v7,"ZodReadonly");var Gp=v7;Gp.create=(e,t)=>new Gp({innerType:e,typeName:Ne.ZodReadonly,...We(t)});function wY(e,t={},r){return e?Bc.create().superRefine((n,o)=>{var i,a;if(!e(n)){let l=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,c=(a=(i=l.fatal)!==null&&i!==void 0?i:r)!==null&&a!==void 0?a:!0,p=typeof l=="string"?{message:l}:l;o.addIssue({code:"custom",...p,fatal:c})}}):Bc.create()}s(wY,"custom");var J2e={object:So.lazycreate},Ne;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ne||(Ne={}));var Q2e=s((e,t={message:"Input not instance of ".concat(e.name)})=>wY(r=>r instanceof e,t),"instanceOfType"),MY=Nc.create,OY=Mp.create,eIe=Um.create,tIe=Op.create,EY=Ep.create,rIe=_p.create,nIe=Bm.create,oIe=Ap.create,iIe=kp.create,sIe=Bc.create,aIe=xl.create,lIe=rs.create,cIe=$m.create,uIe=Il.create,pIe=So.create,dIe=So.strictCreate,fIe=Dp.create,mIe=mI.create,hIe=Fp.create,yIe=sa.create,gIe=hI.create,bIe=jm.create,vIe=Gm.create,xIe=yI.create,IIe=Lp.create,SIe=Rp.create,CIe=Np.create,PIe=Bp.create,TIe=$c.create,vY=Uo.create,wIe=vi.create,MIe=aa.create,OIe=Uo.createWithPreprocess,EIe=mb.create,_Ie=s(()=>MY().optional(),"ostring"),AIe=s(()=>OY().optional(),"onumber"),kIe=s(()=>EY().optional(),"oboolean"),DIe={string:s(e=>Nc.create({...e,coerce:!0}),"string"),number:s(e=>Mp.create({...e,coerce:!0}),"number"),boolean:s(e=>Ep.create({...e,coerce:!0}),"boolean"),bigint:s(e=>Op.create({...e,coerce:!0}),"bigint"),date:s(e=>_p.create({...e,coerce:!0}),"date")},FIe=$e,$=Object.freeze({__proto__:null,defaultErrorMap:Nm,setErrorMap:F2e,getErrorMap:pI,makeIssue:dI,EMPTY_PATH:L2e,addIssueToContext:me,ParseStatus:Rn,INVALID:$e,DIRTY:Fm,OK:Kn,isAborted:WO,isDirty:qO,isValid:pb,isAsync:db,get util(){return Tt},get objectUtil(){return HO},ZodParsedType:ye,getParsedType:Rc,ZodType:qe,datetimeRegex:PY,ZodString:Nc,ZodNumber:Mp,ZodBigInt:Op,ZodBoolean:Ep,ZodDate:_p,ZodSymbol:Bm,ZodUndefined:Ap,ZodNull:kp,ZodAny:Bc,ZodUnknown:xl,ZodNever:rs,ZodVoid:$m,ZodArray:Il,ZodObject:So,ZodUnion:Dp,ZodDiscriminatedUnion:mI,ZodIntersection:Fp,ZodTuple:sa,ZodRecord:hI,ZodMap:jm,ZodSet:Gm,ZodFunction:yI,ZodLazy:Lp,ZodLiteral:Rp,ZodEnum:Np,ZodNativeEnum:Bp,ZodPromise:$c,ZodEffects:Uo,ZodTransformer:Uo,ZodOptional:vi,ZodNullable:aa,ZodDefault:$p,ZodCatch:jp,ZodNaN:Um,BRAND:K2e,ZodBranded:fb,ZodPipeline:mb,ZodReadonly:Gp,custom:wY,Schema:qe,ZodSchema:qe,late:J2e,get ZodFirstPartyTypeKind(){return Ne},coerce:DIe,any:sIe,array:uIe,bigint:tIe,boolean:EY,date:rIe,discriminatedUnion:mIe,effect:vY,enum:CIe,function:xIe,instanceof:Q2e,intersection:hIe,lazy:IIe,literal:SIe,map:bIe,nan:eIe,nativeEnum:PIe,never:lIe,null:iIe,nullable:MIe,number:OY,object:pIe,oboolean:kIe,onumber:AIe,optional:wIe,ostring:_Ie,pipeline:EIe,preprocess:OIe,promise:TIe,record:gIe,set:vIe,strictObject:dIe,string:MY,symbol:nIe,transformer:vY,tuple:yIe,undefined:oIe,union:fIe,unknown:aIe,void:cIe,NEVER:FIe,ZodIssueCode:ae,quotelessJson:D2e,ZodError:Go});var iK=ys(_7());var xb=4,M3e=8,O3e="0.6",oK="low-priority-pin",A7=$.object({rank:$.union([$.enum(["low","medium","high","always-visible"]),$.number()]).optional(),interactive:$.union([$.boolean(),$.literal("pointer-events-auto")]).optional(),id:$.string().optional(),anchor:$.union([$.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),$.array($.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:$.boolean().optional(),zIndex:$.number().optional(),lowPriorityPin:$.object({enabled:$.boolean().optional(),size:$.number().positive().optional(),color:$.string().optional()}).optional()});function sK(e,t,r){$.array($.number()).min(2).max(3).parse(e),$.string().parse(t),A7.parse(r)}s(sK,"validateMarker");var E3e=Object.freeze({enabled:!0,size:M3e,color:"#666"}),Hp=class Hp{constructor(t,r={}){h(this,"id");h(this,"type","marker");h(this,"rank",0);h(this,"initialRank",0);h(this,"activeAnchor","center");h(this,"pointerEvents","none");h(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:{...E3e}});h(this,"projection",new _e);h(this,"enabled",!0);h(this,"canShow",!1);h(this,"visible",!0);h(this,"isOccluded",!1);h(this,"offscreen",!1);h(this,"strategyIndex",-1);h(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});h(this,"dimensions",{width:0,height:0});h(this,"markerContainer");h(this,"containerEl");h(this,"contentEl",null);h(this,"contentHtml","");h(this,"style",{top:"0px",left:"0px"});h(this,"dirty",!1);h(this,"attachedDirty",!0);h(this,"collisionDirty",!0);h(this,"visibilityNeedsUpdate","show");h(this,"animation",null);h(this,"currentStrategyIndex",-1);h(this,"onStrategySelected",s((t,r=!1)=>{var o,i;if(this.currentStrategyIndex===t&&!r)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",oK);let a=this.options.lowPriorityPin,l=a.size,c=a.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(l,"px")),this.markerContainer.style.setProperty("--pin-color",c),this.markerContainer.style.opacity=O3e,this.style.top=-l/2+"px",this.style.left=-l/2+"px"}else{this.activeAnchor=(i=(o=this.strategies[t])==null?void 0:o.name)!=null?i:"center",this.markerContainer.setAttribute("data-anchor",this.activeAnchor),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:a,height:l}=this.dimensions,c=-l/2+"px",p=-a/2+"px";switch(this.style.top=c,this.style.left=p,this.activeAnchor){case"top":{this.style.top=-l+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-a+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-l+"px",this.style.left=-a+"px";break}case"top-right":{this.style.top=-l+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-a+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=c,this.style.left=p}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));h(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var n,o,i;if(this.id=(r==null?void 0:r.id)||_t(),this.options=(0,iK.default)(this.options,r),typeof r.rank=="string")this.rank=Am(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let a=Math.trunc(b.env.NODE_ENV==="test"?Hp.testId:Hp.testId*10)/10;Hp.testId+=.001,this.rank=a}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(n=this.markerContainer.firstElementChild)!=null?n:null,this.contentEl=(i=(o=this.markerContainer.firstElementChild)==null?void 0:o.firstElementChild)!=null?i:null}updateDimensions(t,r){if(t!=null&&r!=null)this.dimensions={width:t,height:r};else{let{width:n,height:o}=this.markerContainer.getBoundingClientRect();this.dimensions={width:n,height:o}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){var i;let{width:t,height:r}=this.dimensions;if(t===0||r===0)return[];let o=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(a=>({name:a,getBoundingBox:s(()=>{let l=r/2,c=r/2,p=t/2,f=t/2;switch(a){case"top":{l=r,c=0;break}case"bottom":{l=0,c=r;break}case"left":{p=t,f=0;break}case"right":{p=0,f=t;break}case"top-left":{l=r,p=t,c=0,f=0;break}case"top-right":{l=r,f=t,c=0,p=0;break}case"bottom-left":{c=r,p=t,l=0,f=0;break}case"bottom-right":{c=r,f=t,l=0,p=0;break}}return[l+xb,c+xb,p+xb,f+xb]},"getBoundingBox")}));if((i=this.options.lowPriorityPin)!=null&&i.enabled){let a={name:oK,getBoundingBox:s(()=>{let l=Math.max(2,xb/2);return[this.options.lowPriorityPin.size/2+l,this.options.lowPriorityPin.size/2+l,this.options.lowPriorityPin.size/2+l,this.options.lowPriorityPin.size/2+l]},"getBoundingBox")};o.push(a)}return o}toPackedMessage(t=!1){var n;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;let r=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&r&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,r&&this.currentStrategyIndex!==((n=this.packedMessage.bboxes[0])==null?void 0:n[4])){let o=this.packedMessage.bboxes.findIndex(i=>i[4]===this.currentStrategyIndex);if(o!==-1){let i=this.packedMessage.bboxes.splice(o,1)[0];this.packedMessage.bboxes.unshift(i)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let o=0;o<this.strategies.length;o++){let i=this.strategies[o];o===this.currentStrategyIndex&&r?this.packedMessage.bboxes.unshift([...i.getBoundingBox(),o]):this.packedMessage.bboxes.push([...i.getBoundingBox(),o])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return(t=this.options.lowPriorityPin)!=null&&t.enabled?Array.isArray(this.options.anchor)?this.options.anchor.length:1:-1}destroy(){}};s(Hp,"MarkerComponent"),h(Hp,"testId",0);var la=Hp;d();d();d();d();d();var k7=class k7{constructor(){h(this,"hover",!1);h(this,"dirty",!1)}};s(k7,"InteractionComponent");var Wm=k7;d();d();function AI(e){"@babel/helpers - typeof";return AI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},AI(e)}s(AI,"_typeof");var _3e=/^\s+/,A3e=/\s+$/;function Ce(e,t){if(e=e||"",t=t||{},e instanceof Ce)return e;if(!(this instanceof Ce))return new Ce(e,t);var r=k3e(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}s(Ce,"tinycolor");Ce.prototype={isDark:s(function(){return this.getBrightness()<128},"isDark"),isLight:s(function(){return!this.isDark()},"isLight"),isValid:s(function(){return this._ok},"isValid"),getOriginalInput:s(function(){return this._originalInput},"getOriginalInput"),getFormat:s(function(){return this._format},"getFormat"),getAlpha:s(function(){return this._a},"getAlpha"),getBrightness:s(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:s(function(){var t=this.toRgb(),r,n,o,i,a,l;return r=t.r/255,n=t.g/255,o=t.b/255,r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),o<=.03928?l=o/12.92:l=Math.pow((o+.055)/1.055,2.4),.2126*i+.7152*a+.0722*l},"getLuminance"),setAlpha:s(function(t){return this._a=fK(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:s(function(){var t=lK(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:s(function(){var t=lK(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+o+"%)":"hsva("+r+", "+n+"%, "+o+"%, "+this._roundA+")"},"toHsvString"),toHsl:s(function(){var t=aK(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:s(function(){var t=aK(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+o+"%)":"hsla("+r+", "+n+"%, "+o+"%, "+this._roundA+")"},"toHslString"),toHex:s(function(t){return cK(this._r,this._g,this._b,t)},"toHex"),toHexString:s(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:s(function(t){return R3e(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:s(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:s(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:s(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:s(function(){return{r:Math.round(mr(this._r,255)*100)+"%",g:Math.round(mr(this._g,255)*100)+"%",b:Math.round(mr(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:s(function(){return this._a==1?"rgb("+Math.round(mr(this._r,255)*100)+"%, "+Math.round(mr(this._g,255)*100)+"%, "+Math.round(mr(this._b,255)*100)+"%)":"rgba("+Math.round(mr(this._r,255)*100)+"%, "+Math.round(mr(this._g,255)*100)+"%, "+Math.round(mr(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:s(function(){return this._a===0?"transparent":this._a<1?!1:Z3e[cK(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:s(function(t){var r="#"+uK(this._r,this._g,this._b,this._a),n=r,o=this._gradientType?"GradientType = 1, ":"";if(t){var i=Ce(t);n="#"+uK(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+n+")"},"toFilter"),toString:s(function(t){var r=!!t;t=t||this._format;var n=!1,o=this._a<1&&this._a>=0,i=!r&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:s(function(){return Ce(this.toString())},"clone"),_applyModification:s(function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:s(function(){return this._applyModification(j3e,arguments)},"lighten"),brighten:s(function(){return this._applyModification(G3e,arguments)},"brighten"),darken:s(function(){return this._applyModification(U3e,arguments)},"darken"),desaturate:s(function(){return this._applyModification(N3e,arguments)},"desaturate"),saturate:s(function(){return this._applyModification(B3e,arguments)},"saturate"),greyscale:s(function(){return this._applyModification($3e,arguments)},"greyscale"),spin:s(function(){return this._applyModification(V3e,arguments)},"spin"),_applyCombination:s(function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:s(function(){return this._applyCombination(W3e,arguments)},"analogous"),complement:s(function(){return this._applyCombination(z3e,arguments)},"complement"),monochromatic:s(function(){return this._applyCombination(q3e,arguments)},"monochromatic"),splitcomplement:s(function(){return this._applyCombination(H3e,arguments)},"splitcomplement"),triad:s(function(){return this._applyCombination(pK,[3])},"triad"),tetrad:s(function(){return this._applyCombination(pK,[4])},"tetrad")};Ce.fromRatio=function(e,t){if(AI(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=Ib(e[n]));e=r}return Ce(e,t)};function k3e(e){var t={r:0,g:0,b:0},r=1,n=null,o=null,i=null,a=!1,l=!1;return typeof e=="string"&&(e=J3e(e)),AI(e)=="object"&&(Pl(e.r)&&Pl(e.g)&&Pl(e.b)?(t=D3e(e.r,e.g,e.b),a=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Pl(e.h)&&Pl(e.s)&&Pl(e.v)?(n=Ib(e.s),o=Ib(e.v),t=L3e(e.h,n,o),a=!0,l="hsv"):Pl(e.h)&&Pl(e.s)&&Pl(e.l)&&(n=Ib(e.s),i=Ib(e.l),t=F3e(e.h,n,i),a=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=fK(r),{ok:a,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}s(k3e,"inputToRGB");function D3e(e,t,r){return{r:mr(e,255)*255,g:mr(t,255)*255,b:mr(r,255)*255}}s(D3e,"rgbToRgb");function aK(e,t,r){e=mr(e,255),t=mr(t,255),r=mr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,a,l=(n+o)/2;if(n==o)i=a=0;else{var c=n-o;switch(a=l>.5?c/(2-n-o):c/(n+o),n){case e:i=(t-r)/c+(t<r?6:0);break;case t:i=(r-e)/c+2;break;case r:i=(e-t)/c+4;break}i/=6}return{h:i,s:a,l}}s(aK,"rgbToHsl");function F3e(e,t,r){var n,o,i;e=mr(e,360),t=mr(t,100),r=mr(r,100);function a(p,f,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(f-p)*6*m:m<1/2?f:m<2/3?p+(f-p)*(2/3-m)*6:p}if(s(a,"hue2rgb"),t===0)n=o=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,c=2*r-l;n=a(c,l,e+1/3),o=a(c,l,e),i=a(c,l,e-1/3)}return{r:n*255,g:o*255,b:i*255}}s(F3e,"hslToRgb");function lK(e,t,r){e=mr(e,255),t=mr(t,255),r=mr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,a,l=n,c=n-o;if(a=n===0?0:c/n,n==o)i=0;else{switch(n){case e:i=(t-r)/c+(t<r?6:0);break;case t:i=(r-e)/c+2;break;case r:i=(e-t)/c+4;break}i/=6}return{h:i,s:a,v:l}}s(lK,"rgbToHsv");function L3e(e,t,r){e=mr(e,360)*6,t=mr(t,100),r=mr(r,100);var n=Math.floor(e),o=e-n,i=r*(1-t),a=r*(1-o*t),l=r*(1-(1-o)*t),c=n%6,p=[r,a,i,i,l,r][c],f=[l,r,r,a,i,i][c],m=[i,i,l,r,r,a][c];return{r:p*255,g:f*255,b:m*255}}s(L3e,"hsvToRgb");function cK(e,t,r,n){var o=[os(Math.round(e).toString(16)),os(Math.round(t).toString(16)),os(Math.round(r).toString(16))];return n&&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[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}s(cK,"rgbToHex");function R3e(e,t,r,n,o){var i=[os(Math.round(e).toString(16)),os(Math.round(t).toString(16)),os(Math.round(r).toString(16)),os(mK(n))];return o&&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[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}s(R3e,"rgbaToHex");function uK(e,t,r,n){var o=[os(mK(n)),os(Math.round(e).toString(16)),os(Math.round(t).toString(16)),os(Math.round(r).toString(16))];return o.join("")}s(uK,"rgbaToArgbHex");Ce.equals=function(e,t){return!e||!t?!1:Ce(e).toRgbString()==Ce(t).toRgbString()};Ce.random=function(){return Ce.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function N3e(e,t){t=t===0?0:t||10;var r=Ce(e).toHsl();return r.s-=t/100,r.s=kI(r.s),Ce(r)}s(N3e,"_desaturate");function B3e(e,t){t=t===0?0:t||10;var r=Ce(e).toHsl();return r.s+=t/100,r.s=kI(r.s),Ce(r)}s(B3e,"_saturate");function $3e(e){return Ce(e).desaturate(100)}s($3e,"_greyscale");function j3e(e,t){t=t===0?0:t||10;var r=Ce(e).toHsl();return r.l+=t/100,r.l=kI(r.l),Ce(r)}s(j3e,"_lighten");function G3e(e,t){t=t===0?0:t||10;var r=Ce(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),Ce(r)}s(G3e,"_brighten");function U3e(e,t){t=t===0?0:t||10;var r=Ce(e).toHsl();return r.l-=t/100,r.l=kI(r.l),Ce(r)}s(U3e,"_darken");function V3e(e,t){var r=Ce(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,Ce(r)}s(V3e,"_spin");function z3e(e){var t=Ce(e).toHsl();return t.h=(t.h+180)%360,Ce(t)}s(z3e,"_complement");function pK(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Ce(e).toHsl(),n=[Ce(e)],o=360/t,i=1;i<t;i++)n.push(Ce({h:(r.h+i*o)%360,s:r.s,l:r.l}));return n}s(pK,"polyad");function H3e(e){var t=Ce(e).toHsl(),r=t.h;return[Ce(e),Ce({h:(r+72)%360,s:t.s,l:t.l}),Ce({h:(r+216)%360,s:t.s,l:t.l})]}s(H3e,"_splitcomplement");function W3e(e,t,r){t=t||6,r=r||30;var n=Ce(e).toHsl(),o=360/r,i=[Ce(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,i.push(Ce(n));return i}s(W3e,"_analogous");function q3e(e,t){t=t||6;for(var r=Ce(e).toHsv(),n=r.h,o=r.s,i=r.v,a=[],l=1/t;t--;)a.push(Ce({h:n,s:o,v:i})),i=(i+l)%1;return a}s(q3e,"_monochromatic");Ce.mix=function(e,t,r){r=r===0?0:r||50;var n=Ce(e).toRgb(),o=Ce(t).toRgb(),i=r/100,a={r:(o.r-n.r)*i+n.r,g:(o.g-n.g)*i+n.g,b:(o.b-n.b)*i+n.b,a:(o.a-n.a)*i+n.a};return Ce(a)};Ce.readability=function(e,t){var r=Ce(e),n=Ce(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};Ce.isReadable=function(e,t,r){var n=Ce.readability(e,t),o,i;switch(i=!1,o=Q3e(r),o.level+o.size){case"AAsmall":case"AAAlarge":i=n>=4.5;break;case"AAlarge":i=n>=3;break;case"AAAsmall":i=n>=7;break}return i};Ce.mostReadable=function(e,t,r){var n=null,o=0,i,a,l,c;r=r||{},a=r.includeFallbackColors,l=r.level,c=r.size;for(var p=0;p<t.length;p++)i=Ce.readability(e,t[p]),i>o&&(o=i,n=Ce(t[p]));return Ce.isReadable(e,n,{level:l,size:c})||!a?n:(r.includeFallbackColors=!1,Ce.mostReadable(e,["#fff","#000"],r))};var D7=Ce.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"},Z3e=Ce.hexNames=X3e(D7);function X3e(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}s(X3e,"flip");function fK(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}s(fK,"boundAlpha");function mr(e,t){Y3e(e)&&(e="100%");var r=K3e(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}s(mr,"bound01");function kI(e){return Math.min(1,Math.max(0,e))}s(kI,"clamp01");function Vo(e){return parseInt(e,16)}s(Vo,"parseIntFromHex");function Y3e(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}s(Y3e,"isOnePointZero");function K3e(e){return typeof e=="string"&&e.indexOf("%")!=-1}s(K3e,"isPercentage");function os(e){return e.length==1?"0"+e:""+e}s(os,"pad2");function Ib(e){return e<=1&&(e=e*100+"%"),e}s(Ib,"convertToPercentage");function mK(e){return Math.round(parseFloat(e)*255).toString(16)}s(mK,"convertDecimalToHex");function dK(e){return Vo(e)/255}s(dK,"convertHexToDecimal");var ns=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+o),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 Pl(e){return!!ns.CSS_UNIT.exec(e)}s(Pl,"isValidCSSUnit");function J3e(e){e=e.replace(_3e,"").replace(A3e,"").toLowerCase();var t=!1;if(D7[e])e=D7[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=ns.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=ns.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=ns.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=ns.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=ns.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=ns.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=ns.hex8.exec(e))?{r:Vo(r[1]),g:Vo(r[2]),b:Vo(r[3]),a:dK(r[4]),format:t?"name":"hex8"}:(r=ns.hex6.exec(e))?{r:Vo(r[1]),g:Vo(r[2]),b:Vo(r[3]),format:t?"name":"hex"}:(r=ns.hex4.exec(e))?{r:Vo(r[1]+""+r[1]),g:Vo(r[2]+""+r[2]),b:Vo(r[3]+""+r[3]),a:dK(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=ns.hex3.exec(e))?{r:Vo(r[1]+""+r[1]),g:Vo(r[2]+""+r[2]),b:Vo(r[3]+""+r[3]),format:t?"name":"hex"}:!1}s(J3e,"stringInputToObject");function Q3e(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}s(Q3e,"validateWCAG2Parms");var W7=ys(H7());var Z7=$.object({rank:$.union([$.enum(["low","medium","high","always-visible"]),$.number()]).optional(),interactive:$.boolean().optional(),appearance:$.object({margin:$.number().min(6).optional(),text:$.object({numLines:$.number().optional(),lineHeight:$.number().optional(),size:$.number().optional(),maxWidth:$.number().optional(),foregroundColor:$.string().optional(),backgroundColor:$.string().optional()}).optional(),marker:$.object({size:$.number().optional(),foregroundColor:$.object({active:$.string().optional(),inactive:$.string().optional()}).optional(),backgroundColor:$.object({active:$.string().optional(),inactive:$.string().optional()}).optional()}).optional()}).optional()});function ZK(e,t,r){$.array($.number()).min(2).max(3).parse(e),$.string().parse(t),Z7.parse(r||{})}s(ZK,"validateLabel");var Ym={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}}},HPe={lightOnDark:{...Ym,text:{...Ym.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...Ym.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...Ym,text:{...Ym.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...Ym.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},WPe="LOW_PRIORITY",HK=4,qPe=6,ZPe=20,XPe=2.5,YPe=2,KPe="cover",JPe=-1/0,WK=6.5,qK={heightAbovePolygon:0,appearance:HPe.darkOnLight};var Zp=class Zp{constructor(t,r,n){h(this,"lines",0);h(this,"id");h(this,"rank");h(this,"type","label");h(this,"initialRank");h(this,"contextConfigured",!1);h(this,"fillText");h(this,"newStyle",{});h(this,"opacity",0);h(this,"visibilityNeedsUpdate",!1);h(this,"text");h(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});h(this,"projection",new _e);h(this,"labelCacheId");h(this,"_cache",{});h(this,"appearance");h(this,"options");h(this,"visible",!0);h(this,"enabled",!0);h(this,"isOccluded",!1);h(this,"offscreen",!1);h(this,"canShow",!1);h(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});h(this,"dimensions",{width:0,height:0});h(this,"currentStrategyIndex",-1);h(this,"totalMarkerSize",0);h(this,"dirty",!0);h(this,"attachedDirty",!0);h(this,"collisionDirty",!0);h(this,"lastTextAlign");h(this,"imageHash");h(this,"markerSize",0);h(this,"iconVisible",!1);h(this,"dp");h(this,"animate",!0);h(this,"onStrategySelected",s(t=>{if(this.currentStrategyIndex===t)return;let r=this.strategies[t];r&&r.onStrategySelected(this),this.currentStrategyIndex=t;let n=this.style;this.style=this.newStyle,this.newStyle=n},"onStrategySelected"));h(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var i,a;if(this.id=(i=r.id)!=null?i:_t(),this.options=(0,W7.default)({},r,qK),this.text=t,this.dp=(l=1)=>l*n.pixelRatio,typeof r.rank=="string")this.rank=Am(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let l=Math.trunc(b.env.NODE_ENV==="test"?Zp.testId:Zp.testId*10)/10;Zp.testId+=.001,this.rank=l,this.initialRank=l}let o=(0,W7.default)({},this.options.appearance,qK.appearance);this.appearance={margin:o.margin,text:{lineHeight:o.text.lineHeight,numLines:o.text.numLines,size:o.text.size,maxWidth:o.text.maxWidth,foregroundColor:o.text.foregroundColor,backgroundColor:o.text.backgroundColor},marker:{foregroundColor:{active:o.marker.foregroundColor.active,inactive:o.marker.foregroundColor.inactive||Ce(o.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:o.marker.backgroundColor.active,inactive:o.marker.backgroundColor.inactive||Ce(o.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:o.marker.icon,iconSize:o.marker.iconSize||ZPe,iconPadding:(a=o.marker.iconPadding)!=null?a:YPe,iconFit:o.marker.iconFit||KPe,iconOverflow:o.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:o.marker.iconVisibleAtZoomLevel==null?JPe:o.marker.iconVisibleAtZoomLevel}}}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(WK),this.totalMarkerSize=Math.ceil((this.markerSize+XPe)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,o=Math.max(qPe,n),i=this.iconVisible?o/2:0,a=this.iconVisible?this.totalMarkerSize:WK,l=[{name:"RIGHT",getBoundingBox:s(()=>{let c=Math.max(this.totalMarkerSize,r);return[c/2+o,c/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+t+o]},"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+HK,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:s(()=>{let c=Math.max(this.totalMarkerSize,r);return[c/2+o,c/2+o,this.totalMarkerSize/2+t+o,this.totalMarkerSize/2+o]},"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-t-this.totalMarkerSize/2-HK,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:s(()=>{let c=this.dp();return[r+this.totalMarkerSize/2/c+o,this.totalMarkerSize/2+o,t/2+o,t/2+o]},"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.totalMarkerSize/2,this.newStyle.left=-t/2},"onStrategySelected")},{name:WPe,getBoundingBox:s(()=>[a/2+i,a/2+i,a/2+i,a/2+i],"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:s(()=>[this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o],"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}]:l}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var r;if(this.visible&&t&&this.collisionDirty===!1&&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.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((r=this.packedMessage.bboxes[0])==null?void 0:r[4])){let n=this.packedMessage.bboxes.findIndex(o=>o[4]===this.currentStrategyIndex);if(n!==-1){let o=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(o)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let o=this.strategies[n];n===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...o.getBoundingBox(),n]):this.packedMessage.bboxes.push([...o.getBoundingBox(),n])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};s(Zp,"LabelComponent"),h(Zp,"testId",0);var q7=Zp,ca=q7;d();d();var eE=class eE extends Fe{constructor(r,n){super();h(this,"rendererState");h(this,"convertTo3DMapPosition");h(this,"textSet",new Set);h(this,"batchedTextMap",new Map);h(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var l,c,p;let n,o,i,a=[];for(let f of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(f),(n==null?void 0:n.type)==="text3d"){o=n.components[0],i=n.components[1];let m=(l=o.mesh)==null?void 0:l.parent;if(!m||!(m instanceof ut)||!(o instanceof jc))continue;if("textArea"in o.feature.properties&&o.mesh!=null&&o.polygonEntityId!=null&&o.textMesh==null&&o.mesh.parent!=null&&((p=(c=o.feature.properties)==null?void 0:c.textArea)==null?void 0:p.position)!=null){if(this.textSet.has(o.polygonEntityId))continue;this.textSet.add(o.polygonEntityId),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,Km().then(({BatchedText:x})=>{let S=new x;return S.type="batchedtext",m.add(S),S}));let v=this.batchedTextMap.get(m);if(!v)throw new Error("batched text required");a.push(XK({entityId:f,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:v,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(o.mesh!=null&&o.textMesh==null&&o.mesh.parent!=null){if(this.textSet.has(f.toString()))continue;this.textSet.add(f.toString()),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,Km().then(({BatchedText:x})=>{let S=new x;return S.type="batchedtext",m.add(S),S}));let v=this.batchedTextMap.get(m);if(!v)throw new Error("batched text required");a.push(XK({entityId:f,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:v,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let y=this.batchedTextMap.get(m);o.textMesh&&y&&o.polygonEntityId!=null&&Promise.all([y,Promise.resolve({meshComponent:o,styleComponent:i})]).then(([v,{meshComponent:x,styleComponent:S}])=>{let{textMesh:I}=x;if(v&&I){let P=Q7(v,I);x.visible&&!P?v.add(I):!x.visible&&P&&v.remove(I)}S.flipToFaceCamera&&this.flipIfNeeded(x,r)})}return Promise.all(a)}flipIfNeeded(r,n){let o=r.textMesh;if(!o)return!1;let i=o.rotation.z,a=T3(i+n);a>Math.PI/2&&a<3*Math.PI/2&&(o.rotation.z=T3(i+Math.PI))}showTextAreaMesh(){let r,n;for(let o of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(o),(r==null?void 0:r.type)==="text3d"&&(n=r.components[0],"textArea"in n.feature.properties)){let i=n.feature.properties.textArea;if(!i)continue;let a=new Oi(i.maxWidth,i.maxHeight),l=new ze(a,new jr({color:"pink"})),{textMesh:c}=n;if(!c)continue;let p=this.convertTo3DMapPosition(i.position,Mb);l.position.copy(p),l.position.z=c.position.z-.1,l.rotation.z=c.rotation.z,X7.identity(),X7.makeRotationAxis(new Pe(0,0,1),c.userData.rotationZ),Mb.set(i.maxWidth/2,0,0),Mb.applyMatrix4(X7),l.position.x-=Mb.x,l.position.y-=Mb.y,this.rendererState.entityScene.add(l),this.debugTextAreaMesh.set(o,l)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};s(eE,"Text3DSystem");var GI=eE;function K7(e){Km().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}s(K7,"configureWorker");var X7=new wi,Mb=new Pe,Y7;async function J7(e){let{preloadFont:t}=await Km();return t(e)}s(J7,"preloadFont");function Km(){return Y7||(Y7=import("./text3d-2NDOCPEF.js").then(e=>e)),Y7}s(Km,"getText3DService");async function XK({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:o,rendererState:i,type:a="text-area"}){return Promise.all([Km(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:l,createTroikaTextArea:c},p])=>a==="text-area"?c(p.entityId,p.meshComponent,p.styleComponent,n):l(p.entityId,p.meshComponent,p.styleComponent,n)).catch(l=>{j.warn("Trouble creating text: ",l)}).then(l=>{if(!(l!=null&&l.text))return;let c=[Promise.resolve(l.text),o,Promise.resolve()];if(t.polygonEntityId){let p=i.geometry3DMap.get(t.polygonEntityId);if((p==null?void 0:p.type)==="geometry"){let f=p.components[0],m=p.components[1];f.textMesh=l.text,f.mesh!=null&&(l.text.position.z=m.altitude+m.height+QPe)}}else c[2]=Km().then(({syncText:p})=>p(l.text));return Promise.all(c)}).then(l=>{if(!l)return;let[c,p]=l;p.add(c),t.batchedText||(t.batchedText=p)})}s(XK,"createText");function Q7(e,t){return e._members.has(t)}s(Q7,"doesBatchedTextContainsText");var QPe=.5;var eTe=$.object({visible:$.boolean(),color:$.string(),flipToFaceCamera:$.boolean(),font:$.string().optional(),fontSize:$.number(),margin:$.union([$.number(),$.tuple([$.number(),$.number(),$.number(),$.number()])]),outlineColor:$.string(),outlineOpacity:$.number(),outlineBlur:$.union([$.number(),$.string()]),outlineWidth:$.number(),outlineOffsetX:$.number(),outlineOffsetY:$.number(),strokeWidth:$.number(),maxWidth:$.number().optional(),maxHeight:$.number().optional(),strokeOpacity:$.number(),strokeColor:$.string(),fillOpacity:$.number(),hoverColor:$.string().optional(),id:$.union([$.string(),$.number()]),type:$.literal("text3d"),position:$.tuple([$.number(),$.number(),$.number()]),content:$.string()}),YK=eTe.partial().omit({id:!0,type:!0}).strict(),KK=YK.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),JK=$.object({appearance:YK.optional(),parentId:$.string().optional()}).strict(),tE=class tE{constructor(t){h(this,"mesh",new _i);h(this,"textMesh");h(this,"type","text3d");h(this,"feature");h(this,"parent");h(this,"batchedText");h(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?Q7(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};s(tE,"Text3DComponent");var jc=tE;d();var rE=class rE{constructor(t){h(this,"color");h(this,"dirty",!0);h(this,"visible",!0);h(this,"edgeColors");h(this,"geometry");h(this,"ranges");h(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[0],this.edgeColors.array[1],this.edgeColors.array[2]]:[0,0,0]}};s(rE,"OutlineComponent");var Jm=rE;d();d();d();var nE=class nE extends f8{constructor(r){let n=r,o=3,i=o*4;super(new Float32Array(r*i),o,r,g0,o8);h(this,"_width");h(this,"_height");h(this,"_propertiesLength");this._width=i,this._height=n,this._propertiesLength=o}setColor(r,n,o){let i=this.image.data,a=r*this._width;i[a]=n.r,i[a+1]=n.g,i[a+2]=n.b,i[a+3]=0,i[a+4]=o.r,i[a+5]=o.g,i[a+6]=o.b,i[a+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,o=r*this._width,i=new Lt(n[o],n[o+1],n[o+2]),a=new Lt(n[o+4],n[o+5],n[o+6]);return{color:i,topColor:a}}setTexture(r,n,o){let i=this.image.data,a=r*this._width;i[a+8]=n?1:0,i[a+9]=o?1:0,i[a+10]=0,i[a+11]=0,this.needsUpdate=!0}};s(nE,"BatchedPropertiesTexture");var UI=nE;var QK="#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 // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";var eJ="#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;\nuniform bool uBlendTexture;\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\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\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 > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of `==` comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.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}\n";var nTe=-.05,oTe=1,oE=class oE extends Ei{constructor(r,n,o=1){super(r);h(this,"propertiesTexture");h(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});h(this,"colorSpace",wa);h(this,"showTextures",s(r=>{let n=!!this.uniforms.uTexture.value,o=!!this.uniforms.uTopTexture.value;(n||o)&&(this.propertiesTexture.setTexture(r,n,o),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new UI(n),this.uniforms.uRepeatYFactor.value=o,this.onBeforeCompile=i=>{let a=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,p=this.uniforms.uTopTexture,f=this.uniforms.uTexture,m=this.uniforms.uRepeatYFactor,y=this.uniforms.uBlendTexture;this.uniforms=i.uniforms,i.vertexShader=QK,i.fragmentShader=eJ,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:l,uGradientStart:c,uMinSideAlpha:{value:nTe},uMaxSideAlpha:{value:oTe},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:p,uTexture:f,uRepeatYFactor:m,uBlendTexture:y})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=gs,r.wrapT=gs,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=gs,r.wrapT=gs,r.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=r}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(r){r!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=r,this.colorSpace=r?i8:wa,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(r,n,o){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=o}setColor(r,n,o){this.propertiesTexture.setColor(r,n,o)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let n=!!this.uniforms.uTexture.value,o=!!this.uniforms.uTopTexture.value;(n||o)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,n),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};s(oE,"BatchedStandardMaterial");var Xp=oE;d();function tJ(e,t){var l,c,p;let r=0;for(let f of e)r+=((c=(l=f.components[0])==null?void 0:l.geometry)==null?void 0:c.attributes.position.count)||0;let n=new Lt(t.color),o;o=new Xp({color:n,side:t.side==="back"?t8:t.side==="front"?y0:Ta,opacity:(p=t.opacity)!=null?p:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let i=new w0(e.length,r,0,o),a;for(let f of e)a=f.components[0],!(!(a instanceof gr)||!a.geometry)&&(a.mesh=i,a.material=o,a.instanceIndex=i.addGeometry(a.geometry),i.addInstance(a.instanceIndex),i.userData.entities[a.instanceIndex]=f.id,o instanceof Xp&&o.setColor(a.instanceIndex,n,t.topColor?new Lt(t.topColor):n));return i.perObjectFrustumCulled=!0,i.matrixAutoUpdate=!1,i}s(tJ,"batchGeometries");function VI(e){return Ce(e).darken(30).toRgbString()}s(VI,"darkenColorForOutline");function rJ(e,t,r,n){if(t.length<1)return;e.boundingBox||e.computeBoundingBox();let o=e.boundingBox,i=e.getAttribute("position"),a=e.getAttribute("normal"),l=e.getAttribute("uv"),c,p;e.index?(c=e.index.count/3,p=s(function(M,w){return e.index.getX(M*3+w)},"meshIndex")):(c=i.count/3,p=s(function(M,w){return M*3+w},"meshIndex"));let f=new wi;f.makeRotationFromQuaternion(new Yh().setFromEuler(new Ma(0,0,r/180*Math.PI)));let m=t.find(M=>M.face==="top"),y;m&&(y={min:n(m.bounds[1],m.bounds[0],0),max:n(m.bounds[3],m.bounds[2],o.max.z)});let v=t.find(M=>M.face==="side"),x;if(v&&(x={min:n(v.bounds[1],v.bounds[0],0),max:n(v.bounds[3],v.bounds[2],o.max.z)}),!(!x&&!y))for(let M=0;M<c;++M){let w=a.getX(p(M,0))+a.getX(p(M,1))+a.getX(p(M,2)),E=a.getY(p(M,0))+a.getY(p(M,1))+a.getY(p(M,2)),B=a.getZ(p(M,0))+a.getZ(p(M,1))+a.getZ(p(M,2)),D=Math.abs(w),F=Math.abs(E),L=Math.abs(B);var S,I;D<=F&&D<=L?(S="x",F<=L?I="y":I="z"):F<=D&&F<=L?(S="y",D<=L?I="x":I="z"):(S="z",D<=F?I="x":I="y"),S==="z"&&(S=I,I="z");let H,U,G,J,X,ie;if(I==="z"||S==="z"){if(!v||!x)continue;H=v.repeat.u,U=v.repeat.v,G=v.offset.u,J=v.offset.v,X=v.rotation,ie=x}else{if(!m||!y)continue;H=m.repeat.u,U=m.repeat.v,G=m.offset.u,J=m.offset.v,X=(360-r+m.rotation)%360,ie=y}let{min:ee,max:be}=ie,ve=new Oa;ve.position.set(ee.x,ee.y,0),ve.updateMatrix(),ve.updateMatrixWorld();let de=ee.clone().applyMatrix4(f),Ae=be.clone().applyMatrix4(f),gt=Math.abs(Ae.x-de.x),st=Math.abs(Ae.y-de.y),Ye=new Pe(gt,st,be.z).applyMatrix4(ve.matrixWorld),Ve=Math.abs(Ye[S]-ee[S]),fe=Math.abs(Ye[I]-ee[I]),he=X*Math.PI/180||0,re=Math.cos(he),se=Math.sin(he),k=ve.matrixWorld.clone().invert(),K=new Yh().setFromEuler(new Ma(0,0,r/180*Math.PI));for(let R=0;R<3;R++){let oe=new Pe(i.getX(p(M,R)),i.getY(p(M,R)),i.getZ(p(M,R))).applyMatrix4(k);oe.applyQuaternion(K);let le=oe.applyMatrix4(ve.matrixWorld),xe=le.x,pr=le.y,Gn=le.z;var P,T;S==="x"?P=H*(xe-ee[S])/Ve+G:S==="y"?P=H*(pr-ee[S])/Ve+G:P=H*(Gn-ee[S])/Ve+G,I==="x"?T=U*(xe-ee[I])/fe+J:I==="y"?T=U*(pr-ee[I])/fe+J:T=U*(Gn-ee[I])/fe+J,P-=.5,T-=.5;let nn=P*re-T*se+.5,In=P*se+T*re+.5;l.setX(p(M,R),nn),l.setY(p(M,R),In)}}}s(rJ,"updateUVsLegacy");d();var iE=class iE{constructor(){h(this,"focusMesh");h(this,"dirty",!0)}};s(iE,"FocusableComponent");var Qm=iE;function gn(e,t,r){if(t!==void 0){if(e.type==="model"||e.type==="path"||e.type==="marker"||e.type==="label"||e.type==="geometry"||e.type==="group-container"||e.type==="custom-geometry")return t===!0?(e instanceof Iu&&e.components[1]===void 0?(e.components[1]=new Wm,e.components[1].dirty=!0):e instanceof wt&&e.components[2]===void 0?(e.components[2]=new Wm,e.components[2].dirty=!0):e instanceof ut&&e.components[1]===void 0&&(e.components[1]=new Wm,e.components[1].dirty=!0),!0):(e instanceof Iu?e.components[1]=void 0:e instanceof wt?e.components[2]=void 0:e instanceof ut&&(e.components[1]=void 0),!0);if(e.type==="geometry-group"){let n;for(let o of e.userData.entities3D.values())n=r.geometry3DMap.get(o),gn(n,t,r);return!0}}return!1}s(gn,"updateInteractivity");function nJ(e,t,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let n,o,i=e.components[0];for(let a of e.userData.entities3D.values())if(n=t.geometry3DMap.get(a),n){o=n.components[1],o.color===i.color&&(o.initialColor=r.color||i.color,o.color=r.color||i.color,o.dirty=!0);let l=n.components[3];l&&(l.color=VI(o.color||i.color),l.dirty=!0),o.topColor===i.topColor&&(o.topColor=r.topColor||i.topColor,o.dirty=!0)}return r.color!==void 0&&(i.color=r.color,i.dirty=!0),"topColor"in r&&(i.topColor=r.topColor,i.dirty=!0),!0}return!1}}s(nJ,"updateGroupColor");function oJ(e,t){if(t!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let r=e.components[0];return r.shading=r.shading||{},r.shading&&(t.start!==r.shading.start||t.end!==r.shading.end||t.intensity!==r.shading.intensity)&&(Object.assign(r.shading,t),e.userData.shadingDirty=!0),!0}return!1}s(oJ,"updateGroupShading");function iJ(e,t){t!==void 0&&e.type==="geometry"&&(t.showImage!==void 0&&(e.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(e.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}s(iJ,"updateImageProps");function aE(e,t,r){if(r!==void 0){if(e.type==="geometry"){let n=e.components[1];if(n.height!==r)return n.height=r,n.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),!0}else if(e.type==="geometry-group"){let n=e.components[0];for(let o of e.userData.entities3D.values()){let i=t.geometry3DMap.get(o),a;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(a=i.components[1],a.height===n.height&&(i.components[1].height=r,i.components[1].dirty=!0),i.components[3]&&(i.components[3].dirty=!0))}return e.components[0].height=r,!0}}return!1}s(aE,"updateHeight");function lE(e,t){t!==void 0&&(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&(e.components[1].initialColor=t.initialColor),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,e.components[3]&&(e.components[3].color=t.color,e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor),e.components[1].dirty=!0)}s(lE,"updateColor");function cE(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?(e.object3d.position.copy(r(t[1],t[0],t[2]||0)),e.positionDirty=!0):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}s(cE,"updatePosition");function uE(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof ut?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}s(uE,"updateParent");function sJ(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}s(sJ,"updateEnabled");function aJ(e,t,r){if(t!==void 0&&e.type==="marker"){let n=e.components[0];if(t.contentHTML!==void 0)return n.containerEl.innerHTML=t.contentHTML,n.contentHtml=t.contentHTML,!0;if(t.anchor!==void 0&&(n.options.anchor=t.anchor,n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{A7.parse(t.options||{})}catch(o){return j.error(o),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",gn(e,!1,r)):(n.pointerEvents="none",gn(e,t.options.interactive,r))),lJ(e,t.options.rank),!0}}return!1}s(aJ,"updateMarker");function lJ(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=Am(t),!0):!1}s(lJ,"updateRank");function cJ(e,t,r){var n,o,i,a,l;if(t!==void 0&&e.type==="label"){let c=e.components[0];t.text!==void 0&&(c.text=t.text,c.dirty=!0);try{Z7.parse(t.options||{})}catch(p){j.error(p);return}((n=t.options)==null?void 0:n.appearance)!==void 0&&Object.keys((o=t.options)==null?void 0:o.appearance).length>0&&(H8(c.appearance,((i=t.options)==null?void 0:i.appearance)||{}),c.dirty=!0),gn(e,(a=t.options)==null?void 0:a.interactive,r),lJ(e,(l=t.options)==null?void 0:l.rank)}}s(cJ,"updateLabel");function uJ(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}s(uJ,"updateHoverColor");function pJ(e,t){if(t!==void 0){let r=e.components[2];if(e.type==="geometry"&&r!=null)return r.hover=t,r.dirty=!0,!0}return!1}s(pJ,"updateHovered");function pE(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}s(pE,"updateFlipImageToFaceCamera");function ua(e,t,r){if(r!==void 0){if(e.type==="model"||e.type==="path"||e.type==="geometry"||e.type==="custom-geometry"||e.type==="image"||e.type==="text3d"){e.components[1].visible=r,e.components[1].dirty=!0;let n=e.components[3];n&&(n.visible=r,n.dirty=!0)}else e.type==="geometry-group"?e.setVisible(r):e.type==="group-container"?(e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof F8){let o=t.geometry2DMap.get(n.userData.entityId);if(o){let i=o.components[0];i instanceof ca&&(i.canShow=r)}}})):e.type==="label"&&(e.components[0].visible=r);return!0}return!1}s(ua,"updateVisibility");function dE(e,t,r){if(r!==void 0){if(e.type==="geometry-group"){let n=e.components[0];if(n.opacity!==r){for(let o of e.userData.entities3D.values()){let i=t.geometry3DMap.get(o),a;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(a=i.components[1],(!a.opacity||a.opacity===n.opacity)&&(a.opacity=r,a.dirty=!0))}return e.setOpacity(r),n.opacity=r,!0}}else if(e.type==="group-container"&&e.opacity!==r){e.setOpacity(r);let n=1;return e.parent instanceof ut&&(n=e.parent.opacity),dJ(e,t,n),!0}}return!1}s(dE,"updateOpacity");function dJ(e,t,r=1){if(e.type==="group-container"&&"children"in e&&e.children.length>0){let n=r*e.opacity;e.userData.computedOpacity=n;for(let o of e.children)(o instanceof Sn&&o.type==="geometry-group"||o instanceof ut&&o.type==="group-container")&&dJ(o,t,n)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let o=t.geometry3DMap.get(n),i;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(i=o.components[1],i.dirty=!0)}}s(dJ,"cascadeOpacity");function fJ(e,t){if(t!==void 0&&e.type==="geometry-group"){let r=e.components[0];(t==null?void 0:t.texture)!=null&&r.texture!==(t==null?void 0:t.texture)&&(r.texture=t.texture,r.dirty=!0),(t==null?void 0:t.topTexture)!=null&&r.topTexture!==(t==null?void 0:t.topTexture)&&(r.topTexture=t.topTexture,r.dirty=!0)}}s(fJ,"updateGroupTexture");function mJ(e,t){if(e.type==="geometry"){let r=!1,n=e.components[1];if((t==null?void 0:t.texture)!=null&&n.texture!==(t==null?void 0:t.texture)&&(n.texture=t.texture,r=!0),(t==null?void 0:t.topTexture)!=null&&n.topTexture!==(t==null?void 0:t.topTexture)&&(n.topTexture=t.topTexture,r=!0),r&&e.components[0]instanceof gr){let o=e.components[0];return o.detached===!1&&(o.detached=!0,o.dirty=!0),!0}}return!1}s(mJ,"updateIndividualGeometryTexture");function hJ(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.opacity!==t){r.opacity=t;let n=e.components[0],o=e.components[3];o&&(o.dirty=!0),n.detached===!1&&(n.detached=!0,n.dirty=!0),t===0?r.visible=!1:r.visible=!0,r.dirty=!0;let i=e.parentObject3D;return(i==null?void 0:i.type)==="geometry-group"&&(i.userData.shadingDirty=!0),!0}}return!1}s(hJ,"updateIndividualGeometryOpacity");function zI(e,t){if(t!==void 0)if(e.type==="path"||e.type==="geometry"||e.type==="custom-geometry")e.components[1].altitude=t,e.components[1].dirty=!0;else{if(e.type==="group-container"&&e.altitude!==t)return e.setAltitude(t),!0;if(e.type==="geometry-group")return e.setAltitude(t),!0}return!1}s(zI,"updateAltitude");function HI(e,t,r){if(r!==void 0){if(e.type==="geometry-group"&&e.components[0]!=null)for(let n of e.userData.entities3D.values()){let o=t.geometry3DMap.get(n);o instanceof wt&&HI(o,t,r)}else if(e.type==="geometry"){let n=e.components[3],o=e.components[1];!n&&r===!0?e.components[3]=new Jm(o.color):n&&(n.visible=r,n.dirty=!0)}return!0}return!1}s(HI,"updateOutline");function fE(e,t){if(t!==void 0){if(e.type==="geometry"){let r=e.components[0];if(e.type==="geometry"&&r&&r instanceof gr&&r.focusable!==t)return r.focusable=t,!0}else if(e.type==="group-container"){let r=e.components[2]!==void 0;if(t===!0&&!r)return e.components[2]=new Qm,!0;if(t===!1&&r)return e.components[2]=void 0,!0}}return!1}s(fE,"updateFocusable");function yJ(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.renderOrder!==t){r.renderOrder=t;let n=e.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=t+1),r.dirty=!0,!0}}return!1}s(yJ,"updateIndividualGeometryRenderOrder");function gJ(e,t,r){let{visible:n,color:o}=r;if(e.type!=="path")return;let i=e.components[0];n!=null&&ua(e,t,n),o!=null&&lE(e,{color:o}),Object.assign(i,mE(r)),G8(r)||(i.materialDirty=!0,(r.nearRadius!=null||r.farRadius!=null)&&(i.dirty=!0),(r.nearZoomLevel!=null||r.farZoomLevel!=null)&&(i.dirty=!0))}s(gJ,"handlePathUpdate");function mE(e){return Eo(e,sTe)}s(mE,"pickPathOptions");var sTe=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel"];function bJ(e){if(!(e instanceof wt&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}s(bJ,"assetGeometryIsText3D");var WI=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function vJ(e,t,r){ua(e,t,r.visible);let n=e.components[1],o=Eo(r,WI);"margin"in r&&j.warn("update to margin is not supported atm"),"content"in r&&j.warn("content update is not supported atm");try{KK.parse(o)}catch(i){j.error(i);return}Object.keys(o).length>0&&(Object.assign(n,o),n.dirty=!0)}s(vJ,"handleText3DUpdate");var aTe=["color","material","opacity","verticalOffset","rotation","position","scale"];function xJ(e,t){let r=Eo(t,aTe),n=e.components[1],o=e.components[0];Object.keys(r).length>0&&(r.material&&(n.material=r.material),r.opacity!=null&&(n.opacity=r.opacity,r.opacity===0?n.visible=!1:n.visible=!0,n.dirty=!0),r.verticalOffset!=null&&(n.verticalOffset=r.verticalOffset),r.color!=null&&(n.color=r.color),r.position!=null&&(o.feature.geometry.coordinates=r.position,o.positionDirty=!0),r.rotation!=null&&(n.rotation=r.rotation),r.scale!=null&&(n.scale=r.scale),n.dirty=!0)}s(xJ,"handleModelStyleUpdate");var Yp,pa,qI,Gc,IJ,Eb,ZI,SJ,CJ,_b,XI,Ab,kb,YI,hE=class hE{constructor(t){O(this,Gc);O(this,Yp,null);O(this,pa);h(this,"getCurrentSceneGLTF",s(async t=>{let r={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},n=await te(this,Gc,IJ).call(this),o=u(this,qI).call(this,r),i=await n.parseAsync(o,{trs:!1,maxTextureSize:1/0,onlyVisible:r.onlyVisible,binary:r.binary,scale:r.scale}),a;if(i instanceof ArrayBuffer)a=new Blob([i],{type:"application/octet-stream"});else{let l=JSON.stringify(i,null,2);a=new Blob([l],{type:"text/plain"})}return a},"getCurrentSceneGLTF"));O(this,qI,s(t=>{let{scale:r,light:n,onlyVisible:o}=t,i=new Xl,a=new Jr().setFromObject(u(this,pa).entityScene);if(u(this,Eb).call(this,u(this,pa).entityScene,i,o),n){let l=new I0(16777215,.3*Math.PI);l.position.set(0,Math.max(a.max.x,a.max.y)*r*.5,a.max.y*r*4),l.lookAt(0,0,-1),l.target.position.set(0,0,-1),l.add(l.target),i.add(l)}return i},"#getExportedScene"));O(this,Eb,s((t,r,n)=>{t.material&&(t instanceof b0?te(this,Gc,SJ).call(this,t).forEach(o=>r.add(o)):t instanceof _d&&r.add(te(this,Gc,CJ).call(this,t))),t.children.forEach(o=>{(!n||o.visible)&&u(this,Eb).call(this,o,r,n)})},"#processObject3D"));O(this,ZI,s((t,r,n)=>{let o=new g8({color:new Lt(t),metalness:0});return o.opacity=r,o.transparent=n,o},"#createStandardMaterial"));O(this,_b,s(t=>{let{geometry:r,material:n,position:o,rotation:i,quaternion:a,scale:l}=t;if(!(r!=null&&r.isBufferGeometry))return t;let c=r.attributes.position,p=r.attributes.normal,f=r.attributes.uv;return u(this,XI).call(this,c,p),u(this,kb).call(this,o,l,i,a),f&&u(this,YI).call(this,f),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=Ta),t},"#convertGeometry"));O(this,XI,s((t,r)=>{let n=new Pe,o=new Pe;for(let i=0;i<t.count;i++)n.fromBufferAttribute(t,i),u(this,Ab).call(this,n),t.setXYZ(i,n.x,n.y,n.z),r&&(o.fromBufferAttribute(r,i),u(this,Ab).call(this,o),r.setXYZ(i,o.x,o.y,o.z))},"#convertAttributes"));O(this,Ab,s(t=>{let r=t.y;t.y=t.z,t.z=-r},"#convertVector"));O(this,kb,s((t,r,n,o)=>{let i=t.y;t.y=t.z,t.z=-i;let a=r.y;if(r.y=r.z,r.z=a,n instanceof Ma)n.order="YXZ",n.set(n.x,n.y,n.z,n.order);else{let l=o.y;o.set(o.x,o.z,-l,o.w)}},"#convertObjectProperties"));O(this,YI,s(t=>{for(let r=0;r<t.count;r++){let n=t.getX(r),o=t.getY(r);t.setXY(r,n,o)}},"#convertUVs"));A(this,pa,t),u(this,pa).entityScene=t.entityScene,u(this,pa).geometry3DMap=t.geometry3DMap}destroy(){A(this,Yp,null)}};Yp=new WeakMap,pa=new WeakMap,qI=new WeakMap,Gc=new WeakSet,IJ=s(async function(){if(!u(this,Yp)){let{GLTFExporter:t}=await import("./GLTFExporter-XQVCTG6M.js");A(this,Yp,new t)}return u(this,Yp)},"#getGLTFExporter"),Eb=new WeakMap,ZI=new WeakMap,SJ=s(function(t){var a,l;let r=[],o=((a=t.userData)!=null&&a.entities?Object.values((l=t.userData)==null?void 0:l.entities):[]).map(c=>u(this,pa).geometry3DMap.get(c)),i=new Map;return o.forEach(c=>{var v;if(!c||!(c instanceof wt))return;let p=c.components[1],f=c.components[2];if(!p.visible||p instanceof Ps&&p.opacity===0||p instanceof ey||p instanceof _0)return;let m=f!=null&&f.hover?p.hoverColor||u(this,pa).hoverColor:p.color,y="".concat(m,"-").concat(p.opacity,"-").concat(Number(p.visible));i.has(y)||i.set(y,[]),(v=i.get(y))==null||v.push(c)}),i.forEach((c,p)=>{let[f,m,y]=p.split("-"),v=c.reduce((P,T)=>{if(T.type==="custom-geometry")return P;let M=T.components[0];return"geometry"in M&&M.geometry instanceof p8&&P.push(M.geometry),P},[]),x=u(this,ZI).call(this,f,Number(m),t.material.transparent),S=qo(v,!0),I=new ze(S,x);I.position.copy(t.position),I.rotation.copy(t.rotation),I.scale.copy(t.scale),I.visible=!!y,u(this,kb).call(this,I.position,I.scale,I.rotation,I.quaternion),r.push(u(this,_b).call(this,I))}),r},"#processBatchedMesh"),CJ=s(function(t){let r=t.geometry.clone(),n=t.material,o=new jr({color:n.color,side:Ta});o.opacity=n.opacity,o.transparent=n.transparent;let i=new _d(r,o);return i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),i.visible=t.visible,u(this,_b).call(this,i)},"#processLineSegments"),_b=new WeakMap,XI=new WeakMap,Ab=new WeakMap,kb=new WeakMap,YI=new WeakMap,s(hE,"ExporterSystem");var Ob=hE;d();d();d();var bE=ys(DJ());function FJ(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}s(FJ,"JSClipperError");FJ.prototype=Error.prototype;bE.default.Error=function(e){throw new FJ(e)};var Xr=bE.default;var eMe="gray",tMe=.1,Lb=100,vE=new Xr.ClipperOffset;function rMe(e,t){vE.Clear(),t/=2;let r=e.map(o=>({X:o.x*Lb,Y:o.y*Lb}));vE.AddPath(r,Xr.JoinType.jtMiter,Xr.EndType.etClosedPolygon);let n=new Xr.Paths;return vE.Execute(n,t*Lb),n.length?n.map(i=>i.map(a=>({x:a.X/Lb,y:a.Y/Lb}))):[e]}s(rMe,"offset");function rS(e,t,r){var y,v,x,S,I;let{color:n=eMe,opacity:o=1,altitude:i=0,height:a=tMe}=r||{};Array.isArray(o)&&(o=1);let l={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:a+i},center:{x:0,y:0,z:(a+i)/2}},p=e.geometry.coordinates[0].map(P=>{let T=t(P[1],P[0]);return l.min.x=Math.min(l.min.x,T.x),l.min.y=Math.min(l.min.y,T.y),l.max.x=Math.max(l.max.x,T.x),l.max.y=Math.max(l.max.y,T.y),T});((v=(y=e.properties)==null?void 0:y.style)==null?void 0:v.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((x=e.properties)==null?void 0:x.image)!=null?p=rMe(p,((I=(S=e.properties)==null?void 0:S.style)==null?void 0:I.edgeOffset)||0):p=[p];let f=[];for(let P of p){let T=new bs;T.moveTo(P[0].x,P[0].y),P.slice(1).forEach(B=>T.lineTo(B.x,B.y)),T.lineTo(P[0].x,P[0].y);let M=e.geometry.coordinates.slice(1);T.holes=M.map(B=>{let D=B.map(L=>t(L[1],L[0])),F=new Kl;return F.moveTo(D[0].x,D[0].y),D.slice(1).forEach(L=>F.lineTo(L.x,L.y)),F.lineTo(D[0].x,D[0].y),F});let w={bevelEnabled:!1,depth:a},E=new vs(T,w);E.userData={style:{color:n,opacity:o}},f.push(E)}if(f.length===1)return f[0];let m=qo(f);return m.userData={style:{color:n,opacity:o},_split:!0},m}s(rS,"renderPolygonGeometry");d();var nMe="gray",oMe=.1;function nS(e,t,r){let{color:n=nMe,opacity:o=1,altitude:i=0,height:a=oMe}=r||{};Array.isArray(o)&&(o=1);let l={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:a+i}},c={bevelEnabled:!1,depth:a},p=[];e.geometry.coordinates.forEach(m=>{let y=new bs,v=m[0].map(I=>{let P=t(I[1],I[0]);return l.min.x=Math.min(l.min.x,P.x),l.min.y=Math.min(l.min.y,P.y),l.max.x=Math.max(l.max.x,P.x),l.max.y=Math.max(l.max.y,P.y),P});y.moveTo(v[0].x,v[0].y),v.slice(1).forEach(I=>y.lineTo(I.x,I.y)),y.lineTo(v[0].x,v[0].y);let x=m.slice(1);y.holes=x.map(I=>{let P=I.map(M=>t(M[1],M[0])),T=new Kl;return T.moveTo(P[0].x,P[0].y),P.slice(1).forEach(M=>T.lineTo(M.x,M.y)),T.lineTo(P[0].x,P[0].y),T});let S=new vs(y,c);p.push(S)});let f=qo(p);return f.translate(0,0,i||0),f.userData={style:{color:n,opacity:o}},f}s(nS,"renderMultiPolygonGeometry");d();var iMe="gray",xE=new Xr.ClipperOffset,Qn=100;function LJ(e,t,r){let{color:n=iMe,opacity:o=1,width:i=1,join:a="round",cap:l="round",height:c=.01,altitude:p=0}=r||{};Array.isArray(o)&&(o=0);let f=[];for(let S=0;S<e.geometry.coordinates.length-1;S++){let I=t(e.geometry.coordinates[S][1],e.geometry.coordinates[S][0]),P=t(e.geometry.coordinates[S+1][1],e.geometry.coordinates[S+1][0]);f.push([I,P])}xE.AddPaths(f.map(S=>S.map(I=>({X:I.x*Qn,Y:I.y*Qn}))),a==="round"?Xr.JoinType.jsRound:a==="miter"?Xr.JoinType.jsMiter:Xr.JoinType.jsSquare,l==="round"?Xr.EndType.etOpenRound:l==="butt"?Xr.EndType.etOpenButt:Xr.EndType.etOpenSquare);let m=new Xr.PolyTree;xE.Execute(m,i/2*Qn);let y=[],v={bevelEnabled:!1,depth:c};for(let S of m.m_AllPolys){let I=new bs;if(S.IsHole())continue;let P=S.m_polygon;I.moveTo(P[0].X/Qn,P[0].Y/Qn),P.slice(1).forEach(T=>I.lineTo(T.X/Qn,T.Y/Qn)),I.lineTo(P[0].X/Qn,P[0].Y/Qn),I.holes=S.m_Childs.map(T=>{let M=new Kl,w=T.m_polygon;return M.moveTo(w[0].X/Qn,w[0].Y/Qn),w.slice(1).forEach(E=>M.lineTo(E.X/Qn,E.Y/Qn)),M.lineTo(w[0].X/Qn,w[0].Y/Qn),M}),y.push(new vs(I,v))}let x=qo(y);return x.translate(0,0,p||0),x.userData={style:{color:n,opacity:o}},xE.Clear(),x}s(LJ,"renderLineStringGeometry");d();var eo=100,sMe=.22,aMe=.01;function RJ(e,t,r={}){let{width:n=sMe,height:o=aMe,color:i="gray",opacity:a=1,altitude:l=0}=r,c={min:{x:1/0,y:1/0,z:l},max:{x:-1/0,y:-1/0,z:l+o}},p={bevelEnabled:!1,depth:o},f=new Xr.ClipperOffset,m=e.geometry.coordinates.map(S=>S.map(I=>t(I[1],I[0])));f.AddPaths(m.map(S=>S.map(I=>({X:I.x*eo,Y:I.y*eo}))),Xr.JoinType.jsMiter,Xr.EndType.etOpenRound);let y=new Xr.PolyTree;f.Execute(y,n/2*eo);let v=[];for(let S of y.m_AllPolys){let I=new bs;if(S.IsHole())continue;c.min.x=Math.min(c.min.x,S.m_polygon[0].X),c.min.y=Math.min(c.min.y,S.m_polygon[0].Y),c.max.x=Math.max(c.max.x,S.m_polygon[0].X),c.max.y=Math.max(c.max.y,S.m_polygon[0].Y);let P=S.m_polygon;I.moveTo(P[0].X/eo,P[0].Y/eo),P.slice(1).forEach(T=>I.lineTo(T.X/eo,T.Y/eo)),I.lineTo(P[0].X/eo,P[0].Y/eo),I.holes=S.m_Childs.map(T=>{let M=new Kl,w=T.m_polygon;return M.moveTo(w[0].X/eo,w[0].Y/eo),w.slice(1).forEach(E=>M.lineTo(E.X/eo,E.Y/eo)),M.lineTo(w[0].X/eo,w[0].Y/eo),M}),v.push(new vs(I,p))}let x=qo(v);return x.translate(0,0,l||0),x.userData={style:{color:i,opacity:a}},f.Clear(),x}s(RJ,"renderMultiLineStringGeometry");d();d();var rh=$.object({type:$.enum(["Point"]),coordinates:$.array($.number()).min(2).max(3)});var lMe=$.object({rotation:$.array($.number()).length(3).optional(),altitude:$.number().optional(),scale:$.array($.number()).length(3).optional(),interactive:$.boolean().optional(),verticalOffset:$.number().optional(),id:$.union([$.number(),$.string()]).optional()}),cMe=$.object({type:$.enum(["Feature"]),geometry:rh,properties:lMe}),uMe=$.object({type:$.enum(["FeatureCollection"]),features:$.array(cMe)}),pMe=$.object({color:$.string()}),dMe=$.object({url:$.string(),color:$.string().optional(),opacity:$.number().optional(),material:$.record($.string(),pMe).optional()});function BJ(e,t,r){$.union([$.number(),$.string()]).parse(e),uMe.parse(t),dMe.parse(r)}s(BJ,"validateModelGroup");var Rb,Nb,IE=class IE{constructor(t){h(this,"mesh");h(this,"type","model");h(this,"positionDirty",!0);h(this,"outline");h(this,"geometry");h(this,"material");h(this,"feature");h(this,"instanceIndex",-1);h(this,"visible",!0);h(this,"color",new Lt);h(this,"position",new Pe);O(this,Rb,0);O(this,Nb,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return u(this,Rb)}set altitude(t){this.mesh&&(this.mesh.position.z=t,A(this,Rb,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(Ke.degToRad(t[0]),Ke.degToRad(t[1]),Ke.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return u(this,Nb)}set opacity(t){var r,n,o;if(this.mesh){if(this.mesh.children[0]instanceof Yl){for(let i of this.mesh.children)if(i instanceof Yl){((r=i.userData)==null?void 0:r.originalOpacity)===void 0&&(i.userData.originalOpacity=i.material.opacity);let a=Ts(t,0,(n=i.userData)==null?void 0:n.originalOpacity,0,1);i.material.opacity=a,i.material.transparent=a<1,i.material.needsUpdate=!0}}else(o=this.mesh)==null||o.traverse(i=>{i instanceof ze&&i.material&&(Array.isArray(i.material)?i.material.forEach(a=>{NJ(a,t)}):NJ(i.material,t))});A(this,Nb,t)}}};Rb=new WeakMap,Nb=new WeakMap,s(IE,"ModelComponent");var zc=IE;function NJ(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}s(NJ,"updateMaterialOpacity");d();function oS(e){var l,c;let t=e.components[0],r=e.components[1];r.opacity!=null&&r.opacity!==t.opacity&&(t.opacity=r.opacity);let n=r.material,o=r.color;if(n||o){let p=fMe(o,n);(l=t.mesh)==null||l.traverse(f=>{f instanceof ze&&f.material&&(Array.isArray(f.material)?f.material.forEach(m=>{p[m.name]?m.color.set(p[m.name].color):m.color.set(o)}):p[f.material.name]?f.material.color.set(p[f.material.name].color):f.material.color.set(o))})}let i=(c=t.feature.geometry.coordinates[2])!=null?c:0,a=r.verticalOffset+i;t.altitude!==a&&(t.altitude=a),r.visible!==t.visible&&(t.visible=r.visible),r.rotation&&t.setRotation(r.rotation),r.scale&&t.setScale(r.scale)}s(oS,"applyModelGeometryStyle");function fMe(e,t){let r={};if(e&&Object.assign(r,{Default:{color:e},Fabric:{color:e},Mpdn_Logo:{color:e},CouchLogo:{color:e}}),t)for(let n in t)t[n].color&&(r[n]?r[n].color=t[n].color:r[n]={color:t[n].color});return r}s(fMe,"consolidateColorAndMaterial");function $J(e,t){var a,l;let r=e.components[0],o=(a=e.components[1].verticalOffset)!=null?a:0,i=r.feature.geometry.coordinates.slice();i[2]=((l=i[2])!=null?l:0)+o,r.mesh?r.mesh.position.copy(t(i)):r.position.copy(t(i))}s($J,"applyModelPosition");function mMe(e){let{color:t,opacity:r,topColor:n,texture:o,topTexture:i}=e;return"".concat(t).concat(r).concat(n||"").concat(o||"").concat(i||"")}s(mMe,"generateIndex");var hMe=1e4,SE=class SE extends Fe{constructor(r,n){super();h(this,"state");h(this,"convertTo3DMapPosition");h(this,"loader");h(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-TYL77RHE.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,o){var l,c;let i=new gr(n),a=new wt(i,new Ps({...o,url:(c=(l=n.properties)==null?void 0:l.image)==null?void 0:c.path}));return o!=null&&o.outline&&(a.components[3]=new Jm(VI(o.color))),a.id=r,a}createModelFromFeature(r,n,o){let i=new zc(n),a={...o};n.properties.verticalOffset!=null&&(a.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(a.rotation=n.properties.rotation),n.properties.scale!=null&&(a.scale=n.properties.scale);let l=new _0(a),c=new wt(i,l);return c.id=r,c}populateEntityMesh(r,n){let o=r.components[0];o.geometry=n,o.currentHeight=r.components[1].height,o.dirty=!1}async populateModelGroup(r,n,o){let i=new wi,a=new Ma,l=new Yh,c=new Pe,p=new _i,f=await this.getGLTFLoader(),m=new Promise(y=>{f.load(n,v=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?v.scene.traverse(x=>{let S=x;if("isMesh"in S&&S.isMesh===!0){let I=new Yl(S.geometry,S.material,r.size);I.userData={entities:{}},p.add(I),o.add(p)}}):(v.scene.traverse(x=>{"isMesh"in x&&x.isMesh===!0&&(x.position.set(0,0,0),x.rotation.set(0,0,0),x.scale.set(1,1,1),x.updateMatrix())}),p.add(v.scene),o.add(p),p.userData.isSingleModel=!0,p.userData.entityId=r.values().next().value,p.userData.type="model")),y()})});return this.optimizePromise.push(m.then(()=>{var x,S,I,P,T,M,w,E,B,D,F,L;let y=0,v;for(let H of r.values()){if(v=this.state.geometry3DMap.get(H),!v||(v==null?void 0:v.type)!=="model")continue;let U=v.components[0],G=v.components[1],J=v.components[0].feature;U.mesh=p,U.instanceIndex=y,oS(v),v.components[1].dirty=!1;let{x:X,y:ie}=this.convertTo3DMapPosition(J.geometry.coordinates[1],J.geometry.coordinates[0],0);U.position.set(X,ie,U.altitude),a.set(Ke.degToRad((S=(x=G.rotation)==null?void 0:x[0])!=null?S:Bd[0]),Ke.degToRad((P=(I=G.rotation)==null?void 0:I[1])!=null?P:Bd[1]),Ke.degToRad((M=(T=G.rotation)==null?void 0:T[2])!=null?M:Bd[2])),c.set((E=(w=G.scale)==null?void 0:w[0])!=null?E:Nd[0],(D=(B=G.scale)==null?void 0:B[1])!=null?D:Nd[1],(L=(F=G.scale)==null?void 0:F[2])!=null?L:Nd[2]),l.setFromEuler(a),i.compose(U.position,l,c),p.children.forEach(ee=>{!v||(v==null?void 0:v.type)!=="model"||!(ee instanceof Yl)||(ee.setMatrixAt(y,i),ee.userData.entities[y]=v.id)}),U.mesh.userData.isSingleModel&&(U.mesh.matrix.copy(i),U.mesh.matrix.decompose(U.mesh.position,U.mesh.quaternion,U.mesh.scale)),y++}this.publish("model-loaded")})),p}populateEntityGroup(r){var l;let n,o,i,a;for(let c of r.values())a=this.state.geometry3DMap.get(c),a.components[0]instanceof gr&&(o=a.components[0].feature,i=a.components[1],o.geometry.type==="Polygon"?(n=rS(o,this.convertTo3DMapPosition,i),(l=o.properties)!=null&&l.textures&&o.properties.textures.length>0&&rJ(n,o.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(a,n)):o.geometry.type==="MultiPolygon"?(n=nS(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,n)):o.geometry.type==="LineString"?(n=LJ(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,n)):o.geometry.type==="MultiLineString"&&(n=RJ(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,n)));return r}optimize(r){var n;if(r.visible&&(r instanceof Sn||r instanceof ut)){for(let a of r.children)this.optimize(a);if(r instanceof ut||r.userData.dirty===!1)return;let o={};if(!r.userData.modelURL&&r.userData.dirty)try{this.populateEntityGroup(r.userData.entities3D)}catch(a){j.warn(a)}else r.userData.modelURL&&r.userData.dirty&&(this.populateModelGroup(r.userData.entities3D,r.userData.modelURL,r),r.userData.dirty=!1);let i=0;if(r.userData.dirty){let a=0,l;for(let c of r.userData.entities3D.values()){l=this.state.geometry3DMap.get(c);let p=l==null?void 0:l.components[0];if((l==null?void 0:l.type)==="geometry"){let f=l.components[1];a++,a>=hMe&&(a=0,i++);let m=mMe(f)+i;o[m]===void 0&&(o[m]={style:f,entities:[]}),o[m].entities.push(l)}else p&&"mesh"in p&&p.mesh&&((n=p.mesh)==null?void 0:n.parent)!==r&&r.add(p.mesh)}for(let c in o){let p=tJ(o[c].entities,o[c].style);r.add(p),r.userData.dirty=!1}for(let c of r.userData.entities3D.values())if(l=this.state.geometry3DMap.get(c),l!=null&&l.entities2D.size>0)for(let p of l.entities2D.values())p&&(l.attach(p),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};s(SE,"MeshCreationAndOptimizationSystem");var iS=SE;d();var CE=class CE{constructor(t,r){h(this,"state");h(this,"dirty",!0);h(this,"domTree");this.state=t,this.domTree=r}update(){if(this.dirty){let t;for(let r of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(r.userData.entityId),t){let n=t.components[0];(!n.enabled||!n.visible||!this.state.geometry2DIdsInScene.has(r.userData.entityId))&&this.domTree.removeChild(r)}else this.domTree.removeChild(r);for(let r of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(r),t){let n=t.components[0];n instanceof la&&n.enabled&&n.markerContainer&&!this.domTree.contains(n.markerContainer)&&(n.markerContainer.userData={entityId:t.id},this.domTree.appendChild(n.markerContainer),n.updateDimensions())}this.dirty=!1}}};s(CE,"DOMVisibilitySystem");var sS=CE;d();var PE=class PE{constructor(t,r){h(this,"state");h(this,"project");this.state=t,this.project=r}update(){let t,r=0,n,o;for(let i of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(i),t){o=t.components[0];let a=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(a instanceof wt)if(this.state.geometry3DIdsInScene.has(a.id)){n=a.components[1],o=t.components[0],(n.dirty||t.components[0].attachedDirty)&&(r=n.height,t.setAltitude(r));let l=n.visible&&n.opacity>0;o.visible!==l&&(o.visible=l)}else o.visible===!0&&(o.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};s(PE,"TwoDProjectionSystem");var aS=PE;d();d();var yMe=s(function(){let t,r;return n=>{if((!r||!r)&&(t=document.createElement("canvas"),t.width=500*n,t.height=500*n,t.style.width="500px",t.style.height="500px",r=t.getContext("2d")),!r)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:r}}},"createMeasureCanvasContext")(),jJ=s(({text:e,size:t,maxWidth:r,pixelRatio:n,maxLines:o=2,lineHeight:i=1.2,options:a={strokeText:!0}})=>{let l="bold ".concat(t*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:c}=yMe(n);c.font=l;let p=[],f=e.split(" "),m=0,y=0,v=0;for(;y<f.length;){let P=f[y];if(m===o&&m>0){p[m-1]+="...";break}if(p[m]==null&&(p[m]=P,y++),f.length===1){p[m]=P;break}if(f[y]==null)break;let{width:T}=c.measureText(p[m]+" "+f[y]);T<=r*n?(p[m]+=" "+f[y],y++):m++}p.forEach(P=>{let{width:T}=c.measureText(P);v=Math.max(T,v)});let x=t*n*i,S=p.length*x;return{maxWidth:v,maxHeight:S,lines:p.length,draw:s((P,T,M)=>{p.length===1?(a.strokeText&&P.strokeText(p[0],T,M),P.fillText(p[0],T,M)):(a.strokeText&&(P.strokeText(p[0],T,M-x/2),P.strokeText(p[1],T,M+x/2)),P.fillText(p[0],T,M-x/2),P.fillText(p[1],T,M+x/2))},"draw")}},"shaveText");d();function GJ(e){let t=new Image;return e&&(/<svg[\s\S]*>/i.test(e)?t.src="data:image/svg+xml;base64,".concat(btoa(e)):t.src=e),t}s(GJ,"createImage");var gMe=3.5,bMe=2.5,vMe=2,xMe=5,Bb=2.5;var TE=class TE extends Fe{constructor(r,n,o){super();h(this,"dirty",!1);h(this,"state");h(this,"colliderContext");h(this,"colliderCanvas");h(this,"transformRequestFunc");h(this,"transformRequest",s(async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r},"transformRequest"));h(this,"pinCache",{});h(this,"imageCache",{});h(this,"imagePromiseCache",{});h(this,"imageDimensionsCache",{});h(this,"textCache",{});h(this,"update",s(r=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let o,i,a,l,c,p,f;for(let m of this.state.geometry2DIdsInScene)if(f=this.state.geometry2DMap.get(m),f!=null&&(p=f.components[0],p instanceof ca&&!f.disposed)){if(c=p.appearance.marker.iconVisibleAtZoomLevel,p.appearance.marker.icon!=null&&c&&r>=c!==p.iconVisible&&(p.iconVisible=r>=c,p.dirty=!0),(p.dirty||this.dirty)&&p.calculateMarkerSize(),i=p.appearance.marker.foregroundColor,a=p.appearance.marker.backgroundColor,l=kd(p.markerSize,2),o="".concat(i.active,"-").concat(i.inactive,"-").concat(a.active,"-").concat(a.inactive,"-").concat(l,"-").concat(p.iconVisible),p.labelCacheId=o,this.pinCache[o]||this.prepare(p,o,this.colliderContext),p.appearance.marker.icon&&(!p.imageHash||p.dirty)&&this.cacheImage(p),this.textCache[p.id]==null||p.dirty||this.dirty){p.collisionDirty=!0,this.textCache[p.id]={};let{textDrawFn:y,width:v,height:x}=this.processText(p.text,p.appearance.text.size,p.appearance.text.maxWidth,p.appearance.text.numLines,p.appearance.text.lineHeight);["left","center","right"].forEach(I=>{this.textCache[p.id][I]=this.textToCanvas(y,p.appearance.text.size,I,v,x,p.appearance.text.foregroundColor,p.appearance.text.backgroundColor)}),p.dimensions={width:Math.ceil(v/n),height:Math.ceil(x/n)},p.currentStrategyIndex===-1&&(p.currentStrategyIndex=0);let S=p.strategies[p.currentStrategyIndex];if(S){S.onStrategySelected(p);let I=p.style;p.style=p.newStyle,p.newStyle=I}}p.canShow&&p.visible&&(p.enabled||p.visibilityNeedsUpdate!==!1)&&this.draw(p,o,this.colliderContext),p.dirty=!1}this.dirty=!1},"update"));h(this,"processText",s((r,n,o,i,a)=>{let l=this.state.pixelRatio,{draw:c,maxWidth:p,maxHeight:f}=jJ({text:r,size:n,pixelRatio:l,maxWidth:o,maxLines:i,lineHeight:a});return{textDrawFn:c,width:p+Bb*l*2,height:f+Bb*l*2}},"processText"));h(this,"textToCanvas",s((r,n,o,i,a,l,c)=>{let p=this.state.pixelRatio,f,m=i,y=a;window.OffscreenCanvas!=null&&!j8()?f=new OffscreenCanvas(m,y):(f=document.createElement("canvas"),f.width=m,f.height=y,f.style.width=m+"px",f.style.height=y+"px");let v=f.getContext("2d",{willReadFrequently:!0});if(!v)return;v.textAlign=o,v.font="bold ".concat(n*p,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),v.textBaseline="middle",v.lineJoin="miter",v.miterLimit=2,v.strokeStyle="white",v.lineWidth=Bb*p,v.fillStyle=l,v.strokeStyle=c;let x=o==="left"?0:o==="center"?m/2:m-Bb*p/2;return r(v,x,(y+Bb*p/2)/2),f},"textToCanvas"));h(this,"cacheImage",s(r=>{if(!r.appearance.marker.icon)return;let n=q8(r.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(o=>{this.transformRequest(r.appearance.marker.icon).then(i=>{let a=GJ(i.url);a.onload=()=>{this.imageCache[n]=a,this.publish("img:loaded"),o(a)}})})),r.imageHash!==n&&(r.imageHash=n,this.imagePromiseCache[n].then(()=>{r.dirty=!0}))},"cacheImage"));h(this,"createPinCanvas",s((r,n,o,i)=>{let a,l=this.state.pixelRatio,c=r.totalMarkerSize*2*l;window.OffscreenCanvas!=null?a=new OffscreenCanvas(c,c):(a=document.createElement("canvas"),a.width=c,a.height=c,a.style.width=c/l+"px",a.style.height=c/l+"px");let p=a.getContext("2d");return p.shadowColor="rgba(0,0,0,0.3)",p.shadowOffsetY=vMe*l,p.shadowBlur=xMe*l,p.beginPath(),p.arc(c/2,c/2,n/2+bMe*l/2,0,2*Math.PI),p.fillStyle=o,p.fill(),p.beginPath(),p.arc(c/2,c/2,n/2,0,2*Math.PI),p.shadowColor="transparent",p.fillStyle=i,p.fill(),a},"createPinCanvas"));h(this,"prepare",s((r,n,o)=>{let i=this.state.pixelRatio;o.lineWidth=4*i;let a=this.createPinCanvas(r,r.markerSize,r.appearance.marker.backgroundColor.active,r.appearance.marker.foregroundColor.active),l=this.createPinCanvas(r,r.iconVisible?r.markerSize:gMe*i,r.appearance.marker.backgroundColor.inactive,r.appearance.marker.foregroundColor.inactive);this.pinCache[n]=[a,l]},"prepare"));this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=o}draw(r,n,o){var p,f;if(!r.canShow||!r.visible)return;o.save(),o.globalAlpha=r.opacity;let i=this.state.pixelRatio,a=r.projection.x*i,l=r.projection.y*i,c=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(o.drawImage(c,a-r.totalMarkerSize*i,l-r.totalMarkerSize*i),r.appearance.marker.icon&&r.iconVisible&&r.imageHash&&r.appearance.marker.iconSize&&this.imageCache[r.imageHash]){let m=this.imageCache[r.imageHash],y=(r.appearance.marker.iconSize-r.appearance.marker.iconPadding)*i,v=r.appearance.marker.iconFit,x=y,S=y,I="".concat(r.imageHash,"_").concat(v);if(this.imageDimensionsCache[I])x=this.imageDimensionsCache[I].width,S=this.imageDimensionsCache[I].height;else{let P=m.width*i,T=m.height*i;if(v==="contain"){let M=Math.sqrt(P**2+T**2),w=y/M;x=P*w,S=T*w}if(v==="cover"){let M=y/P,w=y/T,E=Math.max(M,w);x=P*E,S=T*E}}o.save(),o.beginPath(),o.arc(a,l,y/2,0,2*Math.PI),o.closePath(),((f=(p=r==null?void 0:r.appearance)==null?void 0:p.marker)==null?void 0:f.iconOverflow)!=="visible"&&o.clip(),o.drawImage(m,a-x/2,l-S/2,x,S),o.restore()}r.style.textLabelVisible&&r.style.textAlign!=null&&r.style.left&&r.style.top&&o.drawImage(this.textCache[r.id][r.style.textAlign],a+r.style.left*i,l+r.style.top*i),o.restore()}};s(TE,"TwoDDrawSystem");var lS=TE;d();d();var Hc=class Hc{constructor(){h(this,"loader");this.loader=new Ad}static getInstance(){return Hc.instance||(Hc.instance=new Hc),Hc.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};s(Hc,"TextureLoaderSingleton"),h(Hc,"instance");var wE=Hc,Wc=wE.getInstance();function IMe(e,t){let r=e.components[2],n=e.components[1];return r!=null&&r.hover?[n.hoverColor||t,n.hoverColor||t]:[n.color,n.topColor||n.color]}s(IMe,"processColor");var ed,$b,ME=class ME extends Fe{constructor(r,n){super();O(this,ed);h(this,"state");h(this,"convertTo3DMapPosition");h(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=r}setShading(r,n){r.material&&r.material.setGradientShading(n.start,n.end,n.intensity)}processTextures(r,n,o){var i;if(n.texture!==r.texture&&n.texture!==""&&te(this,ed,$b).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&te(this,ed,$b).call(this,n.topTexture,r,"topTexture"),(r.texture==null||r.topTexture==null)&&Array.isArray((i=r.feature.properties)==null?void 0:i.textures)&&r.feature.properties.textures.length>0)for(let a of r.feature.properties.textures)a.face==="top"&&r.topTexture!==a.path?te(this,ed,$b).call(this,a.path,r,"topTexture"):a.face==="side"&&r.texture!==a.path&&te(this,ed,$b).call(this,a.path,r,"texture"),r.blendTexture=!0;(r.texture!=null||r.topTexture!=null)&&(o!=null&&o.hover&&r.texturesVisible?r.hideTextures():r.texturesVisible||r.showTextures(),n.texture===""&&r.removeSideTexture(),n.topTexture===""&&r.removeTopTexture())}update(){var i,a,l,c,p,f,m,y;let r,n,o;for(let v of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(v),o instanceof Sn&&o.type==="geometry-group"){let x=o.components[0];if(o.userData.shadingDirty){let S=o.userData.entities3D.values().next().value;if(S==null)continue;let I=this.state.geometry3DMap.get(S);I instanceof wt&&(I.type==="geometry"||I.type==="custom-geometry")&&(r=I.components[0],o.userData.shadingDirty&&x.shading&&this.setShading(r,x.shading));let P,T;for(let M of o.userData.entities3D.values())P=this.state.geometry3DMap.get(M),T=P.components[0],P.type==="geometry"&&T.detached&&o.userData.shadingDirty&&x.shading&&this.setShading(T,x.shading);o.userData.shadingDirty=!1}if(x.dirty){let S=o.getfirstChildEntityId();if(S){let P=this.state.geometry3DMap.get(S),T=P==null?void 0:P.components[0];T instanceof gr&&this.processTextures(T,x)}let I=x.opacity*Su(o);o.getOpacity()!==I&&o.setOpacity(I),x.dirty=!1}}else if(o&&(o.type==="geometry"||o.type==="custom-geometry")&&((i=o.components[1])!=null&&i.dirty||(a=o.components[2])!=null&&a.dirty)){let x=o.components[0],S=o.components[1];n=o.components[2];let I=IMe(o,this.state.hoverColor);if(x.setColor(I[0],I[1]),S.visible!==x.visible&&(x.visible=S.visible,x instanceof gr&&x.textMesh)){let T=this.state.geometry3DMap.get(x.textMesh.userData.entityId);(T==null?void 0:T.type)==="text3d"&&T.components[0].polygonEntityId!=null&&(T.components[0].visible=S.visible)}S.altitude!==x.altitude&&(x.altitude=S.altitude);let P=S.opacity*Su(o);P!==x.opacity&&(x.opacity=P),S.renderOrder!==x.renderOrder&&(x.renderOrder=S.renderOrder),S.dirty=!1,x instanceof gr&&this.processTextures(x,S,n),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model")o.components[1].dirty&&(oS(o),o.components[1].dirty=!1),o.components[0].positionDirty&&($J(o,this.convertTo3DMapPosition),o.components[0].positionDirty=!1);else if((o==null?void 0:o.type)==="image"&&((l=o.components[1])!=null&&l.dirty)){r=o.components[0];let x=o.components[1];x.visible!==r.visible&&(r.visible=x.visible),x.dirty=!1}else if((o==null?void 0:o.type)==="text3d"&&((c=o.components[1])!=null&&c.dirty)&&o.components[0].polygonEntityId!=null){r=o.components[0];let x=o.components[1];x.visible!=null&&x.visible!==r.visible&&(r.visible=x.visible);let{textMesh:S}=r;if(S){Object.assign(S,x.getState());let I=(p=x.hoverColor)!=null?p:this.state.text3dHoverColor;S.color=x.hoverByPolygon?I:(f=x.color)!=null?f:Rd.color,S.outlineColor=x.hoverByPolygon?I:(m=x.outlineColor)!=null?m:Rd.outlineColor,S.strokeColor=x.hoverByPolygon?I:(y=x.strokeColor)!=null?y:Rd.strokeColor}x.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};ed=new WeakSet,$b=s(async function(r,n,o){if(!(!r||!n.showTextures))if(this.textureLoadingCache.has(r)){o==="topTexture"?n.topTexture=await this.textureLoadingCache.get(r):n.texture=await this.textureLoadingCache.get(r),n.showTextures();return}else{let i=new Promise((a,l)=>{Wc.getLoader().load(r,c=>{o==="topTexture"?n.topTexture=c:n.texture=c,n.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{j.error("Failed to load texture: ".concat(r)),l("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,i)}},"#loadTexture"),s(ME,"DrawSystem");var cS=ME;d();var OE=class OE extends Fe{constructor(r){super();h(this,"state");h(this,"animating",new Map);h(this,"isAnimating",!1);h(this,"startTime",-1);h(this,"showDuration",300);h(this,"hideDuration",250);h(this,"update",s(()=>{this.animating.clear();let r,n;for(let o of this.state.geometry2DIdsInScene)r=this.state.geometry2DMap.get(o),r&&(n=r.components[0],n instanceof ca&&(n.visibilityNeedsUpdate==="show"?(n.canShow=!0,this.animating.set(n,[n.opacity,1])):n.visibilityNeedsUpdate==="hide"&&this.animating.set(n,[n.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")},"update"));h(this,"playAnimations");this.state=r,this.playAnimations=this._playAnimations}_playAnimations(){let r=performance.now();for(let[n,[o,i]]of this.animating.entries()){let a=i===1?this.showDuration:this.hideDuration,l=(r-this.startTime)/a;n.opacity=Ts(l,0,1,o,i,i===0?Z8:X8),r-this.startTime>=a&&(i===1?n.canShow=!0:i===0&&(n.canShow=!1),n.visibilityNeedsUpdate=!1,this.animating.delete(n))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};s(OE,"TwoDVisibilitySystem");var uS=OE;d();var EE=class EE extends Fe{constructor(r,n,o,i,a,l,c){super();h(this,"state");h(this,"renderer");h(this,"mode");h(this,"scene");h(this,"cameraObject");h(this,"viewCamera");h(this,"systems");h(this,"needs2DRecompute",!1);h(this,"twoDdirty",!0);h(this,"threeDdirty",!0);h(this,"frameId",null);h(this,"twoDFrameId",null);h(this,"animationFrameId",null);h(this,"nextFrame",null);h(this,"update",s((r=!1)=>{var n;if(((n=this.renderer)==null?void 0:n.renderer)==null)return Promise.resolve();if(r){let o=this.commitRenderState();return this.paint(),o}else return this.frameId?Promise.resolve():new Promise(o=>{this.frameId=requestAnimationFrame(()=>{var i,a;return((i=this.renderer)==null?void 0:i.renderer)==null?o():this.mode==="standalone"?(a=this.commitRenderState())==null?void 0:a.then(()=>{this.paint(),o()}):o()})})},"update"));h(this,"animate2D",s(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));h(this,"drawEntities2D",s(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));h(this,"updateEntities2D",s(()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));h(this,"commitRenderState",s(()=>{try{let r=[];this.frameId=null,this.publish("pre-render"),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),z8(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),V8(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let n=this.systems.meshOptimizationSystem.update();n&&r.push(n),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),r.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update();let o=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!o)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.publish("post-render"),Promise.all(r)}catch(r){j.error("Render failed: ",r)}},"commitRenderState"));this.renderer=r,this.state=n,this.mode=o,this.scene=i,this.cameraObject=a,this.viewCamera=l,this.systems=c,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){var r;(r=this.renderer)!=null&&r.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};s(EE,"RenderSystem");var pS=EE;d();var SMe=$.object({interactive:$.boolean().optional(),id:$.string().optional(),nearRadius:$.number().optional(),farRadius:$.number().optional(),accentColor:$.string().optional(),displayArrowsOnPath:$.boolean().optional(),animateArrowsOnPath:$.boolean().optional(),nearZoomLevel:$.number().optional(),farZoomLevel:$.number().optional()}),CMe=$.object({type:$.enum(["Feature"]),geometry:rh,properties:$.object({parentId:$.any().optional()})});function UJ(e,t){$.object({features:$.array(CMe)}).parse(e),SMe.parse(t)}s(UJ,"validatePath");var jb,_E=class _E{constructor(t,r){h(this,"type","path");h(this,"mesh",new _i);h(this,"material");h(this,"geometry");h(this,"outline");h(this,"feature");h(this,"options");h(this,"nearRadius",.2);h(this,"farRadius",.4);h(this,"nearZoomLevel");h(this,"farZoomLevel");h(this,"nearZoomAltitude");h(this,"farZoomAltitude");h(this,"accentColor","blue");h(this,"completeFraction",1);h(this,"altitudeAdjustment",1);h(this,"displayArrowsOnPath",!1);h(this,"animateArrowsOnPath",!1);h(this,"isVertical",!1);h(this,"dirty",!0);h(this,"materialDirty",!0);h(this,"position",new Pe);O(this,jb,0);var n,o,i,a,l;this.feature=t,this.options=r||{},this.accentColor=(n=r==null?void 0:r.accentColor)!=null?n:this.accentColor,this.nearRadius=(o=r==null?void 0:r.nearRadius)!=null?o:this.nearRadius,this.farRadius=(i=r==null?void 0:r.farRadius)!=null?i:this.farRadius,this.nearZoomLevel=r==null?void 0:r.nearZoomLevel,this.farZoomLevel=r==null?void 0:r.farZoomLevel,this.displayArrowsOnPath=(a=r==null?void 0:r.displayArrowsOnPath)!=null?a:this.displayArrowsOnPath,this.animateArrowsOnPath=(l=r==null?void 0:r.animateArrowsOnPath)!=null?l:this.animateArrowsOnPath}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return u(this,jb)}set altitude(t){this.mesh&&(this.mesh.position.z=t,A(this,jb,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};jb=new WeakMap,s(_E,"PathComponent");var qc=_E;d();var AE=class AE{constructor(t){h(this,"rendererState");this.rendererState=t}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(r),t instanceof ut&&t.components[0]){let n=t.components[0];if(n.dirty){for(let o of t.children)(o instanceof Sn||o instanceof ut)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));n.dirty=!1}}}};s(AE,"StackSystem");var dS=AE;d();d();d();var kr=Object.freeze({Linear:Object.freeze({None:s(function(e){return e},"None"),In:s(function(e){return e},"In"),Out:s(function(e){return e},"Out"),InOut:s(function(e){return e},"InOut")}),Quadratic:Object.freeze({In:s(function(e){return e*e},"In"),Out:s(function(e){return e*(2-e)},"Out"),InOut:s(function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},"InOut")}),Cubic:Object.freeze({In:s(function(e){return e*e*e},"In"),Out:s(function(e){return--e*e*e+1},"Out"),InOut:s(function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},"InOut")}),Quartic:Object.freeze({In:s(function(e){return e*e*e*e},"In"),Out:s(function(e){return 1- --e*e*e*e},"Out"),InOut:s(function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},"InOut")}),Quintic:Object.freeze({In:s(function(e){return e*e*e*e*e},"In"),Out:s(function(e){return--e*e*e*e*e+1},"Out"),InOut:s(function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},"InOut")}),Sinusoidal:Object.freeze({In:s(function(e){return 1-Math.sin((1-e)*Math.PI/2)},"In"),Out:s(function(e){return Math.sin(e*Math.PI/2)},"Out"),InOut:s(function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))},"InOut")}),Exponential:Object.freeze({In:s(function(e){return e===0?0:Math.pow(1024,e-1)},"In"),Out:s(function(e){return e===1?1:1-Math.pow(2,-10*e)},"Out"),InOut:s(function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},"InOut")}),Circular:Object.freeze({In:s(function(e){return 1-Math.sqrt(1-e*e)},"In"),Out:s(function(e){return Math.sqrt(1- --e*e)},"Out"),InOut:s(function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},"InOut")}),Elastic:Object.freeze({In:s(function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},"In"),Out:s(function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},"Out"),InOut:s(function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)},"InOut")}),Back:Object.freeze({In:s(function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},"In"),Out:s(function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},"Out"),InOut:s(function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},"InOut")}),Bounce:Object.freeze({In:s(function(e){return 1-kr.Bounce.Out(1-e)},"In"),Out:s(function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},"Out"),InOut:s(function(e){return e<.5?kr.Bounce.In(e*2)*.5:kr.Bounce.Out(e*2-1)*.5+.5},"InOut")}),generatePow:s(function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:s(function(t){return Math.pow(t,e)},"In"),Out:s(function(t){return 1-Math.pow(1-t,e)},"Out"),InOut:s(function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5},"InOut")}},"generatePow")}),Gb=s(function(){return performance.now()},"now"),DE=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return s(e,"Group"),e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(r){return t._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o=0,i=r;o<i.length;o++){var a=i[o];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},e.prototype.remove=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=0,o=t;n<o.length;n++){var i=o[n];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,r){t===void 0&&(t=Gb()),r===void 0&&(r=!0);var n=Object.keys(this._tweens);if(n.length!==0)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<n.length;o++){var i=this._tweens[n[o]],a=!r;i&&i.update(t,a)===!1&&!r&&this.remove(i)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),nh={Linear:s(function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=nh.Utils.Linear;return t<0?i(e[0],e[1],n):t>1?i(e[r],e[r-1],r-n):i(e[o],e[o+1>r?r:o+1],n-o)},"Linear"),Bezier:s(function(e,t){for(var r=0,n=e.length-1,o=Math.pow,i=nh.Utils.Bernstein,a=0;a<=n;a++)r+=o(1-t,n-a)*o(t,a)*e[a]*i(n,a);return r},"Bezier"),CatmullRom:s(function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=nh.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(o=Math.floor(n=r*(1+t))),i(e[(o-1+r)%r],e[o],e[(o+1)%r],e[(o+2)%r],n-o)):t<0?e[0]-(i(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(i(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):i(e[o?o-1:0],e[o],e[r<o+1?r:o+1],e[r<o+2?r:o+2],n-o)},"CatmullRom"),Utils:{Linear:s(function(e,t,r){return(t-e)*r+e},"Linear"),Bernstein:s(function(e,t){var r=nh.Utils.Factorial;return r(e)/r(t)/r(e-t)},"Bernstein"),Factorial:function(){var e=[1];return function(t){var r=1;if(e[t])return e[t];for(var n=t;n>1;n--)r*=n;return e[t]=r,r}}(),CatmullRom:s(function(e,t,r,n,o){var i=(r-e)*.5,a=(n-t)*.5,l=o*o,c=o*l;return(2*t-2*r+i+a)*c+(-3*t+3*r-2*i-a)*l+i*o+t},"CatmullRom")}},VJ=function(){function e(){}return s(e,"Sequence"),e.nextId=function(){return e._nextId++},e._nextId=0,e}(),kE=new DE,Co=function(){function e(t,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=kr.Linear.None,this._interpolationFunction=nh.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=VJ.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=kE,kE.add(this))}return s(e,"Tween"),e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,r){if(t===void 0&&(t=Gb()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var i in this._valuesEnd)o[i]=this._valuesEnd[i];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,r,n,o,i){for(var a in n){var l=t[a],c=Array.isArray(l),p=c?"array":typeof l,f=!c&&Array.isArray(n[a]);if(!(p==="undefined"||p==="function")){if(f){var m=n[a];if(m.length===0)continue;for(var y=[l],v=0,x=m.length;v<x;v+=1){var S=this._handleRelativeValue(l,m[v]);if(isNaN(S)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}y.push(S)}f&&(n[a]=y)}if((p==="object"||c)&&l&&!f){r[a]=c?[]:{};var I=l;for(var P in I)r[a][P]=I[P];o[a]=c?[]:{};var m=n[a];if(!this._isDynamic){var T={};for(var P in m)T[P]=m[P];n[a]=m=T}this._setupProperties(I,r[a],m,o[a],i)}else(typeof r[a]>"u"||i)&&(r[a]=l),c||(r[a]*=1),f?o[a]=n[a].slice().reverse():o[a]=r[a]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=Gb()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Gb()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,r=this._chainedTweens.length;t<r;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=kr.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=nh.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,r){var n=this,o;if(t===void 0&&(t=Gb()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var i;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,l=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*l,p=s(function(){if(n._duration===0||a>c)return 1;var S=Math.trunc(a/l),I=a-S*l,P=Math.min(I/n._duration,1);return P===0&&a===n._duration?1:P},"calculateElapsedPortion"),f=p(),m=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||a>=this._duration)if(this._repeat>0){var y=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=y);for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*y,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,x=this._chainedTweens.length;v<x;v++)this._chainedTweens[v].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,r,n,o){for(var i in n)if(r[i]!==void 0){var a=r[i]||0,l=n[i],c=Array.isArray(t[i]),p=Array.isArray(l),f=!c&&p;f?t[i]=this._interpolationFunction(l,o):typeof l=="object"&&l?this._updateProperties(t[i],a,l,o):(l=this._handleRelativeValue(a,l),typeof l=="number"&&(t[i]=a+(l-a)*o))}},e.prototype._handleRelativeValue=function(t,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?t+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(t){var r=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=r},e.autoStartOnUpdate=!1,e}();var fxt=VJ.nextId,da=kE,mxt=da.getAll.bind(da),hxt=da.removeAll.bind(da),yxt=da.add.bind(da),gxt=da.remove.bind(da),bxt=da.update.bind(da);d();d();d();var zJ=s((e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),HJ=s((e,t)=>new _e(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),"getTouchPos"),FE=s((e,t)=>Math.atan2(t.y-e.y,t.x-e.x),"angle"),Ub=s((e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),"distance"),LE=s((e,t)=>new _e((e.x+t.x)/2,(e.y+t.y)/2),"average"),RE=s(e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t},"getScrollDelta");var NE=class NE{constructor(t,r){h(this,"input1");h(this,"input2");h(this,"lastAngle");h(this,"lastDistance");h(this,"totalDistance");h(this,"first");h(this,"second");this.input1=t,this.input2=r,this.lastAngle=FE(t,r),this.lastDistance=Ub(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=Ub(t,r);this.input1=t,this.input2=r;let o=FE(t,r);this.lastAngle=o,this.lastDistance=n,this.totalDistance+=(Ub(this.first,t)+Ub(this.second,r))/2,this.first=LE(this.first,t),this.second=LE(this.second,r)}};s(NE,"InputSet");var fS=NE;d();var BE=class BE{constructor(t,r,n){h(this,"touch");h(this,"camera");h(this,"cameraPlane");h(this,"viewCoordinate");h(this,"snapHolderMatrix");h(this,"snapCamera");h(this,"cameraPosition");h(this,"raycaster");h(this,"worldCoordinate");h(this,"snapshotted",!1);this.touch=t,this.camera=r,this.cameraPlane=n,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new _e(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new xs,this.raycaster.setFromCamera(t,this.snapCamera);let r=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=r&&r.length>0?r[0].point:null,this.snapshotted=!0}updateAnchorState(t,r){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(r),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var n,o;let t=new _e(this.viewCoordinate.x,this.viewCoordinate.y);(n=this.raycaster)==null||n.setFromCamera(t,this.snapCamera);let r=(o=this.raycaster)==null?void 0:o.intersectObject(this.cameraPlane,!0)[0];return r?r.point:void 0}};s(BE,"TouchAnchor");var Vb=BE;var Si={};Pa(Si,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>TMe,CLIPPING_RADIUS:()=>zb,CONTROL_OPTIONS:()=>PMe,DEFAULT_ANIMATION_DURATION:()=>VE,DEFAULT_BEARING:()=>_Me,DEFAULT_MAX_ZOOM_LEVEL:()=>OMe,DEFAULT_MIN_ZOOM_LEVEL:()=>zE,DEFAULT_PITCH:()=>EMe,DEFAULT_ZOOM_LEVEL:()=>MMe,EVENTS:()=>gS,MAPLIBRE_TILE_SIZE:()=>mS,MAX_LAT:()=>jE,MAX_MERCATOR_ZOOM_LEVEL:()=>yS,MIN_LAT:()=>$E,MIN_MERCATOR_ZOOM_LEVEL:()=>hS,ROOM_MERCATOR_ZOOM_LEVEL:()=>wMe,TWO_PI:()=>GE,WHEEL_ZOOM_MULTIPLIER:()=>UE,ZRANGE:()=>oh});d();var mS=512,$E=-85.051129,jE=85.051129,zb=1e4,PMe={chain:"chain",cancel:"cancel"},GE=Math.PI*2,oh=100,UE=1e4,hS=0,yS=24,TMe=17,wMe=20,VE=200,gS=["change","pan-start","pan-end","rotate-start","rotate-end","zoom-start","zoom-end","multi-start","multi-end","multi-cancel","pedestal-start","pedestal-change","pedestal-end","user-pan-start","user-pedestal-start","user-rotate-start","user-dolly-start","user-zoom-start","user-tilt-start","user-pan-end","user-pedestal-end","user-rotate-end","user-dolly-end","user-zoom-end","user-tilt-end","position-updated","zoom-updated","tilt-updated","rotation-updated"],MMe=18,zE=12,OMe=22,EMe=0,_Me=0;d();function WJ(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}s(WJ,"scrubMaterial");function hr(e){for(let t=e.children.length-1;t>=0;t--)hr(e.children[t]);"geometry"in e&&e.geometry&&e.geometry.dispose(),e.parent&&e.parent.remove(e),"material"in e&&Array.isArray(e.material)?e.material.forEach(function(t){WJ(t)}):"material"in e&&typeof e.material<"u"&&WJ(e.material)}s(hr,"destroyObject3D");var bS=!1,AMe=!1;var vS,xS=class xS extends Fe{constructor(r,n,o,i,a){super();h(this,"dirty",!1);h(this,"zoomDirty",!1);h(this,"rotationDirty",!1);h(this,"panDirty",!1);O(this,vS,zE);h(this,"zoomSpeed",5);h(this,"rotateSpeed",100);h(this,"enabled",!0);h(this,"enableZoom",!0);h(this,"enablePan",!0);h(this,"enablePedestal",!1);h(this,"maxPedestal",1/0);h(this,"minPedestal",0);h(this,"enableRotate",!0);h(this,"minZoomAltitude",0);h(this,"maxZoomAltitude",1/0);h(this,"ignoreZoomLimits",!1);h(this,"zoomFactor",1);h(this,"panBounds",{min:new Pe(1/0,1/0),max:new Pe(-1/0,-1/0),center:new Pe(0,0,0),radius:1/0});h(this,"minTilt",0);h(this,"maxTilt",1.2);h(this,"MOUSE_BUTTONS",{ORBIT:h0.RIGHT,ZOOM:h0.MIDDLE,PAN:h0.LEFT});h(this,"camera");h(this,"scene");h(this,"renderer");h(this,"elevation");h(this,"orbit");h(this,"cameraPlane");h(this,"raycaster",new xs);h(this,"rendererState");h(this,"options");h(this,"state",-1);h(this,"intersection");h(this,"viewState",null);h(this,"tweens",new Map);h(this,"clock",new v8(!0));h(this,"coords",{mouse:new _e,rotateStart:new _e,rotateEnd:new _e,rotateDelta:new _e,panStart:new Pe,panCameraStart:new Pe,panEnd:new Pe,panDelta:new Pe,initialShiftPos:new _e,initialPedestal:0,floorAnchor:new Pe});h(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});h(this,"scrollTimer",null);h(this,"lastWheelTime",0);h(this,"resetZoom",!1);h(this,"zoomStart");h(this,"pedestalScaleFactor",1);h(this,"isUserZooming",!1);h(this,"stayInsideBounds",!0);h(this,"userInteracting",!1);h(this,"cameraMoving",!1);h(this,"lastCameraMoveTime",Date.now());h(this,"raycastToFloor",s(r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new Pe},"raycastToFloor"));h(this,"isUserInteracting",s(()=>this.userInteracting,"isUserInteracting"));h(this,"getPosition",s(()=>new Pe(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));h(this,"getPedestal",s(()=>this.orbit.position.z,"getPedestal"));h(this,"pan",s((r,n)=>{isNaN(r)||isNaN(n)||(this.setPosition(this.orbit.position.x+r,this.orbit.position.y+n),this.publish("position-updated"))},"pan"));h(this,"postRender",s(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));h(this,"isCameraMoving",s(()=>this.cameraMoving,"isCameraMoving"));h(this,"lastCameraStoppedMovingTime",s(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));h(this,"setPosition",s((r,n)=>{r===void 0||n===void 0||isNaN(r)||isNaN(n)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(r,n),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));h(this,"updateCameraPosition",s((r,n)=>{let o=r-this.panBounds.center.x,i=n-this.panBounds.center.y,a=Math.sqrt(o*o+i*i);if(this.stayInsideBounds&&a>this.panBounds.radius){let l=Math.atan2(i,o),c={x:Math.cos(l)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(l)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=c.x,this.orbit.position.y=c.y}else this.orbit.position.x=r,this.orbit.position.y=n},"updateCameraPosition"));h(this,"tilt",s(r=>{if(isNaN(r))return;this.state===-1&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(r+this.getTilt(),this.maxTilt),this.minTilt):r+this.getTilt();n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"tilt"));h(this,"zoomIn",s((r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i/1.5},r,n,o)},"zoomIn"));h(this,"zoomOut",s((r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i*1.5},r,n,o)},"zoomOut"));h(this,"getRotation",s(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));h(this,"cancelAnimation",s(()=>{let r=Array.from(this.tweens.keys()),n=r[r.length-1];n.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(n)},"cancelAnimation"));h(this,"animateCamera",s((r,n,o,i,a,l)=>{let c={interruptible:!0,...l},p={},f={},m=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(p.x=m.x,f.x=r.position.x),r.position.y!==void 0&&(p.y=m.y,f.y=r.position.y),r.position.z!==void 0&&(p.z=m.z,f.z=r.position.z)),r.zoom!==void 0&&(p.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.zoom=r.zoom:f.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:M,end:w}=P0(this.getRotation(),r.rotation);p.rotation=M,f.rotation=w}r.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.tilt=r.tilt:f.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let y=p.zoom!==f.zoom,v=p.rotation!==f.rotation,x=p.tilt!==f.tilt,S=new Co(p).to(f,b.env.TESTING?0:n).onUpdate(M=>{this.setMulti({x:M.x,y:M.y,z:M.z},M.zoom,M.rotation,M.tilt)}).onComplete(()=>{this.completeTween(S),this.publish("multi-end",{zooming:y,rotating:v,tilting:x}),i&&i()}).onStart(()=>{this.state!==7&&(this.state=7,S.state=7,this.publish("multi-start",{zooming:y,rotating:v,tilting:x})),this.publish("change")});this.rendererState.tweenGroup.add(S);let I=Array.from(this.tweens.entries()),P=I[I.length-1],T=!1;return P!=null&&(P[1].interruptible?(typeof P[1].cancelledCallback=="function"&&P[1].cancelledCallback(),this.completeTween(P[0])):(T=!0,P[0].chain(S))),this.tweens.set(S,{cancelledCallback:a,interruptible:c.interruptible}),o?S.easing(o):S.easing(kr.Quadratic.In),!r.doNotAutoStart&&!T&&(S.start(),this.publish("change")),S.cameraAnimation=!0,S},"animateCamera"));h(this,"setMulti",s((r,n,o,i,a=!0)=>{this.state===-1&&this.publish("multi-start");let l=!1;r!=null&&(r.x!==void 0&&!isNaN(r.x)&&r.y!==void 0&&!isNaN(r.y)&&(this.updateCameraPosition(r.x,r.y),l=!0),r.z!==void 0&&!isNaN(r.z)&&(this.setPedestal(r.z,!0),l=!0)),l&&this.publish("position-updated");let c={zooming:!1,tilting:!!n,rotating:!1};if(n!==void 0&&!isNaN(n)){let p=this.stayInsideBounds?Math.min(Math.max(n,this.getZoomScaledMin()),this.getZoomScaledMax()):n;p!==this.camera.position.z&&(c.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>zb&&(this.camera.near=n-zb,this.camera.far=n+zb):(this.camera.near=n/oh,this.camera.far=n*oh),this.camera.updateProjectionMatrix())}if(o!==void 0&&!isNaN(o)&&o!==this.getRotation()&&(c.rotating=!0,this.orbit.rotation.z=-o,this.publish("rotation-updated")),i!==void 0&&!isNaN(i)){let p=this.stayInsideBounds?Math.max(Math.min(i,this.maxTilt),this.minTilt):i;p!==this.elevation.rotation.x&&(c.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",c)},"setMulti"));h(this,"getZoomScaledMin",s(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));h(this,"getZoomScaledMax",s(()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)},"getZoomScaledMax"));h(this,"setRotation",s((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let o=-(r%GE);o!==this.orbit.rotation.z&&(this.orbit.rotation.z=o,n||this.publish("rotation-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0},"setRotation"));h(this,"setZoomAltitude",s(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.stayInsideBounds?Math.min(Math.max(r,this.getZoomScaledMin()),this.getZoomScaledMax()):r;n!==this.camera.position.z&&(this.camera.position.z=n,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=n/oh,this.camera.far=n*oh,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));h(this,"setZoomLevel",s(r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))},"setZoomLevel"));h(this,"getZoomAltitude",s(()=>this.camera.position.z,"getZoomAltitude"));h(this,"getZoomLevel",s(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));h(this,"setTilt",s((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let o=this.stayInsideBounds?Math.max(Math.min(r,this.maxTilt),this.minTilt):r;o!==this.elevation.rotation.x&&(this.elevation.rotation.x=o,n||this.publish("tilt-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0},"setTilt"));h(this,"getTilt",s(()=>this.elevation.rotation.x,"getTilt"));h(this,"setCameraPlaneElevation",s(r=>{this.cameraPlane.position.z=r},"setCameraPlaneElevation"));h(this,"zoom",s(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.getZoomAltitude()-r;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(n,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):n,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")},"zoom"));h(this,"getProjectionScaleFactor",s((r,n,o)=>w3(r,n,o),"getProjectionScaleFactor"));h(this,"update",s(()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));h(this,"setPedestal",s((r,n=!1)=>{typeof r=="number"&&!isNaN(r)&&(this.orbit.position.z=r,n&&(this.publishPedestalChangeEvent(r),this.publish("pedestal-change",{pedestal:r})),this.publish("change"),this.dirty=!0)},"setPedestal"));h(this,"dispose",s(()=>{for(let r of gS)r.endsWith("start")?(this.off(r,this.setCameraMoving),r.startsWith("user")&&this.off(r,this.setUserInteracting)):(r.endsWith("end")||r.endsWith("cancel"))&&(this.off(r,this.unsetCameraMoving),r.startsWith("user")&&this.off(r,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));h(this,"createCameraPlane",s(()=>{let r=bS?2e3:1e10,n=bS?100:1,o=new Oi(r,r,n,n),i=new jr({color:0,wireframe:bS,visible:bS}),a=new ze(o,i);return this.scene.add(a),a},"createCameraPlane"));h(this,"addEventListeners",s(()=>{let{domElement:r}=this.renderer;for(let n of gS)n.endsWith("start")?(this.on(n,this.setCameraMoving),n.startsWith("user")&&this.on(n,this.setUserInteracting)):(n.endsWith("end")||n.endsWith("cancel"))&&(this.on(n,this.unsetCameraMoving),n.startsWith("user")&&this.on(n,this.unsetUserInteracting));r.addEventListener("contextmenu",this.onContextMenu,!1),r.addEventListener("mousedown",this.onMouseDown,!1),r.addEventListener("wheel",this.onMouseWheel,{passive:!1}),r.addEventListener("touchstart",this.onTouchStart,!1),r.addEventListener("touchend",this.onTouchEnd,!1),r.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));h(this,"addMouseEventListeners",s(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));h(this,"addMouseMoveEventListeners",s(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));h(this,"removeMouseMoveEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));h(this,"removeEventListeners",s(()=>{let{domElement:r}=this.renderer;r.removeEventListener("contextmenu",this.onContextMenu,!1),r.removeEventListener("mousedown",this.onMouseDown,!1),r.removeEventListener("wheel",this.onMouseWheel,!1),r.removeEventListener("touchstart",this.onTouchStart,!1),r.removeEventListener("touchend",this.onTouchEnd,!1),r.removeEventListener("touchmove",this.onTouchMove,!1),r.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));h(this,"removeMouseUpEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));h(this,"onContextMenu",s(r=>{r.preventDefault()},"onContextMenu"));h(this,"onMouseUp",s(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1,this.panDirty=!1}},"onMouseUp"));h(this,"onMouseMove",s(r=>{if(this.enabled!==!1)if(r.preventDefault(),this.mouseToScene(r),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(r)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(r)},"onMouseMove"));h(this,"onTouchStart",s(r=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(r),r.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(r),this.state=9):this.enablePan&&(this.handleTouchStartPan(r),this.state=6);break;case 2:this.touch.inputs=new fS(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));h(this,"onTouchMove",s(r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n={...this.touch.inputs.first},o={...this.touch.inputs.second},i=new _e(this.touch.touches[0].x,this.touch.touches[0].y),a=new _e(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(r);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let l=n.y<i.y&&o.y<a.y,c=n.y>i.y&&o.y>a.y;this.enableRotate&&this.state!==4&&(c||l)?(this.handleTouchStartTilt(r),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(r.preventDefault(),r.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(r):this.enablePan&&this.state===6&&this.handleTouchMovePan(r);break;default:this.state=-1}},"onTouchMove"));h(this,"onTouchEnd",s(r=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}r.touches.length?this.onTouchStart(r):this.state=-1}},"onTouchEnd"));h(this,"handleTouchMovePan",s(r=>{let n=Object.hasOwn(r,"x")?new _e(r.x,r.y):this.touch.touches[0],o=this.raycastToFloor(n);this.coords.panEnd.set(o.x,o.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleTouchMovePan"));h(this,"handleTouchStartDolly",s(()=>{let r=this.touch.touches[0].x-this.touch.touches[1].x,n=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let o=new _e(this.touch.touches[0].x-r/2,this.touch.touches[0].y-n/2);this.coords.floorAnchor=this.raycastToFloor(o),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Vb(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Vb(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")},"handleTouchStartDolly"));h(this,"handleMouseMovePan",s(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(r.x,r.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleMouseMovePan"));h(this,"handleTouchStartTilt",s(r=>{this.coords.rotateStart.set(r.touches[1].clientX,r.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));h(this,"handleTouchMovePedestal",s(r=>{this.handleMouseMovePedestal(r.touches[0])},"handleTouchMovePedestal"));h(this,"handleTouchMoveTilt",s(r=>{this.coords.rotateEnd.set(r.touches[1].clientX,r.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));h(this,"handleTouchMoveDolly",s(()=>{let r=this.touch.inputs.first,n=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:r.x,y:r.y},this.touch.anchor2.viewCoordinate={x:n.x,y:n.y};let o=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);o&&this.setCameraFromTransformMatrix(o),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,r),this.touch.anchor2.updateAnchorState(this.camera,n)},"handleTouchMoveDolly"));h(this,"handleTouchEnd",s(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));h(this,"handleTouchStartPan",s(r=>{let n=Object.hasOwn(r,"x")?new _e(r.x,r.y):this.touch.touches[0],o=this.raycastToFloor(n);this.coords.panStart.set(o.x,o.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));h(this,"handleTouchStartPedestal",s(r=>{this.handleMouseDownPedestal(r.touches[0])},"handleTouchStartPedestal"));h(this,"onMouseDown",s(r=>{if(this.enabled!==!1){if(this.mouseToScene(r),r.preventDefault(),this.state===3&&this.publish("zoom-end"),r.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(r),this.state=0}else r.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(r),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));h(this,"onMouseWheel",s(r=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(r.preventDefault(),r.stopPropagation(),this.mouseToScene(r),this.canScrollZoom(r)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(r)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(r))},"onMouseWheel"));h(this,"handleMouseWheel",s(r=>{if(this.publish("zoom-start"),!this.canScrollZoom(r)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let n=this.getZoomAltitude(),o=n-RE(r)*n/UE*this.zoomSpeed;if(this.setZoomAltitude(o),this.enablePan){let i=o/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-i),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));h(this,"setCameraFromTransformMatrix",s(r=>{this.orbit.updateMatrixWorld();let n=new Ma;n.setFromRotationMatrix(r,"ZYX");let o=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),i=n.z,a=new Pe(0,0,1);a.applyEuler(n),a.setLength(o);let l=new Pe;l.setFromMatrixPosition(r),l.sub(a),this.enablePan&&this.setPosition(l.x,l.y),this.enableZoom&&this.setZoomAltitude(o),this.enableRotate&&this.setRotation(-i)},"setCameraFromTransformMatrix"));h(this,"makeTransformFromTouchAnchors",s((r,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let o=this.camera.projectionMatrix.clone(),i=r.worldCoordinate,a=n.worldCoordinate,l=r.reUnproject(),c=n.reUnproject();if(!l||!c||!i||!a)return null;let p=r.viewCoordinate,f=n.viewCoordinate,m=a.x-i.x,y=a.y-i.y,v=Math.atan2(y,m),x=c.x-l.x,S=c.y-l.y,I=Math.atan2(S,x),P=zJ(v,I),T=new wi;T.makeRotationZ(-P);let M=T.clone();M.multiply(r.snapHolderMatrix);let w=s((Hee,Wee,qee)=>Hee.elements[(Wee-1)*4+qee-1],"m"),E=w(o,1,1)*w(M,1,1)-p.x*w(o,3,4)*w(M,3,1),B=w(o,1,1)*w(M,1,2)-p.x*w(o,3,4)*w(M,3,2),D=w(o,1,1)*w(M,1,3)-p.x*w(o,3,4)*w(M,3,3),F=i.x*E+i.y*B+i.z*D,L=w(o,2,2)*w(M,2,1)-p.y*w(o,3,4)*w(M,3,1),H=w(o,2,2)*w(M,2,2)-p.y*w(o,3,4)*w(M,3,2),U=w(o,2,2)*w(M,2,3)-p.y*w(o,3,4)*w(M,3,3),G=i.x*L+i.y*H+i.z*U,J=w(o,1,1)*w(M,1,1)-f.x*w(o,3,4)*w(M,3,1),X=w(o,1,1)*w(M,1,2)-f.x*w(o,3,4)*w(M,3,2),ie=w(o,1,1)*w(M,1,3)-f.x*w(o,3,4)*w(M,3,3),ee=a.x*J+a.y*X+a.z*ie,be=w(o,2,2)*w(M,2,1)-f.y*w(o,3,4)*w(M,3,1),ve=w(o,2,2)*w(M,2,2)-f.y*w(o,3,4)*w(M,3,2),de=w(o,2,2)*w(M,2,3)-f.y*w(o,3,4)*w(M,3,3),Ae=a.x*be+a.y*ve+a.z*de,gt=Math.abs(J-E),st=Math.abs(X-B),Ye=Math.abs(ie-D),Ve=Math.abs(J-L),fe=Math.abs(X-H),he=Math.abs(ie-U),re=Math.abs(be-E),se=Math.abs(ve-B),k=Math.abs(de-D),K=Math.abs(be-L),R=Math.abs(ve-H),ce=Math.abs(de-U),oe=Math.min(gt+st+Ye,Ve+fe+he),le=Math.min(re+se+k,K+R+ce);oe<le&&(J=be,X=ve,ie=de,ee=Ae);let xe=L*D-E*U,pr=H*D-B*U,Gn=G*D-F*U,nn=J*U-L*ie,In=X*U-H*ie,yu=ee*U-G*ie,f3=(yu*pr-Gn*In)/(nn*pr-xe*In),m3=(yu*xe-Gn*nn)/(In*xe-pr*nn),X9=H*E-B*L,Uee=U*E-D*L,Vee=G*E-F*L,Y9=X*L-H*J,zee=ie*L-U*J,K9=((ee*L-G*J)*X9-Vee*Y9)/(zee*X9-Uee*Y9),m0=M.clone();return m0.elements[12]=f3,m0.elements[13]=m3,m0.elements[14]=K9,K9>0?m0:null},"makeTransformFromTouchAnchors"));h(this,"updateTouchOrigin",s(()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top},"updateTouchOrigin"));h(this,"touchToScene",s(r=>{this.touch.touches=[];for(let n=0,o=r.touches.length;n<o;n++){let i=r.touches[n],a=HJ(i,this.touch.origin);this.touch.touches.push(new _e(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));h(this,"canScrollZoom",s(r=>{let n=RE(r),o=this.getZoomAltitude();return!(n<0&&o===this.getZoomScaledMax()||n>0&&o===this.getZoomScaledMin())},"canScrollZoom"));h(this,"mouseToScene",s(r=>{let n=this.getMousePos(r);return this.coords.mouse.x=n.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(n.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));h(this,"getMousePos",s(r=>({x:r.offsetX,y:r.offsetY}),"getMousePos"));h(this,"handleMouseDownRotate",s(r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));h(this,"handleMouseDownPan",s(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(r.x,r.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));h(this,"handleMouseDownPedestal",s(r=>{let n=new _e(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=w3(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));h(this,"handleMouseMovePedestal",s(r=>{let n={x:r.clientX,y:r.clientY},o=this.coords.initialPedestal+this.pedestalScaleFactor*(n.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(o<this.minPedestal?o=Math.max(o,this.minPedestal):o>this.maxPedestal&&(o=Math.min(o,this.maxPedestal))),o!==this.getPedestal()&&this.setPedestal(o,!0)},"handleMouseMovePedestal"));h(this,"handleMouseMoveRotate",s(r=>{this.coords.rotateEnd.set(r.clientX,r.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));h(this,"publishUserZoomDebounced",Ld(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));h(this,"publishUserZoomEvent",s(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));h(this,"setCameraMoving",s(()=>{this.cameraMoving=!0},"setCameraMoving"));h(this,"unsetCameraMoving",s(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));h(this,"setUserInteracting",s(()=>{this.userInteracting=!0},"setUserInteracting"));h(this,"unsetUserInteracting",s(()=>{this.userInteracting=!1},"unsetUserInteracting"));h(this,"publishPedestalChangeEvent",s(r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));h(this,"convertAltitudeToZoomLevel",s(r=>{let[,n]=this.center,i=r*2*Math.tan(Ke.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(Ke.degToRad(n))*2*Math.PI*h3/i;return Ke.clamp(Math.log2(a/512),hS,yS)},"convertAltitudeToZoomLevel"));h(this,"convertZoomLevelToAltitude",s(r=>{let[,n]=this.center,o=Ke.clamp(r,hS,yS),i=Math.pow(2,o),a=Ke.clamp(n,$E,jE),l=i*512;return Math.cos(Ke.degToRad(a))*Math.PI*2*h3/l*this.options.canvasHeight/2/Math.tan(Ke.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));h(this,"completeTween",s(r=>{r.isPlaying()&&r.stop(),this.rendererState.tweenGroup.remove(r),this.tweens.delete(r)},"completeTween"));h(this,"debugContainer",new Oa);this.camera=r,this.renderer=o,this.rendererState=i,this.scene=n,this.options=a,this.elevation=r.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=r.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(r){this.minZoomAltitude=this.convertZoomLevelToAltitude(r)}get defaultMinZoomLevel(){return u(this,vS)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(r){this.maxZoomAltitude=this.convertZoomLevelToAltitude(r)}get scrollPercent(){let r=this.minPedestal,n=this.maxPedestal,o=this.getPedestal();return o=Math.min(o,n),o=Math.max(o,r),(o-r)/(n-r)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var i,a,l,c;let r=this.getPosition(),{lat:n,lon:o}=M0((a=(i=this.rendererState.center)==null?void 0:i[1])!=null?a:0,(c=(l=this.rendererState.center)==null?void 0:l[0])!=null?c:0,r.x,r.y);return[o,n]}setCenter(r,n){var a,l,c,p;let{x:o,y:i}=O0((l=(a=this.rendererState.center)==null?void 0:a[1])!=null?l:0,(p=(c=this.rendererState.center)==null?void 0:c[0])!=null?p:0,n,r);this.setPosition(o,i)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(r=>r.cameraAnimation)}getCameraFrameForCoordinates(r,n){let o=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,i=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,a=this.options.canvasWidth,l=this.options.canvasHeight,c=this.getRotation(),p=this.getTilt(),f=this.getPosition();this.setRotation(n.rotation||c,!0),this.setTilt(n.tilt||p,!0);let m=qJ(r,{canvasWidth:a,canvasHeight:l,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:o,maxZoom:i,position:f,camera:this.camera,orbit:this.orbit});return this.setRotation(c,!0),this.setTilt(p,!0),{center:m.position,zoomLevel:this.convertAltitudeToZoomLevel(m.zoom)}}focusOn(r,n){if(AMe){this.debugContainer&&hr(this.debugContainer);let I=new Mi(4,4,4),P=new jr({color:65280,depthTest:!1}),T=new Yl(I,P,r.length),M=new wi;r.forEach((w,E)=>{M.setPosition(w),T.setMatrixAt(E,M)}),T.instanceMatrix.needsUpdate=!0,this.debugContainer.add(T),this.scene.add(this.debugContainer)}let o=n.curve,i=n.callback,a=n.cancelledCallback,l=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,c=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,p=this.options.canvasWidth,f=this.options.canvasHeight,m;n.duration!==void 0?m=n.duration:b.env.TESTING==="true"?m=0:m=VE;let y=n.padding,v=this.getRotation(),x=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let S=qJ(r,{canvasHeight:f,paddingOption:y,canvasWidth:p,minZoom:l,maxZoom:c,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(v),this.setTilt(x),this.animateCamera({position:S.position,tilt:n.tilt,rotation:n.rotation,zoom:S.zoom},m,o,i,a,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};vS=new WeakMap,s(xS,"CameraSystem"),h(xS,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var ih=xS;function qJ(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:o=0,canvasHeight:i,minZoom:a,maxZoom:l,camera:c,position:p}){let f={zoom:a,position:p};if(e.length===0)return f;for(let xe of ih.CAMERA_FRAME_PADDING_SIDES)typeof n[xe]!="number"&&(n[xe]=0);let m=n.type==="portion"?{top:n.top*i,bottom:n.bottom*i,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(m.left+m.right>=t||m.top+m.bottom>=i)return f;r.updateMatrixWorld();let y=c.matrixWorldInverse,v=c.fov*(Math.PI/180)/2,x=v,I=Math.atan(Math.tan(v)*(t/i)),P=new Pe(1/0,1/0,1/0),T=new Pe(-1/0,-1/0,-1/0),M=new Jr,w=new Pe;for(let xe=0,pr=e.length;xe<pr;xe++)w.copy(e[xe]),M.expandByPoint(w),w.applyMatrix4(y),P.min(w),T.max(w),w.copy(e[xe]),w.z-=o,w.applyMatrix4(y),P.min(w),T.max(w),w.copy(e[xe]),w.z+=o,w.applyMatrix4(y),P.min(w),T.max(w);let E=T.x-P.x,B=T.y-P.y,D=t-m.left-m.right,F=i-m.top-m.bottom,L=(T.x+P.x)/2,H=(T.y+P.y)/2,U=E/D,G=B/F,J=a,X=l,ie=J*Math.tan(I)*2,ee=X*Math.tan(I)*2,be=ie/t,ve=ee/t,de=Math.max(U,G);de=Ke.clamp(de,be,ve);let Ae=D*de,gt=F*de,st={min:{x:L-Ae/2-m.left*de,y:H-gt/2-m.bottom*de},max:{x:L+Ae/2+m.right*de,y:H+gt/2+m.top*de}},Ye=(st.min.x+st.max.x)/2,Ve=(st.min.y+st.max.y)/2,fe=M.getCenter(new Pe),he=Math.abs(Ye-st.min.x),re=Math.abs(Ve-st.min.y),se=he/Math.tan(I),k=re/Math.tan(x),K=new Pe;K.set(Ye,Ve,T.z+Math.max(se,k)),K.applyMatrix4(c.matrixWorld);let R=new Pe;R.set(Ye,Ve,T.z),R.applyMatrix4(c.matrixWorld);let ce=new Pe().subVectors(R,K),oe=(fe.z-K.z)/ce.z,le=new Pe().copy(K).add(ce.clone().multiplyScalar(oe));return R.set(le.x,le.y,le.z),K.sub(R),{position:le,zoom:K.length()}}s(qJ,"getCameraFrameForPoints");d();var kMe=300,Hb,Wb,HE=class HE{constructor(t){h(this,"state");O(this,Hb,new Pe);O(this,Wb,new Pe);this.state=t}update(t){var o;let r,n;this.state.cameraObject.getWorldPosition(u(this,Wb));for(let i of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(i),r&&(n=r.components[0],n&&"containerEl"in n&&n.markerContainer!=null)){if(n.visibilityNeedsUpdate!==!1&&(n.visibilityNeedsUpdate==="show"?n.canShow=!0:n.canShow=!1),(n.canShow&&n.visible===!0||((o=n.animation)==null?void 0:o.pending)===!0)&&!n.offscreen)if(n.options.zIndex!=null)n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(n.options.zIndex,"px)");else{r.object3d.getWorldPosition(u(this,Hb));let a=u(this,Wb).distanceTo(u(this,Hb));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-a,"px)")}if(n.canShow===!0&&n.visible===!0?n.markerContainer.style.pointerEvents=t?"none":n.pointerEvents:n.markerContainer.style.pointerEvents="none",n.currentStrategyIndex===-1&&n.visible&&n.visibilityNeedsUpdate==="show")continue;n.visibilityNeedsUpdate!==!1&&!n.offscreen&&(n.visibilityNeedsUpdate==="show"&&(n.markerContainer.style.opacity="0"),n.animation&&n.animation.cancel(),n.animation=n.markerContainer.animate([{opacity:n.canShow&&n.visible?"1":"0"}],{duration:kMe,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};Hb=new WeakMap,Wb=new WeakMap,s(HE,"DOMDrawSystem");var IS=HE;d();var WE=class WE{constructor(){h(this,"percentExpanded",0);h(this,"activeId","");h(this,"gap",20);h(this,"dirty",!0)}};s(WE,"StackComponent");var SS=WE;d();var qE=class qE extends Fe{constructor(r,n){super();h(this,"state");h(this,"dirty",!0);h(this,"domTree");h(this,"observers",new Map);h(this,"updateDimensions",s(r=>{r.forEach(n=>{var a;let i=(a=n.target.parentElement)==null?void 0:a.getAttribute("data-marker-id");if(i){let l=this.state.geometry2DMap.get(i),c=l==null?void 0:l.components[0];l&&c instanceof la&&(c.updateDimensions(n.contentRect.width,n.contentRect.height),c.collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=r,this.domTree=n}setupObserver(){var o;if(this.observers){for(let i of this.observers.values())i.disconnect();this.observers.clear()}let r,n;for(let i of this.domTree.children){let a=i.getAttribute("data-marker-id");if(a!=null&&(r=this.state.geometry2DMap.get(a),n=r.components[0],(o=n.options)!=null&&o.dynamicResize)){let l=new ResizeObserver(this.updateDimensions);l.observe(n.containerEl),this.observers.set(i.userData.entityId,l)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let r of this.observers.values())r.disconnect();this.observers.clear()}};s(qE,"DOMResizeSystem");var CS=qE;d();var DMe=0,FMe=90,LMe=(b.env.NODE_ENV==="test",!1),Ol={linear:kr.Linear.None,"ease-in":kr.Quadratic.In,"ease-out":kr.Quadratic.Out,"ease-in-out":kr.Quadratic.InOut},RMe=-50,Te,Be,Zc,qb,Zb,XE,YE=class YE{constructor(t,r,n){O(this,Zb);O(this,Te);O(this,Be);O(this,Zc);O(this,qb);A(this,Te,t),A(this,Be,r),A(this,Zc,n),u(this,Be).cameraSystem.on("pedestal-change",({pedestal:o})=>{u(this,Te).map&&(u(this,Te).map.transform.elevation=o,u(this,Te).map.transform.minElevationForCurrentTile=RMe,u(this,Te).map.triggerRepaint()),u(this,Be).cameraSystem.setCameraPlaneElevation(o)})}get center(){return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?u(this,Te).map.getCenter().toArray():u(this,Be).cameraSystem.center}setCenter(t){var r;if(u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map){(r=u(this,Te).map)==null||r.setCenter(t),u(this,Be).interactionSystem.handleHover();return}u(this,Be).cameraSystem.setCenter(t[0],t[1]),u(this,Be).interactionSystem.handleHover()}get zoomLevel(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getZoom():u(this,Be).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map&&((r=u(this,Te).map)==null||r.setZoom(t)),u(this,Be).cameraSystem.setZoomLevel(Is(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return u(this,Be).cameraSystem.isAnimating}cancelAnimation(){u(this,Be).cameraSystem.cancelAnimation()}get maxZoomLevel(){return u(this,Be).cameraSystem.maxZoomLevel}get minZoomLevel(){return u(this,Be).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){u(this,Be).panBoundsSystem.autoMinZoomLevel=t,t&&(u(this,Be).panBoundsSystem.dirty=!0,u(this,Be).panBoundsSystem.update())}get autoMinZoomLevel(){return u(this,Be).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var o;r&&this.setAutoMinZoomLevel(!1);let n=Is(t,Si.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Si.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));u(this,Be).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(o=u(this,Te).map)==null||o.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=Is(t,this.minZoomLevel,Si.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Si.MAX_MERCATOR_ZOOM_LEVEL,"."));u(this,Be).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=u(this,Te).map)==null||n.setMaxZoom(r)}get maxPitch(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getMaxPitch():Ke.radToDeg(u(this,Be).cameraSystem.maxTilt)}get minPitch(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getMinPitch():Ke.radToDeg(u(this,Be).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max(DMe,t);(n=u(this,Te).map)==null||n.setMinPitch(r),u(this,Be).cameraSystem.minTilt=Ke.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(FMe,t);(n=u(this,Te).map)==null||n.setMaxPitch(r),u(this,Be).cameraSystem.maxTilt=Ke.degToRad(r)}get bearing(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getBearing():Ke.radToDeg(u(this,Be).cameraSystem.getRotation())}setBearing(t){var r;if(u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map){(r=u(this,Te).map)==null||r.setBearing(t);return}u(this,Be).cameraSystem.setRotation(Ke.degToRad(t))}get pitch(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getPitch():Ke.radToDeg(u(this,Be).cameraSystem.getTilt())}setPitch(t){var r;if(u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map){(r=u(this,Te).map)==null||r.setPitch(t);return}u(this,Be).cameraSystem.setTilt(Ke.degToRad(Is(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return u(this,Be).cameraSystem.getPedestal()}setElevation(t){u(this,Be).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return u(this,qb)&&u(this,qb).stop(),new Promise(n=>{var i;let o=u(this,Be).cameraSystem.getPosition();o.z=t,u(this,Be).cameraSystem.animateCamera({position:o},(r==null?void 0:r.duration)||300,Ol[(r==null?void 0:r.easing)||"ease-in-out"],n,n,{interruptible:(i=r==null?void 0:r.interruptible)!=null?i:!0})})}get insetsPadding(){return u(this,Zc).insetsPadding}get panMode(){return u(this,Be).cameraSystem.enablePan===!1&&u(this,Be).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(u(this,Be).cameraSystem.enablePan=!0,u(this,Be).cameraSystem.enablePedestal=!1):(u(this,Be).cameraSystem.enablePan=!1,u(this,Be).cameraSystem.enablePedestal=!0))}setInsetPadding(t){u(this,Zc).insetsPadding=Object.assign({},Jh,t)}animateTo(t){var a,l,c,p,f,m;if(u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map)return(m=u(this,Te).map)==null||m.flyTo({center:(a=t.center)!=null?a:this.center,zoom:(l=t.zoomLevel)!=null?l:this.zoomLevel,bearing:(c=t.bearing)!=null?c:this.bearing,pitch:(p=t.pitch)!=null?p:this.pitch,duration:(f=t.duration)!=null?f:600}),Promise.resolve();let r=t.center?u(this,Te).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?u(this,Be).cameraSystem.convertZoomLevelToAltitude(Is(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,o=t.bearing!==void 0?Ke.degToRad(t.bearing):void 0,i=t.pitch!==void 0?Ke.degToRad(Is(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(y=>{var v;u(this,Be).cameraSystem.animateCamera({position:r,zoom:n,rotation:o,tilt:i},t.duration||0,Ol[t.easing||"ease-in-out"],()=>{u(this,Be).interactionSystem.handleHover(),y()},y,{interruptible:(v=t==null?void 0:t.interruptible)!=null?v:!0})})}getCameraFrameForCoordinates(t,r){let n=te(this,Zb,XE).call(this,r||{},()=>Promise.resolve()),{pointCloud:o}=ZJ(t,u(this,Te),u(this,Zc).geometry3DMap);if(o.length===0)return j.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:i,zoomLevel:a}=u(this,Be).cameraSystem.getCameraFrameForCoordinates(o,n);return{center:u(this,Te).convert3DMapPositionToCoordinate(i),zoomLevel:a}}focusOn(t,r){var a,l,c,p;let{pointCloud:n,geoBounds:o,firstPosition:i}=ZJ(t,u(this,Te),u(this,Zc).geometry3DMap);return n.length===0?(j.error("No valid coordinates found in targets:",t),Promise.resolve()):u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(n.length===1&&i?(a=u(this,Te).map)==null||a.flyTo({center:[i[0],i[1]],duration:(r==null?void 0:r.duration)||u(this,Te).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?u(this,Te).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?u(this,Te).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||u(this,Te).map.getMaxZoom()}):(LMe&&NMe(u(this,Te),o),(p=u(this,Te).map)==null||p.fitBounds(o,{duration:(l=r==null?void 0:r.duration)!=null?l:Si.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?u(this,Te).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?u(this,Te).map.getPitch():r==null?void 0:r.pitch,maxZoom:(c=r==null?void 0:r.maxZoomLevel)!=null?c:u(this,Te).map.getMaxZoom()})),u(this,Be).interactionSystem.handleHover(),Promise.resolve()):new Promise(f=>{u(this,Be).cameraSystem.focusOn(n,te(this,Zb,XE).call(this,r||{},f))})}};Te=new WeakMap,Be=new WeakMap,Zc=new WeakMap,qb=new WeakMap,Zb=new WeakSet,XE=s(function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:u(this,Be).cameraSystem.convertZoomLevelToAltitude(Is(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:u(this,Be).cameraSystem.convertZoomLevelToAltitude(Is(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},Jh,t==null?void 0:t.padding):this.insetsPadding,curve:Ol[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Ke.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Ke.degToRad(Is(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:s(()=>{u(this,Be).interactionSystem.handleHover(),r()},"callback"),cancelledCallback:r,interruptible:(n=t==null?void 0:t.interruptible)!=null?n:!0,verticalPadding:t==null?void 0:t.verticalPadding}},"#convertToLegacy"),s(YE,"Camera");var PS=YE;function ZE(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}s(ZE,"updateBounds");function ZJ(e,t,r){var l;let n=[],o=[1/0,1/0,-1/0,-1/0],i=null;if(!e||!Array.isArray(e)||e.length===0)return{pointCloud:n,geoBounds:o,firstPosition:i};let a=t.getSystems().renderSystem;(a.threeDdirty||a.twoDdirty)&&t.renderSync();for(let c of e)if(typeof c=="string"){let p=r.get(c);if(!p){j.error("Entity not found with id:",c);continue}let f=new Jr;$8(t,"userData"in p&&(l=p.userData.entityId)!=null?l:p.id,n,f,p instanceof ut?p.position.z:void 0);let m=t.convert3DMapPositionToCoordinate(f.min),y=t.convert3DMapPositionToCoordinate(f.max);ZE(o,m),ZE(o,y),i||(i=t.convert3DMapPositionToCoordinate(f.getCenter(new Pe)))}else n.push(t.convertTo3DMapPosition(c[1],c[0],c[2]||0)),ZE(o,c),i||(i=c);return{pointCloud:n,geoBounds:o,firstPosition:i}}s(ZJ,"processTargets");function NMe(e,t){var n,o,i,a;let r=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(n=e.map)!=null&&n.getLayer("bounds-outline")&&e.map.removeLayer("bounds-outline"),(o=e.map)!=null&&o.getSource("bounds-source")&&e.map.removeSource("bounds-source"),(i=e.map)==null||i.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:r}}}),(a=e.map)==null||a.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}s(NMe,"drawBounds");d();var XJ="uniform vec4 uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n // Scale the position by the size of the quad\n // and shift to top left corner for 0,0\n vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);\n // Apply width .x and height .y of image\n transformed += vec2(uSize.x, -uSize.y);\n // Apply left .w and top .z offset\n transformed += vec2(uSize.w, -uSize.z) * 2.0;\n gl_Position = vec4(transformed, 1.0, 1.0);\n}";var YJ="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";d();var KJ=4.291666666666667,JJ=15,QJ=25,eQ=43/60;d();var tQ=["horizontal","icon"],jMe=new Map([[tQ[0],'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z"/>\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z"/>\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z"/>\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z"/>\n </svg>'],[tQ[1],'<svg viewBox="0 0 43 60">\n <path d="M14.0291 7.06645C14.0291 10.9691 10.8885 14.1329 7.01453 14.1329C3.14051 14.1329 0 10.9691 0 7.06645C0 3.16376 3.14051 0 7.01453 0C10.8885 0 14.0291 3.16376 14.0291 7.06645Z"/>\n <path d="M28.7335 18.3468H35.1045C36.7455 18.3468 37.5178 19.0599 37.5821 20.6158V57.7309C37.5821 59.2868 36.8099 60 35.1367 60H28.9588C27.1569 60 26.642 59.7406 25.6767 58.282L12.6452 38.282V57.7309C12.6452 59.2868 11.8729 60 10.1997 60H3.82873C2.15554 60 1.3833 59.2868 1.3833 57.7309V20.6158C1.3833 19.0599 2.15554 18.3468 3.82873 18.3468H10.1032C11.9051 18.4116 12.4843 18.671 13.3852 20.0648L26.3524 40.162V20.6158C26.3524 19.0599 27.1247 18.3468 28.7335 18.3468Z"/>\n <path d="M41.5 60C42.3362 60 43 59.3143 43 58.5V58.4914C43 57.6771 42.3448 57 41.5 57C40.6638 57 40 57.6857 40 58.5V58.5086C40 59.3229 40.6552 60 41.5 60ZM41.5 59.8371C40.7414 59.8371 40.1724 59.2371 40.1724 58.5086V58.5C40.1724 57.7714 40.75 57.1629 41.5 57.1629C42.2586 57.1629 42.8276 57.7629 42.8276 58.4914V58.5C42.8276 59.2286 42.25 59.8371 41.5 59.8371ZM40.9138 59.2286H41.2069V58.7057H41.5259L41.8879 59.2286H42.2414L41.8362 58.6543C42.0431 58.5943 42.1897 58.44 42.1897 58.1914C42.1897 57.8743 41.9397 57.7114 41.6034 57.7114H40.9138V59.2286ZM41.2069 58.4657V57.9686H41.5776C41.7759 57.9686 41.8879 58.0543 41.8879 58.2171C41.8879 58.3629 41.7759 58.4657 41.5776 58.4657H41.2069Z"/>\n </svg>']]),GMe=/<svg([^>]*)>/g;function rQ(e,t,r,n){let o=jMe.get(e);return o?o.replace(GMe,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}s(rQ,"getLogoIcon");var nQ=!1,Ht,El,sh,Nn,to,td,is,fa,KE=class KE extends Fe{constructor(r,n,o){super();O(this,Ht,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:s(()=>{window!=null&&window.open("https://www.mappedin.com")},"onClick"),interactive:!0,visible:!0});O(this,El);O(this,sh);O(this,Nn);O(this,to);O(this,td);O(this,is,0);O(this,fa,0);h(this,"dirty",!0);h(this,"getPositionAlignedCanvasCoordinates",s((r,n)=>({"top-left":{x:0,y:0},"top-right":{x:r,y:0},"bottom-left":{x:0,y:n},"bottom-right":{x:r,y:n},center:{x:r/2,y:n/2},top:{x:r/2,y:0},bottom:{x:r/2,y:n},left:{x:0,y:n/2},right:{x:r,y:n/2}})[u(this,Ht).position],"getPositionAlignedCanvasCoordinates"));h(this,"getPositionAlignedPadding",s(()=>{var o,i,a,l;let r=u(this,Ht).padding;if(typeof r=="number")return{"top-left":{x:r,y:r},"top-right":{x:-r,y:r},"bottom-left":{x:r,y:-r},"bottom-right":{x:-r,y:-r},center:{x:0,y:0},top:{x:0,y:r},bottom:{x:0,y:-r},left:{x:r,y:0},right:{x:-r,y:0}}[u(this,Ht).position];let n={top:(o=r.top)!=null?o:0,right:(i=r.right)!=null?i:0,bottom:(a=r.bottom)!=null?a:0,left:(l=r.left)!=null?l:0};return{x:n.left-n.right,y:n.top-n.bottom}},"getPositionAlignedPadding"));o&&Object.entries(o).forEach(([i,a])=>{a!==void 0&&(u(this,Ht)[i]=a)}),A(this,sh,r),A(this,El,n)}get color(){return u(this,Ht).color==="light"?"white":"#293136"}get iconName(){return u(this,Ht).iconOnly?"icon":"horizontal"}get minWidth(){return u(this,Ht).iconOnly?JJ:75}get defaultWidth(){return u(this,Ht).iconOnly?QJ:150}get aspectRatio(){return u(this,Ht).iconOnly?eQ:KJ}get options(){return{...u(this,Ht)}}set options(r){var n;A(this,Ht,{padding:r.padding||u(this,Ht).padding,position:r.position||u(this,Ht).position,iconOnly:r.iconOnly||u(this,Ht).iconOnly,color:r.color||u(this,Ht).color,scale:r.scale||u(this,Ht).scale,onClick:u(this,Ht).onClick,interactive:(n=r.interactive)!=null?n:u(this,Ht).interactive,visible:r.visible||u(this,Ht).visible})}get icon(){return rQ(this.iconName,this.color,u(this,is)*u(this,El).pixelRatio,u(this,fa)*u(this,El).pixelRatio)}setSize(r,n){u(this,to)&&(u(this,to).uniforms.uSize.value.x=r,u(this,to).uniforms.uSize.value.y=n)}setXY(r,n){u(this,to)&&(u(this,to).uniforms.uSize.value.w=r,u(this,to).uniforms.uSize.value.z=n)}get width(){return u(this,is)}get height(){return u(this,fa)}getPositionAlignedOffset(r,n){return{"top-left":{x:0,y:0},"top-right":{x:-r,y:0},"bottom-left":{x:0,y:-n},"bottom-right":{x:-r,y:-n},center:{x:-(r/2),y:-(n/2)},top:{x:-(r/2),y:0},bottom:{x:-(r/2),y:-n},left:{x:0,y:-(n/2)},right:{x:-r,y:-(n/2)}}[u(this,Ht).position]}insertIntoQuadTree(r){u(this,td)!=null&&typeof u(this,Ht).onClick=="function"&&u(this,Ht).interactive&&r.insert(u(this,td))}resize(r,n){if(u(this,Ht).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(r,n),i=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(u(this,is),u(this,fa)),l=Math.min(r-u(this,is),Math.max(0,o.x+i.x+a.x)),c=Math.min(n-u(this,fa),Math.max(0,o.y+i.y+a.y));this.setSize(u(this,is)/r,u(this,fa)/n),this.setXY(l/r,c/n),A(this,td,new qr(l,c,u(this,is),u(this,fa),{entityId:"watermark"}))}update(){this.dirty&&u(this,Ht).visible===!0&&(A(this,is,Math.min(u(this,El).canvasWidth,Math.max(this.minWidth,this.defaultWidth*u(this,Ht).scale))),A(this,fa,u(this,is)/this.aspectRatio),Wc.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if(A(this,to,new gu({uniforms:{uTexture:{value:r},uSize:{value:new l8(0,0,0,0)},uOpacity:{value:.7}},vertexShader:XJ,fragmentShader:YJ,depthWrite:!1,depthTest:!1,defines:{debug:nQ},wireframe:nQ,transparent:!0,visible:!0})),u(this,Nn))u(this,Nn).material=u(this,to),u(this,Nn).material.needsUpdate=!0;else{let n=new Oi(2,2,1,1);A(this,Nn,new ze(n,u(this,to))),u(this,Nn).position.set(0,0,-1),u(this,Nn).frustumCulled=!1,u(this,Nn).renderOrder=999;let o=new Mi(1,1,1),i=new ze(o,new jr({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));i.frustumCulled=!1,i.layers.set(1),u(this,Nn).add(i),u(this,sh).add(u(this,Nn))}this.resize(u(this,El).canvasWidth,u(this,El).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){u(this,Nn)&&(u(this,sh).remove(u(this,Nn)),hr(u(this,Nn))),A(this,Nn,void 0),u(this,to)&&u(this,to).dispose(),A(this,to,void 0),A(this,td,void 0)}};Ht=new WeakMap,El=new WeakMap,sh=new WeakMap,Nn=new WeakMap,to=new WeakMap,td=new WeakMap,is=new WeakMap,fa=new WeakMap,s(KE,"WatermarkSystem");var TS=KE;d();var wS=100,zMe=!1,JE=class JE extends Fe{constructor(r,n){super();h(this,"currentTotalBoundingBox");h(this,"state");h(this,"cameraSystem");h(this,"debugMesh",null);h(this,"dirty",!0);h(this,"autoMinZoomLevel",!0);this.state=r,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Jr,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new Pe(0,0,0),new Pe(wS*2,wS*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(wS)));let r=new Jr().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new Pe),o=Math.max(n.x,n.y,n.z);for(let a of this.state.geometry2DMap.values())a.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(a.position),a.positionDirty=!1);let i=MS.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(o,wS)).getBoundingSphere(HMe).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new Pe),min:MS.min,max:MS.max,radius:i},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,zMe&&this.state.entityScene.parent instanceof Xl){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Oa,this.debugMesh.add(new ze(new x0(this.cameraSystem.panBounds.radius),new jr({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let a=new Pe;MS.getSize(a);let l=new Mi(a.x,a.y,a.z),c=new jr({color:65280,wireframe:!0,transparent:!0,opacity:.5}),p=new ze(l,c);p.position.copy(this.currentTotalBoundingBox.getCenter(new Pe)),this.debugMesh.add(p)}}}};s(JE,"PanBoundsSystem");var OS=JE,MS=new Jr,HMe=new u8;d();var oQ="\xA9 Mappedin",WMe="https://info.mappedin.com/feedback",e6=["top-left","top-right","bottom-left","bottom-right"],qMe=640,ZMe=s(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),QE={custom:[],position:"bottom-right",feedback:!0},t6=class t6{constructor(t){h(this,"controlContainerEl");h(this,"controlPositions");h(this,"compact");h(this,"attribContainerEl");h(this,"attribInnerEl");h(this,"attribButtonEl");h(this,"feedbackLinkEl");h(this,"attribHTML",oQ);h(this,"customAttributions",[]);h(this,"toggleAttribution",s(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=e6.reduce((r,n)=>{let o=document.createElement("div");return o.classList.add("mappedin-ctrl-".concat(n)),this.controlContainerEl.appendChild(o),r[n]=o,r},{})}addAttributionControl(t=QE){var o;let r=t.position&&e6.includes(t.position)?t.position:QE.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(r)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[r].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=ZMe(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((o=t.feedback)!=null?o:QE.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=WMe,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let r=[oQ],n=t.style.sourceCaches;for(let o in n){let i=n[o];if(i.used||i.usedForTerrain){let a=i.getSource();a.attribution&&r.indexOf(a.attribution)<0&&r.push(a.attribution)}}r=r.filter(o=>String(o).trim()),r=r.filter((o,i)=>{for(let a=i+1;a<r.length;a++)if(r[a].indexOf(o)>=0)return!1;return!0}),this.attribHTML=r.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=qMe||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};s(t6,"HTMLControlsSystem");var ES=t6;d();var Xb,r6=class r6{constructor(t,r){h(this,"mesh");h(this,"type","custom-geometry");h(this,"dirty",!0);h(this,"feature");h(this,"builder");h(this,"outline");h(this,"color",new Lt);O(this,Xb,0);this.mesh=new _i,this.feature=t,this.builder=r}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){j.warn("TODO: implement custom geometry opacity")}get opacity(){return j.warn("TODO: implement custom geometry opacity"),0}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return u(this,Xb)}set altitude(t){this.mesh&&(this.mesh.position.z=t,A(this,Xb,t))}get renderOrder(){return j.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){j.warn("TODO: implement custom geometry render order")}};Xb=new WeakMap,s(r6,"CustomGeometryComponent");var ah=r6;d();var n6=class n6{constructor(t,r){h(this,"state");h(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=r}update(){let t,r;for(let n of this.state.geometry3DIdsInScene){let o=this.state.geometry3DMap.get(n);(o==null?void 0:o.type)==="custom-geometry"&&(t=o.components[0],r=o.components[1],t.dirty&&r.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],r.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(i=>{i.userData={entityId:n,type:"custom-geometry"}}),t.dirty=!1),r.visible!==!1&&t.builder.update(t.mesh))}}};s(n6,"CustomGeometrySystem");var _S=n6;d();d();function iQ(e){return e.children.some(t=>t.userData.isOutline)}s(iQ,"hasOutline");var KMe=80,rd,lh,kS,DS,o6=class o6{constructor(t){h(this,"rendererState");h(this,"outlineOpacitiesDirty",!0);O(this,rd,!0);O(this,lh,-1/0);O(this,kS,new Map);O(this,DS,new g3({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:y0}));this.rendererState=t}get geometries3DDirty(){return u(this,rd)}set geometries3DDirty(t){A(this,rd,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let i of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(i),n instanceof Sn&&n.components[0].outline&&n.visible&&!iQ(n)&&n.userData.entities3D.size>0)for(let a of n.userData.entities3D.values()){let l=this.rendererState.geometry3DMap.get(a),c=[];if(l instanceof wt&&l.type==="geometry"&&l.components[3]&&l.components[3].dirty===!0&&l.components[0].geometry!=null&&l.components[0].material!=null){let S=l.components[0].geometry;if(!S)return null;c.push([l.components[3],new b3(S,KMe)])}let p=qo(c.map(S=>S[1]),!1);if(p==null)continue;let f=p.getAttribute("position"),m=new Float32Array(f.count*4),y=new Ea(m,4);p.setAttribute("color",y);let v=0;for(let S=0;S<c.length;S++){let[I,P]=c[S],T=P.getAttribute("position").count;I.edgeColors=y,I.geometry=p,I.ranges={count:T,start:v},v+=T,P.dispose()}let x=new _d(p,u(this,DS));x.userData.isOutline=!0,n.add(x)}A(this,rd,!1),this.outlineOpacitiesDirty=!0}for(let i of this.rendererState.geometry3DIdsInScene){let a=this.rendererState.geometry3DMap.get(i);if(a instanceof wt&&a.type==="geometry"&&a.components[3]&&a.components[3].dirty===!0&&a.components[0].geometry!=null&&a.components[0].material!=null&&a.parentObject3D instanceof Sn){let l=a.components[3].geometry;if(!l)continue;let c=a.components[3];if(!c)continue;let p=c.edgeColors;if(!p)continue;let f=new Lt(c.color);for(let S=0;S<c.ranges.count;S++){let I=c.ranges.start+S;p.setXYZ(I,f.r,f.g,f.b)}let m=a.components[1].height,v=l.getAttribute("position").array,x=-1/0;for(let S=0;S<c.ranges.count;S++){let P=(c.ranges.start+S)*3,T=v[P+2];x=Math.max(x,T)}for(let S=0;S<c.ranges.count;S++){let P=(c.ranges.start+S)*3,T=v[P+2];Math.abs(T-x)<1e-4&&(v[P+2]=Math.max(m,2e-4))}l.attributes.color.needsUpdate=!0,l.attributes.position.needsUpdate=!0,c.dirty=!1}}let o=r?Ts(t,16,19,0,1):u(this,lh);if((o!==u(this,lh)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let i of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(i),(n==null?void 0:n.type)==="geometry"&&n.components[0]instanceof gr){let a=n.components[3];if(a&&a.edgeColors&&a.geometry){let l=a.visible,c=Math.min(o,l?n.components[1].opacity*Su(n):0);if(a.currentOpacity!==c){for(let p=0;p<a.ranges.count;p++){let f=a.ranges.start+p;a.edgeColors.setW(f,c)}a.geometry.attributes.color.needsUpdate=!0}}}}A(this,lh,o),A(this,rd,!1),this.outlineOpacitiesDirty=!1}destroy(){u(this,kS).clear()}};rd=new WeakMap,lh=new WeakMap,kS=new WeakMap,DS=new WeakMap,s(o6,"OutlineInterpolationSystem");var AS=o6;d();d();var i6=class i6 extends ze{constructor(){super(...arguments);h(this,"userData",{entityId:""})}};s(i6,"EntityMesh");var FS=i6,JMe=$.object({flipImageToFaceCamera:$.boolean().optional(),url:$.string()}),QMe=$.object({type:$.enum(["Feature"]),properties:$.object({width:$.number(),height:$.number(),rotation:$.number().min(0).max(360).optional(),verticalOffset:$.number().optional()}),geometry:rh});function sQ(e,t,r){$.union([$.number(),$.string()]).parse(e),QMe.parse(t),JMe.parse(r)}s(sQ,"validateImage");var s6=class s6{constructor(t){h(this,"mesh",new _i);h(this,"imageMesh");h(this,"outline");h(this,"type","image");h(this,"instanceIndex",-1);h(this,"geometry");h(this,"material");h(this,"feature");h(this,"position",new Pe);this.feature=t}get visible(){var t,r;return(r=(t=this.mesh)==null?void 0:t.visible)!=null?r:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};s(s6,"ImageComponent");var LS=s6;d();function a6(e,t){return{x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)}}s(a6,"rotatePoint");function e4e(e,t){return e.map(r=>a6(r,t))}s(e4e,"rotatePoints");function t4e(e){let t=1/0,r=1/0,n=-1/0,o=-1/0;for(let i of e)t=Math.min(t,i.x),r=Math.min(r,i.y),n=Math.max(n,i.x),o=Math.max(o,i.y);return{minX:t,minY:r,maxX:n,maxY:o}}s(t4e,"getBounds");function r4e(e,t){let r=!1;for(let n=0,o=t.length-1;n<t.length;o=n++){let i=t[n].x,a=t[n].y,l=t[o].x,c=t[o].y;a>e.y!=c>e.y&&e.x<(l-i)*(e.y-a)/(c-a)+i&&(r=!r)}return r}s(r4e,"pointInPolygon");function aQ(e,t,r,n,o){for(let i=0;i<o;i++)for(let a=0;a<n;a++)if(e[r+i][t+a]!==1)return!1;return!0}s(aQ,"isValidRectangle");function n4e(e,t,r){let n=e.maxX-e.minX,o=e.maxY-e.minY,i,a,l={...e};return n/o>t?(a=o/r,i=a*t,l.minX+=(n-i*r)/2):(i=n/r,a=i/t,l.minY+=(o-a*r)/2),{dx:i,dy:a,gridBounds:l}}s(n4e,"calculateGridDimensions");function o4e(e,t,r,n,o){let i=Array(r).fill(0).map(()=>Array(r).fill(0));for(let a=0;a<r;a++)for(let l=0;l<r;l++){let c={x:t.minX+l*n,y:t.minY+a*o};r4e(c,e)&&(i[a][l]=1)}return i}s(o4e,"createAndFillGrid");function i4e(e,t){let r=Array(t).fill(0).map(()=>Array(t).fill(0));for(let n=0;n<t;n++)for(let o=0;o<t;o++)if(e[n][o]===1){let i=0;for(let a=1;a<=Math.min(t-o,t-n)&&aQ(e,o,n,a,a);a++)i=a;r[n][o]=i}return r}s(i4e,"calculateRectSizes");function s4e(e,t,r,n,o,i){let a=0,l=0,c=0;for(let p=0;p<n;p++)for(let f=0;f<n;f++)if(e[p][f]===1){let m=Math.pow(t[p][f],2),y=r.minX+f*o,v=r.minY+p*i;a+=m,l+=y*m,c+=v*m}return{x:l/a,y:c/a}}s(s4e,"calculatePolygonCenter");function a4e(e,t,r,n,o,i,a){let l=-1/0,c=null,p=e.length,f=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let m=0;m<p;m++)for(let y=0;y<p;y++)if(e[m][y]===1)for(let v=1;v<=p-y;v++){let x=v;if(!(x>p-m)&&aQ(e,y,m,v,x)){let S=v*x,I=t.minX+(y+v/2)*r,P=t.minY+(m+x/2)*n,T={x:I,y:P},w=Math.sqrt(Math.pow(T.x-o.x,2)+Math.pow(T.y-o.y,2))/f,E=S*(1-i)-w*i*S;E>l&&(l=E,c={center:T,width:v*r*a,height:v*n*a})}}return c}s(a4e,"findBestRectangle");function l6(e,t,r,n={}){let{scaleFactor:o=.9,centerPriority:i=.5,resolution:a=100,minimumSizeRatio:l=.5}=n,c=C8(r),p=e.width/e.height,f=e4e(t,c),m=t4e(f),{dx:y,dy:v,gridBounds:x}=n4e(m,p,a),S=o4e(f,x,a,y,v),I=i4e(S,a),P=s4e(S,I,x,a,y,v),T=a4e(S,x,y,v,P,i,o);return!T||T.width<e.width*l||T.height<e.height*l?e:{...T,center:a6(T.center,-c),rotation:r,polygonCenter:a6(P,-c)}}s(l6,"findLargestInteriorRectangle");var Yb=Math.PI*2,l4e=Math.PI/2,c4e=Math.PI*1.5,u4e=kd(l4e,2),p4e=kd(c4e,2),d4e=.01,lQ=!1,c6=class c6 extends Fe{constructor(r,n,o=0,i=0,a={}){super();h(this,"rendererState");h(this,"convertTo3DMapPosition");h(this,"initialBearing",0);h(this,"naturalBearing",0);h(this,"imagePlacementOptions");h(this,"imageLoadingCache",new Map);this.rendererState=r,this.convertTo3DMapPosition=n,this.initialBearing=o,this.naturalBearing=i,this.imagePlacementOptions=a}createImageMesh(r,n,o,i=0,a,l){var x,S,I;let c={width:o.width,height:o.height,center:this.convertTo3DMapPosition(a),rotation:(x=o.rotation)!=null?x:0},p=(S=this.imagePlacementOptions.mode)!=null?S:"default",f=(()=>{switch(p){case"fit-nearest-90":let P=(this.initialBearing-this.naturalBearing+360)%180;return P>=45&&P<=135?l6(c,l,c.rotation+90,this.imagePlacementOptions):c;case"fit-initial-bearing":return l6(c,l,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return c}})();if(lQ&&f.polygonCenter){let P=new ze(new x0(1),new Ei({color:65280}));P.position.set(f.polygonCenter.x,f.polygonCenter.y,i),this.rendererState.entityScene.add(P)}let m=new Ei({transparent:!0,depthWrite:!1,side:Ta}),y=new Oi(f.width,f.height),v=new FS(y);if(v.visible=!1,(I=this.getOrDownloadImage(n))==null||I.then(P=>{m.map=P,m.needsUpdate=!0,m.map.colorSpace=wa,v.visible=!0,this.publish("image-loaded")}),v.userData.entityId=r,v.material=m,lQ){let P=new ze(new Oi(o.width,o.height),new Ei({color:"gray"}));v.add(P);let T=new I8;v.add(T),T.scale.set(10,10,10)}return v.position.set(f.center.x,f.center.y,i+d4e),v.rotation.z=(-Ke.degToRad(f.rotation)+Yb)%Yb,v}getOrDownloadImage(r){var n;if(this.imageLoadingCache.has(r))return(n=this.imageLoadingCache.get(r))==null?void 0:n.promise;{let o=new Promise(i=>{Wc.getLoader().load(r,a=>{let l=this.imageLoadingCache.get(r);l&&!l.loaded&&(l.loaded=!0),i(a)})});return this.imageLoadingCache.set(r,{loaded:!1,promise:o}),o}}flipIfNeeded(r,n){if(r.imageMesh==null)return;let o=-n,i=r.imageMesh.rotation.z,a=kd((i-o+Yb)%Yb,2);a>u4e&&a<p4e&&(r.imageMesh.rotation.z=(i+Math.PI)%Yb)}update(r){var a,l,c,p,f;let n,o,i;for(let m of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(m),(n==null?void 0:n.type)==="image"){if(o=n.components[0],i=n.components[1],i.url&&o.imageMesh==null){let y=this.convertTo3DMapPosition(o.feature.geometry.coordinates),v={x:y.x,y:y.y};o.imageMesh=this.createImageMesh(n.id,i.url,o.feature.properties,o.feature.properties.verticalOffset,o.feature.geometry.coordinates,[v]),o.mesh.add(o.imageMesh),o.position.copy(o.imageMesh.position)}o.imageMesh&&i.flipImageToFaceCamera&&this.flipIfNeeded(o,r)}else if((n==null?void 0:n.type)==="geometry"){if(o=n.components[0],i=n.components[1],i.showImage&&((a=o.feature.properties)!=null&&a.image)&&o.imageMesh==null&&o.visible&&o.mesh!=null&&o.mesh.parent!=null&&((l=o.feature.properties)==null?void 0:l.image.position)!=null&&o.feature.geometry.coordinates!=null&&o.feature.geometry.coordinates.length>0){let y=o.feature.geometry.coordinates[0].map(x=>{let S=this.convertTo3DMapPosition(x);return{x:S.x,y:S.y}}),v=this.createImageMesh(m,(c=o.feature.properties)==null?void 0:c.image.path,(p=o.feature.properties)==null?void 0:p.image,i.height,(f=o.feature.properties)==null?void 0:f.image.position,y);o.mesh.parent.add(v),o.imageMesh=v}if(o.imageMesh){if(!o.visible)o.imageMesh.visible=!1;else if(i.showImage&&!o.imageMesh.visible)if(i.url){let y=this.imageLoadingCache.get(i.url);y&&y.loaded&&(o.imageMesh.visible=!0)}else o.imageMesh.visible=!0;else!i.showImage&&o.imageMesh.visible&&(o.imageMesh.visible=!1);i.flipImageToFaceCamera&&this.flipIfNeeded(o,r)}}}};s(c6,"ImageSystem");var RS=c6;d();var f4e=250,Xc,u6=class u6 extends Fe{constructor(r,n){super();h(this,"cameraDirty",!0);h(this,"focusablesDirty",!0);h(this,"state");h(this,"camera");h(this,"debugEl",null);h(this,"raycasters",[]);h(this,"collisions",new Map);h(this,"focusableEntities",new Set);h(this,"debugRaycasters",!1);O(this,Xc);h(this,"update",s((r=!1,n=Date.now())=>{r||Date.now()-n>f4e||(u(this,Xc)&&cancelAnimationFrame(u(this,Xc)),A(this,Xc,requestAnimationFrame(()=>{this.updateRaf()})))},"update"));this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new _e(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new _e(r.x/1.2,r.y/1.2),o=new _e(r.x+(r.x-n.x),n.y),i=new _e(n.x,r.y+(r.y-n.y)),a=new _e(o.x,i.y),l=new _e(r.x,r.y/1.5),c=new _e(r.x,r.y+(r.y-l.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[r,l,c,n,o,i,a].map((p,f)=>{if(this.debugRaycasters){let S=document.createElement("div");S.style.position="absolute",S.style.top=p.y+"px",S.style.left=p.x+"px",S.style.width="10px",S.style.height="10px",S.style.backgroundColor="red",this.debugEl.append(S)}let m=p.x/this.state.canvasWidth*2-1,y=-(p.y/this.state.canvasHeight)*2+1,v=new _e(m,y),x=new xs;return x.setFromCamera(v,this.camera),[x,v,f===0?10:f<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let r,n;for(let o of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(o),n!=null){if(n.type==="group-container"&&n.components[2]!==void 0&&n.components[2]instanceof Qm){let i=n.components[2];if(i.dirty===!0||i.focusMesh==null){i.focusMesh&&hr(i.focusMesh);let a=new Jr;a.setFromObject(n);let l=new Mi(a.max.x-a.min.x,a.max.y-a.min.y,a.max.z-a.min.z),c=new jr({transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters}),p=new ze(l,c);p.position.set((a.min.x+a.max.x)/2,(a.min.y+a.max.y)/2,(a.min.z+a.max.z)/2),p.userData={entityId:n.userData.entityId},i.focusMesh=p,n.add(p),n.components[2].dirty=!1}this.focusableEntities.add(i.focusMesh)}else if(n.components[0]&&n.components[0]instanceof gr&&n.components[0].focusable&&n.components[0].geometry!=null&&(r=n.components[0],r instanceof gr&&r.focusable&&r.geometry!=null)){if(r.focusMesh==null){let i=new ze(r.geometry);i.userData={entityId:n.id},r.focusMesh=i}this.focusableEntities.add(r.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.cameraDirty){if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.raycast()}}raycast(){this.collisions.clear();for(let[n,o]of this.raycasters)n.setFromCamera(o,this.camera);for(let[n,o,i]of this.raycasters)n.intersectObjects(Array.from(this.focusableEntities.values())).forEach(l=>{var c;if((l==null?void 0:l.object)!=null&&"isMesh"in l.object&&(l!=null&&l.object.isMesh)){let p=l.object.userData.entityId,f=(c=this.collisions.get(p))!=null?c:0;this.collisions.set(p,f+i)}});let r=Array.from(this.collisions,([n,o])=>({entityId:n,weight:o})).sort((n,o)=>o.weight-n.weight).map(({entityId:n})=>n);this.publish("geometry-in-focus",r),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){u(this,Xc)&&cancelAnimationFrame(u(this,Xc)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Xc=new WeakMap,s(u6,"GeometryInFocusSystem");var NS=u6;d();d();d();d();function Kb(e,t){t===void 0&&(t={});var r=ym(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return m4e(r,t);case"MultiPolygon":return h4e(r,t);default:throw new Error("invalid poly")}}s(Kb,"default");function m4e(e,t){t===void 0&&(t={});var r=ym(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{};return cQ(n,o)}s(m4e,"polygonToLine");function h4e(e,t){t===void 0&&(t={});var r=ym(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{},i=[];return n.forEach(function(a){i.push(cQ(a,o))}),xu(i)}s(h4e,"multiPolygonToLine");function cQ(e,t){return e.length>1?M8(e,t):_a(e[0],t)}s(cQ,"coordsToLine");function y4e(e,t){var r=!0;return Cs(e,function(n){Cs(t,function(o){if(r===!1)return!1;r=g4e(n.geometry,o.geometry)})}),r}s(y4e,"booleanDisjoint");function g4e(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!I4e(e.coordinates,t.coordinates);case"LineString":return!uQ(t,e);case"Polygon":return!fl(e,t)}break;case"LineString":switch(t.type){case"Point":return!uQ(e,t);case"LineString":return!b4e(e,t);case"Polygon":return!pQ(t,e)}break;case"Polygon":switch(t.type){case"Point":return!fl(t,e);case"LineString":return!pQ(e,t);case"Polygon":return!v4e(t,e)}}return!1}s(g4e,"disjoint");function uQ(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(x4e(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}s(uQ,"isPointOnLine");function b4e(e,t){var r=_m(e,t);return r.features.length>0}s(b4e,"isLineOnLine");function pQ(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var o=n[r];if(fl(o,e))return!0}var i=_m(t,Kb(e));return i.features.length>0}s(pQ,"isLineInPoly");function v4e(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var o=n[r];if(fl(o,t))return!0}for(var i=0,a=t.coordinates[0];i<a.length;i++){var l=a[i];if(fl(l,e))return!0}var c=_m(Kb(e),Kb(t));return c.features.length>0}s(v4e,"isPolyInPoly");function x4e(e,t,r){var n=r[0]-e[0],o=r[1]-e[1],i=t[0]-e[0],a=t[1]-e[1],l=n*a-o*i;return l!==0?!1:Math.abs(i)>=Math.abs(a)?i>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:a>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}s(x4e,"isPointOnLineSegment");function I4e(e,t){return e[0]===t[0]&&e[1]===t[1]}s(I4e,"compareCoords");var dQ=y4e;function p6(e,t){var r=!1;return Cs(e,function(n){Cs(t,function(o){if(r===!0)return!0;r=!dQ(n.geometry,o.geometry)})}),r}s(p6,"booleanIntersects");var fQ=20,Yc,nd,od,$S,Jb,d6=class d6{constructor(t){h(this,"dirty",!0);h(this,"map");h(this,"stylesheetId","");h(this,"userHiddenLayers",new Set);h(this,"hiddenLayersInStyle",new Set);h(this,"centerPoint");h(this,"bbox");h(this,"polygons");h(this,"handleRender",s(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(u(this,Yc)&&(u(this,$S).call(this),A(this,Yc,!1)),this.centerPoint){let t=this.map.project(this.centerPoint),r=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});if(r.length>0){for(let n of r)this.expr.push(["!=",["id"],n.id]);this.expr.length>0&&this.hiddenLayersInStyle.forEach(n=>{this.map.setFilter(n,["all",...this.expr])}),this.expr=[],A(this,Yc,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let t=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){A(this,Yc,!0);for(let r=0;r<t.length;r+=fQ){let n=t.slice(r,r+fQ);u(this,nd).push(()=>{for(let o of n)if(o.geometry!=null&&"coordinates"in o.geometry){if(this.polygons==null)return;let i;if(o.geometry.type==="Polygon"?i=T0(o.geometry.coordinates):o.geometry.type==="MultiPolygon"&&(i=O8(o.geometry.coordinates)),!i)continue;for(let a of this.polygons)if(p6(a,i)){this.expr.push(["!=",["id"],o.id]);continue}}})}u(this,Jb).call(this)}}}},"handleRender"));h(this,"expr",[]);O(this,Yc,!1);O(this,nd,[]);O(this,od,null);O(this,$S,s(()=>{u(this,od)&&(globalThis.cancelAnimationFrame(u(this,od)),A(this,od,null)),A(this,nd,[])},"#cancelJobs"));O(this,Jb,s(()=>{let t=u(this,nd).pop();typeof t=="function"&&(t(),u(this,nd).length>0&&A(this,od,globalThis.requestAnimationFrame(u(this,Jb)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],A(this,Yc,!1)},"#runJobs"));h(this,"handleStyleChange",s(t=>{var r,n;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let o=(n=(r=t==null?void 0:t.style)==null?void 0:r.stylesheet)==null?void 0:n.id;(!o||o!==this.stylesheetId)&&(this.stylesheetId=o,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,r){this.centerPoint=t;for(let n of r)this.userHiddenLayers.add(n);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,r,n){this.bbox=t,this.polygons=r.reduce((o,i)=>{if(i.geometry.type==="Polygon"){let a=T0(i.geometry.coordinates);o.push(a)}else i.geometry.type==="MultiPolygon"&&o.push(...i.geometry.coordinates.map(a=>T0(a)));return o},[]);for(let o of n)this.userHiddenLayers.add(o);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};Yc=new WeakMap,nd=new WeakMap,od=new WeakMap,$S=new WeakMap,Jb=new WeakMap,s(d6,"OutdoorLayers");var BS=d6;d();d();d();var f6="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n fragPathDistance = pathDistance;\n\n // We can get an origin point for the cross-section of the path by\n // subtracting the surface normal times the radius, since the surface normal\n // points strictly away from the centre.\n vec3 origin = position - nearRadius * normal;\n\n // Inflate the path along its surface normal to increase its radius from\n // `nearRadius` to `farRadius` when the camera is at `farZoom`.\n vec3 adjustedPosition = position;\n zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n // Determine how far the path extends \"up\" or \"down\" in the direction of the\n // path normal.\n float height = dot(adjustedPosition - origin, pathNormal);\n\n // Flatten the bottom half of the path entirely so that it's flat\n // against the floor. This makes the path look nicer when it's\n // semitransparent behind opaque geometry, so you don't see it\n // peeking through.\n float desiredHeight = max(height, 0.0);\n\n desiredHeight = desiredHeight * flattenFactor;\n\n float flattenMagnitude = height - desiredHeight;\n adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n // Transform the vertices into NDC.\n vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n fragTexcoord = uv;\n\n // Compute a texture coordinate for mapping the arrow texture to the path.\n // We don't want to use the u-value that Three.js provides, because the\n // path may end up twisting arbitrarily -- but we want the arrow texture to\n // always be on the top of the path.\n vec3 bitangent = cross(normal, pathTangent);\n fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n radius = mix(nearRadius, farRadius, zoomLevel);\n}\n";var m6='#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of `pathRadius`. Since we\'ve\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered "long", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered "short", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path\'s length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the `complete` value as it varies from 0.0 to 1.0.\n // Fragments that are at the `complete` value or past it will be fully\n // transparent, while fragments that are at `complete - completeLength`\n // or before it will be fully opaque. However, we adjust the `complete`\n // value here so that it overshoots by one full `completeLength`, so that\n // the entire path will be opaque when the `complete` value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at `arrowMargin` instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // "zooming off" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as `arrowAnimationTimer` goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a "looping sawtooth" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the "looping" design is preferred is because\n // it takes advantage of WebGL\'s `GL_REPEAT` texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from `pulse`\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the `pulse` value and whether it\'s covered by an arrow -- but if it\'s\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like "holes" when they\'re overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}';var mQ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAQkHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZpZciQ7rkT/uYpeAicQ5HI4mr0dvOX3ATOl0li3q3SVJkUqFMEBcHc4IuX2///fcf/hK7cSXRatpZXi+cott9h5U/3j63EMPt+fL1/h+fPdeff6NnJMHNPjD2U/7+qcl183aH6eH+/PO52PN7E+B3qZ+Tlgspkjb57X1edAKT7Oh+fvrj3v6/nNdp7ftd057abHnz78npVgLGG8FF3cKSTPz2oXJFaQWuocCz9D0mhnEu8Tx54k6dexc98F77vY+f48n96HwvnyvKB8iNHzfJCvY3cj9HZF4dfM7/6QZ4j+7deb2J2z6jn7sbueC5Eq7rmpl63cd1w4GCrd2wov5Vt4r/fVeFW2OMnYIpuD13ShhUi0T8hhhR5O2Pc4w2SJOe5IuGOMM6Z7rhL+FudNSrZXOFFJz3KpkqtJ1hKn4+tawp233flmqMy8AlfGwGCBOz693Fcn/+b1OtA5Bt0QfH2NFeuKFnCWYZmzn1xFQsJ5xlRufO/LvcGNf5PYRAblhrmywe7HY4gh4Re20s1z4jrx2fkHNYKu5wCEiLmFxYREBnwJSUIJXmPUEIhjJT+dlceU4yADQSSu4A65SamQnBptbu7RcK+NEh+nkRYSIZBGSQ0EIlk5C/jRXMFQlyTZiUgRlSpNekklFymlaDGN6po0q2hR1apNe001V6mlaq211d5iS0iYtNLUtdpa651JO0N37u5c0fuII408ZJSho442+gQ+M0+ZZeqss82+4koL+q+y1K262uo7bKC085Zdtu662+4HrJ108pFTjp562umvWXtm9X3WwofM/T5r4Zk1y1i+1+mvrHFa9WWIYHIiljMyFnMg42oZANDRcuZryDla5ixnvkVIIZGsBbHkrGAZI4N5hygnvObuV+Z+mzcn+Y/yFr/LnLPU/RuZc5a6Z+Y+5+2LrK1+K0q6CTIWWkx9OggbF+zaY+1Wk/766H46wF8ONFY+O8hBMEc7oc4Vdh+8JsE+PUSrVjr70Zz1+H56PH3o9sRR1ql5Ha8bUMQxpe89Tki8Sb0tE23cw3DcfEo+ugnj2G3WEmononVfoag71pVjR+EmAE53eT5tqYfEHl/7ThMusaI+St0jktFa9gKnreiQqCNpZ2mJdSkbaiK6DrovYR4/JhJfRsx5d5EVZnEIPetHnU5KynJPTSuCPuC0lOuXH7n1DNq7DpUtHbhM5lDA0c2bnDCJoOObMnyj+aPjPwx0yiDUxKKsg35VnRnBEVhonKwK5hOk5NttUrhr2+tMOXkPJb1RZ+iAelYjL2MuO3pGRQ78GdxwOOaTAcJZcewq7ilB1RJCSozUdSEdwVJVb6asiBsHH1Bqgbiv3Cmkkis6ktVnZGRRwMNJjUA3Ao2127YWdhAIblxF51hzMcZsVZc0r0dJo5Liqfn41Q+q193SGhhkMkgaLJRNnEpqBtyVvbcVffIk+LE9QPFBTMTQe0aWkMXMnx3dy5sfHreDE60Ql50E+SqRcmfK16L2p0Ol8JFATu3qASXy7SvmiGW2cdMBxsty44CvtLogfGlv7WkCSV0WId2270EaD5Ym40cs+SAwZuNjPSTywAvEfLmzQhtLDntfCnhl/fNmUNnzyA2g76Zn0SP+c+I6bCC0FONUQ4L50e95dif+DH/m9htQjBEhPPpOjYjmm2ChbfEMIUaYtAIxmWJHlilLU8ZRs9pCsHbDpFaRgZljz2QandjDIBPZDGTuoZW1KdlYh52ALzisKJRNWSQmLAWx8iv9mGttT15bBc2oxd57bZtVF98CYtK3UH22Yd/A7WaKa+ZjNTOXEzNhMJ5kmQOvfzsbxbZALJ2xwGBjX2HFQybhi7kpbA7DVpS3RxMJwFyHwGk5gs6a4lrRHVqhYT0QTJC9UZcC9Yrelkn6yXch68NKNtG7CiU3vf/zMZAYXPWdrR9XZ/ctMV1sJQ2wJEGxzaHs7LmmHIwnUwbwnNAapBY9xhE19DNJW3ua0dDk/AjwITacR0PqZxkbyJ+E5jYbxI84x1TBE+y90hwDCYZIM0tqAKPZfCzFrbH8kYCm3eqQkZ2+2GovcL8Suokyg8yyCJes6dcouSLiNSLb0ETJU+/N/WFsBBSOXBbm9Cwp4CzlOag7ro7R2vC19nSsCPmAjIEMiobFwaoVXhjTU2XMpgEsDH/L3Sx54OCTMUSXI/IIA2V4QcLQpwVz12pInI0bY56pIQ2BSGRLL+yLfZ7JkiimbK+aepsbwRStpokx5gCqe1hjdMAwcINbkk5jmedrNRAG5pUXPe0sZIoXy1h7lSDxApzheg24JeDNtDS1oBDBUC4iWZFilBPhZx0Kqx2lihpbG9q4sYidksCN4yRYhNM4nxfBbTi4E3AT6B3igbvs9Gv8ZkHsIfdlep+2HelEDbkJdNjqZQ90B7k6OIoFfkkPNoY+z0gzACa1f2qcBYxVJpT2QQgS19dKQlbC24S92xiEAFRKB5Uy1qrBgOtwIge55G0kRPfIytGx0tMOrGfrijB2FHOk/TKcMjDTMPeBo4FnXD5cQ8vtdgoAN0yuzZQHQI09wm/5vAB6RHyI9rYKiZ6YWC6rbaiLmDtoaToC1bViXQFNtgWsOfEEKCleC3GWPSfgQWRQWMgw/9FDgvOZrFAT3SmsA3DLbqlsSppQG5QeOjPXavUUkxF/qgLM05vW5o7UakuBqo2ZW8Nj0LB7imVJC9QSA+wd7RPztIUZ80xQZq0ROrc8CSVncWzkTA/RwmunldCPAQKjqVC7bhRuTIv0plbk7gOX4m5OAi2YesYZ0KBQRToG8iv9x8dgGtgECYRBeEU87OxoSc8epu+s7Mq/MN0VbBT19dii7ekO66UZwdAMtoAVQd13J5nwZe98OgGslmVqAGBkeLZNVNVlWpV18qihntXKnBZvrDIVgFpx4q5poLqREOVplMPSpTF2KvjBAzDpprkruXIaaUmUD4Xo2yrGWcYlixKIwRFjl0jPQhKznUXZAoSjlg9c/NwAI4p3Q/w5bCNfhUZS7bGfqesHqKAlyZZxZgNrhGevZXccaqBys4NEqB3Vqfptji9uUrhCL6yXFqxtm0hhLyYU3Tjd8I/HZaWD1oyVjnG5hhpCN5yHSf8BQUZlVNd00OP4M0TK+JSM7iqWi01SinFkCQXWxiZJLqqAHiEt3G3I2WYd46KU9pIJIOkoRQYCcEAAPguHo0Y4k8Hl6SW50MoW0uZU8jJOUghKo38Nl5ZSwsJNAUC2/lFZWkfMjrU8dFrTjHpJnUrLCILQIxINiYdQlDXaE/razQ4jjQluN5jW1Eh/S7yYvI5gigSjdLYU9TiFXAcHjISiLhQd9obb3OQmwY+YqVwiBMCkOGLXaK/ljBShh56c1g0uyIb2lBRKO7ZTAFncw5c5UGjGSy3CsI1Jt2mtruZkfhBZmbR+842Yu1eDiWEl0V6LZcGem6Ct+LW4Wy3oAjyNObazKBHomhJ3HMKEKHgiGksH+Ig1nTidfNMyA+oYHqVFaRGLiQreVLc9GvQgftKjW9cfUSKNYL80rqU7Um2rwqQJR1ai31Wq7vzKJEsFHDj0bAEMUKXgvfD5bWbaLPBTKz1Nk/Fg+GUZvUzFw80CLaKtPAACVAWrismh863FU4IJ0716SXBUNVb/SDMVvZgDt34CXoOq1JKvg0n08gPHTwXBNgD5W8pZZ8E9EVWcv1DZMB2NFysIwkqBSaH5QRmsAHdkHB+UANvLJvFpQKAahSmYTLEd2AFO+5rsqRRU6sVv5IP0wsSPLcWsbC1Y95mte71CUm6RJJWwkg6Q4k+xWMM0ByElJPQ6j2ED5hY42ALpZRytx9RlgQlJLijzhKi5eX5JBSIRGfo9o2xhd/0aWku8OS+4D9ZnovHDQMPaYo4qm2mlZbUnd7pR6oQj29Z2BqJ9n3LRT+MTLu3IR+ZP2TCPh3EDw8H1NHpoT7FibNYU8WHd9ESHcY12aDOQCUBddi4Ucp+4yuzz8ybcCCu1h8zvzXhDN4HYLq1R+U0xzUqg5QSA3iSBgdDouy55Ifx0DaeEhgezxBRGmoEJ6AJitVuzwtKPlUskHgU2F0LS7AFIwW5jPu0RUL7sp+fkNk0ee8P6uXYgl40WM+cdCOW21r13e0ivt0ff/mYcUfrQZWs2BiN6G+MDTGz1BKORmUTNQp9YGSHFxAeTkQrKd6FoVUogyytW25OLy3OpaO5oZCQp46aPzb5LnJiFEIwAKkmbYVYIjzVv3vj7rA6HignEeQAXTAHKDhoD7Uujh0QjtsB6fTP1NzO7T1Nzq4F1GnfHdXCG1Yxjwdtjf+PGRGTzEtEAUCz7KLfTdItLwCXuSOAzVjaZB6LvbUZhYGWmifSZlcMDnGHPd6gPeiK9erhpiw7ZP9ahTrMhFDa1J53m9ri2DloziqGETTcVSppCbTDDjExg6RrZ6cPEzB8XArEjQSB29odrUoLyoS/65RfM9fprGGjlHpbhGgbYD8MtmW1eFcAWX5dbcMHcl8sUI2k+H7GPW9VrArw3G+BefcCrCaAT/N53YLvP26Uy0kMFnDEZz0DJkmQqEOlL7SlKweYhH8gxpYeAYi0f9magqPbMYZuUI6007lSZQoyoGfYQHsNRzHXR3MMINTSMZpq1KD2A5MDJgtMLdRU6R4CEOJcKGiIJ7K6P/vAM6xpECHI8rRHsaEj6smkngAUjXTzrRoSI48ZpHOqgOY5OejKVdpnmiYUChQnVdIPa6ekGqRSRgEO119oDHOiIUQ5ciYVgaF1oG8Udo8WYtD+DEi8D/w8rAJE2k2PoyV0oMtpauxreaFjpujAvxFlwBhjuNqM9P0IfI5iD8Nh8y1kG4igjJkDNkOijnlLhItAd9lhRd670yNRTu95cR/Xuu0c5WO4DEFk5YQAPtLvU4TYPGRh4APPEDNiuuwR6SC21JoFbQBBMr+zJmT32QplNI6p16PbculN/pCX1wAyTWGTeJ774aln0gvQikw7TmkfsNbdQNs0adutYUDqNtGc0RqngUYdhUYuHSL1/eLrgvqDTC5neu++vufRkEgP9D2T64Kg/c4n+s7k3dDr3me8nOr0c72MRNmgF7D4WySPP0YAI/bI4eixwc7K13QiRiL85A8fnSsUj+mvTrsZtVUEQZ6sTpVafW8nYJZyaZS0U+0xIb6et9PhhtoObozQbjKAoDf6eiFgx1UUvpUYj1GweH0MNMrofhynfWn7+KYu7n5r83hN9aqm+6qjcH7dUlgvZVLV3xqq4fbP16qv+eofuTz43eomAqfS7GBAB9zEE31WJ37eVIPtdGN5A8nMYPvvLt8t2/V/6gM19G4g/hIL7UXf9JgbuLRZ+AoW//AzyMxTcWyz8BAruLRZ+AgX3r3y2+mT/PwfiN1DoVI+QT3CZDmvb8022JeYb6HiQPQpPPvboFB+i1MZdcqWZqthHmix6vttw0UAI1z8oEnGwVe++c7JamxslC+8xKJE41XJmug1npz+6CUAKyURd9gSxo+kWxvtZth848GBlws/0SKjYhmbZ9IiV+mcGBSdWHk8sqSr2zz5J7QME/0yD+z4Pe+JuGn1MV/vUyZwOHojWPlmPXgf9CuoeN9UAT+FGwaLg44v3dWe6QpvuL3Ln/p3k/2AgqNDcfwHgqUmIIqn+hwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4wYRESAMujenGAAAB9FJREFUeNrtnWlsFVUUx899fS1gUoKioEY+WBRUEohGkUhAKxgEjSgGoRGB4AJCNKAIJBJZJSiyGYMKKkIoLlEUKhUraxFkKUE2kU1aCrRgW2jpg9f29R2/sBTo67v3zL2zvfP73MzM+XU6mf+5504BGIZhGIZhGIZhGIZhGMZGGq3JvSmR62++BXHH7Ylbf9ouRMT99yVq/e0PICIiHumUmPV3PooXOf5EItafXoCXOdUn8ep/pgjrUDY40ervX4JXUTEiocoXL5/FawiNEwlU/6hzeB3hqQljQIwJYT3UzEkQA2JiGOslsiAhDIgZ1RiD6NIEMBD8NIKxyQr6vv7FtdgQa31uILg0ig2zsZmv4//yePUj7rjNv/U3yUEJ/r7Xr/XfvBmlOPKwT+vfhpIUdvdj/Wm7UZpTz/mv/g4HUYGyQb5r/+SjEhXD/VV/j5OoSGisj16LRe9iVCY8xTcGxIulSKBmtk8MiKHlSMIn8ViMqkQivojHgfcuIJ0VAc/XPzmMVljrcQOBmdVojY1NvVx/8mcRtEqeh+NxypJatM6+ezxb/7Io6uBwR4/e/1moicJunvz956A2ip/1Xv3Nt6JGSgd6rf47/0KtlHssHrfZi5rxVDwWDx5C7XgoHotHC9AANbO8YqBXERohMt8bv/8X/kNDRDM9cA+IgWVojhWuNxAYXo4mWePyeBwYHUKz5Lo6HidNvICmybvVxfXPqEbz7Gvr2vrn1KAdHH7IpX//8yNoD8dcGY+TM6NoF26MxzLTL26Mx0majtM4q5ed7yhNulVsd5WAxqset/mGS6/d5CIBLXI62/7I6ZKyzjUC0rIfsP+hE3zkxt9c8vy7tPnJbiKfuyP+Xdn8ZDeuiMei+zF0juWOGyBNv+iMxw4bEBkl6CzOxmPx6ll0mryWDtb/ViU6z17H4rEYG0I3cMiheByYFEZ34Ew8Dn5UjW7BiXisY/rFDfGYmgWCCwcngXto0q08z1YBSUsy3NWgb5Qe2WSjgJRlfdy2RJPcNXm9bQIarexpsP5VdxHjcbMcm2Q3/5P64i71U8k/ELuLNsVjcct2cnST+rGg+Jo4XmhLPBZ376GOfoOkAIB5NWTHxuu/nzj9ElkA8gLgA+pLlvF43IU4/VI9G1QEAHnIPjfVaP1PnqRdVngKqAkActDMa2Hw/u9zijjjNg5UBcBr1FbD3jbG6h9QSruk8ovfyFESABnUWSNT8VgMI06/lF7aBqomAJ4n3m+G4nHgbeJfZfHljcCKAqDHcWo87m2g/gnE53LhlS+lqQqATv9S4/FL2u//qcT2T34XoAuAdvuJBspf11z/LOKbyYG6q4bqAqDVTqKByjFa21/U6ZfdaWBNADTdTDQQnqSv/pRMYjrZevVLCUUAiF+JBqpnaqv/J2I+zb3mxZwkAMTPDq8ep1A3P/1y3ZOEJABgiaPxuOnvxLN/B7oEwELq/sPl1utvSdz8VPsl6BMAn1AbBKut1t96F+3ENXOFTgFiehXRwAZL8Vi0JW5+qppW7+HIAgDGnyca2G4hHouOh2knvTARdAuAkedsj8cinTj9Ujka9AuAV87YHI/F08TNT2eHgQkB0I/aIDhGmuIU/YnnKxkAZgTAU8SGHC0eDyJufiqKfTKrAqBrPtFAiXo8HlFBO1VBA7ebZQHQifhUVo7H4p2QgQeOdQHQbp8t8Tg4idj+2dPgwJIGAdBqhw3xmDz9EuelQ4cASP3DeDwOziW+ecdbldEiACDbcDxOWkBs/8QNHpoEAPXjLNFMmfpv+IZ4+PjRU5cAWGwwHqcQNz/J2NUmAMgjavHjMfEPTGpvvz4BQH1MrzMkoHoW2CsAppEaBFskemQUA+HJYLcAeJfQINgpNVuvbiA0FuwXAG8qNwh2S07WqxqQ/saPXgEwRDGu7W8te2Q1A6XSH0HWLAD6nVa5zoPS9asZKJb/DLZuAdDzhPx1Hu2gkobkDRQq/J8w7QJAfstevuI3+WQN1F39dkAAtP9H7jpPdFVtiMgZOKC0Z9aAAEiT+mrbScLQjIyBXWngtABokRf/kKefonRF4xvYqrjmYEQApG6Md8SyvrS+eDwDG5QbzUYExL3QMxnUlZGGD5wFbhEADQ7YVwyhr401YCD6LbhHACyK3SA4N9TK6mhMA5EvwE0CYF6sBkFopLXl8exYq9/gLgHwYf3x+PxoqwMC9RoIvw9uE1D/gH3VeOsjItnSq9/OCqhvwL5qAoABA5XU28qsAHjj2tW8mukABgzEXP12WgAMvrpBEPkYwICB2KvfjguAvnUH7GvnARgwUGRhEt24gLoD9tGvAAwYKLDyySzzAqDzpQH76CIAAwYOWtqNYoMAaH9xwP57AAMG9ljbj2SHALhjJyLijwAGDGyzuCPNFgGQuhlxpfw1yR94dfAxi5cmojI/lRyx+rtaX9XDhADr2CVABc//JycWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWIDToH8FyJUWtVWAALedDoFhGIZhGIZhGIZhGIYxyf+YwEMsIhMo/AAAAABJRU5ErkJggg==";var T4e=new Ad;function hQ(e,t,r){let{nearRadius:n,farRadius:o,accentColor:i,completeFraction:a,isVertical:l}=t,{color:c}=r,p=!0,f=0,m=1/0,y=t.displayArrowsOnPath,v=!l,x=!0,S=y,I=n/2+w4e,P=0;e[0].z+=I;for(let re=1;re<e.length;++re){e[re].z+=I;let se=e[re].x-e[re-1].x,k=e[re].z-e[re-1].z;if(l)P+=Math.sqrt(se*se+k*k);else{let K=e[re].y-e[re-1].y;P+=Math.sqrt(se*se+K*K+k*k)}}if(!l){let re=e[0],se=e[e.length-1];e.push(se.clone().setZ(se.z-.01)),e.unshift(re.clone().setZ(re.z-.01))}let T=new a8;S&&(T=T4e.load(mQ),T.colorSpace=wa);let M=new Lt(c),w=new Lt(i),E={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new _e(1,1)},cameraParameters:{type:"v2",value:new _e(f,0)},complete:{type:"f",value:p?0:1},color:{type:"c",value:M},pathLength:{type:"f",value:P},nearRadius:{type:"f",value:n},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:f},farZoom:{type:"f",value:m},pulseColor:{type:"c",value:w},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:l},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:T},displayArrowsOnPath:{type:"b",value:y},flattenFactor:{type:"f",value:v?.05:1},showPulse:{type:"b",value:x},opacityMultiplier:{type:"f",value:1}},B=new h8(e);B.curveType="catmullrom",B.tension=0;let D=30,F=8,L=D*e.length,H=new y8(B,L,n,F,!1),U=new Float32Array(H.attributes.position.count);for(let re=e.length;re<U.length;re++)U[re]=re;H.setAttribute("vertexIndex",new Ea(U,1));let G=new Float32Array(H.attributes.position.count),J=new Ea(G,1);for(let re=0;re<=L;re++)for(let se=0;se<=F;++se)J.setX(re*(F+1)+se,re/L);H.setAttribute("pathDistance",J);let X=new Float32Array(H.attributes.normal.count*3),ie=new Ea(X,3);for(let re=0;re<L;re++){let se=H.tangents[re];for(let k=0;k<=F;++k)ie.setXYZ(re*(F+1)+k,se.x,se.y,se.z)}H.setAttribute("pathTangent",ie);let ee=new Float32Array(H.attributes.normal.count*3),be=new Ea(ee,3);for(let re=0;re<L;re++){let se=H.tangents[re];var ve,de,Ae;l?(ve=se.x*se.y,de=-1+se.y*se.y,Ae=se.z*se.y):(ve=-se.x*se.z,de=-se.y*se.z,Ae=1-se.z*se.z);let k=Math.sqrt(ve*ve+de*de+Ae*Ae);k===0&&(k=1);let K=ve/k,R=de/k,ce=Ae/k;for(let oe=0;oe<=F;++oe)be.setXYZ(re*(F+1)+oe,K,R,ce)}H.setAttribute("pathNormal",be);let gt=new gu({uniforms:E,vertexShader:f6,fragmentShader:m6});gt.transparent=!0,gt.alphaTest=.5,E.resolution.value.x=1,E.resolution.value.y=1,E.vertexes.value=U.length,E.arrowTexture.value.wrapS=gs,E.arrowTexture.value.wrapT=gs,E.arrowTexture.value.anisotropy=16,E.complete.value=a;let st=new ze(H,gt),Ye=st.clone(),Ve={...E,opacityMultiplier:{type:"f",value:.25}};Ve.complete.value=1,Ye.material=new gu({uniforms:Ve,vertexShader:f6,fragmentShader:m6}),Ye.material.transparent=!0,Ye.material.alphaTest=.5,Ye.material.depthWrite=!1,Ye.material.depthTest=!1,Ye.renderOrder=1,Ve.resolution.value.x=1,Ve.resolution.value.y=1,Ve.vertexes.value=U.length,Ve.arrowTexture.value.wrapS=gs,Ve.arrowTexture.value.wrapT=gs,Ve.arrowTexture.value.anisotropy=16,Ve.complete.value=a,st.userData=Ye.userData=t.mesh.userData;let fe=t.mesh;fe.add(st),fe.add(Ye),H.computeBoundingBox();let he=new Pe;return H.boundingBox.getCenter(he),{mesh:fe,material:gt,center:he}}s(hQ,"buildPath");var w4e=.15;var h6=class h6 extends Fe{constructor(r,n,o,i){super();h(this,"rendererState");h(this,"altitudeDirty",!0);h(this,"convertTo3DMapPosition");h(this,"getParentContainer");h(this,"convertZoomLevelToAltitude");this.rendererState=r,this.convertTo3DMapPosition=n,this.getParentContainer=o,this.convertZoomLevelToAltitude=i}update(r,n,o){let i,a=!1;for(let l of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(l),i&&i.type==="path"&&i.components[0].type==="path"){let c=i.components[0],p=i.components[1],f=c.isVertical&&this.altitudeDirty;if(!(c instanceof qc))continue;if(c.dirty||f){if(c.mesh.parent!=null)for(let y=c.mesh.children.length-1;y>=0;y--)hr(c.mesh.children[0]);let m=[];if(c.feature.features.forEach(y=>{let v=y.geometry.coordinates[2]||0,x;if(y.properties.parentId&&(x=this.getParentContainer(y.properties.parentId,!0),x!=null&&x.altitude!=null&&(v+=x.altitude,c.isVertical=!0)),!y.properties.parentId||x!=null&&x.visible){let S=this.convertTo3DMapPosition(y.geometry.coordinates[1],y.geometry.coordinates[0],v);m.push(S)}}),m.length>1){let{mesh:y,material:v,center:x}=hQ(m,c,{color:p.color});c.mesh=y,c.material=v,c.position=x}c.dirty&&(c.nearZoomLevel!=null&&(c.nearZoomAltitude=this.convertZoomLevelToAltitude(c.nearZoomLevel)),c.farZoomLevel!=null&&(c.farZoomAltitude=this.convertZoomLevelToAltitude(c.farZoomLevel))),c.dirty=!1}p.dirty&&(c.mesh.children.forEach(m=>{m.material.uniforms.color.value.set(p.color),m.material.needsUpdate=!0}),c.mesh.position.z=p.altitude,p.dirty=!1),c.material&&(c.mesh.children.forEach(m=>{var v,x;let y=m.material.uniforms;y.nearZoom.value=(v=c.nearZoomAltitude)!=null?v:r,y.farZoom.value=(x=c.farZoomAltitude)!=null?x:n,y.cameraParameters.value.x=o,c.materialDirty&&(y.nearRadius.value=c.nearRadius,y.displayArrowsOnPath.value=c.displayArrowsOnPath,y.farRadius.value=c.farRadius,y.pulseColor.value.set(c.accentColor),y.complete.value=c.completeFraction),m.material.needsUpdate=!0}),c.displayArrowsOnPath&&c.animateArrowsOnPath&&(c.mesh.children.forEach(m=>{m.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,m.material.needsUpdate=!0}),a=!0),c.materialDirty=!1)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};s(h6,"PathSystem");var Qb=h6;d();var Yr,ch,_l,y6=class y6{constructor(t){h(this,"rendererState");h(this,"dirty",!1);O(this,Yr);O(this,ch);O(this,_l);this.rendererState=t}updateOne(t){if(t instanceof wt&&t.components[0]instanceof gr&&t.components[1]instanceof Ps&&t.parentObject3D instanceof Sn&&(A(this,Yr,t.components[0]),A(this,_l,t.components[1]),u(this,Yr).detached&&u(this,Yr).dirty&&u(this,Yr).geometry!=null&&u(this,Yr).material!=null)){A(this,ch,t.parentObject3D),u(this,Yr).visible=!1;let r=new Lt(u(this,_l).color),n=u(this,_l).opacity*Su(t),o=new Xp({color:r,side:Ta,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,u(this,Yr).material.repeatYFactor),i=new w0(1,u(this,Yr).geometry.attributes.position.count||0,0,o),a=i.addGeometry(u(this,Yr).geometry);i.addInstance(a),i.userData={entities:{0:t.id},detached:!0},u(this,Yr).instanceIndex=a,u(this,Yr).material.setColor(u(this,Yr).instanceIndex,r,u(this,_l).topColor?new Lt(u(this,_l).topColor):r),u(this,Yr).mesh=i,u(this,Yr).material=o,u(this,ch).add(i),u(this,Yr).dirty=!1}}update(){if(!this.dirty)return;let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){A(this,Yr,void 0),A(this,ch,void 0),A(this,_l,void 0)}};Yr=new WeakMap,ch=new WeakMap,_l=new WeakMap,s(y6,"MeshDetachmentSystem");var jS=y6;d();d();function yQ(e,t,r){var n;if(e.geometry!=null){let o=t||1e-4,i=o/e.currentHeight,a=o/r;e.geometry.scale(1,1,i),e.material&&(e.material.repeatYFactor=a),(n=e.mesh)==null||n.setGeometryAt(e.instanceIndex,e.geometry),e.currentHeight=o}}s(yQ,"updateHeight");var id,Kc,g6=class g6{constructor(t){h(this,"rendererState");h(this,"dirty",!1);O(this,id);O(this,Kc);this.rendererState=t}updateOne(t){var r;t instanceof wt&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&(A(this,id,t.components[0]),A(this,Kc,t.components[1]),t.type==="geometry"&&u(this,Kc).height!==u(this,id).currentHeight&&yQ(u(this,id),u(this,Kc).height,u(this,Kc).initialHeight))}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.cleanup()}cleanup(){A(this,id,void 0),A(this,Kc,void 0)}};id=new WeakMap,Kc=new WeakMap,s(g6,"MeshModificationSystem");var GS=g6;d();var M4e={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},b6=class b6{constructor(t){h(this,"state",M4e);h(this,"core");this.core=t}update(t){let r={};for(let[n,o]of Object.entries(t))n in this.state&&this.state[n]!==t[n]&&(this.state[n]=o,r[n]=o);this.handleUpdate(r)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};s(b6,"Debug");var US=b6;d();var e1=9,O4e=!1,gQ=.1;function E4e(e,t,r){for(let n=0;n<t;n++){let o=(r&16711680)>>16,i=(r&65280)>>8,a=r&255;e[n*3]=o/255,e[n*3+1]=i/255,e[n*3+2]=a/255}}s(E4e,"fillArrayWithColor");var v6=class v6{constructor(t,r,n){h(this,"state");h(this,"renderer");h(this,"renderService");h(this,"pickingTexture");h(this,"pickingMaterial");h(this,"pixelBuffer");h(this,"width",0);h(this,"height",0);h(this,"scale",1/2);h(this,"color",1);h(this,"convertTo3DMapPosition");h(this,"destroyed",!1);h(this,"enabled",!1);h(this,"backgroundId",16777215);h(this,"resize",s(()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new c8(this.width,this.height,{format:g0,type:n8,internalFormat:"RGBA"})},"resize"));h(this,"shouldShowByXY",s((t,r,n)=>{if(this.pixelBuffer==null)return!1;let o=t+(this.height-r-1)*this.width,i=this.pixelBuffer[o*4],a=this.pixelBuffer[o*4+1],l=this.pixelBuffer[o*4+2],c=i<<16|a<<8|l;return c===n||c===this.backgroundId},"shouldShowByXY"));h(this,"activeOccluders",new Set);h(this,"update",s(()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,r;for(let o of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(o);if(i&&i instanceof ut&&i.userData.occluderFeature!=null&&i.userData.occluderId!=null&&(this.activeOccluders.add(i.userData.occluderId),i.userData.occluderDirty)){if(t=i.userData.occluderFeature,t.geometry.type==="Polygon"){let a=rS(t,this.convertTo3DMapPosition,{color:"white",height:gQ});r=this.createOccluderMesh(a,i.userData.occluderId),i.add(r)}else if(t.geometry.type==="MultiPolygon"){let a=nS(t,this.convertTo3DMapPosition,{color:"white",height:gQ});r=this.createOccluderMesh(a,i.userData.occluderId),i==null||i.add(r)}i.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new Lt(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(e1),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(e1),O4e?this.renderService.enabledLayers.add(e1):this.renderService.enabledLayers.delete(e1),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let o of this.state.geometry2DIdsInScene){let i=this.state.geometry2DMap.get(o);if(i&&(i==null?void 0:i.occluderId)!=null&&this.activeOccluders.has(i==null?void 0:i.occluderId)){let a=i.components[0].projection,l=Math.floor(a.x*this.scale),c=Math.floor(a.y*this.scale),p=this.shouldShowByXY(l,c,i.occluderId);i.components[0].isOccluded=!p}}})},"update"));if(this.state=t,this.convertTo3DMapPosition=r,(n==null?void 0:n.renderer)==null)throw new Error("No Renderer");this.renderService=n,this.renderer=n.renderer,this.resize(),this.pickingMaterial=new gu({glslVersion:s8,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,r){let n=t.attributes.position,o=new Float32Array(n.count*3);E4e(o,n.count,r),t.setAttribute("color",new Ea(o,3))}createOccluderMesh(t,r){let n=new ze(t,this.pickingMaterial);return n.layers.set(e1),this.applyId(n.geometry,r),n.userData.occluderId=r,n}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};s(v6,"Occlusion2DSystem");var VS=v6;var bQ=new xs;var{DEFAULT_PITCH:P6,DEFAULT_BEARING:T6,DEFAULT_ZOOM_LEVEL:w6,DEFAULT_MIN_ZOOM_LEVEL:_4e,DEFAULT_MAX_ZOOM_LEVEL:A4e}=Si,k4e=Ke.radToDeg(.6435011087932844),wr,Sr,sd,t1,uh,Jc,ad,ph,bn,I6,z,Gt,ss,Cr,ma,rn,V,r1,Br,Wt,vQ,xQ,IQ,Qc,n1,o1,i1,s1,zS,a1,l1,c1,dh,S6,ld,u1,ro,no,C6,fh,p1,M6=class M6 extends Fe{constructor(r,n={}){var y,v,x,S,I,P,T,M,w,E,B;super();O(this,bn);h(this,"options");h(this,"container");h(this,"Debug");O(this,wr);O(this,Sr);O(this,sd);O(this,t1);O(this,uh);O(this,Jc);O(this,ad);O(this,ph);h(this,"rendererDomElement");O(this,z,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new ut("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:Jh,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new DE,cameraObject:new y3,naturalBearing:0,containerOffset:[0,0]});h(this,"camera");O(this,Gt);O(this,ss);O(this,Cr);O(this,ma);O(this,rn);O(this,V,{});O(this,r1,window.matchMedia("screen and (min-resolution: 2dppx)"));h(this,"map");O(this,Br,s(()=>{u(this,V).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));O(this,Wt,s(()=>{u(this,V).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));O(this,Qc,"standalone");O(this,n1,s(r=>Math.trunc(r*10)/10,"#round10"));O(this,o1,s(()=>{u(this,V).twoDDrawSystem.dirty=!0,te(this,bn,I6).call(this,Fd()),u(this,V).watermarkSystem.dirty=!0,u(this,V).occlusion2DSystem.resize(),this.render()},"#handlePixelRatioChange"));O(this,i1,s(()=>{u(this,s1).call(this)},"#handleWindowResizeWithEvent"));O(this,s1,s((r,n)=>{let o=r!=null?r:this.rendererDomElement.clientWidth,i=n!=null?n:this.rendererDomElement.clientHeight;if(o===0||i===0)return;u(this,z).canvasWidth=o,u(this,z).canvasHeight=i,te(this,bn,I6).call(this,Fd()),u(this,dh).call(this),te(this,bn,IQ).call(this),u(this,V).cameraSystem.resize(this.canvasWidth,this.canvasHeight),u(this,V).cameraSystem.dirty=!0,u(this,V).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),u(this,V).htmlControlsSystem.resize(this.canvasWidth),u(this,V).geometryInFocusSystem.resize(),u(this,V).occlusion2DSystem.resize();let{top:a,left:l}=this.container.getBoundingClientRect();u(this,z).containerOffset=[a,l],this.publish("resize"),this.render()},"#handleWindowResize"));O(this,zS,s(()=>{this.renderSync()},"#renderFull"));O(this,a1,new Pe);O(this,l1,s((r,n)=>{let o=this.mode==="standalone"?u(this,Sr):this.viewCamera;if(u(this,Sr).position.z+this.camera.elevation>n.z){u(this,a1).copy(n);let i=u(this,a1).project(o),a=(i.x+1)/2*this.canvasWidth-0/2,l=(-i.y+1)/2*this.canvasHeight-0/2,c=u(this,n1).call(this,a),p=u(this,n1).call(this,l);r.x=c,r.y=p}else r.x=-1e3,r.y=-1e3},"#project"));O(this,c1,s((r,n)=>{u(this,rn).setBufferSize(r,n),u(this,Sr).aspect=r/n,u(this,Sr).updateProjectionMatrix(),u(this,Sr).updateMatrixWorld(!0),u(this,uh).x=r,u(this,uh).y=n},"#setBufferSize"));O(this,dh,s(()=>{var a;let r=u(this,z).canvasWidth=this.rendererDomElement.clientWidth,n=u(this,z).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(r*this.resolutionScale),i=Math.floor(n*this.resolutionScale);u(this,c1).call(this,o,i),(a=this.map)==null||a.resize(),u(this,z).shouldMeasureCanvas=!1},"#measureCanvas"));h(this,"getParentContainer",s((r,n=!0)=>{if(!r)return n?u(this,z).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let o=u(this,z).geometry3DMap.get(r);return o instanceof ut?o:(j.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?u(this,z).entityScene:void 0)}else if(r.type==="group-container"){let o=u(this,z).geometry3DMap.get(r.id);if(o instanceof ut)return o}return n?u(this,z).entityScene:void 0},"getParentContainer"));h(this,"showCollisionBoxes",s(()=>{u(this,V).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));h(this,"hideCollisionBoxes",s(()=>{u(this,V).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));h(this,"projectScreenXYToCoordinate",s((r,n,o=!1)=>{var y,v;let i=u(this,z).containerOffset[0],a=u(this,z).containerOffset[1],l=(r-a)/u(this,z).canvasWidth*2-1,c=-((n-i)/u(this,z).canvasHeight)*2+1,p=new _e(l,c),f,m;if(o)bQ.setFromCamera(p,u(this,Sr)),f=(y=bQ.intersectObject(u(this,Jc),!1)[0])==null?void 0:y.point;else{let x=u(this,V).interactionSystem.getThreeDIntersectsFromXY(p);f=(v=x==null?void 0:x[0])==null?void 0:v.point,m=u(this,V).interactionSystem.getGroupContainerIntersectsFromXY(p)}if(f)return{coordinate:this.convert3DMapPositionToCoordinate(f),groupContainers:m}},"projectScreenXYToCoordinate"));h(this,"projectCoordinateToScreenXY",s(r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),o=new _e;return u(this,l1).call(this,o,n),{x:o.x,y:o.y}},"projectCoordinateToScreenXY"));h(this,"convert3DMapPositionToCoordinate",s(r=>{var i,a,l,c;let{lat:n,lon:o}=M0((a=(i=u(this,z).center)==null?void 0:i[1])!=null?a:0,(c=(l=u(this,z).center)==null?void 0:l[0])!=null?c:0,r.x,r.y);return[o,n,r.z]},"convert3DMapPositionToCoordinate"));h(this,"setBackgroundColor",s((r,n)=>{u(this,rn).setBackgroundColor(r,n)},"setBackgroundColor"));h(this,"getMetresPerPixel",s(()=>{let r=this.container.clientWidth,n=this.container.clientHeight/2,o=this.projectScreenXYToCoordinate(0,n,!0),i=this.projectScreenXYToCoordinate(r,n,!0);return o==null||i==null?void 0:C0(o.coordinate,i.coordinate)/r},"getMetresPerPixel"));h(this,"hideOutdoorLayersUnderPoint",s((r,n)=>{!this.map||(n==null?void 0:n.length)===0||(u(this,V).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())},"hideOutdoorLayersUnderPoint"));h(this,"hideOutdoorLayersIntersectingPolygons",s((r,n,o)=>{u(this,V).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,o),this.render()},"hideOutdoorLayersIntersectingPolygons"));O(this,ld,new m8);O(this,u1,new wi);h(this,"render",s(()=>{var r;if(((r=u(this,V))==null?void 0:r.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return u(this,V).renderSystem.update()},"render"));h(this,"renderSync",s(()=>u(this,V).renderSystem.update(!0),"renderSync"));O(this,ro,Ld(()=>{this.publish("user-interaction-start",void 0)},0,!0));O(this,no,Ld(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));h(this,"on",s((r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&b.env.NODE_ENV!=="test"&&(j.warn('"'.concat(r,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(r))},"on"));h(this,"off",s((r,n)=>{super.off(r,n)},"off"));h(this,"getCursor",s(()=>u(this,V).interactionSystem.getCursor(),"getCursor"));h(this,"destroy",s(()=>{var r;u(this,V)&&(u(this,V).cameraSystem.off("user-dolly-start",u(this,ro)),u(this,V).cameraSystem.off("user-pan-start",u(this,ro)),u(this,V).cameraSystem.off("user-rotate-start",u(this,ro)),u(this,V).cameraSystem.off("user-zoom-start",u(this,ro)),u(this,V).cameraSystem.off("user-tilt-start",u(this,ro)),u(this,V).cameraSystem.off("user-pedestal-start",u(this,ro)),u(this,V).cameraSystem.off("user-dolly-end",u(this,no)),u(this,V).cameraSystem.off("user-pan-end",u(this,no)),u(this,V).cameraSystem.off("user-rotate-end",u(this,no)),u(this,V).cameraSystem.off("user-zoom-end",u(this,no)),u(this,V).cameraSystem.off("user-tilt-end",u(this,no)),u(this,V).cameraSystem.off("user-pedestal-end",u(this,no)),u(this,V).renderSystem.off("measure-canvas",u(this,dh)),u(this,V).meshOptimizationSystem.off("geometry-2d-added",this.render),u(this,V).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),u(this,Br).call(this),u(this,Wt).call(this),this.renderSync(),u(this,V).renderSystem.destroy(),u(this,V).cameraSystem.off("change",this.render),u(this,V).pathSystem.off("animate:path",this.render),u(this,V).cameraSystem.dispose(),u(this,V).exporterSystem.destroy(),u(this,V).outdoorLayersSystem.destroy(),u(this,V).drawSystem.destroy(),window.removeEventListener("resize",u(this,i1),!1),u(this,r1).removeEventListener("change",u(this,o1)),u(this,ad)&&u(this,ad).disconnect(),this._subscribers={},u(this,rn).destroy(),(r=u(this,wr))==null||r.traverse(n=>{hr(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),A(this,wr,void 0),u(this,V).htmlControlsSystem.destroy(),u(this,V).collisionSystem.destroy(),u(this,V).interactionSystem.destroy(),u(this,V).domMutationSystem.destroy(),u(this,V).geometryInFocusSystem.destroy(),A(this,V,void 0),u(this,Qc)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(u(this,ma)),this.container.removeChild(u(this,Gt)),A(this,rn,void 0))},"destroy"));O(this,fh,new Pe);O(this,p1,new Pe);if(u(this,z).naturalBearing=(y=n.naturalBearing)!=null?y:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!r.clientWidth||!r.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(n.mode==="outdoors-interleaved"||n.mode==="outdoors-overlay")&&n.map&&(A(this,Qc,n.mode),this.map=n.map),u(this,z).entityScene.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),u(this,z).entityScene.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),u(this,z).geometry3DMap.set(u(this,z).entityScene.userData.entityId,u(this,z).entityScene),n.center&&(u(this,z).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,te(this,bn,vQ).call(this),te(this,bn,xQ).call(this),u(this,V).htmlControlsSystem=new ES(this.container),u(this,Qc)!=="outdoors-overlay"&&u(this,V).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),b.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),A(this,rn,new aI({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(v=n.gl)==null?void 0:v.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:s(D=>{var F;(F=n.onWebGLContextRestored)==null||F.call(n,D),u(this,Br).call(this),u(this,Wt).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(x=n.backgroundAlpha)!=null?x:1})),A(this,wr,new Xl),u(this,wr).add(u(this,z).entityScene);let o=window.__THREE_DEVTOOLS__;b.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:u(this,wr)})),o.dispatchEvent(new CustomEvent("observe",{detail:u(this,rn)}))),A(this,Sr,new y3(k4e,this.aspect,50,1e5)),u(this,z).cameraObject=u(this,Sr),A(this,t1,new d8),u(this,Sr).renderOrder=999;let i=new Oa;i.add(u(this,Sr)),A(this,ph,new Oa),u(this,ph).add(i),u(this,wr).add(u(this,ph)),u(this,Sr).updateProjectionMatrix(),u(this,Sr).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:s(()=>0,"getNorth"),georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=u(this,rn).domElement(),A(this,uh,new _e);let a=new Oi(1e6,1e6),l=new jr({color:0,visible:!1});A(this,Jc,new ze(a,l)),u(this,Jc).name="worldPlane",u(this,wr).add(u(this,Jc)),(S=n.gl)!=null&&S.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",u(this,i1),!1),u(this,r1).addEventListener("change",u(this,o1)),typeof ResizeObserver=="function"&&((I=b.env)==null?void 0:I.NODE_ENV)!=="test"&&(A(this,ad,new ResizeObserver(R8(D=>{u(this,s1).call(this,D[0].contentRect.width,D[0].contentRect.height)},50))),(P=u(this,ad))==null||P.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(T=globalThis.MappedinDebug)!=null&&T.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(M=globalThis.MappedinDebug)!=null&&M.TEST_IOS?"1920px":"100%",b.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),u(this,z).canvasWidth=this.rendererDomElement.clientWidth,u(this,z).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let c=this.canvasWidth,p=this.canvasHeight;u(this,V).watermarkSystem=new TS(u(this,Sr),u(this,z),n==null?void 0:n.watermark),u(this,V).watermarkSystem.on("texture-loaded",this.render),u(this,z).shouldMeasureCanvas=!0,u(this,z).pixelRatio=this.resolutionScale,u(this,c1).call(this,Math.floor(c*this.resolutionScale),Math.floor(p*this.resolutionScale));let f=new I0(16777215,.3*Math.PI);f.position.set(-150,-150,350),u(this,wr).add(f);let m=new b8(16777215,.741*Math.PI);u(this,wr).add(m),u(this,V).cameraSystem=new ih(u(this,Sr),u(this,wr),u(this,rn).renderer,u(this,z),{mode:this.mode,canvasHeight:p,canvasWidth:c}),u(this,V).cameraSystem.on("user-dolly-start",u(this,ro)),u(this,V).cameraSystem.on("user-pan-start",u(this,ro)),u(this,V).cameraSystem.on("user-rotate-start",u(this,ro)),u(this,V).cameraSystem.on("user-zoom-start",u(this,ro)),u(this,V).cameraSystem.on("user-tilt-start",u(this,ro)),u(this,V).cameraSystem.on("user-pedestal-start",u(this,ro)),u(this,V).cameraSystem.on("user-dolly-end",u(this,no)),u(this,V).cameraSystem.on("user-pan-end",u(this,no)),u(this,V).cameraSystem.on("user-rotate-end",u(this,no)),u(this,V).cameraSystem.on("user-zoom-end",u(this,no)),u(this,V).cameraSystem.on("user-tilt-end",u(this,no)),u(this,V).cameraSystem.on("user-pedestal-end",u(this,no)),u(this,V).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),u(this,V).geometryInFocusSystem&&(u(this,V).geometryInFocusSystem.cameraDirty=!0),this.render()}),u(this,V).pathSystem=new Qb(u(this,z),this.convertTo3DMapPosition,this.getParentContainer,u(this,V).cameraSystem.convertZoomLevelToAltitude),u(this,V).pathSystem.on("animate:path",this.render),u(this,V).panBoundsSystem=new OS(u(this,z),u(this,V).cameraSystem),u(this,V).panBoundsSystem.on("update",()=>{let{panBounds:D,fov:F,convertAltitudeToZoomLevel:L}=u(this,V).cameraSystem;if(u(this,V).panBoundsSystem.autoMinZoomLevel){if(D.radius<=0)return;let H=Math.min(u(this,z).canvasWidth/u(this,z).canvasHeight,1),U=F*Math.PI/180*H,G=Math.tan(U/2),{radius:J,center:X}=u(this,V).cameraSystem.panBounds,ie=J/G,ee=this.getThreeCamera().getWorldPosition(new Pe),be=X.distanceTo(ee),ve=Math.abs(ee.z-X.z),de=ie*ve/be,Ae=L(de);K8(Ae,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(Ae)}}),this.camera=new PS(this,u(this,V),u(this,z)),this.camera.setZoomLevel((w=n.zoomLevel)!=null?w:w6),this.camera.setBearing((E=n.bearing)!=null?E:T6),this.camera.setPitch((B=n.pitch)!=null?B:P6),this.camera.setMaxZoomLevel(A4e),this.camera.setMinZoomLevel(_4e),u(this,V).domVisiblitySystem=new sS(u(this,z),u(this,ma)),u(this,V).domMutationSystem=new CS(u(this,z),u(this,ma)),u(this,V).domMutationSystem.on("dimensions-update",()=>{u(this,V).collisionSystem.collidersDirty=!0,this.render()}),u(this,V).domDrawSystem=new IS(u(this,z)),u(this,V).collisionSystem=new lI(u(this,ss),u(this,z)),u(this,V).twoDDrawSystem=new lS(u(this,z),u(this,Cr),n.transformImageRequest),u(this,V).twoDDrawSystem.on("img:loaded",this.render),u(this,V).interactionSystem=new nb(this.rendererDomElement,u(this,z),u(this,Sr),u(this,Jc),u(this,V).cameraSystem.isUserInteracting),u(this,V).interactionSystem.on("doubletap-with-onefinger",D=>{var F;this.camera.animateTo({center:(F=this.projectScreenXYToCoordinate(D.clientX,D.clientY))==null?void 0:F.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:P3,easing:"ease-out"})}),u(this,V).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:P3,easing:"ease-out"})}),u(this,V).interactionSystem.on("hover",this.render),u(this,V).interactionSystem.on("click",D=>{var F,L,H,U,G,J;if(((F=D.entity2D)==null?void 0:F.id)==="watermark"&&typeof u(this,V).watermarkSystem.options.onClick=="function"&&u(this,V).watermarkSystem.options.interactive){u(this,V).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(L=D.entity3D)==null?void 0:L.id]:[],paths:((H=D.entity3D)==null?void 0:H.components[0])instanceof qc?[D.entity3D.id]:[],markers:((U=D.entity2D)==null?void 0:U.components[0])instanceof la?[D.entity2D.id]:[],models:((G=D.entity3D)==null?void 0:G.components[0])instanceof zc?[D.entity3D.id]:[],labels:((J=D.entity2D)==null?void 0:J.components[0])instanceof ca?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(X=>X.userData.entityId):[],pointerEvent:D.pointerEvent})}),u(this,V).interactionSystem.on("hover",D=>{var F,L,H,U,G,J;D.position&&((F=D.entity2D)==null?void 0:F.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(L=D.entity3D)==null?void 0:L.id]:[],paths:((H=D.entity3D)==null?void 0:H.components[0])instanceof qc?[D.entity3D.id]:[],markers:((U=D.entity2D)==null?void 0:U.components[0])instanceof la?[D.entity2D.id]:[],models:((G=D.entity3D)==null?void 0:G.components[0])instanceof zc?[D.entity3D.id]:[],labels:((J=D.entity2D)==null?void 0:J.components[0])instanceof ca?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(X=>X.userData.entityId):[]})}),u(this,V).geometryInFocusSystem=new NS(u(this,z),u(this,Sr)),u(this,V).geometryInFocusSystem.on("geometry-in-focus",D=>{this.publish("geometry-in-focus",D)}),u(this,V).twoDVisiblitySystem=new uS(u(this,z)),u(this,V).drawSystem=new cS(u(this,z),this.convertTo3DMapPosition),u(this,V).drawSystem.on("texture-loaded",this.render),u(this,V).stackSystem=new dS(u(this,z)),u(this,V).twoDProjectionSystem=new aS(u(this,z),u(this,l1)),u(this,V).exporterSystem=new Ob(u(this,z)),u(this,V).meshOptimizationSystem=new iS(u(this,z),this.convertTo3DMapPosition),u(this,V).meshOptimizationSystem.on("model-loaded",this.render),u(this,V).meshOptimizationSystem.on("geometry-2d-added",this.render),u(this,V).meshDetachmentSystem=new jS(u(this,z)),u(this,V).meshModificationSystem=new GS(u(this,z)),u(this,V).customGeometrySystem=new _S(u(this,z),this.convertTo3DMapPosition),u(this,V).outlineInterpolationSystem=new AS(u(this,z)),u(this,V).renderSystem=new pS(u(this,rn),u(this,z),this.mode,u(this,wr),u(this,Sr),this.viewCamera,u(this,V)),u(this,V).imageSystem=new RS(u(this,z),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),u(this,V).text3DSystem=new GI(u(this,z),this.convertTo3DMapPosition),u(this,V).text3DSystem.on("render",this.render),u(this,V).imageSystem.on("image-loaded",this.render),u(this,V).renderSystem.on("pre-render",()=>this.publish("pre-render")),u(this,V).renderSystem.on("post-render",()=>this.publish("post-render")),u(this,V).renderSystem.on("measure-canvas",u(this,dh)),u(this,V).outdoorLayersSystem=new BS(this.map),u(this,V).occlusion2DSystem=new VS(u(this,z),this.convertTo3DMapPosition,u(this,rn)),n.occlusionEnabled&&u(this,V).occlusion2DSystem.enable(),this.Debug=new US(this),n.environment!==!1&&A(this,sd,te(this,bn,C6).call(this)),u(this,zS).call(this)}get viewCamera(){return u(this,t1)}get canvasWidth(){return u(this,z).canvasWidth}get canvasHeight(){return u(this,z).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:Fd()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return u(this,Qc)}addGroupContainer(r,n,o){if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let i=new ut(r);i.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),i.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),(n==null?void 0:n.altitude)!==void 0&&i.setAltitude(n.altitude),(n==null?void 0:n.interactive)!==void 0&&gn(i,n.interactive,u(this,z)),(n==null?void 0:n.focusable)!==void 0&&fE(i,n.focusable),u(this,z).geometry3DMap.set(r,i);let a=this.getParentContainer(o);a instanceof ut&&a.addEntity(i),u(this,Wt).call(this),this.render()}else j.error("Group container with ID '".concat(r,"' already exists. The group container cannot be added."));return{id:r,type:"group-container"}}addStackContainer(r,n,o){if(u(this,z).geometry3DMap.has(r))j.error("Stack container with ID '".concat(r,"' already exists. The stack container cannot be added."));else{let i=new ut(r);i.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),i.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),i.components[0]=new SS,(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),u(this,z).geometry3DMap.set(r,i);let a=this.getParentContainer(o);a instanceof ut&&a.addEntity(i)}return{id:r,type:"stack-container"}}addCustomGeometry(r,n,o,i,a){if(u(this,z).geometry3DMap.has(r))j.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let l=new ah(n,o),c=new wt(l,new Ps(i));(i==null?void 0:i.interactive)!==void 0&&gn(c,i.interactive,u(this,z)),c.id=r,l.mesh.userData={entityId:r,type:"custom-geometry"},u(this,z).geometry3DMap.set(c.id,c);let p=this.getParentContainer(a);p instanceof ut&&p.addEntity(c),u(this,Wt).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,o,i){var a,l;if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let c=new Sn(r,new S3(o));c.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),c.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),c.userData.dirty=!0,u(this,z).geometry3DMap.set(r,c);for(let f of n.features){if(f.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(f.geometry.type))continue;let m=(f==null?void 0:f.id)||((a=f==null?void 0:f.properties)==null?void 0:a.id)||_t(),{visible:y,...v}=o||{color:D8},x=u(this,V).meshOptimizationSystem.createEntityFromFeature(m,f,{...v,outline:!0});u(this,z).geometry3DMap.set(m,x),c.userData.entities3D.add(m)}c.setVisible((l=o==null?void 0:o.visible)!=null?l:!0),(o==null?void 0:o.altitude)!=null&&c.setAltitude(o.altitude);let p=this.getParentContainer(i);p instanceof ut&&p.addEntity(c),u(this,Wt).call(this),this.render()}else j.error("Geometry group with ID '".concat(r,"' already exists. The geometry group cannot be added."));return u(this,V).outlineInterpolationSystem.geometries3DDirty=!0,{id:r,type:"geometry-group"}}addOccluder(r,n){let o=this.getParentContainer(n),i=u(this,V).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(r,i),i}addImage(r,n,o,i){try{sQ(r,n,o)}catch(a){j.error(a);return}if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let a=new LS(n),l=new wt(a,new Ps(o));l.id=r||_t(),a.mesh.userData={entityId:l.id,type:"path"},u(this,z).geometry3DMap.set(l.id,l);let c=this.getParentContainer(i);c instanceof ut&&c.addEntity(l),u(this,Wt).call(this),this.render()}else j.error("Image with ID '".concat(r,"' already exists. The image cannot be added."));return{id:r,type:"image"}}addModelGroup(r,n,o,{parent:i,onComplete:a}={}){var l,c;try{BJ(r,n,o)}catch(p){j.error(p);return}if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let p=new Sn(r,new S3({...o,outline:!1}));p.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),p.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(this,Br).call(this)}),u(this,z).geometry3DMap.set(r,p),p.userData.dirty=!0,p.userData.modelURL=o.url;for(let m of n.features){let y=m.id||m.properties.id||_t(),v=u(this,V).meshOptimizationSystem.createModelFromFeature(y,m,o);(m.properties.interactive!==void 0||o.interactive!=null)&&gn(v,(l=m.properties.interactive)!=null?l:o.interactive,u(this,z)),u(this,z).geometry3DMap.set(y,v),p.userData.entities3D.add(y)}let f=this.getParentContainer(i);f instanceof ut&&f.addEntity(p),u(this,Wt).call(this),(c=this.render())==null||c.then(a)}else j.error("Model group with ID '".concat(r,"' already exists. The model group cannot be added."));return{id:r,type:"geometry-group"}}addMarker2D(r,n,o,i){var l;let a=o==null?void 0:o.id;try{sK(r,n,o||{})}catch(c){j.error(c);return}if(a===void 0||!u(this,z).geometry2DMap.has(a)&&!u(this,z).geometry3DMap.has(a)){let c=te(this,bn,S6).call(this,r,new la(n,o),o==null?void 0:o.occluderId,o==null?void 0:o.verticalOffset);c.id=a||String(c.id),a=c.id,(o==null?void 0:o.interactive)!=null&&o.interactive!=="pointer-events-auto"&&gn(c,o==null?void 0:o.interactive,u(this,z));let p=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?u(this,z).geometry3DMap.get(o.attachTo):void 0;p instanceof wt&&p.attach(c),(l=this.getParentContainer(i))==null||l.addEntity(c),this.render()}else j.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}addText3D(r,n,o,i){if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let a=new jc({...n,properties:{...n.properties,id:r,content:n.properties.text}}),l=new wt(a,new ey(o==null?void 0:o.appearance));l.id=r,a.mesh.userData.entityId=r.toString(),a.mesh.userData.type="text3d",u(this,z).geometry3DMap.set(r,l);let c=this.getParentContainer(i);c instanceof ut&&c.addEntity(l),u(this,Wt).call(this),this.render()}else j.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,o={}){var p,f;try{if(!n||!r)throw new Error("content and meshGeometryId are required");JK.parse(o)}catch(m){j.error(m);return}let i=u(this,z).geometry3DMap.get(r);if((i==null?void 0:i.type)!=="geometry"){j.error(".labelText3D failed: target incorrect");return}let a=i==null?void 0:i.components[0];if(!a.feature.properties.textArea)return;if(a.textEntityId){let m=u(this,z).geometry3DMap.get(a.textEntityId);if((m==null?void 0:m.type)!=="text3d"){j.error(".labelText3D failed: existing text3d not found");return}return{id:m.id,type:m.type}}let l=new jc({type:"Feature",geometry:{coordinates:(p=a.feature.properties.textArea)==null?void 0:p.position,type:"Point"},properties:{textArea:a.feature.properties.textArea,content:n,id:_t()}});l.polygonEntityId=r;let c=new wt(l,new ey(o==null?void 0:o.appearance));return a.textEntityId=c.id.toString(),l.mesh.userData.entityId=c.id.toString(),l.mesh.userData.type="text3d",u(this,z).geometry3DMap.set(c.id.toString(),c),o.parentId&&((f=this.getParentContainer(o.parentId))==null||f.addEntity(c)),this.render(),{id:c.id,type:"text3d"}}addLabel2D(r,n,o,i){var l;let a=o==null?void 0:o.id;try{ZK(r,n,o||{})}catch(c){j.error(c);return}if(a===void 0||!u(this,z).geometry2DMap.has(a)&&!u(this,z).geometry3DMap.has(a)){let c=te(this,bn,S6).call(this,r,new ca(n,o||{},u(this,z)),o==null?void 0:o.occluderId,o==null?void 0:o.verticalOffset);c.id=a||String(c.id),a=c.id,(o==null?void 0:o.interactive)!=null&&gn(c,o==null?void 0:o.interactive,u(this,z));let p=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?u(this,z).geometry3DMap.get(o.attachTo):void 0;p instanceof wt&&p.attach(c),(l=this.getParentContainer(i))==null||l.addEntity(c),u(this,Br).call(this),this.render()}else j.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(r,n={},o){var c;try{UJ(r,n||{})}catch(p){j.error(p);return}let i=new qc(r,mE(n)),a=new wt(i,new Ps({color:(c=n==null?void 0:n.color)!=null?c:"#ff834c"}));a.id=(n==null?void 0:n.id)||_t(),i.mesh.userData={entityId:a.id,type:"path"},u(this,z).geometry3DMap.set(a.id,a),(n==null?void 0:n.interactive)!=null&&gn(a,n==null?void 0:n.interactive,u(this,z));let l=this.getParentContainer(o);return l instanceof ut&&l.addEntity(a),u(this,Wt).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(r){u(this,V).watermarkSystem.options=r,u(this,V).watermarkSystem.dirty=!0,u(this,V).collisionSystem.collidersDirty=!0,this.render()}remove(r){var o;let n;if(typeof r=="string"||typeof r=="number"?(n=u(this,z).geometry2DMap.get(r),n==null&&(n=u(this,z).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=u(this,z).geometry2DMap.get(r.id),n==null&&(n=u(this,z).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")u(this,z).geometry3DMap.delete(n.id),n.object3d&&hr(n.object3d);else if(n.type==="group-container"){u(this,z).geometry3DMap.delete(n.userData.entityId);for(let a of n.childrenIds.values())this.remove(a),n.userData.entities2D.delete(a);let i=n.components[2];i&&i.focusMesh&&hr(i.focusMesh),hr(n)}else if(n.type==="geometry-group"){u(this,z).geometry3DMap.delete(n.userData.entityId);for(let i of n.userData.entities3D.values())this.remove(i),n.userData.entities3D.delete(i);hr(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let i=n.components[0];if(n.entities2D.size>0){for(let a of n.entities2D.values())this.remove(a);n.removeAllEntities()}if(n.object3d&&(((o=n.parentObject3D)==null?void 0:o.type)==="geometry-group"&&n.parentObject3D.userData.entities3D.delete(n.id),hr(n.object3d)),n.type==="geometry"){let a=n.components[3];a&&(a.visible=!1,a.dirty=!0)}"focusMesh"in i&&i.focusMesh!=null&&hr(i.focusMesh),"textMesh"in i&&i.textMesh!=null&&this.remove(i.textMesh.userData.entityId),u(this,z).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let i=n.attachedTo;if(i){let a=u(this,z).geometry3DMap.get(i);a instanceof wt&&a.detach(n)}n.object3d&&hr(n.object3d),n.type==="label"&&delete u(this,V).twoDDrawSystem.textCache[n.id],u(this,z).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&hr(n.object3d),u(this,z).geometry3DMap.delete(n.id);else if(n.type==="text3d"){hr(n.object3d);let{batchedText:i,textMesh:a,polygonEntityId:l}=n.components[0];if(a&&(i&&i.removeText(a),hr(a)),l){u(this,V).text3DSystem.remove(l);let c=u(this,z).geometry3DMap.get(l);(c==null?void 0:c.type)==="geometry"&&(c.components[0].textMesh=void 0,c.components[0].textEntityId=void 0)}u(this,z).geometry3DMap.delete(n.id)}u(this,Wt).call(this),u(this,Br).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return u(this,wr)}getThreeCamera(){return u(this,Sr)}async setEnvironment(r){if(u(this,wr))if(r==="basic"){u(this,sd)||A(this,sd,te(this,bn,C6).call(this));let n=await u(this,sd);u(this,wr).environment=n}else u(this,wr).environment=null}getEnvironment(){var r;return(r=u(this,wr))!=null&&r.environment?"basic":!1}getCurrentSceneGLTF(r){return u(this,V).exporterSystem.getCurrentSceneGLTF(r)}getBoundingArea(r){(u(this,V).renderSystem.threeDdirty||u(this,V).renderSystem.twoDdirty)&&this.renderSync();let n=new Jr;if(r==null)n.setFromObject(u(this,z).entityScene);else{let o=Qh(u(this,z),r);if((o==null?void 0:o.type)==="geometry"&&(o==null?void 0:o.object3d)!=null){let i=o.components[0],a=i instanceof gr?i.geometry:void 0;i.mesh instanceof b0&&a?(a.computeBoundingBox(),a.boundingBox&&n.union(a.boundingBox)):n.setFromObject(o.object3d)}else((o==null?void 0:o.type)==="geometry-group"||(o==null?void 0:o.type)==="group-container")&&(o==null?void 0:o.userData.entityId)!=null&&n.setFromObject(o)}if(bu(n))return B8(n).map(this.convert3DMapPositionToCoordinate)}getState(r){var o,i,a,l,c,p,f,m,y,v;if(r==null)return{type:"map-view",hoverColor:u(this,z).hoverColor,text3dHoverColor:u(this,z).text3dHoverColor};let n=Qh(u(this,z),r);if((n==null?void 0:n.type)==="custom-geometry"){let x=n.components[0],S=n.components[1];return{id:n.id,type:"custom-geometry",visible:S.visible,altitude:S.altitude,parent:(o=n.parentObject3D)==null?void 0:o.userData.entityId,position:this.convert3DMapPositionToCoordinate(x.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let x=[];for(let I of n.userData.entities3D.values()){let P=this.getState(I);((P==null?void 0:P.type)==="geometry"||(P==null?void 0:P.type)==="model")&&x.push(P)}let S=n.components[0];return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,opacity:S.opacity,color:S.color,initialColor:S.initialColor,height:S.height,altitude:n.altitude,topColor:S.topColor,outline:S.outline,shading:S.shading,texture:S.texture,topTexture:S.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(I=>u(this,z).geometry3DMap.get(I)).every(I=>I&&I.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(I=>this.getState(I)).filter(Boolean)}}else{if((n==null?void 0:n.type)==="group-container")return{id:n.userData.entityId,type:"group-container",visible:n.visible,altitude:n.altitude,opacity:n.opacity,interactive:!!n.components[1],children:Array.from(n.childrenIds.values()).map(x=>this.getState(x)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let x=n.components[0],S=n.object3d.parent,I=S==null?void 0:S.userData.entityId;return{id:n.id,type:"label",text:x.text||"",parent:{id:I,type:S==null?void 0:S.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:x.enabled,visible:x.visible,initialRank:tb(x.initialRank),options:{rank:tb(x.rank),appearance:x.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let x=n.components[0],S=n.object3d.parent,I=S==null?void 0:S.userData.entityId;return{id:n.id,type:"marker",enabled:x.enabled,visible:x.visible,anchor:x.options.anchor,dynamicResize:x.options.dynamicResize,parent:{id:I,type:S==null?void 0:S.type},position:this.convert3DMapPositionToCoordinate(n.position),element:x.containerEl,initialRank:tb(x.initialRank),options:{rank:tb(x.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:x.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:x,hoverColor:S,initialColor:I,initialTopColor:P,topColor:T}=n.components[1],M=n.components[0],w=n.components[1],E=n.components[2],B=n.components[3],D=n.parentObject3D;return{id:n.id,type:"geometry",opacity:w.opacity,initialColor:I,color:x,focusable:M.focusable,initialTopColor:P,topColor:T,hoverColor:S,hovered:!!(E!=null&&E.hover),height:w.height,visible:w.visible,outline:B==null?void 0:B.visible,showImage:w.showImage,texture:w.texture,topTexture:w.topTexture,flipImageToFaceCamera:w.flipImageToFaceCamera,parent:{id:D==null?void 0:D.userData.entityId,type:D==null?void 0:D.type},position:this.convert3DMapPositionToCoordinate(M.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let x=n.components[0],S=n.components[1],I=n.components[2];return{id:n.id,type:"model",position:x.mesh?this.convert3DMapPositionToCoordinate((i=x.mesh)==null?void 0:i.getWorldPosition(new Pe)):this.convert3DMapPositionToCoordinate(x.position),interactive:I!=null,material:S.material,parent:(a=n.parentObject3D)!=null&&a.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:S.visible,verticalOffset:S.verticalOffset,color:S.color,opacity:S.opacity,rotation:(l=S.rotation)!=null?l:Bd,scale:(c=S.scale)!=null?c:Nd}}else if((n==null?void 0:n.type)==="path"){let x=n.components[0],S=n.components[2],I=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(x.position),visible:I.visible,interactive:S!=null,completeFraction:x.completeFraction,color:I.color,accentColor:x.accentColor,nearRadius:x.nearRadius,farRadius:x.farRadius,animateArrowsOnPath:x.animateArrowsOnPath,displayArrowsOnPath:x.displayArrowsOnPath,nearZoomLevel:x.nearZoomLevel,farZoomLevel:x.farZoomLevel}}else if((n==null?void 0:n.type)==="image"){let x=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(x.position),visible:n.components[1].visible,verticalOffset:(p=x.feature.properties.verticalOffset)!=null?p:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof jc&&"textArea"in n.components[0].feature.properties){bJ(n);let x=n.components[0],S=n.components[1],{textMesh:I}=x,P=(f=x.mesh)==null?void 0:f.parent;P instanceof ut&&((m=P.children.find(w=>w.type==="batchedtext"))==null||m.getWorldPosition(u(this,p1))),u(this,fh).set(0,0,0);let T=I?I.getWorldPosition(u(this,fh)):u(this,fh);return Object.assign({},Rd,S.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(T.add(u(this,p1))),visible:(y=x.visible)!=null?y:!1,content:(v=x.feature.properties.content)!=null?v:""})}else return}}setState(r,n){var i,a;if(typeof r=="object"&&n==null){"hoverColor"in r&&(u(this,z).hoverColor=(i=r.hoverColor)!=null?i:u(this,z).hoverColor),"text3dHoverColor"in r&&(u(this,z).text3dHoverColor=(a=r.text3dHoverColor)!=null?a:u(this,z).text3dHoverColor);return}let o=Qh(u(this,z),r);if(o!=null){if(o.type==="custom-geometry"){let l=u(this,z).geometry3DMap.get(o.id);if(l instanceof wt&&l.components[0]instanceof ah){let c=n;ua(o,u(this,z),c.visible),zI(o,c.altitude),cE(o,c.position,this.convertTo3DMapPosition),uE(o,this.getParentContainer(c.parent,!1))}}else if(o.type==="path"){let l=n;gn(o,l.interactive,u(this,z))&&u(this,Wt).call(this),zI(o,l.altitude),gJ(o,u(this,z),l)}else if(o.type==="model"){let l=n;gn(o,l.interactive,u(this,z))&&u(this,Wt).call(this),ua(o,u(this,z),l.visible),xJ(o,l)}else if(o.type==="group-container"){let l=n;ua(o,u(this,z),l.visible)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0,u(this,V).pathSystem.altitudeDirty=!0),zI(o,l.altitude)&&(u(this,V).pathSystem.altitudeDirty=!0),gn(o,l.interactive,u(this,z))&&u(this,Wt).call(this),dE(o,u(this,z),l.opacity)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0)}else if(o.type==="geometry-group"){let l=n;ua(o,u(this,z),l.visible)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0),nJ(o,u(this,z),l),HI(o,u(this,z),l.outline),l.height!=null&&aE(o,u(this,z),l.height),l.altitude!=null&&o.setAltitude(l.altitude),fJ(o,l),oJ(o,l.shading),dE(o,u(this,z),l.opacity)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0),gn(o,l.interactive,u(this,z))&&(u(this,Wt).call(this),u(this,Br).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof gr){let l=n;ua(o,u(this,z),l.visible)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0),HI(o,u(this,z),l.outline),iJ(o,l),fE(o,l.focusable)&&(u(this,V).geometryInFocusSystem.focusablesDirty=!0),yJ(o,l.renderOrder)&&(u(this,V).meshDetachmentSystem.dirty=!0),hJ(o,l.opacity)&&(u(this,V).meshDetachmentSystem.dirty=!0,u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0),pE(o,l.flipImageToFaceCamera),l.height!=null&&aE(o,u(this,z),l.height),mJ(o,l)&&(u(this,V).meshDetachmentSystem.dirty=!0),lE(o,l),uJ(o,l.hoverColor),gn(o,l.interactive,u(this,z)),pJ(o,l.hovered)}u(this,Wt).call(this)}else if(o.type==="label"||o.type==="marker"){let l=n;cJ(o,n,u(this,z)),aJ(o,n,u(this,z))&&(u(this,Br).call(this),u(this,V).domMutationSystem.dirty=!0),cE(o,l.position,this.convertTo3DMapPosition),uE(o,this.getParentContainer(l.parent,!1))&&(u(this,Br).call(this),u(this,V).panBoundsSystem.dirty=!0),sJ(o,l.enabled),ua(o,u(this,z),l.visible)}else if(o.type==="image"){let l=n;ua(o,u(this,z),l.visible),pE(o,l.flipImageToFaceCamera)}else if(o.type==="text3d"){let l=n;vJ(o,u(this,z),l)}this.render()}}convertTo3DMapPosition(r,n,o=0,i){var c,p,f,m,y;if(Array.isArray(r))return this.convertTo3DMapPosition(r[1],r[0],(c=r[2])!=null?c:o,typeof n=="function"?n:void 0);if(typeof n!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:l}=O0((f=(p=u(this,z).center)==null?void 0:p[1])!=null?f:0,(y=(m=u(this,z).center)==null?void 0:m[0])!=null?y:0,r,n);return i?(i.set(a,l,o),i):new Pe(a,l,o)}get backgroundColor(){return typeof u(this,rn).backgroundColor=="string"?u(this,rn).backgroundColor:"#".concat(u(this,rn).backgroundColor.getHexString())}get backgroundAlpha(){return u(this,rn).backgroundAlpha}getThreeRenderer(){return u(this,rn)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?Y8(n):void 0}isInView(r){let n=Qh(u(this,z),r);if(u(this,u1).identity().multiply(u(this,Sr).projectionMatrix).multiply(u(this,Sr).matrixWorldInverse),u(this,ld).setFromProjectionMatrix(u(this,u1)),n instanceof Iu)return u(this,ld).containsPoint(n.position);if(n instanceof wt){let o=n==null?void 0:n.components[0];if(o instanceof ah||o instanceof zc)return u(this,ld).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof gr){let i=new Jr(this.convertTo3DMapPosition(o.featureBbox[1],o.featureBbox[0],0),this.convertTo3DMapPosition(o.featureBbox[3],o.featureBbox[2],0));return u(this,ld).intersectsBox(i)}}return!1}getSystems(){return u(this,V)}getInternalState(){return u(this,z)}getTweenGroup(){return u(this,z).tweenGroup}};wr=new WeakMap,Sr=new WeakMap,sd=new WeakMap,t1=new WeakMap,uh=new WeakMap,Jc=new WeakMap,ad=new WeakMap,ph=new WeakMap,bn=new WeakSet,I6=s(function(r){var n;u(this,Qc)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),u(this,z).pixelRatio=this.resolutionScale},"#setResolutionScale"),z=new WeakMap,Gt=new WeakMap,ss=new WeakMap,Cr=new WeakMap,ma=new WeakMap,rn=new WeakMap,V=new WeakMap,r1=new WeakMap,Br=new WeakMap,Wt=new WeakMap,vQ=s(function(){A(this,Gt,document.createElement("div")),u(this,Gt).classList.add("mappedin__smart-collision-engine__container"),A(this,ss,document.createElement("canvas")),u(this,ss).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(u(this,Gt)),A(this,Cr,document.createElement("canvas")),u(this,Cr).classList.add("mappedin__smart-collision-engine__container"),u(this,Cr).width=u(this,Gt).clientWidth*this.resolutionScale,u(this,Cr).height=u(this,Gt).clientHeight*this.resolutionScale,u(this,Cr).style.width=u(this,Gt).clientWidth+"px",u(this,Cr).style.height=u(this,Gt).clientHeight+"px",u(this,Gt).appendChild(u(this,ss)),u(this,Gt).appendChild(u(this,Cr)),u(this,ss).width=u(this,Gt).clientWidth,u(this,ss).height=u(this,Gt).clientHeight,u(this,Cr).width=u(this,Gt).clientWidth*this.resolutionScale,u(this,Cr).height=u(this,Gt).clientHeight*this.resolutionScale,u(this,Cr).style.width=u(this,Gt).clientWidth+"px",u(this,Cr).style.height=u(this,Gt).clientHeight+"px"},"#renderEntity2DContainer"),xQ=s(function(){A(this,ma,document.createElement("div")),u(this,ma).classList.add("mappedin-2d-entities"),Object.assign(u(this,ma).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(u(this,ma))},"#renderEntityDOMContainer"),IQ=s(function(){u(this,Cr).width=u(this,Gt).clientWidth*this.resolutionScale,u(this,Cr).height=u(this,Gt).clientHeight*this.resolutionScale,u(this,Cr).style.width=u(this,Gt).clientWidth+"px",u(this,Cr).style.height=u(this,Gt).clientHeight+"px",u(this,ss).width=u(this,Gt).clientWidth,u(this,ss).height=u(this,Gt).clientHeight,u(this,Cr).width=u(this,Gt).clientWidth*this.resolutionScale,u(this,Cr).height=u(this,Gt).clientHeight*this.resolutionScale,u(this,Cr).style.width=u(this,Gt).clientWidth+"px",u(this,Cr).style.height=u(this,Gt).clientHeight+"px",u(this,V).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),Qc=new WeakMap,n1=new WeakMap,o1=new WeakMap,i1=new WeakMap,s1=new WeakMap,zS=new WeakMap,a1=new WeakMap,l1=new WeakMap,c1=new WeakMap,dh=new WeakMap,S6=s(function(r,n,o,i){let a=new Iu(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i);return a.occluderId=o!=null?o:u(this,V).occlusion2DSystem.backgroundId,u(this,z).geometry2DMap.set(a.id,a),a},"#createEntity2D"),ld=new WeakMap,u1=new WeakMap,ro=new WeakMap,no=new WeakMap,C6=s(async function(){return Wc.load(oY).then(r=>{var n;return u(this,wr)&&((n=u(this,wr).environment)==null||n.dispose(),r.mapping=r8,u(this,wr).environment=r,this.render()),r})},"#loadEnvMap"),fh=new WeakMap,p1=new WeakMap,s(M6,"Core");var x6=M6,d1=x6;d();function D4e(e,t){F4e(e,t)(e.getScene(),t),L4e(e,t),t.addFolder("Export").add({export:s(async()=>{let a=await e.getCurrentSceneGLTF({binary:!0}),l=new Blob([a],{type:"application/octet-stream"});var c=document.createElement("a");document.body.appendChild(c),c.style.display="none";let p=window.URL.createObjectURL(l);c.href=p,c.download="scene.glb",c.click(),window.URL.revokeObjectURL(p)},"export")},"export");let o=t.addFolder("Camera"),i={get bearing(){return e.camera.bearing},set bearing(a){e.camera.setBearing(a)},get pitch(){return e.camera.pitch},set pitch(a){e.camera.setPitch(a)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(a){e.camera.setZoomLevel(a)}};o.add(i,"bearing",-359,359,1),o.add(i,"pitch",e.camera.minPitch,e.camera.maxPitch,1),o.add(i,"zoomLevel",e.camera.minZoomLevel,e.camera.maxZoomLevel,.1)}s(D4e,"mountSceneGraphVisualizer");function F4e(e,t){let r=t;return s(function n(o,i){let a=i.addFolder("".concat([o.type]," ").concat(o.id.slice(0,16)));if(i.close(),o.type==="geometry"||o.type==="model"||o.type==="path"||o.type==="image"){let l={get height(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"?c.height:0},set height(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(o,{height:c})},set flipImageToFaceCamera(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="image"&&e.setState(o,{flipImageToFaceCamera:c})},get flipImageToFaceCamera(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="image"?c.flipImageToFaceCamera:!1},set visible(c){let p=e.getState(o.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image")&&e.setState(o,{visible:c})},get visible(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?c.visible:!1},set outline(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(o,{outline:c})},get outline(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"?c.outline:!1},get opacity(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"?c.opacity:1},set opacity(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(p,{opacity:c})},get color(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"&&c.color?Ce(c.color).toHexString():"#ffffff"},set color(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(p,{color:c})},set interactive(c){let p=e.getState(o.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path")&&(e.setState(o,{interactive:c}),r.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"?c.interactive:!1},get completeFraction(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="path"?c.completeFraction:1},set completeFraction(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="path"&&e.setState(p,{completeFraction:c})},focus:s(()=>{},"focus")};a.add(l,"focus").onChange(()=>{let c=e.getState(o.id);(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?e.camera.focusOn([c.position]):(c==null?void 0:c.type)==="geometry"&&e.camera.focusOn(e.getBoundingArea(c))}),a.add(l,"visible"),o.type==="image"?a.add(l,"flipImageToFaceCamera"):(a.add(l,"interactive"),o.type==="path"&&a.add(l,"completeFraction",0,1,.1),o.type!=="model"&&(a.addColor(l,"color"),a.add(l,"outline"))),o.type==="geometry"&&(a.add(l,"height"),a.add(l,"opacity",0,1,.1))}else if(o.type==="marker"){let l={get interactive(){var p;let c=e.getState(o.id);return(c==null?void 0:c.type)==="marker"?(p=c.options)==null?void 0:p.interactive:!1},set interactive(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="marker"&&(e.setState(p,{options:{interactive:c}}),r.controllersRecursive().forEach(f=>f.updateDisplay()))},focus:s(()=>{},"focus")};a.add(l,"focus").onChange(()=>{let c=e.getState(o.id);(c==null?void 0:c.type)==="marker"&&e.camera.focusOn([c.position])}),a.add(l,"interactive")}else if(o.type==="label"){let l={get interactive(){var p;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(p=c.options)==null?void 0:p.interactive:!1},set interactive(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&(e.setState(p,{options:{interactive:c}}),r.controllersRecursive().forEach(f=>f.updateDisplay()))},get text(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?c.text:""},set text(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:c})},get"Text Color"(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(f=(p=c.options.appearance)==null?void 0:p.text)==null?void 0:f.foregroundColor:"#000000"},set"Text Color"(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(o.id,{text:l.text,options:{appearance:{text:{foregroundColor:c}}}})},get"Text Size"(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(f=(p=c.options.appearance)==null?void 0:p.text)==null?void 0:f.size:10},set"Text Size"(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{text:{size:c}}}})},get"Icon Size"(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.iconSize:10},set"Icon Size"(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{iconSize:c}}}})},get"Active Foreground Color"(){var p,f,m;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(m=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.foregroundColor)==null?void 0:m.active:"#000000"},set"Active Foreground Color"(c){var f,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{foregroundColor:{...(m=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:m.foregroundColor,active:c}}}}})},get"Inactive Foreground Color"(){var p,f,m;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(m=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.foregroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Foreground Color"(c){var f,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{foregroundColor:{...(m=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:m.foregroundColor,inactive:c}}}}})},get"Active Background Color"(){var p,f,m;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(m=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.backgroundColor)==null?void 0:m.active:"#000000"},set"Active Background Color"(c){var f,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{backgroundColor:{...(m=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:m.backgroundColor,active:c}}}}})},get"Inactive Background Color"(){var p,f,m;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(m=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.backgroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Background Color"(c){var f,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{backgroundColor:{...(m=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:m.backgroundColor,inactive:c}}}}})},focus:s(()=>{},"focus")};a.add(l,"focus").onChange(()=>{let c=e.getState(o.id);(c==null?void 0:c.type)==="label"&&e.camera.focusOn([c.position])}),a.add(l,"interactive"),a.add(l,"text"),a.add(l,"Text Size",10,50),a.add(l,"Icon Size",10,50),a.addColor(l,"Text Color"),a.addColor(l,"Active Background Color"),a.addColor(l,"Inactive Background Color"),a.addColor(l,"Active Foreground Color"),a.addColor(l,"Inactive Foreground Color")}else if(o.type==="geometry-group"){let l={get opacity(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"?c.opacity:1},set opacity(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(o,{opacity:c})},set visible(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(o,{visible:c})},get visible(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"?c.visible:!1},set outline(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(o,{outline:c})},get outline(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"?c.outline:!1},set interactive(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&(e.setState(o,{interactive:c}),r.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"?c.interactive:!1},get shadingStart(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(p=c.shading)==null?void 0:p.start)!=null?f:0},set shadingStart(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(p,{shading:{start:c}})},get shadingEnd(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(p=c.shading)==null?void 0:p.end)!=null?f:0},set shadingEnd(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(p,{shading:{end:c}})},get shadingIntensity(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(p=c.shading)==null?void 0:p.intensity)!=null?f:0},set shadingIntensity(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(p,{shading:{intensity:c}})}};a.add(l,"visible"),a.add(l,"opacity",0,1,.1),a.add(l,"interactive"),a.add(l,"outline"),a.add(l,"shadingStart",0,1,.1),a.add(l,"shadingEnd",0,1,.1),a.add(l,"shadingIntensity",0,1,.1)}else if(o.type==="group-container"){let l={set visible(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="group-container"&&e.setState(o,{visible:c})},get visible(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="group-container"?c.visible:!1},set interactive(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="group-container"&&(e.setState(p,{interactive:c}),r.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="group-container"?c.interactive:!1}};a.add(l,"visible"),a.add(l,"interactive")}if(a.close(),o.children)for(let l of o.children.values())n(l,a)},"parseChild")}s(F4e,"createParseChild");function L4e(e,t){let r=t.addFolder("Watermark"),n={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};r.add(n,"padding",0,100,1),r.add(n,"scale",.5,1.5,.1),r.add(n,"color",["dark","light"]),r.add(n,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),r.add(n,"iconOnly"),r.onChange(()=>{e.updateWatermark(n)})}s(L4e,"createWatermarkChild");var SQ="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",R4e="https://auth.mappedin.com/oauth2/token";async function CQ(e,t){var r,n,o,i,a;if((r=t==null?void 0:t.outdoorView)!=null&&r.enabled){let{Map:l,MercatorCoordinate:c}=await import("./outdoor-context-v4-YNWNY6XZ.js"),p=t.outdoorView.headers;p==null&&(p=await W8(R4e));let f=t.center||[0,0],m=new l({container:e,style:t.outdoorView.style||SQ,center:f,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:w6,pitch:(o=t.pitch)!=null?o:P6,bearing:(i=t.bearing)!=null?i:T6,transformRequest:U8(p),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:Fd(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),y=m.painter.context.gl,v=new d1(e,{center:f,zoomLevel:m.getZoom(),pitch:m.getPitch(),bearing:m.getBearing(),gl:y,map:m,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled,transformImageRequest:t.transformImageRequest,naturalBearing:(a=t.naturalBearing)!=null?a:0,imagePlacementOptions:t.imagePlacementOptions,onWebGLContextCreationError:t.onWebGLContextCreationError,onWebGLContextLost:t.onWebGLContextLost,onWebGLContextRestored:t.onWebGLContextRestored,onWebGLRendererError:t.onWebGLRendererError}),x={center:m.getCenter().toArray(),zoom:m.getZoom(),bearing:m.getBearing(),pitch:m.getPitch()};m.setMinZoom(v.camera.minZoomLevel),m.setMaxZoom(v.camera.maxZoomLevel),v.on("camera-change",w=>{x.center=w.center,x.zoom=w.zoomLevel,x.bearing=w.bearing,x.pitch=w.pitch,m.jumpTo(x)});let S=c.fromLngLat(f,0),I=E0(S,v.viewCamera,v.camera,()=>{v.renderSync()});m.on("style.load",async()=>{m&&(m.addLayer(I),v.renderSync())});let P=!1,T=!1;m.on("idle",()=>{m&&(P||(v.publish("outdoor-view-loaded"),P=!0),T||(T=!0,v.publish("outdoor-style-loaded")))});let M=s(w=>{w&&(w.sourceDataType==="metadata"||w.sourceDataType==="visibility"||w.dataType==="style"||w.type==="terrain")&&v.getSystems().htmlControlsSystem.updateData(m)},"updateData");return m.on("styledata",w=>{m&&w&&w.dataType==="style"&&w.type==="styledata"&&(T=!1),M(w)}),m.on("sourcedata",M),m.on("terrain",M),m.on("error",w=>{var E;if(((E=w.error)==null?void 0:E.url)===SQ){j.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(p["x-mappedin-tiles-key"],'"'));return}j.warn(w)}),v}else return new d1(e,t)}s(CQ,"createRenderer");d();d();d();var f1=(r=>(r.Exterior="exterior-walls",r.Interior="interior-walls",r))(f1||{}),m1=(r=>(r.Interior="interior-doors",r.Exterior="exterior-doors",r))(m1||{});d();d();var mh=class mh{constructor(t,r,n){h(this,"id");h(this,"text");h(this,"target");h(this,"__type",mh.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===mh.__type}get focusTarget(){return this.target.anchorTarget}};s(mh,"Label"),h(mh,"__type","Label");var eu=mh;d();var cd,hh=class hh{constructor(t,r,n){h(this,"id");O(this,cd);h(this,"__type",hh.__type);h(this,"contentEl");this.id=t,this.contentEl=r,A(this,cd,n)}get target(){return u(this,cd)}get coordinate(){return u(this,cd).anchorTarget}static is(t){return t.__type===hh.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){A(this,cd,t)}};cd=new WeakMap,s(hh,"Marker"),h(hh,"__type","Marker");var Al=hh;d();var y1,g1,yh=class yh{constructor(t,r,n){O(this,y1);O(this,g1);h(this,"target");h(this,"__type",yh.__type);A(this,y1,t),A(this,g1,r),this.target=n}static is(t){return t.__type===yh.__type}get id(){return u(this,y1)}get url(){return u(this,g1)}};y1=new WeakMap,g1=new WeakMap,s(yh,"Image"),h(yh,"__type","Image");var h1=yh;d();var bh,gh=class gh{constructor(t,r,n){h(this,"id");h(this,"groupId");h(this,"__type",gh.__type);O(this,bh);this.id=t,this.groupId=r,A(this,bh,n)}get target(){return u(this,bh)}static is(t){return t.__type===gh.__type}updateTarget(t){A(this,bh,t)}};bh=new WeakMap,s(gh,"Model"),h(gh,"__type","Model");var ud=gh;d();var vh=class vh{constructor(t,r){h(this,"id");h(this,"coordinates");h(this,"__type",vh.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===vh.__type}get focusTarget(){return this.coordinates}};s(vh,"PathSegment"),h(vh,"__type","PathSegment");var Ih=vh,xh=class xh{constructor(t,r,n,o){h(this,"id");h(this,"animation");h(this,"coordinates");h(this,"segments");h(this,"__type",xh.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=o.map(({id:i,coordinates:a})=>new Ih(i.toString(),a))}static is(t){return t.__type===xh.__type}get focusTarget(){return this.coordinates}};s(xh,"Path"),h(xh,"__type","Path");var as=xh;d();var tu,O6=class O6{constructor(t){O(this,tu);A(this,tu,t)}get center(){return u(this,tu).center}get bearing(){return u(this,tu).bearing}get pitch(){return u(this,tu).pitch}get zoomLevel(){return u(this,tu).zoomLevel}};tu=new WeakMap,s(O6,"CameraTransform");var b1=O6;d();var Sh=class Sh{constructor(t){h(this,"id");h(this,"__type",Sh.__type);this.id=t}static is(t){return t.__type===Sh.__type}get focusTarget(){return this}};s(Sh,"Shape"),h(Sh,"__type","Shape");var ru=Sh;d();var v1=class v1{constructor(t,r){h(this,"id");h(this,"target");h(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===v1.__type}};s(v1,"Text3D"),h(v1,"__type","Text3D");var nu=v1;d();d();d();var N4e=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n // Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),B4e=/<svg([^>]*)>/g;function PQ(e,t,r){let n=N4e.get(e);return n?n.replace(B4e,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}s(PQ,"getStyledIcon");var $4e=s(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(e,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),j4e=s(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(e,'"\n />\n </svg>\n '),"getDestinationPin"),E6="#722ED1",_6="#1890FF",TQ=s(({type:e="departure",color:t=_6})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?$4e(t):j4e(t),"\n </div>"),"DroppedPin"),G4e=s(e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),wQ=s(({type:e="stairs",color:t=E6,direction:r="up"})=>{let n=G4e("default"),o=n/2+2,i=r&&r!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(n,"px; height:").concat(n,'px;"\n >\n ').concat(PQ("connection-"+e+"-16x16","white",o)||"","\n </div>\n ").concat(i?'<div style="margin-left: -'.concat(n*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(n,"px; height: ").concat(n,'px;">\n <div class="').concat(r==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(o,"px; height: ").concat(o,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")},"ConnectionMarker");d();var MQ=s(async e=>new Promise(t=>setTimeout(t,e)),"ms");var U4e={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},V4e={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},ou={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:U4e,inactivePathOptions:V4e,markerOptions:{departureColor:_6,destinationColor:E6},animatePathDrawing:!0},kl,ls,Dl,ct,I1,Fl,pd,$r,cs,Po,us,iu,Mr,OQ,EQ,A6,HS,Ch,k6,Ph,D6=class D6{constructor(t,r,n){O(this,Mr);O(this,kl,new Map);O(this,ls);O(this,Dl);O(this,ct,ou);O(this,I1);O(this,Fl);O(this,pd);O(this,$r,[]);O(this,cs);O(this,Po,new Map);O(this,us,new Map);O(this,iu,new Map);O(this,Ph,s(t=>{var r;if((r=u(this,ct).createMarkers)!=null&&r.connection&&t.markers.length>0){let{instruction:n}=u(this,kl).get(t.markers[0]);n!=null&&n.action.toFloor&&(u(this,ct).setMapOnConnectionClick&&this.currentMap.setFloor(n.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:n,fromFloor:n.action.fromFloor,toFloor:n.action.toFloor}))}},"#handleClick"));A(this,ls,t),A(this,I1,n),A(this,Dl,r)}get currentMap(){return u(this,I1).call(this)}get isMultiFloor(){if(!u(this,$r).length)return!1;let t=new Set;for(let r of u(this,$r))for(let n of r.coordinates)if(n.floorId&&(t.add(n.floorId),t.size>1))return!0;return!1}getPathById(t){return u(this,Po).get(t)}getMarkerById(t){return u(this,kl).get(t)}get paths(){let t=new Set;return u(this,Po).forEach(({path:r})=>t.add(r)),Array.from(t)}get activeDirections(){return u(this,iu).get(u(this,cs))}get activePath(){var t;if(u(this,cs))return(t=u(this,Po).get(u(this,cs).id))==null?void 0:t.path}get floorStacks(){let t=u(this,Dl).getMapData();if(!u(this,$r).length||!t)return[];let r=new Set;for(let n of u(this,$r))for(let o of n.coordinates)if(o.floorId){let i=t.getById("floor",o.floorId);i&&r.add(i.floorStack)}return Array.from(r)}get floors(){let t=u(this,Dl).getMapData();if(!u(this,$r).length||!t)return[];let r=new Set;for(let n of u(this,$r))for(let o of n.coordinates)if(o.floorId){let i=t.getById("floor",o.floorId);i&&r.add(i)}return Array.from(r)}setActivePathByIndex(t){let r=u(this,$r)[t];if(!u(this,$r).length){j.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!u(this,$r)[t]){j.warn("Direction #".concat(t," does not exist"));return}let n=u(this,us).get(r);if(!n){j.warn("The direction is not a part of muli-direcional path");return}te(this,Mr,HS).call(this,n)}setActivePath(t){if(!u(this,$r).length){j.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!u(this,iu).get(t)){j.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}te(this,Mr,HS).call(this,t)}setActivePathByDirections(t){if(!u(this,$r).length){j.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let r=u(this,us).get(t);if(!r){j.warn("The direction is not a part of muli-direcional path");return}te(this,Mr,HS).call(this,r)}drawSync(t,r={}){var l,c,p;u(this,pd)&&this.clear(),A(this,pd,!0),te(this,Mr,A6).call(this,r);let n=Array.isArray(t)?t:[t],o=n[0],i=n[n.length-1],a=o.coordinates[0];A(this,$r,n),a.floorId&&u(this,ct).setMapToDeparture&&this.currentMap.setFloor(a.floorId),(l=u(this,ct).createMarkers)!=null&&l.departure&&te(this,Mr,Ch).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let f=0;f<n.length;f++){let m=n[f],y=f?{...u(this,ct).inactivePathOptions}:{...u(this,ct).pathOptions};if(m.coordinates.length<2){j.warn("Directions must have at least 2 coordinates");return}let v=this.currentMap.Paths.add(m.coordinates,{...y,animateDrawing:u(this,ct).animatePathDrawing}),x=v.paths.map(I=>I.id.toString()),S=new as(_t(),v.animation,m.coordinates,v.paths);for(let I of x){u(this,Po).set(I,{path:S,entityIds:x});let P=f?{...u(this,ct).inactivePathOptions,altitude:0}:{...u(this,ct).pathOptions,altitude:.05};u(this,ls).setState(I,P)}u(this,Po).set(S.id,{path:S,entityIds:x}),u(this,us).set(m,S),u(this,iu).set(S,m),(c=u(this,ct).createMarkers)!=null&&c.connection&&te(this,Mr,k6).call(this,m.instructions,"connection"),f===0&&(A(this,cs,u(this,us).get(u(this,$r)[0])),u(this,ls).on("click",u(this,Ph)))}(p=u(this,ct).createMarkers)!=null&&p.destination&&te(this,Mr,Ch).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),u(this,Dl).mapObjects.forEach(f=>{f.processFloorChange(f.currentFloorId)})}async draw(t,r={}){u(this,Fl)&&this.clear(),te(this,Mr,A6).call(this,r);let n=Array.isArray(t)?t:[t],i=n[0].coordinates[0];return A(this,$r,n),i.floorId&&u(this,ct).setMapToDeparture&&this.currentMap.setFloor(i.floorId),te(this,Mr,EQ).call(this,n)}clear(){u(this,kl).forEach((t,r)=>{this.currentMap.Markers.remove(r.toString())}),u(this,kl).clear(),u(this,Po).forEach(({path:t,entityIds:r})=>{u(this,Po).delete(t.id),r.forEach(n=>u(this,Po).delete(n)),this.currentMap.Paths.remove(r)}),u(this,Fl)&&(u(this,Fl).cancel(),A(this,Fl,void 0)),u(this,pd)&&A(this,pd,!1),A(this,$r,[]),u(this,us).clear(),u(this,iu).clear(),A(this,cs,void 0),u(this,ls).off("click",u(this,Ph)),u(this,Dl).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};kl=new WeakMap,ls=new WeakMap,Dl=new WeakMap,ct=new WeakMap,I1=new WeakMap,Fl=new WeakMap,pd=new WeakMap,$r=new WeakMap,cs=new WeakMap,Po=new WeakMap,us=new WeakMap,iu=new WeakMap,Mr=new WeakSet,OQ=s(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),EQ=s(function(t){let r=t[0],n=t[t.length-1],o=!1;return A(this,Fl,{promise:new Promise(async i=>{var a,l,c;if(b.env.NODE_ENV!=="test"&&await MQ(500),o||!t.length){i();return}(a=u(this,ct).createMarkers)!=null&&a.departure&&te(this,Mr,Ch).call(this,r.coordinates[0],"departure",r.instructions[0]);for(let p=0;p<t.length;p++){let f=t[p],m=p?{...u(this,ct).inactivePathOptions}:{...u(this,ct).pathOptions};if(f.coordinates.length<2){j.warn("Directions must have at least 2 coordinates"),i();return}let y=this.currentMap.Paths.add(f.coordinates,{...m,animateDrawing:u(this,ct).animatePathDrawing}),v=y.paths.map(S=>S.id.toString()),x=new as(_t(),y.animation,f.coordinates,y.paths);for(let S of v){u(this,Po).set(S,{path:x,entityIds:v});let I=p?{...u(this,ct).inactivePathOptions,altitude:0}:{...u(this,ct).pathOptions,altitude:.05};u(this,ls).setState(S,I)}if(u(this,Po).set(x.id,{path:x,entityIds:v}),u(this,us).set(f,x),u(this,iu).set(x,f),b.env.NODE_ENV!=="test"&&await y.animation,o){i();return}(l=u(this,ct).createMarkers)!=null&&l.connection&&te(this,Mr,k6).call(this,f.instructions,"connection"),p===0&&(A(this,cs,u(this,us).get(u(this,$r)[0])),u(this,ls).on("click",u(this,Ph)))}if((c=u(this,ct).createMarkers)!=null&&c.destination&&te(this,Mr,Ch).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),o){i();return}u(this,Dl).mapObjects.forEach(p=>{p.processFloorChange(p.currentFloorId)}),i()}),cancel:s(()=>{o=!0},"cancel")}),u(this,Fl).promise},"#drawAsync"),A6=s(function(t){var r,n,o;A(this,ct,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:ou.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:ou.setMapToDeparture,pathOptions:{...ou.pathOptions,...t.pathOptions},inactivePathOptions:{...ou.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...ou.createMarkers,...t.createMarkers},markerOptions:{...ou.markerOptions,...t.markerOptions},animatePathDrawing:(o=t.animatePathDrawing)!=null?o:ou.animatePathDrawing})},"#setupOptions"),HS=s(function(t){A(this,cs,t),u(this,$r).forEach(r=>{let n=u(this,us).get(r);if(n){let o=u(this,Po).get(n.id),i=o.path.id===u(this,cs).id?{...u(this,ct).pathOptions,altitude:.05}:{...u(this,ct).inactivePathOptions,altitude:0};o.entityIds.forEach(a=>{u(this,ls).setState(a,i)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),Ch=s(function(t,r,n){var o,i,a,l,c;if(r==="connection"&&n){let p=n.action.type==="ExitConnection"?u(this,ct).markerOptions.departureColor:u(this,ct).markerOptions.destinationColor,f;if(typeof((o=u(this,ct).createMarkers)==null?void 0:o.connection)=="function"){let y=u(this,ct).createMarkers.connection(n);u(this,ls).setState(y.id.toString(),{options:{interactive:!0}}),f={id:y.id,type:"marker"}}else f=this.currentMap.Markers.add(n.coordinate,wQ({type:(a=(i=n.action.connection)==null?void 0:i.type)!=null?a:n.action.connectionType,color:p,direction:n.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let m=this.currentMap.Markers.getContentEl(f.id.toString());if(!m)throw new Error("marker component should exist");u(this,kl).set(f.id,{instruction:n,marker:new Al(f.id.toString(),m,n.coordinate)})}else{let p=r==="departure"?u(this,ct).markerOptions.departureColor:u(this,ct).markerOptions.destinationColor,f;typeof((l=u(this,ct).createMarkers)==null?void 0:l.departure)=="function"&&r==="departure"?f={id:u(this,ct).createMarkers.departure(n).id,type:"marker"}:typeof((c=u(this,ct).createMarkers)==null?void 0:c.destination)=="function"&&r==="destination"?f={id:u(this,ct).createMarkers.destination(n).id,type:"marker"}:f=this.currentMap.Markers.add(t,TQ({type:r,color:p}),{anchor:"top",rank:"always-visible"}),u(this,kl).set(f.id,void 0)}},"#addMarker"),k6=s(function(t,r){t.filter(o=>te(this,Mr,OQ).call(this,o.action)).forEach(o=>{te(this,Mr,Ch).call(this,o.coordinate,r,o)})},"#addMarkers"),Ph=new WeakMap,s(D6,"Navigation");var x1=D6;d();d();d();var z4e=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),H4e=/<svg([^>]*)>/g;function _Q(e,t,r){let n=z4e.get(e);return n?n.replace(H4e,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}s(_Q,"getStyledIcon");var dd,Th,To,F6,AQ,kQ,L6,DQ,R6=class R6{constructor(t,r){O(this,To);O(this,dd);O(this,Th);h(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});A(this,dd,t),A(this,Th,r)}auto(){let t=[],r=u(this,Th)[Object.keys(u(this,Th))[0]];return[...r.getByType("connection"),...r.getByType("point-of-interest"),...r.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(o=>{let i=n.name||n.externalId;if(i){let a=u(this,dd).Labels.add(o,i,te(this,To,F6).call(this,n));t.push(a)}});else{n.__type==="space"&&n.name!==""&&u(this,dd).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let o=n.name;if(o){let i=u(this,dd).Labels.add(n,o,te(this,To,F6).call(this,n));t.push(i)}}}),{labels:t}}};dd=new WeakMap,Th=new WeakMap,To=new WeakSet,F6=s(function(t){let r=_Q(te(this,To,AQ).call(this,t),"white",12);return{appearance:{text:{foregroundColor:te(this,To,L6).call(this,t)},marker:{foregroundColor:{active:te(this,To,L6).call(this,t)},icon:r,iconSize:12}},interactive:!0,rank:te(this,To,DQ).call(this,t)}},"#generatLabelAppearance"),AQ=s(function(t){return t.__type==="connection"?te(this,To,kQ).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),kQ=s(function(t){let r="";switch(t){case"elevator":r="connection-elevator-12x12";break;case"escalator":r="connection-escalator-12x12";break;case"stairs":r="connection-stairs-12x12";break}return r},"#attemptIconNameForConnection"),L6=s(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),DQ=s(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),s(R6,"Labels");var WS=R6;var N6=class N6{constructor(t,r){h(this,"Labels");h(this,"auto",s(()=>this.Labels.auto(),"auto"));this.Labels=new WS(t,r)}};s(N6,"DefaultTheme");var qS=N6;d();var je,C1,Ll,ZS,B6,$6=class $6{constructor(t){O(this,Ll);O(this,je);O(this,C1);h(this,"interactions",{set:s(t=>{(t==null?void 0:t.pan)!=null&&(u(this,je).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(u(this,je).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(u(this,je).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:s(()=>{u(this,je).getSystems().cameraSystem.enablePan=!0,u(this,je).getSystems().cameraSystem.enableZoom=!0,u(this,je).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:s(()=>{u(this,je).getSystems().cameraSystem.enablePan=!1,u(this,je).getSystems().cameraSystem.enableZoom=!1,u(this,je).getSystems().cameraSystem.enableRotate=!1},"disable")});h(this,"setMinPitch",s(t=>{u(this,je).camera.setMinPitch(t)},"setMinPitch"));h(this,"setMaxPitch",s(t=>{u(this,je).camera.setMaxPitch(t)},"setMaxPitch"));h(this,"setMinZoomLevel",s(t=>{u(this,je).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));h(this,"setMaxZoomLevel",s(t=>{u(this,je).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));A(this,C1,t),A(this,je,t.core)}setScreenOffsets(t){u(this,je).camera.setInsetPadding(t)}get screenOffsets(){return u(this,je).camera.insetsPadding}get panMode(){return u(this,je).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&u(this,je).camera.setPanMode(t)}getFocusOnTransform(t,r){var o;let n=u(this,je).camera.getCameraFrameForCoordinates(te(this,Ll,B6).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,verticalPadding:(o=r==null?void 0:r.axisAlignedPadding)==null?void 0:o.vertical,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,easing:r==null?void 0:r.easing});return{center:new Le(n.center[1],n.center[0]),zoomLevel:n.zoomLevel}}focusOn(t,r){var n;return u(this,je).camera.focusOn(te(this,Ll,B6).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,verticalPadding:(n=r==null?void 0:r.axisAlignedPadding)==null?void 0:n.vertical,easing:r==null?void 0:r.easing})}animateTo(t,r){var c;let{center:n,zoomLevel:o,bearing:i,pitch:a}=t,l=n!=null?n:this.center;return u(this,je).camera.animateTo({center:n!=null?[l.longitude,l.latitude,u(this,je).camera.elevation]:void 0,zoomLevel:o,bearing:i,pitch:a,duration:(c=r==null?void 0:r.duration)!=null?c:600,easing:r==null?void 0:r.easing})}set(t){let{center:r=this.center,zoomLevel:n=this.zoomLevel,bearing:o=this.bearing,pitch:i=this.pitch}=t,a=[r.longitude,r.latitude];u(this,je).camera.setCenter(a),u(this,je).camera.setZoomLevel(n),u(this,je).camera.setBearing(o),u(this,je).camera.setPitch(i)}get center(){let t=u(this,je).camera.center;return new Le(t[1],t[0],void 0)}setAutoMinZoomLevel(t){u(this,je).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return u(this,je).camera.autoMinZoomLevel}get zoomLevel(){return u(this,je).camera.zoomLevel}get pitch(){return u(this,je).camera.pitch}get minPitch(){return u(this,je).camera.minPitch}get maxPitch(){return u(this,je).camera.maxPitch}get bearing(){let t=u(this,je).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return u(this,je).camera.minZoomLevel}get maxZoomLevel(){return u(this,je).camera.maxZoomLevel}setElevation(t){u(this,je).camera.setElevation(t)}get elevation(){return u(this,je).camera.elevation}animateElevation(t,r){return u(this,je).camera.animateElevation(t,r)}updateFacadesInView(){u(this,je).getSystems().geometryInFocusSystem.raycast()}};je=new WeakMap,C1=new WeakMap,Ll=new WeakSet,ZS=s(function(t){var n,o,i,a,l,c;let r=u(this,je).camera.elevation;return Le.is(t)&&t.floorId!=null?(o=(n=u(this,je).getState(t.floorId))==null?void 0:n.altitude)!=null?o:r:ao.is(t)?(a=(i=u(this,je).getState(t.id))==null?void 0:i.altitude)!=null?a:r:"floor"in t&&ao.is(t.floor)&&(c=(l=u(this,je).getState(t.floor.id))==null?void 0:l.altitude)!=null?c:r},"#getFloorAltitude"),B6=s(function(t){var i;let r=[],o=(Array.isArray(t)?t:[t]).flatMap(a=>{var l;return(l=a==null?void 0:a.focusTarget)!=null?l:[a]});for(let a of o)if(a!=null)if(Le.is(a)){let l=te(this,Ll,ZS).call(this,a);r.push([a.longitude,a.latitude,l])}else if((a==null?void 0:a.id)!=null){let l=te(this,Ll,ZS).call(this,a);if(ao.is(a)&&((i=u(this,C1).getMapDataInternal())!=null&&i.enterpriseMode)){r.push(a.id);continue}else if("geoJSON"in a&&a.geoJSON.geometry.coordinates.length>0){A8(a.geoJSON,p=>{r.push([p[0],p[1],l])});continue}let c=u(this,je).getBoundingArea(a.id);if(c)r.push(...c.map(p=>[p[0],p[1],l]));else if("geoJSONBoundingBox"in a){let p=te(this,Ll,ZS).call(this,a);if(a.geoJSONBoundingBox!=null){let f=[[a.geoJSONBoundingBox[0],a.geoJSONBoundingBox[1],p],[a.geoJSONBoundingBox[2],a.geoJSONBoundingBox[3],p]];r.push(...f)}}}else L3(a)&&r.push(a);return r},"#computeCoordinateCloud"),s($6,"Camera");var S1=$6;d();var wh,j6=class j6{constructor({currentMapGetter:t}){O(this,wh);A(this,wh,t)}get currentMap(){return u(this,wh).call(this)}async getCurrentSceneGLTF(t){let r=u(this,wh).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):(j.error("There is no map to export. Please load a map first."),new Blob)}};wh=new WeakMap,s(j6,"Exporter");var P1=j6;d();var ha,w1,G6=class G6{constructor({currentMapGetter:t}){O(this,ha,new Map);O(this,w1);A(this,w1,t)}get currentMap(){return u(this,w1).call(this)}getById(t){return u(this,ha).get(t)}add(t,r,n){let o=t.anchorTarget,i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Labels.add(o,r,{...n,attachTo:Mh(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank}),l=new eu(a.id.toString(),r,t);return u(this,ha).set(l.id,{label:l,entityId:l.id}),l}all(t){var n;let r=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:s((o,i,a)=>{let l=new eu(o.toString(),i,a);u(this,ha).set(l.id,{label:l,entityId:l.id}),r.push(l)},"onCreate"),labelOptions:t}),r}remove(t){var n;let r=u(this,ha).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),u(this,ha).delete(t.id.toString()))}removeAll(){let t=[];return u(this,ha).forEach(({label:r})=>{this.remove(r),t.push(r),u(this,ha).delete(r.id.toString())}),t}};ha=new WeakMap,w1=new WeakMap,s(G6,"Labels");var T1=G6;d();d();var U6={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},FQ={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},LQ=.5,H6=class H6{constructor(t,r,n=new Map){h(this,"containerId");h(this,"layers");h(this,"renderer");this.containerId=r,this.layers=n,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};s(H6,"Layer");var Rl=H6,fd,W6=class W6{constructor(t,r,n,o,i,a,l,c){h(this,"id");h(this,"name");h(this,"elevation");h(this,"containerId");h(this,"externalId");h(this,"metadata");h(this,"shortName");h(this,"subtitle");h(this,"occluderId");h(this,"loaded",!1);h(this,"styleMap",{});h(this,"obstructions");h(this,"entrances");h(this,"spaces");h(this,"floorImages");h(this,"floorText");h(this,"renderer");h(this,"options");h(this,"layers",new Map);h(this,"footprint");h(this,"floorStackId");h(this,"multiFloorView");h(this,"mapDataInternal");h(this,"facadesByStyleId",new Map);O(this,fd);h(this,"load",s(()=>{var o,i,a,l,c,p,f,m,y,v,x,S,I,P;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(Ba,"-").concat(this.id),{},this.id);this.layers.set(Ba,new Rl(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(As,"-").concat(this.id),{},this.id);this.layers.set(As,new Rl(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(Or,"-").concat(this.id),{},this.id);if(this.layers.set(Or,new Rl(this.renderer,n.id.toString())),((o=this.footprint)==null?void 0:o.geometry)!=null&&((i=this.footprint)==null?void 0:i.geometry.coordinates.length)!==0){let T=U6;if(this.obstructions!=null&&this.obstructions.features.length>0){let E=this.obstructions.features.filter(B=>B.geometry.type==="LineString"&&B.properties.kind==="Wall"&&B.properties.footprintComponent===!0);E!=null&&E.length>0&&(T=this.styleMap[(a=E[0].properties)==null?void 0:a.id])}let M=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...T,height:(c=(l=this.multiFloorView)==null?void 0:l.floorHeight)!=null?c:10,altitude:0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":T.color,renderOrder:2},this.id);this.layers.set(dy,new Rl(this.renderer,M.id.toString()));let w=this.renderer.addGroupContainer("".concat(Qd,"-").concat(this.id),{},this.id);this.layers.set(Qd,new Rl(this.renderer,w.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,w.id)}if(this.spaces!=null&&this.spaces.features.length>0){let T=[],M=new Map;this.spaces.features.filter(D=>{var F;return D.geometry.type==="Polygon"&&((F=D.properties.kind)==null?void 0:F.toLowerCase())!=="void"}).forEach(D=>{var L;let F=(L=this.mapDataInternal)==null?void 0:L.facadesBySpaceId[D.properties.id];if(F){let H=M.get(F.id)||[];M.set(F.id,[...H,D])}else T.push(D)});let w=XS(T,this.styleMap),E=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),B=0;for(let[D,F]of w){let L=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(B),{features:F},Oh(D,this.options),E);B++;let H=E.id.toString();this.layers.get(Or).layers.set(D.id||H,L.id.toString())}if(M.size>0){let D=this.renderer.addGroupContainer("".concat(Au,"-").concat(this.id),{},this.id);this.layers.set(Au,new Rl(this.renderer,D.id.toString()));for(let[F,L]of M){let H=this.renderer.addGroupContainer(F,{focusable:!0},D),U=this.renderer.addGroupContainer("".concat(F,"-geometry"),{},H),G=XS(L,this.styleMap),J=0;for(let[X,ie]of G){let ee=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(F,"-").concat(J),{features:ie},{...Oh(X,this.options),renderOrder:3},U);J++;let be=X.id||ee.id.toString();this.layers.get(Au).layers.set("".concat(F,"-").concat(be),ee.id.toString()),this.facadesByStyleId.has(be)?(p=this.facadesByStyleId.get(be))==null||p.push(F):this.facadesByStyleId.set(be,[F])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let T=this.obstructions.features.filter(U=>U.geometry.type==="Polygon"&&U.properties.kind==="object"),M=XS(T,this.styleMap),w=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),E=0;for(let[U,G]of M){let J=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(E),{features:G},Oh(U,this.options),w);E++;let X=w.id.toString();this.layers.get(Or).layers.set(U.id||X,J.id.toString())}let B=this.obstructions.features.filter(U=>U.geometry.type==="LineString"&&U.properties.kind==="Wall"&&U.properties.footprintComponent===!1),D=this.obstructions.features.filter(U=>U.geometry.type==="LineString"&&U.properties.kind==="Wall"&&U.properties.footprintComponent===!0),F=this.entrances,L=U6,H=U6;if(B!=null&&B.length>0){let U=this.styleMap[(f=B[0].properties)==null?void 0:f.id];U!=null&&(L={...U}),H=L;let{walls:G,entrances:J}=V6(B,(F==null?void 0:F.features)||[]),X=Math.max(L.height-.11,LQ),ie={...FQ,height:X},ee=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),J,ie,n);this.layers.get(Or).layers.set(Kd,ee.id.toString());let be=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[G]},Oh(L,this.options),n);this.layers.get(Or).layers.set(oc,be.id.toString())}if(D!=null&&D.length>0){let U=this.styleMap[(m=D[0].properties)==null?void 0:m.id];U!=null&&(H={...U,id:_s});let{walls:G,entrances:J}=V6(D,(F==null?void 0:F.features)||[]),X=Math.max(H.height-.11,LQ),ie={...FQ,height:X},ee=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),J,ie,n);this.layers.get(Or).layers.set(Jd,ee.id.toString());let be=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[G]},Oh(H,this.options),n);this.layers.get(Or).layers.set(_s,be.id.toString())}}if(this.floorImages!=null){let T=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let M of this.floorImages.features||[])"anchorId"in M.properties||"anchorId"in M.properties&&((y=M.properties)==null?void 0:y.anchorId)==null||this.renderer.addImage(_t(),M,{url:M.properties.path,flipImageToFaceCamera:(v=this.options.flipImagesToFaceCamera)!=null?v:!0},T);this.layers.set(Q8,new Rl(this.renderer,T.id.toString()))}if(this.floorText!=null)for(let T of this.floorText.features||[]){let M=0;"geometryId"in T.properties?M=(S=(x=this.renderer.getState(T.properties.geometryId))==null?void 0:x.height)!=null?S:0:M=(I=T.properties.verticalOffset)!=null?I:0,this.renderer.addText3D(_t(),{...T,properties:{...T.properties,verticalOffset:M}},{},this.id)}return(P=this.multiFloorView)!=null&&P.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var f,m,y,v;this.id=r.id,this.options=i;let p=n.addGroupContainer(this.id,{visible:!1,interactive:!0},t);this.containerId=p.id.toString(),this.externalId=r.externalId,this.metadata=r.metadata,this.shortName=r.shortName,this.subtitle=r.subtitle,this.name=r.name,this.elevation=r.elevation,a!=null&&l!=null&&(this.styleMap=l,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=(f=a.floorImages)==null?void 0:f[this.id],this.floorText=(y=(m=a.enterprise)==null?void 0:m.floorText)==null?void 0:y[this.id],this.footprint=(v=a["floor.geojson"])==null?void 0:v.features.find(x=>x.properties.id===r.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=o,this.mapDataInternal=c}get geoJSONBoundingBox(){if(u(this,fd))return u(this,fd);if(!this.footprint){j.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return A(this,fd,YS(this.footprint)),u(this,fd)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};fd=new WeakMap,s(W6,"FloorObject");var M1=W6;d();var q6=50,Z6=!1,W4e=1e3,yr,Eh,ya,ps,vn,E1,au,_h,md,wo,Y6,hd,_1,A1,k1,D1,Nl,$Q,F1,lu,K6,jQ,GQ,yd,J6=class J6 extends Fe{constructor({currentMapGetter:r}){super();O(this,wo);O(this,yr);O(this,Eh,0);O(this,ya);O(this,ps,!1);O(this,vn,[]);O(this,E1,0);O(this,au,q6);O(this,_h,!1);O(this,md,"collapsed");h(this,"expandedFactor",0);O(this,hd,"all-floors");O(this,_1,s(()=>{let r=u(this,yr).call(this);if(u(this,E1)===this.expandedFactor||r==null||!u(this,ps))return;A(this,E1,this.expandedFactor);let n=Ts(this.expandedFactor,0,1,0,this.distanceBetweenFloors),i=Ts(this.expandedFactor,0,.1,0,1)===0;u(this,vn).forEach((a,l)=>{r.api.updateState(a.containerId,{visible:i?a.id===r.currentFloorId:!0,altitude:n*l})}),this.expandedFactor===0?(A(this,ps,!1),r.renderer.camera.setPanMode("default"),u(this,lu)&&u(this,lu).call(this)):this.expandedFactor===1&&(A(this,ps,!1),u(this,lu)&&u(this,lu).call(this))},"#handlePreRender"));O(this,A1,s(()=>{var r,n,o;this.expanded&&A(this,Eh,(n=(r=u(this,yr).call(this))==null?void 0:r.renderer.camera.elevation)!=null?n:0),(o=u(this,yr).call(this))==null||o.renderer.on("user-interaction-end",u(this,D1))},"#handleUserInteractionStart"));O(this,k1,s(()=>{var n;let r=u(this,yr).call(this);if(r!=null&&this.expanded&&u(this,_h)&&!u(this,ps)){let o=r.currentFloorId,i=[1/0,r.currentFloorId];for(let a=0;a<u(this,vn).length;a++){let l=u(this,vn)[a],c=Math.abs(((n=r.renderer.camera.elevation)!=null?n:0)-a*this.distanceBetweenFloors);c<this.distanceBetweenFloors/3&&(i[0]=c,i[1]=l.id)}i[1]!==r.currentFloorId&&(r.currentFloorId=i[1],u(this,vn).forEach(a=>{r.api.updateState(a.containerId,{visible:u(this,hd)==="all-floors"?!0:r.currentFloor.id===a.id})}),r.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:r.currentFloorId,previousFloorId:o}))}},"#determineCurrentMapBasedOnElevation"));O(this,D1,s(()=>{var n,o;let r=u(this,yr).call(this);if(this.expanded&&r&&u(this,Eh)!==((n=r.renderer.camera.elevation)!=null?n:0)){let i=[1/0,r.currentFloorId,0];for(let a=0;a<u(this,vn).length;a++){let l=u(this,vn)[a],c=Math.abs(((o=r.renderer.camera.elevation)!=null?o:0)-a*this.distanceBetweenFloors);c<i[0]&&(i[0]=c,i[1]=l.id,i[2]=a*this.distanceBetweenFloors)}u(this,_h)&&te(this,wo,$Q).call(this,i[2]),A(this,Eh,0),r.renderer.off("user-interaction-end",u(this,D1))}},"#handleUserInteractionEnd"));O(this,Nl,null);O(this,F1,null);O(this,lu);O(this,yd);A(this,yr,r);let n=u(this,yr).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",u(this,A1)),n.renderer.on("camera-change",u(this,k1)),n.renderer.on("pre-render",u(this,_1)))}get state(){return u(this,md)}get expanded(){return u(this,md)!=="collapsed"}get distanceBetweenFloors(){if(u(this,au)==="auto"){if(u(this,yd)!=null)return u(this,yd);let r=te(this,wo,GQ).call(this);if(r)return A(this,yd,r),r}return typeof u(this,au)=="number"?u(this,au):q6}clearCachedFloorSeparationDistance(){A(this,yd,void 0)}get includedFloors(){var r;return(r=u(this,wo,Y6))!=null&&r.api.mapData?u(this,vn).map(n=>{var o,i;return(i=(o=u(this,wo,Y6))==null?void 0:o.api.mapData)==null?void 0:i.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return u(this,hd)}setFloorVisiblityMode(r){A(this,hd,r);let n=u(this,yr).call(this);n!=null&&u(this,vn).forEach(o=>{n.api.updateState(o.containerId,{visible:u(this,hd)==="all-floors"?!0:n.currentFloor.id===o.id})})}changeFloorOnElevationChanges(r){A(this,_h,r)}async expand(r){var o,i,a;let n=u(this,yr).call(this);if(n!=null)return(r==null?void 0:r.distanceBetweenFloors)==="auto"?A(this,au,"auto"):A(this,au,(o=r==null?void 0:r.distanceBetweenFloors)!=null?o:q6),A(this,vn,(r==null?void 0:r.includedFloors)!=null&&(r==null?void 0:r.includedFloors.length)>0?r==null?void 0:r.includedFloors.map(l=>n.floorsById.get(l.id)).filter(Boolean):n.currentFloorStack.floorObjects),u(this,vn).sort((l,c)=>l.elevation-c.elevation),u(this,vn).length<=1||this.expanded===!0?Promise.resolve():(A(this,ps,!0),n.api.Camera.setPanMode((i=r==null?void 0:r.cameraPanMode)!=null?i:"elevation"),this.changeFloorOnElevationChanges((a=r==null?void 0:r.changeFloorOnElevationChanges)!=null?a:!0),te(this,wo,K6).call(this,"expand",r).then(()=>{A(this,md,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{A(this,ps,!1)}))}async collapse(r){let n=u(this,yr).call(this);if(n!=null)return this.expanded===!0?(A(this,ps,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),te(this,wo,K6).call(this,"collapse",r).then(()=>{A(this,md,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{A(this,ps,!1)})):Promise.resolve()}destroy(){let r=u(this,yr).call(this);r!=null&&(r.renderer.off("user-interaction-start",u(this,A1)),r.renderer.off("camera-change",u(this,k1)),r.renderer.off("pre-render",u(this,_1)))}};yr=new WeakMap,Eh=new WeakMap,ya=new WeakMap,ps=new WeakMap,vn=new WeakMap,E1=new WeakMap,au=new WeakMap,_h=new WeakMap,md=new WeakMap,wo=new WeakSet,Y6=s(function(){return u(this,yr).call(this)},"#currentMap"),hd=new WeakMap,_1=new WeakMap,A1=new WeakMap,k1=new WeakMap,D1=new WeakMap,Nl=new WeakMap,$Q=s(function(r){var o,i,a;u(this,Nl)&&u(this,Nl).stop();let n=u(this,yr).call(this);n!=null&&(A(this,Nl,new Co({elevation:(o=n.renderer.camera.elevation)!=null?o:0}).to({elevation:r},150).easing(kr.Quadratic.Out).onComplete(()=>{var l;u(this,Nl)&&((l=u(this,yr).call(this))==null||l.renderer.getTweenGroup().remove(u(this,Nl)))}).onUpdate(({elevation:l})=>{n.renderer.camera.setElevation(l)}).start()),(i=u(this,yr).call(this))==null||i.renderer.getTweenGroup().add(u(this,Nl)),(a=u(this,yr).call(this))==null||a.renderer.render())},"#animateElevationTo"),F1=new WeakMap,lu=new WeakMap,K6=s(function(r,n){var l,c,p,f;u(this,ya)&&u(this,ya).stop();let o=u(this,yr).call(this);if(o==null)return Promise.reject(new Error("No current map"));let i=u(this,vn).indexOf(o.currentFloor),a=(l=o.renderer.camera.elevation)!=null?l:0;return A(this,F1,new Promise(m=>{A(this,lu,m)})),A(this,ya,new Co({percentExpanded:this.expandedFactor}).to({percentExpanded:r==="expand"?1:0},(c=n==null?void 0:n.duration)!=null?c:W4e).easing(Ol[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:m})=>{this.expandedFactor=m;let y=i*this.distanceBetweenFloors;o.renderer.camera.setElevation(r==="expand"?y*m:a*m)}).onComplete(()=>{var m;u(this,ya)&&((m=u(this,yr).call(this))==null||m.renderer.getTweenGroup().remove(u(this,ya)))}).start()),u(this,ya).cameraAnimation=!0,(p=u(this,yr).call(this))==null||p.renderer.getTweenGroup().add(u(this,ya)),(f=u(this,yr).call(this))==null||f.renderer.render(),u(this,F1)},"#animate"),jQ=s(function(r,n,o,i){let a=X6(r,o),l=n.clone(),c=X6(l,o);if(!bu(a)||!bu(c))return-1;let p=0,f;Z6&&i.querySelectorAll(".debug-box").forEach(y=>y.remove());do{if(p>1e4)return-1;if(p+=20,l.position.z=p,l.updateMatrixWorld(),c.makeEmpty(),X6(l,o,c),f=a.intersectsBox(c),Z6){let m=BQ(a,"blue",i),y=BQ(c,f?"red":"green",i);m.classList.add("debug-box"),y.classList.add("debug-box")}}while(f);return p},"#computeMinZOffsetToSeparateFirstTwoFloors"),GQ=s(function(){let r=u(this,yr).call(this);if(!r)return;let n=r.renderer,o=n.getThreeScene();if(!r.api.mapData||!o)return;let a=u(this,vn).length>0?u(this,vn):r.currentFloorStack.floorObjects;if(a.length<2)return;let l=n.getInternalState().geometry3DMap.get(a[0].id),c=n.getInternalState().geometry3DMap.get(a[1].id);if(!l||!c)return;if(v3(l,"group-container"),v3(c,"group-container"),Z6){let f=new Jr;f.setFromObject(l);let m=new Jr;if(m.setFromObject(c),l.children.forEach(T=>{T instanceof ze&&T.userData.debugBox&&hr(T)}),c.children.forEach(T=>{T instanceof ze&&T.userData.debugBox&&hr(T)}),!bu(f)||!bu(m))return;let y=new Mi(f.max.x-f.min.x,f.max.y-f.min.y,f.max.z-f.min.z),v=new jr({color:255,transparent:!0,opacity:.5}),x=new ze(y,v);x.position.set((f.min.x+f.max.x)/2,(f.min.y+f.max.y)/2,(f.min.z+f.max.z)/2),x.userData.debugBox=!0;let S=new Mi(m.max.x-m.min.x,m.max.y-m.min.y,m.max.z-m.min.z),I=new jr({color:"cyan",transparent:!0,opacity:.5}),P=new ze(S,I);P.position.set((m.min.x+m.max.x)/2,(m.min.y+m.max.y)/2,(m.min.z+m.max.z)/2),P.userData.debugBox=!0,l.add(x),c.add(P)}let p=te(this,wo,jQ).call(this,l,c,n.getThreeCamera(),n.container);if(p!==-1)return p},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),yd=new WeakMap,s(J6,"StackedMaps");var O1=J6,su=new Pe,RQ=new _e;function X6(e,t,r=new x8){return e.traverse(n=>{if(n instanceof ze){let i=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let l=0;l<i.count;l++)su.fromBufferAttribute(i,l),su.applyMatrix4(n.matrixWorld),su.applyMatrix4(t.matrixWorldInverse),su.applyMatrix4(t.projectionMatrix),su.z<1&&su.z>0&&(RQ.set(su.x,su.y),r.expandByPoint(RQ))}}),r}s(X6,"projectToBox2D");function NQ(e,t){let r=t.clientWidth,n=t.clientHeight;return new _e((e.x+1)*r/2,(1-e.y)*n/2)}s(NQ,"ndcToScreen");function BQ(e,t,r){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(t),n.style.pointerEvents="none";let o=NQ(new _e(e.min.x,e.min.y),r),i=NQ(new _e(e.max.x,e.max.y),r);n.style.left="".concat(o.x,"px"),n.style.top="".concat(i.y,"px");let a=Math.abs(i.x-o.x),l=Math.abs(i.y-o.y);return n.style.width="".concat(a,"px"),n.style.height="".concat(l,"px"),r.appendChild(n),n}s(BQ,"drawProjectedBox");d();d();function q4e(e,t){return"".concat(t," ").concat(e)}s(q4e,"formatMessage");var Q6=class Q6 extends Error{constructor(t,r=J9){super(q4e(t,r)),this.name="MappedinError"}};s(Q6,"MappedinError");var Bn=Q6;var Ah,e9=class e9{constructor(t,r,n,o){h(this,"id");h(this,"externalId");h(this,"name");h(this,"type");h(this,"floorIds");h(this,"defaultFloorId");h(this,"floorObjects",[]);h(this,"floorObjectsByElevation",new Map);h(this,"metadata");h(this,"containerId");h(this,"facade");h(this,"renderer");O(this,Ah);var a;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(a=t.floors)!=null?a:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=n;let i=n.addGroupContainer(this.id,{visible:!0,interactive:!0},r);this.containerId=i.id.toString(),this.facade=o}get defaultFloor(){if(u(this,Ah)==null){if(this.floorObjects.length===0)throw new Bn("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(r=>r.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r)),A(this,Ah,t)}return u(this,Ah)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){j.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var r,n;(n=(r=this.facade)==null?void 0:r.spaces)==null||n.forEach(o=>{this.renderer.setState(o.spaceId,{visible:t})})}};Ah=new WeakMap,s(e9,"FloorStackObject");var L1=e9;d();function UQ(e,t,r,n){let o={outdoorOpacity:1,floorStates:[]},i=e.sort((f,m)=>f.elevation-m.elevation),a=Math.min(0,i[0].elevation),l=i[i.length-1].elevation,c,p;for(let f=a;f<=l;f++){let m=i.find(I=>I.elevation===f);if(m==null){f>=0&&(c==null?c=f:p=f);continue}let y=0,v=f<0?Math.abs(m.elevation)*r:r,x=!1;if(c===0&&p!=null){let I=r*p;y=-I,v=I,x=!0}else if(c!=null&&p!=null){let I=c,P=e.find(M=>M.elevation===I-1),T=o.floorStates.find(M=>M.floor===P);if(T){let M=r*(p-c+2);T.state.footprint={...T.state.footprint,altitude:0,height:M,visible:!0}}}c=void 0,p=void 0;let S={floor:m,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};o.floorStates.push(S),m.id===t.id?(S.state.visible=!0,S.state.geometry.visible=!0,S.state.labels.enabled=!0,S.state.markers.enabled=!0,S.state.occlusion.enabled=!0,(m.elevation<0||x)&&(m.elevation<0&&(o.outdoorOpacity=.2),S.state.footprint.height=v,S.state.footprint.altitude=y,S.state.footprint.visible=!0)):n.includes(m.id)&&m.elevation<t.elevation?(S.state.visible=!0,S.state.geometry.visible=!0,S.state.markers.enabled=!0,S.state.occlusion.enabled=!0,S.state.footprint.visible=!0,m.elevation<0?(S.state.footprint.height=v,S.state.footprint.altitude=y,o.outdoorOpacity=.2):(S.state.footprint.height=v,S.state.footprint.altitude=y)):t.elevation>0&&m.elevation<t.elevation&&m.elevation>=0&&(S.state.visible=!0,S.state.footprint.visible=!0,S.state.footprint.height=r,S.state.footprint.altitude=y)}return o}s(UQ,"getVisiblityState");var Z4e={linear:kr.Linear.None,easeIn:kr.Quadratic.In,easeOut:kr.Quadratic.Out,easeInOut:kr.Quadratic.InOut},ga,n9=class n9 extends Fe{constructor(r,n,o,i){var p,f,m,y;super();h(this,"floorStacksById",new Map);h(this,"floorsById",new Map);h(this,"currentFloorId","");h(this,"currentFloorStackId","");h(this,"outdoorFloorStacks",new Set);h(this,"id");h(this,"renderer");h(this,"api");h(this,"mvf");h(this,"options",{});h(this,"styleMap");h(this,"StackedMaps");h(this,"animations",new Map);h(this,"Models",{add:s((r,n,o)=>{let{floorId:i,scale:a,...l}=o,c=i?this.floorsById.get(i):this.currentFloor,p={...l};a!=null&&(p.scale=Array.isArray(o.scale)?o.scale:[o.scale,o.scale,o.scale]);let f=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(m=>{var y;return{type:"Feature",properties:{id:_t(),rotation:o.rotation,scale:p.scale,interactive:o.interactive,verticalOffset:m.verticalOffset+((y=o.verticalOffset)!=null?y:0)},geometry:{type:"Point",coordinates:Ci(m)}}})},p,{parent:c.id});if(f==null)throw new Bn("error creating model");return this.renderer.getState(f).children},"add"),remove:s((r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)},"remove")});h(this,"Images",{add:s((r,n,o)=>{let{floorId:i,flipImageToFaceCamera:a,...l}=o,c=i?this.floorsById.get(i):this.currentFloor,p={type:"Feature",properties:l,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage(_t(),p,{url:n,flipImageToFaceCamera:a!=null?a:!1},c.id)},"add"),remove:s(r=>{this.renderer.remove(r)},"remove"),removeAll:s(()=>{},"removeAll")});h(this,"Markers",{add:s((r,n,o)=>{let i=r9(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:a,...l}=o,c=l;l.rank==="initial"&&(c.rank="medium");let p=i.layers.get(As),f=this.renderer.addMarker2D(Ci(r),n,{...c,occluderId:i==null?void 0:i.occluderId,attachTo:a},p==null?void 0:p.containerId);if(!f)throw new Bn("Failed to create Marker");return f},"add"),remove:s(r=>{this.renderer.remove(r)},"remove"),getContentEl:s(r=>{let n=this.renderer.getState(r);if((n==null?void 0:n.type)==="marker")return n.element},"getContentEl"),removeAll:s(()=>{},"removeAll"),setPosition:s((r,n,o)=>{var l;let i=this.renderer.getState(r),a=o?this.floorsById.get(o):this.currentFloor;if(!i){j.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(i.type!=="marker"){j.error('Geometry with id "'.concat(r,'" is not of type "marker".'));return}this.renderer.setState(i,{position:n,parent:(l=a==null?void 0:a.layers.get(As))==null?void 0:l.containerId})},"setPosition"),animateTo:s((r,n,o,i)=>{let a=this.renderer.getState(r),l=o?this.floorsById.get(o):this.currentFloor;if(!a)return j.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(a.type!=="marker")return j.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let c={duration:1e3,easing:"ease-in-out",...i};this.cancelAnimation(r);let p=new Co({lon:a.position[0],lat:a.position[1]}).to({lon:n[0],lat:n[1]},c.duration).easing(Z4e[c.easing]).onUpdate(({lon:f,lat:m})=>{var v;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let x=(v=l==null?void 0:l.layers.get(As))==null?void 0:v.containerId;x&&this.Markers.setPosition(r,[f,m],x)}}).start();return this.renderer.getTweenGroup().add(p),this.renderer.render(),this.animations.set(r,p),t9(p).then(()=>{this.animations.delete(r)})},"animateTo")});h(this,"Exporter",{getCurrentSceneGLTF:s(async r=>this.renderer.getCurrentSceneGLTF(r),"getCurrentSceneGLTF")});h(this,"Shapes",{add:s((r,n,o)=>{let i=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,a=_t();return this.renderer.addGeometryGroup(a,r,n,i.id),a},"add"),remove:s(r=>(this.renderer.remove(r.id),r.id),"remove")});h(this,"Text3D",{label:s((r,n,o)=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode)){j.warn("Enterprise mode is not enabled, skipping label creation");return}let i=VQ(this.renderer,r,n,o);if(i)return{textInfo:i,target:r}},"label"),labelAll:s((r={})=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode))return j.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let o=[];return n.getByType("space").forEach(a=>{var l,c;if(a.locations[0]){let p=VQ(this.renderer,a,(c=(l=a.locations[0])==null?void 0:l.name)!=null?c:a.name,r);p&&o.push({textInfo:p,target:a})}}),o},"labelAll"),remove:s(r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){j.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r},"remove")});h(this,"Labels",{all:s(({onCreate:r,labelOptions:n={}})=>{for(let o of Object.entries(this.mvf.space)){let[i,a]=o;a&&a.features.forEach(l=>{var S,I,P,T,M;let c=(S=this.api.getMapData())==null?void 0:S.getById("space",l.properties.id);if(!c)return;let p=(I=this.styleMap[l.properties.id])==null?void 0:I.showImage,f=(P=l.properties.details)==null?void 0:P.images,y={marker:{...p&&((T=f==null?void 0:f[0])!=null&&T.url)?{icon:f[0].url}:{},...(M=n.appearance)==null?void 0:M.marker},...n.appearance},x=(i?this.floorsById.get(i):this.currentFloor).layers.get(Ba);if(l.properties.center&&c.name!==""){let w=this.renderer.addLabel2D(l.properties.center,c.name,{id:l.properties.id+"-label",...n,appearance:y,rank:n.rank,attachTo:Mh(c)},Ur.is(c)?c.id:x==null?void 0:x.containerId);w&&r(w.id,c.name,c)}})}},"all"),add:s((r,n,o={})=>{let{attachTo:i,...a}=o,l=r9(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),c=l.layers.get(Ba),p=this.renderer.addLabel2D(Ci(r),n,{...a,occluderId:l.occluderId,attachTo:i},c==null?void 0:c.containerId);if(!p)throw new Bn("label creating failed");return p},"add"),remove:s(({entityId:r})=>{this.renderer.remove(r)},"remove"),removeAll:s(()=>{},"removeAll")});h(this,"Paths",{add:s((r,n)=>{var p;let o=(p=n==null?void 0:n.animateDrawing)!=null?p:!0,i=[],a=r[0].floorId||"root",l=0;for(let f of r){let{floorId:m="root",latitude:y,longitude:v}=f;m!==a&&(l++,a=m),i[l]==null&&i.push({floorId:m,coordinates:[]});let x=m===f.floorId?f:new Le({longitude:v,latitude:y,floorId:m});i[l].coordinates.push(x)}let c=i.reduce((f,{floorId:m,coordinates:y},v)=>{if(v!==0){let S=i[v-1],I=S.coordinates[S.coordinates.length-1],P=y[0],T=Ci(I),M=Ci(P),w=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:S.floorId},geometry:{type:"Point",coordinates:T}},{type:"Feature",properties:{parentId:m},geometry:{type:"Point",coordinates:M}}]},n,this.id);w&&(n!=null&&n.animateDrawing&&this.renderer.setState(w.id,{completeFraction:0}),f.push({...w,coordinates:[I,P]}))}let x=this.renderer.addPath({type:"FeatureCollection",features:y.map(S=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:Ci(S)}}))},n,m);return x&&(n!=null&&n.animateDrawing&&this.renderer.setState(x.id,{completeFraction:0}),f.push({...x,coordinates:y})),f},[]);if(o){let f=[],m=this.api.getMapData();return c.forEach(y=>{var x;let v=HQ(y,m,this.api);f.push(new Co({fraction:0}).to({fraction:1},v===!1?0:(x=n==null?void 0:n.drawDuration)!=null?x:1500).onUpdate(S=>{this.renderer.setState(y.id,{completeFraction:S.fraction})}))}),f.forEach((y,v)=>{v<f.length-1&&y.chain(f[v+1]),this.renderer.getTweenGroup().add(y)}),f[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),f[0]),{paths:c,animation:t9(f[f.length-1]).then(()=>{this.animations.delete(c[0].id.toString())})}}else return{paths:c,animation:Promise.resolve()}},"add"),remove:s(r=>{r.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})},"remove")});O(this,ga,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=i.core,this.api=i,this.id=r,this.renderer.addGroupContainer(r,{},"root"),this.options=o!=null?o:{},this.StackedMaps=new O1({currentMapGetter:s(()=>this,"currentMapGetter")}),this.mvf=(p=n==null?void 0:n.mvf)!=null?p:{};let a=zQ(this.mvf["styles.json"]||{});if(this.styleMap=a,A(this,ga,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0,...o==null?void 0:o.multiFloorView}),!n){this.id!=="outdoors-container"&&j.warn("Map (".concat(this.id,") created with no data."));let v=new L1({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(v.id,v),this.currentFloorStackId=v.id;let x=new M1(v.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,u(this,ga),o!=null?o:{});v.addFloor(x),this.floorsById.set(x.id,x),this.setFloor(x.id);return}let l=n.getMVFFeatureByType("floor-stack");if(l==null||l.length===0)throw new Bn("MVF does not contain any Floor Stacks.");for(let v of l){let x=new L1(v,this.id,this.renderer,(f=this.mvf.facade)==null?void 0:f[v.id]);if(x.floorIds.length!==0){for(let S of x.floorIds){let I=n.getMVFFeatureById("floor",S);if(I!=null){let P=this.mvf.space[I.id],T=this.mvf.obstruction[I.id];if((P==null||P.features.length===0)&&(T==null||T.features.length===0))continue;let M=new M1(x.id,I,this.renderer,u(this,ga),o!=null?o:{},this.mvf,a,n);x.addFloor(M),this.floorsById.set(M.id,M)}}this.floorStacksById.set(v.id,x),this.currentFloorStackId||(this.currentFloorStackId=v.id)}}for(let[v]of Object.entries(n.facadesBySpaceId)){let x=n.getById("space",v);x&&(this.outdoorFloorStacks.add(x.floor.floorStack.id),(m=this.floorsById.get(x.floor.id))==null||m.setVisible(!0))}let c=(y=this.mvf.enterprise)==null?void 0:y.venue.defaultMap;if(o!=null&&o.initialFloor){let v=iy(o.initialFloor);v&&this.floorsById.has(v)?c=v:j.error("Invalid initial floor specified (".concat(o.initialFloor,"), using default behavior instead"))}c||(c=this.currentFloorStack.defaultFloor.id),this.setFloor(c)}get currentFloorStack(){let r=this.floorStacksById.get(this.currentFloorStackId);if(!r)throw new Bn('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return r}setFloorStack(r,n){if(this.currentFloorStackId===r)return;let o=this.floorStacksById.get(r);if(o==null){j.error("Invalid floor stack passed to setFloorStack (".concat(r,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(o.floorObjects.length===0){j.error("Floor stack (".concat(r,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(o.defaultFloor.id,n)}get currentFloor(){let r=this.floorsById.get(this.currentFloorId);if(!r)throw new Bn('Floor with id "'.concat(this.currentFloorId,'" not found'));return r}get floors(){return Array.from(this.floorsById.values())}processFloorChange(r){var i,a,l,c,p;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let n=this.floorsById.get(r),o=this.floorStacksById.get(this.currentFloorStackId);if(n&&o)if(!((i=u(this,ga))!=null&&i.enabled)||n.floorStackId!==(o==null?void 0:o.id))for(let f of this.floorStacksById.values())f.floorObjects.forEach(m=>{m.id!==r&&m.setVisible(!1)});else{let f=UQ(this.currentFloorStack.floorObjects,n,u(this,ga).floorHeight,((l=(a=this.api.Navigation)==null?void 0:a.floors)==null?void 0:l.map(m=>m.id))||[]);(p=(c=this.api)==null?void 0:c.Outdoor)==null||p.setOpacity(f.outdoorOpacity),f.floorStates.forEach(m=>{m.floor&&this.api.updateState(m.floor.id,m.state)}),u(this,ga).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*u(this,ga).floorHeight)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){j.error("Invalid floor passed to setFloor (".concat(r,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let i=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:i,floorId:r,reason:n}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(r),this.currentFloorId=r,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.publish("floor-change",{reason:n,floorId:this.currentFloor.id,previousFloorId:i})}cancelAnimation(r){let n=this.animations.get(r);n&&(n.stop(),this.animations.delete(r),this.renderer.getTweenGroup().remove(n))}};ga=new WeakMap,s(n9,"GeojsonApiMapObject");var R1=n9;function VQ(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,{...n,parentId:t.floor.id})}s(VQ,"labelSpace");d();var ds,B1,o9=class o9{constructor({currentMapGetter:t}){O(this,ds,new Map);O(this,B1);A(this,B1,t)}get currentMap(){return u(this,B1).call(this)}getById(t){return u(this,ds).get(t)}add(t,r,n){let o=t.anchorTarget;if(!o)throw new Error("get coordinate failed");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Markers.add(o,r,{...n,rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:Mh(t)});if(a==null)throw new Error("error creating marker");let l=i.Markers.getContentEl(a.id.toString());if(!l)throw new Error("marker component should exist");let c=new Al(a.id.toString(),l,t);return u(this,ds).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(t){var n;let r=u(this,ds).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),u(this,ds).delete(t.id.toString()))}removeAll(){let t=[];return u(this,ds).forEach(({marker:r})=>{this.remove(r),t.push(r),u(this,ds).delete(r.id.toString())}),t}setPosition(t,r){var a;let n=r.anchorTarget;if(!n){j.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){j.error("Cannot determine the current map.");return}let i=u(this,ds).get(t.id);if(!i){j.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(i.entityId,Ci(n),(a=n.floorId)!=null?a:o.currentFloorId),i.marker.updateTarget(r)}animateTo(t,r,n){var l;let o=r.anchorTarget;if(!o)return j.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return j.error("Cannot determine the current map."),Promise.resolve();let a=u(this,ds).get(t.id);return a?(a.marker.updateTarget(r),i.Markers.animateTo(a.entityId,Ci(o),(l=o.floorId)!=null?l:i.currentFloorId,n)):(j.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};ds=new WeakMap,B1=new WeakMap,s(o9,"Markers");var N1=o9;d();var Bl,j1,i9=class i9{constructor({currentMapGetter:t}){O(this,Bl,new Map);O(this,j1);A(this,j1,t)}get currentMap(){return u(this,j1).call(this)}getById(t){return u(this,Bl).get(t)}add(t,r,n){var c;let o=t.anchorTarget;if(!o)throw new Error("Target does not implement IAnchorable.");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Images.add(Ci(o),r,{...n,floorId:o.floorId,verticalOffset:o.verticalOffset+((c=n.verticalOffset)!=null?c:0)});if(!a)throw new Error("image component should exist");let l=new h1(a.id.toString(),r,t);return u(this,Bl).set(l.id,{image:l,entityId:a.id.toString()}),l}remove(t){var n;let r=u(this,Bl).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),u(this,Bl).delete(t.id.toString()))}removeAll(){let t=[];return u(this,Bl).forEach(({image:r})=>{this.remove(r),t.push(r),u(this,Bl).delete(r.id.toString())}),t}};Bl=new WeakMap,j1=new WeakMap,s(i9,"Images");var $1=i9;d();var ba,U1,s9=class s9{constructor({currentMapGetter:t}){O(this,ba,new Map);O(this,U1);A(this,U1,t)}get currentMap(){return u(this,U1).call(this)}getById(t){return u(this,ba).get(t)}add(t,r,n){let o=[t],i=o.reduce((c,p)=>{var f;return p?(c.has(p.floorId)||c.set(p.floorId,[]),(f=c.get(p.floorId))==null||f.push(p),c):(j.error("Cannot determine coordinate from options."),c)},new Map);if(!o.length)throw new Error("targets should not be empty when adding a model");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let l=[];return i.forEach((c,p)=>{let f=_t();a.Models.add(f,c,{...n,url:r,floorId:p}).forEach(({id:y})=>{let v=new ud(y.toString(),f,c[0]);u(this,ba).set(v.id,{model:v,entityId:y.toString(),groupId:f}),l.push(v)})}),l[0]}remove(t){var n;let r=u(this,ba).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),u(this,ba).delete(t.id.toString()))}removeAll(){let t=[];return u(this,ba).forEach(({model:r})=>{var o;let n=u(this,ba).get(r.id);n&&(t.push(r),(o=this.currentMap)==null||o.Models.remove(n.entityId,n.groupId),u(this,ba).delete(r.id.toString()))}),t}};ba=new WeakMap,U1=new WeakMap,s(s9,"Models");var G1=s9;d();var va,z1,a9=class a9{constructor({currentMapGetter:t}){O(this,va,new Map);O(this,z1);A(this,z1,t)}get currentMap(){return u(this,z1).call(this)}getById(t){return u(this,va).get(t)}add(t,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let o=n.Paths.add(t,r),i=o.paths.map(l=>l.id.toString()),a=new as(_t(),o.animation,t,o.paths);for(let l of i)u(this,va).set(l,{path:a,entityIds:i});return u(this,va).set(a.id,{path:a,entityIds:i}),a}remove(t){var n;let r=u(this,va).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),u(this,va).delete(t.id),r.entityIds.forEach(o=>u(this,va).delete(o)))}removeAll(){let t=[];return u(this,va).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};va=new WeakMap,z1=new WeakMap,s(a9,"Paths");var V1=a9;d();var nee=ys(H7(),1);d();var l9="#2266ff",X4e="#808080",WQ="#f5f5f5";var qQ={radius:10,color:l9,inactiveColor:X4e,heading:{color:l9,opacity:.7},accuracyRing:{color:l9,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};d();var ZQ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";d();var XQ=s((e,t,r=0)=>{if(Math.abs(e)>=Math.PI)throw new Error("Sector angle too wide!");let n=r/Math.tan(e/2),o=r/Math.sin(e/2),i=o+t,a=10,l=new bs;l.moveTo(-o*Math.sin(e/2),o*Math.cos(e/2)-n);for(let c=0;c<a;c++)l.lineTo(-(i*Math.sin(e/2-e/a*c)),i*Math.cos(e/2-e/a*c)-n);for(let c=0;c<a;c++)l.lineTo(-(r*Math.sin(Math.PI/-2+Math.PI/a*c)),r*Math.cos(Math.PI/-2+Math.PI/a*c));return new vs(l,{depth:.1,bevelEnabled:!1,UVGenerator:K4e(t)})},"createSectorGeometry"),c9=s((e,t,r)=>{let o=Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/r;return o>1?o=1:o<0&&(o=0),new _e(0,o)},"generateRadialUV"),K4e=s(e=>({generateTopUV:s((t,r,n,o,i)=>{let a=r[n*3],l=r[n*3+1],c=r[o*3],p=r[o*3+1],f=r[i*3],m=r[i*3+1];return[c9(a,l,e),c9(c,p,e),c9(f,m,e)]},"generateTopUV"),generateSideWallUV:s(()=>[new _e(0,1),new _e(0,1),new _e(0,1),new _e(0,1)],"generateSideWallUV")}),"radialUVGenerator");function YQ(e,t){if(t==null)return e;let r={latitude:e==null?void 0:e.latitude,longitude:e==null?void 0:e.longitude,accuracy:e==null?void 0:e.accuracy,floor:e==null?void 0:e.floor,heading:e==null?void 0:e.heading};return"latitude"in t&&(r.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?e==null?void 0:e.latitude:t.latitude),"longitude"in t&&(r.longitude=t.longitude==null||t.longitude==="device"?e==null?void 0:e.longitude:t.longitude),"accuracy"in t&&(r.accuracy=t.accuracy==="device"?e==null?void 0:e.accuracy:t.accuracy),"floor"in t&&(r.floor=t.floor==="device"?e==null?void 0:e.floor:t.floor),"heading"in t&&(r.heading=t.heading==="device"?e==null?void 0:e.heading:t.heading),r}s(YQ,"getPositionWithOverrides");function J4e([e,t],[r,n],[o,i]){let a=r-e,l=n-t,c=a**2+l**2;if(c===0)return;let p=((o-e)*a+(i-t)*l)/c,f;p<=0?f=[e,t]:p>=1?f=[r,n]:f=[e+p*a,t+p*l];let m=C0([o,i],f);return{proportion:Math.max(0,Math.min(1,p)),intersection:f,distance:m}}s(J4e,"getPointLineIntersection");function KQ(e,t){if(e==null||e.length<2)return;let r=Number.MAX_SAFE_INTEGER,n,o=0,i=0;for(let a=0;a<e.length-1;a++){let l=e[a],c=e[a+1],p=J4e(l,c,t);p!=null&&p.distance<r&&(r=p.distance,n=p.intersection,o=a,i=p.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:o,proportion:i}}s(KQ,"findBlueDotOnPath");function JQ(e,t){let r=new Ei({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,o=.35*4,i=XQ(Math.PI/6,o,n);new Ad().load(ZQ,l=>{r.alphaMap=l,r.needsUpdate=!0});let a=new ze(i,r);return a.position.z=-.05,a.renderOrder=0,a}s(JQ,"createHeadingCone");function QQ(e,t){let r=new v0(1,1,.05,32),n=new Ei({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),o=new ze(r,n);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}s(QQ,"createAccuracyRing");function eee(e){let t=new v0(.35,.35,.07,32),r=new Ei({transparent:!0,color:WQ,depthTest:!1,depthWrite:!1}),n=new ze(t,r);n.renderOrder=2;let o=new v0(.35*.8,.35*.8,.01,32),i=new Ei({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),a=new ze(o,i);return a.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,a.rotation.x=Math.PI/2,a.position.z=.07,{outerMesh:n,innerMesh:a}}s(eee,"createBlueDot");var oee=ys(tee(),1);var e3="blue-dot",gd,$l,zo,Ho,jl,bd,vd,xd,Dr,Mo,H1,Gl,W1,q1,Z1,X1,JS,xa,Ul,QS,Id,Y1,Ia,u9=class u9 extends Fe{constructor(r,n){super();this.core=r;this.geoJSONApi=n;O(this,gd,null);h(this,"geometry");O(this,$l);O(this,zo);O(this,Ho);O(this,jl);O(this,bd);O(this,vd);O(this,xd);O(this,Dr,qQ);O(this,Mo,1);O(this,H1);O(this,Gl);h(this,"state","disabled");h(this,"following",!1);O(this,W1,s(r=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",r)},"#getFloorByFloorId"));O(this,q1,s(r=>{var o;let n;if(r!=null){let i=(o=this.geoJSONApi.currentMap)==null?void 0:o.currentFloorStack.floorObjectsByElevation.get(r);n=i?u(this,W1).call(this,i.id):void 0}return n},"#getFloorByFloorLevel"));O(this,Z1,s(r=>{if(this.state==="hidden"||this.state==="disabled")return;let[n,o,i,a]=r.children;if(u(this,JS).call(this),o.scale.set(u(this,Mo),u(this,Mo),u(this,Mo)),o.position.z=.07/2*u(this,Mo),i.scale.set(u(this,Mo),u(this,Mo),u(this,Mo)),i.position.z=.07*u(this,Mo),this.state==="active"){i.material.color.set(u(this,Dr).color);let l=this.accuracy;l!=null?(n.visible=!0,u(this,vd)&&u(this,vd).stop(),A(this,vd,new Co({scale:n.scale.x}).to({scale:l/2},150).onUpdate(({scale:p})=>{n.scale.set(p,1,p)}).start()),this.core.getTweenGroup().add(u(this,vd))):n.visible=!1;let c=this.heading;if(c!=null){a.visible=!0,u(this,xd)&&u(this,xd).stop();let{start:p,end:f}=P0(a.rotation.z,-Ke.degToRad(c));A(this,xd,new Co({rotation:p}).to({rotation:f},150).onUpdate(({rotation:m})=>{a.rotation.z=m}).start()),this.core.getTweenGroup().add(u(this,xd)),a.scale.set(u(this,Mo),u(this,Mo),1)}else a.visible=!1}else this.state==="inactive"&&(i.material.color.set(u(this,Dr).inactiveColor),a.visible=!1,n.visible=!1)},"#updateGeometryPerFrame"));O(this,X1,s(r=>{var a,l;let n;try{n=n5e.parse(YQ(r,u(this,zo)))}catch(c){u(this,xa).call(this,"error"),j.error("BlueDot: Position parse failed",c instanceof $.ZodError?c.message:String(c)),this.publish("error");return}u(this,Dr).debug&&j.log("BlueDot: Parsed position",n),A(this,Ho,n),u(this,xa).call(this,"position-update"),u(this,jl)&&clearTimeout(u(this,jl)),typeof u(this,Dr).timeout=="number"&&u(this,Dr).timeout<1/0&&A(this,jl,setTimeout(()=>{u(this,Dr).debug&&j.log("BlueDot: Position timed out after ".concat(u(this,Dr).timeout,"ms")),u(this,xa).call(this,"timeout"),this.core.render()},u(this,Dr).timeout)),(l=this.geoJSONApi.getMapDataInternal())==null||l.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:n.latitude,longitude:n.longitude,floorLevel:(a=n.floor)==null?void 0:a.elevation,accuracy:n.accuracy}});let o=n.floor!=null?n.floor.id:"outdoors-container",i=[n.longitude,n.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(e3,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:i}},{setup:s(c=>{let p=QQ(u(this,Dr).accuracyRing.color,u(this,Dr).accuracyRing.opacity),{outerMesh:f,innerMesh:m}=eee(u(this,Dr).color),y=JQ(u(this,Dr).heading.color,u(this,Dr).heading.opacity);c.add(p),p.visible=!1,c.add(f),c.add(m),c.add(y),y.visible=!1,u(this,Z1).call(this,c)},"setup"),update:u(this,Z1)},{visible:!0,interactive:!0},o);else{let c=this.core.getState(this.geometry);i=[c.position[0],c.position[1]]}u(this,bd)&&u(this,bd).stop(),A(this,bd,new Co(i).to([n.longitude,n.latitude],1e3).easing(kr.Cubic.Out).onUpdate(c=>{if(this.geometry){let p={position:[c[0],c[1]]};p.parent=o,this.core.setState(this.geometry,p)}}).start()),this.core.getTweenGroup().add(u(this,bd)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));h(this,"onPositionUpdate",s(r=>{var n,o,i,a,l;if(this.state!=="disabled"){try{r5e.parse(r)}catch(c){u(this,xa).call(this,"error"),j.error("BlueDot: Browser sent invalid position",c instanceof $.ZodError?c.message:String(c)),this.publish("error");return}A(this,$l,{latitude:(n=r.coords)==null?void 0:n.latitude,longitude:(o=r.coords)==null?void 0:o.longitude,accuracy:(i=r.coords)==null?void 0:i.accuracy,heading:(a=r.coords)==null?void 0:a.heading,floor:u(this,q1).call(this,(l=r.coords)==null?void 0:l.floorLevel)}),u(this,X1).call(this,u(this,$l))}},"onPositionUpdate"));h(this,"onPositionError",s(r=>{var n;switch(u(this,xa).call(this,"error"),r.code){case r.PERMISSION_DENIED:j.error("Geolocation permission denied by the user.",r),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:j.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:j.error("Geolocation request timed out.",r);break;default:j.error("An unknown geolocation error occurred.",r);break}this.publish("error",r)},"onPositionError"));O(this,JS,s(()=>{var n;let r=Math.round(this.core.camera.zoomLevel*1e5);if(r!==u(this,H1)){A(this,H1,r);let o=(n=this.core.getMetresPerPixel())!=null?n:1;A(this,Mo,Math.max(u(this,Dr).radius/(.35/o),1))}},"#updateScale"));O(this,xa,s(r=>{let n=t5e[this.state].actions[r];if(n){switch(u(this,Dr).debug&&j.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(n," using ").concat(r)),n){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==n&&(this.publish("state-change",{state:n,action:r}),this.state=n)}else j.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))},"#transitionAction"));O(this,Ul);O(this,QS,s(()=>{if(u(this,Ul)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let n=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(o=>o.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(o=>o.floorId===this.geoJSONApi.currentFloor.id);A(this,Ul,(0,oee.default)(n.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return u(this,Ul)},"#getSimplifiedDirections"));O(this,Id,s(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),u(this,Ia)&&(this.off("position-update",u(this,Ia)),A(this,Ia,void 0)),this.following=!1,A(this,Ul,void 0),this.core.off("user-interaction-start",u(this,Id)),this.geoJSONApi.currentMap.off("navigation-active-path-change",u(this,Y1)),this.publish("follow-change",{following:!1})},"#cancelFollow"));O(this,Y1,s(()=>{A(this,Ul,void 0)},"#pathChangeHandler"));O(this,Ia);h(this,"follow",s((r,n)=>{var i,a,l,c;if(r===!1){u(this,Id).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&j.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(r,"'. To control the bearing manually, use mode 'position-only'."));let o={zoomLevel:(i=n==null?void 0:n.zoomLevel)!=null?i:21,bearing:r==="position-only"?n==null?void 0:n.bearing:void 0,pitch:(a=n==null?void 0:n.pitch)!=null?a:45,duration:(l=n==null?void 0:n.duration)!=null?l:1e3,easing:(c=n==null?void 0:n.easing)!=null?c:"ease-in-out"};this.following?u(this,Ia)&&this.off("position-update",u(this,Ia)):(this.following=!0,this.core.on("user-interaction-start",u(this,Id)),this.geoJSONApi.currentMap.on("navigation-active-path-change",u(this,Y1))),A(this,Ia,p=>{let{coordinate:f,heading:m,floor:y}=p;if(o.center=[f.longitude,f.latitude],y!=null&&y.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(y.id),A(this,Ul,void 0)),r==="position-and-heading")o.bearing=m!=null?m:void 0;else if(r==="position-and-path-direction"){let v=u(this,QS).call(this);if(v!=null){let x=KQ(v,[f.longitude,f.latitude]);if(x!=null){let S=v[x.segmentIndex],I=v[x.segmentIndex+1];o.bearing=P8(S,I)}}}this.core.camera.animateTo(o)}),this.on("position-update",u(this,Ia)),this.publish("follow-change",{following:!0,mode:r})},"follow"))}get heading(){var r;return(r=u(this,Ho))==null?void 0:r.heading}get accuracy(){var r;return(r=u(this,Ho))==null?void 0:r.accuracy}get coordinate(){var r,n;if(u(this,Ho)!=null)return(u(this,Gl)==null||((r=this.floor)==null?void 0:r.id)!==u(this,Gl).floorId||u(this,Ho).latitude!==u(this,Gl).latitude||u(this,Ho).longitude!==u(this,Gl).longitude)&&A(this,Gl,new Le(u(this,Ho).latitude,u(this,Ho).longitude,(n=this.floor)==null?void 0:n.id)),u(this,Gl)}get floor(){var r;return(r=u(this,Ho))==null?void 0:r.floor}enable(r){A(this,Dr,(0,nee.default)({},r,u(this,Dr))),u(this,xa).call(this,"enable"),this.watchDevicePosition(u(this,Dr).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),u(this,jl)&&(clearTimeout(u(this,jl)),A(this,jl,void 0)),this.following&&u(this,Id).call(this),this.watchDevicePosition(!1),A(this,Ho,void 0),A(this,zo,void 0),u(this,xa).call(this,"disable")}watchDevicePosition(r){if(u(this,gd)&&(navigator.geolocation.clearWatch(u(this,gd)),A(this,gd,null)),u(this,$l)&&A(this,$l,void 0),r){if(this.state==="disabled"){j.warn("BlueDot must be enabled before watching browser position.");return}A(this,gd,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var o,i;r==null?A(this,zo,void 0):"coords"in r?A(this,zo,Object.assign({},u(this,zo),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:u(this,q1).call(this,r.coords.floorLevel)})):(A(this,zo,Object.assign({},u(this,zo),r)),"floorOrFloorId"in r&&(u(this,zo).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?u(this,W1).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((o=u(this,zo))==null?void 0:o.latitude)!=null&&((i=u(this,zo))==null?void 0:i.longitude)!=null||u(this,$l)!=null)&&u(this,X1).call(this,u(this,$l))}};gd=new WeakMap,$l=new WeakMap,zo=new WeakMap,Ho=new WeakMap,jl=new WeakMap,bd=new WeakMap,vd=new WeakMap,xd=new WeakMap,Dr=new WeakMap,Mo=new WeakMap,H1=new WeakMap,Gl=new WeakMap,W1=new WeakMap,q1=new WeakMap,Z1=new WeakMap,X1=new WeakMap,JS=new WeakMap,xa=new WeakMap,Ul=new WeakMap,QS=new WeakMap,Id=new WeakMap,Y1=new WeakMap,Ia=new WeakMap,s(u9,"BlueDot");var Dh=u9,t5e={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",disable:"disabled",timeout:"hidden"}},active:{actions:{enable:"active",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},inactive:{actions:{enable:"inactive",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},disabled:{actions:{enable:"hidden",disable:"disabled"}}},r5e=$.object({coords:$.object({latitude:$.number(),longitude:$.number(),accuracy:$.number(),altitude:$.number().optional().nullable(),altitudeAccuracy:$.number().optional().nullable(),heading:$.number().optional().nullable(),speed:$.number().optional().nullable(),floorLevel:$.number().optional().nullable()}),timestamp:$.number()}),n5e=$.object({latitude:$.number(),longitude:$.number(),floor:$.custom().optional(),accuracy:$.number().optional(),heading:$.number().optional().nullable()});d();var Vl,J1,p9=class p9{constructor({currentMapGetter:t}){O(this,Vl,new Map);O(this,J1);A(this,J1,t)}get currentMap(){return u(this,J1).call(this)}getById(t){return u(this,Vl).get(t)}add(t,r,n){let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let i=o.Shapes.add(t,r||{},{floorId:n==null?void 0:n.id}),a=new ru(i);return u(this,Vl).set(a.id,a),a}remove(t){var n;u(this,Vl).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),u(this,Vl).delete(t.id.toString()))}removeAll(){let t=[];return u(this,Vl).forEach(r=>{this.remove(r),t.push(r.id),u(this,Vl).delete(r.id.toString())}),t}};Vl=new WeakMap,J1=new WeakMap,s(p9,"Shapes");var K1=p9;d();var e0,d9=class d9{constructor({currentMapGetter:t}){O(this,e0);A(this,e0,t)}get currentMap(){return u(this,e0).call(this)}setFromStyleCollection(t){var r,n,o,i;for(let a in t)for(let l of((r=this.currentMap)==null?void 0:r.floors)||[]){if(t[a]==null||!l.layers.has(Or))continue;let c=l.layers.get(Or);if(c!=null&&c.layers.has(a)&&"color"in t[a]){let m=c.layers.get(a);m&&((n=this.currentMap)==null||n.renderer.setState(m,{color:t[a].color}))}if(c&&a===oc&&!(_s in t)){let m=c.layers.get(_s);m&&"color"in t[a]&&((o=this.currentMap)==null||o.renderer.setState(m,{color:t[a].color}))}if(!l.layers.has(Au))continue;let p=l.layers.get(Au),f=l.facadesByStyleId.get(a);if(f&&f.length>0)for(let m of f){let y=p.layers.get("".concat(m,"-").concat(a));y&&"color"in t[a]&&((i=this.currentMap)==null||i.renderer.setState(y,{color:t[a].color}))}}}};e0=new WeakMap,s(d9,"Style");var Q1=d9;d();var f9={opacity:1},$n,t0,r0,uu,zl,Sd,m9,iee,h9=class h9{constructor(t,r){O(this,Sd);O(this,$n);O(this,t0,[]);O(this,r0,{opacity:"initial"});O(this,uu,{opacity:new Map});O(this,zl,new Set);A(this,$n,t),A(this,t0,r||[]);let n=u(this,$n).map;n&&n.on("idle",()=>{u(this,uu).opacity.size||te(this,Sd,m9).call(this,n)})}setStyle(t){var r,n;if(u(this,$n).map){(r=u(this,$n).map)==null||r.setStyle(t),u(this,zl).size&&(u(this,zl).clear(),this.hide()),te(this,Sd,iee).call(this),te(this,Sd,m9).call(this,u(this,$n).map),this.setOpacity(u(this,r0).opacity),(n=u(this,$n).map)==null||n.moveLayer(C3);for(let[o,i,a]of u(this,t0)||[])u(this,$n).hideOutdoorLayersIntersectingPolygons(o,i,a)}}get map(){return u(this,$n).map}get enabled(){return!!u(this,$n).map}get visible(){return u(this,zl).size===0}show(){let t=u(this,$n).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{u(this,zl).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),u(this,zl).clear())}hide(t=[]){let r=u(this,$n).map;if(!r)return;let n=r.getStyle().layers;n&&n.forEach(o=>{let i=r.getLayoutProperty(o.id,"visibility");!t.includes(o.id)&&i!=="none"&&(r.setLayoutProperty(o.id,"visibility","none"),u(this,zl).add(o.id))})}setOpacity(t,r=[]){var i,a;let n=u(this,$n).map;if(!n)return;let o=(a=(i=u(this,$n).map)==null?void 0:i.getStyle())==null?void 0:a.layers;o&&n.once("idle",()=>{o.forEach(l=>{let c=n.getLayoutProperty(l.id,"visibility");if(!r.includes(l.id)&&c!=="none")try{let p=u(this,uu).opacity.get(l.id);p!==void 0&&(l.id==="background"||(l.type==="symbol"?(n.setPaintProperty(l.id,"icon-opacity",t==="initial"?p[0]:t),n.setPaintProperty(l.id,"text-opacity",t==="initial"?p[1]:t)):n.setPaintProperty(l.id,"".concat(l.type,"-opacity"),t==="initial"?p[0]:t)),u(this,r0).opacity=t)}catch(p){j.warn("Error setting opacity:",p)}})})}};$n=new WeakMap,t0=new WeakMap,r0=new WeakMap,uu=new WeakMap,zl=new WeakMap,Sd=new WeakSet,m9=s(function(t){let r=t.getStyle().layers;r&&r.forEach(n=>{var i,a,l;t.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?u(this,uu).opacity.set(n.id,[(i=t.getPaintProperty(n.id,"icon-opacity"))!=null?i:f9.opacity,(a=t.getPaintProperty(n.id,"text-opacity"))!=null?a:f9.opacity]):u(this,uu).opacity.set(n.id,[(l=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?l:f9.opacity,void 0])))})},"#setInitialStyle"),iee=s(function(){Object.values(u(this,uu)).forEach(t=>t.clear())},"#clearInitialStyle"),s(h9,"Outdoor");var Fh=h9;d();function see(){K7(!1)}s(see,"disableText3DWorker");var Hl,Wl,pu,y9=class y9{constructor({currentMapGetter:t}){O(this,Hl);O(this,Wl,new Map);O(this,pu,new Map);A(this,Hl,t)}labelAll(t={}){var o,i;let r=[],n=new Set;return(i=(o=u(this,Hl).call(this))==null?void 0:o.Text3D.labelAll(t))==null||i.forEach(({textInfo:a,target:l})=>{let c=a.id.toString(),p=u(this,pu).get(c);if(p){n.has(c)||r.push(p.text3DView),n.add(c);return}n.add(c);let f=new nu(c,l);u(this,Wl).set(f.id,{targetId:l.id,text3d:c,text3DView:f}),u(this,pu).set(c,{text3DView:f}),r.push(f)}),r}label(t,r,n={}){var i;if(u(this,Hl).call(this))if(Ur.is(t)){let a=(i=u(this,Hl).call(this))==null?void 0:i.Text3D.label(t,r,n);if(!a)return;let l=a.textInfo.id.toString(),c=u(this,pu).get(l);if(c)return c.text3DView;let p=new nu(l,a.target);return u(this,Wl).set(p.id,{targetId:a.target.id,text3d:l,text3DView:p}),u(this,pu).set(l,{text3DView:p}),p}else throw new Error("Non-space target is not supported")}remove(t){var o;let r=typeof t=="string"?t:t.id,n=u(this,Wl).get(r);n&&((o=u(this,Hl).call(this))==null||o.Text3D.remove(n.text3d),u(this,Wl).delete(r),u(this,pu).delete(n.text3d))}removeAll(){u(this,Wl).forEach(t=>{var r;(r=u(this,Hl).call(this))==null||r.Text3D.remove(t.text3d)}),u(this,Wl).clear()}};Hl=new WeakMap,Wl=new WeakMap,pu=new WeakMap,s(y9,"Text3D");var t3=y9;var r3=.05,b9=class b9{constructor(t,r){h(this,"core");h(this,"mapObjects",[]);h(this,"id");h(this,"mapDataExternal",{});h(this,"mapsByFloorId",{});h(this,"mapData");h(this,"currentMap");h(this,"hiddenOutdoorGeometries",[]);h(this,"lastFacadeIntersected");h(this,"manualFloorVisibility",!1);h(this,"mapView");h(this,"Camera");h(this,"Labels");h(this,"Text3D");h(this,"Markers");h(this,"Models");h(this,"Paths");h(this,"Exporter");h(this,"Navigation");h(this,"Outdoor");h(this,"BlueDot");h(this,"Shapes");h(this,"Style");h(this,"Images");h(this,"update",s(()=>{this.core.render()},"update"));this.core=t,this.mapView=r,this.Camera=new S1(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new R1("outdoors-container",void 0,void 0,this);this.mapObjects.push(n),this.currentMap=n,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")}),this.core.on("geometry-in-focus",c=>{this.mapView.publish("facades-in-view-change",{facades:c.map(p=>{var f;return(f=this.getMapDataInternal())==null?void 0:f.facadesById[p]}).filter(p=>p!=null)})});let o=new b1(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let i=s(c=>p=>{var B,D,F;let f=[],m=[],y=[],v=[];p.labels.forEach(L=>{let H=this.Labels.getById(L.toString());H&&f.push(H.label)}),p.markers.forEach(L=>{let H=this.Markers.getById(L.toString())||this.Navigation.getMarkerById(L.toString());H&&m.push(H.marker)}),p.models.forEach(L=>{let H=this.Models.getById(L.toString());H&&y.push(H.model)}),p.paths.forEach(L=>{let H=this.Paths.getById(L.toString())||this.Navigation.getPathById(L.toString());H&&v.push(H.path)});let x=p.geometry.includes(e3),S=p.geometry.filter(L=>L!==e3)[0],I;S&&(I=(B=this.getMapDataInternal())==null?void 0:B.getById("space",S)),I||(I=(D=this.getMapDataInternal())==null?void 0:D.getById("object",S));let P=p.containers.reduce((L,H)=>{var G;let U=(G=this.getMapDataInternal())==null?void 0:G.getById("floor",H);return U&&ao.is(U)&&L.push(U),L},[]),T,M=0;if(P.length>0){T=P[0].id;let L=this.core.getState(T);M=p.coordinate[2]?p.coordinate[2]-L.altitude:M}let w;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(L=>{this.core.setState(L.id,{hovered:!1})}),I&&Ur.is(I)&&(w=(F=this.getMapDataInternal())==null?void 0:F.facadesBySpaceId[S],w&&w.spaces.forEach(L=>{this.core.setState(L.id,{hovered:!0})})),this.lastFacadeIntersected=w;let E={coordinate:new Le({latitude:p.coordinate[1],longitude:p.coordinate[0],floorId:T,verticalOffset:M}),spaces:I&&Ur.is(I)?[I]:[],objects:I&&lo.is(I)?[I]:[],markers:m,labels:f,models:y,paths:v,blueDot:x,floors:P,facades:w?[w]:[]};"pointerEvent"in p&&(E.pointerEvent=p.pointerEvent),this.mapView.publish(c,E)},"createHandler");this.core.on("hover",i("hover")),this.core.on("click",i("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let a={currentMapGetter:s(()=>this.currentMap,"currentMapGetter")};this.Markers=new N1(a),this.Models=new G1(a),this.Labels=new T1(a),this.Text3D=new t3(a),this.Exporter=new P1(a),this.Paths=new V1(a),this.Navigation=new x1(this.core,this,a.currentMapGetter),this.BlueDot=new Dh(this.core,this),this.BlueDot.on("position-update",c=>{this.mapView.publish("blue-dot-position-update",c)}),this.BlueDot.on("state-change",c=>{this.mapView.publish("blue-dot-state-change",c)}),this.BlueDot.on("error",c=>{this.mapView.publish("blue-dot-error",c)}),this.BlueDot.on("follow-change",c=>{this.mapView.publish("blue-dot-follow-change",c)}),this.Outdoor=new Fh(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{this.mapView.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{this.mapView.publish("outdoor-style-loaded")})),this.Images=new $1(a),this.Shapes=new K1(a),this.Style=new Q1(a);let l=new qS(r,this.mapDataExternal);this.auto=l.auto}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,r){if(t==="interior-walls"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Or);if(i){let a=i.layers.get(oc);a&&this.core.setState(a,g9(r,this.core.getState(a)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Or);if(i){let a=i.layers.get(_s);a&&this.core.setState(a,g9(r,this.core.getState(a)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Or);if(i){let a=i.layers.get(Kd);a&&this.core.setState(a,n3(r,this.core.getState(a)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Or);if(i){let a=i.layers.get(Jd);a&&this.core.setState(a,n3(r,this.core.getState(a)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(eu.is(n))return this.core.setState(n.id,aee({...r,type:"label"},this.core.getState(n.id)));if(Al.is(n))return this.core.setState(n.id,lee({...r,type:"marker"},this.core.getState(n.id)));if((Ur.is(n)||lo.is(n))&&this.core.setState(n.id,cee({...r,type:"geometry"},this.core.getState(n.id))),Fi.is(n)&&this.core.setState(n.id,n3({...r,type:"doors"},this.core.getState(n.id))),ru.is(n)&&this.core.setState(n.id,Eo(r,["altitude","color","opacity"])),ud.is(n)){let{position:o,scale:i,...a}=r,l=a;o&&(l.position=[o.longitude,o.latitude,o.verticalOffset]),i!=null&&(Array.isArray(i)?l.scale=i:l.scale=[i,i,i]),o&&n.updateTarget(o),this.core.setState(n.id,l)}if(ao.is(n)){let o=this.currentMap.floorsById.get(n.id);if(o==null)return;this.core.setState(n.id,Eo(r,["visible","altitude"]));let i=o.layers.get(Or);i!=null&&"geometry"in r&&this.core.setState(i.containerId,Eo(r.geometry,["opacity","visible"]));let a=o.layers.get(Ba);a!=null&&"labels"in r&&"enabled"in r.labels&&typeof r.labels.enabled=="boolean"&&a.setVisible(r.labels.enabled);let l=o.layers.get(As);l!=null&&"markers"in r&&"enabled"in r.markers&&typeof r.markers.enabled=="boolean"&&l.setVisible(r.markers.enabled);let c=o.layers.get(dy);c!=null&&"footprint"in r&&this.core.setState(c.containerId,Eo(r.footprint,["visible","height","opacity","side","color","altitude"]));let p=o.layers.get(Qd);p!=null&&"occlusion"in r&&"enabled"in r.occlusion&&typeof r.occlusion.enabled=="boolean"&&p.setVisible(r.occlusion.enabled)}if(Ko.is(n)){let o=this.core.getState(n.id);for(let i of o.children)i.type==="group-container"&&this.core.setState(i.id,Eo(r,["opacity","visible"]))}if(nu.is(n)&&this.core.setState(n.id,Eo(r,WI)),as.is(n))for(let o of n.segments)this.core.setState(o.id,Eo(r,["color","nearRadius","farRadius","visible","completeFraction"]));Ih.is(n)&&this.core.setState(n.id,Eo(r,["color"]))}}getMapDataObject(t){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Ng(this.mapData)}getMapData(){return this.mapData}addMap(t,r){return new Promise(n=>{var m,y,v,x;let o;try{o=Ng(t)}catch(S){j.error("Error adding map",S),n(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:i}=o,a=i["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new Le(a[1],a[0])});let l=i["manifest.geojson"].features[0].properties.name,c=new R1("mapObject-".concat(l),o,r,this),p=this.core.getBoundingArea(c.currentFloor.id);p==null&&j.error("Could not determine bounding box for map:",c.currentFloor.id);let f=(y=(m=r==null?void 0:r.outdoorView)==null?void 0:m.layersHiddenByGeometry)!=null?y:[];if(f.length>0){let S,I=[];for(let P of c.floorStacksById.values())if(P.defaultFloor.footprint&&P.defaultFloor.footprint.geometry!=null&&((v=P.defaultFloor.footprint.geometry)==null?void 0:v.coordinates.length)>0){let T=P.defaultFloor.footprint,M=YS(T);S==null?S=M:pee(S,M),I.push(T)}I.length>0&&S!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(S,I,f),this.hiddenOutdoorGeometries.push([S,I,f]))}if(this.mapObjects.push(c),o.getMVFFeatureByType("floor").forEach(S=>{this.mapsByFloorId[S.id]=c}),c.on("navigation-connection-click",S=>{this.mapView.publish("navigation-connection-click",S)}),c.on("navigation-active-path-change",S=>{this.mapView.publish("navigation-active-path-change",S)}),c.StackedMaps.on("stacked-maps-state-change",({state:S})=>{this.mapView.publish("stacked-maps-state-change",{state:S})}),c.on("floor-change-start",S=>{var I,P,T,M;this.mapView.publish("floor-change-start",{reason:S.reason,floor:(P=(I=this.getMapDataInternal())==null?void 0:I.getById("floor",S.floorId))!=null?P:this.currentFloor,previousFloor:(M=(T=this.getMapDataInternal())==null?void 0:T.getById("floor",S.previousFloorId))!=null?M:this.currentFloor})}),c.on("floor-change",S=>{var I,P;this.mapView.publish("floor-change",{reason:S.reason,floor:this.currentFloor,previousFloor:(P=(I=this.getMapDataInternal())==null?void 0:I.getById("floor",S.previousFloorId))!=null?P:this.currentFloor})}),this.currentMap=c,this.mapData=t,(r==null?void 0:r.zoomLevel)!=null)this.core.camera.setZoomLevel(r.zoomLevel),n(t);else if(this.core.mode!=="outdoors-overlay"&&p){let S=(x=r==null?void 0:r.screenOffsets)!=null?x:{top:r3*this.core.canvasHeight,left:r3*this.core.canvasWidth,right:r3*this.core.canvasWidth,bottom:r3*this.core.canvasHeight};this.core.camera.focusOn(p,{duration:J8,padding:S}).then(()=>{n(t)})}else n(t)})}setFloor(t,r){return this.currentMap.setFloor(iy(t),r)}setFloorStack(t,r){return this.currentMap.setFloorStack(iy(t),r)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var n;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Bn("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",t);if(!r)throw new Bn("FloorStack was not found in map data.");return r}get currentFloor(){var n;let t=this.currentMap.currentFloor.id;if(!t)throw new Bn("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!r)throw new Bn("Missing currentFloor");return r}getState(t){var o,i,a,l,c,p,f,m,y,v,x,S,I,P,T,M,w,E,B,D;typeof t=="object"&&as.is(t)&&j.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=uee(t,this),n=this.core.getState(r);if(n)if(["interior-walls","exterior-walls"].includes(t)){let{color:F,topColor:L,texture:H,topTexture:U,visible:G,height:J,opacity:X}=n;return{type:"walls",visible:G,color:F,topColor:L,texture:H?{url:H}:void 0,topTexture:U?{url:U}:void 0,height:J,opacity:X}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:F,topColor:L,texture:H,topTexture:U,visible:G,opacity:J}=n;return{type:"doors",visible:G,color:F,topColor:L,opacity:J,texture:H?{url:H}:void 0,topTexture:U?{url:U}:void 0}}else{if(n.type==="geometry")return{type:"geometry",interactive:n.interactive,hoverColor:n.hoverColor,color:n.color,visible:n.visible,opacity:n.opacity,height:n.height,texture:n.texture?{url:n.texture}:void 0,topTexture:n.topTexture?{url:n.topTexture}:void 0,flipImageToFaceCamera:n.flipImageToFaceCamera,topColor:n.topColor};if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return{type:"label",text:n.text,appearance:n.options.appearance,rank:n.options.rank,enabled:n.enabled,interactive:n.options.interactive};if(n.type==="marker"&&((o=n.options)==null?void 0:o.rank)!==void 0&&n.options.interactive!==void 0){let F=typeof n.parent=="object"?n.parent.id:n.parent,L=this.Markers.getById(n.id.toString()),H=L!=null&&L.marker.target?L==null?void 0:L.marker.target.anchorTarget:void 0;return H==null&&(H=new Le(n.position[1],n.position[0],F.toString())),{type:"marker",rank:n.options.rank,interactive:n.options.interactive,enabled:n.enabled,element:n.element,anchor:n.anchor,zIndex:n.options.zIndex,dynamicResize:n.dynamicResize,lowPriorityPin:n.options.lowPriorityPin}}else if(n.type==="model"){let F=n!=null&&typeof n.parent=="object"?n.parent.id.toString():(i=n.parent)==null?void 0:i.toString();return delete n.parent,{...n,position:new Le({latitude:n.position[1],longitude:n.position[0],verticalOffset:n.position[2],floorId:F}),type:"model"}}else{if(n.type==="image")return{type:"image"};if(n.type==="text3d")return n;if(n.type==="geometry-group"&&t&&typeof t!="string"&&ru.is(t)){let[F]=n.children;if(F.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(a=n.altitude)!=null?a:0,visible:n.visible,color:n.color,height:F.height,opacity:n.opacity}}else{if(n.type==="path")return{type:"path",color:n.color,visible:n.visible,nearRadius:n.nearRadius,farRadius:n.farRadius,completeFraction:n.completeFraction};if(n.type==="group-container"&&typeof t!="string"&&ao.is(t)){let F=(l=this.currentMap.floorsById.get(t.id))==null?void 0:l.layers.get(Or),L=F?this.core.getState(F.containerId):void 0,H=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(Ba),U=(p=this.currentMap.floorsById.get(t.id))==null?void 0:p.layers.get(As),G=(f=this.currentMap.floorsById.get(t.id))==null?void 0:f.layers.get(dy),J=G?this.core.getState(G.containerId):void 0,X=(m=this.currentMap.floorsById.get(t.id))==null?void 0:m.layers.get(Qd),ie=X?this.core.getState(X.containerId):void 0;return{type:"floor",geometry:{opacity:(y=L==null?void 0:L.opacity)!=null?y:0,visible:(v=L==null?void 0:L.visible)!=null?v:!0},labels:{enabled:(x=H==null?void 0:H.visible)!=null?x:!1},markers:{enabled:(S=U==null?void 0:U.visible)!=null?S:!1},footprint:{altitude:(I=J==null?void 0:J.altitude)!=null?I:0,visible:(P=J==null?void 0:J.visible)!=null?P:!1,height:(T=J==null?void 0:J.height)!=null?T:0,opacity:(M=J==null?void 0:J.opacity)!=null?M:0,side:(w=J==null?void 0:J.side)!=null?w:"double",color:(E=J==null?void 0:J.color)!=null?E:"white"},occlusion:{enabled:(B=ie==null?void 0:ie.visible)!=null?B:!1},visible:n.visible,altitude:(D=n.altitude)!=null?D:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Ko.is(t)){let F=this.core.getState(n.children[0].id);return{type:"facade",opacity:F.opacity,visible:F.visible}}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,r,n){var c;if(n!=null){let p=this.core.projectScreenXYToCoordinate(t,r,!0);return p?new Le(p.coordinate[1],p.coordinate[0],n.id):void 0}let o=this.core.projectScreenXYToCoordinate(t,r);if(o==null||o.coordinate==null)return;let{coordinate:i,groupContainers:a}=o,l=(c=a==null?void 0:a.find(p=>{let f=p.userData.entityId.toString();return f.includes("f_")||f.includes("m_")}))==null?void 0:c.userData.entityId.toString();return new Le(i[1],i[0],l)}getScreenCoordinateFromCoordinate(t){return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){return{labels:this.Labels.all()}}tween(t){let r=new Co(t);return this.core.getTweenGroup().add(r),this.core.render(),r}removeTween(t){this.core.getTweenGroup().remove(t)}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};s(b9,"GeoJsonApi");var n0=b9;function dee(e){N8("".concat(e,"/maplibre-worker.csp.js")),BO("".concat(e,"/collision-worker.csp.js"))}s(dee,"setWorkersUrl");d();d();var v9=class v9{constructor(t){h(this,"state");h(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};s(v9,"Debug");var i3=v9;d();var fee=$.object({environment:$.union([$.literal("basic"),$.literal(!1)]).optional(),text3d:$.object({hoverColor:$.string().optional()}).optional(),geometry:$.object({hoverColor:$.string().optional()}).optional(),backgroundColor:$.string().optional(),backgroundAlpha:$.number().optional()}).strict();d();var s3=ys(_7(),1);var mee=s(e=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(r=>e.startsWith(r)))return!0;let t=console.warn;return console.warn=()=>{},e==="white"||x9(e).some(r=>r<1)?!0:(console.warn=t,!1)},"isProbablyColor"),x9=s(e=>{let t=new Lt(e);return[t.r,t.g,t.b]},"stringToRgbArray"),o5e=s(e=>{let t=new Lt;return t.setRGB(e[0],e[1],e[2],wa),"#"+t.getHexString()},"rgbArrayToString"),hee=s((e,t)=>{let r=(0,s3.default)({},e),n=(0,s3.default)({},e,t),o=s((i,a,l)=>{for(let c in a){let p=i[c],f=a[c];if(typeof f=="number"&&typeof p=="number")i[c]=p+(f-p)*l;else if(typeof f=="string"&&typeof p=="string"){if(mee(p)&&mee(f)){let m=x9(p),y=x9(f);m&&y?i[c]=o5e([m[0]+(y[0]-m[0])*l,m[1]+(y[1]-m[1])*l,m[2]+(y[2]-m[2])*l]):j.warn('Color "'.concat(c,'" could not be animated!'))}}else typeof f=="object"&&f!==null&&typeof p=="object"&&p!==null?o(p,f,l):j.warn('Value "'.concat(c,'" could not be animated!'))}},"interpolate");return i=>{if(i=Math.min(Math.max(i,0),1),i===0)return e;if(i===1)return n;let a=(0,s3.default)({},r);return o(a,t,i),a}},"animationFactory");var o0,Ie,ql,I9=class I9 extends Fe{constructor(r){super();O(this,o0,{});O(this,Ie);O(this,ql);h(this,"Camera");h(this,"Labels");h(this,"Text3D");h(this,"Markers");h(this,"Images");h(this,"Models");h(this,"Paths");h(this,"Exporter");h(this,"Navigation");h(this,"BlueDot");h(this,"Style");h(this,"Shapes");h(this,"Outdoor");h(this,"update",s(()=>{u(this,Ie).core.render()},"update"));h(this,"getDirections",s((r,n,o)=>{var i;return(i=u(this,Ie).getMapData())==null?void 0:i.getDirections(r,n,o)},"getDirections"));h(this,"getDirectionsMultiDestination",s((r,n,o)=>{var i;return(i=u(this,Ie).getMapData())==null?void 0:i.getDirectionsMultiDestination(r,n,o)},"getDirectionsMultiDestination"));h(this,"on",s((r,n)=>{super.on(r,n)},"on"));h(this,"off",s((r,n)=>{super.off(r,n)},"off"));h(this,"Debug");A(this,ql,r);let n=new n0(r,this);A(this,Ie,n),this.Camera=u(this,Ie).Camera,A(this,o0,u(this,Ie).mapDataExternal),this.Markers=u(this,Ie).Markers,this.Models=u(this,Ie).Models,this.Labels=u(this,Ie).Labels,this.Text3D=u(this,Ie).Text3D,this.Exporter=u(this,Ie).Exporter,this.Paths=u(this,Ie).Paths,this.Navigation=u(this,Ie).Navigation,this.BlueDot=u(this,Ie).BlueDot,this.Shapes=u(this,Ie).Shapes,this.Style=u(this,Ie).Style,this.auto=u(this,Ie).auto,this.Outdoor=u(this,Ie).Outdoor,this.Images=u(this,Ie).Images,u(this,ql).container.dataset.version=b.env.npm_package_version,this.Debug=new i3(u(this,Ie).core)}get StackedMaps(){return u(this,Ie).currentMap.StackedMaps}updateState(r,n){return u(this,Ie).updateState(r,n)}animateState(r,n,o){var p;let i=u(this,Ie).getState(r);if(i==null)return j.warn("Cannot animate state of ".concat(r,".")),new Promise(m=>m());let a=hee(i,n),l=u(this,Ie).tween({percent:0}).to({percent:1},(p=o==null?void 0:o.duration)!=null?p:1e3).onUpdate(({percent:f})=>{u(this,Ie).updateState(r,a(f))});o!=null&&o.easing&&o.easing in Ol&&l.easing(Ol[o.easing]);let c=new Promise(f=>{l.onComplete(()=>{u(this,Ie).removeTween(l),f()}).onStop(()=>{u(this,Ie).removeTween(l),f()}),l.start()});return c.cancel=()=>{l.stop(),u(this,Ie).updateState(r,a(0))},c}updateGlobalState(r){var n,o,i,a;try{fee.parse(r)}catch(l){j.error("updateGlobalState",l);return}if(typeof r=="object"){let l={};if((n=r.text3d)!=null&&n.hoverColor&&(l.text3dHoverColor=r.text3d.hoverColor),(o=r.geometry)!=null&&o.hoverColor&&(l.hoverColor=r.geometry.hoverColor),r.backgroundColor||r.backgroundAlpha!==void 0){let c=(i=r.backgroundColor)!=null?i:u(this,Ie).core.backgroundColor,p=(a=r.backgroundAlpha)!=null?a:u(this,Ie).core.backgroundAlpha;u(this,Ie).core.setBackgroundColor(c,p)}r.environment!=null&&u(this,Ie).core.setEnvironment(r.environment),u(this,Ie).core.setState(l)}}getGlobalState(){let r=u(this,Ie).core.getState();return{backgroundColor:u(this,Ie).core.backgroundColor,backgroundAlpha:u(this,Ie).core.backgroundAlpha,environment:u(this,Ie).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){return u(this,o0)}getDimensions(){return{width:u(this,ql).canvasWidth,height:u(this,ql).canvasHeight}}expand(r){var n;return(n=u(this,Ie).currentMap)==null?void 0:n.StackedMaps.expand(r)}collapse(r){var n;return(n=u(this,Ie).currentMap)==null?void 0:n.StackedMaps.collapse(r)}addMap(r,n){return u(this,Ie).addMap(r,n)}setFloor(r,n){return u(this,Ie).setFloor(r,n==null?void 0:n.context)}setFloorStack(r,n){return u(this,Ie).setFloorStack(r,n==null?void 0:n.context)}tween(r){return u(this,Ie).tween(r)}removeTween(r){u(this,Ie).removeTween(r)}get currentFloorStack(){return u(this,Ie).currentFloorStack}get currentFloor(){return u(this,Ie).currentFloor}updateWatermark(r){u(this,Ie).updateWatermark(r)}getState(r){return u(this,Ie).getState(r)}setHoverColor(r){u(this,Ie).setHoverColor(r)}getHoverColor(){return u(this,Ie).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return u(this,Ie).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return u(this,Ie).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return u(this,Ie).isInView(r)}getDistance(r,n){var o;return(o=u(this,Ie).getMapData())==null?void 0:o.getDistance(r,n)}createCoordinate(r,n,o){return typeof r=="object"?new Le(r):new Le(r,n,o==null?void 0:o.id)}createCoordinateFromScreenCoordinate(r,n,o){return u(this,Ie).createCoordinateFromScreenCoordinate(r,n,o)}getScreenCoordinateFromCoordinate(r){return u(this,Ie).getScreenCoordinateFromCoordinate(r)}auto(){return{labels:this.Labels.all()}}get __core(){if(b.env.INTERNAL==="true")return u(this,Ie).core;throw new Error("__core is not available.")}clear(){u(this,Ie).clear()}destroy(){u(this,Ie).destroy()}async enableDebug(r={}){let{Inspector:n}=await import("./inspector-KUSKAK43.js");await new n(this,u(this,Ie)).enable(r)}async takeScreenshot(){return await u(this,ql).renderSync(),u(this,ql).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return u(this,Ie).manualFloorVisibility}set manualFloorVisibility(r){u(this,Ie).manualFloorVisibility=r}};o0=new WeakMap,Ie=new WeakMap,ql=new WeakMap,s(I9,"MapView");var Lh=I9;d();d();var S9=class S9 extends Fe{constructor(r){super();h(this,"gl");h(this,"el",document.createElement("div"));h(this,"core");h(this,"origin");h(this,"map");h(this,"layer");h(this,"handleStyleChange",s(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));h(this,"handleMove",s(()=>{if(!this.map)return;let[r,n]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(r,n),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(Ke.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(Ke.degToRad(this.map.getPitch()))},"handleMove"));h(this,"handleError",s(r=>{j.warn(r)},"handleError"));this.origin=r}onAdd(r){this.origin=this.origin||r.getCenter().toArray(),this.gl=r.painter.context.gl,this.core=new d1(r._container,{center:this.origin,zoomLevel:r.getZoom(),pitch:r.getPitch(),bearing:r.getBearing(),gl:this.gl,map:r,mode:"outdoors-overlay"}),this.map=r,this.core.camera.setMinZoomLevel(r.getMinZoom()),this.core.camera.setMaxZoomLevel(r.getMaxZoom()),this.core.camera.setMinPitch(r.getMinPitch()),this.core.camera.setMaxPitch(r.getMaxPitch()),this.map.on("error",this.handleError);let n=L8.fromLngLat(this.origin,0);return this.layer=E0(n,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};s(S9,"MapLibreOverlay");var a3=S9;var Cd,Rh,du,Pd,i0=class i0 extends Fe{constructor(r,n,o){super();O(this,Cd);O(this,Rh);O(this,du);O(this,Pd);h(this,"on",s((r,n)=>{super.on(r,n)},"on"));h(this,"off",s((r,n)=>{super.off(r,n)},"off"));A(this,Pd,new a3(r)),A(this,Cd,n),A(this,Rh,o)}onAdd(r){var i,a;let n=u(this,Pd).onAdd(r),o={..._u,...(i=u(this,Rh))!=null?i:{},outdoorView:{token:u(this,Cd).outdoorViewToken,...(a=u(this,Rh))==null?void 0:a.outdoorView}};return A(this,du,new Lh(u(this,Pd).core)),u(this,du).addMap(u(this,Cd),o).then(()=>{this.publish("loaded",{mapView:u(this,du),mapData:u(this,Cd)})}),n}onRemove(){u(this,du)&&u(this,du).clear(),i0.instance=null,u(this,Pd).onRemove()}};Cd=new WeakMap,Rh=new WeakMap,du=new WeakMap,Pd=new WeakMap,s(i0,"MappedinMapLibreOverlay"),h(i0,"instance");var Nh=i0;d();var i5e=1e3*60*60*2,fu,$h,tr,fs,ms,Pi,hs,jh,Gh,a0,ur,yee,gee,Bh,l3,C9,P9,T9,w9=class w9{constructor(t,r){O(this,ur);O(this,fu,new Fe);O(this,$h);O(this,tr);O(this,fs);O(this,ms);O(this,Pi);O(this,hs);O(this,jh);O(this,Gh);O(this,a0,s(()=>{"key"in u(this,tr)&&"secret"in u(this,tr)&&te(this,ur,Bh).call(this),te(this,ur,l3).call(this)},"#handleWindowFocus"));h(this,"on",s((t,r)=>u(this,fu).on(t,r),"on"));h(this,"off",s((t,r)=>u(this,fu).off(t,r),"off"));A(this,$h,t),A(this,tr,r)}setMapIds(t){A(this,$h,t)}setEnterprise(t){u(this,tr).enterprise=t}async readySync(){if((!("key"in u(this,tr))||!("secret"in u(this,tr)))&&!("accessToken"in u(this,tr))){j.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[te(this,ur,Bh).call(this),null];u(this,tr).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);te(this,ur,T9).call(this),te(this,ur,C9).call(this,r),n!=null&&te(this,ur,P9).call(this,n),window!=null&&typeof window.addEventListener=="function"&&window.addEventListener("focus",u(this,a0))}async refreshing(){let t=[];return u(this,fs)!=null&&t.push(u(this,fs)),u(this,ms)!=null&&t.push(u(this,ms)),Promise.all(t)}getAccessTokenAsync(){return te(this,ur,Bh).call(this)}getSasTokensAsync(){return te(this,ur,l3).call(this)}getAccessToken(){return u(this,Pi)==null?(j.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):u(this,Pi)}getSasToken(t){return this.isEnterpriseMode()?(j.error("SAS tokens are not available in the enterprise mode!"),{token:""}):u(this,hs)==null?(j.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in u(this,hs).tokens?u(this,hs).tokens[t]:(j.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=u(this,tr).enterprise)!=null?t:!1}destroy(){te(this,ur,T9).call(this),u(this,fu).destroy(),window!=null&&typeof window.removeEventListener=="function"&&window.removeEventListener("focus",u(this,a0))}};fu=new WeakMap,$h=new WeakMap,tr=new WeakMap,fs=new WeakMap,ms=new WeakMap,Pi=new WeakMap,hs=new WeakMap,jh=new WeakMap,Gh=new WeakMap,a0=new WeakMap,ur=new WeakSet,yee=s(function(t){var n;let r=t.token!==((n=u(this,Pi))==null?void 0:n.token);A(this,Pi,t),r&&u(this,fu).publish("access-token-refreshed",{accessToken:t})},"#setAccessToken"),gee=s(function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=u(this,hs))==null?void 0:n.tokens);A(this,hs,t),r&&u(this,fu).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},"#setSasTokens"),Bh=s(async function(t=!1){var r;if("accessToken"in u(this,tr)&&typeof u(this,tr).accessToken=="string"){let n={token:u(this,tr).accessToken,expires:Date.now()+72e5};return A(this,Pi,n),n}if(!("key"in u(this,tr))||!("secret"in u(this,tr))||typeof u(this,tr).key!="string"||typeof u(this,tr).secret!="string")throw new Error("No API keys or access token provided!");return u(this,fs)!=null?u(this,fs):u(this,Pi)!=null&&u(this,Pi).expires!=null&&u(this,Pi).expires>Date.now()&&!t?u(this,Pi):(A(this,fs,Ag({...u(this,tr),key:u(this,tr).key,secret:u(this,tr).secret},(r=u(this,tr).enterprise)!=null?r:!1).then(n=>{let o={token:n.accessToken,expires:n.expiresTimestamp*1e3};return te(this,ur,yee).call(this,o),o})),u(this,fs).finally(()=>{A(this,fs,void 0)}),u(this,fs))},"#refreshAccessToken"),l3=s(async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:u(this,ms)!=null?u(this,ms):u(this,hs)!=null&&u(this,hs).expires>Date.now()&&!t?u(this,hs):(A(this,ms,new Promise((r,n)=>{te(this,ur,Bh).call(this).then(o=>{let i={},a=u(this,$h).map(l=>M4({...u(this,tr),mapId:l},o.token).then(c=>{i[l]={token:c.token,expires:c.expires}}).catch(c=>{j.error("Error getting SAS token for map ".concat(l,":"),c)}));Promise.all(a).then(()=>{let l={tokens:i,expires:Math.min(...Object.values(i).map(c=>{var p;return(p=c.expires)!=null?p:1/0}))};te(this,ur,gee).call(this,l),r(l)})}).catch(o=>{n(o)})})),u(this,ms).catch(r=>{throw r}).finally(()=>{A(this,ms,void 0)}),u(this,ms))},"#refreshSasTokens"),C9=s(function(t){if(!("key"in u(this,tr))||!("secret"in u(this,tr)))return;let r=t.expires!=null?t.expires-Date.now():i5e;isFinite(r)&&A(this,jh,setTimeout(()=>{te(this,ur,Bh).call(this,!0).then(n=>{te(this,ur,C9).call(this,n)})},r-Pz))},"#setAccessTokenRefresh"),P9=s(function(t){let r=t.expires-Date.now();isFinite(r)&&A(this,Gh,setTimeout(()=>{te(this,ur,l3).call(this,!0).then(n=>{te(this,ur,P9).call(this,n)})},r-Mz))},"#setSasTokensRefresh"),T9=s(function(){u(this,jh)!=null&&clearTimeout(u(this,jh)),u(this,Gh)!=null&&clearTimeout(u(this,Gh))},"#stopRefreshing"),s(w9,"TokenManager");var s0=w9;d();var bee=s((e,{id:t}={})=>{let r=Array.isArray(e)?e:[e];if(!r.every(i=>typeof i=="string"))return;let n=r.join(""),o=null;if(t){let i=document.getElementById(t);i instanceof HTMLStyleElement&&(o=i)}o==null&&(o=document.createElement("style")),t&&t!==""&&(o.id=t),o.textContent=n,document.head.appendChild(o)},"injectCSS");var vee=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var xee='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n transition: transform 300ms linear;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n';var Iee=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var See=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var Cee=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var Pee='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';var d5e=[vee,xee,Iee,See,Cee,Pee],Tee;function f5e(e){Tee=e}s(f5e,"__setWatermarkOnClickFn");var m5e=s(async(e,t)=>{let r,n=gp();t&&n.updateByUserOption(t);try{t&&(r=(await Ag({...t,baseAuthUri:n.getBaseAuthUri()})).accessToken)}catch(a){j.warn("Getting access token failed. Outdoor map disabled.",a)}let o=new Uh(e,{outdoorViewToken:r,languagePacks:t==null?void 0:t.languagePacks,env:n});return new a2(o)},"hydrateMapDataFromMVF"),wee=!1;function h5e(e){wee=e}s(h5e,"setUseEnterpriseAPI");var y5e=s(async(e,t)=>{var v,x,S,I,P,T,M;let r=(S="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?S:"options"in e&&"version"in((v=e.options)!=null?v:{})?(x=e.options)==null?void 0:x.version:void 0,n={...t||{},mvfVersion:r},o,i=gp();i.updateByUserOption(n);let a={};if("type"in e&&typeof e.type=="string"){if(a.enterprise=(I=e.options)==null?void 0:I.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){o=await D4(e.main,n.mvfVersion),a.languagePacks=[];for(let w of(P=e.languagePacks)!=null?P:[])w.localePack instanceof Uint8Array&&a.languagePacks.push({language:w.language,localePack:await hm(w.localePack)})}else if(e.type==="json")o=e.main,a.languagePacks=(T=e.languagePacks)!=null?T:[];else throw new Error("Invalid backup type");e.type==="binary"&&e.main instanceof Uint8Array&&(a.binaryBundle=e.main)}else o=e,a.enterprise=o.enterprise!=null;let l=k4(o),c=l.length>0?l:[n.mapId],p=new s0(c,{...n,enterprise:a.enterprise}),f;if("accessToken"in n)f=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=i.getBaseAuthUri(a.enterprise);let w=await p.getAccessTokenAsync();f=(w==null?void 0:w.token)||""}a.outdoorViewToken=f,a.env=i,a.getMapDataOptions=n;try{await p.readySync()}catch(w){j.error("Failed to ready token manager!",w)}let m=new Uh(o,a);f&&m.Analytics.init({accessToken:f,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,...n.analytics,baseUri:i.getAnalyticsBaseUri(),context:(M=n.analytics)==null?void 0:M.context});let y=new a2(m);if("language"in n)try{await y.changeLanguage(n.language)}catch{}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(o),y},"hydrateMapData"),Mee=s(async e=>{var S;let t=wee,r,n=gp();n.updateByUserOption(e);let o={...e},i=new s0([o.mapId],o);if("accessToken"in o){r=o.accessToken;let{aud:I,sub:P}=S0(r);(e_.some(T=>I.includes(T))||P&&P.startsWith("client"))&&(t=!0,i.setEnterprise(t))}else if("key"in o&&"secret"in o)o.key.startsWith("mik_")||(t=!0,i.setEnterprise(t)),o.baseAuthUri=n.getBaseAuthUri(t),r=(await i.getAccessTokenAsync()).token;else throw new Error("Missing key or secret.");o.layoutId!=null&&(t?o.layoutId!=="draft"&&j.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):j.warn("layoutId is currently unsupported!")),o.baseUri=n.getBaseUri(t);let a=performance.now(),l,c;if(t){let I={...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"},P=await _4(I);l=P.compressed,c=P.localePacks}else l=await A4(o,r);let p=performance.now(),f=await D4(l,o.mvfVersion),m=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(f);let y=k4(f);y.length>0?i.setMapIds(y):i.setMapIds([o.mapId]);try{await i.readySync()}catch(I){j.error("Failed to ready token manager!",I)}let v=new Uh(f,{env:n,outdoorViewToken:r,tokenManager:i,enterprise:t,localePacksUrls:c,binaryBundle:l,getMapDataOptions:o}),x=new a2(v,{search:e.search});if(v.Analytics.init({accessToken:r,mapId:o.mapId,key:"key"in o?o.key:void 0,secret:"secret"in o?o.secret:void 0,...o.analytics,baseUri:n.getAnalyticsBaseUri(),context:(S=o.analytics)==null?void 0:S.context}),v.Analytics.sendGetMapDataEvent({parseDuration:m-p,downloadDuration:p-a,viewId:o.viewId}),"language"in o)try{await x.changeLanguage(o.language)}catch{}return x},"getMapData"),g5e=Mee,b5e=s((e,t)=>{Nh.instance!=null&&j.warn("Only a single map venue is supported at this time.");let r=new Nh([e.mapCenter.longitude,e.mapCenter.latitude],e,t);return Nh.instance=r,r},"createMapLibreOverlay"),Oee=s(async(e,t,r)=>{var p,f,m,y,v,x,S,I,P,T,M,w,E;let n=performance.now(),o=z3(r,t);o&&V3(o),((p=o.injectStyles)==null||p)&&bee(d5e,{id:"mappedin__styles"});let i=r_((f=t.outdoorViewToken)!=null?f:""),a=Ng(t);(m=o.outdoorView)!=null&&m.style&&a.envControl.updateTileServerBaseUrl((y=o.outdoorView)==null?void 0:y.style);let l=await CQ(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(v=o.style)==null?void 0:v.backgroundAlpha,backgroundColor:(x=o.style)==null?void 0:x.backgroundColor,outdoorView:(S=o.outdoorView)!=null&&S.token?{headers:{"x-mappedin-tiles-key":(I=o.outdoorView)==null?void 0:I.token},style:t.getEnv().tileServerUri,enabled:!!((P=o.outdoorView)!=null&&P.enabled),lowDpi:(T=o.outdoorView)==null?void 0:T.lowDpi}:void 0,watermark:{...o.watermark,visible:((M=o.watermark)==null?void 0:M.visible)||!a.enterpriseMode&&!i.remove_watermark,onClick:Tee||void 0},attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((w=o.antialiasing)!=null&&w.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(E=o.occlusion)==null?void 0:E.enabled,transformImageRequest:a.enterpriseMode?void 0:a.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:o.imagePlacementOptions,onWebGLContextCreationError:o.onWebGLContextCreationError,onWebGLContextLost:o.onWebGLContextLost,onWebGLContextRestored:o.onWebGLContextRestored,onWebGLRendererError:o.onWebGLRendererError}),c=new Lh(l);return await c.addMap(t,o),a.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:c.getDimensions()}),c},"show3dMap"),v5e=Oee;function Ci(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}s(Ci,"convertCoordinateToPosition");function I5e(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}s(I5e,"getEntranceMap");var V6=s((e,t)=>{let r=I5e(t),n={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:e[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let o of e){let i=[o.geometry.coordinates],a=(o.properties.entrances||[]).reduce((l,c)=>(r.has(c)&&l.push(r.get(c)),l),[]);if(a.length){let{entrances:l,obstructions:c}=DO(o,a);i=c.map(p=>p.geometry.coordinates),n.entrances.features.push(...l)}n.walls.geometry.coordinates.push(...i)}return n},"cutEntrancesFromLineStrings");function aee(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.text&&(r.text=e.text),e.appearance&&(r.options.appearance=e.appearance),e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!==void 0&&(r.enabled=e.enabled),e.interactive!==null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),r}s(aee,"translateLabelStateToGeojsonCore");function lee(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!=null&&(r.enabled=e.enabled),e.interactive!=null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),r}s(lee,"translateMarkerStateToGeojsonCore");function n3(e,t){var n,o;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((o=e.topTexture)==null?void 0:o.url)!==void 0&&(r.topTexture=e.topTexture.url),e.opacity!==void 0&&(r.opacity=e.opacity)),r}s(n3,"translateDoorsStateToGeojsonCore");function g9(e,t){var n,o;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((o=e.topTexture)==null?void 0:o.url)!==void 0&&(r.topTexture=e.topTexture.url),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity)),r}s(g9,"translateWallsStateToGeojsonCore");function cee(e,t){var n,o;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((o=e.topTexture)==null?void 0:o.url)!==void 0&&(r.topTexture=e.topTexture.url),e.hoverColor!==void 0&&(r.hoverColor=e.hoverColor),e.interactive!==void 0&&(r.interactive=e.interactive),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity),e.flipImageToFaceCamera!==void 0&&(r.flipImageToFaceCamera=e.flipImageToFaceCamera)),r}s(cee,"translateSpaceStateToGeojsonCore");function Eee(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}s(Eee,"differenceBetweenAngles");function _ee(e,t){let r="Left";return e<=-Math.PI/4?r="Right":e<=-t?r="SlightRight":e<=t?r="Straight":e<=Math.PI/4?r="SlightLeft":r="Left",r}s(_ee,"getRelativeBearing");function zQ(e){let t={};for(let r in e){let n=e[r];if(n!=null){if(n.id=r,"polygons"in n)for(let o of n.polygons)t[o]=n;else if("lineStrings"in n)for(let o of n.lineStrings)t[o]=n;else if("points"in n)for(let o of n.points)t[o]=n}}return t}s(zQ,"extractStyleMap");function XS(e,t){return e.reduce((r,n)=>{let o=t[n.properties.id];if(o==null)return r;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let i={...o,id:o.id+"-textures"};r.set(i,[n])}else r.has(o)||r.set(o,[]),r.get(o).push(n);return r},new Map)}s(XS,"groupGeometryByStyle");function Oh(e,t={}){var o,i,a,l,c,p,f;let r={...e,flipImageToFaceCamera:(o=t==null?void 0:t.flipImagesToFaceCamera)!=null?o:!0},n=(a=(i=t==null?void 0:t.style)==null?void 0:i.shading)!=null?a:t==null?void 0:t.shadingAndOutlines;if(n===!0?r.shading={start:.1,end:.15,intensity:.4}:typeof n=="object"&&(r.shading={start:n.start,end:n.end,intensity:n.intensity}),r.outline=(c=(l=t==null?void 0:t.style)==null?void 0:l.outlines)!=null?c:t==null?void 0:t.shadingAndOutlines,"lineStrings"in e){let m=(f=(p=t==null?void 0:t.style)==null?void 0:p.wallTopColor)!=null?f:t==null?void 0:t.wallTopColor;m!=null&&(r.topColor=m)}return r}s(Oh,"translateToCoreStyle");var uee=s((e,t)=>{var o;let n=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(Or);switch(e){case"interior-walls":return n==null?void 0:n.layers.get(oc);case"exterior-walls":return n==null?void 0:n.layers.get(_s);case"interior-doors":return n==null?void 0:n.layers.get(Kd);case"exterior-doors":return n==null?void 0:n.layers.get(Jd);default:return typeof e=="string"?e:e.id}},"getTargetID");function t9(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}s(t9,"tweenToPromise");function YS(e){return e.bbox?e.bbox:Dd(e)}s(YS,"getBoundingBox");function pee(e,t){return[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[2]),Math.max(e[3],t[3])]}s(pee,"expandBbox");function Aee(e){return[...new Set(e)]}s(Aee,"unique");function r9(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}s(r9,"getTargetFloorObject");function Mh(e){if(Ur.is(e)||lo.is(e))return e.id}s(Mh,"getAttachableGeometryId");function HQ(e,t,r){var i,a,l,c,p,f;let n=e.coordinates.length===2,o=!0;if(n&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let m=t==null?void 0:t.getById("floor",e.coordinates[0].floorId),y=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);m&&y&&(o=((a=(i=r.getState(m))==null?void 0:i.visible)!=null?a:!0)&&((c=(l=r.getState(y))==null?void 0:l.visible)!=null?c:!0))}else{let m=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;o=m&&(f=(p=r.getState(m))==null?void 0:p.visible)!=null?f:!0}return o}s(HQ,"determineFloorVisibleBasedOnPath");var kee=Math.PI*.1,Fr,jn,oo,Td,wd,Zl,Md,zh,Ti,Dee,Vh,Fee,M9=class M9{constructor(t,r,n,o){O(this,Ti);O(this,Fr,{});O(this,jn);O(this,oo);O(this,Td);O(this,wd);O(this,Zl);O(this,Md);O(this,zh);A(this,jn,r),A(this,oo,t.features),A(this,Td,n),A(this,wd,o)}get path(){return u(this,oo).map(t=>u(this,jn).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(u(this,Fr).departure)return u(this,Fr).departure;let t=u(this,oo)[0].properties.id,r=u(this,Td)[0];if(u(this,Td).length>1){for(let n of u(this,Td))if(l0(n,u(this,jn)).includes(t)){r=n;break}}return u(this,Fr).departure=r,r}get destination(){if(u(this,Fr).destination)return u(this,Fr).destination;let t=u(this,oo)[u(this,oo).length-1].properties.id,r=u(this,wd)[0];if(u(this,wd).length>1){for(let n of u(this,wd))if(l0(n,u(this,jn)).includes(t)){r=n;break}}return u(this,Fr).destination=r,r}get coordinates(){return u(this,Fr).coordinates?u(this,Fr).coordinates:(u(this,Fr).coordinates=u(this,oo).map(t=>new Le(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),u(this,Fr).coordinates)}get distance(){return u(this,Fr).distance?u(this,Fr).distance:(u(this,Fr).distance=u(this,oo).reduce((t,r)=>t+(r.properties.distance||0),0),u(this,Fr).distance)}get instructions(){if(u(this,oo).length<2)return[];if(u(this,Fr).instructions)return u(this,Fr).instructions;let t=[],r=0;for(let n=0;n<u(this,oo).length;n++){let o=u(this,oo)[n],i=u(this,oo)[n-1],a=u(this,oo)[n+1],l=new Le(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),c=te(this,Ti,Dee).call(this,{prevDirection:i,direction:o,nextDirection:a});r+=(i==null?void 0:i.properties.distance)||0;for(let p of c)p&&(t.push({action:p,distance:r,coordinate:l,node:u(this,jn).getById("node",o.properties.id)}),r=0)}return u(this,Fr).instructions=t,u(this,Fr).instructions}};Fr=new WeakMap,jn=new WeakMap,oo=new WeakMap,Td=new WeakMap,wd=new WeakMap,Zl=new WeakMap,Md=new WeakMap,zh=new WeakMap,Ti=new WeakSet,Dee=s(function(t){var x,S;let{prevDirection:r,direction:n,nextDirection:o}=t,i=r&&u(this,jn).getById("floor",r.properties.groupBy),a=u(this,jn).getById("floor",n.properties.groupBy),l=o&&u(this,jn).getById("floor",o.properties.groupBy),c=[];r||c.push({type:"Departure"});let p=u(this,jn).getMVFFeatureByNodeId("connection",n.properties.id),f=p?u(this,jn).getById("connection",p.id):void 0,m=p&&p.nodes.length>1,y=u(this,jn).enterpriseMode&&(!n.properties.destination||!(p!=null&&p.nodes.includes(n.properties.destination))||!(p!=null&&p.nodes.includes(n.properties.id)));if(p&&!(!m||y))if(!u(this,Zl)||u(this,Zl)==="exit")c.push(te(this,Ti,Vh).call(this,"TakeConnection",a,l,f,p)),A(this,Zl,"take"),A(this,Md,f),A(this,zh,p);else{let I=u(this,jn).getMVFFeatureByNodeId("connection",(x=r==null?void 0:r.properties.id)!=null?x:""),P=u(this,jn).getById("connection",(S=I==null?void 0:I.id)!=null?S:"");c.push(te(this,Ti,Vh).call(this,"ExitConnection",a,i,P,I)),A(this,Zl,"exit"),A(this,Md,f),A(this,zh,p)}else u(this,Zl)==="take"?(c.push(te(this,Ti,Vh).call(this,"ExitConnection",a,i,u(this,Md),u(this,zh))),A(this,Zl,"exit"),A(this,Md,f)):l&&a.id!==l.id?c.push(te(this,Ti,Vh).call(this,"TakeConnection",a,l,f)):i&&i.id!==a.id?c.push(te(this,Ti,Vh).call(this,"ExitConnection",a,i,f)):c.push(te(this,Ti,Fee).call(this,r,n));return o||c.push({type:"Arrival"}),c},"#getActions"),Vh=s(function(t,r,n,o,i){var c,p;let a="none";if(r.elevation!=null&&(n==null?void 0:n.elevation)!=null){let f=r.elevation-n.elevation;f>0?a="down":f<0&&(a="up")}let l=(p=(c=o==null?void 0:o.type)!=null?c:i==null?void 0:i.type)!=null?p:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:a,connection:o,connectionType:l}},"#createConnectionAction"),Fee=s(function(t,r){let n=r.properties.edges;if(!n||n.filter(a=>a.destination.properties.id!==(t==null?void 0:t.properties.id)&&a.destination.properties.id!==r.properties.destination).length===0)return null;let i=t?-Eee(t.properties.angle,r.properties.angle):0;return Math.abs(i)>=kee?{type:"Turn",bearing:_ee(i,kee),referencePosition:"At"}:null},"#createTurnAction"),s(M9,"Directions");var o3=M9,O9=class O9{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:o,multiplicativeDistanceWeightScaling:i}){h(this,"navigator");h(this,"connections");h(this,"getDirections",s((t,r,n,o)=>{let{accessible:i,smoothing:{enabled:a,radius:l}}=n,c=t.flatMap(x=>l0(x,o)),p=r.flatMap(x=>l0(x,o)),f=this.getExcludedNodeIds(n.excludedConnections).filter(x=>!c.includes(x)&&!p.includes(x)),m=this.getDisabledConnectionNodeIds(i).filter(x=>!c.includes(x)&&!p.includes(x)),y=this.navigator.getDirections({zones:n.zones.map(x=>{var S;return{geometry:x.geometry,cost:x.cost,map:(S=x.floor)==null?void 0:S.id}}),originIds:c,destinationNodeIds:p,excludedNodeIds:f,disabledConnectionNodeIds:m,simplify:{enabled:a,bufferRadius:l},multiplicativeDistanceWeightScaling:!o.enterpriseMode});this.addCoordinateDirections(y,t,r);let v=new o3(y,o,t,r);if(!(v.distance===0&&new Set([...c,...p]).size===c.length+p.length))return v},"getDirections"));h(this,"getExcludedNodeIds",s(t=>{if(t.length===0)return[];let r=new Set(t.map(n=>n.id));return this.connections.reduce((n,o)=>r.has(o.id)?n.concat(o.nodes):n,[])},"getExcludedNodeIds"));h(this,"getDisabledConnectionNodeIds",s(t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]),"getDisabledConnectionNodeIds"));h(this,"addCoordinateDirections",s((t,[r],[n])=>{if(t.features.length){if(Le.is(r)){let o=this.createDirectionFeature(r,this.navigator.getAngle([r.longitude,r.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([r.longitude,r.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,o)}if(Le.is(n)){let o=this.createDirectionFeature(n,0,0),i=t.features[t.features.length-1];i.properties.distance=this.navigator.getDistance(i.geometry.coordinates,[n.longitude,n.latitude]),i.properties.angle=this.navigator.getAngle(i.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(o)}}},"addCoordinateDirections"));h(this,"createDirectionFeature",s((t,r,n)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:r,distance:n,edges:[]}}),"createDirectionFeature"));this.navigator=new gm({nodes:t,geojsonCollection:this.createCollection(r),groupBy:o,multiplicativeDistanceWeightScaling:i}),this.connections=n}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((r,[n,o])=>r.concat(o.features.map(i=>(i.properties.map=n,i))),[])}}};s(O9,"DirectionsInternal");var c3=O9;function l0(e,t){var r,n,o,i;if(Nu.is(e))return e.navigationTarget.flatMap(a=>l0(a,t));if(Na.is(e)){let a=t.Query.nearest(e,{types:["node"]});return(r=a==null?void 0:a[0])!=null&&r.feature.id?[a[0].feature.id]:[]}else if(Le.is(e)){let a=t.Query.nearest(e,{types:["node"]});return(n=a==null?void 0:a[0])!=null&&n.feature.id?[a[0].feature.id]:[]}else if(Ra.is(e)){let a=t.Query.nearest(e,{types:["node"]});return(o=a==null?void 0:a[0])!=null&&o.feature.id?[a[0].feature.id]:[]}else if(Fi.is(e)){let a=t==null?void 0:t.getMVFFeatureById("entrance",e.id);return a!=null&&a.properties.node?[a==null?void 0:a.properties.node]:[]}else if(Fa.is(e)){let a=t==null?void 0:t.getMVFFeatureById("area",e.id);return(i=a==null?void 0:a.properties.destinationNodes)!=null?i:[]}else if(Ur.is(e)){let a=t==null?void 0:t.getMVFFeatureById("space",e.id);return a==null?[]:a.properties.destinationNodes}else{if(sc.is(e))return e.coordinates.reduce((a,l)=>{var p;let c=t.Query.nearest(l,{types:["node"]});return(p=c==null?void 0:c[0])!=null&&p.feature.id&&a.push(c[0].feature.id),a},[]);if(lo.is(e)){let a=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return a!=null?a:[]}else return Ko.is(e)?e.spaces.flatMap(a=>{var l,c;return(c=(l=t==null?void 0:t.getMVFFeatureById("space",a.id))==null?void 0:l.properties.destinationNodes)!=null?c:[]}).filter(a=>typeof a=="string"):Es.is(e)?e.nodes.map(a=>a.id):Aa.is(e)?[e.id]:[]}}s(l0,"getNodesFromTarget");d();d();d();d();d();d();function E9(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return Lee(this.cover(t,r),t,r,e)}s(E9,"default");function Lee(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var o,i=e._root,a={data:n},l=e._x0,c=e._y0,p=e._x1,f=e._y1,m,y,v,x,S,I,P,T;if(!i)return e._root=a,e;for(;i.length;)if((S=t>=(m=(l+p)/2))?l=m:p=m,(I=r>=(y=(c+f)/2))?c=y:f=y,o=i,!(i=i[P=I<<1|S]))return o[P]=a,e;if(v=+e._x.call(null,i.data),x=+e._y.call(null,i.data),t===v&&r===x)return a.next=i,o?o[P]=a:e._root=a,e;do o=o?o[P]=new Array(4):e._root=new Array(4),(S=t>=(m=(l+p)/2))?l=m:p=m,(I=r>=(y=(c+f)/2))?c=y:f=y;while((P=I<<1|S)===(T=(x>=y)<<1|v>=m));return o[T]=i,o[P]=a,e}s(Lee,"add");function Ree(e){var t,r,n=e.length,o,i,a=new Array(n),l=new Array(n),c=1/0,p=1/0,f=-1/0,m=-1/0;for(r=0;r<n;++r)isNaN(o=+this._x.call(null,t=e[r]))||isNaN(i=+this._y.call(null,t))||(a[r]=o,l[r]=i,o<c&&(c=o),o>f&&(f=o),i<p&&(p=i),i>m&&(m=i));if(c>f||p>m)return this;for(this.cover(c,p).cover(f,m),r=0;r<n;++r)Lee(this,a[r],l[r],e[r]);return this}s(Ree,"addAll");d();function _9(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,o=this._x1,i=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,i=(n=Math.floor(t))+1;else{for(var a=o-r||1,l=this._root,c,p;r>e||e>=o||n>t||t>=i;)switch(p=(t<n)<<1|e<r,c=new Array(4),c[p]=l,l=c,a*=2,p){case 0:o=r+a,i=n+a;break;case 1:r=o-a,i=n+a;break;case 2:o=r+a,n=i-a;break;case 3:r=o-a,n=i-a;break}this._root&&this._root.length&&(this._root=l)}return this._x0=r,this._y0=n,this._x1=o,this._y1=i,this}s(_9,"default");d();function A9(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}s(A9,"default");d();function k9(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}s(k9,"default");d();d();function Kr(e,t,r,n,o){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=o}s(Kr,"default");function D9(e,t,r){var n,o=this._x0,i=this._y0,a,l,c,p,f=this._x1,m=this._y1,y=[],v=this._root,x,S;for(v&&y.push(new Kr(v,o,i,f,m)),r==null?r=1/0:(o=e-r,i=t-r,f=e+r,m=t+r,r*=r);x=y.pop();)if(!(!(v=x.node)||(a=x.x0)>f||(l=x.y0)>m||(c=x.x1)<o||(p=x.y1)<i))if(v.length){var I=(a+c)/2,P=(l+p)/2;y.push(new Kr(v[3],I,P,c,p),new Kr(v[2],a,P,I,p),new Kr(v[1],I,l,c,P),new Kr(v[0],a,l,I,P)),(S=(t>=P)<<1|e>=I)&&(x=y[y.length-1],y[y.length-1]=y[y.length-1-S],y[y.length-1-S]=x)}else{var T=e-+this._x.call(null,v.data),M=t-+this._y.call(null,v.data),w=T*T+M*M;if(w<r){var E=Math.sqrt(r=w);o=e-E,i=t-E,f=e+E,m=t+E,n=v.data}}return n}s(D9,"default");d();function F9(e){if(isNaN(f=+this._x.call(null,e))||isNaN(m=+this._y.call(null,e)))return this;var t,r=this._root,n,o,i,a=this._x0,l=this._y0,c=this._x1,p=this._y1,f,m,y,v,x,S,I,P;if(!r)return this;if(r.length)for(;;){if((x=f>=(y=(a+c)/2))?a=y:c=y,(S=m>=(v=(l+p)/2))?l=v:p=v,t=r,!(r=r[I=S<<1|x]))return this;if(!r.length)break;(t[I+1&3]||t[I+2&3]||t[I+3&3])&&(n=t,P=I)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(i=r.next)&&delete r.next,o?(i?o.next=i:delete o.next,this):t?(i?t[I]=i:delete t[I],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[P]=r:this._root=r),this):(this._root=i,this)}s(F9,"default");function Nee(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}s(Nee,"removeAll");d();function L9(){return this._root}s(L9,"default");d();function R9(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}s(R9,"default");d();function N9(e){var t=[],r,n=this._root,o,i,a,l,c;for(n&&t.push(new Kr(n,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(n=r.node,i=r.x0,a=r.y0,l=r.x1,c=r.y1)&&n.length){var p=(i+l)/2,f=(a+c)/2;(o=n[3])&&t.push(new Kr(o,p,f,l,c)),(o=n[2])&&t.push(new Kr(o,i,f,p,c)),(o=n[1])&&t.push(new Kr(o,p,a,l,f)),(o=n[0])&&t.push(new Kr(o,i,a,p,f))}return this}s(N9,"default");d();function B9(e){var t=[],r=[],n;for(this._root&&t.push(new Kr(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var o=n.node;if(o.length){var i,a=n.x0,l=n.y0,c=n.x1,p=n.y1,f=(a+c)/2,m=(l+p)/2;(i=o[0])&&t.push(new Kr(i,a,l,f,m)),(i=o[1])&&t.push(new Kr(i,f,l,c,m)),(i=o[2])&&t.push(new Kr(i,a,m,f,p)),(i=o[3])&&t.push(new Kr(i,f,m,c,p))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}s(B9,"default");d();function Bee(e){return e[0]}s(Bee,"defaultX");function $9(e){return arguments.length?(this._x=e,this):this._x}s($9,"default");d();function $ee(e){return e[1]}s($ee,"defaultY");function j9(e){return arguments.length?(this._y=e,this):this._y}s(j9,"default");function c0(e,t,r){var n=new G9(t==null?Bee:t,r==null?$ee:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}s(c0,"quadtree");function G9(e,t,r,n,o,i){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=o,this._y1=i,this._root=void 0}s(G9,"Quadtree");function jee(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}s(jee,"leaf_copy");var io=c0.prototype=G9.prototype;io.copy=function(){var e=new G9(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,r,n;if(!t)return e;if(!t.length)return e._root=jee(t),e;for(r=[{source:t,target:e._root=new Array(4)}];t=r.pop();)for(var o=0;o<4;++o)(n=t.source[o])&&(n.length?r.push({source:n,target:t.target[o]=new Array(4)}):t.target[o]=jee(n));return e};io.add=E9;io.addAll=Ree;io.cover=_9;io.data=A9;io.extent=k9;io.find=D9;io.remove=F9;io.removeAll=Nee;io.root=L9;io.size=R9;io.visit=N9;io.visitAfter=B9;io.x=$9;io.y=j9;var Wo,mu,U9=class U9{constructor(t){O(this,Wo,{});O(this,mu);A(this,mu,t)}getTreeByType(t,r,n){var a;if(u(this,Wo)[t]||(u(this,Wo)[t]={}),u(this,Wo)[t][r]&&u(this,Wo)[t][r][n])return u(this,Wo)[t][r][n];u(this,Wo)[t][r]||(u(this,Wo)[t][r]={}),u(this,Wo)[t][r][n]||(u(this,Wo)[t][r][n]=c0());let o=u(this,Wo)[t][r][n];o.x(l=>l.geometry.coordinates[1]),o.y(l=>l.geometry.coordinates[0]);let i=[];switch(t){case"node":i=((a=u(this,mu).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:a.filter(l=>l.properties.neighbors.length>0))||[];break;case"point-of-interest":i=u(this,mu).mvfPoisByFloorId[n]||[];break;case"door":i=u(this,mu).mvfEntrancesByFloorId[n]||[];break;case"annotation":i=u(this,mu).mvfAnnotationsByFloorId[n]||[];break}return(i==null?void 0:i.length)>0&&o.addAll(i),o}};Wo=new WeakMap,mu=new WeakMap,s(U9,"QueryCache");var u3=U9;var S5e=$.object({limit:$.enum(["same-floor","same-elevation"]).optional(),radius:$.number().optional(),types:$.array($.enum(["node","point-of-interest"])).min(1)}),Sa,p0,V9=class V9{constructor(t){O(this,Sa);O(this,p0);A(this,Sa,t),A(this,p0,new u3(u(this,Sa)))}nearest(t,r){try{S5e.parse(r)}catch(a){j.error(a);return}let n=py(t);if(!n)return;let o=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let a of u(this,Sa).getByType("floor-stack")){let l=a.defaultFloor;l&&o.push(l.id)}else if(r.limit==="same-elevation"){let a=u(this,Sa).floorsById[n.floorId];if(a){let l=a==null?void 0:a.elevation;l&&(o=u(this,Sa).getByType("floor-stack").map(c=>{var p;return(p=c.floors.find(f=>f.elevation===l))==null?void 0:p.id}).filter(Boolean))}}let i=[];for(let a of Aee(r.types))for(let l of o){let c=u(this,p0).getTreeByType(a,u(this,Sa).mapName,l).find(n.latitude,n.longitude,r.radius);if(c){let p=u(this,Sa).getById(a,c==null?void 0:c.properties.id);p&&i.push({distance:Qi([n.longitude,n.latitude],c.geometry.coordinates),feature:p})}}return i.sort((a,l)=>a.distance-l.distance)}};Sa=new WeakMap,p0=new WeakMap,s(V9,"Query");var u0=V9;d();d();var d0,z9=class z9{constructor(t){O(this,d0);A(this,d0,t||[])}get raw(){return u(this,d0)}};d0=new WeakMap,s(z9,"OpeningHours");var p3=z9;var xn,Se,Xt,Hh=class Hh extends Gr{constructor(r,n){super(n.mvfData.id);h(this,"__type",Hh.__type);h(this,"id","loc_");h(this,"name","");h(this,"externalId");h(this,"description");h(this,"logo");h(this,"phone");h(this,"social",[]);h(this,"images",[]);h(this,"links",[]);h(this,"website");h(this,"icon");O(this,xn);O(this,Se,{});O(this,Xt);A(this,xn,r),A(this,Xt,n.mvfData);for(let o in n.mvfData)o==="links"?this.links=n.mvfData.links.map(i=>new ec({mvfData:i})):o==="pictures"?this.images=n.mvfData.pictures.map(i=>{var a;return i.url?new rc({mvfData:{...i,url:(a=i.url)!=null?a:""},mapData:u(this,xn)}):void 0}).filter(i=>i!=null):o==="website"?n.mvfData.website&&(this.website=new ec({mvfData:n.mvfData.website})):o==="icon"?n.mvfData.icon&&(this.icon=new rc({mvfData:{url:n.mvfData.icon},mapData:u(this,xn)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return u(this,Xt)[o]}})}static is(r){return r.__type===Hh.__type}get spaces(){if(u(this,Se).spaces)return u(this,Se).spaces;if(u(this,Xt).spaces==null)return u(this,Se).spaces=[],u(this,Se).spaces;u(this,Se).spaces=[];for(let r=0;r<u(this,Xt).spaces.length;r++){let n=u(this,xn).getById("space",u(this,Xt).spaces[r].id);n&&u(this,Se).spaces.push(n)}return u(this,Se).spaces}get points(){if(u(this,Se).points)return u(this,Se).points;if(u(this,Xt).spaces==null)return u(this,Se).points=[],u(this,Se).points;u(this,Se).points=[];for(let r=0;r<u(this,Xt).spaces.length;r++){let n=u(this,xn).getById("point-of-interest",u(this,Xt).spaces[r].id);n&&u(this,Se).points.push(n)}return u(this,Se).points}get doors(){if(u(this,Se).doors)return u(this,Se).doors;if(u(this,Xt).entrances==null)return u(this,Se).doors=[],u(this,Se).doors;u(this,Se).doors=[];for(let r=0;r<u(this,Xt).entrances.length;r++){let n=u(this,xn).getById("door",u(this,Xt).entrances[r].id);n&&u(this,Se).doors.push(n)}return u(this,Se).doors}get connections(){var n;if(u(this,Se).connections)return u(this,Se).connections;if(u(this,Xt).connections==null)return u(this,Se).connections=[],u(this,Se).connections;let r=new Set;for(let o=0;o<u(this,Xt).connections.length;o++){let i=u(this,Xt).connections[o],a=u(this,xn).mvfConnectionsById[i],c=(a==null?[]:a.nodes).map(p=>u(this,xn).getById("node",p)).filter(Boolean);for(let p of c){if(p==null)continue;let f=Ms([p.coordinate.longitude,p.coordinate.latitude]),y=((n=u(this,xn).connectionSpaceIdsByLatLon[f])!=null?n:[]).map(v=>u(this,xn).connectionsById[v]).filter(v=>v!=null);for(let v of y)r.add(v)}}return u(this,Se).connections=Array.from(r),u(this,Se).connections}get annotations(){if(u(this,Se).annotations)return u(this,Se).annotations;if(u(this,Xt).annotations==null)return u(this,Se).annotations=[],u(this,Se).annotations;u(this,Se).annotations=[];for(let r=0;r<u(this,Xt).annotations.length;r++){let n=u(this,xn).getById("annotation",u(this,Xt).annotations[r].id);n&&u(this,Se).annotations.push(n)}return u(this,Se).annotations}get categories(){return u(this,Se).categories?u(this,Se).categories:u(this,Xt).categories==null?(u(this,Se).categories=[],u(this,Se).categories):(u(this,Se).categories=u(this,Xt).categories.map(r=>u(this,xn).getById("location-category",r)).filter(r=>r!=null),u(this,Se).categories)}get mapObjects(){return u(this,Se).mapObjects?u(this,Se).mapObjects:u(this,Xt).obstructions==null?(u(this,Se).mapObjects=[],u(this,Se).mapObjects):(u(this,Se).mapObjects=u(this,Xt).obstructions.map(r=>u(this,xn).getById("object",r.id)).filter(r=>r!=null),u(this,Se).mapObjects)}get areas(){return u(this,Se).areas?u(this,Se).areas:u(this,Xt).areas==null?(u(this,Se).areas=[],u(this,Se).areas):(u(this,Se).areas=u(this,Xt).areas.map(r=>u(this,xn).getById("area",r.id)).filter(r=>r!=null),u(this,Se).areas)}get focusTarget(){if(u(this,Se).focusTarget)return u(this,Se).focusTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);return u(this,Se).focusTarget=r,r}get openingHours(){var r;return u(this,Se).openingHours?u(this,Se).openingHours:(u(this,Se).openingHours=new p3((r=u(this,Xt).openingHoursSpecification)!=null?r:[]),u(this,Se).openingHours)}get navigationTarget(){if(u(this,Se).navigationTarget)return u(this,Se).navigationTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);for(let n of this.points)r.push(n.focusTarget);return u(this,Se).navigationTarget=r,r}toJSON(){return{id:this.id,name:this.name}}};xn=new WeakMap,Se=new WeakMap,Xt=new WeakMap,s(Hh,"LocationProfile"),h(Hh,"__type","location-profile");var H9=Hh,Nu=H9;d();var hu,Oo,Od,Wh=class Wh extends Gr{constructor(r,n){super(n.mvfData.id);h(this,"__type",Wh.__type);h(this,"id","cat_");h(this,"name","");h(this,"icon","");O(this,hu);O(this,Oo,{});O(this,Od);A(this,hu,r),A(this,Od,n.mvfData);for(let o in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return u(this,Od)[o]}})}static is(r){return r.__type===Wh.__type}get parent(){return u(this,Oo).parent?u(this,Oo).parent:(u(this,Oo).parent=u(this,Od).parent?u(this,hu).getById("location-category",u(this,Od).parent):void 0,u(this,Oo).parent)}get children(){return u(this,Oo).children?u(this,Oo).children:(u(this,Oo).children=u(this,hu).locationCategoriesByParentId[this.id]||[],u(this,Oo).children)}get locationProfiles(){if(u(this,Oo).locationProfiles)return u(this,Oo).locationProfiles;let r=[];for(let n of u(this,hu).locationProfilesByCategoryId[this.id]||[]){let o=u(this,hu).getById("location-profile",n.id);o&&r.push(o)}return u(this,Oo).locationProfiles=r,r}toJSON(){return{id:this.id,name:this.name}}};hu=new WeakMap,Oo=new WeakMap,Od=new WeakMap,s(Wh,"LocationCategory"),h(Wh,"__type","location-category");var W9=Wh,by=W9;var Ee,d3,Gee,qh,q9=class q9 extends Fe{constructor(r,n){var l,c,p,f,m;super();O(this,d3);h(this,"Analytics");O(this,Ee,{});h(this,"Query");h(this,"mvf");h(this,"outdoorViewToken");h(this,"spaceIdsByDestinationNodeId");h(this,"objectEntranceNodeIdsByObstructionId");h(this,"obstructionIdByEntranceId");h(this,"venue");h(this,"tokenManager");h(this,"directions");h(this,"enterpriseMode",!1);h(this,"nodesById");h(this,"spacesById");h(this,"floorsById");h(this,"floorStacksById");h(this,"facadesById");h(this,"facadesBySpaceId");h(this,"connectionsById");h(this,"objectsById");h(this,"doorsById");h(this,"pointsOfInterestById");h(this,"annotationsById");h(this,"areasById");h(this,"locationProfilesById");h(this,"locationCategoriesById");h(this,"locationProfilesByExternalId");h(this,"locationsById");h(this,"locationProfilesByCategoryId");h(this,"locationCategoriesByParentId");h(this,"categoriesById");h(this,"doorsByNodeId");h(this,"mvfLocationsBySpaceId");h(this,"locationIdsByNodeId");h(this,"spaceIdsByNodeId");h(this,"mvfAnnotationsById");h(this,"mvfConnectionsById");h(this,"mvfConnectionsByNodeId");h(this,"mvfConnectionIdsByLatLon");h(this,"mvfEntrancesById");h(this,"mvfNodesById");h(this,"mvfObstructionById");h(this,"mvfSpacesById");h(this,"mvfFloorsById");h(this,"mvfFloorStacksById");h(this,"mvfAreasById");h(this,"connectionSpaceIdsByLatLon");h(this,"locationProfilesByAttachedFeatureId");h(this,"spacesByExternalId");h(this,"nodesByExternalId");h(this,"objectsByExternalId");h(this,"poisByExternalId");h(this,"floorsByExternalId");h(this,"floorStacksByExternalId");h(this,"doorsByExternalId");h(this,"areasByExternalId");h(this,"connectionsByExternalId");h(this,"locationsByExternalId");h(this,"categoriesByExternalId");h(this,"mvfNodesByFloorId");h(this,"mvfSpacesByFloorId");h(this,"mvfPoisByFloorId");h(this,"mvfEntrancesByFloorId");h(this,"mvfAnnotationsByFloorId");h(this,"localePacksUrls");h(this,"currentLanguage");h(this,"languagePacks",{});h(this,"tilesets",{});h(this,"binaryBundle");h(this,"envControl");h(this,"getMapDataOptions");O(this,qh);h(this,"getDirectionsMultiDestination",s((r,n,o)=>this.getDirections(r,n,{...o,multiDestination:!0}),"getDirectionsMultiDestination"));h(this,"getDirections",s((r,n,o)=>{let{accessible:i=!1,smoothing:a=!0,multiDestination:l=!1}=o||{},c=typeof a=="object"?a.enabled:a,p=typeof a=="object"?a.radius:void 0,f=(o==null?void 0:o.zones)||[],m={accessible:i,zones:f,smoothing:{enabled:c!=null?c:!0,radius:p!=null?p:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[]};if(l&&Array.isArray(n)){let y=Array.isArray(r)?r:[r],v=[];for(let x of n){let S=Array.isArray(x)?x:[x],I=this.directions.getDirections(y,S,m,this);if(!I){j.error("getDirections failed due to missing directions for one of the segments");return}y=S,v.push(I)}return v}else{let y=Array.isArray(r)?r:[r],v=Array.isArray(n)?n:[n];if(Array.isArray(v[0])){j.error("getDirections does not support multi-destination without multisegment option");return}return y[0].id&&v[0].id&&this.Analytics.sendGetDirectionsEvent(y[0].id,v[0].id),this.directions.getDirections(y,v,m,this)}},"getDirections"));h(this,"transformImageRequest",s(async r=>{var o;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!Lz(r))return{url:r};if(Rz(r))return{url:r};let n=A0(r);if(!n)return{url:r};try{let i=await((o=this.tokenManager)==null?void 0:o.getSasTokensAsync()),a=i==null?void 0:i[n.mapId];if(a==null)throw new Error("SAS token not found");let[l]=r.split("?");return{url:"".concat(l,"?").concat(a.token)}}catch(i){return j.error("Failed to append SAS token to image request. Requests for private images may fail.",i),{url:r}}},"transformImageRequest"));let o=(l=n==null?void 0:n.env)!=null?l:gp();if(this.envControl=o,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new af,this.localePacksUrls=(c=n==null?void 0:n.localePacksUrls)!=null?c:{},this.mvf=r,this.outdoorViewToken=n==null?void 0:n.outdoorViewToken,this.getMapDataOptions=n==null?void 0:n.getMapDataOptions,((p=r["tileset.json"])==null?void 0:p.default)!=null&&(this.tilesets[r["tileset.json"].default.key]=r["tileset.json"].default,o.updateTileServerBaseUrl(r["tileset.json"].default.url),r["tileset.json"].others!=null))for(let y of r["tileset.json"].others)this.tilesets[y.key]=y;this.enterpriseMode=(f=n==null?void 0:n.enterprise)!=null?f:!1,this.tokenManager=n==null?void 0:n.tokenManager;let i=o_(r,this);this.nodesById=i.nodesById,this.spacesById=i.spacesById,this.floorsById=i.floorsById,this.floorStacksById=i.floorStacksById,this.facadesById=i.facadesById,this.facadesBySpaceId=i.facadesBySpaceId,this.connectionsById=i.connectionsById,this.objectsById=i.objectsById,this.doorsById=i.doorsById,this.pointsOfInterestById=i.poisById,this.annotationsById=i.annotationsById,this.areasById=i.areasById,this.locationProfilesById=i.locationProfilesById,this.locationCategoriesById=i.locationCategoriesById,this.locationProfilesByCategoryId=i.locationProfilesByCategoryId,this.locationCategoriesByParentId=i.locationCategoriesByParentId,this.spacesByExternalId=i.spacesByExternalId,this.nodesByExternalId=i.nodesByExternalId,this.objectsByExternalId=i.objectsByExternalId,this.floorsByExternalId=i.floorsByExternalId,this.locationProfilesByExternalId=i.locationProfilesByExternalId,this.floorStacksByExternalId=i.floorStacksByExternalId,this.poisByExternalId=i.poisByExternalId,this.doorsByExternalId=i.doorsByExternalId,this.areasByExternalId=i.areasByExternalId,this.mvfAnnotationsById=i.mvfAnnotationsById,this.mvfConnectionsById=i.mvfConnectionsById,this.mvfConnectionsByNodeId=i.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=i.mvfConnectionIdsByLatLon,this.mvfEntrancesById=i.mvfEntrancesById,this.mvfNodesById=i.mvfNodesById,this.mvfObstructionById=i.mvfObstructionById,this.mvfSpacesById=i.mvfSpacesById,this.mvfFloorsById=i.mvfFloorsById,this.mvfFloorStacksById=i.mvfFloorStacksById,this.mvfNodesByFloorId=i.mvfNodesByFloorId,this.mvfSpacesByFloorId=i.mvfSpacesByFloorId,this.mvfPoisByFloorId=i.mvfPoisByFloorId,this.mvfEntrancesByFloorId=i.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=i.mvfAnnotationsByFloorId,this.mvfAreasById=i.mvfAreasById,this.doorsByNodeId=i.doorsByNodeId,this.spaceIdsByDestinationNodeId=i.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=i.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=i.obstructionIdByEntranceId;let a=n_(r,this);if(this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.mvfLocationsBySpaceId=a.mvfLocationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=i.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=i.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=a.spaceIdsByNodeId,this.connectionsByExternalId=a.connectionsByExternalId,this.locationsByExternalId=a.locationsByExternalId,this.categoriesByExternalId=a.categoriesByExternalId,a.venue.name!=null){this.venue=new D0(this,{mvfData:a.venue});let y={};for(let v in a.mvfLocationsById)y[v]=a.mvfLocationsById[v];for(let v in a.locationInstancesById)y[v]=a.locationInstancesById[v];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":y,"enterprise-category":a.mvfCategoriesById,"floor-stack":i.mvfFloorStacksById,floor:i.mvfFloorsById}},(m=n==null?void 0:n.languagePacks)==null||m.forEach(({language:v,localePack:x})=>{this.languagePacks[v.code]=F4(x)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new u0(this),this.directions=new c3({nodes:r["node.geojson"],geojsonCollection:r.enterprise?r.space:r.obstruction,connections:r["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let r=this;return{get baseUri(){var n;return r.envControl.getBaseUri((n=r.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return r.envControl.getBaseAuthUri()},get analyticsBaseUri(){return r.envControl.getAnalyticsBaseUri()},get tileServerUri(){return r.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?r:""}get mapCenter(){return new Le(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?r:0}get spaces(){return u(this,Ee).spaces==null&&(u(this,Ee).spaces=globalThis.Object.values(this.spacesById)),u(this,Ee).spaces}get objects(){return u(this,Ee).objects==null&&(u(this,Ee).objects=globalThis.Object.values(this.objectsById)),u(this,Ee).objects}get connections(){return u(this,Ee).connections==null&&(u(this,Ee).connections=globalThis.Object.values(this.connectionsById)),u(this,Ee).connections}get floors(){return u(this,Ee).floors==null&&(u(this,Ee).floors=globalThis.Object.values(this.floorsById)),u(this,Ee).floors}get floorStacks(){return u(this,Ee).floorStacks==null&&(u(this,Ee).floorStacks=globalThis.Object.values(this.floorStacksById)),u(this,Ee).floorStacks}get facades(){return u(this,Ee).facades==null&&(u(this,Ee).facades=globalThis.Object.values(this.facadesById)),u(this,Ee).facades}get doors(){return u(this,Ee).doors==null&&(u(this,Ee).doors=globalThis.Object.values(this.doorsById)),u(this,Ee).doors}get pointsOfInterest(){return u(this,Ee).pointsOfInterest==null&&(u(this,Ee).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),u(this,Ee).pointsOfInterest}get annotations(){return u(this,Ee).annotations==null&&(u(this,Ee).annotations=globalThis.Object.values(this.annotationsById)),u(this,Ee).annotations}get areas(){return u(this,Ee).areas==null&&(u(this,Ee).areas=globalThis.Object.values(this.areasById)),u(this,Ee).areas}get nodes(){return u(this,Ee).nodes==null&&(u(this,Ee).nodes=globalThis.Object.values(this.nodesById)),u(this,Ee).nodes}get locations(){return u(this,Ee).locations==null&&(u(this,Ee).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return u(this,Ee).categories==null&&(u(this,Ee).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return u(this,Ee).locationProfiles==null&&(u(this,Ee).locationProfiles=globalThis.Object.values(this.locationProfilesById)),u(this,Ee).locationProfiles}get locationCategories(){return u(this,Ee).locationCategories==null&&(u(this,Ee).locationCategories=globalThis.Object.values(this.locationCategoriesById)),u(this,Ee).locationCategories}get mvfFloors(){return u(this,Ee).mvfFloors==null&&(u(this,Ee).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),u(this,Ee).mvfFloors}get mvfFloorStacks(){return u(this,Ee).mvfFloorStacks==null&&(u(this,Ee).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),u(this,Ee).mvfFloorStacks}getByType(r){switch(r){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(r,n){switch(r){case"location-profile":return this.locationProfilesById[n];case"location-category":return this.locationCategoriesById[n];case"space":return this.spacesById[n];case"floor":return this.floorsById[n];case"floor-stack":return this.floorStacksById[n];case"facade":return this.facadesById[n];case"node":return this.nodesById[n];case"door":return this.doorsById[n];case"connection":let o=this.connectionsById[n];return o==null&&(o=te(this,d3,Gee).call(this,this.mvfConnectionsById[n])),o;case"object":return this.objectsById[n];case"point-of-interest":return this.pointsOfInterestById[n];case"annotation":return this.annotationsById[n];case"area":return this.areasById[n];case"enterprise-location":return this.locationsById[n];case"enterprise-category":return this.categoriesById[n];default:return}}getByExternalId(r,n){var o,i,a,l,c,p,f,m,y,v,x,S;switch(r){case"location-profile":return(o=this.locationProfilesByExternalId[n])!=null?o:[];case"location-category":return[];case"space":return(i=this.spacesByExternalId[n])!=null?i:[];case"floor":return(a=this.floorsByExternalId[n])!=null?a:[];case"floor-stack":return(l=this.floorStacksByExternalId[n])!=null?l:[];case"node":return(c=this.nodesByExternalId[n])!=null?c:[];case"door":return(p=this.doorsByExternalId[n])!=null?p:[];case"connection":return(f=this.connectionsByExternalId[n])!=null?f:[];case"object":return(m=this.objectsByExternalId[n])!=null?m:[];case"point-of-interest":return(y=this.poisByExternalId[n])!=null?y:[];case"area":return(v=this.areasByExternalId[n])!=null?v:[];case"enterprise-location":return(x=this.locationsByExternalId[n])!=null?x:[];case"enterprise-category":return(S=this.categoriesByExternalId[n])!=null?S:[];default:return[]}}getMapDataById(r){var n,o,i,a,l,c,p,f,m,y;return(y=(m=(f=(p=(c=(l=(a=(i=(o=(n=this.spacesById[r])!=null?n:this.floorsById[r])!=null?o:this.floorStacksById[r])!=null?i:this.facadesById[r])!=null?a:this.nodesById[r])!=null?l:this.doorsById[r])!=null?c:this.connectionsById[r])!=null?p:this.objectsById[r])!=null?f:this.pointsOfInterestById[r])!=null?m:this.annotationsById[r])!=null?y:this.areasById[r]}getMVFFeatureById(r,n){switch(r){case"space":return this.mvfSpacesById[n];case"node":return this.mvfNodesById[n];case"obstruction":return this.mvfObstructionById[n];case"floor":return this.mvfFloorsById[n];case"floor-stack":return this.mvfFloorStacksById[n];case"connection":return this.mvfConnectionsById[n];case"entrance":return this.mvfEntrancesById[n];case"annotation":return this.mvfAnnotationsById[n];case"area":return this.mvfAreasById[n];default:throw new Error("Unknown MVF feature type: ".concat(r))}}getMVFFeatureByNodeId(r,n){switch(r){case"connection":return this.mvfConnectionsByNodeId[n];default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getMVFFeatureByType(r){switch(r){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getPropTranslation(r,n,o,i){var c,p;if(!this.currentLanguage)return i;let{code:a}=this.currentLanguage,l=(p=(c=this.languagePacks[a])==null?void 0:c.optimized)==null?void 0:p[r];if(l){let f=l[o];if(f!=null&&f[n]!==void 0)return f[n]}return i}async changeLanguage(r){var l;let n=r.toLowerCase();if(!n){j.error("language code must be defined");return}if(!this.currentLanguage){j.error("languageCode feature is not supported");return}let o=this.currentLanguage.code,i=(l=this.venue)==null?void 0:l.languages.find(({code:c})=>c.toLowerCase()===n.toLowerCase());if(!i){j.warn("language not found");return}if(o===i.code)return;let a=this.languagePacks[i.code];if(!a){let c=this.localePacksUrls[i.code];if(!c){j.error("locale packs url not found for ".concat(i.code));return}u(this,qh)&&u(this,qh).abort();let p=new AbortController;A(this,qh,p);let f;try{f=await Dz(c,{signal:p.signal})}catch(m){j.error("failed downloading language pack",m);return}if(!f||p.signal.aborted)return;a=F4(f),this.languagePacks[i.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=i,this.publish("language-change",this.currentLanguage)}getDistance(r,n){let o=py(r),i=py(n);return Qi([o.longitude,o.latitude],[i.longitude,i.latitude])}async toJSONBundle({downloadLanguagePacks:r=!0}={}){var o;let n=[];if(r&&this.enterpriseMode){let i=new AbortController;for(let a of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[a.code]){let l=await E4(this.localePacksUrls[a.code],{signal:i.signal}),c=await hm(l);c&&n.push({language:{code:a.code,name:a.name},localePack:c})}}catch(l){j.warn("failed downloading language pack",l)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:r=!0}={}){var o;if(!this.binaryBundle){j.error("binary bundle not found");return}let n=[];if(r&&this.enterpriseMode){let i=new AbortController;for(let a of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[a.code]){let l=await E4(this.localePacksUrls[a.code],{signal:i.signal});l&&n.push({language:{code:a.code,name:a.name},localePack:l})}}catch(l){j.warn("failed downloading language pack",l)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.binaryBundle}}destroy(){for(let r of globalThis.Object.keys(u(this,Ee)))u(this,Ee)[r]=null}};Ee=new WeakMap,d3=new WeakSet,Gee=s(function(r){var l;let n=(l=r==null?void 0:r.nodes)==null?void 0:l[0],o=this.getById("node",n);if(o==null)return;let i=Ms([o.coordinate.longitude,o.coordinate.latitude]),a=this.connectionSpaceIdsByLatLon[i];return a==null?void 0:a.map(c=>this.connectionsById[c]).find(c=>c!=null)},"#getConnectionFromMVFConnection"),qh=new WeakMap,s(q9,"MapDataInternal");var Uh=q9;var Xh,Ed,f0,Ca,Zh=class Zh extends Ai{constructor(r,n){super(n.mvfData.id,r);h(this,"__type",Zh.__type);O(this,Xh);O(this,Ed);O(this,f0);O(this,Ca,{});A(this,Xh,n.mvfData),A(this,Ed,r),A(this,f0,n.floorStackId)}static is(r){return r.__type===Zh.__type}get floorStack(){return u(this,Ed).getById("floor-stack",u(this,f0))}get spaces(){if(!u(this,Ca).spaces){u(this,Ca).spaces=[];for(let r of u(this,Xh).spaces){let n=u(this,Ed).getById("space",r.spaceId);n&&u(this,Ca).spaces.push(n)}}return u(this,Ca).spaces}get center(){if(!u(this,Ca).center){let r={type:"FeatureCollection",features:[]};for(let o of this.spaces){let i=u(this,Ed).mvfSpacesById[o.id];i&&r.features.push(i)}if(r.features.length===0)throw new Error("No geometry found for facade!");let n=l2(r);u(this,Ca).center=new Le(n.geometry.coordinates[1],n.geometry.coordinates[0],u(this,Xh).spaces[0].floorId)}return u(this,Ca).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};Xh=new WeakMap,Ed=new WeakMap,f0=new WeakMap,Ca=new WeakMap,s(Zh,"Facade"),h(Zh,"__type","facade");var Z9=Zh,Ko=Z9;export{Le as a,Aa as b,Ur as c,ry as d,Ko as e,Es as f,gy as g,$ as h,H7 as i,D4e as j,Mee as k,Oee as l,x5e as m};