@mapxus/mapxus-map-jp 9.0.0 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,2 +1,27 @@
1
- /*! For license information please see index.umd.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("axios"),require("maplibre-gl")):"function"==typeof define&&define.amd?define(["axios","maplibre-gl"],e):"object"==typeof exports?exports.MapxusMap=e(require("axios"),require("maplibre-gl")):t.MapxusMap=e(t.axios,t["maplibre-gl"])}(self,(t,e)=>(()=>{var r={22:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.polyval=e.ghash=void 0,e._toGHASHKey=u;const n=r(6527),i=16,o=new Uint8Array(16),s=(0,n.u32)(o),a=(t,e,r,n)=>({s3:r<<31|n>>>1,s2:e<<31|r>>>1,s1:t<<31|e>>>1,s0:t>>>1^225<<24&-(1&(1&n))}),c=t=>(t>>>0&255)<<24|(t>>>8&255)<<16|(t>>>16&255)<<8|t>>>24&255;function u(t){t.reverse();const e=1&t[15];let r=0;for(let e=0;e<t.length;e++){const n=t[e];t[e]=n>>>1|r,r=(1&n)<<7}return t[0]^=225&-e,t}class l{constructor(t,e){this.blockLen=i,this.outputLen=i,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,t=(0,n.toBytes)(t),(0,n.abytes)(t,16);const r=(0,n.createView)(t);let o=r.getUint32(0,!1),s=r.getUint32(4,!1),u=r.getUint32(8,!1),l=r.getUint32(12,!1);const d=[];for(let t=0;t<128;t++)d.push({s0:c(o),s1:c(s),s2:c(u),s3:c(l)}),({s0:o,s1:s,s2:u,s3:l}=a(o,s,u,l));const h=(f=e||1024)>65536?8:f>1024?4:2;var f;if(![1,2,4,8].includes(h))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=h;const p=128/h,y=this.windowSize=2**h,g=[];for(let t=0;t<p;t++)for(let e=0;e<y;e++){let r=0,n=0,i=0,o=0;for(let s=0;s<h;s++){if(!(e>>>h-s-1&1))continue;const{s0:a,s1:c,s2:u,s3:l}=d[h*t+s];r^=a,n^=c,i^=u,o^=l}g.push({s0:r,s1:n,s2:i,s3:o})}this.t=g}_updateBlock(t,e,r,n){t^=this.s0,e^=this.s1,r^=this.s2,n^=this.s3;const{W:i,t:o,windowSize:s}=this;let a=0,c=0,u=0,l=0;const d=(1<<i)-1;let h=0;for(const f of[t,e,r,n])for(let t=0;t<4;t++){const e=f>>>8*t&255;for(let t=8/i-1;t>=0;t--){const r=e>>>i*t&d,{s0:n,s1:f,s2:p,s3:y}=o[h*s+r];a^=n,c^=f,u^=p,l^=y,h+=1}}this.s0=a,this.s1=c,this.s2=u,this.s3=l}update(t){(0,n.aexists)(this),t=(0,n.toBytes)(t),(0,n.abytes)(t);const e=(0,n.u32)(t),r=Math.floor(t.length/i),a=t.length%i;for(let t=0;t<r;t++)this._updateBlock(e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]);return a&&(o.set(t.subarray(r*i)),this._updateBlock(s[0],s[1],s[2],s[3]),(0,n.clean)(s)),this}destroy(){const{t}=this;for(const e of t)e.s0=0,e.s1=0,e.s2=0,e.s3=0}digestInto(t){(0,n.aexists)(this),(0,n.aoutput)(t,this),this.finished=!0;const{s0:e,s1:r,s2:i,s3:o}=this,s=(0,n.u32)(t);return s[0]=e,s[1]=r,s[2]=i,s[3]=o,t}digest(){const t=new Uint8Array(i);return this.digestInto(t),this.destroy(),t}}class d extends l{constructor(t,e){t=(0,n.toBytes)(t),(0,n.abytes)(t);const r=u((0,n.copyBytes)(t));super(r,e),(0,n.clean)(r)}update(t){t=(0,n.toBytes)(t),(0,n.aexists)(this);const e=(0,n.u32)(t),r=t.length%i,a=Math.floor(t.length/i);for(let t=0;t<a;t++)this._updateBlock(c(e[4*t+3]),c(e[4*t+2]),c(e[4*t+1]),c(e[4*t+0]));return r&&(o.set(t.subarray(a*i)),this._updateBlock(c(s[3]),c(s[2]),c(s[1]),c(s[0])),(0,n.clean)(s)),this}digestInto(t){(0,n.aexists)(this),(0,n.aoutput)(t,this),this.finished=!0;const{s0:e,s1:r,s2:i,s3:o}=this,s=(0,n.u32)(t);return s[0]=e,s[1]=r,s[2]=i,s[3]=o,t.reverse()}}function h(t){const e=(e,r)=>t(r,e.length).update((0,n.toBytes)(e)).digest(),r=t(new Uint8Array(16),0);return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=(e,r)=>t(e,r),e}e.ghash=h((t,e)=>new l(t,e)),e.polyval=h((t,e)=>new d(t,e))},42:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},52:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(241),i=r(5572),o=r(2049),s=r(1882),a=n.A?n.A.prototype:void 0,c=a?a.toString:void 0;const u=function t(e){if("string"==typeof e)return e;if((0,o.A)(e))return(0,i.A)(e,t)+"";if((0,s.A)(e))return c?c.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},83:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.chacha20=e.xchacha20=void 0;var n=r(8900);e.xchacha20=function(t,e,r){return(0,n.xchacha20poly1305)(t,e,r)};e.chacha20=function(t,e,r){return(0,n.chacha20poly1305)(t,e,r)}},169:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(6984);const i=function(t,e){for(var r=t.length;r--;)if((0,n.A)(t[r][0],e))return r;return-1}},180:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(702),i=r(1917);const o=(0,n.A)(i.A,"Promise")},181:(t,e,r)=>{"use strict";r.d(e,{d:()=>n});class n{static instance;_buildingUnitsMap;_ordinalsMap;_visitedBuildingUnits;constructor(){this._buildingUnitsMap=new Map,this._ordinalsMap=new Map,this._visitedBuildingUnits=[]}static getInstance(){return n.instance||(n.instance=new n),n.instance}getBuildingUnitByVenue(t){return this._buildingUnitsMap.get(t)}setBuildingUnitByVenue(t,e){this._buildingUnitsMap.set(t,e)}getOrdinalByBuildingUnit(t){return this._ordinalsMap.get(t)}setOrdinalByBuildingUnit(t,e){this._ordinalsMap.set(t,e)}getVisitedBuildingUnits(){return this._visitedBuildingUnits}addVisitedBuildingUnit(t){this._visitedBuildingUnits.push(t),this._visitedBuildingUnits.length>100&&(this._visitedBuildingUnits=this._visitedBuildingUnits.slice(this._visitedBuildingUnits.length-100))}}},241:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=r(1917).A.Symbol},244:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSharedKey=e.deriveKey=void 0;var n=r(6527),i=r(4139),o=r(7076);e.deriveKey=function(t,e,r){return(0,i.hkdf)(o.sha256,t,e,r,32)};e.getSharedKey=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(0,e.deriveKey)(n.concatBytes.apply(void 0,t))}},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,d=r?i-1:0,h=r?-1:1,f=t[e+d];for(d+=h,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+t[e+d],d+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+d],d+=h,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=u}return(f?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(e*c-1)*Math.pow(2,i),s+=d):(a=e*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;t[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+f]=255&s,f+=p,s/=256,u-=8);t[r+f-p]|=128*y}},367:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){return function(r){return t(e(r))}}},402:(t,e,r)=>{"use strict";r.d(e,{A:()=>d});var n=r(241),i=r(3988),o=r(6984),s=r(8967),a=r(4877),c=r(9959),u=n.A?n.A.prototype:void 0,l=u?u.valueOf:void 0;const d=function(t,e,r,n,u,d,h){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!d(new i.A(t),new i.A(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,o.A)(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var f=a.A;case"[object Set]":var p=1&n;if(f||(f=c.A),t.size!=e.size&&!p)return!1;var y=h.get(t);if(y)return y==e;n|=2,h.set(t,e);var g=(0,s.A)(f(t),f(e),n,u,d,h);return h.delete(t),g;case"[object Symbol]":if(l)return l.call(t)==l.call(e)}return!1}},423:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(9520),i=r(1788),o=r(2049),s=r(4616),a=r(5353),c=r(8719),u=Object.prototype.hasOwnProperty;const l=function(t,e){var r=(0,o.A)(t),l=!r&&(0,i.A)(t),d=!r&&!l&&(0,s.A)(t),h=!r&&!l&&!d&&(0,c.A)(t),f=r||l||d||h,p=f?(0,n.A)(t.length,String):[],y=p.length;for(var g in t)!e&&!u.call(t,g)||f&&("length"==g||d&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||(0,a.A)(g,y))||p.push(g);return p}},451:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(241),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n.A?n.A.toStringTag:void 0;const c=function(t){var e=o.call(t,a),r=t[a];try{t[a]=void 0;var n=!0}catch(t){}var i=s.call(t);return n&&(e?t[a]=r:delete t[a]),i}},459:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.RistrettoPoint=e.encodeToCurve=e.hashToCurve=e.ed25519_hasher=e.edwardsToMontgomery=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=e.ED25519_TORSION_SUBGROUP=void 0,e.edwardsToMontgomeryPub=S,e.edwardsToMontgomeryPriv=function(t){const e=A.hash(t.subarray(0,32));return A.adjustScalarBytes(e).subarray(0,32)};const n=r(7076),i=r(9175),o=r(2422),s=r(6377),a=r(1761),c=r(4967),u=r(2854),l=r(8627),d=BigInt(0),h=BigInt(1),f=BigInt(2),p=BigInt(3),y=BigInt(5),g=BigInt(8),m={p:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:g,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function _(t){const e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=m.p,s=t*t%o*t%o,a=(0,c.pow2)(s,f,o)*s%o,u=(0,c.pow2)(a,h,o)*t%o,l=(0,c.pow2)(u,y,o)*u%o,d=(0,c.pow2)(l,e,o)*l%o,p=(0,c.pow2)(d,r,o)*d%o,g=(0,c.pow2)(p,n,o)*p%o,_=(0,c.pow2)(g,i,o)*g%o,b=(0,c.pow2)(_,i,o)*g%o,v=(0,c.pow2)(b,e,o)*l%o;return{pow_p_5_8:(0,c.pow2)(v,f,o)*t%o,b2:s}}function b(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const v=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function w(t,e){const r=m.p,n=(0,c.mod)(e*e*e,r),i=_(t*(0,c.mod)(n*n*e,r)).pow_p_5_8;let o=(0,c.mod)(t*n*i,r);const s=(0,c.mod)(e*o*o,r),a=o,u=(0,c.mod)(o*v,r),l=s===t,d=s===(0,c.mod)(-t,r),h=s===(0,c.mod)(-t*v,r);return l&&(o=a),(d||h)&&(o=u),(0,c.isNegativeLE)(o,r)&&(o=(0,c.mod)(-o,r)),{isValid:l||d,value:o}}e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const B=(()=>(0,c.Field)(m.p,void 0,!0))(),A=(()=>({...m,Fp:B,hash:n.sha512,adjustScalarBytes:b,uvRatio:w}))();function E(t,e,r){if(e.length>255)throw new Error("Context is too big");return(0,i.concatBytes)((0,i.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}function S(t){const r=(0,l.ensureBytes)("pub",t),{y:n}=e.ed25519.Point.fromHex(r),i=BigInt(1);return B.toBytes(B.create((i+n)*B.inv(i-n)))}e.ed25519=(0,s.twistedEdwards)(A),e.ed25519ctx=(0,s.twistedEdwards)({...A,domain:E}),e.ed25519ph=(0,s.twistedEdwards)(Object.assign({},A,{domain:E,prehash:n.sha512})),e.x25519=(()=>{const t=m.p;return(0,u.montgomery)({P:t,type:"x25519",powPminus2:e=>{const{pow_p_5_8:r,b2:n}=_(e);return(0,c.mod)((0,c.pow2)(r,p,t)*n,t)},adjustScalarBytes:b})})(),e.edwardsToMontgomery=S;const I=(()=>(B.ORDER+p)/g)(),x=(()=>B.pow(f,I))(),L=(()=>B.sqrt(B.neg(B.ONE)))();const k=(()=>(0,c.FpSqrtEven)(B,B.neg(BigInt(486664))))();function O(t){const{xMn:e,xMd:r,yMn:n,yMd:i}=function(t){const e=(B.ORDER-y)/g,r=BigInt(486662);let n=B.sqr(t);n=B.mul(n,f);let i=B.add(n,B.ONE),o=B.neg(r),s=B.sqr(i),a=B.mul(s,i),c=B.mul(n,r);c=B.mul(c,o),c=B.add(c,s),c=B.mul(c,o);let u=B.sqr(a);s=B.sqr(u),u=B.mul(u,a),u=B.mul(u,c),s=B.mul(s,u);let l=B.pow(s,e);l=B.mul(l,u);let d=B.mul(l,L);s=B.sqr(l),s=B.mul(s,a);let p=B.eql(s,c),m=B.cmov(d,l,p),_=B.mul(o,n),b=B.mul(l,t);b=B.mul(b,x);let v=B.mul(b,L),w=B.mul(c,n);s=B.sqr(b),s=B.mul(s,a);let A=B.eql(s,w),E=B.cmov(v,b,A);s=B.sqr(m),s=B.mul(s,a);let S=B.eql(s,c),I=B.cmov(_,o,S),k=B.cmov(E,m,S),O=B.isOdd(k);return k=B.cmov(k,B.neg(k),S!==O),{xMn:I,xMd:i,yMn:k,yMd:h}}(t);let o=B.mul(e,i);o=B.mul(o,k);let s=B.mul(r,n),a=B.sub(e,r),u=B.add(e,r),l=B.mul(s,u),d=B.eql(l,B.ZERO);o=B.cmov(o,B.ZERO,d),s=B.cmov(s,B.ONE,d),a=B.cmov(a,B.ONE,d),u=B.cmov(u,B.ONE,d);const[p,m]=(0,c.FpInvertBatch)(B,[s,u],!0);return{x:B.mul(o,p),y:B.mul(a,m)}}function C(t){if(!(t instanceof N))throw new Error("RistrettoPoint expected")}e.ed25519_hasher=(0,a.createHasher)(e.ed25519.Point,t=>O(t[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:B.ORDER,m:1,k:128,expand:"xmd",hash:n.sha512}),e.hashToCurve=e.ed25519_hasher.hashToCurve,e.encodeToCurve=e.ed25519_hasher.encodeToCurve;const T=v,P=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),F=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),R=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),M=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),H=t=>w(h,t),U=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),V=t=>e.ed25519.CURVE.Fp.create((0,l.bytesToNumberLE)(t)&U);function j(t){const{d:r}=e.ed25519.CURVE,n=e.ed25519.CURVE.Fp.ORDER,i=e.ed25519.CURVE.Fp.create,o=i(T*t*t),s=i((o+h)*R);let a=BigInt(-1);const u=i((a-r*o)*i(o+r));let{isValid:l,value:d}=w(s,u),f=i(d*t);(0,c.isNegativeLE)(f,n)||(f=i(-f)),l||(d=f),l||(a=o);const p=i(a*(o-h)*M-u),y=d*d,g=i((d+d)*u),m=i(p*P),_=i(h-y),b=i(h+y);return new e.ed25519.Point(i(g*b),i(_*m),i(m*b),i(g*_))}class N{constructor(t){this.ep=t}static fromAffine(t){return new N(e.ed25519.Point.fromAffine(t))}static hashToCurve(t){t=(0,l.ensureBytes)("ristrettoHash",t,64);const e=j(V(t.slice(0,32))),r=j(V(t.slice(32,64)));return new N(e.add(r))}static fromBytes(t){return(0,i.abytes)(t),this.fromHex(t)}static fromHex(t){t=(0,l.ensureBytes)("ristrettoHex",t,32);const{a:r,d:n}=e.ed25519.CURVE,i=B.ORDER,o=B.create,s="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",a=V(t);if(!(0,l.equalBytes)((0,l.numberToBytesLE)(a,32),t)||(0,c.isNegativeLE)(a,i))throw new Error(s);const u=o(a*a),f=o(h+r*u),p=o(h-r*u),y=o(f*f),g=o(p*p),m=o(r*n*y-g),{isValid:_,value:b}=H(o(m*g)),v=o(b*p),w=o(b*v*m);let A=o((a+a)*v);(0,c.isNegativeLE)(A,i)&&(A=o(-A));const E=o(f*w),S=o(A*E);if(!_||(0,c.isNegativeLE)(S,i)||E===d)throw new Error(s);return new N(new e.ed25519.Point(A,E,h,S))}static msm(t,r){const n=(0,c.Field)(e.ed25519.CURVE.n,e.ed25519.CURVE.nBitLength);return(0,o.pippenger)(N,n,t,r)}toBytes(){let{ex:t,ey:e,ez:r,et:n}=this.ep;const i=B.ORDER,o=B.create,s=o(o(r+e)*o(r-e)),a=o(t*e),u=o(a*a),{value:d}=H(o(s*u)),h=o(d*s),f=o(d*a),p=o(h*f*n);let y;if((0,c.isNegativeLE)(n*p,i)){let r=o(e*T),n=o(t*T);t=r,e=n,y=o(h*F)}else y=f;(0,c.isNegativeLE)(t*p,i)&&(e=o(-e));let g=o((r-e)*y);return(0,c.isNegativeLE)(g,i)&&(g=o(-g)),(0,l.numberToBytesLE)(g,32)}toRawBytes(){return this.toBytes()}toHex(){return(0,l.bytesToHex)(this.toBytes())}toString(){return this.toHex()}equals(t){C(t);const{ex:e,ey:r}=this.ep,{ex:n,ey:i}=t.ep,o=B.create,s=o(e*i)===o(r*n),a=o(r*i)===o(e*n);return s||a}add(t){return C(t),new N(this.ep.add(t.ep))}subtract(t){return C(t),new N(this.ep.subtract(t.ep))}multiply(t){return new N(this.ep.multiply(t))}multiplyUnsafe(t){return new N(this.ep.multiplyUnsafe(t))}double(){return new N(this.ep.double())}negate(){return new N(this.ep.negate())}}e.RistrettoPoint=(N.BASE||(N.BASE=new N(e.ed25519.Point.BASE)),N.ZERO||(N.ZERO=new N(e.ed25519.Point.ZERO)),N);e.hashToRistretto255=(t,e)=>{const r=e.DST,o="string"==typeof r?(0,i.utf8ToBytes)(r):r,s=(0,a.expand_message_xmd)(t,o,64,n.sha512);return N.hashToCurve(s)},e.hash_to_ristretto255=e.hashToRistretto255},469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unsafe=e.aeskwp=e.aeskw=e.siv=e.gcmsiv=e.gcm=e.cfb=e.cbc=e.ecb=e.ctr=void 0;const n=r(22),i=r(6527),o=16,s=new Uint8Array(o);function a(t){return t<<1^283&-(t>>7)}function c(t,e){let r=0;for(;e>0;e>>=1)r^=t&-(1&e),t=a(t);return r}const u=(()=>{const t=new Uint8Array(256);for(let e=0,r=1;e<256;e++,r^=a(r))t[e]=r;const e=new Uint8Array(256);e[0]=99;for(let r=0;r<255;r++){let n=t[255-r];n|=n<<8,e[t[r]]=255&(n^n>>4^n>>5^n>>6^n>>7^99)}return(0,i.clean)(t),e})(),l=u.map((t,e)=>u.indexOf(e)),d=t=>t<<24|t>>>8,h=t=>t<<8|t>>>24,f=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function p(t,e){if(256!==t.length)throw new Error("Wrong sbox length");const r=new Uint32Array(256).map((r,n)=>e(t[n])),n=r.map(h),i=n.map(h),o=i.map(h),s=new Uint32Array(65536),a=new Uint32Array(65536),c=new Uint16Array(65536);for(let e=0;e<256;e++)for(let u=0;u<256;u++){const l=256*e+u;s[l]=r[e]^n[u],a[l]=i[e]^o[u],c[l]=t[e]<<8|t[u]}return{sbox:t,sbox2:c,T0:r,T1:n,T2:i,T3:o,T01:s,T23:a}}const y=p(u,t=>c(t,3)<<24|t<<16|t<<8|c(t,2)),g=p(l,t=>c(t,11)<<24|c(t,13)<<16|c(t,9)<<8|c(t,14)),m=(()=>{const t=new Uint8Array(16);for(let e=0,r=1;e<16;e++,r=a(r))t[e]=r;return t})();function _(t){(0,i.abytes)(t);const e=t.length;if(![16,24,32].includes(e))throw new Error("aes: invalid key size, should be 16, 24 or 32, got "+e);const{sbox2:r}=y,n=[];(0,i.isAligned32)(t)||n.push(t=(0,i.copyBytes)(t));const o=(0,i.u32)(t),s=o.length,a=t=>w(r,t,t,t,t),c=new Uint32Array(e+28);c.set(o);for(let t=s;t<c.length;t++){let e=c[t-1];t%s===0?e=a(d(e))^m[t/s-1]:s>6&&t%s===4&&(e=a(e)),c[t]=c[t-s]^e}return(0,i.clean)(...n),c}function b(t){const e=_(t),r=e.slice(),n=e.length,{sbox2:o}=y,{T0:s,T1:a,T2:c,T3:u}=g;for(let t=0;t<n;t+=4)for(let i=0;i<4;i++)r[t+i]=e[n-t-4+i];(0,i.clean)(e);for(let t=4;t<n-4;t++){const e=r[t],n=w(o,e,e,e,e);r[t]=s[255&n]^a[n>>>8&255]^c[n>>>16&255]^u[n>>>24]}return r}function v(t,e,r,n,i,o){return t[r<<8&65280|n>>>8&255]^e[i>>>8&65280|o>>>24&255]}function w(t,e,r,n,i){return t[255&e|65280&r]|t[n>>>16&255|i>>>16&65280]<<16}function B(t,e,r,n,i){const{sbox2:o,T01:s,T23:a}=y;let c=0;e^=t[c++],r^=t[c++],n^=t[c++],i^=t[c++];const u=t.length/4-2;for(let o=0;o<u;o++){const o=t[c++]^v(s,a,e,r,n,i),u=t[c++]^v(s,a,r,n,i,e),l=t[c++]^v(s,a,n,i,e,r),d=t[c++]^v(s,a,i,e,r,n);e=o,r=u,n=l,i=d}return{s0:t[c++]^w(o,e,r,n,i),s1:t[c++]^w(o,r,n,i,e),s2:t[c++]^w(o,n,i,e,r),s3:t[c++]^w(o,i,e,r,n)}}function A(t,e,r,n,i){const{sbox2:o,T01:s,T23:a}=g;let c=0;e^=t[c++],r^=t[c++],n^=t[c++],i^=t[c++];const u=t.length/4-2;for(let o=0;o<u;o++){const o=t[c++]^v(s,a,e,i,n,r),u=t[c++]^v(s,a,r,e,i,n),l=t[c++]^v(s,a,n,r,e,i),d=t[c++]^v(s,a,i,n,r,e);e=o,r=u,n=l,i=d}return{s0:t[c++]^w(o,e,i,n,r),s1:t[c++]^w(o,r,e,i,n),s2:t[c++]^w(o,n,r,e,i),s3:t[c++]^w(o,i,n,r,e)}}function E(t,e,r,n){(0,i.abytes)(e,o),(0,i.abytes)(r);const s=r.length;n=(0,i.getOutput)(s,n),(0,i.complexOverlapBytes)(r,n);const a=e,c=(0,i.u32)(a);let{s0:u,s1:l,s2:d,s3:h}=B(t,c[0],c[1],c[2],c[3]);const f=(0,i.u32)(r),p=(0,i.u32)(n);for(let e=0;e+4<=f.length;e+=4){p[e+0]=f[e+0]^u,p[e+1]=f[e+1]^l,p[e+2]=f[e+2]^d,p[e+3]=f[e+3]^h;let r=1;for(let t=a.length-1;t>=0;t--)r=r+(255&a[t])|0,a[t]=255&r,r>>>=8;({s0:u,s1:l,s2:d,s3:h}=B(t,c[0],c[1],c[2],c[3]))}const y=o*Math.floor(f.length/4);if(y<s){const t=new Uint32Array([u,l,d,h]),e=(0,i.u8)(t);for(let t=y,i=0;t<s;t++,i++)n[t]=r[t]^e[i];(0,i.clean)(t)}return n}function S(t,e,r,n,s){(0,i.abytes)(r,o),(0,i.abytes)(n),s=(0,i.getOutput)(n.length,s);const a=r,c=(0,i.u32)(a),u=(0,i.createView)(a),l=(0,i.u32)(n),d=(0,i.u32)(s),h=e?0:12,f=n.length;let p=u.getUint32(h,e),{s0:y,s1:g,s2:m,s3:_}=B(t,c[0],c[1],c[2],c[3]);for(let r=0;r+4<=l.length;r+=4)d[r+0]=l[r+0]^y,d[r+1]=l[r+1]^g,d[r+2]=l[r+2]^m,d[r+3]=l[r+3]^_,p=p+1>>>0,u.setUint32(h,p,e),({s0:y,s1:g,s2:m,s3:_}=B(t,c[0],c[1],c[2],c[3]));const b=o*Math.floor(l.length/4);if(b<f){const t=new Uint32Array([y,g,m,_]),e=(0,i.u8)(t);for(let t=b,r=0;t<f;t++,r++)s[t]=n[t]^e[r];(0,i.clean)(t)}return s}function I(t){if((0,i.abytes)(t),t.length%o!==0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size 16")}function x(t,e,r){(0,i.abytes)(t);let n=t.length;const s=n%o;if(!e&&0!==s)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");(0,i.isAligned32)(t)||(t=(0,i.copyBytes)(t));const a=(0,i.u32)(t);if(e){let t=o-s;t||(t=o),n+=t}r=(0,i.getOutput)(n,r),(0,i.complexOverlapBytes)(t,r);return{b:a,o:(0,i.u32)(r),out:r}}function L(t,e){if(!e)return t;const r=t.length;if(!r)throw new Error("aes/pcks5: empty ciphertext not allowed");const n=t[r-1];if(n<=0||n>16)throw new Error("aes/pcks5: wrong padding");const i=t.subarray(0,-n);for(let e=0;e<n;e++)if(t[r-e-1]!==n)throw new Error("aes/pcks5: wrong padding");return i}function k(t){const e=new Uint8Array(16),r=(0,i.u32)(e);e.set(t);const n=o-t.length;for(let t=o-n;t<o;t++)e[t]=n;return r}function O(t,e,r,n,o){const s=o?o.length:0,a=t.create(r,n.length+s);o&&a.update(o);const c=(0,i.u64Lengths)(8*n.length,8*s,e);a.update(n),a.update(c);const u=a.digest();return(0,i.clean)(c),u}e.ctr=(0,i.wrapCipher)({blockSize:16,nonceLength:16},function(t,e){function r(r,n){if((0,i.abytes)(r),void 0!==n&&((0,i.abytes)(n),!(0,i.isAligned32)(n)))throw new Error("unaligned destination");const o=_(t),s=(0,i.copyBytes)(e),a=[o,s];(0,i.isAligned32)(r)||a.push(r=(0,i.copyBytes)(r));const c=E(o,s,r,n);return(0,i.clean)(...a),c}return{encrypt:(t,e)=>r(t,e),decrypt:(t,e)=>r(t,e)}}),e.ecb=(0,i.wrapCipher)({blockSize:16},function(t,e={}){const r=!e.disablePadding;return{encrypt(e,n){const{b:o,o:s,out:a}=x(e,r,n),c=_(t);let u=0;for(;u+4<=o.length;){const{s0:t,s1:e,s2:r,s3:n}=B(c,o[u+0],o[u+1],o[u+2],o[u+3]);s[u++]=t,s[u++]=e,s[u++]=r,s[u++]=n}if(r){const t=k(e.subarray(4*u)),{s0:r,s1:n,s2:i,s3:o}=B(c,t[0],t[1],t[2],t[3]);s[u++]=r,s[u++]=n,s[u++]=i,s[u++]=o}return(0,i.clean)(c),a},decrypt(e,n){I(e);const o=b(t);n=(0,i.getOutput)(e.length,n);const s=[o];(0,i.isAligned32)(e)||s.push(e=(0,i.copyBytes)(e)),(0,i.complexOverlapBytes)(e,n);const a=(0,i.u32)(e),c=(0,i.u32)(n);for(let t=0;t+4<=a.length;){const{s0:e,s1:r,s2:n,s3:i}=A(o,a[t+0],a[t+1],a[t+2],a[t+3]);c[t++]=e,c[t++]=r,c[t++]=n,c[t++]=i}return(0,i.clean)(...s),L(n,r)}}}),e.cbc=(0,i.wrapCipher)({blockSize:16,nonceLength:16},function(t,e,r={}){const n=!r.disablePadding;return{encrypt(r,o){const s=_(t),{b:a,o:c,out:u}=x(r,n,o);let l=e;const d=[s];(0,i.isAligned32)(l)||d.push(l=(0,i.copyBytes)(l));const h=(0,i.u32)(l);let f=h[0],p=h[1],y=h[2],g=h[3],m=0;for(;m+4<=a.length;)f^=a[m+0],p^=a[m+1],y^=a[m+2],g^=a[m+3],({s0:f,s1:p,s2:y,s3:g}=B(s,f,p,y,g)),c[m++]=f,c[m++]=p,c[m++]=y,c[m++]=g;if(n){const t=k(r.subarray(4*m));f^=t[0],p^=t[1],y^=t[2],g^=t[3],({s0:f,s1:p,s2:y,s3:g}=B(s,f,p,y,g)),c[m++]=f,c[m++]=p,c[m++]=y,c[m++]=g}return(0,i.clean)(...d),u},decrypt(r,o){I(r);const s=b(t);let a=e;const c=[s];(0,i.isAligned32)(a)||c.push(a=(0,i.copyBytes)(a));const u=(0,i.u32)(a);o=(0,i.getOutput)(r.length,o),(0,i.isAligned32)(r)||c.push(r=(0,i.copyBytes)(r)),(0,i.complexOverlapBytes)(r,o);const l=(0,i.u32)(r),d=(0,i.u32)(o);let h=u[0],f=u[1],p=u[2],y=u[3];for(let t=0;t+4<=l.length;){const e=h,r=f,n=p,i=y;h=l[t+0],f=l[t+1],p=l[t+2],y=l[t+3];const{s0:o,s1:a,s2:c,s3:u}=A(s,h,f,p,y);d[t++]=o^e,d[t++]=a^r,d[t++]=c^n,d[t++]=u^i}return(0,i.clean)(...c),L(o,n)}}}),e.cfb=(0,i.wrapCipher)({blockSize:16,nonceLength:16},function(t,e){function r(r,n,s){(0,i.abytes)(r);const a=r.length;if(s=(0,i.getOutput)(a,s),(0,i.overlapBytes)(r,s))throw new Error("overlapping src and dst not supported.");const c=_(t);let u=e;const l=[c];(0,i.isAligned32)(u)||l.push(u=(0,i.copyBytes)(u)),(0,i.isAligned32)(r)||l.push(r=(0,i.copyBytes)(r));const d=(0,i.u32)(r),h=(0,i.u32)(s),f=n?h:d,p=(0,i.u32)(u);let y=p[0],g=p[1],m=p[2],b=p[3];for(let t=0;t+4<=d.length;){const{s0:e,s1:r,s2:n,s3:i}=B(c,y,g,m,b);h[t+0]=d[t+0]^e,h[t+1]=d[t+1]^r,h[t+2]=d[t+2]^n,h[t+3]=d[t+3]^i,y=f[t++],g=f[t++],m=f[t++],b=f[t++]}const v=o*Math.floor(d.length/4);if(v<a){({s0:y,s1:g,s2:m,s3:b}=B(c,y,g,m,b));const t=(0,i.u8)(new Uint32Array([y,g,m,b]));for(let e=v,n=0;e<a;e++,n++)s[e]=r[e]^t[n];(0,i.clean)(t)}return(0,i.clean)(...l),s}return{encrypt:(t,e)=>r(t,!0,e),decrypt:(t,e)=>r(t,!1,e)}}),e.gcm=(0,i.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(t,e,r){if(e.length<8)throw new Error("aes/gcm: invalid nonce length");function o(t,e,i){const o=O(n.ghash,!1,t,i,r);for(let t=0;t<e.length;t++)o[t]^=e[t];return o}function a(){const r=_(t),o=s.slice(),a=s.slice();if(S(r,!1,a,a,o),12===e.length)a.set(e);else{const t=s.slice(),r=(0,i.createView)(t);(0,i.setBigUint64)(r,8,BigInt(8*e.length),!1);const c=n.ghash.create(o).update(e).update(t);c.digestInto(a),c.destroy()}return{xk:r,authKey:o,counter:a,tagMask:S(r,!1,a,s)}}return{encrypt(t){const{xk:e,authKey:r,counter:n,tagMask:s}=a(),c=new Uint8Array(t.length+16),u=[e,r,n,s];(0,i.isAligned32)(t)||u.push(t=(0,i.copyBytes)(t)),S(e,!1,n,t,c.subarray(0,t.length));const l=o(r,s,c.subarray(0,c.length-16));return u.push(l),c.set(l,t.length),(0,i.clean)(...u),c},decrypt(t){const{xk:e,authKey:r,counter:n,tagMask:s}=a(),c=[e,r,s,n];(0,i.isAligned32)(t)||c.push(t=(0,i.copyBytes)(t));const u=t.subarray(0,-16),l=t.subarray(-16),d=o(r,s,u);if(c.push(d),!(0,i.equalBytes)(d,l))throw new Error("aes/gcm: invalid ghash tag");const h=S(e,!1,n,u);return(0,i.clean)(...c),h}}});const C=(t,e,r)=>n=>{if(!Number.isSafeInteger(n)||e>n||n>r){throw new Error(t+": expected value in range "+("["+e+".."+r+"]")+", got "+n)}};function T(t){return t instanceof Uint32Array||ArrayBuffer.isView(t)&&"Uint32Array"===t.constructor.name}function P(t,e){if((0,i.abytes)(e,16),!T(t))throw new Error("_encryptBlock accepts result of expandKeyLE");const r=(0,i.u32)(e);let{s0:n,s1:o,s2:s,s3:a}=B(t,r[0],r[1],r[2],r[3]);return r[0]=n,r[1]=o,r[2]=s,r[3]=a,e}function F(t,e){if((0,i.abytes)(e,16),!T(t))throw new Error("_decryptBlock accepts result of expandKeyLE");const r=(0,i.u32)(e);let{s0:n,s1:o,s2:s,s3:a}=A(t,r[0],r[1],r[2],r[3]);return r[0]=n,r[1]=o,r[2]=s,r[3]=a,e}e.gcmsiv=(0,i.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(t,e,r){const o=C("AAD",0,2**36),s=C("plaintext",0,2**36),a=C("nonce",12,12),c=C("ciphertext",16,2**36+16);function u(){const r=_(t),n=new Uint8Array(t.length),o=new Uint8Array(16),s=[r,n];let a=e;(0,i.isAligned32)(a)||s.push(a=(0,i.copyBytes)(a));const c=(0,i.u32)(a);let u=0,l=c[0],d=c[1],h=c[2],f=0;for(const t of[o,n].map(i.u32)){const e=(0,i.u32)(t);for(let t=0;t<e.length;t+=2){const{s0:n,s1:i}=B(r,u,l,d,h);e[t+0]=n,e[t+1]=i,u=++f}}const p={authKey:o,encKey:_(n)};return(0,i.clean)(...s),p}function l(t,o,s){const a=O(n.polyval,!0,o,s,r);for(let t=0;t<12;t++)a[t]^=e[t];a[15]&=127;const c=(0,i.u32)(a);let u=c[0],l=c[1],d=c[2],h=c[3];return({s0:u,s1:l,s2:d,s3:h}=B(t,u,l,d,h)),c[0]=u,c[1]=l,c[2]=d,c[3]=h,a}function d(t,e,r){let n=(0,i.copyBytes)(e);n[15]|=128;const o=S(t,!0,n,r);return(0,i.clean)(n),o}return(0,i.abytes)(t,16,24,32),a(e.length),void 0!==r&&o(r.length),{encrypt(t){s(t.length);const{encKey:e,authKey:r}=u(),n=l(e,r,t),o=[e,r,n];(0,i.isAligned32)(t)||o.push(t=(0,i.copyBytes)(t));const a=new Uint8Array(t.length+16);return a.set(n,t.length),a.set(d(e,n,t)),(0,i.clean)(...o),a},decrypt(t){c(t.length);const e=t.subarray(-16),{encKey:r,authKey:n}=u(),o=[r,n];(0,i.isAligned32)(t)||o.push(t=(0,i.copyBytes)(t));const s=d(r,e,t.subarray(0,-16)),a=l(r,n,s);if(o.push(a),!(0,i.equalBytes)(e,a))throw(0,i.clean)(...o),new Error("invalid polyval tag");return(0,i.clean)(...o),s}}}),e.siv=e.gcmsiv;const R={encrypt(t,e){if(e.length>=2**32)throw new Error("plaintext should be less than 4gb");const r=_(t);if(16===e.length)P(r,e);else{const t=(0,i.u32)(e);let n=t[0],o=t[1];for(let e=0,i=1;e<6;e++)for(let e=2;e<t.length;e+=2,i++){const{s0:s,s1:a,s2:c,s3:u}=B(r,n,o,t[e],t[e+1]);n=s,o=a^f(i),t[e]=c,t[e+1]=u}t[0]=n,t[1]=o}r.fill(0)},decrypt(t,e){if(e.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");const r=b(t),n=e.length/8-1;if(1===n)F(r,e);else{const t=(0,i.u32)(e);let o=t[0],s=t[1];for(let e=0,i=6*n;e<6;e++)for(let e=2*n;e>=1;e-=2,i--){s^=f(i);const{s0:n,s1:a,s2:c,s3:u}=A(r,o,s,t[e],t[e+1]);o=n,s=a,t[e]=c,t[e+1]=u}t[0]=o,t[1]=s}r.fill(0)}},M=new Uint8Array(8).fill(166);e.aeskw=(0,i.wrapCipher)({blockSize:8},t=>({encrypt(e){if(!e.length||e.length%8!=0)throw new Error("invalid plaintext length");if(8===e.length)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");const r=(0,i.concatBytes)(M,e);return R.encrypt(t,r),r},decrypt(e){if(e.length%8!=0||e.length<24)throw new Error("invalid ciphertext length");const r=(0,i.copyBytes)(e);if(R.decrypt(t,r),!(0,i.equalBytes)(r.subarray(0,8),M))throw new Error("integrity check failed");return r.subarray(0,8).fill(0),r.subarray(8)}}));const H=2790873510;e.aeskwp=(0,i.wrapCipher)({blockSize:8},t=>({encrypt(e){if(!e.length)throw new Error("invalid plaintext length");const r=8*Math.ceil(e.length/8),n=new Uint8Array(8+r);n.set(e,8);const o=(0,i.u32)(n);return o[0]=H,o[1]=f(e.length),R.encrypt(t,n),n},decrypt(e){if(e.length<16)throw new Error("invalid ciphertext length");const r=(0,i.copyBytes)(e),n=(0,i.u32)(r);R.decrypt(t,r);const o=f(n[1])>>>0,s=8*Math.ceil(o/8);if(n[0]!==H||r.length-8!==s)throw new Error("integrity check failed");for(let t=o;t<s;t++)if(0!==r[8+t])throw new Error("integrity check failed");return r.subarray(0,8).fill(0),r.subarray(8,8+o)}})),e.unsafe={expandKeyLE:_,expandKeyDecLE:b,encrypt:B,decrypt:A,encryptBlock:P,decryptBlock:F,ctrCounter:E,ctr32:S}},520:(t,e,r)=>{"use strict";r.d(e,{z:()=>i});var n=r(1682);class i{_container;_anchor;_theme;constructor(t){this._theme=t.theme?t.theme:"default"}onAdd(t){return this._container=(0,n.r)("div","maplibregl-ctrl mapxus-ctrl-attribution",t.getContainer()),this._anchor=(0,n.r)("a","mapxus-attribution",this._container),this._anchor.target="_blank",this._setCopyrightInfo(this._theme),this._anchor.setAttribute("aria-label","Mapxus attribution"),this._anchor.setAttribute("rel","noopener"),this._container.appendChild(this._anchor),this._container}onRemove(){(0,n.Z)(this._container)}getDefaultPosition(){return"bottom-right"}changeTheme(t){this._setCopyrightInfo(t)}_setCopyrightInfo(t){this._anchor.innerText="landsD"===t?"© The Government of the Hong Kong SAR":"©Mapxus driven by Kawasaki ©OpenStreetMap contributors","landsD"===t&&(this._anchor.href="https://www.map.gov.hk/gm/")}}},549:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(5547);const i=function(t,e){var r=(0,n.A)(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}},608:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(6632);const i=function(t){var e=(0,n.A)(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}},640:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n,i=r(3161),o=(n=/[^.]+$/.exec(i.A&&i.A.keys&&i.A.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";const s=function(t){return!!o&&o in t}},674:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=(0,r(702).A)(Object,"create")},702:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(1979),i=r(8104);const o=function(t,e){var r=(0,i.A)(t,e);return(0,n.A)(r)?r:void 0}},759:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(3265),i=r(1038);const o=function(t,e,r,o){var s=r.length,a=s,c=!o;if(null==t)return!a;for(t=Object(t);s--;){var u=r[s];if(c&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++s<a;){var l=(u=r[s])[0],d=t[l],h=u[1];if(c&&u[2]){if(void 0===d&&!(l in t))return!1}else{var f=new n.A;if(o)var p=o(d,h,l,t,e,f);if(!(void 0===p?(0,i.A)(h,d,3,o,f):p))return!1}}return!0}},805:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return function(e){return null==e?void 0:e[t]}}},853:(t,e,r)=>{"use strict";async function n(t,e){if(!t.hasImage(e))try{const r=await t.loadImage(e);t.addImage(e,r.data)}catch(t){throw new Error(t)}}r.d(e,{K:()=>n})},901:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(1882);const i=function(t){if("string"==typeof t||(0,n.A)(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},1031:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(169);const i=function(t,e){var r=this.__data__,i=(0,n.A)(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}},1038:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(3244),i=r(3098);const o=function t(e,r,o,s,a){return e===r||(null==e||null==r||!(0,i.A)(e)&&!(0,i.A)(r)?e!=e&&r!=r:(0,n.A)(e,r,o,s,t,a))}},1052:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(1917);const i=function(){return n.A.Date.now()}},1088:(t,e,r)=>{"use strict";r.d(e,{B6:()=>s.B,CA:()=>i.C,EJ:()=>n.E,Nj:()=>o.N});var n=r(2468),i=r(9644),o=r(9205),s=r(6294)},1089:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n={value:()=>{}};function i(){for(var t,e=0,r=arguments.length,n={};e<r;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new o(n)}function o(t){this._=t}function s(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function a(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=n,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}o.prototype=i.prototype={constructor:o,on:function(t,e){var r,n,i=this._,o=(n=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),c=-1,u=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++c<u;)if(r=(t=o[c]).type)i[r]=a(i[r],t.name,e);else if(null==e)for(r in i)i[r]=a(i[r],t.name,null);return this}for(;++c<u;)if((r=(t=o[c]).type)&&(r=s(i[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new o(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),o=0;o<r;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,r=(n=this._[t]).length;o<r;++o)n[o].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,o=n.length;i<o;++i)n[i].value.apply(e,r)}};const c=i},1121:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=Function.prototype.toString;const i=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},1210:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.poly1305=void 0,e.wrapConstructorWithKey=s;const n=r(6527),i=(t,e)=>255&t[e++]|(255&t[e++])<<8;class o{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=(0,n.toBytes)(t),(0,n.abytes)(t,32);const e=i(t,0),r=i(t,2),o=i(t,4),s=i(t,6),a=i(t,8),c=i(t,10),u=i(t,12),l=i(t,14);this.r[0]=8191&e,this.r[1]=8191&(e>>>13|r<<3),this.r[2]=7939&(r>>>10|o<<6),this.r[3]=8191&(o>>>7|s<<9),this.r[4]=255&(s>>>4|a<<12),this.r[5]=a>>>1&8190,this.r[6]=8191&(a>>>14|c<<2),this.r[7]=8065&(c>>>11|u<<5),this.r[8]=8191&(u>>>8|l<<8),this.r[9]=l>>>5&127;for(let e=0;e<8;e++)this.pad[e]=i(t,16+2*e)}process(t,e,r=!1){const n=r?0:2048,{h:o,r:s}=this,a=s[0],c=s[1],u=s[2],l=s[3],d=s[4],h=s[5],f=s[6],p=s[7],y=s[8],g=s[9],m=i(t,e+0),_=i(t,e+2),b=i(t,e+4),v=i(t,e+6),w=i(t,e+8),B=i(t,e+10),A=i(t,e+12),E=i(t,e+14);let S=o[0]+(8191&m),I=o[1]+(8191&(m>>>13|_<<3)),x=o[2]+(8191&(_>>>10|b<<6)),L=o[3]+(8191&(b>>>7|v<<9)),k=o[4]+(8191&(v>>>4|w<<12)),O=o[5]+(w>>>1&8191),C=o[6]+(8191&(w>>>14|B<<2)),T=o[7]+(8191&(B>>>11|A<<5)),P=o[8]+(8191&(A>>>8|E<<8)),F=o[9]+(E>>>5|n),R=0,M=R+S*a+I*(5*g)+x*(5*y)+L*(5*p)+k*(5*f);R=M>>>13,M&=8191,M+=O*(5*h)+C*(5*d)+T*(5*l)+P*(5*u)+F*(5*c),R+=M>>>13,M&=8191;let H=R+S*c+I*a+x*(5*g)+L*(5*y)+k*(5*p);R=H>>>13,H&=8191,H+=O*(5*f)+C*(5*h)+T*(5*d)+P*(5*l)+F*(5*u),R+=H>>>13,H&=8191;let U=R+S*u+I*c+x*a+L*(5*g)+k*(5*y);R=U>>>13,U&=8191,U+=O*(5*p)+C*(5*f)+T*(5*h)+P*(5*d)+F*(5*l),R+=U>>>13,U&=8191;let V=R+S*l+I*u+x*c+L*a+k*(5*g);R=V>>>13,V&=8191,V+=O*(5*y)+C*(5*p)+T*(5*f)+P*(5*h)+F*(5*d),R+=V>>>13,V&=8191;let j=R+S*d+I*l+x*u+L*c+k*a;R=j>>>13,j&=8191,j+=O*(5*g)+C*(5*y)+T*(5*p)+P*(5*f)+F*(5*h),R+=j>>>13,j&=8191;let N=R+S*h+I*d+x*l+L*u+k*c;R=N>>>13,N&=8191,N+=O*a+C*(5*g)+T*(5*y)+P*(5*p)+F*(5*f),R+=N>>>13,N&=8191;let D=R+S*f+I*h+x*d+L*l+k*u;R=D>>>13,D&=8191,D+=O*c+C*a+T*(5*g)+P*(5*y)+F*(5*p),R+=D>>>13,D&=8191;let $=R+S*p+I*f+x*h+L*d+k*l;R=$>>>13,$&=8191,$+=O*u+C*c+T*a+P*(5*g)+F*(5*y),R+=$>>>13,$&=8191;let z=R+S*y+I*p+x*f+L*h+k*d;R=z>>>13,z&=8191,z+=O*l+C*u+T*c+P*a+F*(5*g),R+=z>>>13,z&=8191;let G=R+S*g+I*y+x*p+L*f+k*h;R=G>>>13,G&=8191,G+=O*d+C*l+T*u+P*c+F*a,R+=G>>>13,G&=8191,R=(R<<2)+R|0,R=R+M|0,M=8191&R,R>>>=13,H+=R,o[0]=M,o[1]=H,o[2]=U,o[3]=V,o[4]=j,o[5]=N,o[6]=D,o[7]=$,o[8]=z,o[9]=G}finalize(){const{h:t,pad:e}=this,r=new Uint16Array(10);let i=t[1]>>>13;t[1]&=8191;for(let e=2;e<10;e++)t[e]+=i,i=t[e]>>>13,t[e]&=8191;t[0]+=5*i,i=t[0]>>>13,t[0]&=8191,t[1]+=i,i=t[1]>>>13,t[1]&=8191,t[2]+=i,r[0]=t[0]+5,i=r[0]>>>13,r[0]&=8191;for(let e=1;e<10;e++)r[e]=t[e]+i,i=r[e]>>>13,r[e]&=8191;r[9]-=8192;let o=(1^i)-1;for(let t=0;t<10;t++)r[t]&=o;o=~o;for(let e=0;e<10;e++)t[e]=t[e]&o|r[e];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let s=t[0]+e[0];t[0]=65535&s;for(let r=1;r<8;r++)s=(t[r]+e[r]|0)+(s>>>16)|0,t[r]=65535&s;(0,n.clean)(r)}update(t){(0,n.aexists)(this),t=(0,n.toBytes)(t),(0,n.abytes)(t);const{buffer:e,blockLen:r}=this,i=t.length;for(let n=0;n<i;){const o=Math.min(r-this.pos,i-n);if(o!==r)e.set(t.subarray(n,n+o),this.pos),this.pos+=o,n+=o,this.pos===r&&(this.process(e,0,!1),this.pos=0);else for(;r<=i-n;n+=r)this.process(t,n)}return this}destroy(){(0,n.clean)(this.h,this.r,this.buffer,this.pad)}digestInto(t){(0,n.aexists)(this),(0,n.aoutput)(t,this),this.finished=!0;const{buffer:e,h:r}=this;let{pos:i}=this;if(i){for(e[i++]=1;i<16;i++)e[i]=0;this.process(e,0,!0)}this.finalize();let o=0;for(let e=0;e<8;e++)t[o++]=r[e]>>>0,t[o++]=r[e]>>>8;return t}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}}function s(t){const e=(e,r)=>t(r).update((0,n.toBytes)(e)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}e.poly1305=s(t=>new o(t))},1275:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(5917),i=r(5668),o=r(9875);function s(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n.A;++e<r;)this.add(t[e])}s.prototype.add=s.prototype.push=i.A,s.prototype.has=o.A;const a=s},1470:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(5572),i=r(2141),o=r(9084),s=r(3973);const a=function(t,e){if(null==t)return{};var r=(0,n.A)((0,s.A)(t),function(t){return[t]});return e=(0,i.A)(e),(0,o.A)(t,r,function(t,r){return e(t,r[0])})}},1472:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(3454),i=r(8776),o=r(9313);const s=function(t,e,r){return e=(0,i.A)(e),void 0===r?(r=e,e=0):r=(0,i.A)(r),t=(0,o.A)(t),(0,n.A)(t,e,r)}},1493:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},1521:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(5547);const i=function(t){return(0,n.A)(this,t).get(t)}},1532:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(7919);const i=function(){this.__data__=new n.A,this.size=0}},1635:(t,e,r)=>{"use strict";r.d(e,{Cl:()=>n,YH:()=>o,fX:()=>s,sH:()=>i});var n=function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};function i(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(s,a)}c((n=n.apply(t,e||[])).next())})}function o(t,e){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}Object.create;function s(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}Object.create;"function"==typeof SuppressedError&&SuppressedError},1666:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AEAD_TAG_LENGTH=e.XCHACHA20_NONCE_LENGTH=e.CURVE25519_PUBLIC_KEY_SIZE=e.ETH_PUBLIC_KEY_SIZE=e.UNCOMPRESSED_PUBLIC_KEY_SIZE=e.COMPRESSED_PUBLIC_KEY_SIZE=e.SECRET_KEY_LENGTH=void 0,e.SECRET_KEY_LENGTH=32,e.COMPRESSED_PUBLIC_KEY_SIZE=33,e.UNCOMPRESSED_PUBLIC_KEY_SIZE=65,e.ETH_PUBLIC_KEY_SIZE=64,e.CURVE25519_PUBLIC_KEY_SIZE=32,e.XCHACHA20_NONCE_LENGTH=24,e.AEAD_TAG_LENGTH=16},1682:(t,e,r)=>{"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}function i(t,e,r){const n=document.createElement(t);return e&&(n.className=e),r&&r.appendChild(n),n}r.d(e,{Z:()=>n,r:()=>i})},1694:(t,e,r)=>{"use strict";r.d(e,{F0:()=>l,F2:()=>c,pT:()=>a,qT:()=>u,xW:()=>d});var n=r(4545);const i=new n.H$,o=new n.w1,s=new n.FR;async function a(t){try{return(await i.searchByIds(t)).data.result.buildings[0]}catch(t){throw t}}async function c(t){try{const e=(await i.searchByFloorId(t)).data.result.buildings[0].buildingId;return await a(e)}catch(t){throw t}}async function u(t){try{return(await o.searchByIds(t)).data.result.venues[0]}catch(t){throw t}}async function l(t){try{return(await o.searchBySharedFloorId(t)).data.result.venues[0]}catch(t){throw t}}async function d(t){try{return(await s.searchByIds([t])).data.result.pois[0]}catch(t){throw t}}},1705:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DER=e.DERErr=void 0,e._legacyHelperEquat=p,e._legacyHelperNormPriv=y,e.weierstrassN=g,e.weierstrassPoints=function(t){const{CURVE:e,curveOpts:r}=b(t),n=g(e,r);return function(t,e){const{Fp:r,Fn:n}=e;function o(t){return(0,i.inRange)(t,l,n.ORDER)}const s=p(r,t.a,t.b),a=y(n,t.allowedPrivateKeyLengths,t.wrapPrivateKey);return Object.assign({},{CURVE:t,Point:e,ProjectivePoint:e,normPrivateKeyToScalar:a,weierstrassEquation:s,isWithinCurveOrder:o})}(t,n)},e.ecdsa=_,e.weierstrass=function(t){const{CURVE:e,curveOpts:r,ecdsaOpts:n}=function(t){const{CURVE:e,curveOpts:r}=b(t),n={hash:t.hash,hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:r,ecdsaOpts:n}}(t),i=_(g(e,r),n,r);return function(t,e){return Object.assign({},e,{ProjectivePoint:e.Point,CURVE:t})}(t,i)},e.SWUFpSqrtRatio=v,e.mapToCurveSimpleSWU=function(t,e){(0,s.validateField)(t);const{A:r,B:n,Z:i}=e;if(!t.isValid(r)||!t.isValid(n)||!t.isValid(i))throw new Error("mapToCurveSimpleSWU: invalid opts");const o=v(t,i);if(!t.isOdd)throw new Error("Field does not have .isOdd()");return e=>{let a,c,u,l,d,h,f,p;a=t.sqr(e),a=t.mul(a,i),c=t.sqr(a),c=t.add(c,a),u=t.add(c,t.ONE),u=t.mul(u,n),l=t.cmov(i,t.neg(c),!t.eql(c,t.ZERO)),l=t.mul(l,r),c=t.sqr(u),h=t.sqr(l),d=t.mul(h,r),c=t.add(c,d),c=t.mul(c,u),h=t.mul(h,l),d=t.mul(h,n),c=t.add(c,d),f=t.mul(a,u);const{isValid:y,value:g}=o(c,h);p=t.mul(a,e),p=t.mul(p,g),f=t.cmov(f,u,y),p=t.cmov(p,g,y);const m=t.isOdd(e)===t.isOdd(p);p=t.cmov(t.neg(p),p,m);const _=(0,s.FpInvertBatch)(t,[l],!0)[0];return f=t.mul(f,_),{x:f,y:p}}};const n=r(9615),i=r(8627),o=r(2422),s=r(4967);function a(t){void 0!==t.lowS&&(0,i.abool)("lowS",t.lowS),void 0!==t.prehash&&(0,i.abool)("prehash",t.prehash)}class c extends Error{constructor(t=""){super(t)}}e.DERErr=c,e.DER={Err:c,_tlv:{encode:(t,r)=>{const{Err:n}=e.DER;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(1&r.length)throw new n("tlv.encode: unpadded data");const o=r.length/2,s=(0,i.numberToHexUnpadded)(o);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const a=o>127?(0,i.numberToHexUnpadded)(s.length/2|128):"";return(0,i.numberToHexUnpadded)(t)+a+s+r},decode(t,r){const{Err:n}=e.DER;let i=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(r.length<2||r[i++]!==t)throw new n("tlv.decode: wrong tlv");const o=r[i++];let s=0;if(!!(128&o)){const t=127&o;if(!t)throw new n("tlv.decode(long): indefinite length not supported");if(t>4)throw new n("tlv.decode(long): byte length is too big");const e=r.subarray(i,i+t);if(e.length!==t)throw new n("tlv.decode: length bytes not complete");if(0===e[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of e)s=s<<8|t;if(i+=t,s<128)throw new n("tlv.decode(long): not minimal encoding")}else s=o;const a=r.subarray(i,i+s);if(a.length!==s)throw new n("tlv.decode: wrong value length");return{v:a,l:r.subarray(i+s)}}},_int:{encode(t){const{Err:r}=e.DER;if(t<u)throw new r("integer: negative integers are not allowed");let n=(0,i.numberToHexUnpadded)(t);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new r("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:r}=e.DER;if(128&t[0])throw new r("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new r("invalid signature integer: unnecessary leading zero");return(0,i.bytesToNumberBE)(t)}},toSig(t){const{Err:r,_int:n,_tlv:o}=e.DER,s=(0,i.ensureBytes)("signature",t),{v:a,l:c}=o.decode(48,s);if(c.length)throw new r("invalid signature: left bytes after parsing");const{v:u,l}=o.decode(2,a),{v:d,l:h}=o.decode(2,l);if(h.length)throw new r("invalid signature: left bytes after parsing");return{r:n.decode(u),s:n.decode(d)}},hexFromSig(t){const{_tlv:r,_int:n}=e.DER,i=r.encode(2,n.encode(t.r))+r.encode(2,n.encode(t.s));return r.encode(48,i)}};const u=BigInt(0),l=BigInt(1),d=BigInt(2),h=BigInt(3),f=BigInt(4);function p(t,e,r){return function(n){const i=t.sqr(n),o=t.mul(i,n);return t.add(t.add(o,t.mul(n,e)),r)}}function y(t,e,r){const{BYTES:n}=t;return function(o){let s;if("bigint"==typeof o)s=o;else{let r=(0,i.ensureBytes)("private key",o);if(e){if(!e.includes(2*r.length))throw new Error("invalid private key");const t=new Uint8Array(n);t.set(r,t.length-r.length),r=t}try{s=t.fromBytes(r)}catch(t){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof o}`)}}if(r&&(s=t.create(s)),!t.isValidNot0(s))throw new Error("invalid private key: out of range [1..N-1]");return s}}function g(t,e={}){const{Fp:r,Fn:n}=(0,o._createCurveFields)("weierstrass",t,e),{h:s,n:a}=t;(0,i._validateObject)(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=e;if(c&&(!r.is0(t.a)||"bigint"!=typeof c.beta||"function"!=typeof c.splitScalar))throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');function d(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const g=e.toBytes||function(t,e,n){const{x:o,y:s}=e.toAffine(),a=r.toBytes(o);if((0,i.abool)("isCompressed",n),n){d();const t=!r.isOdd(s);return(0,i.concatBytes)(m(t),a)}return(0,i.concatBytes)(Uint8Array.of(4),a,r.toBytes(s))},_=e.fromBytes||function(t){(0,i.abytes)(t);const e=r.BYTES,n=e+1,o=2*e+1,s=t.length,a=t[0],c=t.subarray(1);if(s!==n||2!==a&&3!==a){if(s===o&&4===a){const t=r.fromBytes(c.subarray(0*e,1*e)),n=r.fromBytes(c.subarray(1*e,2*e));if(!v(t,n))throw new Error("bad point: is not on curve");return{x:t,y:n}}throw new Error(`bad point: got length ${s}, expected compressed=${n} or uncompressed=${o}`)}{const t=r.fromBytes(c);if(!r.isValid(t))throw new Error("bad point: is not on curve, wrong x");const e=b(t);let n;try{n=r.sqrt(e)}catch(t){const e=t instanceof Error?": "+t.message:"";throw new Error("bad point: is not on curve, sqrt error"+e)}d();return!(1&~a)!==r.isOdd(n)&&(n=r.neg(n)),{x:t,y:n}}},b=p(r,t.a,t.b);function v(t,e){const n=r.sqr(e),i=b(t);return r.eql(n,i)}if(!v(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const w=r.mul(r.pow(t.a,h),f),B=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(w,B)))throw new Error("bad curve params: a or b");function A(t,e,n=!1){if(!r.isValid(e)||n&&r.is0(e))throw new Error(`bad point coordinate ${t}`);return e}function E(t){if(!(t instanceof L))throw new Error("ProjectivePoint expected")}const S=(0,i.memoized)((t,e)=>{const{px:n,py:i,pz:o}=t;if(r.eql(o,r.ONE))return{x:n,y:i};const s=t.is0();null==e&&(e=s?r.ONE:r.inv(o));const a=r.mul(n,e),c=r.mul(i,e),u=r.mul(o,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),I=(0,i.memoized)(t=>{if(t.is0()){if(e.allowInfinityPoint&&!r.is0(t.py))return;throw new Error("bad point: ZERO")}const{x:n,y:i}=t.toAffine();if(!r.isValid(n)||!r.isValid(i))throw new Error("bad point: x or y not field elements");if(!v(n,i))throw new Error("bad point: equation left != right");if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function x(t,e,n,i,s){return n=new L(r.mul(n.px,t),n.py,n.pz),e=(0,o.negateCt)(i,e),n=(0,o.negateCt)(s,n),e.add(n)}class L{constructor(t,e,r){this.px=A("x",t),this.py=A("y",e,!0),this.pz=A("z",r),Object.freeze(this)}static fromAffine(t){const{x:e,y:n}=t||{};if(!t||!r.isValid(e)||!r.isValid(n))throw new Error("invalid affine point");if(t instanceof L)throw new Error("projective point not allowed");return r.is0(e)&&r.is0(n)?L.ZERO:new L(e,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){return(0,o.normalizeZ)(L,"pz",t)}static fromBytes(t){return(0,i.abytes)(t),L.fromHex(t)}static fromHex(t){const e=L.fromAffine(_((0,i.ensureBytes)("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){const r=y(n,e.allowedPrivateKeyLengths,e.wrapPrivateKey);return L.BASE.multiply(r(t))}static msm(t,e){return(0,o.pippenger)(L,n,t,e)}precompute(t=8,e=!0){return O.setWindowSize(this,t),e||this.multiply(h),this}_setWindowSize(t){this.precompute(t)}assertValidity(){I(this)}hasEvenY(){const{y:t}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(t)}equals(t){E(t);const{px:e,py:n,pz:i}=this,{px:o,py:s,pz:a}=t,c=r.eql(r.mul(e,a),r.mul(o,i)),u=r.eql(r.mul(n,a),r.mul(s,i));return c&&u}negate(){return new L(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,i=r.mul(n,h),{px:o,py:s,pz:a}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,d=r.mul(o,o),f=r.mul(s,s),p=r.mul(a,a),y=r.mul(o,s);return y=r.add(y,y),l=r.mul(o,a),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,p),u=r.add(c,u),c=r.sub(f,u),u=r.add(f,u),u=r.mul(c,u),c=r.mul(y,c),l=r.mul(i,l),p=r.mul(e,p),y=r.sub(d,p),y=r.mul(e,y),y=r.add(y,l),l=r.add(d,d),d=r.add(l,d),d=r.add(d,p),d=r.mul(d,y),u=r.add(u,d),p=r.mul(s,a),p=r.add(p,p),d=r.mul(p,y),c=r.sub(c,d),l=r.mul(p,f),l=r.add(l,l),l=r.add(l,l),new L(c,u,l)}add(e){E(e);const{px:n,py:i,pz:o}=this,{px:s,py:a,pz:c}=e;let u=r.ZERO,l=r.ZERO,d=r.ZERO;const f=t.a,p=r.mul(t.b,h);let y=r.mul(n,s),g=r.mul(i,a),m=r.mul(o,c),_=r.add(n,i),b=r.add(s,a);_=r.mul(_,b),b=r.add(y,g),_=r.sub(_,b),b=r.add(n,o);let v=r.add(s,c);return b=r.mul(b,v),v=r.add(y,m),b=r.sub(b,v),v=r.add(i,o),u=r.add(a,c),v=r.mul(v,u),u=r.add(g,m),v=r.sub(v,u),d=r.mul(f,b),u=r.mul(p,m),d=r.add(u,d),u=r.sub(g,d),d=r.add(g,d),l=r.mul(u,d),g=r.add(y,y),g=r.add(g,y),m=r.mul(f,m),b=r.mul(p,b),g=r.add(g,m),m=r.sub(y,m),m=r.mul(f,m),b=r.add(b,m),y=r.mul(g,b),l=r.add(l,y),y=r.mul(v,b),u=r.mul(_,u),u=r.sub(u,y),y=r.mul(_,g),d=r.mul(v,d),d=r.add(d,y),new L(u,l,d)}subtract(t){return this.add(t.negate())}is0(){return this.equals(L.ZERO)}multiply(t){const{endo:r}=e;if(!n.isValidNot0(t))throw new Error("invalid scalar: out of range");let i,o;const s=t=>O.wNAFCached(this,t,L.normalizeZ);if(r){const{k1neg:e,k1:n,k2neg:a,k2:c}=r.splitScalar(t),{p:u,f:l}=s(n),{p:d,f:h}=s(c);o=l.add(h),i=x(r.beta,u,d,e,a)}else{const{p:e,f:r}=s(t);i=e,o=r}return L.normalizeZ([i,o])[0]}multiplyUnsafe(t){const{endo:r}=e,i=this;if(!n.isValid(t))throw new Error("invalid scalar: out of range");if(t===u||i.is0())return L.ZERO;if(t===l)return i;if(O.hasPrecomputes(this))return this.multiply(t);if(r){const{k1neg:e,k1:n,k2neg:s,k2:a}=r.splitScalar(t),{p1:c,p2:u}=(0,o.mulEndoUnsafe)(L,i,n,a);return x(r.beta,c,u,e,s)}return O.wNAFCachedUnsafe(i,t)}multiplyAndAddUnsafe(t,e,r){const n=this.multiplyUnsafe(e).add(t.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(t){return S(this,t)}isTorsionFree(){const{isTorsionFree:t}=e;return s===l||(t?t(L,this):O.wNAFCachedUnsafe(this,a).is0())}clearCofactor(){const{clearCofactor:t}=e;return s===l?this:t?t(L,this):this.multiplyUnsafe(s)}toBytes(t=!0){return(0,i.abool)("isCompressed",t),this.assertValidity(),g(L,this,t)}toRawBytes(t=!0){return this.toBytes(t)}toHex(t=!0){return(0,i.bytesToHex)(this.toBytes(t))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}L.BASE=new L(t.Gx,t.Gy,r.ONE),L.ZERO=new L(r.ZERO,r.ONE,r.ZERO),L.Fp=r,L.Fn=n;const k=n.BITS,O=(0,o.wNAF)(L,e.endo?Math.ceil(k/2):k);return L}function m(t){return Uint8Array.of(t?2:3)}function _(t,r,o={}){(0,i._validateObject)(r,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const c=r.randomBytes||i.randomBytes,h=r.hmac||((t,...e)=>(0,n.hmac)(r.hash,t,(0,i.concatBytes)(...e))),{Fp:f,Fn:p}=t,{ORDER:g,BITS:_}=p;function b(t){return t>g>>l}function v(t,e){if(!p.isValidNot0(e))throw new Error(`invalid signature ${t}: out of range 1..CURVE.n`)}class w{constructor(t,e,r){v("r",t),v("s",e),this.r=t,this.s=e,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(t){const e=p.BYTES,r=(0,i.ensureBytes)("compactSignature",t,2*e);return new w(p.fromBytes(r.subarray(0,e)),p.fromBytes(r.subarray(e,2*e)))}static fromDER(t){const{r,s:n}=e.DER.toSig((0,i.ensureBytes)("DER",t));return new w(r,n)}assertValidity(){}addRecoveryBit(t){return new w(this.r,this.s,t)}recoverPublicKey(e){const r=f.ORDER,{r:n,s:o,recovery:s}=this;if(null==s||![0,1,2,3].includes(s))throw new Error("recovery id invalid");if(g*d<r&&s>1)throw new Error("recovery id is ambiguous for h>1 curve");const a=2===s||3===s?n+g:n;if(!f.isValid(a))throw new Error("recovery id 2 or 3 invalid");const c=f.toBytes(a),u=t.fromHex((0,i.concatBytes)(m(!(1&s)),c)),l=p.inv(a),h=I((0,i.ensureBytes)("msgHash",e)),y=p.create(-h*l),_=p.create(o*l),b=t.BASE.multiplyUnsafe(y).add(u.multiplyUnsafe(_));if(b.is0())throw new Error("point at infinify");return b.assertValidity(),b}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new w(this.r,p.neg(this.s),this.recovery):this}toBytes(t){if("compact"===t)return(0,i.concatBytes)(p.toBytes(this.r),p.toBytes(this.s));if("der"===t)return(0,i.hexToBytes)(e.DER.hexFromSig(this));throw new Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,i.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,i.bytesToHex)(this.toBytes("compact"))}}const B=y(p,o.allowedPrivateKeyLengths,o.wrapPrivateKey),A={isValidPrivateKey(t){try{return B(t),!0}catch(t){return!1}},normPrivateKeyToScalar:B,randomPrivateKey:()=>{const t=g;return(0,s.mapHashToField)(c((0,s.getMinHashLength)(t)),t)},precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)};function E(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;const r=(0,i.ensureBytes)("key",e).length,n=f.BYTES,s=n+1,a=2*n+1;return o.allowedPrivateKeyLengths||p.BYTES===s?void 0:r===s||r===a}const S=r.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const e=(0,i.bytesToNumberBE)(t),r=8*t.length-_;return r>0?e>>BigInt(r):e},I=r.bits2int_modN||function(t){return p.create(S(t))},x=(0,i.bitMask)(_);function L(t){return(0,i.aInRange)("num < 2^"+_,t,u,x),p.toBytes(t)}function k(e,n,o=O){if(["recovered","canonical"].some(t=>t in o))throw new Error("sign() legacy options not supported");const{hash:s}=r;let{lowS:d,prehash:h,extraEntropy:y}=o;null==d&&(d=!0),e=(0,i.ensureBytes)("msgHash",e),a(o),h&&(e=(0,i.ensureBytes)("prehashed msgHash",s(e)));const g=I(e),m=B(n),_=[L(m),L(g)];if(null!=y&&!1!==y){const t=!0===y?c(f.BYTES):y;_.push((0,i.ensureBytes)("extraEntropy",t))}const v=(0,i.concatBytes)(..._),A=g;return{seed:v,k2sig:function(e){const r=S(e);if(!p.isValidNot0(r))return;const n=p.inv(r),i=t.BASE.multiply(r).toAffine(),o=p.create(i.x);if(o===u)return;const s=p.create(n*p.create(A+o*m));if(s===u)return;let a=(i.x===o?0:2)|Number(i.y&l),c=s;return d&&b(s)&&(c=function(t){return b(t)?p.neg(t):t}(s),a^=1),new w(o,c,a)}}}const O={lowS:r.lowS,prehash:!1},C={lowS:r.lowS,prehash:!1};return t.BASE.precompute(8),Object.freeze({getPublicKey:function(e,r=!0){return t.fromPrivateKey(e).toBytes(r)},getSharedSecret:function(e,r,n=!0){if(!0===E(e))throw new Error("first arg must be private key");if(!1===E(r))throw new Error("second arg must be public key");return t.fromHex(r).multiply(B(e)).toBytes(n)},sign:function(t,e,n=O){const{seed:o,k2sig:s}=k(t,e,n);return(0,i.createHmacDrbg)(r.hash.outputLen,p.BYTES,h)(o,s)},verify:function(n,o,s,c=C){const u=n;o=(0,i.ensureBytes)("msgHash",o),s=(0,i.ensureBytes)("publicKey",s),a(c);const{lowS:l,prehash:d,format:h}=c;if("strict"in c)throw new Error("options.strict was renamed to lowS");if(void 0!==h&&!["compact","der","js"].includes(h))throw new Error('format must be "compact", "der" or "js"');const f="string"==typeof u||(0,i.isBytes)(u),y=!f&&!h&&"object"==typeof u&&null!==u&&"bigint"==typeof u.r&&"bigint"==typeof u.s;if(!f&&!y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let g,m;try{if(y){if(void 0!==h&&"js"!==h)throw new Error("invalid format");g=new w(u.r,u.s)}if(f){try{"compact"!==h&&(g=w.fromDER(u))}catch(t){if(!(t instanceof e.DER.Err))throw t}g||"der"===h||(g=w.fromCompact(u))}m=t.fromHex(s)}catch(t){return!1}if(!g)return!1;if(l&&g.hasHighS())return!1;d&&(o=r.hash(o));const{r:_,s:b}=g,v=I(o),B=p.inv(b),A=p.create(v*B),E=p.create(_*B),S=t.BASE.multiplyUnsafe(A).add(m.multiplyUnsafe(E));return!S.is0()&&p.create(S.x)===_},utils:A,Point:t,Signature:w})}function b(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy};return{CURVE:e,curveOpts:{Fp:t.Fp,Fn:(0,s.Field)(e.n,t.nBitLength),allowedPrivateKeyLengths:t.allowedPrivateKeyLengths,allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,wrapPrivateKey:t.wrapPrivateKey,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes}}}function v(t,e){const r=t.ORDER;let n=u;for(let t=r-l;t%d===u;t/=d)n+=l;const i=n,o=d<<i-l-l,s=o*d,a=(r-l)/s,c=(a-l)/d,p=s-l,y=o,g=t.pow(e,a),m=t.pow(e,(a+l)/d);let _=(e,r)=>{let n=g,o=t.pow(r,p),s=t.sqr(o);s=t.mul(s,r);let a=t.mul(e,s);a=t.pow(a,c),a=t.mul(a,o),o=t.mul(a,r),s=t.mul(a,e);let u=t.mul(s,o);a=t.pow(u,y);let h=t.eql(a,t.ONE);o=t.mul(s,m),a=t.mul(u,n),s=t.cmov(o,s,h),u=t.cmov(a,u,h);for(let e=i;e>l;e--){let r=e-d;r=d<<r-l;let i=t.pow(u,r);const a=t.eql(i,t.ONE);o=t.mul(s,n),n=t.mul(n,n),i=t.mul(u,n),s=t.cmov(o,s,a),u=t.cmov(i,u,a)}return{isValid:h,value:s}};if(t.ORDER%f===h){const r=(t.ORDER-h)/f,n=t.sqrt(t.neg(e));_=(e,i)=>{let o=t.sqr(i);const s=t.mul(e,i);o=t.mul(o,s);let a=t.pow(o,r);a=t.mul(a,s);const c=t.mul(a,n),u=t.mul(t.sqr(a),i),l=t.eql(u,e);return{isValid:l,value:t.cmov(c,a,l)}}}return _}},1761:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.expand_message_xmd=u,e.expand_message_xof=l,e.hash_to_field=d,e.isogenyMap=function(t,e){const r=e.map(t=>Array.from(t).reverse());return(e,n)=>{const[o,s,a,c]=r.map(r=>r.reduce((r,n)=>t.add(t.mul(r,e),n))),[u,l]=(0,i.FpInvertBatch)(t,[s,c],!0);return e=t.mul(o,u),n=t.mul(n,t.mul(a,l)),{x:e,y:n}}},e.createHasher=function(t,e,r){if("function"!=typeof e)throw new Error("mapToCurve() must be defined");function n(r){return t.fromAffine(e(r))}function i(e){const r=e.clearCofactor();return r.equals(t.ZERO)?t.ZERO:(r.assertValidity(),r)}return{defaults:r,hashToCurve(t,e){const o=r.DST?r.DST:{},s=d(t,2,Object.assign({},r,o,e)),a=n(s[0]),c=n(s[1]);return i(a.add(c))},encodeToCurve(t,e){const o=r.encodeDST?r.encodeDST:{};return i(n(d(t,1,Object.assign({},r,o,e))[0]))},mapToCurve(t){if(!Array.isArray(t))throw new Error("expected array of bigints");for(const e of t)if("bigint"!=typeof e)throw new Error("expected array of bigints");return i(n(t))}}};const n=r(8627),i=r(4967),o=n.bytesToNumberBE;function s(t,e){if(c(t),c(e),t<0||t>=1<<8*e)throw new Error("invalid I2OSP input: "+t);const r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=255&t,t>>>=8;return new Uint8Array(r)}function a(t,e){const r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}function c(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function u(t,e,r,i){(0,n.abytes)(t),(0,n.abytes)(e),c(r),e.length>255&&(e=i((0,n.concatBytes)((0,n.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));const{outputLen:o,blockLen:u}=i,l=Math.ceil(r/o);if(r>65535||l>255)throw new Error("expand_message_xmd: invalid lenInBytes");const d=(0,n.concatBytes)(e,s(e.length,1)),h=s(0,u),f=s(r,2),p=new Array(l),y=i((0,n.concatBytes)(h,t,f,s(0,1),d));p[0]=i((0,n.concatBytes)(y,s(1,1),d));for(let t=1;t<=l;t++){const e=[a(y,p[t-1]),s(t+1,1),d];p[t]=i((0,n.concatBytes)(...e))}return(0,n.concatBytes)(...p).slice(0,r)}function l(t,e,r,i,o){if((0,n.abytes)(t),(0,n.abytes)(e),c(r),e.length>255){const t=Math.ceil(2*i/8);e=o.create({dkLen:t}).update((0,n.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(t).update(s(r,2)).update(e).update(s(e.length,1)).digest()}function d(t,e,r){(0,n._validateObject)(r,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:s,k:a,m:d,hash:h,expand:f,DST:p}=r;if(!(0,n.isBytes)(p)&&"string"!=typeof p)throw new Error("DST must be string or uint8array");if(!(0,n.isHash)(r.hash))throw new Error("expected valid hash");(0,n.abytes)(t),c(e);const y="string"==typeof p?(0,n.utf8ToBytes)(p):p,g=s.toString(2).length,m=Math.ceil((g+a)/8),_=e*d*m;let b;if("xmd"===f)b=u(t,y,_,h);else if("xof"===f)b=l(t,y,_,a,h);else{if("_internal_pass"!==f)throw new Error('expand must be "xmd" or "xof"');b=t}const v=new Array(e);for(let t=0;t<e;t++){const e=new Array(d);for(let r=0;r<d;r++){const n=m*(r+t*d),a=b.subarray(n,n+m);e[r]=(0,i.mod)(o(a),s)}v[t]=e}return v}},1788:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(4846),i=r(3098),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable;const c=(0,n.A)(function(){return arguments}())?n.A:function(t){return(0,i.A)(t)&&s.call(t,"callee")&&!a.call(t,"callee")}},1865:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(423),i=r(8823),o=r(8446);const s=function(t){return(0,o.A)(t)?(0,n.A)(t,!0):(0,i.A)(t)}},1882:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(9672),i=r(3098);const o=function(t){return"symbol"==typeof t||(0,i.A)(t)&&"[object Symbol]"==(0,n.A)(t)}},1917:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(2136),i="object"==typeof self&&self&&self.Object===Object&&self;const o=n.A||i||Function("return this")()},1965:(t,e,r)=>{"use strict";r.d(e,{FI:()=>n,TU:()=>i,Zj:()=>o});const n="reserve_mapxus-level-fill",i="reserve_mapxus-shared-level-fill",o="reserve_mapxus-building-fill"},1979:(t,e,r)=>{"use strict";r.d(e,{A:()=>f});var n=r(9610),i=r(640),o=r(3149),s=r(1121),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,d=u.hasOwnProperty,h=RegExp("^"+l.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const f=function(t){return!(!(0,o.A)(t)||(0,i.A)(t))&&((0,n.A)(t)?h:a).test((0,s.A)(t))}},2049:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=Array.isArray},2068:(t,e,r)=>{"use strict";r.d(e,{K:()=>a});var n=r(2742),i=r.n(n),o=r(9588);const s=r(7311).o.getInstance();class a{static instance;_axios;_isRefreshingToken=!1;_retryCount=0;constructor(){this._axios=i().create({baseURL:o.hl}),this._setupInterceptors()}static getInstance(){return a.instance||(a.instance=new a),a.instance}async get(t){return this._axios.get(t)}async post(t,e){return this._axios.post(t,e)}async getRequestHeaders(){return{"Content-Type":"application/json",sdkVersion:s.getSdkVersion(),identifier:await s.getIdentifier(),token:await s.getAccessToken()}}_setupInterceptors(){this._axios.interceptors.request.use(async t=>{const e=await this.getRequestHeaders();return t.headers=Object.assign({},t.headers,e),t},t=>{throw t}),this._axios.interceptors.response.use(null,async t=>{if(401!==t.response?.status||this._retryCount>=3)throw this._retryCount=0,t;if(this._isRefreshingToken)throw t;s.getGlobalDispatcher().call("unauthorized"),this._isRefreshingToken=!0,this._retryCount++;try{const e=await this.getRequestHeaders(),r=t.config;return r.headers=Object.assign({},r.headers,e),this._axios.request(r)}catch(t){throw t}finally{this._isRefreshingToken=!1}})}}},2075:(t,e,r)=>{"use strict";r.d(e,{$b:()=>h,Hf:()=>d,_C:()=>s,aS:()=>f,em:()=>l,lu:()=>a,ts:()=>c,xR:()=>u});var n=r(9588);const i="v3";function o(t){return`${n.hl}/api/${i}/tiles/styles/${t}`}const s=o("christmas_mims2_v1"),a=o("common_mims2_v1"),c=o("halloween_mims2_v1"),u=o("mappybee_mims2_v1"),l=o("mapxus_mims2_v1"),d=o("lands_d_mims2_v1"),h=o("mapxus_v7");function f(t){return o(t)}},2136:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n="object"==typeof global&&global&&global.Object===Object&&global},2141:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(4943),i=r(6474),o=r(9008),s=r(2049),a=r(2263);const c=function(t){return"function"==typeof t?t:null==t?o.A:"object"==typeof t?(0,s.A)(t)?(0,i.A)(t[0],t[1]):(0,n.A)(t):(0,a.A)(t)}},2158:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(9378),e),i(r(244),e),i(r(3503),e),i(r(7757),e)},2199:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(6318);const i=function(t){return function(e){return(0,n.A)(e,t)}}},2263:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(805),i=r(2199),o=r(6586),s=r(901);const a=function(t){return(0,o.A)(t)?(0,n.A)((0,s.A)(t)):(0,i.A)(t)}},2302:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(){}},2318:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toBig=e.shrSL=e.shrSH=e.rotrSL=e.rotrSH=e.rotrBL=e.rotrBH=e.rotr32L=e.rotr32H=e.rotlSL=e.rotlSH=e.rotlBL=e.rotlBH=e.add5L=e.add5H=e.add4L=e.add4H=e.add3L=e.add3H=void 0,e.add=b,e.fromBig=i,e.split=o;const r=BigInt(2**32-1),n=BigInt(32);function i(t,e=!1){return e?{h:Number(t&r),l:Number(t>>n&r)}:{h:0|Number(t>>n&r),l:0|Number(t&r)}}function o(t,e=!1){const r=t.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){const{h:r,l:a}=i(t[s],e);[n[s],o[s]]=[r,a]}return[n,o]}const s=(t,e)=>BigInt(t>>>0)<<n|BigInt(e>>>0);e.toBig=s;const a=(t,e,r)=>t>>>r;e.shrSH=a;const c=(t,e,r)=>t<<32-r|e>>>r;e.shrSL=c;const u=(t,e,r)=>t>>>r|e<<32-r;e.rotrSH=u;const l=(t,e,r)=>t<<32-r|e>>>r;e.rotrSL=l;const d=(t,e,r)=>t<<64-r|e>>>r-32;e.rotrBH=d;const h=(t,e,r)=>t>>>r-32|e<<64-r;e.rotrBL=h;const f=(t,e)=>e;e.rotr32H=f;const p=(t,e)=>t;e.rotr32L=p;const y=(t,e,r)=>t<<r|e>>>32-r;e.rotlSH=y;const g=(t,e,r)=>e<<r|t>>>32-r;e.rotlSL=g;const m=(t,e,r)=>e<<r-32|t>>>64-r;e.rotlBH=m;const _=(t,e,r)=>t<<r-32|e>>>64-r;function b(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:0|i}}e.rotlBL=_;const v=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);e.add3L=v;const w=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;e.add3H=w;const B=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);e.add4L=B;const A=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0;e.add4H=A;const E=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0);e.add5L=E;const S=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0;e.add5H=S;const I={fromBig:i,split:o,toBig:s,shrSH:a,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:d,rotrBL:h,rotr32H:f,rotr32L:p,rotlSH:y,rotlSL:g,rotlBH:m,rotlBL:_,add:b,add3L:v,add3H:w,add4L:B,add4H:A,add5H:S,add5L:E};e.default=I},2384:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(169),i=Array.prototype.splice;const o=function(t){var e=this.__data__,r=(0,n.A)(e,t);return!(r<0)&&(r==e.length-1?e.pop():i.call(e,r,1),--this.size,!0)}},2422:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.negateCt=a,e.normalizeZ=function(t,e,r){const n="pz"===e?t=>t.pz:t=>t.ez,o=(0,i.FpInvertBatch)(t.Fp,r.map(n));return r.map((t,e)=>t.toAffine(o[e])).map(t.fromAffine)},e.wNAF=function(t,e){return{constTimeNegate:a,hasPrecomputes:t=>1!==y(t),unsafeLadder(e,r,n=t.ZERO){let i=e;for(;r>o;)r&s&&(n=n.add(i)),i=i.double(),r>>=s;return n},precomputeWindow(t,r){const{windows:n,windowSize:i}=u(r,e),o=[];let s=t,a=s;for(let t=0;t<n;t++){a=s,o.push(a);for(let t=1;t<i;t++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(r,n,i){let o=t.ZERO,s=t.BASE;const c=u(r,e);for(let t=0;t<c.windows;t++){const{nextN:e,offset:r,isZero:u,isNeg:d,isNegF:h,offsetF:f}=l(i,t,c);i=e,u?s=s.add(a(h,n[f])):o=o.add(a(d,n[r]))}return g(i),{p:o,f:s}},wNAFUnsafe(r,n,i,s=t.ZERO){const a=u(r,e);for(let t=0;t<a.windows&&i!==o;t++){const{nextN:e,offset:r,isZero:o,isNeg:c}=l(i,t,a);if(i=e,!o){const t=n[r];s=s.add(c?t.negate():t)}}return g(i),s},getPrecomputes(t,e,r){let n=f.get(e);return n||(n=this.precomputeWindow(e,t),1!==t&&("function"==typeof r&&(n=r(n)),f.set(e,n))),n},wNAFCached(t,e,r){const n=y(t);return this.wNAF(n,this.getPrecomputes(n,t,r),e)},wNAFCachedUnsafe(t,e,r,n){const i=y(t);return 1===i?this.unsafeLadder(t,e,n):this.wNAFUnsafe(i,this.getPrecomputes(i,t,r),e,n)},setWindowSize(t,r){c(r,e),p.set(t,r),f.delete(t)}}},e.mulEndoUnsafe=function(t,e,r,n){let i=e,a=t.ZERO,c=t.ZERO;for(;r>o||n>o;)r&s&&(a=a.add(i)),n&s&&(c=c.add(i)),i=i.double(),r>>=s,n>>=s;return{p1:a,p2:c}},e.pippenger=function(t,e,r,i){d(r,t),h(i,e);const o=r.length,s=i.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const a=t.ZERO,c=(0,n.bitLen)(BigInt(o));let u=1;c>12?u=c-3:c>4?u=c-2:c>0&&(u=2);const l=(0,n.bitMask)(u),f=new Array(Number(l)+1).fill(a),p=Math.floor((e.BITS-1)/u)*u;let y=a;for(let t=p;t>=0;t-=u){f.fill(a);for(let e=0;e<s;e++){const n=i[e],o=Number(n>>BigInt(t)&l);f[o]=f[o].add(r[e])}let e=a;for(let t=f.length-1,r=a;t>0;t--)r=r.add(f[t]),e=e.add(r);if(y=y.add(e),0!==t)for(let t=0;t<u;t++)y=y.double()}return y},e.precomputeMSMUnsafe=function(t,e,r,i){c(i,e.BITS),d(r,t);const o=t.ZERO,s=2**i-1,a=Math.ceil(e.BITS/i),u=(0,n.bitMask)(i),l=r.map(t=>{const e=[];for(let r=0,n=t;r<s;r++)e.push(n),n=n.add(t);return e});return t=>{if(h(t,e),t.length>r.length)throw new Error("array of scalars must be smaller than array of points");let n=o;for(let e=0;e<a;e++){if(n!==o)for(let t=0;t<i;t++)n=n.double();const r=BigInt(a*i-(e+1)*i);for(let e=0;e<t.length;e++){const i=t[e],o=Number(i>>r&u);o&&(n=n.add(l[e][o-1]))}}return n}},e.validateBasic=function(t){return(0,i.validateField)(t.Fp),(0,n.validateObject)(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,i.nLength)(t.n,t.nBitLength),...t,p:t.Fp.ORDER})},e._createCurveFields=function(t,e,r={}){if(!e||"object"!=typeof e)throw new Error(`expected valid ${t} CURVE object`);for(const t of["p","n","h"]){const r=e[t];if(!("bigint"==typeof r&&r>o))throw new Error(`CURVE.${t} must be positive bigint`)}const n=m(e.p,r.Fp),i=m(e.n,r.Fn),s=["Gx","Gy","a","weierstrass"===t?"b":"d"];for(const t of s)if(!n.isValid(e[t]))throw new Error(`CURVE.${t} must be valid field element of CURVE.Fp`);return{Fp:n,Fn:i}};const n=r(8627),i=r(4967),o=BigInt(0),s=BigInt(1);function a(t,e){const r=e.negate();return t?r:e}function c(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function u(t,e){c(t,e);const r=2**t;return{windows:Math.ceil(e/t)+1,windowSize:2**(t-1),mask:(0,n.bitMask)(t),maxNumber:r,shiftBy:BigInt(t)}}function l(t,e,r){const{windowSize:n,mask:i,maxNumber:o,shiftBy:a}=r;let c=Number(t&i),u=t>>a;c>n&&(c-=o,u+=s);const l=e*n;return{nextN:u,offset:l+Math.abs(c)-1,isZero:0===c,isNeg:c<0,isNegF:e%2!=0,offsetF:l}}function d(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function h(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const f=new WeakMap,p=new WeakMap;function y(t){return p.get(t)||1}function g(t){if(t!==o)throw new Error("invalid wNAF")}function m(t,e){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,i.validateField)(e),e}return(0,i.Field)(t)}},2468:(t,e,r)=>{"use strict";r.d(e,{E:()=>n});class n{_buildingSelector;_isEnabled=!0;_position;constructor(t){this._buildingSelector=t}enable(){this._isEnabled=!0,this._buildingSelector.enabled||this._buildingSelector.setVisibility(!0)}disable(){this._isEnabled=!1,this._buildingSelector.enabled&&this._buildingSelector.setVisibility(!1)}setPosition(t,e){this._position=t,this._buildingSelector.changePosition(this._buildingSelector.position,t,e)}get isEnabled(){return this._isEnabled}get position(){return this._position}}},2506:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rotl=function(t,e){return t<<e|t>>>32-e},e.createCipher=function(t,e){const{allowShortKeys:r,extendNonceFn:i,counterLength:o,counterRight:s,rounds:p}=(0,n.checkOpts)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if("function"!=typeof t)throw new Error("core must be a function");return(0,n.anumber)(o),(0,n.anumber)(p),(0,n.abool)(s),(0,n.abool)(r),(e,y,g,m,_=0)=>{(0,n.abytes)(e),(0,n.abytes)(y),(0,n.abytes)(g);const b=g.length;if(void 0===m&&(m=new Uint8Array(b)),(0,n.abytes)(m),(0,n.anumber)(_),_<0||_>=h)throw new Error("arx: counter overflow");if(m.length<b)throw new Error(`arx: output (${m.length}) is shorter than data (${b})`);const v=[];let w,B,A=e.length;if(32===A)v.push(w=(0,n.copyBytes)(e)),B=c;else{if(16!==A||!r)throw new Error(`arx: invalid 32-byte key, got length=${A}`);w=new Uint8Array(32),w.set(e),w.set(e,16),B=a,v.push(w)}u(y)||v.push(y=(0,n.copyBytes)(y));const E=(0,n.u32)(w);if(i){if(24!==y.length)throw new Error("arx: extended nonce must be 24 bytes");i(B,E,(0,n.u32)(y.subarray(0,16)),E),y=y.subarray(16)}const S=16-o;if(S!==y.length)throw new Error(`arx: nonce must be ${S} or 16 bytes`);if(12!==S){const t=new Uint8Array(12);t.set(y,s?0:12-y.length),y=t,v.push(y)}const I=(0,n.u32)(y);return function(t,e,r,i,o,s,a,c){const p=o.length,y=new Uint8Array(l),g=(0,n.u32)(y),m=u(o)&&u(s),_=m?(0,n.u32)(o):f,b=m?(0,n.u32)(s):f;for(let n=0;n<p;a++){if(t(e,r,i,g,a,c),a>=h)throw new Error("arx: counter overflow");const u=Math.min(l,p-n);if(m&&u===l){const t=n/4;if(n%4!=0)throw new Error("arx: invalid block position");for(let e,r=0;r<d;r++)e=t+r,b[e]=_[e]^g[r];n+=l;continue}for(let t,e=0;e<u;e++)t=n+e,s[t]=o[t]^y[e];n+=u}}(t,B,E,I,g,m,_,p),(0,n.clean)(...v),m}};const n=r(6527),i=t=>Uint8Array.from(t.split("").map(t=>t.charCodeAt(0))),o=i("expand 16-byte k"),s=i("expand 32-byte k"),a=(0,n.u32)(o),c=(0,n.u32)(s);function u(t){return t.byteOffset%4==0}const l=64,d=16,h=2**32-1,f=new Uint32Array},2509:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(5547);const i=function(t){return(0,n.A)(this,t).has(t)}},2528:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(4171);const i=function(t,e,r){"__proto__"==e&&n.A?(0,n.A)(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},2531:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(5707),i=r(6983),o=r(6031);const s=function(t,e,r){return e==e?(0,o.A)(t,e,r):(0,n.A)(t,i.A,r)}},2557:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=void 0;var n=r(6527),i=r(2158),o=function(){function t(t,e){var r=(0,i.convertPublicKeyFormat)(t,!0,e),n=(0,i.convertPublicKeyFormat)(t,!1,e);this.data=r,this.dataUncompressed=r.length!==n.length?n:null}return t.fromHex=function(e,r){return new t((0,i.hexToPublicKey)(e,r),r)},Object.defineProperty(t.prototype,"_uncompressed",{get:function(){return null!==this.dataUncompressed?this.dataUncompressed:this.data},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uncompressed",{get:function(){return Buffer.from(this._uncompressed)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"compressed",{get:function(){return Buffer.from(this.data)},enumerable:!1,configurable:!0}),t.prototype.toBytes=function(t){return void 0===t&&(t=!0),t?this.data:this._uncompressed},t.prototype.toHex=function(t){return void 0===t&&(t=!0),(0,n.bytesToHex)(this.toBytes(t))},t.prototype.decapsulate=function(t,e){void 0===e&&(e=!1);var r=this.toBytes(e),n=t.multiply(this,e);return(0,i.getSharedKey)(r,n)},t.prototype.equals=function(t){return(0,n.equalBytes)(this.data,t.data)},t}();e.PublicKey=o},2559:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(1882);const i=function(t,e,r){for(var i=-1,o=t.length;++i<o;){var s=t[i],a=e(s);if(null!=a&&(void 0===c?a==a&&!(0,n.A)(a):r(a,c)))var c=a,u=s}return u}},2634:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}},2658:(t,e,r)=>{"use strict";r.d(e,{S:()=>i,d:()=>o});let n=[];const i={[Symbol.for("mapxus/callers-register")]:t=>{n=t}};function o(){return n}},2732:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(702),i=r(1917);const o=(0,n.A)(i.A,"DataView")},2742:e=>{"use strict";e.exports=t},2789:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return function(e){return t(e)}}},2801:(t,e,r)=>{"use strict";r.d(e,{w:()=>c});var n=r(2068),i=r(9573),o=r(9588),s=r(6034);const a=["opening_hours","description","phone","website","email","appURL","icon"];class c{_api="/api/v5/venues";_request=n.K.getInstance();constructor(){}searchByIds(t){const e=(0,i.VS)(t);if(!e)throw new Error("Please input venue id at least one.");const r=`${this._api}/${e}`;return this._changedRes(r)}searchByDistance(t){const{center:e,distance:r,keywords:n="",offset:s=o.e$,page:a=o.KL}=t;if(!(0,i.ES)(e))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!(0,i.F5)(r)||r>1e4)throw new Error("Invalid distance parameter. Expected a positive number and no more than 10000.");const c=new URLSearchParams;c.set("center",e.join(",")),c.set("distance",String(r)),c.set("offset",String(s)),c.set("page",String(a)),(0,i.BW)(n)&&c.set("keywords",n);const u=`${this._api}?${c.toString()}`;return this._changedRes(u)}searchByBounds(t){const{keywords:e,bounds:r,offset:n=o.e$,page:s=o.KL}=t;if(!(0,i.dD)(r))throw new Error("'bounds' must be an array of two arrays, each containing two numbers.");const a=new URLSearchParams;a.set("bbox",r.flat().join()),a.set("offset",String(n)),a.set("page",String(s)),(0,i.BW)(e)&&a.set("keywords",e);const c=`${this._api}?${a.toString()}`;return this._changedRes(c)}searchByGlobal(t){const{keywords:e,offset:r=o.e$,page:n=o.KL}=t,s=new URLSearchParams;s.set("offset",String(r)),s.set("page",String(n)),(0,i.BW)(e)&&s.set("keywords",e);const a=`${this._api}?${s.toString()}`;return this._changedRes(a)}searchBySharedFloorId(t){if(!(0,i.BW)(t))throw new Error("Please input correct sharedFloorId.");const e=`${this._api}/shared_floors/${t}`;return this._changedRes(e)}search(t){const e=new URLSearchParams;return Object.entries(t).forEach(([t,r])=>{"bounds"===t?e.set("bbox",r.flat().join()):"center"===t?e.set("center",r.join()):e.set(t,String(r))}),this._changedRes(`${this._api}?${e.toString()}`)}async _changedRes(t){return this._request.get(t).then(t=>{if(t.data?.result?.venues){const e=t.data.result.venues.map(t=>(0,s.A)(t,(t,e)=>a.includes(e)));return{...t,data:{...t.data,result:{...t.data.result,venues:e}}}}return t})}}},2851:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(2528),i=r(6984),o=Object.prototype.hasOwnProperty;const s=function(t,e,r){var s=t[e];o.call(t,e)&&(0,i.A)(s,r)&&(void 0!==r||e in t)||(0,n.A)(t,e,r)}},2854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.montgomery=function(t){const e=(f=t,(0,n._validateObject)(f,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...f})),{P:r,type:c,adjustScalarBytes:u,powPminus2:l,randomBytes:d}=e,h="x25519"===c;var f;if(!h&&"x448"!==c)throw new Error("invalid type");const p=d||n.randomBytes,y=h?255:448,g=h?32:56,m=h?BigInt(9):BigInt(5),_=h?BigInt(121665):BigInt(39081),b=h?a**BigInt(254):a**BigInt(447),v=h?BigInt(8)*a**BigInt(251)-s:BigInt(4)*a**BigInt(445)-s,w=b+v+s,B=t=>(0,i.mod)(t,r),A=E(m);function E(t){return(0,n.numberToBytesLE)(B(t),g)}function S(t,e){const i=function(t,e){(0,n.aInRange)("u",t,o,r),(0,n.aInRange)("scalar",e,b,w);const i=e,a=t;let c=s,u=o,d=t,h=s,f=o;for(let t=BigInt(y-1);t>=o;t--){const e=i>>t&s;f^=e,({x_2:c,x_3:d}=x(f,c,d)),({x_2:u,x_3:h}=x(f,u,h)),f=e;const r=c+u,n=B(r*r),o=c-u,l=B(o*o),p=n-l,y=d+h,g=B((d-h)*r),m=B(y*o),b=g+m,v=g-m;d=B(b*b),h=B(a*B(v*v)),c=B(n*l),u=B(p*(n+B(_*p)))}({x_2:c,x_3:d}=x(f,c,d)),({x_2:u,x_3:h}=x(f,u,h));const p=l(u);return B(c*p)}(function(t){const e=(0,n.ensureBytes)("u coordinate",t,g);return h&&(e[31]&=127),B((0,n.bytesToNumberLE)(e))}(e),function(t){return(0,n.bytesToNumberLE)(u((0,n.ensureBytes)("scalar",t,g)))}(t));if(i===o)throw new Error("invalid private or public key received");return E(i)}function I(t){return S(t,A)}function x(t,e,r){const n=B(t*(e-r));return{x_2:e=B(e-n),x_3:r=B(r+n)}}return{scalarMult:S,scalarMultBase:I,getSharedSecret:(t,e)=>S(t,e),getPublicKey:t=>I(t),utils:{randomPrivateKey:()=>p(g)},GuBytes:A.slice()}};const n=r(8627),i=r(4967),o=BigInt(0),s=BigInt(1),a=BigInt(2)},2944:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(674);const i=function(){this.__data__=n.A?(0,n.A)(null):{},this.size=0}},3061:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return this.__data__.get(t)}},3098:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return null!=t&&"object"==typeof t}},3149:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},3153:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(){return[]}},3161:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=r(1917).A["__core-js_shared__"]},3207:(t,e,r)=>{"use strict";r.d(e,{t:()=>c});var n=r(6568),i=r(8330),o=r(9588),s=r(7007),a=r(3574);class c extends s.EventEmitter{static instance;static platform={sdkVersion:i.rE,identifier:""};_appIds=new Map([[a.en.Access,{}],[a.en.Map,{}]]);_tokenStorage={};_appIdsHistory=[];static getInstance(){return c.instance||(c.instance=new c),c.instance}static setPlatform(t){c.platform=t}updateToken(t){const{appId:e,secret:r,token:n,from:i}=t;this._tokenStorage[e]=n,this._appIds.get(i)[e]=r,this._appIdsHistory.push(e)}deleteToken(t,e){delete this._tokenStorage[t],e&&(delete this._appIds.get(e)[t],this.emit("permission-disconnected",{appId:t,from:e}))}getVersion(){return c.platform.sdkVersion}getToken(t){return this._tokenStorage[t]}async getIdentifier(){if(!c.platform.identifier){const t=await n.Ay.load(),e=await t.get();c.platform.identifier=e.visitorId}return c.platform.identifier}getAppId(t){const e=t?Object.keys(this._appIds.get(t)):[...Object.keys(this._appIds.get(a.en.Access)),...Object.keys(this._appIds.get(a.en.Map))];return this._appIdsHistory.reverse().find(t=>e.includes(t))}async fetchToken(t,e,r=0){try{const r={appId:t,secret:e,..."bundleId"in c.platform?{bundleId:c.platform.bundleId}:"sha1"in c.platform?{sha1:c.platform.sha1,packageName:c.platform.packageName}:{origin:window.location.hostname||"restriction.test.example.com",keyPlatform:"WEB"}},n={"Content-Type":"application/json",sdkVersion:c.platform.sdkVersion,identifier:c.platform.identifier??await this.getIdentifier()},i=await fetch(o.R0,{method:"POST",body:JSON.stringify(r),headers:n});return(await i.json()).result.idToken}catch(n){if(r<3){const n=500*Math.pow(2,r);return console.warn(`Retrying to fetch token in ${n} ms...`,++r),await new Promise(t=>setTimeout(t,n)),this.fetchToken(t,e,r)}throw n}}}},3236:(t,e,r)=>{"use strict";function n(t){const{buildingId:e,labelCenter:{lat:r,lon:n},floors:i,name:o,venueId:s,defaultFloor:a}=t,c=Object.keys(o).map(t=>"default"===t?"name":`name:${t}`),{codes:u,ids:l,ordinals:d}=i.reduce((t,e)=>{const{id:r,code:n,ordinal:i}=e;return{codes:t.codes?`${t.codes},${n}`:n,ids:t.ids?`${t.ids},${r}`:r,ordinals:`${t.ordinals}`?`${t.ordinals},${i}`:`${i}`}},{codes:"",ids:"",ordinals:""});return{layer:{id:"mapxus-building-line"},properties:{building:"yes",id:e,label_center:`${n},${r}`,level_ids:l,level_names:u,ordinals:d,"ref:venue":s,...c,...a?{default_displayed_floor:a}:{}},source:"indoor-planet",sourceLayer:"mapxus_building"}}function i(t){const{address:e,buildings:r,id:n,name:i,type:o,labelCenter:{lon:s,lat:a},defaultBuilding:c,sharedFloors:u}=t,l=Object.entries(e).reduce((t,[e,r])=>Object.assign(t,"default"===e?{"addr:street":r.street,"addr:housenumber":r.housenumber}:{[`addr:street:${e}`]:r.street}),{}),d=Object.keys(i).map(t=>"default"===t?"name":`name:${t}`),h=c?r.find(t=>t.id===c)?.defaultFloor:null,f=c?{default_displayed_building:c,...h?{default_displayed_ordinal:h}:{}}:{},p=u?.length?{shared_level_ids:u.map(({id:t})=>t).join(","),shared_level_ordinals:u.map(({ordinal:t})=>t).join(",")}:{};return{layer:{id:"mapxus-venue-fill"},properties:{...l,...d,id:n,venue:o,label_center:`${s},${a}`,building_ids:r.map(({id:t})=>t).join(),...f,...p},source:"indoor-planet",sourceLayer:"mapxus_venue"}}r.d(e,{E:()=>i,r:()=>n})},3244:(t,e,r)=>{"use strict";r.d(e,{A:()=>y});var n=r(3265),i=r(8967),o=r(402),s=r(7265),a=r(5861),c=r(2049),u=r(4616),l=r(8719),d="[object Arguments]",h="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;const y=function(t,e,r,y,g,m){var _=(0,c.A)(t),b=(0,c.A)(e),v=_?h:(0,a.A)(t),w=b?h:(0,a.A)(e),B=(v=v==d?f:v)==f,A=(w=w==d?f:w)==f,E=v==w;if(E&&(0,u.A)(t)){if(!(0,u.A)(e))return!1;_=!0,B=!1}if(E&&!B)return m||(m=new n.A),_||(0,l.A)(t)?(0,i.A)(t,e,r,y,g,m):(0,o.A)(t,e,v,r,y,g,m);if(!(1&r)){var S=B&&p.call(t,"__wrapped__"),I=A&&p.call(e,"__wrapped__");if(S||I){var x=S?t.value():t,L=I?e.value():e;return m||(m=new n.A),g(x,L,r,y,m)}}return!!E&&(m||(m=new n.A),(0,s.A)(t,e,r,y,g,m))}},3265:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(7919),i=r(1532),o=r(42),s=r(3061),a=r(4105),c=r(7681);function u(t){var e=this.__data__=new n.A(t);this.size=e.size}u.prototype.clear=i.A,u.prototype.delete=o.A,u.prototype.get=s.A,u.prototype.has=a.A,u.prototype.set=c.A;const l=u},3442:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var n=r(5629),i=r(1682),o=r(5056),s=r(1965),a=r(1472),c=r(3549);class u{_container;_indoor;_maplibre;_position="top-right";_buildingId;_floorNames;_ordinals;_ordinal;_style;_$innerFloors;_$activeFloor;_centerSelectorIdx;_lastNormalScrollableIdx;_$arrowBtnUp;_$arrowBtnDown;_maxScrollTop;_$selectorExpanded;_$selectorFolded;_componentDidMount=!1;_visible=!1;_isEnabled;_dragPan;_language;_debounceScroll;_clearScrollEventListener;constructor(t,e){const{style:r,enabled:n=!0,language:i}=e;this._indoor=t,this._language=i,this._style=r?Object.assign({},o.kC,r):o.kC,this._isEnabled=n,this._addIndoorEventListeners()}onAdd(t){return this._maplibre=t,this._addMapMoveEventListener(),this._container=(0,i.r)("div","maplibregl-ctrl mapxus-ctrl-floors hidden"),this._container}onRemove(){this._debounceScroll&&this._debounceScroll.cancel(),this._clearScrollEventListener&&this._clearScrollEventListener(),(0,i.Z)(this._container)}get position(){return this._position}get enabled(){return this._isEnabled}setEnabled(t){this._isEnabled=t,t&&!this._visible&&this._setVisibility(!0),!t&&this._visible&&this._setVisibility(!1)}getDefaultPosition(){return"top-right"}async switchByOrdinal(t,e){this._ordinal=t,this._dragPan=e??!0,await this._indoor.switchFloorByOrdinal(t),this._updateSelectorStatus(t),this._scrollCenterActiveFloor()}changePosition(t,e,r){const n=document.querySelector(`.maplibregl-ctrl-${t}`),i=n.querySelector(".mapxus-ctrl-floors");if(t!==e){this._position=e;const t=document.querySelector(`.maplibregl-ctrl-${e}`);i&&(n.removeChild(i),Number.isFinite(r)?t.insertBefore(i,t.children[r]):t.append(i),this._show(),this._scrollCenterActiveFloor())}else Number.isFinite(r)&&n.children[r]!==i&&(n.removeChild(i),n.insertBefore(i,n.children[r]),this._show(),this._scrollCenterActiveFloor())}setStyle(t){this._style=Object.assign({},this._style,t),this._componentDidMount&&(this._clearFloors(),this._calcSelectorLayout(),this._render(),this._scrollCenterActiveFloor())}_setVisibility(t){this._componentDidMount?t?(this._show(),this._scrollCenterActiveFloor()):this._hide():(this._visible=t,this._indoor.building&&t&&(this._render(),this._show(),this._scrollCenterActiveFloor()))}_addIndoorEventListeners(){this._indoor.on(n.Ms,t=>{if(this._updatePrepared(),!t)return;const{ordinal:e,dragPan:r}=t;this._dragPan=r,"building"in t?this._renderBuildingFloors(t.building,e):this._renderSharedLevelFloor(t)})}_updatePrepared(){this._clearState(),this._visible&&this._hide(),this._componentDidMount&&this._clearFloors()}_renderBuildingFloors(t,e){const{level_names:r,ordinals:n,id:i}=t.properties;this._buildingId=i,this._floorNames=r.split(",").reverse(),this._ordinals=n.split(",").reverse(),this._ordinal=e,this._calcSelectorLayout(),this._render();const o=this._indoor.getFeaturesById(i,{filter:t=>"mapxus-building-line"===t.layer.id})[0];this._checkIfShowFloorSelector(o)}_renderSharedLevelFloor(t){const{name:e,ordinal:r,id:n}=t;this._floorNames=[e[this._language]||e.default],this._ordinals=[r],this._ordinal=r,this._calcSelectorLayout(),this._render();const i=this._indoor.getFeaturesById(n,{layerIds:[s.TU]})[0];this._checkIfShowFloorSelector(i)}_checkIfShowFloorSelector(t){this.enabled&&(!1!==this._dragPan||!1===this._dragPan&&t)&&(this._show(),this._scrollCenterActiveFloor())}_addMapMoveEventListener(){this._maplibre.on("moveend",()=>{if(this.enabled&&!1===this._dragPan&&this._buildingId){this._indoor.getFeaturesById(this._buildingId,{layerIds:["mapxus-building-line"]})[0]?this._componentDidMount?this._visible||(this._show(),this._scrollCenterActiveFloor()):(this._render(),this._show(),this._scrollCenterActiveFloor()):this._componentDidMount&&this._visible&&this._hide()}})}_clearState(){this._buildingId=null,this._floorNames=[],this._ordinals=[],this._ordinal=null}_calcSelectorLayout(){const{itemCount:t,itemSize:e}=this._style;this._centerSelectorIdx=Math.ceil(t/2)-1,this._maxScrollTop=(this._floorNames.length-t)*e,this._lastNormalScrollableIdx=this._floorNames.length-(t-this._centerSelectorIdx-1)-1}_render(){this._createFloors(),this._componentDidMount=!0}_hide(){this._container.classList.add("hidden"),this._visible=!1}_show(){this._container.classList.remove("hidden"),this._visible=!0}_createFloors(){this._$selectorFolded=this._$foldedSelector(this._container,()=>{this._expandSelector(!0),this._scrollCenterActiveFloor()}),this._$selectorExpanded=this._$expandedSelector(this._container,()=>this._expandSelector(!1))}_$expandedSelector(t,e){const{itemSize:r,itemCount:n,defaultFolded:o,backgroundColor:s}=this._style,a=(0,i.r)("div","mapxus-ctrl-floors-expanded "+(o?"hidden":""),t);if(this._floorNames.length>1){(0,i.r)("div","mapxus-ctrl-floors-close",a).onclick=e}const u=(0,i.r)("div","mapxus-ctrl-floors-wrapper",a);return u.style.backgroundColor=s,this._floorNames.length>n&&(this._$arrowBtnUp=this._$createScrollButton(u,"up"),this._$arrowBtnUp.onclick=()=>this._handleScroll("up")),this._$innerFloors=(0,i.r)("div","mapxus-ctrl-floors-inner",u),Object.assign(this._$innerFloors.style,{maxHeight:r*n+"px",width:`${r}px`}),this._$createFloors(this._$innerFloors),this._floorNames.length>n&&(this._$arrowBtnDown=this._$createScrollButton(u,"down"),this._$arrowBtnDown.onclick=()=>this._handleScroll("down"),this._$innerFloors.addEventListener("scroll",this._debounceScroll=(0,c.A)(t=>{t.stopPropagation(),this._resetArrowBtnStatus(this._$innerFloors.scrollTop)},100)),this._clearScrollEventListener=()=>this._$innerFloors.removeEventListener("scroll",this._debounceScroll)),a}_$foldedSelector(t,e){const{itemSize:r,activeFontColor:n,activeBackgroundColor:o,defaultFolded:s}=this._style,a=(0,i.r)("div","mapxus-ctrl-floors-folded mapxus-ctrl-floors-floor "+(s?"":"hidden"),t);return a.onclick=e,Object.assign(a.style,{width:`${r}px`,height:`${r}px`,lineHeight:`${r}px`,color:n,backgroundColor:o}),a}_clearFloors(){this._container.replaceChildren(),this._componentDidMount=!1}_$createScrollButton(t,e){return(0,i.r)("div",`mapxus-ctrl-floors-arrow mapxus-ctrl-floors-floor ${e}`,t)}_$createFloors(t){const{fontColor:e,itemSize:r}=this._style;let n;this._floorNames.forEach((o,s)=>{n=(0,i.r)("div","mapxus-ctrl-floors-floor",t),n.dataset.floor=o,n.dataset.ordinal=this._ordinals[s],n.innerText=o,Object.assign(n.style,{color:e,height:`${r}px`,lineHeight:`${r}px`}),n.dataset.ordinal===this._ordinal&&(this._$activeFloor=n,this._resetActiveFloor(!0),this._$selectorFolded.innerText=o),n.onclick=async t=>{this._indoor.setDragPan("restrict"),await this.switchByOrdinal(t.target.dataset.ordinal)}})}_updateSelectorStatus(t){const e=this._floorNames[this._ordinals.indexOf(t)];this._$activeFloor&&this._resetActiveFloor(!1);for(const e of this._$innerFloors.children){const r=e;r.dataset.ordinal===t&&(this._$activeFloor=r,this._resetActiveFloor(!0))}this._$selectorFolded.innerText=e}_resetArrowBtnStatus(t){0===t?this._$arrowBtnUp?.classList?.add("hidden"):this._$arrowBtnUp?.classList?.remove("hidden"),t===this._maxScrollTop?this._$arrowBtnDown?.classList?.add("hidden"):this._$arrowBtnDown?.classList?.remove("hidden")}_resetActiveFloor(t){const{activeBackgroundColor:e,backgroundColor:r,activeFontColor:n,fontColor:i}=this._style;Object.assign(this._$activeFloor.style,{color:t?n:i,backgroundColor:t?e:r,fontWeight:t?"bold":"normal",cursor:t?"auto":"pointer"}),this._$activeFloor.disabled=t}_scrollCenterActiveFloor(){if(this._ordinal){const t=this._ordinals.indexOf(this._ordinal);t>-1&&(this._$innerFloors.scrollTop=this._getScrollTop(t),this._$innerFloors.scrollTop||this._resetArrowBtnStatus(0))}}_getScrollTop(t){return(0,a.A)(this._centerSelectorIdx,this._lastNormalScrollableIdx+1)?(t-this._centerSelectorIdx)*this._style.itemSize:t>this._lastNormalScrollableIdx?this._maxScrollTop:0}_handleScroll(t){const e=this._$innerFloors.scrollTop,{itemSize:r}=this._style;if("up"===t){const t=e-2*r;this._$innerFloors.scrollTop=t<0?0:t}else if("down"===t){const t=e+2*r;this._$innerFloors.scrollTop=t>this._maxScrollTop?this._maxScrollTop:t}}_expandSelector(t){t?(this._$selectorExpanded.classList.remove("hidden"),this._$selectorFolded.classList.add("hidden")):(this._$selectorExpanded.classList.add("hidden"),this._$selectorFolded.classList.remove("hidden"))}}},3454:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=Math.max,i=Math.min;const o=function(t,e,r){return t>=i(e,r)&&t<n(e,r)}},3503:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHex=e.remove0x=void 0;var n=r(6527);e.remove0x=function(t){return t.startsWith("0x")||t.startsWith("0X")?t.slice(2):t};e.decodeHex=function(t){return(0,n.hexToBytes)((0,e.remove0x)(t))}},3511:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(6912),i=r(5647),o=r(4792),s=r(3153);const a=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)(0,n.A)(e,(0,o.A)(t)),t=(0,i.A)(t);return e}:s.A},3549:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(3149),i=r(1052),o=r(9313),s=Math.max,a=Math.min;const c=function(t,e,r){var c,u,l,d,h,f,p=0,y=!1,g=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function _(e){var r=c,n=u;return c=u=void 0,p=e,d=t.apply(n,r)}function b(t){var r=t-f;return void 0===f||r>=e||r<0||g&&t-p>=l}function v(){var t=(0,i.A)();if(b(t))return w(t);h=setTimeout(v,function(t){var r=e-(t-f);return g?a(r,l-(t-p)):r}(t))}function w(t){return h=void 0,m&&c?_(t):(c=u=void 0,d)}function B(){var t=(0,i.A)(),r=b(t);if(c=arguments,u=this,f=t,r){if(void 0===h)return function(t){return p=t,h=setTimeout(v,e),y?_(t):d}(f);if(g)return clearTimeout(h),h=setTimeout(v,e),_(f)}return void 0===h&&(h=setTimeout(v,e)),d}return e=(0,o.A)(e)||0,(0,n.A)(r)&&(y=!!r.leading,l=(g="maxWait"in r)?s((0,o.A)(r.maxWait)||0,e):l,m="trailing"in r?!!r.trailing:m),B.cancel=function(){void 0!==h&&clearTimeout(h),p=0,c=f=u=h=void 0},B.flush=function(){return void 0===h?d:w((0,i.A)())},B}},3562:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getHash=function(t){return{hash:t}},e.createCurve=function(t,e){const r=e=>(0,n.weierstrass)({...t,hash:e});return{...r(e),create:r}};const n=r(1705)},3574:(t,e,r)=>{"use strict";r.d(e,{$O:()=>a.$,Kp:()=>s.Kp,LJ:()=>s.LJ,SV:()=>i.S,_P:()=>s._P,en:()=>o.e,nH:()=>s.nH,ys:()=>n.y});var n=r(6612),i=r(9408),o=r(8884),s=r(6358),a=r(5405)},3626:(t,e,r)=>{"use strict";r.d(e,{V:()=>i});var n=r(1682);class i{_container;_isEnabled;constructor(t){this._isEnabled=t?.enabled??!0}onAdd(t){if(this._container=(0,n.r)("div","maplibregl-ctrl mapxus-ctrl-logo",t.getContainer()),this._isEnabled){const t=(0,n.r)("a","mapxus-logo",this._container);t.target="_blank",t.href="https://www.khi.co.jp/groupvision2030/mapxus.html",t.setAttribute("aria-label","Mapxus logo"),t.setAttribute("rel","noopener"),this._container.appendChild(t)}return this._container}onRemove(){(0,n.Z)(this._container)}getDefaultPosition(){return"bottom-left"}}},3631:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(702),i=r(1917);const o=(0,n.A)(i.A,"WeakMap")},3724:(t,e,r)=>{"use strict";r.d(e,{H:()=>c});var n=r(9588),i=r(2068),o=r(9573),s=r(6034);const a=["specialHours","businessStatus","serviceHours","keywords","siteCode","refPhotoId","totalPhotoCount","photos","description"];class c{_api="/api/v5/buildings";_request=i.K.getInstance();constructor(){}searchByIds(t){const e=(0,o.VS)(t);if(!e)throw new Error("Please input building id at least one.");const r=`${this._api}/${e}`;return this._changedRes(r)}searchByDistance(t){const{center:e,distance:r,keywords:i="",offset:s=n.e$,page:a=n.KL}=t;if(!(0,o.ES)(e))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!(0,o.F5)(r)||r>1e4)throw new Error("Invalid distance parameter. Expected a positive number and no more than 10000.");const c=new URLSearchParams;c.set("center",e.join(",")),c.set("distance",String(r)),c.set("offset",String(s)),c.set("page",String(a)),(0,o.BW)(i)&&c.set("keywords",i);const u=`${this._api}?${c.toString()}`;return this._changedRes(u)}searchByBounds(t){const{bounds:e,offset:r=n.e$,page:i=n.KL,keywords:s}=t;if(!(0,o.dD)(e))throw new Error("'bounds' must be an array of two arrays, each containing two numbers.");const a=new URLSearchParams;a.set("bbox",e.flat().join()),a.set("offset",String(r)),a.set("page",String(i)),(0,o.BW)(s)&&a.set("keywords",s);const c=`${this._api}?${a.toString()}`;return this._changedRes(c)}searchByGlobal(t){const{keywords:e,offset:r=n.e$,page:i=n.KL}=t,s=new URLSearchParams;s.set("searchGlobal",String(!0)),s.set("offset",String(r)),s.set("page",String(i)),(0,o.BW)(e)&&s.set("keywords",e);const a=`${this._api}?${s.toString()}`;return this._changedRes(a)}searchByFloorId(t){if(!(0,o.BW)(t))throw new Error("'floorId' cannot be empty.");return this._changedRes(`${this._api}/floors/${t}`)}search(t){const e=new URLSearchParams;return Object.entries(t).forEach(([t,r])=>{"bounds"===t?e.set("bbox",r.flat().join()):"center"===t?e.set("center",r.join()):e.set(t,String(r))}),this._changedRes(`${this._api}?${e.toString()}`)}async _changedRes(t){return this._request.get(t).then(t=>{if(t.data?.result?.buildings){const e=t.data.result.buildings.map(t=>(0,s.A)(t,(t,e)=>a.includes(e)));return{...t,data:{...t.data,result:{...t.data.result,buildings:e}}}}return t})}}},3736:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}},3831:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(6912),i=r(2049);const o=function(t,e,r){var o=e(t);return(0,i.A)(t)?o:(0,n.A)(o,r(t))}},3913:(t,e,r)=>{"use strict";r.d(e,{d:()=>i});var n=r(1682);class i{_container;_$icon;_removeClickEventListener;onAdd(t){return this._container=(0,n.r)("div","maplibregl-ctrl mapxus-ctrl-collapsed-copyright",t.getContainer()),this._container.innerHTML='\n <div class="mapxus-collapsed-copyright-content">\n <div class="mapxus-collapsed-copyright-menu hidden">\n <div class="mapxus-collapsed-copyright-logo" onclick="window.open(\'https://www.khi.co.jp/groupvision2030/mapxus.html\')"></div>\n <div class="mapxus-collapsed-horizontal-divider"></div>\n <div class="mapxus-collapsed-copyright-text" onclick="window.open(\'https://www.openstreetmap.org/copyright/\')"></div>\n </div>\n <div class="mapxus-collapsed-copyright-btn"></div>\n </div>\n ',this._bindEvents(),this._container}onRemove(){this._removeClickEventListener(),(0,n.Z)(this._container)}getDefaultPosition(){return"bottom-right"}_bindEvents(){const t=this._container.querySelector(".mapxus-collapsed-copyright-menu");this._$icon=this._container.querySelector(".mapxus-collapsed-copyright-btn");let e=!1;function r(){e=!e,e?t.classList.remove("hidden"):t.classList.add("hidden")}this._$icon.addEventListener("click",r),this._removeClickEventListener=()=>this._$icon.removeEventListener("click",r)}}},3938:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=(0,r(367).A)(Object.keys,Object)},3957:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(674);const i=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n.A&&void 0===e?"__lodash_hash_undefined__":e,this}},3973:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(3831),i=r(3511),o=r(1865);const s=function(t){return(0,n.A)(t,o.A,i.A)}},3988:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=r(1917).A.Uint8Array},4099:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){return t.has(e)}},4105:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return this.__data__.has(t)}},4116:(t,e,r)=>{"use strict";r.d(e,{p:()=>o});var n=r(853),i=r(5664);class o{_maplibreMap;_layerId;_sourceId;_imageName="poi-01";_imageSize=.75;_iconAnchor="bottom";constructor(t){this._maplibreMap=t;const e=(0,i.A)();this._layerId=`MXMap_preset_marker_layer_${e}`,this._sourceId=`MXMap_preset_marker_source_${e}`}async setIcon(t){t&&await(0,n.K)(this._maplibreMap,t),this._imageName=t}setIconSize(t){this._imageSize=t}setIconAnchor(t){this._iconAnchor=t}get layerId(){return this._layerId}get sourceId(){return this._sourceId}create(t){if(t.length){const e=t.map(t=>this._createIconFeature(t));this._addIconSource(e),this._addIconLayer()}}updateData(t){const e=this._maplibreMap.getSource(this._sourceId);if(!e)return;const r=!(!t.remove||!t.remove.length),n=!(!t.add||!t.add.length),i=!(!t.update||!t.update.length);if(r||n||i){const o={};r&&(o.remove=t.remove.map(t=>String(t))),n&&(o.add=t.add.map(t=>this._createIconFeature(t))),i&&(o.update=t.update.map(t=>{const e="properties"in t,r=this._createIconFeature(t),{id:n,geometry:i,properties:o}=r;return{id:n,newGeometry:i,removeAllProperties:e,...o?{addOrUpdateProperties:o.map((t,e)=>({key:e,value:t}))}:{}}})),e.updateData(o)}}remove(){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.removeLayer(this._layerId),this._maplibreMap.getSource(this._sourceId)&&this._maplibreMap.removeSource(this._sourceId)}on(t,e){const{unsubscribe:r}=this._maplibreMap.on(t,this._layerId,t=>this._handleEventListener(t,e));return{off:r}}setFilter(t){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.setFilter(this._layerId,t)}setFilterByVenue(t,e){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.setFilter(this._layerId,["any",["all",["==",["get","venueId"],t??""],["==",["get","ordinal"],e??""]],["all",["==",["get","venueId"],""],["==",["get","ordinal"],""]]])}setFilterByBuilding(t,e){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.setFilter(this._layerId,["any",["all",["==",["get","buildingId"],t??""],["==",["get","ordinal"],e??""]],["all",["==",["get","buildingId"],""],["==",["get","ordinal"],""]]])}setOpacity(t){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.setPaintProperty(this._layerId,"icon-opacity",t)}setOpacityByVenue(t,e,r){if(this._maplibreMap.getLayer(this._layerId)){const n=["case",["all",["==",["get","venueId"],t??""],["==",["get","ordinal"],e??""]],1,["all",["==",["get","venueId"],""],["==",["get","ordinal"],""]],1,r??.5];this._maplibreMap.setPaintProperty(this._layerId,"icon-opacity",n)}}setOpacityByBuilding(t,e,r){if(this._maplibreMap.getLayer(this._layerId)){const n=["case",["all",["==",["get","buildingId"],t??""],["==",["get","ordinal"],e??""]],1,["all",["==",["get","buildingId"],""],["==",["get","ordinal"],""]],1,r??.5];this._maplibreMap.setPaintProperty(this._layerId,"icon-opacity",n)}}_createIconFeature(t){const{lngLat:e,properties:r}=t;return{id:"featureId"in t&&Number.isFinite(t.featureId)?String(t.featureId):void 0,type:"Feature",geometry:{type:"Point",coordinates:e},properties:r||null}}_addIconSource(t){const e={type:"geojson",data:{type:"FeatureCollection",features:t}};this._maplibreMap.addSource(this._sourceId,e)}_addIconLayer(){this._maplibreMap.addLayer({id:this._layerId,type:"symbol",source:this._sourceId,layout:{"icon-image":this._imageName,"icon-size":this._imageSize,"icon-anchor":this._iconAnchor,"icon-allow-overlap":!0,"icon-ignore-placement":!0}})}_handleEventListener(t,e){const{point:r}=t;e(this._maplibreMap.queryRenderedFeatures(r,{layers:[this._layerId]})[0])}}},4139:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hkdf=void 0,e.extract=o,e.expand=c;const n=r(9615),i=r(9175);function o(t,e,r){return(0,i.ahash)(t),void 0===r&&(r=new Uint8Array(t.outputLen)),(0,n.hmac)(t,(0,i.toBytes)(r),(0,i.toBytes)(e))}const s=Uint8Array.from([0]),a=Uint8Array.of();function c(t,e,r,o=32){(0,i.ahash)(t),(0,i.anumber)(o);const c=t.outputLen;if(o>255*c)throw new Error("Length should be <= 255*HashLen");const u=Math.ceil(o/c);void 0===r&&(r=a);const l=new Uint8Array(u*c),d=n.hmac.create(t,e),h=d._cloneInto(),f=new Uint8Array(d.outputLen);for(let t=0;t<u;t++)s[0]=t+1,h.update(0===t?a:f).update(r).update(s).digestInto(f),l.set(f,c*t),d._cloneInto(h);return d.destroy(),h.destroy(),(0,i.clean)(f,s),l.slice(0,o)}e.hkdf=(t,e,r,n,i)=>c(t,o(t,e,r),n,i)},4171:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(702);const i=function(){try{var t=(0,n.A)(Object,"defineProperty");return t({},"",{}),t}catch(t){}}()},4543:(t,e,r)=>{"use strict";r.d(e,{e:()=>n});class n extends Error{status;constructor(t,e){super(t);const{status:r,name:n}=e;void 0!==r&&(this.status=r),void 0!==n&&(this.name=n)}}},4545:(t,e,r)=>{"use strict";r.d(e,{FR:()=>o.F,H$:()=>i.H,v$:()=>s.v,w1:()=>n.w});var n=r(2801),i=r(3724),o=r(5568),s=r(5344)},4616:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(1917),i=r(4639),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=o&&"object"==typeof module&&module&&!module.nodeType&&module,a=s&&s.exports===o?n.A.Buffer:void 0;const c=(a?a.isBuffer:void 0)||i.A},4639:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(){return!1}},4762:(t,e,r)=>{"use strict";r.d(e,{G:()=>i});var n=r(1682);class i{_map;_maplibre;_buildingId;_features;_$container;_$listContainer;_$buildingList;_listHeight;_language;_visible;_position="top-right";_isMobileMode;_isListShown=!1;constructor(t,e){this._map=t,this._language=t.getLanguage(),this._visible=e??!0,this._detectDeviceMode()}onAdd(t){return this._maplibre=t,this._$container=(0,n.r)("div","maplibregl-ctrl maplibregl-ctrl-building-filter "+(this._visible?"":"hide"),this._maplibre.getContainer()),this._$container.appendChild(this._buildingFilterIconCreate("div")),this._$container.appendChild(this._buildingNameListCreate("div")),this._bindEvents(),this._$container}onRemove(){(0,n.Z)(this._$container)}get position(){return this._position}get enabled(){return this._visible}getDefaultPosition(){return"top-right"}setVisibility(t){this._visible=t,t?this._$showLayout():this._$hideLayout()}changePosition(t,e,r){const n=document.querySelector(`.maplibregl-ctrl-${t}`),i=n.querySelector(".maplibregl-ctrl-building-filter");if(t!==e){this._position=e;const t=document.querySelector(`.maplibregl-ctrl-${e}`);i&&(n.removeChild(i),Number.isFinite(r)?t.insertBefore(i,t.children[r]):t.append(i),this._updateBuildingListLayout(e))}else Number.isFinite(r)&&n.children[r]!==i&&(n.removeChild(i),n.insertBefore(i,n.children[r]))}_bindEvents(){this._maplibre.on("moveend",()=>this._refresh()),this._map.onMapChangeListener(t=>{const e=t.building?.properties?.id??"";this._buildingId!==e&&(this._buildingId=e,this._refresh())}),this._map.renderComplete(()=>this._init())}_init(){this._load()}_refresh(){this._load()}_load(){this._buildingNameListClean(),this._buildingNameListUpdate()}_buildingFilterIconCreate(t){const e=(0,n.r)(t,"mapxus-building-filter-icon");return this._bindMouseOnEvents(e,!1),this._bindMobileTouchEvents(e),e}_buildingNameListCreate(t){return this._$listContainer=(0,n.r)(t,"mapxus-building-name-layout"),this._$listContainer.style.display="none",this._$listContainer.style.top="20px",this._$buildingList=(0,n.r)(t,"mapxus-building-name-list",this._$listContainer),this._bindMouseOnEvents(this._$listContainer,!0),this._$listContainer}_buildingNameListUpdate(){this._features=[];const t=this._map.getMaplibre(),e=t?t.queryRenderedFeatures({layers:["mapxus-building-line"]}):[];for(const t of e){const{properties:e}=t,{id:r,name:n}=e,i=e?.[`name:${this._language}`]??n;this._features.find(t=>t.properties.id===r)||(this._features.push(t),this._$buildingList.appendChild(this._buildingNameCreate("p",i,r,r===this._map.building?.properties?.id)))}this._setBuildingListHeight(this._features),this._updateBuildingListLayout(this._position)}_buildingNameListClean(){this._$buildingList.replaceChildren()}_setBuildingListHeight(t){const e=t.map(t=>{const e=t?.properties?.[`name:${this._language}`]??t?.properties?.name;return e?Math.ceil(8*e.length/107):0}).reduce((t,e)=>t+e,0);this._listHeight=26*e+8*t.length,this._$buildingList.style.height=this._$listContainer.style.height=`${this._listHeight>=208?208:this._listHeight}px`}_buildingNameCreate(t,e,r,i){const o=(0,n.r)(t,"mapxus-building-name"+(i?" active":""));return o.dataset.id=r,o.innerText=e,this._buildingNameClickEvent(o),o}_toggleList(t){this._isListShown=t,this._$listContainer.style.display=t?"block":"none"}_buildingNameClickEvent(t){t.onclick||(t.onclick=async t=>{const e=t.target;await this._map.selectBuildingById(e.dataset.id)})}_bindMouseOnEvents(t,e){t.onmouseenter=()=>{this._isMobileMode||this._toggleList(!0)},e&&(t.onmouseleave=()=>this._toggleList(!1))}_bindMobileTouchEvents(t){window.addEventListener("resize",()=>this._detectDeviceMode()),t.ontouchend=()=>this._toggleList(!this._isListShown)}_$showLayout(){this._$container.classList.remove("hide")}_$hideLayout(){this._$container.classList.add("hide")}_updateBuildingListLayout(t){t.indexOf("left")>-1?(this._$listContainer.style.right=null,this._$listContainer.style.left="55px"):(this._$listContainer.style.left=null,this._$listContainer.style.right="55px");const e=this._$container.offsetParent?this._$container.offsetParent.clientHeight-(this._$container.offsetTop+this._$container.clientHeight)-25:0;t.includes("bottom")&&this._listHeight-20>e?(this._$listContainer.style.top=null,this._$listContainer.style.bottom="15px"):(this._$listContainer.style.bottom=null,this._$listContainer.style.top="20px")}_detectDeviceMode(){this._isMobileMode=window.matchMedia("(pointer: coarse) and (max-width: 768px)").matches}}},4787:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(169);const i=function(t){var e=this.__data__,r=(0,n.A)(e,t);return r<0?void 0:e[r][1]}},4792:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(2634),i=r(3153),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols;const a=s?function(t){return null==t?[]:(t=Object(t),(0,n.A)(s(t),function(e){return o.call(t,e)}))}:i.A},4841:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(2136),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof module&&module&&!module.nodeType&&module,s=o&&o.exports===i&&n.A.process;const a=function(){try{var t=o&&o.require&&o.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}()},4846:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(9672),i=r(3098);const o=function(t){return(0,i.A)(t)&&"[object Arguments]"==(0,n.A)(t)}},4877:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}},4928:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ephemeralKeySize=e.symmetricNonceLength=e.symmetricAlgorithm=e.isHkdfKeyCompressed=e.isEphemeralKeyCompressed=e.ellipticCurve=e.ECIES_CONFIG=void 0;var n=r(1666),i=function(){this.ellipticCurve="secp256k1",this.isEphemeralKeyCompressed=!1,this.isHkdfKeyCompressed=!1,this.symmetricAlgorithm="aes-256-gcm",this.symmetricNonceLength=16};e.ECIES_CONFIG=new i;e.ellipticCurve=function(){return e.ECIES_CONFIG.ellipticCurve};e.isEphemeralKeyCompressed=function(){return e.ECIES_CONFIG.isEphemeralKeyCompressed};e.isHkdfKeyCompressed=function(){return e.ECIES_CONFIG.isHkdfKeyCompressed};e.symmetricAlgorithm=function(){return e.ECIES_CONFIG.symmetricAlgorithm};e.symmetricNonceLength=function(){return e.ECIES_CONFIG.symmetricNonceLength};e.ephemeralKeySize=function(){var t={secp256k1:e.ECIES_CONFIG.isEphemeralKeyCompressed?n.COMPRESSED_PUBLIC_KEY_SIZE:n.UNCOMPRESSED_PUBLIC_KEY_SIZE,x25519:n.CURVE25519_PUBLIC_KEY_SIZE,ed25519:n.CURVE25519_PUBLIC_KEY_SIZE};if(e.ECIES_CONFIG.ellipticCurve in t)return t[e.ECIES_CONFIG.ellipticCurve];throw new Error("Not implemented")}},4943:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(759),i=r(7960),o=r(5997);const s=function(t){var e=(0,i.A)(t);return 1==e.length&&e[0][2]?(0,o.A)(e[0][0],e[0][1]):function(r){return r===t||(0,n.A)(r,t,e)}}},4967:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isNegativeLE=void 0,e.mod=d,e.pow=function(t,e,r){return _(B(r),t,e)},e.pow2=function(t,e,r){let n=t;for(;e-- >i;)n*=n,n%=r;return n},e.invert=h,e.tonelliShanks=y,e.FpSqrt=g,e.validateField=function(t){const e=m.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});return(0,n._validateObject)(t,e),t},e.FpPow=_,e.FpInvertBatch=b,e.FpDiv=function(t,e,r){return t.mul(e,"bigint"==typeof r?h(r,t.ORDER):t.inv(r))},e.FpLegendre=v,e.FpIsSquare=function(t,e){return 1===v(t,e)},e.nLength=w,e.Field=B,e.FpSqrtOdd=function(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const r=t.sqrt(e);return t.isOdd(r)?r:t.neg(r)},e.FpSqrtEven=function(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r},e.hashToPrivateScalar=function(t,e,r=!1){const i=(t=(0,n.ensureBytes)("privateHash",t)).length,s=w(e).nByteLength+8;if(s<24||i<s||i>1024)throw new Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+i);return d(r?(0,n.bytesToNumberLE)(t):(0,n.bytesToNumberBE)(t),e-o)+o},e.getFieldBytesLength=A,e.getMinHashLength=E,e.mapHashToField=function(t,e,r=!1){const i=t.length,s=A(e),a=E(e);if(i<16||i<a||i>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+i);const c=d(r?(0,n.bytesToNumberLE)(t):(0,n.bytesToNumberBE)(t),e-o)+o;return r?(0,n.numberToBytesLE)(c,s):(0,n.numberToBytesBE)(c,s)};const n=r(8627),i=BigInt(0),o=BigInt(1),s=BigInt(2),a=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);function d(t,e){const r=t%e;return r>=i?r:e+r}function h(t,e){if(t===i)throw new Error("invert: expected non-zero number");if(e<=i)throw new Error("invert: expected positive modulus, got "+e);let r=d(t,e),n=e,s=i,a=o,c=o,u=i;for(;r!==i;){const t=n/r,e=n%r,i=s-c*t,o=a-u*t;n=r,r=e,s=c,a=u,c=i,u=o}if(n!==o)throw new Error("invert: does not exist");return d(s,e)}function f(t,e){const r=(t.ORDER+o)/c,n=t.pow(e,r);if(!t.eql(t.sqr(n),e))throw new Error("Cannot find square root");return n}function p(t,e){const r=(t.ORDER-u)/l,n=t.mul(e,s),i=t.pow(n,r),o=t.mul(e,i),a=t.mul(t.mul(o,s),i),c=t.mul(o,t.sub(a,t.ONE));if(!t.eql(t.sqr(c),e))throw new Error("Cannot find square root");return c}function y(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-o,r=0;for(;e%s===i;)e/=s,r++;let n=s;const a=B(t);for(;1===v(a,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return f;let c=a.pow(n,e);const u=(e+o)/s;return function(t,n){if(t.is0(n))return n;if(1!==v(t,n))throw new Error("Cannot find square root");let i=r,s=t.mul(t.ONE,c),a=t.pow(n,e),l=t.pow(n,u);for(;!t.eql(a,t.ONE);){if(t.is0(a))return t.ZERO;let e=1,r=t.sqr(a);for(;!t.eql(r,t.ONE);)if(e++,r=t.sqr(r),e===i)throw new Error("Cannot find square root");const n=o<<BigInt(i-e-1),c=t.pow(s,n);i=e,s=t.sqr(c),a=t.mul(a,s),l=t.mul(l,c)}return l}}function g(t){return t%c===a?f:t%l===u?p:y(t)}e.isNegativeLE=(t,e)=>(d(t,e)&o)===o;const m=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function _(t,e,r){if(r<i)throw new Error("invalid exponent, negatives unsupported");if(r===i)return t.ONE;if(r===o)return e;let n=t.ONE,s=e;for(;r>i;)r&o&&(n=t.mul(n,s)),s=t.sqr(s),r>>=o;return n}function b(t,e,r=!1){const n=new Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((e,r,i)=>t.is0(r)?e:(n[i]=e,t.mul(e,r)),t.ONE),o=t.inv(i);return e.reduceRight((e,r,i)=>t.is0(r)?e:(n[i]=t.mul(e,n[i]),t.mul(e,r)),o),n}function v(t,e){const r=(t.ORDER-o)/s,n=t.pow(e,r),i=t.eql(n,t.ONE),a=t.eql(n,t.ZERO),c=t.eql(n,t.neg(t.ONE));if(!i&&!a&&!c)throw new Error("invalid Legendre symbol result");return i?1:a?0:-1}function w(t,e){void 0!==e&&(0,n.anumber)(e);const r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function B(t,e,r=!1,s={}){if(t<=i)throw new Error("invalid field: expected ORDER > 0, got "+t);let a,c;if("object"==typeof e&&null!=e){if(s.sqrt||r)throw new Error("cannot specify opts in two arguments");const t=e;t.BITS&&(a=t.BITS),t.sqrt&&(c=t.sqrt),"boolean"==typeof t.isLE&&(r=t.isLE)}else"number"==typeof e&&(a=e),s.sqrt&&(c=s.sqrt);const{nBitLength:u,nByteLength:l}=w(t,a);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let f;const p=Object.freeze({ORDER:t,isLE:r,BITS:u,BYTES:l,MASK:(0,n.bitMask)(u),ZERO:i,ONE:o,create:e=>d(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return i<=e&&e<t},is0:t=>t===i,isValidNot0:t=>!p.is0(t)&&p.isValid(t),isOdd:t=>(t&o)===o,neg:e=>d(-e,t),eql:(t,e)=>t===e,sqr:e=>d(e*e,t),add:(e,r)=>d(e+r,t),sub:(e,r)=>d(e-r,t),mul:(e,r)=>d(e*r,t),pow:(t,e)=>_(p,t,e),div:(e,r)=>d(e*h(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>h(e,t),sqrt:c||(e=>(f||(f=g(t)),f(p,e))),toBytes:t=>r?(0,n.numberToBytesLE)(t,l):(0,n.numberToBytesBE)(t,l),fromBytes:t=>{if(t.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);return r?(0,n.bytesToNumberLE)(t):(0,n.bytesToNumberBE)(t)},invertBatch:t=>b(p,t),cmov:(t,e,r)=>r?e:t});return Object.freeze(p)}function A(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function E(t){const e=A(t);return e+Math.ceil(e/2)}},4969:(t,e,r)=>{"use strict";r.d(e,{y:()=>i});var n=r(3574);function i(t){let e=null;return!function(t){return/^en(-(US|GB|AU))?$/.test(t)}(t)?!function(t){return/^zh(-(Hans|CN))?$/.test(t)}(t)?!function(t){return/^zh-(Hant|HK|MO)$/.test(t)}(t)?!function(t){return"zh-TW"===t}(t)?!function(t){return/^ja(-JP)?$/.test(t)}(t)?!function(t){return/^ko(-KR)?$/.test(t)}(t)?!function(t){return/^(fil|tl)(-PH)?$/.test(t)}(t)?!function(t){return/^id(-ID)?$/.test(t)}(t)?!function(t){return/^pt(-(BR|PT))?$/.test(t)}(t)?!function(t){return/^th(-TH)?$/.test(t)}(t)?!function(t){return/^vi(-VN)?$/.test(t)}(t)?function(t){return/^ar(-(DZ|BH|EG|IQ|JO|KW|LB|LY|MA|OM|QA|SA|SY|TN|AE|YE))?$/.test(t)}(t)&&(e=n.ys.ARABIC):e=n.ys.VIETNAMESE:e=n.ys.THAI:e=n.ys.PORTUGUESE:e=n.ys.INDONESIAN:e=n.ys.FILIPINO:e=n.ys.KOREAN:e=n.ys.JAPANESE:e=n.ys.CHINESE_TRADITIONAL_TW:e=n.ys.CHINESE_TRADITIONAL:e=n.ys.CHINESE_SIMPLIFIED:e=n.ys.ENGLISH,e}},5054:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(7465),i=r(1788),o=r(2049),s=r(5353),a=r(5254),c=r(901);const u=function(t,e,r){for(var u=-1,l=(e=(0,n.A)(e,t)).length,d=!1;++u<l;){var h=(0,c.A)(e[u]);if(!(d=null!=t&&r(t,h)))break;t=t[h]}return d||++u!=l?d:!!(l=null==t?0:t.length)&&(0,a.A)(l)&&(0,s.A)(h,l)&&((0,o.A)(t)||(0,i.A)(t))}},5056:(t,e,r)=>{"use strict";r.d(e,{eG:()=>a,kC:()=>s,sy:()=>o});var n=r(4969),i=r(3574);const o={lineWidth:3,lineColor:"#A5E3FF",lineOpacity:1,lineOffset:-1.5},s={fontColor:"#8c8c8c",activeFontColor:"#fff",backgroundColor:"#fff",activeBackgroundColor:"#074769",itemSize:50,itemCount:4,defaultFolded:!1},a=(0,n.y)(window.navigator.language)??i.ys.ENGLISH},5088:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(5373),i=r(7919),o=r(8335);const s=function(){this.size=0,this.__data__={hash:new n.A,map:new(o.A||i.A),string:new n.A}}},5145:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},5188:(t,e,r)=>{"use strict";r.d(e,{p:()=>a});var n=r(8291),i=r(1089),o=r(5664);const s="Poi_poiClick";class a{_map;_currentStyle=null;_layerIds=[];_dispatch=(0,i.A)(s);_listeners=[];constructor(t){this._map=t,this._bindPoiClickEvent()}destroy(){this._dispatch.on(`.${s}`,null),this._currentStyle=null,this._map=null,this._dispatch=null,this._listeners=[],this._layerIds=[]}onPoiClick(t){const e=(0,o.A)(`${s}.`);return this._dispatch.on(e,t),this._listeners.push(e),{unsubscribe:()=>this._dispatch.on(e,null)}}_queryPoiLayers(){const t=this._map.getStyle();if(t.name===this._currentStyle)return;const e=(0,n.cq)(t).filter(t=>"mapxus_place"===t["source-layer"]&&"symbol"===t.type);this._layerIds=e.map(({id:t})=>t),this._currentStyle=t.name}_bindPoiClickEvent(){this._map.on("click",t=>{if(0===this._listeners.length)return;this._queryPoiLayers();const e=this._map.queryRenderedFeatures(t.point,{layers:this._layerIds});if(0===e.length)return;const r=e[0],n=Boolean(r.properties?.["ref:shared_level"]),i=n?r.properties?.["ref:shared_level"]:r.properties?.["ref:level"],{floor:o,building:a,venue:c}=n?this._queryIndoorFeaturesBySharedFloor(i):this._queryIndoorFeaturesByFloor(i);this._dispatch.call(s,null,{coordinate:t.lngLat,poi:r,building:a,venue:c,floor:o})})}_queryIndoorFeaturesBySharedFloor(t){const e=this._map.queryRenderedFeatures({layers:["mapxus-shared-level-fill","mapxus-shared-level-fill-overlap-copy","mapxus-shared-level-fill-shared-bg","mapxus-building-line","mapxus-venue-fill"]}),r=e.find(e=>e.layer.id.includes("mapxus-shared-level-fill")&&e.properties.id===t);if(!r)return{floor:null,building:null,venue:null};const n=r.properties["ref:venue"],i=e.find(t=>"mapxus-venue-fill"===t.layer.id&&t.properties.id===n),{id:o,ordinal:s,name:a}=r.properties;return{floor:{id:o,ordinal:s,name:{default:a}},building:null,venue:i}}_queryIndoorFeaturesByFloor(t){const e=this._map.queryRenderedFeatures({layers:["mapxus-level-fill","mapxus-level-fill-overlap-copy","mapxus-building-line","mapxus-venue-fill"]}),r=e.find(e=>e.layer.id.includes("mapxus-level-fill")&&e.properties.id===t);if(!r)return{floor:null,building:null,venue:null};const{id:n,ordinal:i,name:o,"ref:building":s}=r.properties,a=e.find(t=>"mapxus-building-line"===t.layer.id&&t.properties.id===s),c=e.find(t=>"mapxus-venue-fill"===t.layer.id&&t.properties.id===a?.properties?.["ref:venue"]);return{floor:{id:n,ordinal:i,code:o},building:a,venue:c}}}},5254:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},5295:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrivateKey=void 0;var n=r(6527),i=r(2158),o=r(2557),s=function(){function t(t,e){if(this.curve=e,void 0===t)this.data=(0,i.getValidSecret)(e);else{if(!(0,i.isValidPrivateKey)(t,e))throw new Error("Invalid private key");this.data=t}this.publicKey=new o.PublicKey((0,i.getPublicKey)(this.data,e),e)}return t.fromHex=function(e,r){return new t((0,i.decodeHex)(e),r)},Object.defineProperty(t.prototype,"secret",{get:function(){return Buffer.from(this.data)},enumerable:!1,configurable:!0}),t.prototype.toHex=function(){return(0,n.bytesToHex)(this.data)},t.prototype.encapsulate=function(t,e){void 0===e&&(e=!1);var r=this.publicKey.toBytes(e),n=this.multiply(t,e);return(0,i.getSharedKey)(r,n)},t.prototype.multiply=function(t,e){return void 0===e&&(e=!1),(0,i.getSharedPoint)(this.data,t.toBytes(!0),e,this.curve)},t.prototype.equals=function(t){return(0,n.equalBytes)(this.data,t.data)},t}();e.PrivateKey=s},5297:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},5344:(t,e,r)=>{"use strict";r.d(e,{v:()=>o});var n=r(2068),i=r(5405);class o{_api="/api/v4/route/query";_request=n.K.getInstance();constructor(){}search(t){const{points:e,vehicle:r=i.$.FOOT,locale:n="en"}=t;if(!(e&&e.length>1&&e.length<6))throw new Error("Parameter error. It must be 1 < {points.length} < 6");if(function(t){return t.some(t=>!t||"number"!=typeof t.lat||"number"!=typeof t.lon)}(e))throw new Error("Parameter error. Points must have lat and lon.");const o={points:e,vehicle:r,locale:n};return this._request.post(this._api,JSON.stringify(o))}}},5353:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=/^(?:0|[1-9]\d*)$/;const i=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},5373:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(2944),i=r(9190),o=r(8417),s=r(8813),a=r(3957);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n.A,c.prototype.delete=i.A,c.prototype.get=o.A,c.prototype.has=s.A,c.prototype.set=a.A;const u=c},5405:(t,e,r)=>{"use strict";var n;r.d(e,{$:()=>n}),function(t){t.FOOT="foot",t.WHEELCHAIR="wheelchair",t.ESCALATOR="escalator",t.EMERGENCY="emergency"}(n||(n={}))},5461:(t,e,r)=>{"use strict";r.d(e,{U:()=>a,l:()=>s});var n=r(9588);const i="-webkit-extension-67d8e3e8-";let o=null;async function s(){let t=sessionStorage.getItem(i);if(!t)try{a(),await c(Date.now()),t=sessionStorage.getItem(i)}catch(t){throw new Error("Failed to fetch public key: "+t)}return t}function a(){sessionStorage.removeItem(i),o&&(clearTimeout(o),o=null)}async function c(t){try{const r=await fetch(`${n.kk}?timestamp=${t}`,{method:"GET",headers:{"Content-Type":"text/plain"}}),{headers:s}=r,a=parseInt(s.get("x-retry-in"));o=setTimeout(async()=>{await c(t)},1e3*a),e=await r.text(),sessionStorage.setItem(i,e)}catch(t){throw t}var e}},5462:(t,e,r)=>{"use strict";r.d(e,{T:()=>R});var n=r(5629),i=r(5188),o=r(9983),s=r(2068),a=r(3626),c=r(520),u=r(3913),l=r(1089),d=r(3236),h=r(5056),f=r(181),p=r(5706),y=r(7311),g=r(1682),m=r(1965),_=r(3574),b=r(8488),v=r.n(b),w=r(2075),B=r(1694),A=r(6294),E=r(9205),S=r(2468),I=r(9644),x=r(3549),L=r(5664),k=r(5582);const O="Map_mapClick",C="Map_pointClick",T="Map_isRenderComplete",P="Map_isDestroyed",F=y.o.getInstance();class R{_map;_indoor;_poi;_floorsControl;_buildingFilterControl;_attributionControl;_language;_dispatch=(0,l.A)(O,C,T,P);_fitBuildingBounds;_history=f.d.getInstance();_hiddenBuildings=p.Q.getInstance().getHiddenBuildings();_debounceHTTPErrorHandler;_transformRequestHandler;_tokenRefreshingPromise=null;_request=s.K.getInstance();_$mask=null;_cancelTokenChangedListener;isDestroyed=!1;switchOutdoor;switchBuilding;buildingSelector;floorSelector;constructor(t){if(!t.map)throw new Error("Map is required.");if(!H(t)&&!M(t))throw new Error("Access params are required.");H(t)?F.setAccessByAppKey({appId:t.appId,secret:t.secret,platform:t.platform}).then(async()=>{await F.setupTokenManager(),this._setup(t)}):M(t)&&(F.setTokenGetter(t.getTokenAsync),F.setupTokenManager().then(()=>{this._setup(t)}))}renderComplete(t){const e=(0,L.A)(`${T}.`);this._dispatch.on(e,t)}destroyed(t){const e=(0,L.A)(`${P}.`);this._dispatch.on(e,()=>{t(),this._dispatch.on(e,null),0===this._dispatch._[P].length&&(delete this._dispatch,Object.freeze(this))})}setTransformRequest(t){this._transformRequestHandler=t}getIndoor(){return this._indoor}getMaplibre(){return this._map}get floor(){return this.getIndoor()?.floor??null}get building(){return this.getIndoor()?.building??null}get venue(){return this.getIndoor()?.venue??null}setLanguage(t){this._language!==t&&(this._language=t);const e=this._map?.getStyle(),r=(e?.layers||[]).filter(({type:t})=>"symbol"===t);for(const{id:e}of r){const r=this._map.getLayer(e),n="string"==typeof this._map.getLayoutProperty(e,"text-field");r&&!n&&this._map.setLayoutProperty(e,"text-field",["coalesce",["get",`name:${t}`],["get","name"]])}}getLanguage(){return this._language}setOutdoorMapShown(t){this.getIndoor()?.setOutdoorMapShown(t)}getIndoorFeaturesByCoordinates(t,e){const r=this._map.project(t),n=this._map.queryRenderedFeatures(r,{layers:["mapxus-venue-fill","mapxus-building-line","mapxus-level-fill","mapxus-level-fill-overlap-copy"]});if(0===n.length)return{venue:null,building:null,level:null};const i=n.filter(t=>t.layer.id.includes("mapxus-level-fill")).find(t=>Number.isFinite(e)?t.properties.ordinal===e+"":t.layer.id.startsWith("mapxus-level-fill"));if(!i)return{venue:null,building:null,level:null};const o=n.find(t=>t.properties.id===i.properties["ref:building"]);return{venue:n.find(t=>t.properties.id===o.properties["ref:venue"]),building:o,level:i}}getFeaturesById(t,e){return this.getIndoor()?.getFeaturesById(t,e)||[]}async selectFloorById(t,e){const{dragPan:r=!0}=e||{};if(this._indoor.setDragPan(r),t===this.floor?.id){if(!r)return;this._fitBuildingBounds?this._indoor.fitBuildingBbox():await this._indoor.panToBuildingCenter()}else{let e,n,i=!1;try{if(this._fitBuildingBounds){e=await(0,B.F2)(t),n=(0,d.r)(e),i=!0;const{maxLat:r,maxLon:o,minLat:s,minLon:a}=e.bbox;this._indoor.setBuildingBounds([[a,s],[o,r]])}else n=(this._indoor?.features||[]).find(e=>e.properties?.level_ids?.includes(t)&&"mapxus-building-line"===e.layer.id)??null,n||(e=await(0,B.F2)(t),n=(0,d.r)(e),i=!0)}catch(t){this._handleSearchError(t)}if(n&&n?.properties?.id===this.building?.properties?.id){const{level_ids:e,ordinals:i}=n.properties,o=e.split(",").indexOf(t),s=i.split(",")[o]??null;await this._floorsControl.switchByOrdinal(s,r)}else await(this._indoor?.selectBuilding(n,{floorId:t,featureIncomplete:i}))}}async selectSharedFloorById(t,e){const{dragPan:r=!0}=e||{};if(this._indoor.setDragPan(r),t===this.floor?.id){if(!r)return;this._fitBuildingBounds?this._indoor.fitVenueBbox():await this._indoor.panToVenueCenter()}else{let e,r,n=!1;const i=async t=>{n=!0;const i=await(0,B.F0)(t);r=(0,d.E)(i);const{maxLat:o,maxLon:s,minLat:a,minLon:c}=i.bbox;this._indoor.setVenueBounds([[c,a],[s,o]]);const u=i.sharedFloors.find(({id:e})=>e===t),{id:l,name:h,ordinal:f}=u;e={id:l,name:h,ordinal:f+""}};try{if(this._fitBuildingBounds)await i(t);else{r=(this._indoor?.features||[]).find(e=>e.properties?.shared_level_ids?.includes(t)&&"mapxus-venue-fill"===e.layer.id);const n=r?this._indoor.features.find(e=>e.properties.id===t):null;if(n){const{id:t,name:r,ordinal:i}=n.properties;e={id:t,name:"string"==typeof r?{default:r}:r,ordinal:i}}else await i(t)}}catch(t){this._handleSearchError(t)}e&&r&&await(this._indoor?.selectSharedFloor(e,r,{featureIncomplete:n}))}}async selectBuildingById(t,e){const{dragPan:r=!0}=e||{};if(this._indoor.setDragPan(r),t===this.building?.properties?.id){if(!r)return;this._fitBuildingBounds?this._indoor.fitBuildingBbox():await this._indoor.panToBuildingCenter()}else{let e,r,n=!1;try{if(this._fitBuildingBounds){e=await(0,B.pT)(t),r=(0,d.r)(e),n=!0;const{maxLat:i,maxLon:o,minLat:s,minLon:a}=e.bbox;this._indoor.setBuildingBounds([[a,s],[o,i]])}else r=this._map.getLayer("mapxus-building-line")&&this.getFeaturesById(t,{layerIds:["mapxus-building-line"]})[0]||null,r||(e=await(0,B.pT)(t),r=(0,d.r)(e),n=!0);await(this._indoor?.selectBuilding(r,{featureIncomplete:n}))}catch(t){this._handleSearchError(t)}}}async selectVenueById(t,e){const{dragPan:r=!0}=e||{};if(this._indoor.setDragPan(r),"string"==typeof t&&""===t.trim()||null===t)await(this._indoor?.selectBuilding(null));else if(t===this.venue?.properties?.id){if(!r)return;this.building?this._fitBuildingBounds?this._indoor.fitBuildingBbox():await this._indoor.panToBuildingCenter():"name"in this.floor&&(this._fitBuildingBounds?this._indoor.fitVenueBbox():await this._indoor.panToVenueCenter())}else{const e=this._history.getBuildingUnitByVenue(t);if(e){const{id:t,type:n}=e;"building"===n?await this.selectBuildingById(t,{dragPan:r}):await this.selectSharedFloorById(t,{dragPan:r})}else{let e;const n=this._map.getLayer("mapxus-venue-fill")&&this.getFeaturesById(t,{layerIds:["mapxus-venue-fill"]})[0];if(n){const{default_displayed_building:t,building_ids:r}=n.properties;e=t||(r?.split(",")||[])[0]}else try{const r=await(0,B.qT)(t);e=r.defaultBuilding||r.buildings[0]?.id}catch(t){this._handleSearchError(t)}e&&await this.selectBuildingById(e,{dragPan:r})}}}onMapClickListener(t){const e=(0,L.A)(`${O}.`);return this._dispatch.on(e,t),{unsubscribe:()=>this._dispatch.on(e,null)}}onPoiClickListener(t){return this._poi?.onPoiClick(t)}onPointClickListener(t){const e=(0,L.A)(`${C}.`);return this._dispatch.on(e,t),{unsubscribe:()=>this._dispatch.on(e,null)}}onMapChangeListener(t){return this._indoor?.onMapChange(t)}switchTheme(t){this._setStyle(this._getStyleUrl(t)),this._map?.once("styledata",()=>this._setIndoorFilter()),"changeTheme"in this._attributionControl&&this._attributionControl.changeTheme(t)}setSelectedBuildingBorderStyle(t){return this._indoor?.setSelectedHighlightStyle(t),this}setSelectedHighlightStyle(t){return this._indoor?.setSelectedHighlightStyle(t),this}async _setup(t){const{map:e,poiId:r,sharedFloorId:s,floorId:l,buildingId:d,venueId:f,theme:p=_.SV.MAPXUS_DEFAULT,floorSelectorEnabled:y,buildingSelectorEnabled:g,outdoorMapShown:m,collapseCopyright:b=!1,maskNonSelectedAreas:v,fitBuildingBounds:w=!1,boundsPadding:B=30,selectedHighlightStyle:L,floorSelectorStyle:k,language:O=h.eG,autoSelectBuilding:C=!1,transformRequest:P=null,mapxusLogoEnabled:F=!0}=t;this._map=e,this._language=O,this._indoor=new n.SN({map:this._map,startWithIndoorView:Boolean(f||d||l||r),outdoorMapShown:m,fitBuildingBounds:w,boundsPadding:B,maskNonSelectedAreas:v,selectedHighlightStyle:L}),this._poi=new i.p(this._map),this._fitBuildingBounds=w,this._transformRequestHandler=P,this._setMaskEnabled(!0),await this._resourceRequestTransform(),this._installRtlTextPlugin(),this._setStyle(this._getStyleUrl(p)),this._checkMapZoom(),b?this._attributionControl=new u.d:(this._attributionControl=new c.z({theme:p}),this._addControl(new a.V({enabled:F}))),this._addControl(this._attributionControl),this._addControl(this._buildingFilterControl=new o.G(this,g)),this._addControl(this._floorsControl=new o.Z(this._indoor,{language:O,style:k,enabled:y})),r?this._selectPoiById(r):l?this.selectFloorById(l):d?this.selectBuildingById(d):f?this.selectVenueById(f):s&&this.selectSharedFloorById(s),this.switchOutdoor=new A.B(this._indoor),this.switchBuilding=new E.N(this._indoor),this.buildingSelector=new S.E(this._buildingFilterControl),this.floorSelector=new I.C(this._floorsControl),this._map.once("styledata",()=>this.setLanguage(this._language)),this._map.on("remove",()=>this._destroy()),this._map.on("error",this._debounceHTTPErrorHandler=(0,x.A)(t=>this._updatePermission(t),300)),this._indoor.once(n.Hv,()=>{this._setMaskEnabled(!1),C&&this._map.on("moveend",()=>this._selectCenterBuilding()),this._bindMapClickListener(),this._bindTokenChangedListener(),this._dispatch.call(T)})}_getStyleUrl(t){const e=new globalThis.Map([[_.SV.CHRISTMAS,w._C],[_.SV.HALLOWEEN,w.ts],[_.SV.MAPPY_BEE,w.xR],[_.SV.MAPXUS,w.em],[_.SV.COMMON,w.lu],[_.SV.LANDS_D,w.Hf],[_.SV.MAPXUS_DEFAULT,w.$b]]);return e.has(t)?e.get(t):(0,w.aS)(t)}_setIndoorFilter(){this._indoor.updateCustomLayers(),this._indoor.updateRendering()}_setStyle(t){this._map?.setStyle(t,{localIdeographFontFamily:!1})}_addControl(t,e){this._map.addControl(t,e)}async _selectPoiById(t){try{const e=await(0,B.xW)(t),{lon:r,lat:n}=e.location;"floorId"in e?await this.selectFloorById(e.floorId):"sharedFloorId"in e&&await this.selectSharedFloorById(e.sharedFloorId),this._map.panTo([r,n])}catch(t){this._handleSearchError(t)}}async _resourceRequestTransform(){const t=await this._request.getRequestHeaders();this._map.setTransformRequest((e,r)=>{const{host:n}=new URL(e);return n.includes("map-api")&&n.includes("mapxus")?{url:e,headers:t}:this._transformRequestHandler?this._transformRequestHandler(e,r):{url:e}})}_checkMapZoom(){const t=this._map.getZoom();(t<8||t>22)&&t>1&&console.warn("Indoor maps perform better at zoom levels [8, 22].")}async _updatePermission(t){if(401===t.error?.status)return this._tokenRefreshingPromise||(this._tokenRefreshingPromise=this._resourceRequestTransform().finally(()=>this._tokenRefreshingPromise=null)),this._tokenRefreshingPromise}_selectCenterBuilding(){const t=this._getCenterBuildingUnitsMap();if(!t.size)return;let e=t.entries().next().value[1];const r=this._history.getVisitedBuildingUnits().reverse();for(const n of r){const{id:r}=n;if(t.get(r)){e=n;break}}"building"===e.type?this.selectBuildingById(e.id,{dragPan:!1}):this.selectSharedFloorById(e.id,{dragPan:!1})}_getCenterBuildingUnitsMap(){const t=this._map.getCanvas().getBoundingClientRect(),e=t.width/4,r=t.height/4,n=[e,r],i=[t.width-e,t.height-r],o=["mapxus-building-line",m.TU].filter(t=>this._map.getLayer(t));let s=this._map.queryRenderedFeatures([n,i],{layers:o});return s=(0,k.A)(s,"properties.id"),s=s.filter(t=>!this._hiddenBuildings.has(t.properties.id)),new globalThis.Map(s.map(({properties:t})=>[`${t.id}`,{id:t.id,type:t.building?"building":"sharedFloor"}]))}_bindMapClickListener(){this._map.on("click",async t=>{const{point:e,lngLat:r}=t;await this._indoor.selectByClickMap(e),this._dispatch.call(C,null,{point:e,coordinate:r}),this._dispatch.call(O,null,{coordinate:r,venue:this.venue,building:this.building,floor:this.floor})})}_bindTokenChangedListener(){const{off:t}=F.on(y.O,async()=>{await this._resourceRequestTransform()});this._cancelTokenChangedListener=t}_handleSearchError(t){const e=t?.response?.status||"unknown",r=t?.response?.data?.message||"unknown";F.getGlobalDispatcher().call("initError",null,{status:e,message:r})}_setMaskEnabled(t){t?this._$mask||(this._$mask=(0,g.r)("div","mapxus-map-mask",this._map.getContainer())):this._$mask&&((0,g.Z)(this._$mask),this._$mask=null)}_installRtlTextPlugin(){"unavailable"===v().getRTLTextPluginStatus()&&v().setRTLTextPlugin("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js",!0)}_destroy(){if(this.isDestroyed)return;this.isDestroyed=!0,this._debounceHTTPErrorHandler?.cancel();const t=this._dispatch._;for(const e in t)e!==P&&t.hasOwnProperty(e)&&t[e].forEach(({name:t})=>{this._dispatch.on(`${e}.${t}`,null)});this._indoor.destroy(),this._poi.destroy(),Object.keys(this).forEach(t=>{"isDestroyed"!==t&&"_dispatch"!==t&&delete this[t]}),this._cancelTokenChangedListener&&this._cancelTokenChangedListener(),F.clearState(),this._dispatch.call(P)}}function M(t){return"getTokenAsync"in t&&"function"==typeof t.getTokenAsync}function H(t){return"appId"in t&&""!==t.appId.trim()&&"secret"in t&&""!==t.secret.trim()}},5488:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(7880),i=/^\s+/;const o=function(t){return t?t.slice(0,(0,n.A)(t)+1).replace(i,""):t}},5530:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(2531);const i=function(t,e){return!!(null==t?0:t.length)&&(0,n.A)(t,e,0)>-1}},5537:(t,e,r)=>{"use strict";r.d(e,{s:()=>o});class n extends Error{}function i(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(t){return decodeURIComponent(atob(t).replace(/(.)/g,(t,e)=>{let r=e.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(e)}catch(t){return atob(e)}}function o(t,e){if("string"!=typeof t)throw new n("Invalid token specified: must be a string");e||(e={});const r=!0===e.header?0:1,o=t.split(".")[r];if("string"!=typeof o)throw new n(`Invalid token specified: missing part #${r+1}`);let s;try{s=i(o)}catch(t){throw new n(`Invalid token specified: invalid base64 for part #${r+1} (${t.message})`)}try{return JSON.parse(s)}catch(t){throw new n(`Invalid token specified: invalid json for part #${r+1} (${t.message})`)}}n.prototype.name="InvalidTokenError"},5547:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(9914);const i=function(t,e){var r=t.__data__;return(0,n.A)(e)?r["string"==typeof e?"string":"hash"]:r.map}},5568:(t,e,r)=>{"use strict";r.d(e,{F:()=>u});var n=r(9588),i=r(2068),o=r(9573),s=r(3574),a=r(6034);const c=["specialHours","businessStatus","serviceHours","keywords","siteCode","refPhotoId","totalPhotoCount","photos","icon"];class u{_poisApi="/api/v5/pois";_categoriesGroupApi="/api/v5/categories/group";_request=i.K.getInstance();constructor(){}searchByIds(t){const e=(0,o.VS)(t);if(!e)throw new Error("Invalid ids parameter. Expected a non-empty string or an array of strings.");const r=`${this._poisApi}/${e}`;return this._changedRes(r)}searchByDistance(t){const{center:e,distance:r,keywords:i="",offset:s=n.e$,page:a=n.KL}=t;if(!(0,o.ES)(e))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!(0,o.F5)(r)||r>1e4)throw new Error("Invalid distance parameter. Expected a positive number and no more than 10000.");const c=new URLSearchParams;c.set("center",e.join(",")),c.set("distance",String(Math.round(r))),c.set("offset",String(s)),c.set("page",String(a)),(0,o.BW)(i)&&c.set("keywords",i);const u=`${this._poisApi}?${c.toString()}`;return this._changedRes(u)}searchByBounds(t){const{bounds:e,offset:r=n.e$,page:i=n.KL,keywords:s,orderBy:a}=t;if(!(0,o.dD)(e))throw new Error("'bounds' must be an array of two arrays, each containing two numbers.");const c=new URLSearchParams;c.set("bbox",e.flat().join()),c.set("offset",String(r)),c.set("page",String(i)),(0,o.BW)(s)&&c.set("keywords",s),a&&c.set("orderBy",a);const u=`${this._poisApi}?${c.toString()}`;return this._changedRes(u)}searchByBuilding(t){const{buildingId:e,offset:r=n.e$,page:i=n.KL,keywords:s,orderBy:a}=t;if(!(0,o.BW)(e))throw new Error("'buildingId' must be a non-empty string.");const c=new URLSearchParams;c.set("buildingId",e),c.set("offset",String(r)),c.set("page",String(i)),(0,o.BW)(s)&&c.set("keywords",s),a&&c.set("orderBy",a);const u=`${this._poisApi}?${c.toString()}`;return this._changedRes(u)}searchByVenue(t){const{venueId:e,offset:r=n.e$,page:i=n.KL,keywords:s,orderBy:a}=t;if(!(0,o.BW)(e))throw new Error("'venueId' must be a non-empty string.");const c=new URLSearchParams;c.set("venueId",e),c.set("offset",String(r)),c.set("page",String(i)),(0,o.BW)(s)&&c.set("keywords",s),a&&c.set("orderBy",a);const u=`${this._poisApi}?${c.toString()}`;return this._changedRes(u)}searchByFloor(t){let e=null,r=null;if("floorId"in t&&(0,o.BW)(t.floorId)?(e="floorId",r=t.floorId):"sharedFloorId"in t&&(0,o.BW)(t.sharedFloorId)&&(e="sharedFloorId",r=t.sharedFloorId),!e||!r)throw new Error("Either 'floorId' or 'sharedFloorId' must be a non-empty string.");const{offset:i=n.e$,page:s=n.KL,keywords:a,orderBy:c}=t,u=new URLSearchParams;u.set("offset",String(i)),u.set("page",String(s)),u.set(e,r),(0,o.BW)(a)&&u.set("keywords",a),c&&u.set("orderBy",c);const l=`${this._poisApi}?${u.toString()}`;return this._changedRes(l)}searchByOrientation(t){const{center:e,angle:r,distance:n,distanceSearchType:i=s._P.POINT}=t;if(!(0,o.ES)(e))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!(0,o.F5)(n)||n>100)throw new Error("Invalid distance parameter. Expected a positive number and no more than 100.");if(!(0,o.F5)(r))throw new Error("Invalid angle parameter. Expected a positive number.");const a=new URLSearchParams;if("ordinal"in t){if(!(0,o.BW)(t.ordinal))throw new Error("'ordinal' must be a non-empty string.");a.set("ordinal",t.ordinal)}else if("floorId"in t){if(!(0,o.BW)(t.floorId))throw new Error("'floorId' must be a non-empty string.");a.set("floorId",t.floorId)}else{if(!("buildingId"in t))throw new Error("Either 'ordinal', 'floorId', or 'buildingId' must be provided.");if(!(0,o.BW)(t.buildingId))throw new Error("'buildingId' must be a non-empty string.");a.set("buildingId",t.buildingId)}a.set("center",e.join()),a.set("angle",String(Math.round(r))),a.set("distance",String(n)),a.set("distanceSearchType",i);const c=`${this._poisApi}/orientation?${a.toString()}`;return this._request.get(c)}searchByCategory(t){const{center:e,distance:r,page:i=n.KL,offset:s=n.e$}=t;if(!(0,o.ES)(e))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!(0,o.F5)(r)||r>1e4)throw new Error("Invalid distance parameter. Expected a positive number and no more than 10000");const a=new URLSearchParams;if("category"in t&&(0,o.BW)(t.category))a.set("category",String(t.category));else{if(!("excludedCategories"in t)||!(0,o.VS)(t.excludedCategories))throw new Error("Either 'category' or 'excludedCategories' must be provided.");a.set("excludeCategories",(0,o.VS)(t.excludedCategories))}a.set("center",e.join(",")),a.set("distance",String(r)),a.set("page",String(i)),a.set("offset",String(s));const c=`${this._poisApi}?${a.toString()}`;return this._changedRes(c)}searchCategories(t){const e=new URLSearchParams;if("floorId"in t&&(0,o.BW)(t.floorId)?e.set("floorId",t.floorId):"buildingId"in t&&(0,o.BW)(t.buildingId)?e.set("buildingId",t.buildingId):"sharedFloorId"in t&&(0,o.BW)(t.sharedFloorId)?e.set("sharedFloorId",t.sharedFloorId):"venueId"in t&&(0,o.BW)(t.venueId)&&e.set("venueId",t.venueId),"bounds"in t&&(0,o.dD)(t.bounds)&&(e.set("bbox",t.bounds.flat().join()),(0,o.BW)(t.keywords)&&e.set("keywords",t.keywords)),0===e.toString().length)throw new Error("At least one of 'floorId', 'buildingId', 'sharedFloorId', 'venueId', or 'bounds' must be provided.");const r=`${this._categoriesGroupApi}?${e.toString()}`;return this._request.get(r)}search(t){const e=new URLSearchParams;Object.entries(t).forEach(([t,r])=>{switch(t){case"bounds":(0,o.dD)(r)&&e.set("bbox",r.flat().join());break;case"center":(0,o.ES)(r)&&e.set("center",r.join());break;case"excludedCategories":(0,o.VS)(r)&&e.set("excludeCategories",(0,o.VS)(r));break;default:e.set(t,String(r))}});const r=`${this._poisApi}?${e.toString()}`;return this._request.get(r)}async _changedRes(t){return this._request.get(t).then(t=>{if(t.data?.result?.pois){const e=t.data.result.pois.map(t=>(0,a.A)(t,(t,e)=>c.includes(e)));return{...t,data:{...t.data,result:{...t.data.result,pois:e}}}}return t})}}},5572:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}},5582:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(2141),i=r(5781);const o=function(t,e){return t&&t.length?(0,i.A)(t,(0,n.A)(e,2)):[]}},5606:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=Object.prototype.toString;const i=function(t){return n.call(t)}},5629:(t,e,r)=>{"use strict";r.d(e,{Hv:()=>B,Ms:()=>w,SN:()=>C});var n=r(7007),i=r(8291),o=r(3236),s=r(8700),a=r(9266),c=r(1965),u=r(4545),l=r(5056),d=r(1694),h=r(8021),f=r(1089),p=r(181),y=r(5706),g=r(8389),m=r(3549),_=r(5582),b=r(5664);const v="Indoor_selectedFloorChanged",w="Indoor_selectedBuildingChanged",B="Indoor_mapxusMapLoaded",A="Indoor_maplibreMapLoaded",E="mapxus-venue-fill",S="mapxus-building-line",I="mapxus-level-fill",x="mapxus-shared-level-fill",L="highlight-mapxus_level",k="highlight-mapxus_shared_level",O=new u.w1;class C extends n.EventEmitter{_map;_features;_allVenuesMap;_allBuildingsMap;_allSharedLevelsMap;_curBuildingId=null;_curBuildingFeature=null;_curSharedLevelId=null;_floor={code:null,id:null,ordinal:null};_sharedFloor={id:null,ordinal:null,name:null};_allowOutdoorSwitch;_allowBuildingSwitch;_outdoorMapShown;_originIndoorLayers;_outdoorLayers;_curVenueId=null;_curVenueFeature=null;_selectedHighlightStyle;_upperLayers=[];_middleLayers=[];_commonLayers=[];_lowerLayers=[];_excludedPoisInMiddle=[];_dispatch=(0,f.A)(v);_fitBuildingBounds;_boundsPadding;_startWithIndoorView;_indoorMapLoaded=!1;_isSelectSharedFloor=!1;_isMaskMode;_upperLevels=new Set;_middleLevels=new Set;_lowerLevels=new Set;_featureIncomplete=!1;_dragPan;_buildingBounds;_venueBounds;_history=p.d.getInstance();_layerBuildings=y.Q.getInstance();_hiddenBuildings=this._layerBuildings.getHiddenBuildings();_maskBuildings=new Set;_maskSharedFloors=new Set;_isDestroyed=!1;_fetchBuildingTimeoutId=null;_fetchVenueTimeoutId=null;_fitBoundsTimer=null;_abortQueryBuilding;_debounceRendering;constructor(t){super();const{map:e,startWithIndoorView:r=!0,outdoorMapShown:n=!0,selectedHighlightStyle:i,fitBuildingBounds:o,boundsPadding:s,maskNonSelectedAreas:a=!1}=t;this._map=e,this._allowOutdoorSwitch=!0,this._allowBuildingSwitch=!0,this._startWithIndoorView=r,this._outdoorMapShown=n,this._isMaskMode=a,this._fitBuildingBounds=o,this._boundsPadding=s,this._selectedHighlightStyle=i?Object.assign({},l.sy,i):l.sy,this._hiddenBuildings=new Set,this._bindMaplibreEventListeners()}destroy(){this._isDestroyed||(this._isDestroyed=!0,this._dispatch.on(`.${v}`,null),this.removeAllListeners(w),this.removeAllListeners(A),this.removeAllListeners(B),this._debounceRendering?.cancel(),this._fetchBuildingTimeoutId&&(clearTimeout(this._fetchBuildingTimeoutId),this._fetchBuildingTimeoutId=null),this._fetchVenueTimeoutId&&(clearTimeout(this._fetchVenueTimeoutId),this._fetchVenueTimeoutId=null),this._fitBoundsTimer&&(clearTimeout(this._fitBoundsTimer),this._fitBoundsTimer=null),this._abortQueryBuilding&&(this._abortQueryBuilding(),this._abortQueryBuilding=null))}setAllowOutdoorSwitch(t){return this._allowOutdoorSwitch=t,this}setAllowBuildingSwitch(t){return this._allowBuildingSwitch=t,this}get floor(){return this._isSelectSharedFloor?this._sharedFloor:this._curBuildingId?this._floor:null}get building(){return this._curBuildingFeature}get venue(){return this._curVenueFeature}get features(){return this._features}getFeaturesById(t,e){const{layerIds:r,filter:n}=e||{},i=this._queryRenderedFeatures(r),o=n?e=>e.properties.id===t&&n(e):e=>e.properties.id===t;return i.filter(o)}async switchFloorByOrdinal(t){this._updateFloorState(t),this._dispatch.call(v,null,{venue:this.venue,building:this.building,floor:this.floor}),this.venue&&t&&(!0===this._dragPan&&(this._fitBuildingBounds?await this.fitBuildingBbox():await this.panToBuildingCenter()),"restrict"===this._dragPan&&await this._checkAndPanToBuilding(),this._resetSelectedDisplayedLevel()),this.updateRendering()}setOutdoorMapShown(t){this._outdoorMapShown=t,this._setOutdoorVisibility(t)}setSelectedHighlightStyle(t){this._selectedHighlightStyle=Object.assign({},this._selectedHighlightStyle,t??{"line-opacity":0});for(const e of[L,k])if(this._map.getLayer(e))if(t){const{lineColor:t,lineOpacity:r,lineWidth:n,lineOffset:i}=this._selectedHighlightStyle,o=T(n,i);this._map.setPaintProperty(e,"line-color",t),this._map.setPaintProperty(e,"line-opacity",r),this._map.setPaintProperty(e,"line-width",n),this._map.setPaintProperty(e,"line-offset",o)}else this._map.setPaintProperty(e,"line-opacity",0)}onMapChange(t){const e=(0,b.A)(`${v}.`);return this._dispatch.on(e,t),{unsubscribe:()=>this._dispatch.on(e,null)}}async selectBuilding(t,e){(this._allowOutdoorSwitch||t)&&this._allowBuildingSwitch&&this._isNotCurrentFeature(t)&&(this._isSelectSharedFloor=!1,this._curSharedLevelId=null,this._featureIncomplete=e?.featureIncomplete??this._featureIncomplete,t?.properties?.id&&this._history.addVisitedBuildingUnit({id:t.properties.id,type:"building"}),await this._updateIndoorState(t,e?.floorId),await this.switchFloorByOrdinal(this._floor.ordinal),this.emit(w,t?{building:t,ordinal:this._floor.ordinal,dragPan:this._dragPan}:null),this._dispatchIndoorMapLoaded())}async selectSharedFloor(t,e,r){const{id:n,ordinal:i}=t;this._isSelectSharedFloor=!0,this._curBuildingId=null,this._curBuildingFeature=null,this._sharedFloor=t,this._curSharedLevelId=n,this._curVenueFeature=e,this._curVenueId=e.properties.id,this._featureIncomplete=r?.featureIncomplete??this._featureIncomplete,this._history.addVisitedBuildingUnit({id:n,type:"sharedFloor"}),this._history.setOrdinalByBuildingUnit(n,i),this._history.setBuildingUnitByVenue(this._curVenueId,{id:n,type:"sharedFloor"}),this._dragPan&&"restrict"!==this._dragPan&&(this._fitBuildingBounds?this.fitVenueBbox():await this.panToVenueCenter()),this._dispatch.call(v,null,{venue:this.venue,building:this.building,floor:this.floor}),this.emit(w,{...t,dragPan:this._dragPan}),this._dispatchIndoorMapLoaded(),this._resetSelectedDisplayedLevel(),this.updateRendering()}updateCustomLayers(){const t=this._map.getStyle();this._originIndoorLayers=(0,i.cq)(t),this._outdoorLayers=(0,i.Z3)(t),this._copyOverlapLayers(),this._copySharedFloorBackgroundLayers(),this._addSelectedHighlightLayers(),this._addReserveFloorLayers(),this._isMaskMode&&this._addBuildingMaskLayer(),this._outdoorMapShown||this._setOutdoorVisibility(!1)}updateRendering(){this._updateFeatures(),this._updateSelectedFeatures(),this._layerFloors(),this._calExcludedPoisInMiddle(),this._filterLayers(),this._filterSelectedHighlight(),this._updateUnselectedMask()}async panToBuildingCenter(){const t=this._curBuildingFeature.properties?.label_center?.split(",");if(!t)return;if(this._map.panTo(t),!this._featureIncomplete)return;const{promise:e,abort:r}=(0,h.B)(()=>{if(!this._isDestroyed)return this._map.getLayer("mapxus-building-line")&&this.getFeaturesById(this._curBuildingId,{layerIds:["mapxus-building-line"]})[0]});this._abortQueryBuilding=r,await e}async fitBuildingBbox(){return this._map.fitBounds(this._buildingBounds,{animate:!0,duration:500,padding:this._boundsPadding,bearing:this._map.getBearing()}),new Promise(t=>{this._fitBoundsTimer=setTimeout(()=>{t(!0),this._fitBoundsTimer=null},600)})}async panToVenueCenter(){const t=this._curVenueFeature.properties?.label_center?.split(",");if(!t)return;if(this._map.panTo(t),!this._featureIncomplete)return;const{promise:e,abort:r}=(0,h.B)(()=>{if(!this._isDestroyed)return this._map.getLayer(E)&&this.getFeaturesById(this._curVenueId,{layerIds:[E]})[0]});this._abortQueryBuilding=r,await e}fitVenueBbox(){this._map.fitBounds(this._venueBounds,{padding:this._boundsPadding,bearing:this._map.getBearing()})}setDragPan(t){this._dragPan=t}setBuildingBounds(t){this._buildingBounds=t}setVenueBounds(t){this._venueBounds=t}async selectByClickMap(t){this.setDragPan(!1),this._featureIncomplete=!1;const e=await this._queryFeatureByPoint(t);if(e){if("building"in e){if(await this.selectBuilding(e.building,{floorId:e.floorId}),this._fitBuildingBounds){const t=e.building;if(!t)return;this._fetchBuildingTimeoutId=setTimeout(()=>this._updateBuildingBounds(t.properties.id))}}else if("sharedLevel"in e&&(await this.selectSharedFloor(e.sharedLevel,e.venue),this._fitBuildingBounds)){const t=e.venue;if(!t)return;this._fetchVenueTimeoutId=setTimeout(()=>this._updateVenueBounds(t.properties.id))}}else await this.selectBuilding(null)}async _updateBuildingBounds(t){const e=await(0,d.pT)(t),{minLon:r,minLat:n,maxLon:i,maxLat:o}=e.bbox;this.setBuildingBounds([[r,n],[i,o]])}async _updateVenueBounds(t){const e=await(0,d.qT)(t),{minLon:r,minLat:n,maxLon:i,maxLat:o}=e.bbox;this.setVenueBounds([[r,n],[i,o]])}_bindMaplibreEventListeners(){this._map.once("styledata",()=>this.updateCustomLayers()),this._map.once("idle",()=>{this.emit(A),(!this._startWithIndoorView||this._map.getZoom()<14)&&this._dispatchIndoorMapLoaded()}),this._map.on("sourcedata",this._debounceRendering=(0,m.A)(()=>this.updateRendering(),300))}_clear(){this._curBuildingFeature=null,this._curBuildingId=null,this._floor={code:null,id:null,ordinal:null},this._curVenueId=null,this._curVenueFeature=null,this._buildingBounds=null,this._curSharedLevelId=null,this._venueBounds=null}_getIndoorFeatures(){return this._queryRenderedFeatures().filter(t=>(0,i.ld)(t.source))}_getBuildingFloorByOrdinal(t,e){let r=null,n=null;if(t?.properties){const{ordinals:i,level_names:o,level_ids:a}=t.properties,c=(0,s.S)(i).findIndex(t=>t===e);r=(0,s.S)(o)[c]??null,n=(0,s.S)(a)[c]??null}return{code:r,id:n,ordinal:e}}_isNotCurrentFeature(t){return t?.properties?.id!==this._curBuildingId}_setOutdoorVisibility(t){for(const{id:e}of this._outdoorLayers)this._map.getLayer(e)&&this._map.setLayoutProperty(e,"visibility",t?"visible":"none")}_addReserveFloorLayers(){for(const t of[a.FI,a.TU]){if(this._map.getLayer(t))continue;const e=t.split("_")[1],r=this._map.getLayer(e);if(!r)continue;const{source:n,sourceLayer:i}=r,o=t===a.FI?this._middleLayers[0]:this._lowerLayers[0];let s={"fill-opacity":0};if(this._isMaskMode&&t===a.TU){const t=this._originIndoorLayers.find(({id:t})=>t===S);t&&(s=Object.assign({},t.paint??{},s))}this._map.addLayer({id:t,source:n,"source-layer":i,type:"fill",paint:s},o.id)}}_addBuildingMaskLayer(){if(this._map.getLayer(c.Zj))return;const t=this._originIndoorLayers.find(({id:t})=>t===S);if(t){const e=Object.assign({},t,{id:c.Zj,layout:Object.assign({},t.layout??{},{visibility:"visible"}),paint:Object.assign({},t.paint??{},{"fill-opacity":0})});this._map.addLayer(e,S)}}_updateUnselectedMask(){if(!this._isMaskMode)return;const t=[...this._maskBuildings],e=[...this._maskSharedFloors];this._map.getLayer(c.Zj)&&this._map.setPaintProperty(c.Zj,"fill-opacity",["case",["in",["get","id"],["literal",t]],1,0]),this._map.getLayer(a.TU)&&this._map.setPaintProperty(a.TU,"fill-opacity",["case",["in",["get","id"],["literal",e]],1,0])}_addSelectedHighlightLayers(){const t=[{layerId:L,sourceLayer:"mapxus_level"},{layerId:k,sourceLayer:"mapxus_shared_level"}];let e=this._originIndoorLayers.find(({type:t})=>V(t));if(!e){const t=this._originIndoorLayers.findIndex(({id:t})=>t===this._upperLayers[this._upperLayers.length-1].id);e=this._originIndoorLayers[t+1]}for(const{layerId:r,sourceLayer:n}of t){if(this._map.getLayer(r))continue;const{lineWidth:t,lineOpacity:i,lineColor:o,lineOffset:s}=this._selectedHighlightStyle,a=T(t,s);this._map.addLayer({id:r,source:"indoor-planet","source-layer":n,type:"line",filter:["==","id",""],paint:{"line-offset":a,"line-width":t,"line-color":o,"line-opacity":i}},e?.id)}}_filterSelectedHighlight(){for(const t of[L,k])this._map.getLayer(t)&&this._map.setFilter(t,["==","id",this._isSelectSharedFloor?this._curSharedLevelId:this._floor.id??""])}_getBuildingDefaultOrdinal(t){let e=null;if(t?.properties){const{level_ids:r,ordinals:n,default_displayed_floor:i}=t.properties,o=(0,s.S)(n);if(o.length){if(i){e=o[(0,s.S)(r).findIndex(t=>t===i)]??null}e||(e=(0,g.A)(o,t=>Math.abs(Number(t)-.1)))}}return e}_copyOverlapLayers(){const t=this._originIndoorLayers.findIndex(({type:t,"source-layer":e})=>R(e,t)),e=this._originIndoorLayers.findIndex(({type:t,"source-layer":e})=>U(e,t));this._commonLayers=this._originIndoorLayers.slice(0,t).concat(this._originIndoorLayers.slice(e)),this._upperLayers=this._originIndoorLayers.slice(t,e).filter(({type:t})=>function(t){return"line"===t||"fill"===t||"fill-extrusion"===t}(t));const r=this._upperLayers[0];this._middleLayers=this._upperLayers.filter(({type:t})=>!V(t)).map(t=>{const e=`${t.id}-overlap-copy`;let n=this._map.getLayer(e);return n||(n=Object.assign({},t,{id:e}),this._map.addLayer(n,r.id)),n})}_copySharedFloorBackgroundLayers(){if(!!!this._upperLayers.find(t=>t.id===a.TU.split("_")[1]))return;const t=this._upperLayers.filter(({"source-layer":t,type:e})=>!M(t,e)&&!V(e)),e=this._commonLayers.filter(({"source-layer":t,type:e})=>U(t,e)),r=this._middleLayers[0]||this._upperLayers[0];this._lowerLayers=[...t,...e].map(t=>{const e=`${t.id}-shared-bg`;let n=this._map.getLayer(e);return n||(n=Object.assign({},t,{id:e}),this._map.addLayer(n,r.id)),n})}_updateFeatures(){this._features=this._getIndoorFeatures();const t=(0,_.A)(this._features,t=>t.layer.id+":"+t.properties.id),e=[],r=[],n=[];for(const i of t){const t=i.layer.id;t===E?e.push(i):t===S?r.push(i):t===a.TU&&n.push(i)}this._allVenuesMap=new Map(e.map(t=>[t.properties.id,t])),this._allBuildingsMap=new Map(r.map(t=>[t.properties.id,t])),this._allSharedLevelsMap=new Map(n.map(t=>[t.properties.id,t]))}_calExcludedPoisInMiddle(){const t=this._map.querySourceFeatures("indoor-planet",{sourceLayer:"mapxus_place"}),e=t=>{if(!t)return!1;return(0,s.S)(t).some(t=>this._upperLevels.has(t))},r=t.filter(t=>{const r=t.properties["ref:level"]||t.properties["ref:shared_level"];return!!this._middleLevels.has(r)&&e(t.properties.overlap)});this._excludedPoisInMiddle=r.map(t=>t.properties["osm:ref"])}_updateSelectedFeatures(){if(this._featureIncomplete){if(this._isSelectSharedFloor){const t=this._features.find(t=>t.properties.id===this._curVenueId);if(!t)return;this._curVenueFeature=t}else{const t=this._allBuildingsMap.get(this._curBuildingId);if(!t)return;this._curBuildingFeature=t}this._featureIncomplete=!1}}_layerFloors(){const{displayedLevels:t,selectedLevelIds:e,alwaysDisplayedSharedLevelIds:r,hiddenBuildingIds:n,maskBuildingIds:i,maskSharedFloorIds:o}=this._classifyFloors();this._isMaskMode&&(this._maskBuildings.clear(),i.forEach(t=>this._maskBuildings.add(t)),this._maskSharedFloors.clear(),o.forEach(t=>this._maskSharedFloors.add(t)),this._upperLevels.clear(),this._middleLevels.clear(),this._lowerLevels.clear()),this._layerSelectedLevels(t,e,r),this._layerUnselectedLevels(t,e,r),n.forEach(t=>{this._hiddenBuildings.has(t)||this._hiddenBuildings.add(t)})}_layerSelectedLevels(t,e,r){for(const n of e){this._upperLevels.has(n)||(this._middleLevels.delete(n),this._lowerLevels.delete(n),this._upperLevels.add(n));const e=t.find(({level:t,overlap:e})=>t===n&&!!e);if(e)for(const t of e.overlap)this._upperLevels.has(t)&&(this._upperLevels.delete(t),r.includes(t)?this._lowerLevels.add(t):this._middleLevels.add(t))}}_layerUnselectedLevels(t,e,r){for(const n of t){if(e.includes(n.level))continue;const{level:t,overlap:i}=n,o=!i||!i.some(t=>this._upperLevels.has(t)),s=r.includes(t);o?s?this._lowerLevels.add(t):this._upperLevels.add(t):s?this._lowerLevels.add(t):this._middleLevels.add(t)}}_classifyFloors(){const t=[],e=[],r=[],n=[],i=[],o=[],a=[...this._allVenuesMap.values()],c=this._curVenueId?[this._allVenuesMap.get(this._curVenueId),...a.filter(t=>t.properties.id!==this._curVenueId)]:a;for(const a of c){if(!a||!a.properties)continue;const{id:c,overlap:u,building_ids:l,shared_level_ids:d,default_displayed_ordinal:h}=a.properties,f=c===this._curVenueId,p=j(u),y=(0,s.S)(l),g=this._history.getBuildingUnitByVenue(c);let m=g?this._history.getOrdinalByBuildingUnit(g.id):h;m||(m=this._setVenueInitOrdinal(c,y)),m&&(y.forEach(r=>{const o=this._allBuildingsMap.get(r),s=this._getBuildingDisplayedLevel(o,m);s?this._isMaskMode?f?(e.push(s),t.push({level:s,overlap:p.get(s)??null})):i.push(r):(t.push({level:s,overlap:p.get(s)??null}),f&&e.push(s)):n.push(r)}),(0,s.S)(d).forEach(i=>{const s=this._allSharedLevelsMap.get(i),{ordinal:a,persistence:c=!1}=s?.properties||{},u=Boolean(c)&&0<=a&&a<=m,l=a===m,d=u||l,h={level:i,overlap:p.get(i)??null};d?this._isMaskMode?f?(t.push(h),u&&r.push(i),l&&e.push(i)):o.push(i):(t.push(h),f&&l&&e.push(i),u&&r.push(i)):n.push(i)}))}return{displayedLevels:t,hiddenBuildingIds:n,maskBuildingIds:i,maskSharedFloorIds:o,alwaysDisplayedSharedLevelIds:r,selectedLevelIds:e}}_setVenueInitOrdinal(t,e){const r=e.find(t=>this._allBuildingsMap.has(t)),n=r?this._allBuildingsMap.get(r):null,i=n?this._getBuildingDefaultOrdinal(n):null;return i&&(this._history.setOrdinalByBuildingUnit(r,i),this._history.setBuildingUnitByVenue(t,{id:r,type:"building"})),i}_getBuildingDisplayedLevel(t,e){if(!t||!t.properties)return null;const{level_ids:r,ordinals:n}=t.properties,i=(0,s.S)(n).findIndex(t=>t===e);return(0,s.S)(r)[i]??null}_filterLayers(){this._filterIndoorLayers([...this._upperLevels,...this._middleLevels],this._commonLayers),this._filterIndoorLayers([...this._upperLevels],this._upperLayers),this._filterIndoorLayers([...this._middleLevels],this._middleLayers),this._filterIndoorLayers([...this._lowerLevels],this._lowerLayers)}_filterIndoorLayers(t,e){let r;for(const n of e){const{id:e,filter:i,type:o,"source-layer":s}=n,a=e.includes("-shared-bg"),c=[...this._maskBuildings],u=[...this._maskSharedFloors];P(s,o)||F(s,o)||(R(s,o)?r=["all",M(s,o)?["!in","ref:building",...c]:["!in","id",...u],["in","id",...t],i]:a?r=["all",["!in","ref:shared_level",...u],["in","ref:shared_level",...t],i]:(r=["all",["any",["all",["!in","ref:building",...c],["in","ref:level",...t]],["all",["!in","ref:shared_level",...u],["in","ref:shared_level",...t]]],i],U(s,o)&&r.splice(1,0,["any",["!has","overlap"],["any",["in","ref:level",...this._upperLevels],["in","ref:shared_level",...this._upperLevels],["!in","osm:ref",...this._excludedPoisInMiddle]]])),this._map.setFilter(e,r))}}async _updateIndoorState(t,e){if(!t)return void this._clear();if(!t.properties)return;const{id:r,"ref:venue":n,level_ids:i,ordinals:a}=t.properties;if(this._curVenueId!==n){this._curVenueId=n;let t=this.getFeaturesById(n,{layerIds:[E]})[0]??null;if(!t)try{const e=(await O.searchByIds(n)).data.result.venues[0];t=(0,o.E)(e)}catch(t){throw t}this._curVenueFeature=t}if(this._curBuildingFeature=t,this._curBuildingId=r,e){const t=(0,s.S)(i).findIndex(t=>t===e);this._floor.ordinal=(0,s.S)(a)[t]??null}else{const e=this._history.getBuildingUnitByVenue(n);this._floor.ordinal=e?this._history.getOrdinalByBuildingUnit(e.id):this._getBuildingDefaultOrdinal(t)}}_updateFloorState(t){if(this._floor={code:null,id:null,ordinal:t},!t)return;const{code:e,id:r}=this._getBuildingFloorByOrdinal(this._curBuildingFeature,t);this._floor.code=e,this._floor.id=r,this._history.setOrdinalByBuildingUnit(this._curBuildingId,t),this._history.setBuildingUnitByVenue(this._curVenueId,{id:this._curBuildingId,type:"building"})}_resetSelectedDisplayedLevel(){const{building_ids:t,shared_level_ids:e}=this._curVenueFeature.properties,r=(0,s.S)(t),n=(0,s.S)(e);for(const t of r){const e=this._allBuildingsMap.get(t);if(!e)continue;const r=(0,s.S)(e.properties.level_ids);n.push(...r),this._hiddenBuildings.delete(t),this._isMaskMode&&this._maskBuildings.delete(t)}for(const t of n)this._upperLevels.delete(t),this._middleLevels.delete(t),this._lowerLevels.delete(t),this._isMaskMode&&this._maskSharedFloors.delete(t)}async _checkAndPanToBuilding(){this.getFeaturesById(this._curBuildingId,{layerIds:[S]})[0]||(this._fitBuildingBounds?this.fitBuildingBbox():await this.panToBuildingCenter())}async _queryFeatureByPoint(t){const e=this._queryVisibleFeature(t);if(!e)return null;let r=null;if(M(e.sourceLayer,e.layer.type)){const{id:t,"ref:building":n}=e.properties;let i=this._allBuildingsMap.get(n);if(!i){const t=await(0,d.pT)(n);i=(0,o.r)(t),this._featureIncomplete=!0}i&&(r={building:i,floorId:t})}else if(H(e.sourceLayer,e.layer.type)){const{id:t,ordinal:n,name:i,"ref:venue":s}=e.properties;let a=this._allVenuesMap.get(s);if(!a){const t=await(0,d.qT)(s);a=(0,o.E)(t),this._featureIncomplete=!0}a&&(r={sharedLevel:{id:t,ordinal:n,name:"string"==typeof i?{default:i}:i},venue:a})}else r={building:e};return r}_queryVisibleFeature(t){const e=[I,x,`${I}-overlap-copy`,`${x}-overlap-copy`,`${x}-shared-bg`,...this._isMaskMode?[c.Zj,a.TU]:[]].filter(t=>!!this._map.getLayer(t)),r=this._map.queryRenderedFeatures(t,{layers:e});let n=null;for(const t of e){const e=r.find(e=>e.layer.id===t);if(e){n=e;break}}return n&&F(n.sourceLayer,n.layer.type)&&(this._maskBuildings.has(n.properties.id)||(n=null)),n}_queryRenderedFeatures(t){const e=(t||[]).filter(t=>this._map.getLayer(t)),r=e.length?{layers:e}:void 0,n=this._map.getCanvas().getBoundingClientRect();return this._map.queryRenderedFeatures([[0,0],[n.width,n.height]],r)}_dispatchIndoorMapLoaded(){this._indoorMapLoaded||(this._indoorMapLoaded=!0,this.emit(B))}}function T(t,e){const r="number"==typeof t&&t===l.sy.lineWidth,n="number"==typeof e&&e===l.sy.lineOffset;return n?r&&n?["interpolate",["linear"],["zoom"],18,-1.5,20.2,-3.75,20.4,-3.8,21.5,-7.5,22,-9.55]:!r&&n?"number"==typeof t?-t/2:e:void 0:e}function P(t,e){return"mapxus_venue"===t&&"fill"===e}function F(t,e){return"mapxus_building"===t&&("fill"===e||"line"===e||"symbol"===e)}function R(t,e){return M(t,e)||H(t,e)}function M(t,e){return"mapxus_level"===t&&("fill"===e||"line"===e)}function H(t,e){return"mapxus_shared_level"===t&&("fill"===e||"line"===e)}function U(t,e){return"mapxus_place"===t&&"symbol"===e}function V(t){return"fill-extrusion"===t}function j(t){const e=new Map;if(!t)return e;for(const r of(0,s.S)(t,"/")){const[t,n]=(0,s.S)(r,":");e.set(t,(0,s.S)(n))}return e}},5647:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=(0,r(367).A)(Object.getPrototypeOf,Object)},5664:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(8182),i=0;const o=function(t){var e=++i;return(0,n.A)(t)+e}},5668:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},5706:(t,e,r)=>{"use strict";r.d(e,{Q:()=>n});class n{static instance;_hiddenBuildings;constructor(){this._hiddenBuildings=new Set}static getInstance(){return n.instance||(n.instance=new n),n.instance}getHiddenBuildings(){return this._hiddenBuildings}}},5707:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},5722:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(608),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g;const s=(0,n.A)(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,function(t,r,n,i){e.push(n?i.replace(o,"$1"):r||t)}),e})},5781:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(1275),i=r(5530),o=r(7809),s=r(4099),a=r(9109),c=r(9959);const u=function(t,e,r){var u=-1,l=i.A,d=t.length,h=!0,f=[],p=f;if(r)h=!1,l=o.A;else if(d>=200){var y=e?null:(0,a.A)(t);if(y)return(0,c.A)(y);h=!1,l=s.A,p=new n.A}else p=e?[]:f;t:for(;++u<d;){var g=t[u],m=e?e(g):g;if(g=r||0!==g?g:0,h&&m==m){for(var _=p.length;_--;)if(p[_]===m)continue t;e&&p.push(m),f.push(g)}else l(p,m,r)||(p!==f&&p.push(m),f.push(g))}return f}},5861:(t,e,r)=>{"use strict";r.d(e,{A:()=>w});var n=r(2732),i=r(8335),o=r(180),s=r(9857),a=r(3631),c=r(9672),u=r(1121),l="[object Map]",d="[object Promise]",h="[object Set]",f="[object WeakMap]",p="[object DataView]",y=(0,u.A)(n.A),g=(0,u.A)(i.A),m=(0,u.A)(o.A),_=(0,u.A)(s.A),b=(0,u.A)(a.A),v=c.A;(n.A&&v(new n.A(new ArrayBuffer(1)))!=p||i.A&&v(new i.A)!=l||o.A&&v(o.A.resolve())!=d||s.A&&v(new s.A)!=h||a.A&&v(new a.A)!=f)&&(v=function(t){var e=(0,c.A)(t),r="[object Object]"==e?t.constructor:void 0,n=r?(0,u.A)(r):"";if(n)switch(n){case y:return p;case g:return l;case m:return d;case _:return h;case b:return f}return e});const w=v},5917:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(5088),i=r(9846),o=r(1521),s=r(2509),a=r(549);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n.A,c.prototype.delete=i.A,c.prototype.get=o.A,c.prototype.has=s.A,c.prototype.set=a.A;const u=c},5997:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}},6031:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}},6034:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(2141),i=r(8672),o=r(1470);const s=function(t,e){return(0,o.A)(t,(0,i.A)((0,n.A)(e)))}},6224:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){return t<e}},6242:(t,e,r)=>{"use strict";r.d(e,{k:()=>a});var n=r(7007),i=r(5537),o=r(3574),s=r(3207);class a extends n.EventEmitter{_appId=null;_secret=null;isClosed=!1;_timeoutId;_isInitialized=!1;_initializationPromise;_tokenManager=s.t.getInstance();_from;constructor(t,e,r=o.en.Access){super(),this._from=r,this._appId=t,this._secret=e,this._initializationPromise=this._initToken()}async ready(){await this._initializationPromise}get appId(){return this._appId}get token(){if(!this._isInitialized)throw new Error("Token is not initialized yet. Use the 'ready' method to wait for initialization.");return this._tokenManager.getToken(this._appId)}close(){this.isClosed||(this._timeoutId&&clearTimeout(this._timeoutId),this._tokenManager.deleteToken(this._appId,this._from),this.emit("updated",{appId:this._appId,token:null}),Object.keys(this).forEach(t=>{"isClosed"!==t&&"_events"!==t&&delete this[t]}),this.isClosed=!0,this.emit("closed"),delete this._events,Object.freeze(this))}forceUpdateToken(){this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=null),this._isInitialized=!1,this._initializationPromise=this._initToken()}async _initToken(){try{const t=await this._tokenManager.fetchToken(this._appId,this._secret);this._isInitialized=!0,this._tokenManager.updateToken({appId:this._appId,secret:this._secret,token:t,from:this._from});const e=(0,i.s)(t),r=1e3*(e.exp-e.iat-60);this._loopUpdateToken(r)}catch(t){throw this.emit("error",new Error("Failed to initialize token.",{cause:t})),t}}_loopUpdateToken(t){this.isClosed||(this._timeoutId=setTimeout(async()=>{try{const e=await this._tokenManager.fetchToken(this._appId,this._secret);this._tokenManager.updateToken({appId:this._appId,secret:this._secret,token:e,from:this._from}),this.emit("updated",{appId:this._appId,token:e}),this._loopUpdateToken(t)}catch(t){this.emit("error",new Error("Failed to update token.",{cause:t}))}},t))}}},6294:(t,e,r)=>{"use strict";r.d(e,{B:()=>n});class n{_indoor;_isEnabled=!0;constructor(t){this._indoor=t}enable(){this._isEnabled=!0,this._indoor.setAllowOutdoorSwitch(!0)}disable(){this._isEnabled=!1,this._indoor.setAllowOutdoorSwitch(!1)}get isEnabled(){return this._isEnabled}}},6318:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(7465),i=r(901);const o=function(t,e){for(var r=0,o=(e=(0,n.A)(e,t)).length;null!=t&&r<o;)t=t[(0,i.A)(e[r++])];return r&&r==o?t:void 0}},6358:(t,e,r)=>{"use strict";var n,i,o,s;r.d(e,{Kp:()=>n,LJ:()=>o,_P:()=>i,nH:()=>s}),function(t){t.POINT="Point",t.POLYGON="Polygon"}(n||(n={})),function(t){t.POINT="Point",t.POLYGON="Polygon",t.GATE="Gate"}(i||(i={})),function(t){t.DEFAULT_NAME="DefaultName"}(o||(o={})),function(t){t.ABSOLUTE_DISTANCE="AbsoluteDistance",t.ACTUAL_DISTANCE="ActualDistance"}(s||(s={}))},6377:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.edwards=d,e.eddsa=h,e.twistedEdwards=function(t){const{CURVE:e,curveOpts:r,eddsaOpts:n}=function(t){const e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r=t.Fp,n=(0,o.Field)(e.n,t.nBitLength,!0),i={Fp:r,Fn:n,uvRatio:t.uvRatio},s={hash:t.hash,randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve};return{CURVE:e,curveOpts:i,eddsaOpts:s}}(t),i=h(d(e,r),n);return function(t,e){const r=Object.assign({},e,{ExtendedPoint:e.Point,CURVE:t});return r}(t,i)};const n=r(8627),i=r(2422),o=r(4967),s=BigInt(0),a=BigInt(1),c=BigInt(2),u=BigInt(8),l={zip215:!0};function d(t,e={}){const{Fp:r,Fn:o}=(0,i._createCurveFields)("edwards",t,e),{h:l,n:d}=t;(0,n._validateObject)(e,{},{uvRatio:"function"});const h=c<<BigInt(8*o.BYTES)-a,f=t=>r.create(t),p=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:r.sqrt(r.div(t,e))}}catch(t){return{isValid:!1,value:s}}});if(!function(t,e,r,n){const i=t.sqr(r),o=t.sqr(n),s=t.add(t.mul(e.a,i),o),a=t.add(t.ONE,t.mul(e.d,t.mul(i,o)));return t.eql(s,a)}(r,t,t.Gx,t.Gy))throw new Error("bad curve params: generator point");function y(t,e,r=!1){const i=r?a:s;return(0,n.aInRange)("coordinate "+t,e,i,h),e}function g(t){if(!(t instanceof b))throw new Error("ExtendedPoint expected")}const m=(0,n.memoized)((t,e)=>{const{ex:n,ey:i,ez:o}=t,c=t.is0();null==e&&(e=c?u:r.inv(o));const l=f(n*e),d=f(i*e),h=f(o*e);if(c)return{x:s,y:a};if(h!==a)throw new Error("invZ was invalid");return{x:l,y:d}}),_=(0,n.memoized)(e=>{const{a:r,d:n}=t;if(e.is0())throw new Error("bad point: ZERO");const{ex:i,ey:o,ez:s,et:a}=e,c=f(i*i),u=f(o*o),l=f(s*s),d=f(l*l),h=f(c*r);if(f(l*f(h+u))!==f(d+f(n*f(c*u))))throw new Error("bad point: equation left != right (1)");if(f(i*o)!==f(s*a))throw new Error("bad point: equation left != right (2)");return!0});class b{constructor(t,e,r,n){this.ex=y("x",t),this.ey=y("y",e),this.ez=y("z",r,!0),this.et=y("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(t){if(t instanceof b)throw new Error("extended point not allowed");const{x:e,y:r}=t||{};return y("x",e),y("y",r),new b(e,r,a,f(e*r))}static normalizeZ(t){return(0,i.normalizeZ)(b,"ez",t)}static msm(t,e){return(0,i.pippenger)(b,o,t,e)}_setWindowSize(t){this.precompute(t)}precompute(t=8,e=!0){return v.setWindowSize(this,t),e||this.multiply(c),this}assertValidity(){_(this)}equals(t){g(t);const{ex:e,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=t,a=f(e*s),c=f(i*n),u=f(r*s),l=f(o*n);return a===c&&u===l}is0(){return this.equals(b.ZERO)}negate(){return new b(f(-this.ex),this.ey,this.ez,f(-this.et))}double(){const{a:e}=t,{ex:r,ey:n,ez:i}=this,o=f(r*r),s=f(n*n),a=f(c*f(i*i)),u=f(e*o),l=r+n,d=f(f(l*l)-o-s),h=u+s,p=h-a,y=u-s,g=f(d*p),m=f(h*y),_=f(d*y),v=f(p*h);return new b(g,m,v,_)}add(e){g(e);const{a:r,d:n}=t,{ex:i,ey:o,ez:s,et:a}=this,{ex:c,ey:u,ez:l,et:d}=e,h=f(i*c),p=f(o*u),y=f(a*n*d),m=f(s*l),_=f((i+o)*(c+u)-h-p),v=m-y,w=m+y,B=f(p-r*h),A=f(_*v),E=f(w*B),S=f(_*B),I=f(v*w);return new b(A,E,I,S)}subtract(t){return this.add(t.negate())}multiply(t){const e=t;(0,n.aInRange)("scalar",e,a,d);const{p:r,f:i}=v.wNAFCached(this,e,b.normalizeZ);return b.normalizeZ([r,i])[0]}multiplyUnsafe(t,e=b.ZERO){const r=t;return(0,n.aInRange)("scalar",r,s,d),r===s?b.ZERO:this.is0()||r===a?this:v.wNAFCachedUnsafe(this,r,b.normalizeZ,e)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return v.wNAFCachedUnsafe(this,d).is0()}toAffine(t){return m(this,t)}clearCofactor(){return l===a?this:this.multiplyUnsafe(l)}static fromBytes(t,e=!1){return(0,n.abytes)(t),this.fromHex(t,e)}static fromHex(e,i=!1){const{d:o,a:c}=t,u=r.BYTES;e=(0,n.ensureBytes)("pointHex",e,u),(0,n.abool)("zip215",i);const l=e.slice(),d=e[u-1];l[u-1]=-129&d;const y=(0,n.bytesToNumberLE)(l),g=i?h:r.ORDER;(0,n.aInRange)("pointHex.y",y,s,g);const m=f(y*y),_=f(m-a),v=f(o*m-c);let{isValid:w,value:B}=p(_,v);if(!w)throw new Error("Point.fromHex: invalid y coordinate");const A=(B&a)===a,E=!!(128&d);if(!i&&B===s&&E)throw new Error("Point.fromHex: x=0 and x_0=1");return E!==A&&(B=f(-B)),b.fromAffine({x:B,y})}static fromPrivateScalar(t){return b.BASE.multiply(t)}toBytes(){const{x:t,y:e}=this.toAffine(),i=(0,n.numberToBytesLE)(e,r.BYTES);return i[i.length-1]|=t&a?128:0,i}toRawBytes(){return this.toBytes()}toHex(){return(0,n.bytesToHex)(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}b.BASE=new b(t.Gx,t.Gy,a,f(t.Gx*t.Gy)),b.ZERO=new b(s,a,a,s),b.Fp=r,b.Fn=o;const v=(0,i.wNAF)(b,8*o.BYTES);return b}function h(t,e){(0,n._validateObject)(e,{hash:"function"},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:r,hash:i}=e,{BASE:o,Fp:a,Fn:c}=t,u=c.ORDER,d=e.randomBytes||n.randomBytes,h=e.adjustScalarBytes||(t=>t),f=e.domain||((t,e,r)=>{if((0,n.abool)("phflag",r),e.length||r)throw new Error("Contexts/pre-hash are not supported");return t});function p(t){return c.create(t)}function y(t){return p((0,n.bytesToNumberLE)(t))}function g(t){const{head:e,prefix:r,scalar:s}=function(t){const e=a.BYTES;t=(0,n.ensureBytes)("private key",t,e);const r=(0,n.ensureBytes)("hashed private key",i(t),2*e),o=h(r.slice(0,e));return{head:o,prefix:r.slice(e,2*e),scalar:y(o)}}(t),c=o.multiply(s),u=c.toBytes();return{head:e,prefix:r,scalar:s,point:c,pointBytes:u}}function m(t=Uint8Array.of(),...e){const o=(0,n.concatBytes)(...e);return y(i(f(o,(0,n.ensureBytes)("context",t),!!r)))}const _=l;o.precompute(8);return{getPublicKey:function(t){return g(t).pointBytes},sign:function(t,e,i={}){t=(0,n.ensureBytes)("message",t),r&&(t=r(t));const{prefix:c,scalar:l,pointBytes:d}=g(e),h=m(i.context,c,t),f=o.multiply(h).toBytes(),y=p(h+m(i.context,f,d,t)*l);(0,n.aInRange)("signature.s",y,s,u);const _=a.BYTES,b=(0,n.concatBytes)(f,(0,n.numberToBytesLE)(y,_));return(0,n.ensureBytes)("result",b,2*_)},verify:function(e,i,s,c=_){const{context:u,zip215:l}=c,d=a.BYTES;e=(0,n.ensureBytes)("signature",e,2*d),i=(0,n.ensureBytes)("message",i),s=(0,n.ensureBytes)("publicKey",s,d),void 0!==l&&(0,n.abool)("zip215",l),r&&(i=r(i));const h=(0,n.bytesToNumberLE)(e.slice(d,2*d));let f,p,y;try{f=t.fromHex(s,l),p=t.fromHex(e.slice(0,d),l),y=o.multiplyUnsafe(h)}catch(t){return!1}if(!l&&f.isSmallOrder())return!1;const g=m(u,p.toBytes(),f.toBytes(),i);return p.add(f.multiplyUnsafe(g)).subtract(y).clearCofactor().is0()},utils:{getExtendedPublicKey:g,randomPrivateKey:()=>d(a.BYTES),precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)},Point:t}}},6474:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(1038),i=r(7500),o=r(7511),s=r(6586),a=r(9396),c=r(5997),u=r(901);const l=function(t,e){return(0,s.A)(t)&&(0,a.A)(e)?(0,c.A)((0,u.A)(t),e):function(r){var s=(0,i.A)(r,t);return void 0===s&&s===e?(0,o.A)(r,t):(0,n.A)(e,s,3)}}},6527:(t,e)=>{"use strict";function r(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function n(t){if("boolean"!=typeof t)throw new Error(`boolean expected, not ${t}`)}function i(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function o(t,...e){if(!r(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function s(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}Object.defineProperty(e,"__esModule",{value:!0}),e.wrapCipher=e.Hash=e.nextTick=e.isLE=void 0,e.isBytes=r,e.abool=n,e.anumber=i,e.abytes=o,e.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");i(t.outputLen),i(t.blockLen)},e.aexists=function(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")},e.aoutput=function(t,e){o(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},e.u8=function(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},e.u32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))},e.clean=function(...t){for(let e=0;e<t.length;e++)t[e].fill(0)},e.createView=s,e.bytesToHex=u,e.hexToBytes=h,e.hexToNumber=f,e.bytesToNumberBE=function(t){return f(u(t))},e.numberToBytesBE=function(t,e){return h(t.toString(16).padStart(2*e,"0"))},e.utf8ToBytes=p,e.bytesToUtf8=function(t){return(new TextDecoder).decode(t)},e.toBytes=function(t){if("string"==typeof t)t=p(t);else{if(!r(t))throw new Error("Uint8Array expected, got "+typeof t);t=_(t)}return t},e.overlapBytes=y,e.complexOverlapBytes=function(t,e){if(y(t,e)&&t.byteOffset<e.byteOffset)throw new Error("complex overlap of input and output is not supported")},e.concatBytes=function(...t){let e=0;for(let r=0;r<t.length;r++){const n=t[r];o(n),e+=n.length}const r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const i=t[e];r.set(i,n),n+=i.length}return r},e.checkOpts=function(t,e){if(null==e||"object"!=typeof e)throw new Error("options must be defined");return Object.assign(t,e)},e.equalBytes=function(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r},e.getOutput=function(t,e,r=!0){if(void 0===e)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(r&&!m(e))throw new Error("invalid output, must be aligned");return e},e.setBigUint64=g,e.u64Lengths=function(t,e,r){n(r);const i=new Uint8Array(16),o=s(i);return g(o,0,BigInt(e),r),g(o,8,BigInt(t),r),i},e.isAligned32=m,e.copyBytes=_,e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];const a=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),c=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function u(t){if(o(t),a)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=c[t[r]];return e}const l={_0:48,_9:57,A:65,F:70,a:97,f:102};function d(t){return t>=l._0&&t<=l._9?t-l._0:t>=l.A&&t<=l.F?t-(l.A-10):t>=l.a&&t<=l.f?t-(l.a-10):void 0}function h(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(a)return Uint8Array.fromHex(t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let e=0,i=0;e<r;e++,i+=2){const r=d(t.charCodeAt(i)),o=d(t.charCodeAt(i+1));if(void 0===r||void 0===o){const e=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+i)}n[e]=16*r+o}return n}function f(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":"0x"+t)}function p(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function y(t,e){return t.buffer===e.buffer&&t.byteOffset<e.byteOffset+e.byteLength&&e.byteOffset<t.byteOffset+t.byteLength}e.nextTick=async()=>{};e.Hash=class{};function g(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;t.setUint32(e+c,s,n),t.setUint32(e+u,a,n)}function m(t){return t.byteOffset%4==0}function _(t){return Uint8Array.from(t)}e.wrapCipher=(t,r)=>{function n(n,...i){if(o(n),!e.isLE)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==t.nonceLength){const e=i[0];if(!e)throw new Error("nonce / iv required");t.varSizeNonce?o(e):o(e,t.nonceLength)}const s=t.tagLength;s&&void 0!==i[1]&&o(i[1]);const a=r(n,...i),c=(t,e)=>{if(void 0!==e){if(2!==t)throw new Error("cipher output not supported");o(e)}};let u=!1;return{encrypt(t,e){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,o(t),c(a.encrypt.length,e),a.encrypt(t,e)},decrypt(t,e){if(o(t),s&&t.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return c(a.decrypt.length,e),a.decrypt(t,e)}}}return Object.assign(n,t),n}},6568:(t,e,r)=>{"use strict";r.d(e,{Ay:()=>Lt});var n=r(1635),i="4.6.2";function o(t,e){return new Promise(function(r){return setTimeout(r,t,e)})}function s(t){return!!t&&"function"==typeof t.then}function a(t,e){try{var r=t();s(r)?r.then(function(t){return e(!0,t)},function(t){return e(!1,t)}):e(!0,r)}catch(t){e(!1,t)}}function c(t,e,r){return void 0===r&&(r=16),(0,n.sH)(this,void 0,void 0,function(){var i,o,s,a;return(0,n.YH)(this,function(n){switch(n.label){case 0:i=Array(t.length),o=Date.now(),s=0,n.label=1;case 1:return s<t.length?(i[s]=e(t[s],s),(a=Date.now())>=o+r?(o=a,[4,new Promise(function(t){var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(null)})]):[3,3]):[3,4];case 2:n.sent(),n.label=3;case 3:return++s,[3,1];case 4:return[2,i]}})})}function u(t){return t.then(void 0,function(){}),t}function l(t){return parseInt(t)}function d(t){return parseFloat(t)}function h(t,e){return"number"==typeof t&&isNaN(t)?e:t}function f(t){return t.reduce(function(t,e){return t+(e?1:0)},0)}function p(t,e){if(void 0===e&&(e=1),Math.abs(e)>=1)return Math.round(t/e)*e;var r=1/e;return Math.round(t*r)/r}function y(t,e){var r=t[0]>>>16,n=65535&t[0],i=t[1]>>>16,o=65535&t[1],s=e[0]>>>16,a=65535&e[0],c=e[1]>>>16,u=0,l=0,d=0,h=0;d+=(h+=o+(65535&e[1]))>>>16,h&=65535,l+=(d+=i+c)>>>16,d&=65535,u+=(l+=n+a)>>>16,l&=65535,u+=r+s,u&=65535,t[0]=u<<16|l,t[1]=d<<16|h}function g(t,e){var r=t[0]>>>16,n=65535&t[0],i=t[1]>>>16,o=65535&t[1],s=e[0]>>>16,a=65535&e[0],c=e[1]>>>16,u=65535&e[1],l=0,d=0,h=0,f=0;h+=(f+=o*u)>>>16,f&=65535,d+=(h+=i*u)>>>16,h&=65535,d+=(h+=o*c)>>>16,h&=65535,l+=(d+=n*u)>>>16,d&=65535,l+=(d+=i*c)>>>16,d&=65535,l+=(d+=o*a)>>>16,d&=65535,l+=r*u+n*c+i*a+o*s,l&=65535,t[0]=l<<16|d,t[1]=h<<16|f}function m(t,e){var r=t[0];32===(e%=64)?(t[0]=t[1],t[1]=r):e<32?(t[0]=r<<e|t[1]>>>32-e,t[1]=t[1]<<e|r>>>32-e):(e-=32,t[0]=t[1]<<e|r>>>32-e,t[1]=r<<e|t[1]>>>32-e)}function _(t,e){0!==(e%=64)&&(e<32?(t[0]=t[1]>>>32-e,t[1]=t[1]<<e):(t[0]=t[1]<<e-32,t[1]=0))}function b(t,e){t[0]^=e[0],t[1]^=e[1]}var v=[4283543511,3981806797],w=[3301882366,444984403];function B(t){var e=[0,t[0]>>>1];b(t,e),g(t,v),e[1]=t[0]>>>1,b(t,e),g(t,w),e[1]=t[0]>>>1,b(t,e)}var A=[2277735313,289559509],E=[1291169091,658871167],S=[0,5],I=[0,1390208809],x=[0,944331445];function L(t,e){var r=function(t){for(var e=new Uint8Array(t.length),r=0;r<t.length;r++){var n=t.charCodeAt(r);if(n>127)return(new TextEncoder).encode(t);e[r]=n}return e}(t);e=e||0;var n,i=[0,r.length],o=i[1]%16,s=i[1]-o,a=[0,e],c=[0,e],u=[0,0],l=[0,0];for(n=0;n<s;n+=16)u[0]=r[n+4]|r[n+5]<<8|r[n+6]<<16|r[n+7]<<24,u[1]=r[n]|r[n+1]<<8|r[n+2]<<16|r[n+3]<<24,l[0]=r[n+12]|r[n+13]<<8|r[n+14]<<16|r[n+15]<<24,l[1]=r[n+8]|r[n+9]<<8|r[n+10]<<16|r[n+11]<<24,g(u,A),m(u,31),g(u,E),b(a,u),m(a,27),y(a,c),g(a,S),y(a,I),g(l,E),m(l,33),g(l,A),b(c,l),m(c,31),y(c,a),g(c,S),y(c,x);u[0]=0,u[1]=0,l[0]=0,l[1]=0;var d=[0,0];switch(o){case 15:d[1]=r[n+14],_(d,48),b(l,d);case 14:d[1]=r[n+13],_(d,40),b(l,d);case 13:d[1]=r[n+12],_(d,32),b(l,d);case 12:d[1]=r[n+11],_(d,24),b(l,d);case 11:d[1]=r[n+10],_(d,16),b(l,d);case 10:d[1]=r[n+9],_(d,8),b(l,d);case 9:d[1]=r[n+8],b(l,d),g(l,E),m(l,33),g(l,A),b(c,l);case 8:d[1]=r[n+7],_(d,56),b(u,d);case 7:d[1]=r[n+6],_(d,48),b(u,d);case 6:d[1]=r[n+5],_(d,40),b(u,d);case 5:d[1]=r[n+4],_(d,32),b(u,d);case 4:d[1]=r[n+3],_(d,24),b(u,d);case 3:d[1]=r[n+2],_(d,16),b(u,d);case 2:d[1]=r[n+1],_(d,8),b(u,d);case 1:d[1]=r[n],b(u,d),g(u,A),m(u,31),g(u,E),b(a,u)}return b(a,i),b(c,i),y(a,c),y(c,a),B(a),B(c),y(a,c),y(c,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(c[0]>>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)}function k(t){return"function"!=typeof t}function O(t,e,r,i){var o=Object.keys(t).filter(function(t){return!function(t,e){for(var r=0,n=t.length;r<n;++r)if(t[r]===e)return!0;return!1}(r,t)}),s=u(c(o,function(r){return function(t,e){var r=u(new Promise(function(r){var n=Date.now();a(t.bind(null,e),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=Date.now()-n;if(!t[0])return r(function(){return{error:t[1],duration:i}});var o=t[1];if(k(o))return r(function(){return{value:o,duration:i}});r(function(){return new Promise(function(t){var e=Date.now();a(o,function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=i+Date.now()-e;if(!r[0])return t({error:r[1],duration:o});t({value:r[1],duration:o})})})})})}));return function(){return r.then(function(t){return t()})}}(t[r],e)},i));return function(){return(0,n.sH)(this,void 0,void 0,function(){var t,e,r,a;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,s];case 1:return[4,c(n.sent(),function(t){return u(t())},i)];case 2:return t=n.sent(),[4,Promise.all(t)];case 3:for(e=n.sent(),r={},a=0;a<o.length;++a)r[o[a]]=e[a];return[2,r]}})})}}function C(){var t=window,e=navigator;return f(["MSCSSMatrix"in t,"msSetImmediate"in t,"msIndexedDB"in t,"msMaxTouchPoints"in e,"msPointerEnabled"in e])>=4}function T(){var t=window,e=navigator;return f(["webkitPersistentStorage"in e,"webkitTemporaryStorage"in e,0===(e.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in t,"BatteryManager"in t,"webkitMediaStream"in t,"webkitSpeechGrammar"in t])>=5}function P(){var t=window;return f(["ApplePayError"in t,"CSSPrimitiveValue"in t,"Counter"in t,0===navigator.vendor.indexOf("Apple"),"RGBColor"in t,"WebKitMediaKeys"in t])>=4}function F(){var t=window,e=t.HTMLElement,r=t.Document;return f(["safari"in t,!("ongestureend"in t),!("TouchEvent"in t),!("orientation"in t),e&&!("autocapitalize"in e.prototype),r&&"pointerLockElement"in r.prototype])>=4}function R(){var t,e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser)}function M(){var t,e,r=window;return f(["buildID"in navigator,"MozAppearance"in(null!==(e=null===(t=document.documentElement)||void 0===t?void 0:t.style)&&void 0!==e?e:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}function H(){var t=window,e=navigator,r=t.CSS,n=t.HTMLButtonElement;return f([!("getStorageUpdates"in e),n&&"popover"in n.prototype,"CSSCounterStyleRule"in t,r.supports("font-size-adjust: ex-height 0.5"),r.supports("text-transform: full-width")])>=4}function U(){var t=document;return(t.exitFullscreen||t.msExitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen).call(t)}function V(){var t=T(),e=M(),r=window,n=navigator,i="connection";return t?f([!("SharedWorker"in r),n[i]&&"ontypechange"in n[i],!("sinkId"in new Audio)])>=2:!!e&&f(["onorientationchange"in r,"orientation"in r,/android/i.test(n.appVersion)])>=2}function j(t){var e=new Error(t);return e.name=t,e}function N(t,e,r){var i,s,a;return void 0===r&&(r=50),(0,n.sH)(this,void 0,void 0,function(){var c,u;return(0,n.YH)(this,function(n){switch(n.label){case 0:c=document,n.label=1;case 1:return c.body?[3,3]:[4,o(r)];case 2:return n.sent(),[3,1];case 3:u=c.createElement("iframe"),n.label=4;case 4:return n.trys.push([4,,10,11]),[4,new Promise(function(t,r){var n=!1,i=function(){n=!0,t()};u.onload=i,u.onerror=function(t){n=!0,r(t)};var o=u.style;o.setProperty("display","block","important"),o.position="absolute",o.top="0",o.left="0",o.visibility="hidden",e&&"srcdoc"in u?u.srcdoc=e:u.src="about:blank",c.body.appendChild(u);var s=function(){var t,e;n||("complete"===(null===(e=null===(t=u.contentWindow)||void 0===t?void 0:t.document)||void 0===e?void 0:e.readyState)?i():setTimeout(s,10))};s()})];case 5:n.sent(),n.label=6;case 6:return(null===(s=null===(i=u.contentWindow)||void 0===i?void 0:i.document)||void 0===s?void 0:s.body)?[3,8]:[4,o(r)];case 7:return n.sent(),[3,6];case 8:return[4,t(u,u.contentWindow)];case 9:return[2,n.sent()];case 10:return null===(a=u.parentNode)||void 0===a||a.removeChild(u),[7];case 11:return[2]}})})}function D(t){for(var e=function(t){for(var e,r,n="Unexpected syntax '".concat(t,"'"),i=/^\s*([a-z-]*)(.*)$/i.exec(t),o=i[1]||void 0,s={},a=/([.:#][\w-]+|\[.+?\])/gi,c=function(t,e){s[t]=s[t]||[],s[t].push(e)};;){var u=a.exec(i[2]);if(!u)break;var l=u[0];switch(l[0]){case".":c("class",l.slice(1));break;case"#":c("id",l.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);if(!d)throw new Error(n);c(d[1],null!==(r=null!==(e=d[4])&&void 0!==e?e:d[5])&&void 0!==r?r:"");break;default:throw new Error(n)}}return[o,s]}(t),r=e[0],n=e[1],i=document.createElement(null!=r?r:"div"),o=0,s=Object.keys(n);o<s.length;o++){var a=s[o],c=n[a].join(" ");"style"===a?$(i.style,c):i.setAttribute(a,c)}return i}function $(t,e){for(var r=0,n=e.split(";");r<n.length;r++){var i=n[r],o=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);if(o){var s=o[1],a=o[2],c=o[4];t.setProperty(s,a,c||"")}}}var z=["monospace","sans-serif","serif"],G=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function W(t){return t.toDataURL()}var Z,q;function K(){var t=this;return function(){if(void 0===q){var t=function(){var e=Y();X(e)?q=setTimeout(t,2500):(Z=e,q=void 0)};t()}}(),function(){return(0,n.sH)(t,void 0,void 0,function(){var t;return(0,n.YH)(this,function(e){switch(e.label){case 0:return X(t=Y())?Z?[2,(0,n.fX)([],Z,!0)]:(r=document).fullscreenElement||r.msFullscreenElement||r.mozFullScreenElement||r.webkitFullscreenElement?[4,U()]:[3,2]:[3,2];case 1:e.sent(),t=Y(),e.label=2;case 2:return X(t)||(Z=t),[2,t]}var r})})}}function Y(){var t=screen;return[h(d(t.availTop),null),h(d(t.width)-d(t.availWidth)-h(d(t.availLeft),0),null),h(d(t.height)-d(t.availHeight)-h(d(t.availTop),0),null),h(d(t.availLeft),null)]}function X(t){for(var e=0;e<4;++e)if(t[e])return!1;return!0}function J(t){var e;return(0,n.sH)(this,void 0,void 0,function(){var r,i,s,a,c,u,l;return(0,n.YH)(this,function(n){switch(n.label){case 0:for(r=document,i=r.createElement("div"),s=new Array(t.length),a={},Q(i),l=0;l<t.length;++l)"DIALOG"===(c=D(t[l])).tagName&&c.show(),Q(u=r.createElement("div")),u.appendChild(c),i.appendChild(u),s[l]=c;n.label=1;case 1:return r.body?[3,3]:[4,o(50)];case 2:return n.sent(),[3,1];case 3:r.body.appendChild(i);try{for(l=0;l<t.length;++l)s[l].offsetParent||(a[t[l]]=!0)}finally{null===(e=i.parentNode)||void 0===e||e.removeChild(i)}return[2,a]}})})}function Q(t){t.style.setProperty("visibility","hidden","important"),t.style.setProperty("display","block","important")}function tt(t){return matchMedia("(inverted-colors: ".concat(t,")")).matches}function et(t){return matchMedia("(forced-colors: ".concat(t,")")).matches}function rt(t){return matchMedia("(prefers-contrast: ".concat(t,")")).matches}function nt(t){return matchMedia("(prefers-reduced-motion: ".concat(t,")")).matches}function it(t){return matchMedia("(prefers-reduced-transparency: ".concat(t,")")).matches}function ot(t){return matchMedia("(dynamic-range: ".concat(t,")")).matches}var st=Math,at=function(){return 0};var ct={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};var ut=function(){for(var t=window;;){var e=t.parent;if(!e||e===t)return!1;try{if(e.location.origin!==t.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}t=e}};var lt=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),dt=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),ht=["FRAGMENT_SHADER","VERTEX_SHADER"],ft=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],pt="WEBGL_debug_renderer_info";function yt(t){if(t.webgl)return t.webgl.context;var e,r=document.createElement("canvas");r.addEventListener("webglCreateContextError",function(){return e=void 0});for(var n=0,i=["webgl","experimental-webgl"];n<i.length;n++){var o=i[n];try{e=r.getContext(o)}catch(t){}if(e)break}return t.webgl={context:e},e}function gt(t,e,r){var n=t.getShaderPrecisionFormat(t[e],t[r]);return n?[n.rangeMin,n.rangeMax,n.precision]:[]}function mt(t){return Object.keys(t.__proto__).filter(_t)}function _t(t){return"string"==typeof t&&!t.match(/[^A-Z0-9_x]/)}function bt(){return M()}function vt(){return T()||P()}function wt(t){return"function"==typeof t.getParameter}var Bt={fonts:function(){var t=this;return N(function(e,r){var i=r.document;return(0,n.sH)(t,void 0,void 0,function(){var t,e,r,o,s,a,c,u,l,d,h;return(0,n.YH)(this,function(n){for((t=i.body).style.fontSize="48px",(e=i.createElement("div")).style.setProperty("visibility","hidden","important"),r={},o={},s=function(t){var r=i.createElement("span"),n=r.style;return n.position="absolute",n.top="0",n.left="0",n.fontFamily=t,r.textContent="mmMwWLliI0O&1",e.appendChild(r),r},a=function(t,e){return s("'".concat(t,"',").concat(e))},c=function(){for(var t={},e=function(e){t[e]=z.map(function(t){return a(e,t)})},r=0,n=G;r<n.length;r++){e(n[r])}return t},u=function(t){return z.some(function(e,n){return t[n].offsetWidth!==r[e]||t[n].offsetHeight!==o[e]})},l=function(){return z.map(s)}(),d=c(),t.appendChild(e),h=0;h<z.length;h++)r[z[h]]=l[h].offsetWidth,o[z[h]]=l[h].offsetHeight;return[2,G.filter(function(t){return u(d[t])})]})})})},domBlockers:function(t){var e=(void 0===t?{}:t).debug;return(0,n.sH)(this,void 0,void 0,function(){var t,r,i,o,s;return(0,n.YH)(this,function(n){switch(n.label){case 0:return P()||V()?(a=atob,t={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',a("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",a("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",a("LnNwb25zb3JpdA=="),".ylamainos",a("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",a("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",a("LmhlYWRlci1ibG9ja2VkLWFk"),a("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",a("I2FkXzMwMFgyNTA="),a("I2Jhbm5lcmZsb2F0MjI="),a("I2NhbXBhaWduLWJhbm5lcg=="),a("I0FkLUNvbnRlbnQ=")],adGuardChinese:[a("LlppX2FkX2FfSA=="),a("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",a("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),a("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",a("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",a("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",a("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),a("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),a("LmFkZ29vZ2xl"),a("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[a("YW1wLWF1dG8tYWRz"),a("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",a("I2FkX2ludmlld19hcmVh")],adGuardRussian:[a("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),a("LnJlY2xhbWE="),'div[id^="smi2adblock"]',a("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[a("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),a("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",a("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),a("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),a("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",a("I3Jla2xhbWk="),a("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),a("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),a("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[a("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",a("LndpZGdldF9wb19hZHNfd2lkZ2V0"),a("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",a("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[a("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),a("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",a("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",a("I3Jla2xhbW5pLWJveA=="),a("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",a("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[a("I2FkdmVydGVudGll"),a("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",a("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",a("LnNwb25zb3JsaW5rZ3J1ZW4="),a("I3dlcmJ1bmdza3k="),a("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),a("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[a("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",a("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[a("LnJla2xhbW9zX3RhcnBhcw=="),a("LnJla2xhbW9zX251b3JvZG9z"),a("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),a("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),a("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[a("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[a("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),a("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",a("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[a("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),a("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),a("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",a("LmFkX19tYWlu"),a("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[a("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[a("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),a("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[a("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),a("I2xpdmVyZUFkV3JhcHBlcg=="),a("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),a("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[a("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",a("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),a("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),a("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[a("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),a("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),a("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",a("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),a("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),a("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),a("ZGl2I3NrYXBpZWNfYWQ=")],ro:[a("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),a("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),a("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[a("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),a("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),a("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",a("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),a("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",a("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]},r=Object.keys(t),[4,J((s=[]).concat.apply(s,r.map(function(e){return t[e]})))]):[2,void 0];case 1:return i=n.sent(),e&&function(t,e){for(var r="DOM blockers debug:\n```",n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];r+="\n".concat(o,":");for(var s=0,a=t[o];s<a.length;s++){var c=a[s];r+="\n ".concat(e[c]?"🚫":"➡️"," ").concat(c)}}console.log("".concat(r,"\n```"))}(t,i),(o=r.filter(function(e){var r=t[e];return f(r.map(function(t){return i[t]}))>.6*r.length})).sort(),[2,o]}var a})})},fontPreferences:function(){return function(t,e){void 0===e&&(e=4e3);return N(function(r,i){var o=i.document,s=o.body,a=s.style;a.width="".concat(e,"px"),a.webkitTextSizeAdjust=a.textSizeAdjust="none",T()?s.style.zoom="".concat(1/i.devicePixelRatio):P()&&(s.style.zoom="reset");var c=o.createElement("div");return c.textContent=(0,n.fX)([],Array(e/20|0),!0).map(function(){return"word"}).join(" "),s.appendChild(c),t(o,s)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}(function(t,e){for(var r={},n={},i=0,o=Object.keys(ct);i<o.length;i++){var s=o[i],a=ct[s],c=a[0],u=void 0===c?{}:c,l=a[1],d=void 0===l?"mmMwWLliI0fiflO&1":l,h=t.createElement("span");h.textContent=d,h.style.whiteSpace="nowrap";for(var f=0,p=Object.keys(u);f<p.length;f++){var y=p[f],g=u[y];void 0!==g&&(h.style[y]=g)}r[s]=h,e.append(t.createElement("br"),h)}for(var m=0,_=Object.keys(ct);m<_.length;m++){n[s=_[m]]=r[s].getBoundingClientRect().width}return n})},audio:function(){return P()&&H()&&R()||T()&&(t=navigator,e=window,r=Audio.prototype,n=e.visualViewport,f(["srLatency"in r,"srChannelCount"in r,"devicePosture"in t,n&&"segments"in n,"getTextInformation"in Image.prototype])>=3)&&function(){var t=window,e=t.URLPattern;return f(["union"in Set.prototype,"Iterator"in t,e&&"hasRegExpGroups"in e.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){var t=window,e=t.OfflineAudioContext||t.webkitOfflineAudioContext;if(!e)return-2;if(P()&&!F()&&!function(){var t=window;return f(["DOMRectList"in t,"RTCPeerConnectionIceEvent"in t,"SVGGeometryElement"in t,"ontransitioncancel"in t])>=3}())return-1;var r=4500,n=new e(1,5e3,44100),i=n.createOscillator();i.type="triangle",i.frequency.value=1e4;var o=n.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,i.connect(o),o.connect(n.destination),i.start(0);var a=function(t){var e=3,r=500,n=500,i=5e3,o=function(){},a=new Promise(function(a,c){var l=!1,d=0,h=0;t.oncomplete=function(t){return a(t.renderedBuffer)};var f=function(){setTimeout(function(){return c(j("timeout"))},Math.min(n,h+i-Date.now()))},p=function(){try{var n=t.startRendering();switch(s(n)&&u(n),t.state){case"running":h=Date.now(),l&&f();break;case"suspended":document.hidden||d++,l&&d>=e?c(j("suspended")):setTimeout(p,r)}}catch(t){c(t)}};p(),o=function(){l||(l=!0,h>0&&f())}});return[a,o]}(n),c=a[0],l=a[1],d=u(c.then(function(t){return function(t){for(var e=0,r=0;r<t.length;++r)e+=Math.abs(t[r]);return e}(t.getChannelData(0).subarray(r))},function(t){if("timeout"===t.name||"suspended"===t.name)return-3;throw t}));return function(){return l(),d}}();var t,e,r,n},screenFrame:function(){var t=this;if(P()&&H()&&R())return function(){return Promise.resolve(void 0)};var e=K();return function(){return(0,n.sH)(t,void 0,void 0,function(){var t,r;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,e()];case 1:return t=n.sent(),[2,[(r=function(t){return null===t?null:p(t,10)})(t[0]),r(t[1]),r(t[2]),r(t[3])]]}})})}},canvas:function(){return function(t){var e,r,n,i=!1,o=function(){var t=document.createElement("canvas");return t.width=1,t.height=1,[t,t.getContext("2d")]}(),s=o[0],a=o[1];!function(t,e){return!(!e||!t.toDataURL)}(s,a)?r=n="unsupported":(i=function(t){return t.rect(0,0,10,10),t.rect(2,2,6,6),!t.isPointInPath(5,5,"evenodd")}(a),t?r=n="skipped":(e=function(t,e){!function(t,e){t.width=240,t.height=60,e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(100,1,62,20),e.fillStyle="#069",e.font='11pt "Times New Roman"';var r="Cwm fjordbank gly ".concat(String.fromCharCode(55357,56835));e.fillText(r,2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText(r,4,45)}(t,e);var r=W(t),n=W(t);if(r!==n)return["unstable","unstable"];!function(t,e){t.width=122,t.height=110,e.globalCompositeOperation="multiply";for(var r=0,n=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];r<n.length;r++){var i=n[r],o=i[0],s=i[1],a=i[2];e.fillStyle=o,e.beginPath(),e.arc(s,a,40,0,2*Math.PI,!0),e.closePath(),e.fill()}e.fillStyle="#f9c",e.arc(60,60,60,0,2*Math.PI,!0),e.arc(60,60,20,0,2*Math.PI,!0),e.fill("evenodd")}(t,e);var i=W(t);return[i,r]}(s,a),r=e[0],n=e[1]));return{winding:i,geometry:r,text:n}}(P()&&H()&&R())},osCpu:function(){return navigator.oscpu},languages:function(){var t,e=navigator,r=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&r.push([n]),Array.isArray(e.languages))T()&&f([!("MediaSettingsRange"in(t=window)),"RTCEncodedAudioFrame"in t,""+t.Intl=="[object Intl]",""+t.Reflect=="[object Reflect]"])>=3||r.push(e.languages);else if("string"==typeof e.languages){var i=e.languages;i&&r.push(i.split(","))}return r},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return h(d(navigator.deviceMemory),void 0)},screenResolution:function(){var t,e,r;if(!(P()&&H()&&R()))return t=screen,(r=[(e=function(t){return h(l(t),null)})(t.width),e(t.height)]).sort().reverse(),r},hardwareConcurrency:function(){return h(l(navigator.hardwareConcurrency),void 0)},timezone:function(){var t,e=null===(t=window.Intl)||void 0===t?void 0:t.DateTimeFormat;if(e){var r=(new e).resolvedOptions().timeZone;if(r)return r}var n,i=(n=(new Date).getFullYear(),-Math.max(d(new Date(n,0,1).getTimezoneOffset()),d(new Date(n,6,1).getTimezoneOffset())));return"UTC".concat(i>=0?"+":"").concat(i)},sessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},localStorage:function(){try{return!!window.localStorage}catch(t){return!0}},indexedDB:function(){var t,e;if(!(C()||(t=window,e=navigator,f(["msWriteProfilerMark"in t,"MSStream"in t,"msLaunchUri"in e,"msSaveBlob"in e])>=3&&!C())))try{return!!window.indexedDB}catch(t){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var t=navigator.platform;return"MacIntel"===t&&P()&&!F()?function(){if("iPad"===navigator.platform)return!0;var t=screen,e=t.width/t.height;return f(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,e>.65&&e<1.53])>=2}()?"iPad":"iPhone":t},plugins:function(){var t=navigator.plugins;if(t){for(var e=[],r=0;r<t.length;++r){var n=t[r];if(n){for(var i=[],o=0;o<n.length;++o){var s=n[o];i.push({type:s.type,suffixes:s.suffixes})}e.push({name:n.name,description:n.description,mimeTypes:i})}}return e}},touchSupport:function(){var t,e=navigator,r=0;void 0!==e.maxTouchPoints?r=l(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(r=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(e){t=!1}return{maxTouchPoints:r,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var t=[],e=0,r=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];e<r.length;e++){var n=r[e],i=window[n];i&&"object"==typeof i&&t.push(n)}return t.sort()},cookiesEnabled:function(){var t=document;try{t.cookie="cookietest=1; SameSite=Strict;";var e=-1!==t.cookie.indexOf("cookietest=");return t.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",e}catch(t){return!1}},colorGamut:function(){for(var t=0,e=["rec2020","p3","srgb"];t<e.length;t++){var r=e[t];if(matchMedia("(color-gamut: ".concat(r,")")).matches)return r}},invertedColors:function(){return!!tt("inverted")||!tt("none")&&void 0},forcedColors:function(){return!!et("active")||!et("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var t=0;t<=100;++t)if(matchMedia("(max-monochrome: ".concat(t,")")).matches)return t;throw new Error("Too high value")}},contrast:function(){return rt("no-preference")?0:rt("high")||rt("more")?1:rt("low")||rt("less")?-1:rt("forced")?10:void 0},reducedMotion:function(){return!!nt("reduce")||!nt("no-preference")&&void 0},reducedTransparency:function(){return!!it("reduce")||!it("no-preference")&&void 0},hdr:function(){return!!ot("high")||!ot("standard")&&void 0},math:function(){var t,e=st.acos||at,r=st.acosh||at,n=st.asin||at,i=st.asinh||at,o=st.atanh||at,s=st.atan||at,a=st.sin||at,c=st.sinh||at,u=st.cos||at,l=st.cosh||at,d=st.tan||at,h=st.tanh||at,f=st.exp||at,p=st.expm1||at,y=st.log1p||at;return{acos:e(.12312423423423424),acosh:r(1e308),acoshPf:(t=1e154,st.log(t+st.sqrt(t*t-1))),asin:n(.12312423423423424),asinh:i(1),asinhPf:function(t){return st.log(t+st.sqrt(t*t+1))}(1),atanh:o(.5),atanhPf:function(t){return st.log((1+t)/(1-t))/2}(.5),atan:s(.5),sin:a(-1e300),sinh:c(1),sinhPf:function(t){return st.exp(t)-1/st.exp(t)/2}(1),cos:u(10.000000000123),cosh:l(1),coshPf:function(t){return(st.exp(t)+1/st.exp(t))/2}(1),tan:d(-1e300),tanh:h(1),tanhPf:function(t){return(st.exp(2*t)-1)/(st.exp(2*t)+1)}(1),exp:f(1),expm1:p(1),expm1Pf:function(t){return st.exp(t)-1}(1),log1p:y(10),log1pPf:function(t){return st.log(1+t)}(10),powPI:function(t){return st.pow(st.PI,t)}(-100)}},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],e[3]},applePay:function(){var t=window.ApplePaySession;if("function"!=typeof(null==t?void 0:t.canMakePayments))return-1;if(ut())return-3;try{return t.canMakePayments()?1:0}catch(t){return function(t){if(t instanceof Error&&"InvalidAccessError"===t.name&&/\bfrom\b.*\binsecure\b/i.test(t.message))return-2;throw t}(t)}},privateClickMeasurement:function(){var t,e=document.createElement("a"),r=null!==(t=e.attributionSourceId)&&void 0!==t?t:e.attributionsourceid;return void 0===r?void 0:String(r)},audioBaseLatency:function(){if(!(V()||P()))return-2;if(!window.AudioContext)return-1;var t=(new AudioContext).baseLatency;return null==t?-1:isFinite(t)?t:-3},dateTimeLocale:function(){if(!window.Intl)return-1;var t=window.Intl.DateTimeFormat;if(!t)return-2;var e=t().resolvedOptions().locale;return e||""===e?e:-3},webGlBasics:function(t){var e,r,n,i,o,s,a=yt(t.cache);if(!a)return-1;if(!wt(a))return-2;var c=bt()?null:a.getExtension(pt);return{version:(null===(e=a.getParameter(a.VERSION))||void 0===e?void 0:e.toString())||"",vendor:(null===(r=a.getParameter(a.VENDOR))||void 0===r?void 0:r.toString())||"",vendorUnmasked:c?null===(n=a.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===n?void 0:n.toString():"",renderer:(null===(i=a.getParameter(a.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(o=a.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===o?void 0:o.toString():"",shadingLanguageVersion:(null===(s=a.getParameter(a.SHADING_LANGUAGE_VERSION))||void 0===s?void 0:s.toString())||""}},webGlExtensions:function(t){var e=yt(t.cache);if(!e)return-1;if(!wt(e))return-2;var r=e.getSupportedExtensions(),n=e.getContextAttributes(),i=[],o=[],s=[],a=[],c=[];if(n)for(var u=0,l=Object.keys(n);u<l.length;u++){var d=l[u];o.push("".concat(d,"=").concat(n[d]))}for(var h=0,f=mt(e);h<f.length;h++){var p=e[w=f[h]];s.push("".concat(w,"=").concat(p).concat(lt.has(p)?"=".concat(e.getParameter(p)):""))}if(r)for(var y=0,g=r;y<g.length;y++){var m=g[y];if(!(m===pt&&bt()||"WEBGL_polygon_mode"===m&&vt())){var _=e.getExtension(m);if(_)for(var b=0,v=mt(_);b<v.length;b++){var w;p=_[w=v[b]];a.push("".concat(w,"=").concat(p).concat(dt.has(p)?"=".concat(e.getParameter(p)):""))}else i.push(m)}}for(var B=0,A=ht;B<A.length;B++)for(var E=A[B],S=0,I=ft;S<I.length;S++){var x=I[S],L=gt(e,E,x);c.push("".concat(E,".").concat(x,"=").concat(L.join(",")))}return a.sort(),s.sort(),{contextAttributes:o,parameters:s,shaderPrecisions:c,extensions:r,extensionParameters:a,unsupportedExtensions:i}}};function At(t){var e=function(t){if(V())return.4;if(P())return!F()||H()&&R()?.3:.5;var e="value"in t.platform?t.platform.value:"";if(/^Win/.test(e))return.6;if(/^Mac/.test(e))return.5;return.7}(t),r=function(t){return p(.99+.01*t,1e-4)}(e);return{score:e,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,"".concat(r))}}function Et(t){return JSON.stringify(t,function(t,e){return e instanceof Error?(r=e,(0,n.Cl)({name:r.name,message:r.message,stack:null===(i=r.stack)||void 0===i?void 0:i.split("\n")},r)):e;var r,i},2)}function St(t){return L(function(t){for(var e="",r=0,n=Object.keys(t).sort();r<n.length;r++){var i=n[r],o=t[i],s="error"in o?"error":JSON.stringify(o.value);e+="".concat(e?"|":"").concat(i.replace(/([:|\\])/g,"\\$1"),":").concat(s)}return e}(t))}function It(t){return void 0===t&&(t=50),function(t,e){void 0===e&&(e=1/0);var r=window.requestIdleCallback;return r?new Promise(function(t){return r.call(window,function(){return t()},{timeout:e})}):o(Math.min(t,e))}(t,2*t)}function xt(t,e){var r=Date.now();return{get:function(o){return(0,n.sH)(this,void 0,void 0,function(){var s,a,c;return(0,n.YH)(this,function(n){switch(n.label){case 0:return s=Date.now(),[4,t()];case 1:return a=n.sent(),c=function(t){var e,r=At(t);return{get visitorId(){return void 0===e&&(e=St(this.components)),e},set visitorId(t){e=t},confidence:r,components:t,version:i}}(a),(e||(null==o?void 0:o.debug))&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(c.version,"\nuserAgent: ").concat(navigator.userAgent,"\ntimeBetweenLoadAndGet: ").concat(s-r,"\nvisitorId: ").concat(c.visitorId,"\ncomponents: ").concat(Et(a),"\n```")),[2,c]}})})}}}var Lt={load:function(t){var e;return void 0===t&&(t={}),(0,n.sH)(this,void 0,void 0,function(){var r,o,s;return(0,n.YH)(this,function(n){switch(n.label){case 0:return(null===(e=t.monitoring)||void 0===e||e)&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var t=new XMLHttpRequest;t.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(i,"/npm-monitoring"),!0),t.send()}catch(t){console.error(t)}}(),r=t.delayFallback,o=t.debug,[4,It(r)];case 1:return n.sent(),s=function(t){return O(Bt,t,[])}({cache:{},debug:o}),[2,xt(s,o)]}})})},hashComponents:St,componentsToDebugString:Et}},6586:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(2049),i=r(1882),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;const a=function(t,e){if((0,n.A)(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!(0,i.A)(t))||(s.test(t)||!o.test(t)||null!=e&&t in Object(e))}},6612:(t,e,r)=>{"use strict";var n;r.d(e,{y:()=>n}),function(t){t.ENGLISH="en",t.CHINESE_SIMPLIFIED="zh-Hans",t.CHINESE_TRADITIONAL="zh-Hant",t.CHINESE_TRADITIONAL_TW="zh-Hant-TW",t.JAPANESE="ja",t.KOREAN="ko",t.FILIPINO="fil",t.INDONESIAN="id",t.PORTUGUESE="pt",t.THAI="th",t.VIETNAMESE="vi",t.ARABIC="ar"}(n||(n={}))},6632:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(5917);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(i.Cache||n.A),r}i.Cache=n.A;const o=i},6666:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},6733:(t,e,r)=>{"use strict";r.d(e,{B:()=>b});var n=r(8291),i=r(853),o=r(1472),s=r(6666);const a={indoorLineColor:"#45b1cc",outdoorLineColor:"#8183ba",dashedLineColor:"#969696",shuttleBusLineColor:"#fb923c",lineWidth:4,dashedLineWidth:4,disableDashedLine:!1,inactiveRouteOpacity:.5,outdoorLineOpacity:1,markerIconSize:.75,markers:{from:"poi-02",to:"poi-01",stops:["waypoint-01"]},lineSymbol:{image:"east-blue-arrow-01",size:.25,spacing:1}},c="mmws-source-line-solid",u="mmws-layer-line-solid",l="mmws-layer-icon-line-symbol",d="mmws-source-line-dashed",h="mmws-layer-line-dashed",f="mmws-source-icon-connector",p="mmws-layer-icon-connector",y="mmws-source-icon-marker",g="mmws-layer-icon-marker",m=[u,l,h,p,g],_=[c,d,f,y];class b{_maplibreMap;_routeStyle=a;_styleDiffs={};_filterBy="venue";_curVenue=null;_curBuilding=null;_curOrdinal=null;_renderBoundaryLayer;constructor(t,e){this._maplibreMap=t,e&&(this._updateStyleProperties(e),t.on("load",()=>this._loadMarkerIcons()))}async setStyle(t){this._updateStyleProperties(t),await this._loadMarkerIcons(),await this._updateLayers()}async setMarkerIcons(t){if(Array.isArray(t)&&t.length){const e=t.slice(1,t.length-1);this._routeStyle.markers={from:t[0],to:(0,s.A)(t),stops:e.length?e:[t[0]]},this._styleDiffs={markers:this._routeStyle.markers}}else"from"in t&&(this._routeStyle.markers.from=t.from,this._styleDiffs.markers.from=t.from),"to"in t&&(this._routeStyle.markers.to=t.to,this._styleDiffs.markers.to=t.to),"stops"in t&&(this._routeStyle.markers.stops=t.stops??[null],this._styleDiffs.markers.stops=t.stops??[null]);await this._loadMarkerIcons()}setMarkerIconSize(t){return this._routeStyle.markerIconSize=t,this}setIndoorLineColor(t){return this._routeStyle.indoorLineColor=t,this}setOutdoorLineColor(t){return this._routeStyle.outdoorLineColor=t,this}setDashedLineColor(t){return this._routeStyle.dashedLineColor=t,this}setBusLineColor(t){return this._routeStyle.shuttleBusLineColor=t,this}render(t,e){if(!this._renderBoundaryLayer){const t=this._maplibreMap.getStyle(),e=(0,n.cq)(t);let r=e.find(({type:t,id:e})=>!e.includes("-overlap-copy")&&"fill-extrusion"===t);r||(r=e.find(t=>"symbol"===t.type&&"mapxus_place"===t?.["source-layer"])),this._renderBoundaryLayer=r?.id}const{instructions:r,points:{coordinates:i}}=t,{lineFeatures:o,connectorFeatures:s,dashedLineFeatures:a,markerFeatures:u}=this._classifyFeatures(r,i,e);this._renderSolidLines(o),this._renderLineSymbols(c,l),!0!==this._routeStyle.disableDashedLine&&this._renderDashedLines(a),this._renderConnectors(s),this._renderMarkers(u)}remove(){m.forEach(t=>{this._maplibreMap.getLayer(t)&&this._maplibreMap.removeLayer(t)}),_.forEach(t=>{this._maplibreMap.getSource(t)&&this._maplibreMap.removeSource(t)})}setFilterByVenue(t,e){this._filterBy="venue",this._curVenue=t??null,this._curOrdinal=e??null,this._filterRouteOpacity()}setFilterByBuilding(t,e){this._filterBy="building",this._curBuilding=t??null,this._curOrdinal=e??null,this._filterRouteOpacity()}_classifyFeatures(t,e,r){const n=[],i=[],o=[],a=[],c=[];t.forEach((r,o)=>{const{venue_id:s,building_id:a,floor_id:u,ordinal:l,sign:d,type:h,interval:[f,p]}=r;if(function(t){return 5===t}(d))c.push(r);else if(function(t){return 100===t||-100===t}(d)){0!==o&&o!==t.length-1&&i.push(this._createIconFeature(`connector-${i.length}`,e[f],{...v({venue_id:s,building_id:a,floor_id:u,ordinal:l}),icon:h}));const r=t[o+1];if(r){const{venue_id:t,building_id:n,floor_id:o,ordinal:s}=r;i.push(this._createIconFeature(`connector-${i.length}`,e[p],{...v({venue_id:t,building_id:n,floor_id:o,ordinal:s}),icon:h}))}}else n.push(this._createLineFeature(`solid-line-${n.length}`,e.slice(f,p+1),v({venue_id:s,building_id:a,floor_id:u,ordinal:l,isShuttleBus:w(d)?1:0})))});const u=t[0],{venue_id:l,building_id:d,floor_id:h,ordinal:f}=u,p=t[t.length-1],{venue_id:y,building_id:g,floor_id:m,ordinal:_}=p,b=e[0],B=e[e.length-1],A=r[0],E=r[r.length-1],S=r.slice(1,r.length-1);return A&&o.push(this._createLineFeature(`dashed-line-${o.length}`,[A,b],v({venue_id:l,building_id:d,floor_id:h,ordinal:f}))),E&&o.push(this._createLineFeature(`dashed-line-${o.length}`,[B,E],v({venue_id:y,building_id:g,floor_id:m,ordinal:_}))),c.length&&S.length&&c.forEach(({venue_id:t,building_id:r,floor_id:n,ordinal:i,interval:[c]},u)=>{o.push(this._createLineFeature(`dashed-line-${o.length}`,[e[c],S[u]],v({venue_id:t,building_id:r,floor_id:n,ordinal:i}))),a.push(this._createIconFeature(`marker-${a.length}`,S[u],{...v({venue_id:t,building_id:r,floor_id:n,ordinal:i,markerType:`stops_${u}`}),icon:this._routeStyle.markers.stops[u]??(0,s.A)(this._routeStyle.markers.stops),iconSize:this._routeStyle.markerIconSize}))}),a.push(this._createIconFeature(`marker-${a.length}`,A??b,{...v({venue_id:l,building_id:d,floor_id:h,ordinal:f,markerType:"from"}),icon:this._routeStyle.markers.from,iconSize:this._routeStyle.markerIconSize})),a.push(this._createIconFeature(`marker-${a.length}`,E??B,{...v({venue_id:y,building_id:g,floor_id:m,ordinal:_,markerType:"to"}),icon:this._routeStyle.markers.to,iconSize:this._routeStyle.markerIconSize})),{lineFeatures:n,connectorFeatures:i,dashedLineFeatures:o,markerFeatures:a}}_createLineFeature(t,e,r){return{id:t,type:"Feature",geometry:{type:"LineString",coordinates:e},properties:r}}_createIconFeature(t,e,r){return{id:t,type:"Feature",geometry:{type:"Point",coordinates:e},properties:r}}_renderSolidLines(t){this._addCollectionSource(c,t),this._addLineLayer(c,u,{"line-color":["case",["==",["get","isShuttleBus"],"1"],this._routeStyle.shuttleBusLineColor,["==",["get","floor_id"],null],this._routeStyle.outdoorLineColor,this._routeStyle.indoorLineColor],"line-opacity":["case",["==",["get","floor_id"],null],this._routeStyle.outdoorLineOpacity,1],"line-width":this._routeStyle.lineWidth})}_renderDashedLines(t){this._addCollectionSource(d,t),this._addLineLayer(d,h,{"line-color":this._routeStyle.dashedLineColor,"line-width":this._routeStyle.dashedLineWidth,"line-dasharray":[.1,1.8]})}_renderConnectors(t){this._addCollectionSource(f,t),this._addIconLayer(f,p)}_renderMarkers(t){this._addCollectionSource(y,t),this._addIconLayer(y,g,{"icon-anchor":"bottom","icon-allow-overlap":!0,"icon-ignore-placement":!0})}_addCollectionSource(t,e){this._maplibreMap.addSource(t,{type:"geojson",data:{type:"FeatureCollection",features:e}})}_addLineLayer(t,e,r){this._maplibreMap.addLayer({id:e,type:"line",source:t,layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":4,...r||{}}},this._renderBoundaryLayer)}_renderLineSymbols(t,e){this._maplibreMap.addLayer({id:e,type:"symbol",source:t,layout:{"symbol-placement":"line","symbol-spacing":this._routeStyle.lineSymbol.spacing,"icon-size":this._routeStyle.lineSymbol.size,"icon-image":this._routeStyle.lineSymbol.image},paint:{"icon-opacity":["case",["==",["get","floor_id"],null],this._routeStyle.outdoorLineOpacity,1]}},this._renderBoundaryLayer)}_addIconLayer(t,e,r){this._maplibreMap.addLayer({id:e,type:"symbol",source:t,layout:{"icon-image":["get","icon"],"icon-size":["case",["has","iconSize"],["get","iconSize"],1],...r||{}}})}_updateStyleProperties(t){if(this._styleDiffs=B(this._routeStyle,t??a),t){if(Object.keys(this._styleDiffs).length){const t={...this._routeStyle.lineSymbol,...this._styleDiffs.lineSymbol??{}},e=this._styleDiffs.markers;let r=this._routeStyle.markers;const n={outdoorLineOpacity:(this._styleDiffs.outdoorLineOpacity>1?1:this._styleDiffs.outdoorLineOpacity<0?0:this._styleDiffs.outdoorLineOpacity)??this._routeStyle.outdoorLineOpacity},i={inactiveRouteOpacity:(this._styleDiffs.inactiveRouteOpacity>1?1:this._styleDiffs.inactiveRouteOpacity<0?0:this._styleDiffs.inactiveRouteOpacity)??this._routeStyle.inactiveRouteOpacity};e&&Object.keys(e).length&&(r={...r,...e}),this._routeStyle={...this._routeStyle,...this._styleDiffs,...n,...i,markers:r,lineSymbol:t}}}else this._routeStyle=a}async _loadMarkerIcons(){const{markers:t,lineSymbol:e}=this._styleDiffs;if(e?.image&&await(0,i.K)(this._maplibreMap,e.image),t&&Object.keys(t).length){const{from:e,to:r,stops:n}=t;if(e&&await(0,i.K)(this._maplibreMap,e),r&&await(0,i.K)(this._maplibreMap,r),n&&n.length){const t=n.filter(t=>!!t);t.length&&await Promise.all(t.map(t=>(0,i.K)(this._maplibreMap,t)))}}}async _updateLayers(){if(!this._maplibreMap.getLayer(u))return;const{indoorLineColor:t,outdoorLineColor:e,dashedLineColor:r,shuttleBusLineColor:n,lineWidth:i,dashedLineWidth:o,disableDashedLine:a,inactiveRouteOpacity:c,outdoorLineOpacity:d,markerIconSize:f,markers:p,lineSymbol:m}=this._styleDiffs;if((t||e||n)&&this._maplibreMap.setPaintProperty(u,"line-color",["case",["==",["get","isShuttleBus"],"1"],this._routeStyle.shuttleBusLineColor,["==",["get","floor_id"],null],this._routeStyle.outdoorLineColor,this._routeStyle.indoorLineColor]),void 0!==i&&i+""&&this._maplibreMap.setPaintProperty(u,"line-width",i),"boolean"==typeof a?a?this._maplibreMap.setPaintProperty(h,"line-color","transparent"):(this._maplibreMap.setPaintProperty(h,"line-color",this._routeStyle.dashedLineColor),this._maplibreMap.setPaintProperty(h,"line-width",this._routeStyle.dashedLineWidth)):!0!==this._routeStyle.disableDashedLine&&(r&&this._maplibreMap.setPaintProperty(h,"line-color",r),void 0!==o&&o+""&&this._maplibreMap.setPaintProperty(h,"line-width",o)),void 0!==c&&c+""&&this._filterRouteOpacity(),void 0!==f&&f+""&&this._maplibreMap.setLayoutProperty(g,"icon-size",f),p&&Object.keys(p).length){const{from:t,to:e,stops:r}=p,n=this._maplibreMap.getSource(y),i=await n.getData();i.features=i.features.map(n=>{const{markerType:i}=n.properties;if(void 0!==t&&"from"===i&&(n.properties.icon=t),void 0!==e&&"to"===i&&(n.properties.icon=e),r&&i.includes("stops")){const t=parseInt(i.split("_")[1]);n.properties.icon=r[t]??(0,s.A)(r)}return n}),n.setData(i)}if(m){const{image:t,size:e,spacing:r}=m;void 0!==t&&this._maplibreMap.setLayoutProperty(l,"icon-image",t),void 0!==e&&e+""&&this._maplibreMap.setLayoutProperty(l,"icon-size",e),void 0!==r&&r+""&&this._maplibreMap.setLayoutProperty(l,"symbol-spacing",r)}void 0!==d&&d+""&&(this._maplibreMap.setPaintProperty(u,"line-opacity",["case",["==",["get","floor_id"],null],d,1]),this._maplibreMap.setPaintProperty(l,"icon-opacity",["case",["==",["get","floor_id"],null],d,1]),this._filterRouteOpacity())}_filterRouteOpacity(){let t;switch(this._filterBy){case"venue":t=["case",["all",["==",["get","ordinal"],this._curOrdinal??""],["==",["get","venue_id"],this._curVenue??""]],1,["==",["get","floor_id"],null],this._routeStyle.outdoorLineOpacity,this._routeStyle.inactiveRouteOpacity];break;case"building":t=["case",["all",["==",["get","ordinal"],this._curOrdinal??""],["==",["get","building_id"],this._curBuilding??""]],1,["==",["get","floor_id"],null],this._routeStyle.outdoorLineOpacity,this._routeStyle.inactiveRouteOpacity]}m.forEach(e=>{this._maplibreMap.getLayer(e)&&this._maplibreMap.setPaintProperty(e,e.includes("layer-line")?"line-opacity":"icon-opacity",t)})}}function v(t){return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,Number.isFinite(e)?e+"":e]))}function w(t){return(0,o.A)(t,104,108)}function B(t,e){const r={};for(const n in e){const i=t[n],o=e[n];if("markers"===n||"lineSymbol"===n)if(Array.isArray(o)){const t=o.slice(1,o.length-1);r[n]={from:o[0],to:(0,s.A)(o),stops:t.length?t:[o[0]]}}else{const t=B(i,o);Object.keys(t).length&&(r[n]=t)}else o+""!=i+""&&(r[n]="stops"===n?o??[null]:o)}return r}},6748:(t,e,r)=>{"use strict";e.VV=void 0,e.w=function(t,e){return Buffer.from(function(t,e){var r=(0,i.ellipticCurve)(),a=new o.PrivateKey(void 0,r),c=t instanceof Uint8Array?new o.PublicKey(t,r):o.PublicKey.fromHex(t,r),u=a.encapsulate(c,(0,i.isHkdfKeyCompressed)()),l=a.publicKey.toBytes((0,i.isEphemeralKeyCompressed)()),d=(0,s.symEncrypt)(u,e);return(0,n.concatBytes)(l,d)}(t,e))};var n=r(6527),i=r(4928),o=r(9065),s=r(2158);var a=r(4928);Object.defineProperty(e,"VV",{enumerable:!0,get:function(){return a.ECIES_CONFIG}});var c=r(9065);s.aesEncrypt,s.aesDecrypt,s.symEncrypt,s.symDecrypt,s.decodeHex,s.getValidSecret,s.remove0x},6838:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(){this.__data__=[],this.size=0}},6912:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}},6983:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return t!=t}},6984:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){return t===e||t!=t&&e!=e}},7007:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise(function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(t,"error",e,r)}(t,i,{once:!0})})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):p(i,i.length)}function f(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function y(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,l=p(c,u);for(r=0;r<u;++r)n(l[r],this,e)}return!0},o.prototype.addListener=function(t,e){return u(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return u(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,d(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,d(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(a(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},7064:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(7271),i=r(3938),o=Object.prototype.hasOwnProperty;const s=function(t){if(!(0,n.A)(t))return(0,i.A)(t);var e=[];for(var r in Object(t))o.call(t,r)&&"constructor"!=r&&e.push(r);return e}},7076:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sha512_224=e.sha512_256=e.sha384=e.sha512=e.sha224=e.sha256=e.SHA512_256=e.SHA512_224=e.SHA384=e.SHA512=e.SHA224=e.SHA256=void 0;const n=r(7202),i=r(2318),o=r(9175),s=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array(64);class c extends n.HashMD{constructor(t=32){super(64,t,8,!1),this.A=0|n.SHA256_IV[0],this.B=0|n.SHA256_IV[1],this.C=0|n.SHA256_IV[2],this.D=0|n.SHA256_IV[3],this.E=0|n.SHA256_IV[4],this.F=0|n.SHA256_IV[5],this.G=0|n.SHA256_IV[6],this.H=0|n.SHA256_IV[7]}get(){const{A:t,B:e,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[t,e,r,n,i,o,s,a]}set(t,e,r,n,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)a[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=a[t-15],r=a[t-2],n=(0,o.rotr)(e,7)^(0,o.rotr)(e,18)^e>>>3,i=(0,o.rotr)(r,17)^(0,o.rotr)(r,19)^r>>>10;a[t]=i+a[t-7]+n+a[t-16]|0}let{A:r,B:i,C:c,D:u,E:l,F:d,G:h,H:f}=this;for(let t=0;t<64;t++){const e=f+((0,o.rotr)(l,6)^(0,o.rotr)(l,11)^(0,o.rotr)(l,25))+(0,n.Chi)(l,d,h)+s[t]+a[t]|0,p=((0,o.rotr)(r,2)^(0,o.rotr)(r,13)^(0,o.rotr)(r,22))+(0,n.Maj)(r,i,c)|0;f=h,h=d,d=l,l=u+e|0,u=c,c=i,i=r,r=e+p|0}r=r+this.A|0,i=i+this.B|0,c=c+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,h=h+this.G|0,f=f+this.H|0,this.set(r,i,c,u,l,d,h,f)}roundClean(){(0,o.clean)(a)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,o.clean)(this.buffer)}}e.SHA256=c;class u extends c{constructor(){super(28),this.A=0|n.SHA224_IV[0],this.B=0|n.SHA224_IV[1],this.C=0|n.SHA224_IV[2],this.D=0|n.SHA224_IV[3],this.E=0|n.SHA224_IV[4],this.F=0|n.SHA224_IV[5],this.G=0|n.SHA224_IV[6],this.H=0|n.SHA224_IV[7]}}e.SHA224=u;const l=(()=>i.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))))(),d=(()=>l[0])(),h=(()=>l[1])(),f=new Uint32Array(80),p=new Uint32Array(80);class y extends n.HashMD{constructor(t=64){super(128,t,16,!1),this.Ah=0|n.SHA512_IV[0],this.Al=0|n.SHA512_IV[1],this.Bh=0|n.SHA512_IV[2],this.Bl=0|n.SHA512_IV[3],this.Ch=0|n.SHA512_IV[4],this.Cl=0|n.SHA512_IV[5],this.Dh=0|n.SHA512_IV[6],this.Dl=0|n.SHA512_IV[7],this.Eh=0|n.SHA512_IV[8],this.El=0|n.SHA512_IV[9],this.Fh=0|n.SHA512_IV[10],this.Fl=0|n.SHA512_IV[11],this.Gh=0|n.SHA512_IV[12],this.Gl=0|n.SHA512_IV[13],this.Hh=0|n.SHA512_IV[14],this.Hl=0|n.SHA512_IV[15]}get(){const{Ah:t,Al:e,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:h,Gl:f,Hh:p,Hl:y}=this;return[t,e,r,n,i,o,s,a,c,u,l,d,h,f,p,y]}set(t,e,r,n,i,o,s,a,c,u,l,d,h,f,p,y){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|y}process(t,e){for(let r=0;r<16;r++,e+=4)f[r]=t.getUint32(e),p[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|f[t-15],r=0|p[t-15],n=i.rotrSH(e,r,1)^i.rotrSH(e,r,8)^i.shrSH(e,r,7),o=i.rotrSL(e,r,1)^i.rotrSL(e,r,8)^i.shrSL(e,r,7),s=0|f[t-2],a=0|p[t-2],c=i.rotrSH(s,a,19)^i.rotrBH(s,a,61)^i.shrSH(s,a,6),u=i.rotrSL(s,a,19)^i.rotrBL(s,a,61)^i.shrSL(s,a,6),l=i.add4L(o,u,p[t-7],p[t-16]),d=i.add4H(l,n,c,f[t-7],f[t-16]);f[t]=0|d,p[t]=0|l}let{Ah:r,Al:n,Bh:o,Bl:s,Ch:a,Cl:c,Dh:u,Dl:l,Eh:y,El:g,Fh:m,Fl:_,Gh:b,Gl:v,Hh:w,Hl:B}=this;for(let t=0;t<80;t++){const e=i.rotrSH(y,g,14)^i.rotrSH(y,g,18)^i.rotrBH(y,g,41),A=i.rotrSL(y,g,14)^i.rotrSL(y,g,18)^i.rotrBL(y,g,41),E=y&m^~y&b,S=g&_^~g&v,I=i.add5L(B,A,S,h[t],p[t]),x=i.add5H(I,w,e,E,d[t],f[t]),L=0|I,k=i.rotrSH(r,n,28)^i.rotrBH(r,n,34)^i.rotrBH(r,n,39),O=i.rotrSL(r,n,28)^i.rotrBL(r,n,34)^i.rotrBL(r,n,39),C=r&o^r&a^o&a,T=n&s^n&c^s&c;w=0|b,B=0|v,b=0|m,v=0|_,m=0|y,_=0|g,({h:y,l:g}=i.add(0|u,0|l,0|x,0|L)),u=0|a,l=0|c,a=0|o,c=0|s,o=0|r,s=0|n;const P=i.add3L(L,O,T);r=i.add3H(P,x,k,C),n=0|P}({h:r,l:n}=i.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:s}=i.add(0|this.Bh,0|this.Bl,0|o,0|s)),({h:a,l:c}=i.add(0|this.Ch,0|this.Cl,0|a,0|c)),({h:u,l}=i.add(0|this.Dh,0|this.Dl,0|u,0|l)),({h:y,l:g}=i.add(0|this.Eh,0|this.El,0|y,0|g)),({h:m,l:_}=i.add(0|this.Fh,0|this.Fl,0|m,0|_)),({h:b,l:v}=i.add(0|this.Gh,0|this.Gl,0|b,0|v)),({h:w,l:B}=i.add(0|this.Hh,0|this.Hl,0|w,0|B)),this.set(r,n,o,s,a,c,u,l,y,g,m,_,b,v,w,B)}roundClean(){(0,o.clean)(f,p)}destroy(){(0,o.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}e.SHA512=y;class g extends y{constructor(){super(48),this.Ah=0|n.SHA384_IV[0],this.Al=0|n.SHA384_IV[1],this.Bh=0|n.SHA384_IV[2],this.Bl=0|n.SHA384_IV[3],this.Ch=0|n.SHA384_IV[4],this.Cl=0|n.SHA384_IV[5],this.Dh=0|n.SHA384_IV[6],this.Dl=0|n.SHA384_IV[7],this.Eh=0|n.SHA384_IV[8],this.El=0|n.SHA384_IV[9],this.Fh=0|n.SHA384_IV[10],this.Fl=0|n.SHA384_IV[11],this.Gh=0|n.SHA384_IV[12],this.Gl=0|n.SHA384_IV[13],this.Hh=0|n.SHA384_IV[14],this.Hl=0|n.SHA384_IV[15]}}e.SHA384=g;const m=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),_=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class b extends y{constructor(){super(28),this.Ah=0|m[0],this.Al=0|m[1],this.Bh=0|m[2],this.Bl=0|m[3],this.Ch=0|m[4],this.Cl=0|m[5],this.Dh=0|m[6],this.Dl=0|m[7],this.Eh=0|m[8],this.El=0|m[9],this.Fh=0|m[10],this.Fl=0|m[11],this.Gh=0|m[12],this.Gl=0|m[13],this.Hh=0|m[14],this.Hl=0|m[15]}}e.SHA512_224=b;class v extends y{constructor(){super(32),this.Ah=0|_[0],this.Al=0|_[1],this.Bh=0|_[2],this.Bl=0|_[3],this.Ch=0|_[4],this.Cl=0|_[5],this.Dh=0|_[6],this.Dl=0|_[7],this.Eh=0|_[8],this.El=0|_[9],this.Fh=0|_[10],this.Fl=0|_[11],this.Gh=0|_[12],this.Gl=0|_[13],this.Hh=0|_[14],this.Hl=0|_[15]}}e.SHA512_256=v,e.sha256=(0,o.createHasher)(()=>new c),e.sha224=(0,o.createHasher)(()=>new u),e.sha512=(0,o.createHasher)(()=>new y),e.sha384=(0,o.createHasher)(()=>new g),e.sha512_256=(0,o.createHasher)(()=>new v),e.sha512_224=(0,o.createHasher)(()=>new b)},7202:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SHA512_IV=e.SHA384_IV=e.SHA224_IV=e.SHA256_IV=e.HashMD=void 0,e.setBigUint64=i,e.Chi=function(t,e,r){return t&e^~t&r},e.Maj=function(t,e,r){return t&e^t&r^e&r};const n=r(9175);function i(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;t.setUint32(e+c,s,n),t.setUint32(e+u,a,n)}class o extends n.Hash{constructor(t,e,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=(0,n.createView)(this.buffer)}update(t){(0,n.aexists)(this),t=(0,n.toBytes)(t),(0,n.abytes)(t);const{view:e,buffer:r,blockLen:i}=this,o=t.length;for(let s=0;s<o;){const a=Math.min(i-this.pos,o-s);if(a===i){const e=(0,n.createView)(t);for(;i<=o-s;s+=i)this.process(e,s);continue}r.set(t.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,n.aexists)(this),(0,n.aoutput)(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:o,isLE:s}=this;let{pos:a}=this;e[a++]=128,(0,n.clean)(this.buffer.subarray(a)),this.padOffset>o-a&&(this.process(r,0),a=0);for(let t=a;t<o;t++)e[t]=0;i(r,o-8,BigInt(8*this.length),s),this.process(r,0);const c=(0,n.createView)(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<l;t++)c.setUint32(4*t,d[t],s)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=i,t.length=n,t.pos=s,n%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}e.HashMD=o,e.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),e.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),e.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),e.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])},7265:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(9042),i=Object.prototype.hasOwnProperty;const o=function(t,e,r,o,s,a){var c=1&r,u=(0,n.A)(t),l=u.length;if(l!=(0,n.A)(e).length&&!c)return!1;for(var d=l;d--;){var h=u[d];if(!(c?h in e:i.call(e,h)))return!1}var f=a.get(t),p=a.get(e);if(f&&p)return f==e&&p==t;var y=!0;a.set(t,e),a.set(e,t);for(var g=c;++d<l;){var m=t[h=u[d]],_=e[h];if(o)var b=c?o(_,m,h,e,t,a):o(m,_,h,t,e,a);if(!(void 0===b?m===_||s(m,_,r,o,a):b)){y=!1;break}g||(g="constructor"==h)}if(y&&!g){var v=t.constructor,w=e.constructor;v==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof w&&w instanceof w||(y=!1)}return a.delete(t),a.delete(e),y}},7271:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=Object.prototype;const i=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},7311:(t,e,r)=>{"use strict";r.d(e,{O:()=>a,o:()=>u});var n=r(6568),i=r(8330),o=r(8693),s=r(1089);const a="tokenUpdated",c={maxRetries:3,initialDelay:500};class u{static instance;_appId="";_secret="";_platform;_accessToken="";_expiredTime=0;_version="";_identifier="";_webIdentifier="";_tokenGetter;_tokenPending=null;_dispatch=(0,s.A)(a);_globalDispatcher;constructor(){}static getInstance(){return u.instance||(u.instance=new u),u.instance}async setAccessByAppKey(t){this._tokenGetter=this._fetchToken.bind(this);const{appId:e,secret:r,platform:n}=t;this._appId=e,this._secret=r,this._platform=n,this._version=n?.sdkVersion||i.rE,this._identifier=n?.identifier||await this.getWebIdentifier()}setTokenGetter(t){this._tokenGetter=t}async setupTokenManager(){if(!this._tokenGetter)throw new Error("getTokenAsync() is not set!");const{maxRetries:t,initialDelay:e}=c;let r=0;for(;r<=t;)try{const t=await this._tokenGetter();if(t)return void this._updateContext(t)}catch(n){if(r++,r>t)throw this._globalDispatcher.call("unauthorized"),n;await this._retryDelay(r,e)}}getSdkVersion(){return this._version||i.rE}async getIdentifier(){return this._identifier||await this.getWebIdentifier()}async getAccessToken(){if(this._accessToken&&!this._isTokenExpired)return this._accessToken;if(this._tokenPending)return this._tokenPending;if(!this._tokenGetter)throw new Error("Token getter not configured. Call setGetTokenAsync() first.");return this._tokenPending=this._tokenGetter().then(t=>(this._updateContext(t),this._dispatch.call(a,null,t.accessToken),t.accessToken)).catch(t=>{throw this._tokenPending=null,t}).finally(()=>{this._tokenPending=null}),this._tokenPending}async getWebIdentifier(){if(!this._webIdentifier){const t=await n.Ay.load(),e=await t.get();this._webIdentifier=e.visitorId}return this._webIdentifier}on(t,e){return this._dispatch.on(t,e),{off:()=>this._dispatch.on(t,null)}}setGlobalDispatcher(t){this._globalDispatcher=t}getGlobalDispatcher(){return this._globalDispatcher}clearState(){this._appId="",this._secret="",this._platform=void 0,this._webIdentifier="",this._tokenPending=null,this._tokenGetter=void 0,this._accessToken="",this._expiredTime=0,this._version="",this._identifier=""}get _isTokenExpired(){return this._expiredTime<=Date.now()}_updateContext(t){const{accessToken:e,expiredTime:r,identifier:n,sdkVersion:i}=t;this._accessToken=e,this._expiredTime=r,void 0!==n&&(this._identifier=n),void 0!==i&&(this._version=i)}_fetchToken(){return(0,o.i)(this._appId,this._secret,this._platform)}async _retryDelay(t,e){const r=e*Math.pow(2,t-1);return console.warn(`Retrying in ${r} ms... (Attempt ${t})`),new Promise(t=>setTimeout(t,r))}}},7346:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(2851),i=r(7465),o=r(5353),s=r(3149),a=r(901);const c=function(t,e,r,c){if(!(0,s.A)(t))return t;for(var u=-1,l=(e=(0,i.A)(e,t)).length,d=l-1,h=t;null!=h&&++u<l;){var f=(0,a.A)(e[u]),p=r;if("__proto__"===f||"constructor"===f||"prototype"===f)return t;if(u!=d){var y=h[f];void 0===(p=c?c(y,f,h):void 0)&&(p=(0,s.A)(y)?y:(0,o.A)(e[u+1])?[]:{})}(0,n.A)(h,f,p),h=h[f]}return t}},7422:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(423),i=r(7064),o=r(8446);const s=function(t){return(0,o.A)(t)?(0,n.A)(t):(0,i.A)(t)}},7465:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(2049),i=r(6586),o=r(5722),s=r(8182);const a=function(t,e){return(0,n.A)(t)?t:(0,i.A)(t,e)?[t]:(0,o.A)((0,s.A)(t))}},7500:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(6318);const i=function(t,e,r){var i=null==t?void 0:(0,n.A)(t,e);return void 0===i?r:i}},7511:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(9789),i=r(5054);const o=function(t,e){return null!=t&&(0,i.A)(t,e,n.A)}},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),l=0,d=c>0?s-4:s;for(r=0;r<d;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e);1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(u(t,a,a+s>c?c:a+s));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function u(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(c(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7678:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.aes256cbc=e.aes256gcm=void 0;var n=r(469);e.aes256gcm=function(t,e,r){return(0,n.gcm)(t,e,r)};e.aes256cbc=function(t,e,r){return(0,n.cbc)(t,e)}},7681:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(7919),i=r(8335),o=r(5917);const s=function(t,e){var r=this.__data__;if(r instanceof n.A){var s=r.__data__;if(!i.A||s.length<199)return s.push([t,e]),this.size=++r.size,this;r=this.__data__=new o.A(s)}return r.set(t,e),this.size=r.size,this}},7757:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.aesDecrypt=e.aesEncrypt=e.symDecrypt=e.symEncrypt=void 0;var n=r(6527),i=r(8489),o=r(7678),s=r(83),a=r(4928),c=r(1666);e.symEncrypt=function(t,e,r){return u(l,t,e,r)};function u(t,e,r,n){var i=(0,a.symmetricAlgorithm)();if("aes-256-gcm"===i)return t(o.aes256gcm,e,r,(0,a.symmetricNonceLength)(),c.AEAD_TAG_LENGTH,n);if("xchacha20"===i)return t(s.xchacha20,e,r,c.XCHACHA20_NONCE_LENGTH,c.AEAD_TAG_LENGTH,n);if("aes-256-cbc"===i)return t(o.aes256cbc,e,r,16,0);throw new Error("Not implemented")}function l(t,e,r,o,s,a){var c=(0,i.randomBytes)(o),u=t(e,c,a).encrypt(r);if(0===s)return(0,n.concatBytes)(c,u);var l=u.length-s,d=u.subarray(0,l),h=u.subarray(l);return(0,n.concatBytes)(c,h,d)}function d(t,e,r,i,o,s){var a=r.subarray(0,i),c=t(e,Uint8Array.from(a),s),u=r.subarray(i);if(0===o)return c.decrypt(u);var l=u.subarray(0,o),d=u.subarray(o);return c.decrypt((0,n.concatBytes)(d,l))}e.symDecrypt=function(t,e,r){return u(d,t,e,r)},e.aesEncrypt=e.symEncrypt,e.aesDecrypt=e.symDecrypt},7808:(t,e,r)=>{"use strict";r.d(e,{Cm:()=>i,EC:()=>s,Uk:()=>o});var n=r(7311);function i(){return n.o.getInstance().getIdentifier()}function o(t){n.o.getInstance().setTokenGetter(t)}function s(){return n.o.getInstance().setupTokenManager()}},7809:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e,r){for(var n=-1,i=null==t?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}},7880:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=/\s/;const i=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}},7919:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(6838),i=r(2384),o=r(4787),s=r(8207),a=r(1031);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n.A,c.prototype.delete=i.A,c.prototype.get=o.A,c.prototype.has=s.A,c.prototype.set=a.A;const u=c},7960:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(9396),i=r(7422);const o=function(t){for(var e=(0,i.A)(t),r=e.length;r--;){var o=e[r],s=t[o];e[r]=[o,s,(0,n.A)(s)]}return e}},8021:(t,e,r)=>{"use strict";r.d(e,{B:()=>i});var n=r(4543);function i(t,e=30){let r,i=null;return{promise:new Promise((o,s)=>{i=s;const a=performance.now(),c=t();c?o(c):r=setInterval(()=>{const i=t();i?(clearInterval(r),o(i)):(performance.now()-a)/1e3>e&&(s(new n.e("Timeouts or Feature is not found in the map at current zoom level.",{status:404,name:"NetworkError"})),clearInterval(r))},100)}),abort:()=>{r&&(clearInterval(r),r=void 0),i&&(i(new n.e("Query was aborted by the user.",{status:400,name:"AbortError"})),i=null)}}}},8104:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){return null==t?void 0:t[e]}},8167:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(8287),i=r(6748);void 0===globalThis.Buffer&&(globalThis.Buffer=n.hp),i.VV.ellipticCurve="secp256k1",i.VV.symmetricAlgorithm="aes-256-gcm";const o=new TextEncoder;function s(t,e){return(0,i.w)(t,o.encode(e)).toString("hex")}},8182:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(52);const i=function(t){return null==t?"":(0,n.A)(t)}},8207:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(169);const i=function(t){return(0,n.A)(this.__data__,t)>-1}},8287:(t,e,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=c,e.IS=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return d(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(K(t,Uint8Array)){const e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer))return f(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(K(t,SharedArrayBuffer)||t&&K(t.buffer,SharedArrayBuffer)))return f(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||Y(t.length)?a(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function d(t){return l(t),a(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function f(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,c.prototype),n}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||K(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(i)return n?-1:W(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function _(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(t,o+n)!==u(e,n)){r=!1;break}if(r)return o}return-1}function v(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(Y(n))return s;t[r+s]=n}return s}function w(t,e,r,n){return q(W(e,t.length-r),t,r,n)}function B(t,e,r,n){return q(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function A(t,e,r,n){return q(Z(e),t,r,n)}function E(t,e,r,n){return q(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=x));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},c.allocUnsafe=function(t){return d(t)},c.allocUnsafeSlow=function(t){return d(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=c.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(K(e,Uint8Array))i+e.length>n.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?I(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t<a;++t)if(u[t]!==l[t]){o=u[t],s=l[t];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return _(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return _(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":case"latin1":case"binary":return B(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function k(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function O(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=X[t[n]];return i}function C(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function R(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function M(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(t,e,r,n,o){return e=+e,r>>>=0,o||M(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,o){return e=+e,r>>>=0,o||M(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=J(function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=J(function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),c.prototype.readBigInt64BE=J(function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){P(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){P(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=J(function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=J(function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=J(function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=J(function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(t,e,r){return H(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return H(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const V={};function j(t,e,r){V[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function N(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function D(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new V.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){$(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function $(t,e){if("number"!=typeof t)throw new V.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw $(t,r),new V.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new V.ERR_BUFFER_OUT_OF_BOUNDS;throw new V.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}j("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),j("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=N(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=N(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);const G=/[^+/0-9A-Za-z-_]/g;function W(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function K(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function J(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},8291:(t,e,r)=>{"use strict";function n(t){return t.layers.filter(t=>!o(t.source))}function i(t){return t.layers.filter(t=>o(t.source))}function o(t){return"string"==typeof t&&t.startsWith("indoor-")}r.d(e,{Z3:()=>n,cq:()=>i,ld:()=>o})},8330:t=>{"use strict";t.exports={rE:"9.0.0"}},8335:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(702),i=r(1917);const o=(0,n.A)(i.A,"Map")},8389:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(2559),i=r(2141),o=r(6224);const s=function(t,e){return t&&t.length?(0,n.A)(t,(0,i.A)(e,2),o.A):void 0}},8417:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(674),i=Object.prototype.hasOwnProperty;const o=function(t){var e=this.__data__;if(n.A){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(e,t)?e[t]:void 0}},8446:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(9610),i=r(5254);const o=function(t){return null!=t&&(0,i.A)(t.length)&&!(0,n.A)(t)}},8488:t=>{"use strict";t.exports=e},8489:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gcm=e.ctr=e.cbc=e.utils=void 0,e.randomBytes=o,e.getWebcryptoSubtle=s,e.managedNonce=function(t){const{nonceLength:e}=t;return(0,i.anumber)(e),(r,...n)=>({encrypt(s,...a){const c=o(e),u=t(r,c,...n).encrypt(s,...a),l=(0,i.concatBytes)(c,u);return u.fill(0),l},decrypt(i,...o){const s=i.subarray(0,e),a=i.subarray(e);return t(r,s,...n).decrypt(a,...o)}})};const n=r(5297),i=r(6527);function o(t=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(t));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return Uint8Array.from(n.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}function s(){if(n.crypto&&"object"==typeof n.crypto.subtle&&null!=n.crypto.subtle)return n.crypto.subtle;throw new Error("crypto.subtle must be defined")}e.utils={async encrypt(t,e,r,n){const i=s(),o=await i.importKey("raw",t,e,!0,["encrypt"]),a=await i.encrypt(r,o,n);return new Uint8Array(a)},async decrypt(t,e,r,n){const i=s(),o=await i.importKey("raw",t,e,!0,["decrypt"]),a=await i.decrypt(r,o,n);return new Uint8Array(a)}};const a="AES-CBC",c="AES-CTR",u="AES-GCM";function l(t){return(r,n,o)=>{(0,i.abytes)(r),(0,i.abytes)(n);const s={name:t,length:8*r.length},l=function(t,e,r){if(t===a)return{name:a,iv:e};if(t===c)return{name:c,counter:e,length:64};if(t===u)return r?{name:u,iv:e,additionalData:r}:{name:u,iv:e};throw new Error("unknown aes block mode")}(t,n,o);let d=!1;return{encrypt(t){if((0,i.abytes)(t),d)throw new Error("Cannot encrypt() twice with same key / nonce");return d=!0,e.utils.encrypt(r,s,l,t)},decrypt:t=>((0,i.abytes)(t),e.utils.decrypt(r,s,l,t))}}}e.cbc=l(a),e.ctr=l(c),e.gcm=(()=>l(u))()},8510:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.secp256k1_hasher=e.schnorr=e.secp256k1=void 0;const n=r(7076),i=r(9175),o=r(3562),s=r(1761),a=r(4967),c=r(1705),u=r(8627),l={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},d=BigInt(0),h=BigInt(1),f=BigInt(2),p=(t,e)=>(t+e/f)/e;function y(t){const e=l.p,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),c=BigInt(44),u=BigInt(88),d=t*t*t%e,h=d*d*t%e,p=(0,a.pow2)(h,r,e)*h%e,y=(0,a.pow2)(p,r,e)*h%e,m=(0,a.pow2)(y,f,e)*d%e,_=(0,a.pow2)(m,i,e)*m%e,b=(0,a.pow2)(_,o,e)*_%e,v=(0,a.pow2)(b,c,e)*b%e,w=(0,a.pow2)(v,u,e)*v%e,B=(0,a.pow2)(w,c,e)*b%e,A=(0,a.pow2)(B,r,e)*h%e,E=(0,a.pow2)(A,s,e)*_%e,S=(0,a.pow2)(E,n,e)*d%e,I=(0,a.pow2)(S,f,e);if(!g.eql(g.sqr(I),t))throw new Error("Cannot find square root");return I}const g=(0,a.Field)(l.p,void 0,void 0,{sqrt:y});e.secp256k1=(0,o.createCurve)({...l,Fp:g,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=l.n,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),c=p(o*t,e),u=p(-n*t,e);let d=(0,a.mod)(t-c*r-u*i,e),f=(0,a.mod)(-c*n-u*o,e);const y=d>s,g=f>s;if(y&&(d=e-d),g&&(f=e-f),d>s||f>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:y,k1:d,k2neg:g,k2:f}}}},n.sha256);const m={};function _(t,...e){let r=m[t];if(void 0===r){const e=(0,n.sha256)(Uint8Array.from(t,t=>t.charCodeAt(0)));r=(0,u.concatBytes)(e,e),m[t]=r}return(0,n.sha256)((0,u.concatBytes)(r,...e))}const b=t=>t.toBytes(!0).slice(1),v=t=>(0,u.numberToBytesBE)(t,32),w=t=>(0,a.mod)(t,l.p),B=t=>(0,a.mod)(t,l.n),A=(()=>e.secp256k1.Point)(),E=t=>t%f===d;function S(t){let r=e.secp256k1.utils.normPrivateKeyToScalar(t),n=A.fromPrivateKey(r);return{scalar:E(n.y)?r:B(-r),bytes:b(n)}}function I(t){(0,u.aInRange)("x",t,h,l.p);const e=w(t*t);let r=y(w(e*t+BigInt(7)));E(r)||(r=w(-r));const n=A.fromAffine({x:t,y:r});return n.assertValidity(),n}const x=u.bytesToNumberBE;function L(...t){return B(x(_("BIP0340/challenge",...t)))}function k(t){return S(t).bytes}function O(t,e,r=(0,i.randomBytes)(32)){const n=(0,u.ensureBytes)("message",t),{bytes:o,scalar:s}=S(e),a=(0,u.ensureBytes)("auxRand",r,32),c=v(s^x(_("BIP0340/aux",a))),l=_("BIP0340/nonce",c,o,n),h=B(x(l));if(h===d)throw new Error("sign failed: k is zero");const{bytes:f,scalar:p}=S(h),y=L(f,o,n),g=new Uint8Array(64);if(g.set(f,0),g.set(v(B(p+y*s)),32),!C(g,n,o))throw new Error("sign: Invalid signature produced");return g}function C(t,e,r){const n=(0,u.ensureBytes)("signature",t,64),i=(0,u.ensureBytes)("message",e),o=(0,u.ensureBytes)("publicKey",r,32);try{const t=I(x(o)),e=x(n.subarray(0,32));if(!(0,u.inRange)(e,h,l.p))return!1;const r=x(n.subarray(32,64));if(!(0,u.inRange)(r,h,l.n))return!1;const s=L(v(e),b(t),i),a=A.BASE.multiplyUnsafe(r).add(t.multiplyUnsafe(B(-s))),{x:c,y:d}=a.toAffine();return!(a.is0()||!E(d)||c!==e)}catch(t){return!1}}e.schnorr={getPublicKey:k,sign:O,verify:C,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:I,pointToBytes:b,numberToBytesBE:u.numberToBytesBE,bytesToNumberBE:u.bytesToNumberBE,taggedHash:_,mod:a.mod}};const T=(()=>(0,s.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(t=>BigInt(t)))))(),P=(()=>(0,c.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))}))();e.secp256k1_hasher=(0,s.createHasher)(e.secp256k1.Point,t=>{const{x:e,y:r}=P(g.create(t[0]));return T(e,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:n.sha256}),e.hashToCurve=e.secp256k1_hasher.hashToCurve,e.encodeToCurve=e.secp256k1_hasher.encodeToCurve},8627:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.notImplemented=e.bitMask=e.utf8ToBytes=e.randomBytes=e.isBytes=e.hexToBytes=e.concatBytes=e.bytesToUtf8=e.bytesToHex=e.anumber=e.abytes=void 0,e.abool=function(t,e){if("boolean"!=typeof e)throw new Error(t+" boolean expected, got "+e)},e.numberToHexUnpadded=a,e.hexToNumber=c,e.bytesToNumberBE=function(t){return c((0,n.bytesToHex)(t))},e.bytesToNumberLE=function(t){return(0,n.abytes)(t),c((0,n.bytesToHex)(Uint8Array.from(t).reverse()))},e.numberToBytesBE=u,e.numberToBytesLE=function(t,e){return u(t,e).reverse()},e.numberToVarBytesBE=function(t){return(0,n.hexToBytes)(a(t))},e.ensureBytes=function(t,e,r){let i;if("string"==typeof e)try{i=(0,n.hexToBytes)(e)}catch(e){throw new Error(t+" must be hex string or Uint8Array, cause: "+e)}else{if(!(0,n.isBytes)(e))throw new Error(t+" must be hex string or Uint8Array");i=Uint8Array.from(e)}const o=i.length;if("number"==typeof r&&o!==r)throw new Error(t+" of length "+r+" expected, got "+o);return i},e.equalBytes=function(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r},e.inRange=d,e.aInRange=function(t,e,r,n){if(!d(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)},e.bitLen=function(t){let e;for(e=0;t>o;t>>=s,e+=1);return e},e.bitGet=function(t,e){return t>>BigInt(e)&s},e.bitSet=function(t,e,r){return t|(r?s:o)<<BigInt(e)},e.createHmacDrbg=function(t,e,r){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");const i=t=>new Uint8Array(t),o=t=>Uint8Array.of(t);let s=i(t),a=i(t),c=0;const u=()=>{s.fill(1),a.fill(0),c=0},l=(...t)=>r(a,s,...t),d=(t=i(0))=>{a=l(o(0),t),s=l(),0!==t.length&&(a=l(o(1),t),s=l())},h=()=>{if(c++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const r=[];for(;t<e;){s=l();const e=s.slice();r.push(e),t+=s.length}return(0,n.concatBytes)(...r)};return(t,e)=>{let r;for(u(),d(t);!(r=e(h()));)d();return u(),r}},e.validateObject=function(t,e,r={}){const n=(e,r,n)=>{const i=h[r];if("function"!=typeof i)throw new Error("invalid validator function");const o=t[e];if(!(n&&void 0===o||i(o,t)))throw new Error("param "+String(e)+" is invalid. Expected "+r+", got "+o)};for(const[t,r]of Object.entries(e))n(t,r,!1);for(const[t,e]of Object.entries(r))n(t,e,!0);return t},e.isHash=function(t){return"function"==typeof t&&Number.isSafeInteger(t.outputLen)},e._validateObject=function(t,e,r={}){if(!t||"object"!=typeof t)throw new Error("expected valid options object");function n(e,r,n){const i=t[e];if(n&&void 0===i)return;const o=typeof i;if(o!==r||null===i)throw new Error(`param "${e}" is invalid: expected ${r}, got ${o}`)}Object.entries(e).forEach(([t,e])=>n(t,e,!1)),Object.entries(r).forEach(([t,e])=>n(t,e,!0))},e.memoized=function(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(void 0!==i)return i;const o=t(r,...n);return e.set(r,o),o}};const n=r(9175);var i=r(9175);Object.defineProperty(e,"abytes",{enumerable:!0,get:function(){return i.abytes}}),Object.defineProperty(e,"anumber",{enumerable:!0,get:function(){return i.anumber}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return i.bytesToHex}}),Object.defineProperty(e,"bytesToUtf8",{enumerable:!0,get:function(){return i.bytesToUtf8}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return i.concatBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return i.hexToBytes}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return i.isBytes}}),Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return i.randomBytes}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return i.utf8ToBytes}});const o=BigInt(0),s=BigInt(1);function a(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function c(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?o:BigInt("0x"+t)}function u(t,e){return(0,n.hexToBytes)(t.toString(16).padStart(2*e,"0"))}const l=t=>"bigint"==typeof t&&o<=t;function d(t,e,r){return l(t)&&l(e)&&l(r)&&e<=t&&t<r}e.bitMask=t=>(s<<BigInt(t))-s;const h={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||(0,n.isBytes)(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};e.notImplemented=()=>{throw new Error("not implemented")}},8672:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){if("function"!=typeof t)throw new TypeError("Expected a function");return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}},8693:(t,e,r)=>{"use strict";r.d(e,{i:()=>l});var n=r(2658),i=r(5461),o=r(7808),s=r(9588),a=r(8167),c=r(8330);const u=["CORE_SDK",...(0,n.d)()];async function l(t,e,r,n){if(!t||!e)throw new Error("appId and secret are required");try{const l=await(0,i.l)(),h=await async function(t,e=d){return t??async function(t){return{identifier:await(0,o.Cm)(),origin:t,keyPlatform:"WEB",sdkVersion:c.rE}}(e)}(r,n),{identifier:f,sdkVersion:p,...y}=h,g={"Content-Type":"text/plain",sdkVersion:p},m=function(t,e){return(0,a.Z)(t,JSON.stringify(e))}(l,{appId:t,secret:e,identifier:f,timestamp:Date.now(),products:u,...y}),_=await fetch(s.R0,{method:"POST",body:m,headers:g});if(!_.ok){const t=await _.json(),{code:e,message:r}=t;if(401===_.status&&7001005===e)throw(0,i.U)(),new Error(r);throw new Error(r||`HTTP error! status: ${_.status}`)}const b=await _.json(),{accessToken:v,expiresIn:w}=b;return{accessToken:v,expiredTime:Date.now()+1e3*(w-90)}}catch(t){throw t instanceof Error?new Error(`Failed to get access token: ${t.message}`,{cause:t}):new Error(`Failed to get access token: ${String(t)}`)}}const d="undefined"!=typeof window&&window.location?.hostname?window.location.hostname:"restriction.test.example.com"},8700:(t,e,r)=>{"use strict";function n(t,e=","){return"string"==typeof t&&t.trim()?t.split(e):[]}r.d(e,{S:()=>n})},8719:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(9717),i=r(2789),o=r(4841),s=o.A&&o.A.isTypedArray;const a=s?(0,i.A)(s):n.A},8776:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(9313),i=1/0;const o=function(t){return t?(t=(0,n.A)(t))===i||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},8813:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(674),i=Object.prototype.hasOwnProperty;const o=function(t){var e=this.__data__;return n.A?void 0!==e[t]:i.call(e,t)}},8823:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(3149),i=r(7271),o=r(1493),s=Object.prototype.hasOwnProperty;const a=function(t){if(!(0,n.A)(t))return(0,o.A)(t);var e=(0,i.A)(t),r=[];for(var a in t)("constructor"!=a||!e&&s.call(t,a))&&r.push(a);return r}},8884:(t,e,r)=>{"use strict";var n;r.d(e,{e:()=>n}),function(t){t.Access="access_control",t.Map="map"}(n||(n={}))},8900:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.xchacha20poly1305=e.chacha20poly1305=e._poly1305_aead=e.chacha12=e.chacha8=e.xchacha20=e.chacha20=e.chacha20orig=void 0,e.hchacha=a;const n=r(2506),i=r(1210),o=r(6527);function s(t,e,r,i,o,s=20){let a=t[0],c=t[1],u=t[2],l=t[3],d=e[0],h=e[1],f=e[2],p=e[3],y=e[4],g=e[5],m=e[6],_=e[7],b=o,v=r[0],w=r[1],B=r[2],A=a,E=c,S=u,I=l,x=d,L=h,k=f,O=p,C=y,T=g,P=m,F=_,R=b,M=v,H=w,U=B;for(let t=0;t<s;t+=2)A=A+x|0,R=(0,n.rotl)(R^A,16),C=C+R|0,x=(0,n.rotl)(x^C,12),A=A+x|0,R=(0,n.rotl)(R^A,8),C=C+R|0,x=(0,n.rotl)(x^C,7),E=E+L|0,M=(0,n.rotl)(M^E,16),T=T+M|0,L=(0,n.rotl)(L^T,12),E=E+L|0,M=(0,n.rotl)(M^E,8),T=T+M|0,L=(0,n.rotl)(L^T,7),S=S+k|0,H=(0,n.rotl)(H^S,16),P=P+H|0,k=(0,n.rotl)(k^P,12),S=S+k|0,H=(0,n.rotl)(H^S,8),P=P+H|0,k=(0,n.rotl)(k^P,7),I=I+O|0,U=(0,n.rotl)(U^I,16),F=F+U|0,O=(0,n.rotl)(O^F,12),I=I+O|0,U=(0,n.rotl)(U^I,8),F=F+U|0,O=(0,n.rotl)(O^F,7),A=A+L|0,U=(0,n.rotl)(U^A,16),P=P+U|0,L=(0,n.rotl)(L^P,12),A=A+L|0,U=(0,n.rotl)(U^A,8),P=P+U|0,L=(0,n.rotl)(L^P,7),E=E+k|0,R=(0,n.rotl)(R^E,16),F=F+R|0,k=(0,n.rotl)(k^F,12),E=E+k|0,R=(0,n.rotl)(R^E,8),F=F+R|0,k=(0,n.rotl)(k^F,7),S=S+O|0,M=(0,n.rotl)(M^S,16),C=C+M|0,O=(0,n.rotl)(O^C,12),S=S+O|0,M=(0,n.rotl)(M^S,8),C=C+M|0,O=(0,n.rotl)(O^C,7),I=I+x|0,H=(0,n.rotl)(H^I,16),T=T+H|0,x=(0,n.rotl)(x^T,12),I=I+x|0,H=(0,n.rotl)(H^I,8),T=T+H|0,x=(0,n.rotl)(x^T,7);let V=0;i[V++]=a+A|0,i[V++]=c+E|0,i[V++]=u+S|0,i[V++]=l+I|0,i[V++]=d+x|0,i[V++]=h+L|0,i[V++]=f+k|0,i[V++]=p+O|0,i[V++]=y+C|0,i[V++]=g+T|0,i[V++]=m+P|0,i[V++]=_+F|0,i[V++]=b+R|0,i[V++]=v+M|0,i[V++]=w+H|0,i[V++]=B+U|0}function a(t,e,r,i){let o=t[0],s=t[1],a=t[2],c=t[3],u=e[0],l=e[1],d=e[2],h=e[3],f=e[4],p=e[5],y=e[6],g=e[7],m=r[0],_=r[1],b=r[2],v=r[3];for(let t=0;t<20;t+=2)o=o+u|0,m=(0,n.rotl)(m^o,16),f=f+m|0,u=(0,n.rotl)(u^f,12),o=o+u|0,m=(0,n.rotl)(m^o,8),f=f+m|0,u=(0,n.rotl)(u^f,7),s=s+l|0,_=(0,n.rotl)(_^s,16),p=p+_|0,l=(0,n.rotl)(l^p,12),s=s+l|0,_=(0,n.rotl)(_^s,8),p=p+_|0,l=(0,n.rotl)(l^p,7),a=a+d|0,b=(0,n.rotl)(b^a,16),y=y+b|0,d=(0,n.rotl)(d^y,12),a=a+d|0,b=(0,n.rotl)(b^a,8),y=y+b|0,d=(0,n.rotl)(d^y,7),c=c+h|0,v=(0,n.rotl)(v^c,16),g=g+v|0,h=(0,n.rotl)(h^g,12),c=c+h|0,v=(0,n.rotl)(v^c,8),g=g+v|0,h=(0,n.rotl)(h^g,7),o=o+l|0,v=(0,n.rotl)(v^o,16),y=y+v|0,l=(0,n.rotl)(l^y,12),o=o+l|0,v=(0,n.rotl)(v^o,8),y=y+v|0,l=(0,n.rotl)(l^y,7),s=s+d|0,m=(0,n.rotl)(m^s,16),g=g+m|0,d=(0,n.rotl)(d^g,12),s=s+d|0,m=(0,n.rotl)(m^s,8),g=g+m|0,d=(0,n.rotl)(d^g,7),a=a+h|0,_=(0,n.rotl)(_^a,16),f=f+_|0,h=(0,n.rotl)(h^f,12),a=a+h|0,_=(0,n.rotl)(_^a,8),f=f+_|0,h=(0,n.rotl)(h^f,7),c=c+u|0,b=(0,n.rotl)(b^c,16),p=p+b|0,u=(0,n.rotl)(u^p,12),c=c+u|0,b=(0,n.rotl)(b^c,8),p=p+b|0,u=(0,n.rotl)(u^p,7);let w=0;i[w++]=o,i[w++]=s,i[w++]=a,i[w++]=c,i[w++]=m,i[w++]=_,i[w++]=b,i[w++]=v}e.chacha20orig=(0,n.createCipher)(s,{counterRight:!1,counterLength:8,allowShortKeys:!0}),e.chacha20=(0,n.createCipher)(s,{counterRight:!1,counterLength:4,allowShortKeys:!1}),e.xchacha20=(0,n.createCipher)(s,{counterRight:!1,counterLength:8,extendNonceFn:a,allowShortKeys:!1}),e.chacha8=(0,n.createCipher)(s,{counterRight:!1,counterLength:4,rounds:8}),e.chacha12=(0,n.createCipher)(s,{counterRight:!1,counterLength:4,rounds:12});const c=new Uint8Array(16),u=(t,e)=>{t.update(e);const r=e.length%16;r&&t.update(c.subarray(r))},l=new Uint8Array(32);function d(t,e,r,n,s){const a=t(e,r,l),c=i.poly1305.create(a);s&&u(c,s),u(c,n);const d=(0,o.u64Lengths)(n.length,s?s.length:0,!0);c.update(d);const h=c.digest();return(0,o.clean)(a,d),h}e._poly1305_aead=t=>(e,r,n)=>{const i=16;return{encrypt(s,a){const c=s.length;(a=(0,o.getOutput)(c+i,a,!1)).set(s);const u=a.subarray(0,-16);t(e,r,u,u,1);const l=d(t,e,r,u,n);return a.set(l,c),(0,o.clean)(l),a},decrypt(s,a){a=(0,o.getOutput)(s.length-i,a,!1);const c=s.subarray(0,-16),u=s.subarray(-16),l=d(t,e,r,c,n);if(!(0,o.equalBytes)(u,l))throw new Error("invalid tag");return a.set(s.subarray(0,-16)),t(e,r,a,a,1),(0,o.clean)(l),a}}},e.chacha20poly1305=(0,o.wrapCipher)({blockSize:64,nonceLength:12,tagLength:16},(0,e._poly1305_aead)(e.chacha20)),e.xchacha20poly1305=(0,o.wrapCipher)({blockSize:64,nonceLength:24,tagLength:16},(0,e._poly1305_aead)(e.xchacha20))},8967:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(1275),i=r(3736),o=r(4099);const s=function(t,e,r,s,a,c){var u=1&r,l=t.length,d=e.length;if(l!=d&&!(u&&d>l))return!1;var h=c.get(t),f=c.get(e);if(h&&f)return h==e&&f==t;var p=-1,y=!0,g=2&r?new n.A:void 0;for(c.set(t,e),c.set(e,t);++p<l;){var m=t[p],_=e[p];if(s)var b=u?s(_,m,p,e,t,c):s(m,_,p,t,e,c);if(void 0!==b){if(b)continue;y=!1;break}if(g){if(!(0,i.A)(e,function(t,e){if(!(0,o.A)(g,e)&&(m===t||a(m,t,r,s,c)))return g.push(e)})){y=!1;break}}else if(m!==_&&!a(m,_,r,s,c)){y=!1;break}}return c.delete(t),c.delete(e),y}},9008:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return t}},9042:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(3831),i=r(4792),o=r(7422);const s=function(t){return(0,n.A)(t,o.A,i.A)}},9065:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.PrivateKey=void 0;var n=r(5295);Object.defineProperty(e,"PrivateKey",{enumerable:!0,get:function(){return n.PrivateKey}});var i=r(2557);Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return i.PublicKey}})},9084:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(6318),i=r(7346),o=r(7465);const s=function(t,e,r){for(var s=-1,a=e.length,c={};++s<a;){var u=e[s],l=(0,n.A)(t,u);r(l,u)&&(0,i.A)(c,(0,o.A)(u,t),l)}return c}},9109:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(9857),i=r(2302),o=r(9959);const s=n.A&&1/(0,o.A)(new n.A([,-0]))[1]==1/0?function(t){return new n.A(t)}:i.A},9175:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=i,e.anumber=o,e.abytes=s,e.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");o(t.outputLen),o(t.blockLen)},e.aexists=function(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")},e.aoutput=function(t,e){s(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},e.u8=function(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},e.u32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))},e.clean=function(...t){for(let e=0;e<t.length;e++)t[e].fill(0)},e.createView=function(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)},e.rotr=function(t,e){return t<<32-e|t>>>e},e.rotl=function(t,e){return t<<e|t>>>32-e>>>0},e.byteSwap=a,e.byteSwap32=c,e.bytesToHex=function(t){if(s(t),u)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=l[t[r]];return e},e.hexToBytes=function(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(u)return Uint8Array.fromHex(t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let e=0,i=0;e<r;e++,i+=2){const r=h(t.charCodeAt(i)),o=h(t.charCodeAt(i+1));if(void 0===r||void 0===o){const e=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+i)}n[e]=16*r+o}return n},e.asyncLoop=async function(t,r,n){let i=Date.now();for(let o=0;o<t;o++){n(o);const t=Date.now()-i;t>=0&&t<r||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=f,e.bytesToUtf8=function(t){return(new TextDecoder).decode(t)},e.toBytes=p,e.kdfInputToBytes=function(t){"string"==typeof t&&(t=f(t));return s(t),t},e.concatBytes=function(...t){let e=0;for(let r=0;r<t.length;r++){const n=t[r];s(n),e+=n.length}const r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const i=t[e];r.set(i,n),n+=i.length}return r},e.checkOpts=function(t,e){if(void 0!==e&&"[object Object]"!=={}.toString.call(e))throw new Error("options should be object or undefined");return Object.assign(t,e)},e.createHasher=y,e.createOptHasher=g,e.createXOFer=m,e.randomBytes=function(t=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(t));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return Uint8Array.from(n.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")};const n=r(5145);function i(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function o(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function s(t,...e){if(!i(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function a(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function c(t){for(let e=0;e<t.length;e++)t[e]=a(t[e]);return t}e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.swap8IfBE=e.isLE?t=>t:t=>a(t),e.byteSwapIfBE=e.swap8IfBE,e.swap32IfBE=e.isLE?t=>t:c;const u=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),l=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const d={_0:48,_9:57,A:65,F:70,a:97,f:102};function h(t){return t>=d._0&&t<=d._9?t-d._0:t>=d.A&&t<=d.F?t-(d.A-10):t>=d.a&&t<=d.f?t-(d.a-10):void 0}function f(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function p(t){return"string"==typeof t&&(t=f(t)),s(t),t}e.nextTick=async()=>{};function y(t){const e=e=>t().update(p(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function g(t){const e=(e,r)=>t(r).update(p(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}function m(t){const e=(e,r)=>t(r).update(p(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}e.Hash=class{},e.wrapConstructor=y,e.wrapConstructorWithOpts=g,e.wrapXOFConstructorWithOpts=m},9190:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},9205:(t,e,r)=>{"use strict";r.d(e,{N:()=>n});class n{_indoor;_isEnabled=!0;constructor(t){this._indoor=t}enable(){this._isEnabled=!0,this._indoor.setAllowBuildingSwitch(!0)}disable(){this._isEnabled=!1,this._indoor.setAllowBuildingSwitch(!1)}get isEnabled(){return this._isEnabled}}},9266:(t,e,r)=>{"use strict";r.d(e,{Cm:()=>c.Cm,EC:()=>c.EC,FI:()=>s.FI,KL:()=>i.KL,SN:()=>u.S,Sr:()=>l.S,TU:()=>s.TU,Uk:()=>c.Uk,e$:()=>i.e$,iD:()=>a.i,xv:()=>d,yf:()=>o.y});var n=r(8330),i=r(9588),o=r(4969),s=r(1965),a=r(8693),c=r(7808),u=r(2658),l=r(9489);const d=n.rE},9313:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(5488),i=r(3149),o=r(1882),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;const l=function(t){if("number"==typeof t)return t;if((0,o.A)(t))return NaN;if((0,i.A)(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=(0,i.A)(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=(0,n.A)(t);var r=a.test(t);return r||c.test(t)?u(t.slice(2),r?2:8):s.test(t)?NaN:+t}},9378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToPublicKey=e.convertPublicKeyFormat=e.getSharedPoint=e.getPublicKey=e.isValidPrivateKey=e.getValidSecret=void 0;var n=r(8489),i=r(459),o=r(8510),s=r(4928),a=r(1666),c=r(3503);e.getValidSecret=function(t){var r;do{r=(0,n.randomBytes)(a.SECRET_KEY_LENGTH)}while(!(0,e.isValidPrivateKey)(r,t));return r};e.isValidPrivateKey=function(t,e){return u(e||(0,s.ellipticCurve)(),function(e){return e.utils.isValidPrivateKey(t)},function(){return!0},function(){return!0})};e.getPublicKey=function(t,e){return u(e||(0,s.ellipticCurve)(),function(e){return e.getPublicKey(t)},function(e){return e.getPublicKey(t)},function(e){return e.getPublicKey(t)})};e.getSharedPoint=function(t,e,r,n){return u(n||(0,s.ellipticCurve)(),function(n){return n.getSharedSecret(t,e,r)},function(r){return r.getSharedSecret(t,e)},function(r){return d(r,t,e)})};e.convertPublicKeyFormat=function(t,e,r){return u(r||(0,s.ellipticCurve)(),function(r){return r.getSharedSecret(BigInt(1),t,e)},function(){return t},function(){return t})};function u(t,e,r,n){if("secp256k1"===t)return e(o.secp256k1);if("x25519"===t)return r(i.x25519);if("ed25519"===t)return n(i.ed25519);throw new Error("Not implemented")}e.hexToPublicKey=function(t,e){var r=(0,c.decodeHex)(t);return u(e||(0,s.ellipticCurve)(),function(){return l(r)},function(){return r},function(){return r})};var l=function(t){if(t.length===a.ETH_PUBLIC_KEY_SIZE){var e=new Uint8Array(1+t.length);return e.set([4]),e.set(t,1),e}return t},d=function(t,e,r){var n=t.utils.getExtendedPublicKey(e).scalar;return t.ExtendedPoint.fromHex(r).multiply(n).toRawBytes()}},9396:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(3149);const i=function(t){return t==t&&!(0,n.A)(t)}},9408:(t,e,r)=>{"use strict";var n;r.d(e,{S:()=>n}),function(t){t.CHRISTMAS="christmas",t.HALLOWEEN="halloween",t.MAPPY_BEE="mappyBee",t.MAPXUS="mapxus",t.LANDS_D="landsD",t.COMMON="common",t.MAPXUS_V2="mapxus_v2",t.MAPXUS_DEFAULT="mapxus_default"}(n||(n={}))},9489:(t,e,r)=>{"use strict";r.d(e,{S:()=>o});var n=r(1089),i=r(7311);const o=["unauthorized","initError"],s=globalThis,a=(0,n.A)(...o);i.o.getInstance().setGlobalDispatcher(a),s.MapxusMapEvents=s.MapxusMapEvents||{},s.MapxusMapEvents.on=function(t,e){return a.on(t,e),{off:()=>a.on(t,null)}}},9520:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},9573:(t,e,r)=>{"use strict";function n(t){let e=!0,r="";if(Array.isArray(t)){const n=t.filter(i);e=0===n.length,r=n.join(",")}else i(t)&&(e=!1,r=t.trim());return e?null:r}function i(t){return"string"==typeof t&&t.trim().length>0}function o(t){return Array.isArray(t)&&2===t.length&&t.every(t=>"number"==typeof t)}function s(t){return Array.isArray(t)&&2===t.length&&t.every(t=>o(t))}function a(t){return"number"==typeof t&&t>0}r.d(e,{BW:()=>i,ES:()=>o,F5:()=>a,VS:()=>n,dD:()=>s})},9588:(t,e,r)=>{"use strict";r.d(e,{KL:()=>a,R0:()=>n,e$:()=>s,hl:()=>i,kk:()=>o});const n="https://map-api.mapxus.co.jp/accounts/v1/auth/secure-token",i="https://map-api.mapxus.co.jp/bms",o="https://map-sdk.mapxus.co.jp/prod/static/resources/manifest-z6frc5.dat",s=10,a=1},9610:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(9672),i=r(3149);const o=function(t){if(!(0,i.A)(t))return!1;var e=(0,n.A)(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},9615:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const n=r(9175);class i extends n.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,n.ahash)(t);const r=(0,n.toBytes)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?t.create().update(r).digest():r);for(let t=0;t<o.length;t++)o[t]^=54;this.iHash.update(o),this.oHash=t.create();for(let t=0;t<o.length;t++)o[t]^=106;this.oHash.update(o),(0,n.clean)(o)}update(t){return(0,n.aexists)(this),this.iHash.update(t),this}digestInto(t){(0,n.aexists)(this),(0,n.abytes)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=n,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=i;e.hmac=(t,e,r)=>new i(t,e).update(r).digest(),e.hmac.create=(t,e)=>new i(t,e)},9644:(t,e,r)=>{"use strict";r.d(e,{C:()=>n});class n{_floorSelector;_isEnabled;_position;constructor(t){this._floorSelector=t,this._position=t.position,this._isEnabled=this._floorSelector.enabled}enable(){this._isEnabled=!0,this._floorSelector.setEnabled(!0)}disable(){this._isEnabled=!1,this._floorSelector.setEnabled(!1)}setPosition(t,e){this._position=t,this._floorSelector.changePosition(this._floorSelector.position,t,e)}setStyle(t){this._floorSelector.setStyle(t)}get isEnabled(){return this._isEnabled}get position(){return this._position}}},9672:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(241),i=r(451),o=r(5606),s=n.A?n.A.toStringTag:void 0;const a=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?(0,i.A)(t):(0,o.A)(t)}},9717:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(9672),i=r(5254),o=r(3098),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;const a=function(t){return(0,o.A)(t)&&(0,i.A)(t.length)&&!!s[(0,n.A)(t)]}},9789:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){return null!=t&&e in Object(t)}},9846:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(5547);const i=function(t){var e=(0,n.A)(this,t).delete(t);return this.size-=e?1:0,e}},9857:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(702),i=r(1917);const o=(0,n.A)(i.A,"Set")},9875:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return this.__data__.has(t)}},9914:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},9959:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}},9983:(t,e,r)=>{"use strict";r.d(e,{G:()=>n.G,Z:()=>i.Z});var n=r(4762),i=r(3442)}},n={};function i(t){var e=n[t];if(void 0!==e)return e.exports;var o=n[t]={exports:{}};return r[t].call(o.exports,o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";i.r(o),i.d(o,{ASSISTANT_LAYER_INDOOR_FLOORS:()=>h.FI,ASSISTANT_LAYER_SHARED_FLOORS:()=>h.TU,AccessControl:()=>a.k,AccessControlOrigin:()=>d.en,BuildingFilterControl:()=>c.G,BuildingSelectorHandler:()=>u.EJ,BuildingsService:()=>l.H$,DistanceSearchType:()=>d.Kp,ERRORS:()=>h.Sr,FloorSelectorHandler:()=>u.CA,FloorsControl:()=>c.Z,Indoor:()=>e.SN,Map:()=>t.T,Marker:()=>r.p,OFFSET:()=>h.e$,OrientationDistanceSearchType:()=>d._P,PAGE:()=>h.KL,Poi:()=>n.p,PoisOrderBy:()=>d.LJ,PoisService:()=>l.FR,PoisSortBy:()=>d.nH,PresetLanguage:()=>d.ys,RoutePainter:()=>s.B,RouteService:()=>l.v$,SwitchBuildingHandler:()=>u.Nj,SwitchOutdoorHandler:()=>u.B6,ThemeType:()=>d.SV,VERSION:()=>h.xv,VehicleType:()=>d.$O,VenuesService:()=>l.w1,__internal:()=>h.SN,convertBrowserLangToPresetLang:()=>h.yf,getAccessToken:()=>h.iD,getIdentifier:()=>h.Cm,setGetTokenAsync:()=>h.Uk,setupTokenManager:()=>h.EC});var t=i(5462),e=i(5629),r=i(4116),n=i(5188),s=i(6733),a=i(6242),c=i(9983),u=i(1088),l=i(4545),d=i(3574),h=i(9266)})(),o})());
1
+ (function(_e,Vt){typeof exports=="object"&&typeof module<"u"?Vt(exports,require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","maplibre-gl"],Vt):(_e=typeof globalThis<"u"?globalThis:_e||self,Vt(_e.MapxusMap={},_e.maplibregl))})(this,(function(_e,Vt){"use strict";var Mn={exports:{}},no;function Qc(){if(no)return Mn.exports;no=1;function e(){}return e.prototype={on:function(t,n,r){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:n,ctx:r}),this},once:function(t,n,r){var i=this;function o(){i.off(t,o),n.apply(r,arguments)}return o._=n,this.on(t,o,r)},emit:function(t){var n=[].slice.call(arguments,1),r=((this.e||(this.e={}))[t]||[]).slice(),i=0,o=r.length;for(i;i<o;i++)r[i].fn.apply(r[i].ctx,n);return this},off:function(t,n){var r=this.e||(this.e={}),i=r[t],o=[];if(i&&n)for(var s=0,a=i.length;s<a;s++)i[s].fn!==n&&i[s].fn._!==n&&o.push(i[s]);return o.length?r[t]=o:delete r[t],this}},Mn.exports=e,Mn.exports.TinyEmitter=e,Mn.exports}var Sr=Qc();function el(e){return e.layers.filter(t=>!Ir(t.source))}function Br(e){return e.layers.filter(t=>Ir(t.source))}function Ir(e){return typeof e!="string"?!1:e.startsWith("indoor-")}function xr(e){const{buildingId:t,labelCenter:{lat:n,lon:r},floors:i,name:o,venueId:s,defaultFloor:a}=e,d=Object.entries(o).reduce((I,[b,g])=>{const w=b==="default"?"name":`name:${b}`;return Object.assign(I,{[w]:g})},{}),{codes:u,ids:p,ordinals:h}=i.reduce((I,b)=>{const{id:g,code:w,ordinal:B}=b;return{codes:I.codes?`${I.codes},${w}`:w,ids:I.ids?`${I.ids},${g}`:g,ordinals:`${I.ordinals}`?`${I.ordinals},${B}`:`${B}`}},{codes:"",ids:"",ordinals:""});return{layer:{id:"mapxus-building-line"},properties:{building:"yes",id:t,label_center:`${r},${n}`,level_ids:p,level_names:u,ordinals:h,"ref:venue":s,...d,...a?{default_displayed_floor:a}:{}},source:"indoor-planet",sourceLayer:"mapxus_building"}}function Hn(e){const{address:t,buildings:n,id:r,name:i,type:o,labelCenter:{lon:s,lat:a},defaultBuilding:d,sharedFloors:u}=e,p=Object.entries(t).reduce((w,[B,T])=>Object.assign(w,B==="default"?{"addr:street":T.street,"addr:housenumber":T.housenumber}:{[`addr:street:${B}`]:T.street}),{}),h=Object.entries(i).reduce((w,[B,T])=>{const H=B==="default"?"name":`name:${B}`;return Object.assign(w,{[H]:T})},{}),I=d?n.find(w=>w.id===d)?.defaultFloor:null,b=d?{default_displayed_building:d,...I?{default_displayed_ordinal:I}:{}}:{},g=u?.length?{shared_level_ids:u.map(({id:w})=>w).join(","),shared_level_ordinals:u.map(({ordinal:w})=>w).join(",")}:{};return{layer:{id:"mapxus-venue-fill"},properties:{...p,...h,id:r,venue:o,label_center:`${s},${a}`,building_ids:n.map(({id:w})=>w).join(),...b,...g},source:"indoor-planet",sourceLayer:"mapxus_venue"}}function Ae(e,t=","){return typeof e!="string"||!e.trim()?[]:e.split(t)}const nn="reserve_mapxus-level-fill",je="reserve_mapxus-shared-level-fill",rn="reserve_mapxus-building-fill";var De=(e=>(e.ENGLISH="en",e.CHINESE_SIMPLIFIED="zh-Hans",e.CHINESE_TRADITIONAL="zh-Hant",e.CHINESE_TRADITIONAL_TW="zh-Hant-TW",e.JAPANESE="ja",e.KOREAN="ko",e.FILIPINO="fil",e.INDONESIAN="id",e.PORTUGUESE="pt",e.THAI="th",e.VIETNAMESE="vi",e.ARABIC="ar",e))(De||{});function ro(e){let t=null;return tl(e)?t=De.ENGLISH:nl(e)?t=De.CHINESE_SIMPLIFIED:rl(e)?t=De.CHINESE_TRADITIONAL:il(e)?t=De.CHINESE_TRADITIONAL_TW:ol(e)?t=De.JAPANESE:sl(e)?t=De.KOREAN:al(e)?t=De.FILIPINO:cl(e)?t=De.INDONESIAN:ll(e)?t=De.PORTUGUESE:ul(e)?t=De.THAI:dl(e)?t=De.VIETNAMESE:fl(e)&&(t=De.ARABIC),t}function tl(e){return/^en(-(US|GB|AU))?$/.test(e)}function nl(e){return/^zh(-(Hans|CN))?$/.test(e)}function rl(e){return/^zh-(Hant|HK|MO)$/.test(e)}function il(e){return e==="zh-TW"}function ol(e){return/^ja(-JP)?$/.test(e)}function sl(e){return/^ko(-KR)?$/.test(e)}function al(e){return/^(fil|tl)(-PH)?$/.test(e)}function cl(e){return/^id(-ID)?$/.test(e)}function ll(e){return/^pt(-(BR|PT))?$/.test(e)}function ul(e){return/^th(-TH)?$/.test(e)}function dl(e){return/^vi(-VN)?$/.test(e)}function fl(e){return/^ar(-(DZ|BH|EG|IQ|JO|KW|LB|LY|MA|OM|QA|SA|SY|TN|AE|YE))?$/.test(e)}var Lr=(e=>(e.CHRISTMAS="christmas_mims2_v1",e.HALLOWEEN="halloween_mims2_v1",e.MAPPY_BEE="mappybee_mims2_v2",e.MAPXUS="mapxus_mims2_v1",e.LANDS_D="lands_d_mims2_v1",e.COMMON="common_mims2_v1",e.MAPXUS_V2="mapxus_v2",e.MAPXUS_DEFAULT="mapxus_v8",e.ROSE_TEA="rose_tea",e.PEAR_SORBET="pear_sorbet",e.CITY_WALK="city_walk",e.MOCHA_MOUSSE="mocha_mousse",e.SECTION_DISPLAY_BY_COLOR="mapxus_v7_with_section_v2",e.SECTION_DISPLAY_BY_CATEGORY="mapxus_v7_with_section_v3",e))(Lr||{}),St=(e=>(e.Access="access_control",e.Map="map",e))(St||{}),Ar=(e=>(e.FOOT="foot",e.WHEELCHAIR="wheelchair",e.ESCALATOR="escalator",e.EMERGENCY="emergency",e))(Ar||{}),io=(e=>(e.POINT="Point",e.POLYGON="Polygon",e))(io||{}),Cr=(e=>(e.POINT="Point",e.POLYGON="Polygon",e.GATE="Gate",e))(Cr||{}),oo=(e=>(e.DEFAULT_NAME="DefaultName",e))(oo||{}),so=(e=>(e.ABSOLUTE_DISTANCE="AbsoluteDistance",e.ACTUAL_DISTANCE="ActualDistance",e))(so||{});const Un={lineWidth:3,lineColor:"#A5E3FF",lineOpacity:1,lineOffset:-1.5},ao={fontColor:"#8c8c8c",activeFontColor:"#fff",backgroundColor:"#fff",activeBackgroundColor:"#074769",itemSize:50,itemCount:4,defaultFolded:!1},hl=ro(window.navigator.language)??De.ENGLISH;function co(e,t){return function(){return e.apply(t,arguments)}}const{toString:pl}=Object.prototype,{getPrototypeOf:Tr}=Object,{iterator:Nn,toStringTag:lo}=Symbol,Dn=(e=>t=>{const n=pl.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Qe=e=>(e=e.toLowerCase(),t=>Dn(t)===e),$n=e=>t=>typeof t===e,{isArray:jt}=Array,on=$n("undefined");function sn(e){return e!==null&&!on(e)&&e.constructor!==null&&!on(e.constructor)&&qe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const uo=Qe("ArrayBuffer");function yl(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&uo(e.buffer),t}const gl=$n("string"),qe=$n("function"),fo=$n("number"),an=e=>e!==null&&typeof e=="object",ml=e=>e===!0||e===!1,Vn=e=>{if(Dn(e)!=="object")return!1;const t=Tr(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(lo in e)&&!(Nn in e)},_l=e=>{if(!an(e)||sn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},bl=Qe("Date"),wl=Qe("File"),vl=Qe("Blob"),El=Qe("FileList"),Sl=e=>an(e)&&qe(e.pipe),Bl=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||qe(e.append)&&((t=Dn(e))==="formdata"||t==="object"&&qe(e.toString)&&e.toString()==="[object FormData]"))},Il=Qe("URLSearchParams"),[xl,Ll,Al,Cl]=["ReadableStream","Request","Response","Headers"].map(Qe),Tl=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function cn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),jt(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(sn(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(r=0;r<s;r++)a=o[r],t.call(null,e[a],a,e)}}function ho(e,t){if(sn(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Bt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,po=e=>!on(e)&&e!==Bt;function Or(){const{caseless:e}=po(this)&&this||{},t={},n=(r,i)=>{const o=e&&ho(t,i)||i;Vn(t[o])&&Vn(r)?t[o]=Or(t[o],r):Vn(r)?t[o]=Or({},r):jt(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&cn(arguments[r],n);return t}const Ol=(e,t,n,{allOwnKeys:r}={})=>(cn(t,(i,o)=>{n&&qe(i)?e[o]=co(i,n):e[o]=i},{allOwnKeys:r}),e),Rl=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Pl=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Fl=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&Tr(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kl=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Ml=e=>{if(!e)return null;if(jt(e))return e;let t=e.length;if(!fo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Hl=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Tr(Uint8Array)),Ul=(e,t)=>{const r=(e&&e[Nn]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Nl=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Dl=Qe("HTMLFormElement"),$l=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),yo=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Vl=Qe("RegExp"),go=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};cn(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},jl=e=>{go(e,(t,n)=>{if(qe(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(qe(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ql=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return jt(e)?r(e):r(String(e).split(t)),n},Kl=()=>{},Gl=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function zl(e){return!!(e&&qe(e.append)&&e[lo]==="FormData"&&e[Nn])}const Zl=e=>{const t=new Array(10),n=(r,i)=>{if(an(r)){if(t.indexOf(r)>=0)return;if(sn(r))return r;if(!("toJSON"in r)){t[i]=r;const o=jt(r)?[]:{};return cn(r,(s,a)=>{const d=n(s,i+1);!on(d)&&(o[a]=d)}),t[i]=void 0,o}}return r};return n(e,0)},Wl=Qe("AsyncFunction"),Yl=e=>e&&(an(e)||qe(e))&&qe(e.then)&&qe(e.catch),mo=((e,t)=>e?setImmediate:t?((n,r)=>(Bt.addEventListener("message",({source:i,data:o})=>{i===Bt&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Bt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",qe(Bt.postMessage)),Xl=typeof queueMicrotask<"u"?queueMicrotask.bind(Bt):typeof process<"u"&&process.nextTick||mo,ie={isArray:jt,isArrayBuffer:uo,isBuffer:sn,isFormData:Bl,isArrayBufferView:yl,isString:gl,isNumber:fo,isBoolean:ml,isObject:an,isPlainObject:Vn,isEmptyObject:_l,isReadableStream:xl,isRequest:Ll,isResponse:Al,isHeaders:Cl,isUndefined:on,isDate:bl,isFile:wl,isBlob:vl,isRegExp:Vl,isFunction:qe,isStream:Sl,isURLSearchParams:Il,isTypedArray:Hl,isFileList:El,forEach:cn,merge:Or,extend:Ol,trim:Tl,stripBOM:Rl,inherits:Pl,toFlatObject:Fl,kindOf:Dn,kindOfTest:Qe,endsWith:kl,toArray:Ml,forEachEntry:Ul,matchAll:Nl,isHTMLForm:Dl,hasOwnProperty:yo,hasOwnProp:yo,reduceDescriptors:go,freezeMethods:jl,toObjectSet:ql,toCamelCase:$l,noop:Kl,toFiniteNumber:Gl,findKey:ho,global:Bt,isContextDefined:po,isSpecCompliantForm:zl,toJSONObject:Zl,isAsyncFn:Wl,isThenable:Yl,setImmediate:mo,asap:Xl,isIterable:e=>e!=null&&qe(e[Nn])};function Be(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}ie.inherits(Be,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ie.toJSONObject(this.config),code:this.code,status:this.status}}});const _o=Be.prototype,bo={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{bo[e]={value:e}}),Object.defineProperties(Be,bo),Object.defineProperty(_o,"isAxiosError",{value:!0}),Be.from=(e,t,n,r,i,o)=>{const s=Object.create(_o);return ie.toFlatObject(e,s,function(d){return d!==Error.prototype},a=>a!=="isAxiosError"),Be.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const Jl=null;function Rr(e){return ie.isPlainObject(e)||ie.isArray(e)}function wo(e){return ie.endsWith(e,"[]")?e.slice(0,-2):e}function vo(e,t,n){return e?e.concat(t).map(function(i,o){return i=wo(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function Ql(e){return ie.isArray(e)&&!e.some(Rr)}const eu=ie.toFlatObject(ie,{},null,function(t){return/^is[A-Z]/.test(t)});function jn(e,t,n){if(!ie.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ie.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,B){return!ie.isUndefined(B[w])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,s=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&ie.isSpecCompliantForm(t);if(!ie.isFunction(i))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(ie.isDate(g))return g.toISOString();if(ie.isBoolean(g))return g.toString();if(!d&&ie.isBlob(g))throw new Be("Blob is not supported. Use a Buffer instead.");return ie.isArrayBuffer(g)||ie.isTypedArray(g)?d&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function p(g,w,B){let T=g;if(g&&!B&&typeof g=="object"){if(ie.endsWith(w,"{}"))w=r?w:w.slice(0,-2),g=JSON.stringify(g);else if(ie.isArray(g)&&Ql(g)||(ie.isFileList(g)||ie.endsWith(w,"[]"))&&(T=ie.toArray(g)))return w=wo(w),T.forEach(function(N,X){!(ie.isUndefined(N)||N===null)&&t.append(s===!0?vo([w],X,o):s===null?w:w+"[]",u(N))}),!1}return Rr(g)?!0:(t.append(vo(B,w,o),u(g)),!1)}const h=[],I=Object.assign(eu,{defaultVisitor:p,convertValue:u,isVisitable:Rr});function b(g,w){if(!ie.isUndefined(g)){if(h.indexOf(g)!==-1)throw Error("Circular reference detected in "+w.join("."));h.push(g),ie.forEach(g,function(T,H){(!(ie.isUndefined(T)||T===null)&&i.call(t,T,ie.isString(H)?H.trim():H,w,I))===!0&&b(T,w?w.concat(H):[H])}),h.pop()}}if(!ie.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Eo(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Pr(e,t){this._pairs=[],e&&jn(e,this,t)}const So=Pr.prototype;So.append=function(t,n){this._pairs.push([t,n])},So.toString=function(t){const n=t?function(r){return t.call(this,r,Eo)}:Eo;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function tu(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Bo(e,t,n){if(!t)return e;const r=n&&n.encode||tu;ie.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=ie.isURLSearchParams(t)?t.toString():new Pr(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Io{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ie.forEach(this.handlers,function(r){r!==null&&t(r)})}}const xo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},nu={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Pr,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Fr=typeof window<"u"&&typeof document<"u",kr=typeof navigator=="object"&&navigator||void 0,ru=Fr&&(!kr||["ReactNative","NativeScript","NS"].indexOf(kr.product)<0),iu=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ou=Fr&&window.location.href||"http://localhost",He={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Fr,hasStandardBrowserEnv:ru,hasStandardBrowserWebWorkerEnv:iu,navigator:kr,origin:ou},Symbol.toStringTag,{value:"Module"})),...nu};function su(e,t){return jn(e,new He.classes.URLSearchParams,{visitor:function(n,r,i,o){return He.isNode&&ie.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function au(e){return ie.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function cu(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function Lo(e){function t(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),d=o>=n.length;return s=!s&&ie.isArray(i)?i.length:s,d?(ie.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!ie.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&ie.isArray(i[s])&&(i[s]=cu(i[s])),!a)}if(ie.isFormData(e)&&ie.isFunction(e.entries)){const n={};return ie.forEachEntry(e,(r,i)=>{t(au(r),i,n,0)}),n}return null}function lu(e,t,n){if(ie.isString(e))try{return(t||JSON.parse)(e),ie.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ln={transitional:xo,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=ie.isObject(t);if(o&&ie.isHTMLForm(t)&&(t=new FormData(t)),ie.isFormData(t))return i?JSON.stringify(Lo(t)):t;if(ie.isArrayBuffer(t)||ie.isBuffer(t)||ie.isStream(t)||ie.isFile(t)||ie.isBlob(t)||ie.isReadableStream(t))return t;if(ie.isArrayBufferView(t))return t.buffer;if(ie.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return su(t,this.formSerializer).toString();if((a=ie.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return jn(a?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),lu(t)):t}],transformResponse:[function(t){const n=this.transitional||ln.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(ie.isResponse(t)||ie.isReadableStream(t))return t;if(t&&ie.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?Be.from(a,Be.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:He.classes.FormData,Blob:He.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ie.forEach(["delete","get","head","post","put","patch"],e=>{ln.headers[e]={}});const uu=ie.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),du=e=>{const t={};let n,r,i;return e&&e.split(`
2
+ `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&uu[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ao=Symbol("internals");function un(e){return e&&String(e).trim().toLowerCase()}function qn(e){return e===!1||e==null?e:ie.isArray(e)?e.map(qn):String(e)}function fu(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const hu=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Mr(e,t,n,r,i){if(ie.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!ie.isString(t)){if(ie.isString(r))return t.indexOf(r)!==-1;if(ie.isRegExp(r))return r.test(t)}}function pu(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function yu(e,t){const n=ie.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}let Ke=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,d,u){const p=un(d);if(!p)throw new Error("header name must be a non-empty string");const h=ie.findKey(i,p);(!h||i[h]===void 0||u===!0||u===void 0&&i[h]!==!1)&&(i[h||d]=qn(a))}const s=(a,d)=>ie.forEach(a,(u,p)=>o(u,p,d));if(ie.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(ie.isString(t)&&(t=t.trim())&&!hu(t))s(du(t),n);else if(ie.isObject(t)&&ie.isIterable(t)){let a={},d,u;for(const p of t){if(!ie.isArray(p))throw TypeError("Object iterator must return a key-value pair");a[u=p[0]]=(d=a[u])?ie.isArray(d)?[...d,p[1]]:[d,p[1]]:p[1]}s(a,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=un(t),t){const r=ie.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return fu(i);if(ie.isFunction(n))return n.call(this,i,r);if(ie.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=un(t),t){const r=ie.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Mr(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=un(s),s){const a=ie.findKey(r,s);a&&(!n||Mr(r,r[a],a,n))&&(delete r[a],i=!0)}}return ie.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Mr(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return ie.forEach(this,(i,o)=>{const s=ie.findKey(r,o);if(s){n[s]=qn(i),delete n[o];return}const a=t?pu(o):String(o).trim();a!==o&&delete n[o],n[a]=qn(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ie.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&ie.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Ao]=this[Ao]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=un(s);r[a]||(yu(i,s),r[a]=!0)}return ie.isArray(t)?t.forEach(o):o(t),this}};Ke.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ie.reduceDescriptors(Ke.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),ie.freezeMethods(Ke);function Hr(e,t){const n=this||ln,r=t||n,i=Ke.from(r.headers);let o=r.data;return ie.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Co(e){return!!(e&&e.__CANCEL__)}function qt(e,t,n){Be.call(this,e??"canceled",Be.ERR_CANCELED,t,n),this.name="CanceledError"}ie.inherits(qt,Be,{__CANCEL__:!0});function To(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Be("Request failed with status code "+n.status,[Be.ERR_BAD_REQUEST,Be.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function gu(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mu(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(d){const u=Date.now(),p=r[o];s||(s=u),n[i]=d,r[i]=u;let h=o,I=0;for(;h!==i;)I+=n[h++],h=h%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),u-s<t)return;const b=p&&u-p;return b?Math.round(I*1e3/b):void 0}}function _u(e,t){let n=0,r=1e3/t,i,o;const s=(u,p=Date.now())=>{n=p,i=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const p=Date.now(),h=p-n;h>=r?s(u,p):(i=u,o||(o=setTimeout(()=>{o=null,s(i)},r-h)))},()=>i&&s(i)]}const Kn=(e,t,n=3)=>{let r=0;const i=mu(50,250);return _u(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,d=s-r,u=i(d),p=s<=a;r=s;const h={loaded:s,total:a,progress:a?s/a:void 0,bytes:d,rate:u||void 0,estimated:u&&a&&p?(a-s)/u:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(h)},n)},Oo=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ro=e=>(...t)=>ie.asap(()=>e(...t)),bu=He.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,He.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(He.origin),He.navigator&&/(msie|trident)/i.test(He.navigator.userAgent)):()=>!0,wu=He.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];ie.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ie.isString(r)&&s.push("path="+r),ie.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function vu(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Eu(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Po(e,t,n){let r=!vu(t);return e&&(r||n==!1)?Eu(e,t):t}const Fo=e=>e instanceof Ke?{...e}:e;function It(e,t){t=t||{};const n={};function r(u,p,h,I){return ie.isPlainObject(u)&&ie.isPlainObject(p)?ie.merge.call({caseless:I},u,p):ie.isPlainObject(p)?ie.merge({},p):ie.isArray(p)?p.slice():p}function i(u,p,h,I){if(ie.isUndefined(p)){if(!ie.isUndefined(u))return r(void 0,u,h,I)}else return r(u,p,h,I)}function o(u,p){if(!ie.isUndefined(p))return r(void 0,p)}function s(u,p){if(ie.isUndefined(p)){if(!ie.isUndefined(u))return r(void 0,u)}else return r(void 0,p)}function a(u,p,h){if(h in t)return r(u,p);if(h in e)return r(void 0,u)}const d={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,p,h)=>i(Fo(u),Fo(p),h,!0)};return ie.forEach(Object.keys({...e,...t}),function(p){const h=d[p]||i,I=h(e[p],t[p],p);ie.isUndefined(I)&&h!==a||(n[p]=I)}),n}const ko=e=>{const t=It({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=Ke.from(s),t.url=Bo(Po(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let d;if(ie.isFormData(n)){if(He.hasStandardBrowserEnv||He.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((d=s.getContentType())!==!1){const[u,...p]=d?d.split(";").map(h=>h.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...p].join("; "))}}if(He.hasStandardBrowserEnv&&(r&&ie.isFunction(r)&&(r=r(t)),r||r!==!1&&bu(t.url))){const u=i&&o&&wu.read(o);u&&s.set(i,u)}return t},Su=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=ko(e);let o=i.data;const s=Ke.from(i.headers).normalize();let{responseType:a,onUploadProgress:d,onDownloadProgress:u}=i,p,h,I,b,g;function w(){b&&b(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let B=new XMLHttpRequest;B.open(i.method.toUpperCase(),i.url,!0),B.timeout=i.timeout;function T(){if(!B)return;const N=Ke.from("getAllResponseHeaders"in B&&B.getAllResponseHeaders()),P={data:!a||a==="text"||a==="json"?B.responseText:B.response,status:B.status,statusText:B.statusText,headers:N,config:e,request:B};To(function(q){n(q),w()},function(q){r(q),w()},P),B=null}"onloadend"in B?B.onloadend=T:B.onreadystatechange=function(){!B||B.readyState!==4||B.status===0&&!(B.responseURL&&B.responseURL.indexOf("file:")===0)||setTimeout(T)},B.onabort=function(){B&&(r(new Be("Request aborted",Be.ECONNABORTED,e,B)),B=null)},B.onerror=function(){r(new Be("Network Error",Be.ERR_NETWORK,e,B)),B=null},B.ontimeout=function(){let X=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const P=i.transitional||xo;i.timeoutErrorMessage&&(X=i.timeoutErrorMessage),r(new Be(X,P.clarifyTimeoutError?Be.ETIMEDOUT:Be.ECONNABORTED,e,B)),B=null},o===void 0&&s.setContentType(null),"setRequestHeader"in B&&ie.forEach(s.toJSON(),function(X,P){B.setRequestHeader(P,X)}),ie.isUndefined(i.withCredentials)||(B.withCredentials=!!i.withCredentials),a&&a!=="json"&&(B.responseType=i.responseType),u&&([I,g]=Kn(u,!0),B.addEventListener("progress",I)),d&&B.upload&&([h,b]=Kn(d),B.upload.addEventListener("progress",h),B.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(p=N=>{B&&(r(!N||N.type?new qt(null,e,B):N),B.abort(),B=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const H=gu(i.url);if(H&&He.protocols.indexOf(H)===-1){r(new Be("Unsupported protocol "+H+":",Be.ERR_BAD_REQUEST,e));return}B.send(o||null)})},Bu=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(u){if(!i){i=!0,a();const p=u instanceof Error?u:this.reason;r.abort(p instanceof Be?p:new qt(p instanceof Error?p.message:p))}};let s=t&&setTimeout(()=>{s=null,o(new Be(`timeout ${t} of ms exceeded`,Be.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>ie.asap(a),d}},Iu=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},xu=async function*(e,t){for await(const n of Lu(e))yield*Iu(n,t)},Lu=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Mo=(e,t,n,r)=>{const i=xu(e,t);let o=0,s,a=d=>{s||(s=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:u,value:p}=await i.next();if(u){a(),d.close();return}let h=p.byteLength;if(n){let I=o+=h;n(I)}d.enqueue(new Uint8Array(p))}catch(u){throw a(u),u}},cancel(d){return a(d),i.return()}},{highWaterMark:2})},Gn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ho=Gn&&typeof ReadableStream=="function",Au=Gn&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Uo=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Cu=Ho&&Uo(()=>{let e=!1;const t=new Request(He.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),No=64*1024,Ur=Ho&&Uo(()=>ie.isReadableStream(new Response("").body)),zn={stream:Ur&&(e=>e.body)};Gn&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!zn[t]&&(zn[t]=ie.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Be(`Response type '${t}' is not supported`,Be.ERR_NOT_SUPPORT,r)})})})(new Response);const Tu=async e=>{if(e==null)return 0;if(ie.isBlob(e))return e.size;if(ie.isSpecCompliantForm(e))return(await new Request(He.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ie.isArrayBufferView(e)||ie.isArrayBuffer(e))return e.byteLength;if(ie.isURLSearchParams(e)&&(e=e+""),ie.isString(e))return(await Au(e)).byteLength},Ou=async(e,t)=>{const n=ie.toFiniteNumber(e.getContentLength());return n??Tu(t)},Nr={http:Jl,xhr:Su,fetch:Gn&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:d,responseType:u,headers:p,withCredentials:h="same-origin",fetchOptions:I}=ko(e);u=u?(u+"").toLowerCase():"text";let b=Bu([i,o&&o.toAbortSignal()],s),g;const w=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let B;try{if(d&&Cu&&n!=="get"&&n!=="head"&&(B=await Ou(p,r))!==0){let P=new Request(t,{method:"POST",body:r,duplex:"half"}),F;if(ie.isFormData(r)&&(F=P.headers.get("content-type"))&&p.setContentType(F),P.body){const[q,W]=Oo(B,Kn(Ro(d)));r=Mo(P.body,No,q,W)}}ie.isString(h)||(h=h?"include":"omit");const T="credentials"in Request.prototype;g=new Request(t,{...I,signal:b,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:T?h:void 0});let H=await fetch(g,I);const N=Ur&&(u==="stream"||u==="response");if(Ur&&(a||N&&w)){const P={};["status","statusText","headers"].forEach(K=>{P[K]=H[K]});const F=ie.toFiniteNumber(H.headers.get("content-length")),[q,W]=a&&Oo(F,Kn(Ro(a),!0))||[];H=new Response(Mo(H.body,No,q,()=>{W&&W(),w&&w()}),P)}u=u||"text";let X=await zn[ie.findKey(zn,u)||"text"](H,e);return!N&&w&&w(),await new Promise((P,F)=>{To(P,F,{data:X,headers:Ke.from(H.headers),status:H.status,statusText:H.statusText,config:e,request:g})})}catch(T){throw w&&w(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new Be("Network Error",Be.ERR_NETWORK,e,g),{cause:T.cause||T}):Be.from(T,T&&T.code,e,g)}})};ie.forEach(Nr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Do=e=>`- ${e}`,Ru=e=>ie.isFunction(e)||e===null||e===!1,$o={getAdapter:e=>{e=ie.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o<t;o++){n=e[o];let s;if(r=n,!Ru(n)&&(r=Nr[(s=String(n)).toLowerCase()],r===void 0))throw new Be(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([a,d])=>`adapter ${a} `+(d===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since :
4
+ `+o.map(Do).join(`
5
+ `):" "+Do(o[0]):"as no adapter specified";throw new Be("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Nr};function Dr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new qt(null,e)}function Vo(e){return Dr(e),e.headers=Ke.from(e.headers),e.data=Hr.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),$o.getAdapter(e.adapter||ln.adapter)(e).then(function(r){return Dr(e),r.data=Hr.call(e,e.transformResponse,r),r.headers=Ke.from(r.headers),r},function(r){return Co(r)||(Dr(e),r&&r.response&&(r.response.data=Hr.call(e,e.transformResponse,r.response),r.response.headers=Ke.from(r.response.headers))),Promise.reject(r)})}const jo="1.11.0",Zn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Zn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const qo={};Zn.transitional=function(t,n,r){function i(o,s){return"[Axios v"+jo+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new Be(i(s," has been removed"+(n?" in "+n:"")),Be.ERR_DEPRECATED);return n&&!qo[s]&&(qo[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}},Zn.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Pu(e,t,n){if(typeof e!="object")throw new Be("options must be an object",Be.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],d=a===void 0||s(a,o,e);if(d!==!0)throw new Be("option "+o+" must be "+d,Be.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Be("Unknown option "+o,Be.ERR_BAD_OPTION)}}const Wn={assertOptions:Pu,validators:Zn},rt=Wn.validators;let xt=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Io,response:new Io}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=It(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&Wn.assertOptions(r,{silentJSONParsing:rt.transitional(rt.boolean),forcedJSONParsing:rt.transitional(rt.boolean),clarifyTimeoutError:rt.transitional(rt.boolean)},!1),i!=null&&(ie.isFunction(i)?n.paramsSerializer={serialize:i}:Wn.assertOptions(i,{encode:rt.function,serialize:rt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Wn.assertOptions(n,{baseUrl:rt.spelling("baseURL"),withXsrfToken:rt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&ie.merge(o.common,o[n.method]);o&&ie.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),n.headers=Ke.concat(s,o);const a=[];let d=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(d=d&&w.synchronous,a.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let p,h=0,I;if(!d){const g=[Vo.bind(this),void 0];for(g.unshift(...a),g.push(...u),I=g.length,p=Promise.resolve(n);h<I;)p=p.then(g[h++],g[h++]);return p}I=a.length;let b=n;for(h=0;h<I;){const g=a[h++],w=a[h++];try{b=g(b)}catch(B){w.call(this,B);break}}try{p=Vo.call(this,b)}catch(g){return Promise.reject(g)}for(h=0,I=u.length;h<I;)p=p.then(u[h++],u[h++]);return p}getUri(t){t=It(this.defaults,t);const n=Po(t.baseURL,t.url,t.allowAbsoluteUrls);return Bo(n,t.params,t.paramsSerializer)}};ie.forEach(["delete","get","head","options"],function(t){xt.prototype[t]=function(n,r){return this.request(It(r||{},{method:t,url:n,data:(r||{}).data}))}}),ie.forEach(["post","put","patch"],function(t){function n(r){return function(o,s,a){return this.request(It(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}xt.prototype[t]=n(),xt.prototype[t+"Form"]=n(!0)});let Fu=class Jc{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new qt(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Jc(function(i){t=i}),cancel:t}}};function ku(e){return function(n){return e.apply(null,n)}}function Mu(e){return ie.isObject(e)&&e.isAxiosError===!0}const $r={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($r).forEach(([e,t])=>{$r[t]=e});function Ko(e){const t=new xt(e),n=co(xt.prototype.request,t);return ie.extend(n,xt.prototype,t,{allOwnKeys:!0}),ie.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Ko(It(e,i))},n}const Pe=Ko(ln);Pe.Axios=xt,Pe.CanceledError=qt,Pe.CancelToken=Fu,Pe.isCancel=Co,Pe.VERSION=jo,Pe.toFormData=jn,Pe.AxiosError=Be,Pe.Cancel=Pe.CanceledError,Pe.all=function(t){return Promise.all(t)},Pe.spread=ku,Pe.isAxiosError=Mu,Pe.mergeConfig=It,Pe.AxiosHeaders=Ke,Pe.formToJSON=e=>Lo(ie.isHTMLForm(e)?new FormData(e):e),Pe.getAdapter=$o.getAdapter,Pe.HttpStatusCode=$r,Pe.default=Pe;const{Axios:pm,AxiosError:ym,CanceledError:gm,isCancel:mm,CancelToken:_m,VERSION:bm,all:wm,Cancel:vm,isAxiosError:Em,spread:Sm,toFormData:Bm,AxiosHeaders:Im,HttpStatusCode:xm,formToJSON:Lm,getAdapter:Am,mergeConfig:Cm}=Pe,Go="https://map-api.mapxus.co.jp/accounts/v1/auth/secure-token",zo="https://map-api.mapxus.co.jp/bms",Hu="https://map-sdk.mapxus.co.jp/prod/static/resources/manifest-z6frc5.dat",Ge=10,ze=1;var Vr=function(){return Vr=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vr.apply(this,arguments)};function it(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(p){try{u(r.next(p))}catch(h){s(h)}}function d(p){try{u(r.throw(p))}catch(h){s(h)}}function u(p){p.done?o(p.value):i(p.value).then(a,d)}u((r=r.apply(e,t||[])).next())})}function ot(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(p){return d([u,p])}}function d(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(p){u=[6,p],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Zo(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Wo="4.6.2";function Yn(e,t){return new Promise(function(n){return setTimeout(n,e,t)})}function Uu(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function Nu(e,t){t===void 0&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise(function(r){return n.call(window,function(){return r()},{timeout:t})}):Yn(Math.min(e,t))}function Yo(e){return!!e&&typeof e.then=="function"}function Xo(e,t){try{var n=e();Yo(n)?n.then(function(r){return t(!0,r)},function(r){return t(!1,r)}):t(!0,n)}catch(r){t(!1,r)}}function Jo(e,t,n){return n===void 0&&(n=16),it(this,void 0,void 0,function(){var r,i,o,s;return ot(this,function(a){switch(a.label){case 0:r=Array(e.length),i=Date.now(),o=0,a.label=1;case 1:return o<e.length?(r[o]=t(e[o],o),s=Date.now(),s>=i+n?(i=s,[4,Uu()]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++o,[3,1];case 4:return[2,r]}})})}function dn(e){return e.then(void 0,function(){}),e}function Du(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function $u(e,t){return!Du(e,t)}function jr(e){return parseInt(e)}function et(e){return parseFloat(e)}function lt(e,t){return typeof e=="number"&&isNaN(e)?t:e}function $e(e){return e.reduce(function(t,n){return t+(n?1:0)},0)}function Qo(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function Vu(e){for(var t,n,r="Unexpected syntax '".concat(e,"'"),i=/^\s*([a-z-]*)(.*)$/i.exec(e),o=i[1]||void 0,s={},a=/([.:#][\w-]+|\[.+?\])/gi,d=function(I,b){s[I]=s[I]||[],s[I].push(b)};;){var u=a.exec(i[2]);if(!u)break;var p=u[0];switch(p[0]){case".":d("class",p.slice(1));break;case"#":d("id",p.slice(1));break;case"[":{var h=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(p);if(h)d(h[1],(n=(t=h[4])!==null&&t!==void 0?t:h[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[o,s]}function ju(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>127)return new TextEncoder().encode(e);t[n]=r}return t}function mt(e,t){var n=e[0]>>>16,r=e[0]&65535,i=e[1]>>>16,o=e[1]&65535,s=t[0]>>>16,a=t[0]&65535,d=t[1]>>>16,u=t[1]&65535,p=0,h=0,I=0,b=0;b+=o+u,I+=b>>>16,b&=65535,I+=i+d,h+=I>>>16,I&=65535,h+=r+a,p+=h>>>16,h&=65535,p+=n+s,p&=65535,e[0]=p<<16|h,e[1]=I<<16|b}function Ye(e,t){var n=e[0]>>>16,r=e[0]&65535,i=e[1]>>>16,o=e[1]&65535,s=t[0]>>>16,a=t[0]&65535,d=t[1]>>>16,u=t[1]&65535,p=0,h=0,I=0,b=0;b+=o*u,I+=b>>>16,b&=65535,I+=i*u,h+=I>>>16,I&=65535,I+=o*d,h+=I>>>16,I&=65535,h+=r*u,p+=h>>>16,h&=65535,h+=i*d,p+=h>>>16,h&=65535,h+=o*a,p+=h>>>16,h&=65535,p+=n*u+r*d+i*a+o*s,p&=65535,e[0]=p<<16|h,e[1]=I<<16|b}function Kt(e,t){var n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function We(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function Oe(e,t){e[0]^=t[0],e[1]^=t[1]}var qu=[4283543511,3981806797],Ku=[3301882366,444984403];function es(e){var t=[0,e[0]>>>1];Oe(e,t),Ye(e,qu),t[1]=e[0]>>>1,Oe(e,t),Ye(e,Ku),t[1]=e[0]>>>1,Oe(e,t)}var Xn=[2277735313,289559509],Jn=[1291169091,658871167],ts=[0,5],Gu=[0,1390208809],zu=[0,944331445];function Zu(e,t){var n=ju(e);t=t||0;var r=[0,n.length],i=r[1]%16,o=r[1]-i,s=[0,t],a=[0,t],d=[0,0],u=[0,0],p;for(p=0;p<o;p=p+16)d[0]=n[p+4]|n[p+5]<<8|n[p+6]<<16|n[p+7]<<24,d[1]=n[p]|n[p+1]<<8|n[p+2]<<16|n[p+3]<<24,u[0]=n[p+12]|n[p+13]<<8|n[p+14]<<16|n[p+15]<<24,u[1]=n[p+8]|n[p+9]<<8|n[p+10]<<16|n[p+11]<<24,Ye(d,Xn),Kt(d,31),Ye(d,Jn),Oe(s,d),Kt(s,27),mt(s,a),Ye(s,ts),mt(s,Gu),Ye(u,Jn),Kt(u,33),Ye(u,Xn),Oe(a,u),Kt(a,31),mt(a,s),Ye(a,ts),mt(a,zu);d[0]=0,d[1]=0,u[0]=0,u[1]=0;var h=[0,0];switch(i){case 15:h[1]=n[p+14],We(h,48),Oe(u,h);case 14:h[1]=n[p+13],We(h,40),Oe(u,h);case 13:h[1]=n[p+12],We(h,32),Oe(u,h);case 12:h[1]=n[p+11],We(h,24),Oe(u,h);case 11:h[1]=n[p+10],We(h,16),Oe(u,h);case 10:h[1]=n[p+9],We(h,8),Oe(u,h);case 9:h[1]=n[p+8],Oe(u,h),Ye(u,Jn),Kt(u,33),Ye(u,Xn),Oe(a,u);case 8:h[1]=n[p+7],We(h,56),Oe(d,h);case 7:h[1]=n[p+6],We(h,48),Oe(d,h);case 6:h[1]=n[p+5],We(h,40),Oe(d,h);case 5:h[1]=n[p+4],We(h,32),Oe(d,h);case 4:h[1]=n[p+3],We(h,24),Oe(d,h);case 3:h[1]=n[p+2],We(h,16),Oe(d,h);case 2:h[1]=n[p+1],We(h,8),Oe(d,h);case 1:h[1]=n[p],Oe(d,h),Ye(d,Xn),Kt(d,31),Ye(d,Jn),Oe(s,d)}return Oe(s,r),Oe(a,r),mt(s,a),mt(a,s),es(s),es(a),mt(s,a),mt(a,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function Wu(e){var t;return Vr({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
7
+ `)},e)}function Yu(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Xu(e){return typeof e!="function"}function Ju(e,t){var n=dn(new Promise(function(r){var i=Date.now();Xo(e.bind(null,t),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=Date.now()-i;if(!o[0])return r(function(){return{error:o[1],duration:a}});var d=o[1];if(Xu(d))return r(function(){return{value:d,duration:a}});r(function(){return new Promise(function(u){var p=Date.now();Xo(d,function(){for(var h=[],I=0;I<arguments.length;I++)h[I]=arguments[I];var b=a+Date.now()-p;if(!h[0])return u({error:h[1],duration:b});u({value:h[1],duration:b})})})})})}));return function(){return n.then(function(i){return i()})}}function Qu(e,t,n,r){var i=Object.keys(e).filter(function(s){return $u(n,s)}),o=dn(Jo(i,function(s){return Ju(e[s],t)},r));return function(){return it(this,void 0,void 0,function(){var a,d,u,p,h;return ot(this,function(I){switch(I.label){case 0:return[4,o];case 1:return a=I.sent(),[4,Jo(a,function(b){return dn(b())},r)];case 2:return d=I.sent(),[4,Promise.all(d)];case 3:for(u=I.sent(),p={},h=0;h<i.length;++h)p[i[h]]=u[h];return[2,p]}})})}}function ns(){var e=window,t=navigator;return $e(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function ed(){var e=window,t=navigator;return $e(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!ns()}function fn(){var e=window,t=navigator;return $e(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function tt(){var e=window,t=navigator;return $e(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function qr(){var e=window,t=e.HTMLElement,n=e.Document;return $e(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function hn(){var e=window;return Yu(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function rs(){var e,t,n=window;return $e(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function td(){var e=window;return $e([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function nd(){var e=window,t=e.URLPattern;return $e(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function rd(){var e=window;return $e(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function pn(){var e=window,t=navigator,n=e.CSS,r=e.HTMLButtonElement;return $e([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function id(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return $e(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function od(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function sd(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Kr(){var e=fn(),t=rs(),n=window,r=navigator,i="connection";return e?$e([!("SharedWorker"in n),r[i]&&"ontypechange"in r[i],!("sinkId"in new Audio)])>=2:t?$e(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function ad(){var e=navigator,t=window,n=Audio.prototype,r=t.visualViewport;return $e(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function cd(){return dd()?-4:ld()}function ld(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(ud())return-1;var n=4500,r=5e3,i=new t(1,r,44100),o=i.createOscillator();o.type="triangle",o.frequency.value=1e4;var s=i.createDynamicsCompressor();s.threshold.value=-50,s.knee.value=40,s.ratio.value=12,s.attack.value=0,s.release.value=.25,o.connect(s),s.connect(i.destination),o.start(0);var a=fd(i),d=a[0],u=a[1],p=dn(d.then(function(h){return hd(h.getChannelData(0).subarray(n))},function(h){if(h.name==="timeout"||h.name==="suspended")return-3;throw h}));return function(){return u(),p}}function ud(){return tt()&&!qr()&&!rd()}function dd(){return tt()&&pn()&&hn()||fn()&&ad()&&nd()}function fd(e){var t=3,n=500,r=500,i=5e3,o=function(){},s=new Promise(function(a,d){var u=!1,p=0,h=0;e.oncomplete=function(g){return a(g.renderedBuffer)};var I=function(){setTimeout(function(){return d(is("timeout"))},Math.min(r,h+i-Date.now()))},b=function(){try{var g=e.startRendering();switch(Yo(g)&&dn(g),e.state){case"running":h=Date.now(),u&&I();break;case"suspended":document.hidden||p++,u&&p>=t?d(is("suspended")):setTimeout(b,n);break}}catch(w){d(w)}};b(),o=function(){u||(u=!0,h>0&&I())}});return[s,o]}function hd(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function is(e){var t=new Error(e);return t.name=e,t}function os(e,t,n){var r,i,o;return n===void 0&&(n=50),it(this,void 0,void 0,function(){var s,a;return ot(this,function(d){switch(d.label){case 0:s=document,d.label=1;case 1:return s.body?[3,3]:[4,Yn(n)];case 2:return d.sent(),[3,1];case 3:a=s.createElement("iframe"),d.label=4;case 4:return d.trys.push([4,,10,11]),[4,new Promise(function(u,p){var h=!1,I=function(){h=!0,u()},b=function(B){h=!0,p(B)};a.onload=I,a.onerror=b;var g=a.style;g.setProperty("display","block","important"),g.position="absolute",g.top="0",g.left="0",g.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",s.body.appendChild(a);var w=function(){var B,T;h||(((T=(B=a.contentWindow)===null||B===void 0?void 0:B.document)===null||T===void 0?void 0:T.readyState)==="complete"?I():setTimeout(w,10))};w()})];case 5:d.sent(),d.label=6;case 6:return!((i=(r=a.contentWindow)===null||r===void 0?void 0:r.document)===null||i===void 0)&&i.body?[3,8]:[4,Yn(n)];case 7:return d.sent(),[3,6];case 8:return[4,e(a,a.contentWindow)];case 9:return[2,d.sent()];case 10:return(o=a.parentNode)===null||o===void 0||o.removeChild(a),[7];case 11:return[2]}})})}function pd(e){for(var t=Vu(e),n=t[0],r=t[1],i=document.createElement(n??"div"),o=0,s=Object.keys(r);o<s.length;o++){var a=s[o],d=r[a].join(" ");a==="style"?yd(i.style,d):i.setAttribute(a,d)}return i}function yd(e,t){for(var n=0,r=t.split(";");n<r.length;n++){var i=r[n],o=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);if(o){var s=o[1],a=o[2],d=o[4];e.setProperty(s,a,d||"")}}}function gd(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}var md="mmMwWLliI0O&1",_d="48px",Gt=["monospace","sans-serif","serif"],ss=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function bd(){var e=this;return os(function(t,n){var r=n.document;return it(e,void 0,void 0,function(){var i,o,s,a,d,u,p,h,I,b,g,w;return ot(this,function(B){for(i=r.body,i.style.fontSize=_d,o=r.createElement("div"),o.style.setProperty("visibility","hidden","important"),s={},a={},d=function(T){var H=r.createElement("span"),N=H.style;return N.position="absolute",N.top="0",N.left="0",N.fontFamily=T,H.textContent=md,o.appendChild(H),H},u=function(T,H){return d("'".concat(T,"',").concat(H))},p=function(){return Gt.map(d)},h=function(){for(var T={},H=function(F){T[F]=Gt.map(function(q){return u(F,q)})},N=0,X=ss;N<X.length;N++){var P=X[N];H(P)}return T},I=function(T){return Gt.some(function(H,N){return T[N].offsetWidth!==s[H]||T[N].offsetHeight!==a[H]})},b=p(),g=h(),i.appendChild(o),w=0;w<Gt.length;w++)s[Gt[w]]=b[w].offsetWidth,a[Gt[w]]=b[w].offsetHeight;return[2,ss.filter(function(T){return I(g[T])})]})})})}function wd(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];if(r){for(var i=[],o=0;o<r.length;++o){var s=r[o];i.push({type:s.type,suffixes:s.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:i})}}return t}}function vd(){return Ed(Cd())}function Ed(e){var t,n=!1,r,i,o=Sd(),s=o[0],a=o[1];return Bd(s,a)?(n=Id(a),e?r=i="skipped":(t=xd(s,a),r=t[0],i=t[1])):r=i="unsupported",{winding:n,geometry:r,text:i}}function Sd(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function Bd(e,t){return!!(t&&e.toDataURL)}function Id(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function xd(e,t){Ld(e,t);var n=Gr(e),r=Gr(e);if(n!==r)return["unstable","unstable"];Ad(e,t);var i=Gr(e);return[i,n]}function Ld(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("😃");t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function Ad(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var i=r[n],o=i[0],s=i[1],a=i[2];t.fillStyle=o,t.beginPath(),t.arc(s,a,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Gr(e){return e.toDataURL()}function Cd(){return tt()&&pn()&&hn()}function Td(){var e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=jr(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var r="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:r}}function Od(){return navigator.oscpu}function Rd(){var e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))fn()&&td()||t.push(e.languages);else if(typeof e.languages=="string"){var r=e.languages;r&&t.push(r.split(","))}return t}function Pd(){return window.screen.colorDepth}function Fd(){return lt(et(navigator.deviceMemory),void 0)}function kd(){if(!(tt()&&pn()&&hn()))return Md()}function Md(){var e=screen,t=function(r){return lt(jr(r),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n}var Hd=2500,Ud=10,Qn,zr;function Nd(){if(zr===void 0){var e=function(){var t=Zr();Wr(t)?zr=setTimeout(e,Hd):(Qn=t,zr=void 0)};e()}}function Dd(){var e=this;return Nd(),function(){return it(e,void 0,void 0,function(){var t;return ot(this,function(n){switch(n.label){case 0:return t=Zr(),Wr(t)?Qn?[2,Zo([],Qn,!0)]:od()?[4,sd()]:[3,2]:[3,2];case 1:n.sent(),t=Zr(),n.label=2;case 2:return Wr(t)||(Qn=t),[2,t]}})})}}function $d(){var e=this;if(tt()&&pn()&&hn())return function(){return Promise.resolve(void 0)};var t=Dd();return function(){return it(e,void 0,void 0,function(){var n,r;return ot(this,function(i){switch(i.label){case 0:return[4,t()];case 1:return n=i.sent(),r=function(o){return o===null?null:Qo(o,Ud)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function Zr(){var e=screen;return[lt(et(e.availTop),null),lt(et(e.width)-et(e.availWidth)-lt(et(e.availLeft),0),null),lt(et(e.height)-et(e.availHeight)-lt(et(e.availTop),0),null),lt(et(e.availLeft),null)]}function Wr(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Vd(){return lt(jr(navigator.hardwareConcurrency),void 0)}function jd(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var n=new t().resolvedOptions().timeZone;if(n)return n}var r=-qd();return"UTC".concat(r>=0?"+":"").concat(r)}function qd(){var e=new Date().getFullYear();return Math.max(et(new Date(e,0,1).getTimezoneOffset()),et(new Date(e,6,1).getTimezoneOffset()))}function Kd(){try{return!!window.sessionStorage}catch{return!0}}function Gd(){try{return!!window.localStorage}catch{return!0}}function zd(){if(!(ns()||ed()))try{return!!window.indexedDB}catch{return!0}}function Zd(){return!!window.openDatabase}function Wd(){return navigator.cpuClass}function Yd(){var e=navigator.platform;return e==="MacIntel"&&tt()&&!qr()?id()?"iPad":"iPhone":e}function Xd(){return navigator.vendor||""}function Jd(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var r=n[t],i=window[r];i&&typeof i=="object"&&e.push(r)}return e.sort()}function Qd(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function ef(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function tf(e){var t=e===void 0?{}:e,n=t.debug;return it(this,void 0,void 0,function(){var r,i,o,s,a,d;return ot(this,function(u){switch(u.label){case 0:return nf()?(r=ef(),i=Object.keys(r),o=(d=[]).concat.apply(d,i.map(function(p){return r[p]})),[4,rf(o)]):[2,void 0];case 1:return s=u.sent(),n&&of(r,s),a=i.filter(function(p){var h=r[p],I=$e(h.map(function(b){return s[b]}));return I>h.length*.6}),a.sort(),[2,a]}})})}function nf(){return tt()||Kr()}function rf(e){var t;return it(this,void 0,void 0,function(){var n,r,i,o,d,s,a,d;return ot(this,function(u){switch(u.label){case 0:for(n=document,r=n.createElement("div"),i=new Array(e.length),o={},as(r),d=0;d<e.length;++d)s=pd(e[d]),s.tagName==="DIALOG"&&s.show(),a=n.createElement("div"),as(a),a.appendChild(s),r.appendChild(a),i[d]=s;u.label=1;case 1:return n.body?[3,3]:[4,Yn(50)];case 2:return u.sent(),[3,1];case 3:n.body.appendChild(r);try{for(d=0;d<e.length;++d)i[d].offsetParent||(o[e[d]]=!0)}finally{(t=r.parentNode)===null||t===void 0||t.removeChild(r)}return[2,o]}})})}function as(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function of(e,t){for(var n="DOM blockers debug:\n```",r=0,i=Object.keys(e);r<i.length;r++){var o=i[r];n+=`
8
+ `.concat(o,":");for(var s=0,a=e[o];s<a.length;s++){var d=a[s];n+=`
9
+ `.concat(t[d]?"🚫":"➡️"," ").concat(d)}}console.log("".concat(n,"\n```"))}function sf(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}}function af(){if(cs("inverted"))return!0;if(cs("none"))return!1}function cs(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function cf(){if(ls("active"))return!0;if(ls("none"))return!1}function ls(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var lf=100;function uf(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=lf;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function df(){if(zt("no-preference"))return 0;if(zt("high")||zt("more"))return 1;if(zt("low")||zt("less"))return-1;if(zt("forced"))return 10}function zt(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function ff(){if(us("reduce"))return!0;if(us("no-preference"))return!1}function us(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function hf(){if(ds("reduce"))return!0;if(ds("no-preference"))return!1}function ds(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function pf(){if(fs("high"))return!0;if(fs("standard"))return!1}function fs(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var Ie=Math,Ve=function(){return 0};function yf(){var e=Ie.acos||Ve,t=Ie.acosh||Ve,n=Ie.asin||Ve,r=Ie.asinh||Ve,i=Ie.atanh||Ve,o=Ie.atan||Ve,s=Ie.sin||Ve,a=Ie.sinh||Ve,d=Ie.cos||Ve,u=Ie.cosh||Ve,p=Ie.tan||Ve,h=Ie.tanh||Ve,I=Ie.exp||Ve,b=Ie.expm1||Ve,g=Ie.log1p||Ve,w=function(W){return Ie.pow(Ie.PI,W)},B=function(W){return Ie.log(W+Ie.sqrt(W*W-1))},T=function(W){return Ie.log(W+Ie.sqrt(W*W+1))},H=function(W){return Ie.log((1+W)/(1-W))/2},N=function(W){return Ie.exp(W)-1/Ie.exp(W)/2},X=function(W){return(Ie.exp(W)+1/Ie.exp(W))/2},P=function(W){return Ie.exp(W)-1},F=function(W){return(Ie.exp(2*W)-1)/(Ie.exp(2*W)+1)},q=function(W){return Ie.log(1+W)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:B(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:T(1),atanh:i(.5),atanhPf:H(.5),atan:o(.5),sin:s(-1e300),sinh:a(1),sinhPf:N(1),cos:d(10.000000000123),cosh:u(1),coshPf:X(1),tan:p(-1e300),tanh:h(1),tanhPf:F(1),exp:I(1),expm1:b(1),expm1Pf:P(1),log1p:g(10),log1pPf:q(10),powPI:w(-100)}}var gf="mmMwWLliI0fiflO&1",Yr={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function mf(){return _f(function(e,t){for(var n={},r={},i=0,o=Object.keys(Yr);i<o.length;i++){var s=o[i],a=Yr[s],d=a[0],u=d===void 0?{}:d,p=a[1],h=p===void 0?gf:p,I=e.createElement("span");I.textContent=h,I.style.whiteSpace="nowrap";for(var b=0,g=Object.keys(u);b<g.length;b++){var w=g[b],B=u[w];B!==void 0&&(I.style[w]=B)}n[s]=I,t.append(e.createElement("br"),I)}for(var T=0,H=Object.keys(Yr);T<H.length;T++){var s=H[T];r[s]=n[s].getBoundingClientRect().width}return r})}function _f(e,t){return t===void 0&&(t=4e3),os(function(n,r){var i=r.document,o=i.body,s=o.style;s.width="".concat(t,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",fn()?o.style.zoom="".concat(1/r.devicePixelRatio):tt()&&(o.style.zoom="reset");var a=i.createElement("div");return a.textContent=Zo([],Array(t/20<<0),!0).map(function(){return"word"}).join(" "),o.appendChild(a),e(i,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function bf(){return navigator.pdfViewerEnabled}function wf(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function vf(){var e=window.ApplePaySession;if(typeof e?.canMakePayments!="function")return-1;if(Ef())return-3;try{return e.canMakePayments()?1:0}catch(t){return Sf(t)}}var Ef=gd;function Sf(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function Bf(){var e,t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}var hs=-1,ps=-2,If=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),xf=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Lf=["FRAGMENT_SHADER","VERTEX_SHADER"],Af=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],ys="WEBGL_debug_renderer_info",Cf="WEBGL_polygon_mode";function Tf(e){var t,n,r,i,o,s,a=e.cache,d=gs(a);if(!d)return hs;if(!bs(d))return ps;var u=_s()?null:d.getExtension(ys);return{version:((t=d.getParameter(d.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=d.getParameter(d.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:u?(r=d.getParameter(u.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((i=d.getParameter(d.RENDERER))===null||i===void 0?void 0:i.toString())||"",rendererUnmasked:u?(o=d.getParameter(u.UNMASKED_RENDERER_WEBGL))===null||o===void 0?void 0:o.toString():"",shadingLanguageVersion:((s=d.getParameter(d.SHADING_LANGUAGE_VERSION))===null||s===void 0?void 0:s.toString())||""}}function Of(e){var t=e.cache,n=gs(t);if(!n)return hs;if(!bs(n))return ps;var r=n.getSupportedExtensions(),i=n.getContextAttributes(),o=[],s=[],a=[],d=[],u=[];if(i)for(var p=0,h=Object.keys(i);p<h.length;p++){var I=h[p];s.push("".concat(I,"=").concat(i[I]))}for(var b=ms(n),g=0,w=b;g<w.length;g++){var B=w[g],T=n[B];a.push("".concat(B,"=").concat(T).concat(If.has(T)?"=".concat(n.getParameter(T)):""))}if(r)for(var H=0,N=r;H<N.length;H++){var X=N[H];if(!(X===ys&&_s()||X===Cf&&Ff())){var P=n.getExtension(X);if(!P){o.push(X);continue}for(var F=0,q=ms(P);F<q.length;F++){var B=q[F],T=P[B];d.push("".concat(B,"=").concat(T).concat(xf.has(T)?"=".concat(n.getParameter(T)):""))}}}for(var W=0,K=Lf;W<K.length;W++)for(var J=K[W],te=0,ne=Af;te<ne.length;te++){var Y=ne[te],Q=Rf(n,J,Y);u.push("".concat(J,".").concat(Y,"=").concat(Q.join(",")))}return d.sort(),a.sort(),{contextAttributes:s,parameters:a,shaderPrecisions:u,extensions:r,extensionParameters:d,unsupportedExtensions:o}}function gs(e){if(e.webgl)return e.webgl.context;var t=document.createElement("canvas"),n;t.addEventListener("webglCreateContextError",function(){return n=void 0});for(var r=0,i=["webgl","experimental-webgl"];r<i.length;r++){var o=i[r];try{n=t.getContext(o)}catch{}if(n)break}return e.webgl={context:n},n}function Rf(e,t,n){var r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function ms(e){var t=Object.keys(e.__proto__);return t.filter(Pf)}function Pf(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function _s(){return rs()}function Ff(){return fn()||tt()}function bs(e){return typeof e.getParameter=="function"}function kf(){var e=Kr()||tt();if(!e)return-2;if(!window.AudioContext)return-1;var t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function Mf(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}var Hf={fonts:bd,domBlockers:tf,fontPreferences:mf,audio:cd,screenFrame:$d,canvas:vd,osCpu:Od,languages:Rd,colorDepth:Pd,deviceMemory:Fd,screenResolution:kd,hardwareConcurrency:Vd,timezone:jd,sessionStorage:Kd,localStorage:Gd,indexedDB:zd,openDatabase:Zd,cpuClass:Wd,platform:Yd,plugins:wd,touchSupport:Td,vendor:Xd,vendorFlavors:Jd,cookiesEnabled:Qd,colorGamut:sf,invertedColors:af,forcedColors:cf,monochrome:uf,contrast:df,reducedMotion:ff,reducedTransparency:hf,hdr:pf,math:yf,pdfViewerEnabled:bf,architecture:wf,applePay:vf,privateClickMeasurement:Bf,audioBaseLatency:kf,dateTimeLocale:Mf,webGlBasics:Tf,webGlExtensions:Of};function Uf(e){return Qu(Hf,e,[])}var Nf="$ if upgrade to Pro: https://fpjs.dev/pro";function Df(e){var t=$f(e),n=Vf(t);return{score:t,comment:Nf.replace(/\$/g,"".concat(n))}}function $f(e){if(Kr())return .4;if(tt())return qr()&&!(pn()&&hn())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Vf(e){return Qo(.99+.01*e,1e-4)}function jf(e){for(var t="",n=0,r=Object.keys(e).sort();n<r.length;n++){var i=r[n],o=e[i],s="error"in o?"error":JSON.stringify(o.value);t+="".concat(t?"|":"").concat(i.replace(/([:|\\])/g,"\\$1"),":").concat(s)}return t}function ws(e){return JSON.stringify(e,function(t,n){return n instanceof Error?Wu(n):n},2)}function vs(e){return Zu(jf(e))}function qf(e){var t,n=Df(e);return{get visitorId(){return t===void 0&&(t=vs(this.components)),t},set visitorId(r){t=r},confidence:n,components:e,version:Wo}}function Kf(e){return e===void 0&&(e=50),Nu(e,e*2)}function Gf(e,t){var n=Date.now();return{get:function(r){return it(this,void 0,void 0,function(){var i,o,s;return ot(this,function(a){switch(a.label){case 0:return i=Date.now(),[4,e()];case 1:return o=a.sent(),s=qf(o),(t||r?.debug)&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(s.version,`
10
+ userAgent: `).concat(navigator.userAgent,`
11
+ timeBetweenLoadAndGet: `).concat(i-n,`
12
+ visitorId: `).concat(s.visitorId,`
13
+ components: `).concat(ws(o),"\n```")),[2,s]}})})}}}function zf(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(Wo,"/npm-monitoring"),!0),e.send()}catch(t){console.error(t)}}function Zf(e){var t;return e===void 0&&(e={}),it(this,void 0,void 0,function(){var n,r,i;return ot(this,function(o){switch(o.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&zf(),n=e.delayFallback,r=e.debug,[4,Kf(n)];case 1:return o.sent(),i=Uf({cache:{},debug:r}),[2,Gf(i,r)]}})})}var Es={load:Zf,hashComponents:vs,componentsToDebugString:ws};const yn={version:"9.2.0"};let Ss=[];const Wf={[Symbol.for("mapxus/callers-register")]:e=>{Ss=e}};function Yf(){return Ss}const er="-webkit-extension-67d8e3e8-";let tr=null;async function Xf(){let e=sessionStorage.getItem(er);if(!e)try{Bs(),await Is(Date.now()),e=sessionStorage.getItem(er)}catch(t){throw new Error("Failed to fetch public key: "+t)}return e}function Bs(){sessionStorage.removeItem(er),tr&&(clearTimeout(tr),tr=null)}function Jf(e){sessionStorage.setItem(er,e)}async function Is(e){try{const t=await fetch(`${Hu}?timestamp=${e}`,{method:"GET",headers:{"Content-Type":"text/plain"}}),{headers:n}=t,r=parseInt(n.get("x-retry-in"));tr=setTimeout(async()=>{await Is(e)},r*1e3),Jf(await t.text())}catch(t){throw t}}function xs(){return nt.getInstance().getIdentifier()}function Qf(e){nt.getInstance().setTokenGetter(e)}function eh(){return nt.getInstance().setupTokenManager()}var Xr={},gn={},Ls;function th(){if(Ls)return gn;Ls=1,gn.byteLength=a,gn.toByteArray=u,gn.fromByteArray=I;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i<o;++i)e[i]=r[i],t[r.charCodeAt(i)]=i;t[45]=62,t[95]=63;function s(b){var g=b.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var w=b.indexOf("=");w===-1&&(w=g);var B=w===g?0:4-w%4;return[w,B]}function a(b){var g=s(b),w=g[0],B=g[1];return(w+B)*3/4-B}function d(b,g,w){return(g+w)*3/4-w}function u(b){var g,w=s(b),B=w[0],T=w[1],H=new n(d(b,B,T)),N=0,X=T>0?B-4:B,P;for(P=0;P<X;P+=4)g=t[b.charCodeAt(P)]<<18|t[b.charCodeAt(P+1)]<<12|t[b.charCodeAt(P+2)]<<6|t[b.charCodeAt(P+3)],H[N++]=g>>16&255,H[N++]=g>>8&255,H[N++]=g&255;return T===2&&(g=t[b.charCodeAt(P)]<<2|t[b.charCodeAt(P+1)]>>4,H[N++]=g&255),T===1&&(g=t[b.charCodeAt(P)]<<10|t[b.charCodeAt(P+1)]<<4|t[b.charCodeAt(P+2)]>>2,H[N++]=g>>8&255,H[N++]=g&255),H}function p(b){return e[b>>18&63]+e[b>>12&63]+e[b>>6&63]+e[b&63]}function h(b,g,w){for(var B,T=[],H=g;H<w;H+=3)B=(b[H]<<16&16711680)+(b[H+1]<<8&65280)+(b[H+2]&255),T.push(p(B));return T.join("")}function I(b){for(var g,w=b.length,B=w%3,T=[],H=16383,N=0,X=w-B;N<X;N+=H)T.push(h(b,N,N+H>X?X:N+H));return B===1?(g=b[w-1],T.push(e[g>>2]+e[g<<4&63]+"==")):B===2&&(g=(b[w-2]<<8)+b[w-1],T.push(e[g>>10]+e[g>>4&63]+e[g<<2&63]+"=")),T.join("")}return gn}var nr={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var As;function nh(){return As||(As=1,nr.read=function(e,t,n,r,i){var o,s,a=i*8-r-1,d=(1<<a)-1,u=d>>1,p=-7,h=n?i-1:0,I=n?-1:1,b=e[t+h];for(h+=I,o=b&(1<<-p)-1,b>>=-p,p+=a;p>0;o=o*256+e[t+h],h+=I,p-=8);for(s=o&(1<<-p)-1,o>>=-p,p+=r;p>0;s=s*256+e[t+h],h+=I,p-=8);if(o===0)o=1-u;else{if(o===d)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-u}return(b?-1:1)*s*Math.pow(2,o-r)},nr.write=function(e,t,n,r,i,o){var s,a,d,u=o*8-i-1,p=(1<<u)-1,h=p>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=r?0:o-1,g=r?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=p):(s=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-s))<1&&(s--,d*=2),s+h>=1?t+=I/d:t+=I*Math.pow(2,1-h),t*d>=2&&(s++,d/=2),s+h>=p?(a=0,s=p):s+h>=1?(a=(t*d-1)*Math.pow(2,i),s=s+h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[n+b]=a&255,b+=g,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[n+b]=s&255,b+=g,s/=256,u-=8);e[n+b-g]|=w*128}),nr}/*!
14
+ * The buffer module from node.js, for the browser.
15
+ *
16
+ * @author Feross Aboukhadijeh <https://feross.org>
17
+ * @license MIT
18
+ */var Cs;function rh(){return Cs||(Cs=1,(function(e){const t=th(),n=nh(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=H,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=o(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const _=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(_,c),_.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(_){if(_>i)throw new RangeError('The value "'+_+'" is invalid for option "size"');const c=new Uint8Array(_);return Object.setPrototypeOf(c,a.prototype),c}function a(_,c,l){if(typeof _=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(_)}return d(_,c,l)}a.poolSize=8192;function d(_,c,l){if(typeof _=="string")return I(_,c);if(ArrayBuffer.isView(_))return g(_);if(_==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _);if(ye(_,ArrayBuffer)||_&&ye(_.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ye(_,SharedArrayBuffer)||_&&ye(_.buffer,SharedArrayBuffer)))return w(_,c,l);if(typeof _=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const L=_.valueOf&&_.valueOf();if(L!=null&&L!==_)return a.from(L,c,l);const $=B(_);if($)return $;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof _[Symbol.toPrimitive]=="function")return a.from(_[Symbol.toPrimitive]("string"),c,l);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _)}a.from=function(_,c,l){return d(_,c,l)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function u(_){if(typeof _!="number")throw new TypeError('"size" argument must be of type number');if(_<0)throw new RangeError('The value "'+_+'" is invalid for option "size"')}function p(_,c,l){return u(_),_<=0?s(_):c!==void 0?typeof l=="string"?s(_).fill(c,l):s(_).fill(c):s(_)}a.alloc=function(_,c,l){return p(_,c,l)};function h(_){return u(_),s(_<0?0:T(_)|0)}a.allocUnsafe=function(_){return h(_)},a.allocUnsafeSlow=function(_){return h(_)};function I(_,c){if((typeof c!="string"||c==="")&&(c="utf8"),!a.isEncoding(c))throw new TypeError("Unknown encoding: "+c);const l=N(_,c)|0;let L=s(l);const $=L.write(_,c);return $!==l&&(L=L.slice(0,$)),L}function b(_){const c=_.length<0?0:T(_.length)|0,l=s(c);for(let L=0;L<c;L+=1)l[L]=_[L]&255;return l}function g(_){if(ye(_,Uint8Array)){const c=new Uint8Array(_);return w(c.buffer,c.byteOffset,c.byteLength)}return b(_)}function w(_,c,l){if(c<0||_.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(_.byteLength<c+(l||0))throw new RangeError('"length" is outside of buffer bounds');let L;return c===void 0&&l===void 0?L=new Uint8Array(_):l===void 0?L=new Uint8Array(_,c):L=new Uint8Array(_,c,l),Object.setPrototypeOf(L,a.prototype),L}function B(_){if(a.isBuffer(_)){const c=T(_.length)|0,l=s(c);return l.length===0||_.copy(l,0,0,c),l}if(_.length!==void 0)return typeof _.length!="number"||pe(_.length)?s(0):b(_);if(_.type==="Buffer"&&Array.isArray(_.data))return b(_.data)}function T(_){if(_>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return _|0}function H(_){return+_!=_&&(_=0),a.alloc(+_)}a.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==a.prototype},a.compare=function(c,l){if(ye(c,Uint8Array)&&(c=a.from(c,c.offset,c.byteLength)),ye(l,Uint8Array)&&(l=a.from(l,l.offset,l.byteLength)),!a.isBuffer(c)||!a.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===l)return 0;let L=c.length,$=l.length;for(let ee=0,re=Math.min(L,$);ee<re;++ee)if(c[ee]!==l[ee]){L=c[ee],$=l[ee];break}return L<$?-1:$<L?1:0},a.isEncoding=function(c){switch(String(c).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(c,l){if(!Array.isArray(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return a.alloc(0);let L;if(l===void 0)for(l=0,L=0;L<c.length;++L)l+=c[L].length;const $=a.allocUnsafe(l);let ee=0;for(L=0;L<c.length;++L){let re=c[L];if(ye(re,Uint8Array))ee+re.length>$.length?(a.isBuffer(re)||(re=a.from(re)),re.copy($,ee)):Uint8Array.prototype.set.call($,re,ee);else if(a.isBuffer(re))re.copy($,ee);else throw new TypeError('"list" argument must be an Array of Buffers');ee+=re.length}return $};function N(_,c){if(a.isBuffer(_))return _.length;if(ArrayBuffer.isView(_)||ye(_,ArrayBuffer))return _.byteLength;if(typeof _!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof _);const l=_.length,L=arguments.length>2&&arguments[2]===!0;if(!L&&l===0)return 0;let $=!1;for(;;)switch(c){case"ascii":case"latin1":case"binary":return l;case"utf8":case"utf-8":return ue(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l*2;case"hex":return l>>>1;case"base64":return fe(_).length;default:if($)return L?-1:ue(_).length;c=(""+c).toLowerCase(),$=!0}}a.byteLength=N;function X(_,c,l){let L=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((l===void 0||l>this.length)&&(l=this.length),l<=0)||(l>>>=0,c>>>=0,l<=c))return"";for(_||(_="utf8");;)switch(_){case"hex":return C(this,c,l);case"utf8":case"utf-8":return Q(this,c,l);case"ascii":return x(this,c,l);case"latin1":case"binary":return S(this,c,l);case"base64":return Y(this,c,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,c,l);default:if(L)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),L=!0}}a.prototype._isBuffer=!0;function P(_,c,l){const L=_[c];_[c]=_[l],_[l]=L}a.prototype.swap16=function(){const c=this.length;if(c%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let l=0;l<c;l+=2)P(this,l,l+1);return this},a.prototype.swap32=function(){const c=this.length;if(c%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let l=0;l<c;l+=4)P(this,l,l+3),P(this,l+1,l+2);return this},a.prototype.swap64=function(){const c=this.length;if(c%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let l=0;l<c;l+=8)P(this,l,l+7),P(this,l+1,l+6),P(this,l+2,l+5),P(this,l+3,l+4);return this},a.prototype.toString=function(){const c=this.length;return c===0?"":arguments.length===0?Q(this,0,c):X.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(c){if(!a.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:a.compare(this,c)===0},a.prototype.inspect=function(){let c="";const l=e.INSPECT_MAX_BYTES;return c=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(c+=" ... "),"<Buffer "+c+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(c,l,L,$,ee){if(ye(c,Uint8Array)&&(c=a.from(c,c.offset,c.byteLength)),!a.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof c);if(l===void 0&&(l=0),L===void 0&&(L=c?c.length:0),$===void 0&&($=0),ee===void 0&&(ee=this.length),l<0||L>c.length||$<0||ee>this.length)throw new RangeError("out of range index");if($>=ee&&l>=L)return 0;if($>=ee)return-1;if(l>=L)return 1;if(l>>>=0,L>>>=0,$>>>=0,ee>>>=0,this===c)return 0;let re=ee-$,ge=L-l;const be=Math.min(re,ge),me=this.slice($,ee),Se=c.slice(l,L);for(let we=0;we<be;++we)if(me[we]!==Se[we]){re=me[we],ge=Se[we];break}return re<ge?-1:ge<re?1:0};function F(_,c,l,L,$){if(_.length===0)return-1;if(typeof l=="string"?(L=l,l=0):l>2147483647?l=2147483647:l<-2147483648&&(l=-2147483648),l=+l,pe(l)&&(l=$?0:_.length-1),l<0&&(l=_.length+l),l>=_.length){if($)return-1;l=_.length-1}else if(l<0)if($)l=0;else return-1;if(typeof c=="string"&&(c=a.from(c,L)),a.isBuffer(c))return c.length===0?-1:q(_,c,l,L,$);if(typeof c=="number")return c=c&255,typeof Uint8Array.prototype.indexOf=="function"?$?Uint8Array.prototype.indexOf.call(_,c,l):Uint8Array.prototype.lastIndexOf.call(_,c,l):q(_,[c],l,L,$);throw new TypeError("val must be string, number or Buffer")}function q(_,c,l,L,$){let ee=1,re=_.length,ge=c.length;if(L!==void 0&&(L=String(L).toLowerCase(),L==="ucs2"||L==="ucs-2"||L==="utf16le"||L==="utf-16le")){if(_.length<2||c.length<2)return-1;ee=2,re/=2,ge/=2,l/=2}function be(Se,we){return ee===1?Se[we]:Se.readUInt16BE(we*ee)}let me;if($){let Se=-1;for(me=l;me<re;me++)if(be(_,me)===be(c,Se===-1?0:me-Se)){if(Se===-1&&(Se=me),me-Se+1===ge)return Se*ee}else Se!==-1&&(me-=me-Se),Se=-1}else for(l+ge>re&&(l=re-ge),me=l;me>=0;me--){let Se=!0;for(let we=0;we<ge;we++)if(be(_,me+we)!==be(c,we)){Se=!1;break}if(Se)return me}return-1}a.prototype.includes=function(c,l,L){return this.indexOf(c,l,L)!==-1},a.prototype.indexOf=function(c,l,L){return F(this,c,l,L,!0)},a.prototype.lastIndexOf=function(c,l,L){return F(this,c,l,L,!1)};function W(_,c,l,L){l=Number(l)||0;const $=_.length-l;L?(L=Number(L),L>$&&(L=$)):L=$;const ee=c.length;L>ee/2&&(L=ee/2);let re;for(re=0;re<L;++re){const ge=parseInt(c.substr(re*2,2),16);if(pe(ge))return re;_[l+re]=ge}return re}function K(_,c,l,L){return Ee(ue(c,_.length-l),_,l,L)}function J(_,c,l,L){return Ee(de(c),_,l,L)}function te(_,c,l,L){return Ee(fe(c),_,l,L)}function ne(_,c,l,L){return Ee(he(c,_.length-l),_,l,L)}a.prototype.write=function(c,l,L,$){if(l===void 0)$="utf8",L=this.length,l=0;else if(L===void 0&&typeof l=="string")$=l,L=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(L)?(L=L>>>0,$===void 0&&($="utf8")):($=L,L=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ee=this.length-l;if((L===void 0||L>ee)&&(L=ee),c.length>0&&(L<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");let re=!1;for(;;)switch($){case"hex":return W(this,c,l,L);case"utf8":case"utf-8":return K(this,c,l,L);case"ascii":case"latin1":case"binary":return J(this,c,l,L);case"base64":return te(this,c,l,L);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,c,l,L);default:if(re)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),re=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y(_,c,l){return c===0&&l===_.length?t.fromByteArray(_):t.fromByteArray(_.slice(c,l))}function Q(_,c,l){l=Math.min(_.length,l);const L=[];let $=c;for(;$<l;){const ee=_[$];let re=null,ge=ee>239?4:ee>223?3:ee>191?2:1;if($+ge<=l){let be,me,Se,we;switch(ge){case 1:ee<128&&(re=ee);break;case 2:be=_[$+1],(be&192)===128&&(we=(ee&31)<<6|be&63,we>127&&(re=we));break;case 3:be=_[$+1],me=_[$+2],(be&192)===128&&(me&192)===128&&(we=(ee&15)<<12|(be&63)<<6|me&63,we>2047&&(we<55296||we>57343)&&(re=we));break;case 4:be=_[$+1],me=_[$+2],Se=_[$+3],(be&192)===128&&(me&192)===128&&(Se&192)===128&&(we=(ee&15)<<18|(be&63)<<12|(me&63)<<6|Se&63,we>65535&&we<1114112&&(re=we))}}re===null?(re=65533,ge=1):re>65535&&(re-=65536,L.push(re>>>10&1023|55296),re=56320|re&1023),L.push(re),$+=ge}return D(L)}const v=4096;function D(_){const c=_.length;if(c<=v)return String.fromCharCode.apply(String,_);let l="",L=0;for(;L<c;)l+=String.fromCharCode.apply(String,_.slice(L,L+=v));return l}function x(_,c,l){let L="";l=Math.min(_.length,l);for(let $=c;$<l;++$)L+=String.fromCharCode(_[$]&127);return L}function S(_,c,l){let L="";l=Math.min(_.length,l);for(let $=c;$<l;++$)L+=String.fromCharCode(_[$]);return L}function C(_,c,l){const L=_.length;(!c||c<0)&&(c=0),(!l||l<0||l>L)&&(l=L);let $="";for(let ee=c;ee<l;++ee)$+=le[_[ee]];return $}function V(_,c,l){const L=_.slice(c,l);let $="";for(let ee=0;ee<L.length-1;ee+=2)$+=String.fromCharCode(L[ee]+L[ee+1]*256);return $}a.prototype.slice=function(c,l){const L=this.length;c=~~c,l=l===void 0?L:~~l,c<0?(c+=L,c<0&&(c=0)):c>L&&(c=L),l<0?(l+=L,l<0&&(l=0)):l>L&&(l=L),l<c&&(l=c);const $=this.subarray(c,l);return Object.setPrototypeOf($,a.prototype),$};function f(_,c,l){if(_%1!==0||_<0)throw new RangeError("offset is not uint");if(_+c>l)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(c,l,L){c=c>>>0,l=l>>>0,L||f(c,l,this.length);let $=this[c],ee=1,re=0;for(;++re<l&&(ee*=256);)$+=this[c+re]*ee;return $},a.prototype.readUintBE=a.prototype.readUIntBE=function(c,l,L){c=c>>>0,l=l>>>0,L||f(c,l,this.length);let $=this[c+--l],ee=1;for(;l>0&&(ee*=256);)$+=this[c+--l]*ee;return $},a.prototype.readUint8=a.prototype.readUInt8=function(c,l){return c=c>>>0,l||f(c,1,this.length),this[c]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(c,l){return c=c>>>0,l||f(c,2,this.length),this[c]|this[c+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(c,l){return c=c>>>0,l||f(c,2,this.length),this[c]<<8|this[c+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(c,l){return c=c>>>0,l||f(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(c,l){return c=c>>>0,l||f(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},a.prototype.readBigUInt64LE=ae(function(c){c=c>>>0,R(c,"offset");const l=this[c],L=this[c+7];(l===void 0||L===void 0)&&G(c,this.length-8);const $=l+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24,ee=this[++c]+this[++c]*2**8+this[++c]*2**16+L*2**24;return BigInt($)+(BigInt(ee)<<BigInt(32))}),a.prototype.readBigUInt64BE=ae(function(c){c=c>>>0,R(c,"offset");const l=this[c],L=this[c+7];(l===void 0||L===void 0)&&G(c,this.length-8);const $=l*2**24+this[++c]*2**16+this[++c]*2**8+this[++c],ee=this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+L;return(BigInt($)<<BigInt(32))+BigInt(ee)}),a.prototype.readIntLE=function(c,l,L){c=c>>>0,l=l>>>0,L||f(c,l,this.length);let $=this[c],ee=1,re=0;for(;++re<l&&(ee*=256);)$+=this[c+re]*ee;return ee*=128,$>=ee&&($-=Math.pow(2,8*l)),$},a.prototype.readIntBE=function(c,l,L){c=c>>>0,l=l>>>0,L||f(c,l,this.length);let $=l,ee=1,re=this[c+--$];for(;$>0&&(ee*=256);)re+=this[c+--$]*ee;return ee*=128,re>=ee&&(re-=Math.pow(2,8*l)),re},a.prototype.readInt8=function(c,l){return c=c>>>0,l||f(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},a.prototype.readInt16LE=function(c,l){c=c>>>0,l||f(c,2,this.length);const L=this[c]|this[c+1]<<8;return L&32768?L|4294901760:L},a.prototype.readInt16BE=function(c,l){c=c>>>0,l||f(c,2,this.length);const L=this[c+1]|this[c]<<8;return L&32768?L|4294901760:L},a.prototype.readInt32LE=function(c,l){return c=c>>>0,l||f(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},a.prototype.readInt32BE=function(c,l){return c=c>>>0,l||f(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},a.prototype.readBigInt64LE=ae(function(c){c=c>>>0,R(c,"offset");const l=this[c],L=this[c+7];(l===void 0||L===void 0)&&G(c,this.length-8);const $=this[c+4]+this[c+5]*2**8+this[c+6]*2**16+(L<<24);return(BigInt($)<<BigInt(32))+BigInt(l+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24)}),a.prototype.readBigInt64BE=ae(function(c){c=c>>>0,R(c,"offset");const l=this[c],L=this[c+7];(l===void 0||L===void 0)&&G(c,this.length-8);const $=(l<<24)+this[++c]*2**16+this[++c]*2**8+this[++c];return(BigInt($)<<BigInt(32))+BigInt(this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+L)}),a.prototype.readFloatLE=function(c,l){return c=c>>>0,l||f(c,4,this.length),n.read(this,c,!0,23,4)},a.prototype.readFloatBE=function(c,l){return c=c>>>0,l||f(c,4,this.length),n.read(this,c,!1,23,4)},a.prototype.readDoubleLE=function(c,l){return c=c>>>0,l||f(c,8,this.length),n.read(this,c,!0,52,8)},a.prototype.readDoubleBE=function(c,l){return c=c>>>0,l||f(c,8,this.length),n.read(this,c,!1,52,8)};function y(_,c,l,L,$,ee){if(!a.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>$||c<ee)throw new RangeError('"value" argument is out of bounds');if(l+L>_.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(c,l,L,$){if(c=+c,l=l>>>0,L=L>>>0,!$){const ge=Math.pow(2,8*L)-1;y(this,c,l,L,ge,0)}let ee=1,re=0;for(this[l]=c&255;++re<L&&(ee*=256);)this[l+re]=c/ee&255;return l+L},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(c,l,L,$){if(c=+c,l=l>>>0,L=L>>>0,!$){const ge=Math.pow(2,8*L)-1;y(this,c,l,L,ge,0)}let ee=L-1,re=1;for(this[l+ee]=c&255;--ee>=0&&(re*=256);)this[l+ee]=c/re&255;return l+L},a.prototype.writeUint8=a.prototype.writeUInt8=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,1,255,0),this[l]=c&255,l+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,2,65535,0),this[l]=c&255,this[l+1]=c>>>8,l+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,2,65535,0),this[l]=c>>>8,this[l+1]=c&255,l+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,4,4294967295,0),this[l+3]=c>>>24,this[l+2]=c>>>16,this[l+1]=c>>>8,this[l]=c&255,l+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,4,4294967295,0),this[l]=c>>>24,this[l+1]=c>>>16,this[l+2]=c>>>8,this[l+3]=c&255,l+4};function m(_,c,l,L,$){Z(c,L,$,_,l,7);let ee=Number(c&BigInt(4294967295));_[l++]=ee,ee=ee>>8,_[l++]=ee,ee=ee>>8,_[l++]=ee,ee=ee>>8,_[l++]=ee;let re=Number(c>>BigInt(32)&BigInt(4294967295));return _[l++]=re,re=re>>8,_[l++]=re,re=re>>8,_[l++]=re,re=re>>8,_[l++]=re,l}function E(_,c,l,L,$){Z(c,L,$,_,l,7);let ee=Number(c&BigInt(4294967295));_[l+7]=ee,ee=ee>>8,_[l+6]=ee,ee=ee>>8,_[l+5]=ee,ee=ee>>8,_[l+4]=ee;let re=Number(c>>BigInt(32)&BigInt(4294967295));return _[l+3]=re,re=re>>8,_[l+2]=re,re=re>>8,_[l+1]=re,re=re>>8,_[l]=re,l+8}a.prototype.writeBigUInt64LE=ae(function(c,l=0){return m(this,c,l,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ae(function(c,l=0){return E(this,c,l,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(c,l,L,$){if(c=+c,l=l>>>0,!$){const be=Math.pow(2,8*L-1);y(this,c,l,L,be-1,-be)}let ee=0,re=1,ge=0;for(this[l]=c&255;++ee<L&&(re*=256);)c<0&&ge===0&&this[l+ee-1]!==0&&(ge=1),this[l+ee]=(c/re>>0)-ge&255;return l+L},a.prototype.writeIntBE=function(c,l,L,$){if(c=+c,l=l>>>0,!$){const be=Math.pow(2,8*L-1);y(this,c,l,L,be-1,-be)}let ee=L-1,re=1,ge=0;for(this[l+ee]=c&255;--ee>=0&&(re*=256);)c<0&&ge===0&&this[l+ee+1]!==0&&(ge=1),this[l+ee]=(c/re>>0)-ge&255;return l+L},a.prototype.writeInt8=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,1,127,-128),c<0&&(c=255+c+1),this[l]=c&255,l+1},a.prototype.writeInt16LE=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,2,32767,-32768),this[l]=c&255,this[l+1]=c>>>8,l+2},a.prototype.writeInt16BE=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,2,32767,-32768),this[l]=c>>>8,this[l+1]=c&255,l+2},a.prototype.writeInt32LE=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,4,2147483647,-2147483648),this[l]=c&255,this[l+1]=c>>>8,this[l+2]=c>>>16,this[l+3]=c>>>24,l+4},a.prototype.writeInt32BE=function(c,l,L){return c=+c,l=l>>>0,L||y(this,c,l,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[l]=c>>>24,this[l+1]=c>>>16,this[l+2]=c>>>8,this[l+3]=c&255,l+4},a.prototype.writeBigInt64LE=ae(function(c,l=0){return m(this,c,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ae(function(c,l=0){return E(this,c,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function A(_,c,l,L,$,ee){if(l+L>_.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("Index out of range")}function M(_,c,l,L,$){return c=+c,l=l>>>0,$||A(_,c,l,4),n.write(_,c,l,L,23,4),l+4}a.prototype.writeFloatLE=function(c,l,L){return M(this,c,l,!0,L)},a.prototype.writeFloatBE=function(c,l,L){return M(this,c,l,!1,L)};function z(_,c,l,L,$){return c=+c,l=l>>>0,$||A(_,c,l,8),n.write(_,c,l,L,52,8),l+8}a.prototype.writeDoubleLE=function(c,l,L){return z(this,c,l,!0,L)},a.prototype.writeDoubleBE=function(c,l,L){return z(this,c,l,!1,L)},a.prototype.copy=function(c,l,L,$){if(!a.isBuffer(c))throw new TypeError("argument should be a Buffer");if(L||(L=0),!$&&$!==0&&($=this.length),l>=c.length&&(l=c.length),l||(l=0),$>0&&$<L&&($=L),$===L||c.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(L<0||L>=this.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),c.length-l<$-L&&($=c.length-l+L);const ee=$-L;return this===c&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,L,$):Uint8Array.prototype.set.call(c,this.subarray(L,$),l),ee},a.prototype.fill=function(c,l,L,$){if(typeof c=="string"){if(typeof l=="string"?($=l,l=0,L=this.length):typeof L=="string"&&($=L,L=this.length),$!==void 0&&typeof $!="string")throw new TypeError("encoding must be a string");if(typeof $=="string"&&!a.isEncoding($))throw new TypeError("Unknown encoding: "+$);if(c.length===1){const re=c.charCodeAt(0);($==="utf8"&&re<128||$==="latin1")&&(c=re)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(l<0||this.length<l||this.length<L)throw new RangeError("Out of range index");if(L<=l)return this;l=l>>>0,L=L===void 0?this.length:L>>>0,c||(c=0);let ee;if(typeof c=="number")for(ee=l;ee<L;++ee)this[ee]=c;else{const re=a.isBuffer(c)?c:a.from(c,$),ge=re.length;if(ge===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(ee=0;ee<L-l;++ee)this[ee+l]=re[ee%ge]}return this};const O={};function k(_,c,l){O[_]=class extends l{constructor(){super(),Object.defineProperty(this,"message",{value:c.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${_}]`,this.stack,delete this.name}get code(){return _}set code($){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:$,writable:!0})}toString(){return`${this.name} [${_}]: ${this.message}`}}}k("ERR_BUFFER_OUT_OF_BOUNDS",function(_){return _?`${_} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),k("ERR_INVALID_ARG_TYPE",function(_,c){return`The "${_}" argument must be of type number. Received type ${typeof c}`},TypeError),k("ERR_OUT_OF_RANGE",function(_,c,l){let L=`The value of "${_}" is out of range.`,$=l;return Number.isInteger(l)&&Math.abs(l)>2**32?$=U(String(l)):typeof l=="bigint"&&($=String(l),(l>BigInt(2)**BigInt(32)||l<-(BigInt(2)**BigInt(32)))&&($=U($)),$+="n"),L+=` It must be ${c}. Received ${$}`,L},RangeError);function U(_){let c="",l=_.length;const L=_[0]==="-"?1:0;for(;l>=L+4;l-=3)c=`_${_.slice(l-3,l)}${c}`;return`${_.slice(0,l)}${c}`}function j(_,c,l){R(c,"offset"),(_[c]===void 0||_[c+l]===void 0)&&G(c,_.length-(l+1))}function Z(_,c,l,L,$,ee){if(_>l||_<c){const re=typeof c=="bigint"?"n":"";let ge;throw c===0||c===BigInt(0)?ge=`>= 0${re} and < 2${re} ** ${(ee+1)*8}${re}`:ge=`>= -(2${re} ** ${(ee+1)*8-1}${re}) and < 2 ** ${(ee+1)*8-1}${re}`,new O.ERR_OUT_OF_RANGE("value",ge,_)}j(L,$,ee)}function R(_,c){if(typeof _!="number")throw new O.ERR_INVALID_ARG_TYPE(c,"number",_)}function G(_,c,l){throw Math.floor(_)!==_?(R(_,l),new O.ERR_OUT_OF_RANGE("offset","an integer",_)):c<0?new O.ERR_BUFFER_OUT_OF_BOUNDS:new O.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${c}`,_)}const oe=/[^+/0-9A-Za-z-_]/g;function se(_){if(_=_.split("=")[0],_=_.trim().replace(oe,""),_.length<2)return"";for(;_.length%4!==0;)_=_+"=";return _}function ue(_,c){c=c||1/0;let l;const L=_.length;let $=null;const ee=[];for(let re=0;re<L;++re){if(l=_.charCodeAt(re),l>55295&&l<57344){if(!$){if(l>56319){(c-=3)>-1&&ee.push(239,191,189);continue}else if(re+1===L){(c-=3)>-1&&ee.push(239,191,189);continue}$=l;continue}if(l<56320){(c-=3)>-1&&ee.push(239,191,189),$=l;continue}l=($-55296<<10|l-56320)+65536}else $&&(c-=3)>-1&&ee.push(239,191,189);if($=null,l<128){if((c-=1)<0)break;ee.push(l)}else if(l<2048){if((c-=2)<0)break;ee.push(l>>6|192,l&63|128)}else if(l<65536){if((c-=3)<0)break;ee.push(l>>12|224,l>>6&63|128,l&63|128)}else if(l<1114112){if((c-=4)<0)break;ee.push(l>>18|240,l>>12&63|128,l>>6&63|128,l&63|128)}else throw new Error("Invalid code point")}return ee}function de(_){const c=[];for(let l=0;l<_.length;++l)c.push(_.charCodeAt(l)&255);return c}function he(_,c){let l,L,$;const ee=[];for(let re=0;re<_.length&&!((c-=2)<0);++re)l=_.charCodeAt(re),L=l>>8,$=l%256,ee.push($),ee.push(L);return ee}function fe(_){return t.toByteArray(se(_))}function Ee(_,c,l,L){let $;for($=0;$<L&&!($+l>=c.length||$>=_.length);++$)c[$+l]=_[$];return $}function ye(_,c){return _ instanceof c||_!=null&&_.constructor!=null&&_.constructor.name!=null&&_.constructor.name===c.name}function pe(_){return _!==_}const le=(function(){const _="0123456789abcdef",c=new Array(256);for(let l=0;l<16;++l){const L=l*16;for(let $=0;$<16;++$)c[L+$]=_[l]+_[$]}return c})();function ae(_){return typeof BigInt>"u"?ce:_}function ce(){throw new Error("BigInt not supported")}})(Xr)),Xr}var ih=rh(),Jr={},Qr={},Ts;function Xe(){return Ts||(Ts=1,(function(e){/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.wrapCipher=e.Hash=e.nextTick=e.isLE=void 0,e.isBytes=t,e.abool=n,e.anumber=r,e.abytes=i,e.ahash=o,e.aexists=s,e.aoutput=a,e.u8=d,e.u32=u,e.clean=p,e.createView=h,e.bytesToHex=g,e.hexToBytes=T,e.hexToNumber=H,e.bytesToNumberBE=N,e.numberToBytesBE=X,e.utf8ToBytes=F,e.bytesToUtf8=q,e.toBytes=W,e.overlapBytes=K,e.complexOverlapBytes=J,e.concatBytes=te,e.checkOpts=ne,e.equalBytes=Y,e.getOutput=D,e.setBigUint64=x,e.u64Lengths=S,e.isAligned32=C,e.copyBytes=V;function t(f){return f instanceof Uint8Array||ArrayBuffer.isView(f)&&f.constructor.name==="Uint8Array"}function n(f){if(typeof f!="boolean")throw new Error(`boolean expected, not ${f}`)}function r(f){if(!Number.isSafeInteger(f)||f<0)throw new Error("positive integer expected, got "+f)}function i(f,...y){if(!t(f))throw new Error("Uint8Array expected");if(y.length>0&&!y.includes(f.length))throw new Error("Uint8Array expected of length "+y+", got length="+f.length)}function o(f){if(typeof f!="function"||typeof f.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");r(f.outputLen),r(f.blockLen)}function s(f,y=!0){if(f.destroyed)throw new Error("Hash instance has been destroyed");if(y&&f.finished)throw new Error("Hash#digest() has already been called")}function a(f,y){i(f);const m=y.outputLen;if(f.length<m)throw new Error("digestInto() expects output buffer of length at least "+m)}function d(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}function u(f){return new Uint32Array(f.buffer,f.byteOffset,Math.floor(f.byteLength/4))}function p(...f){for(let y=0;y<f.length;y++)f[y].fill(0)}function h(f){return new DataView(f.buffer,f.byteOffset,f.byteLength)}e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const I=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",b=Array.from({length:256},(f,y)=>y.toString(16).padStart(2,"0"));function g(f){if(i(f),I)return f.toHex();let y="";for(let m=0;m<f.length;m++)y+=b[f[m]];return y}const w={_0:48,_9:57,A:65,F:70,a:97,f:102};function B(f){if(f>=w._0&&f<=w._9)return f-w._0;if(f>=w.A&&f<=w.F)return f-(w.A-10);if(f>=w.a&&f<=w.f)return f-(w.a-10)}function T(f){if(typeof f!="string")throw new Error("hex string expected, got "+typeof f);if(I)return Uint8Array.fromHex(f);const y=f.length,m=y/2;if(y%2)throw new Error("hex string expected, got unpadded hex of length "+y);const E=new Uint8Array(m);for(let A=0,M=0;A<m;A++,M+=2){const z=B(f.charCodeAt(M)),O=B(f.charCodeAt(M+1));if(z===void 0||O===void 0){const k=f[M]+f[M+1];throw new Error('hex string expected, got non-hex character "'+k+'" at index '+M)}E[A]=z*16+O}return E}function H(f){if(typeof f!="string")throw new Error("hex string expected, got "+typeof f);return BigInt(f===""?"0":"0x"+f)}function N(f){return H(g(f))}function X(f,y){return T(f.toString(16).padStart(y*2,"0"))}const P=async()=>{};e.nextTick=P;function F(f){if(typeof f!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(f))}function q(f){return new TextDecoder().decode(f)}function W(f){if(typeof f=="string")f=F(f);else if(t(f))f=V(f);else throw new Error("Uint8Array expected, got "+typeof f);return f}function K(f,y){return f.buffer===y.buffer&&f.byteOffset<y.byteOffset+y.byteLength&&y.byteOffset<f.byteOffset+f.byteLength}function J(f,y){if(K(f,y)&&f.byteOffset<y.byteOffset)throw new Error("complex overlap of input and output is not supported")}function te(...f){let y=0;for(let E=0;E<f.length;E++){const A=f[E];i(A),y+=A.length}const m=new Uint8Array(y);for(let E=0,A=0;E<f.length;E++){const M=f[E];m.set(M,A),A+=M.length}return m}function ne(f,y){if(y==null||typeof y!="object")throw new Error("options must be defined");return Object.assign(f,y)}function Y(f,y){if(f.length!==y.length)return!1;let m=0;for(let E=0;E<f.length;E++)m|=f[E]^y[E];return m===0}class Q{}e.Hash=Q;const v=(f,y)=>{function m(E,...A){if(i(E),!e.isLE)throw new Error("Non little-endian hardware is not yet supported");if(f.nonceLength!==void 0){const j=A[0];if(!j)throw new Error("nonce / iv required");f.varSizeNonce?i(j):i(j,f.nonceLength)}const M=f.tagLength;M&&A[1]!==void 0&&i(A[1]);const z=y(E,...A),O=(j,Z)=>{if(Z!==void 0){if(j!==2)throw new Error("cipher output not supported");i(Z)}};let k=!1;return{encrypt(j,Z){if(k)throw new Error("cannot encrypt() twice with same key + nonce");return k=!0,i(j),O(z.encrypt.length,Z),z.encrypt(j,Z)},decrypt(j,Z){if(i(j),M&&j.length<M)throw new Error("invalid ciphertext length: smaller than tagLength="+M);return O(z.decrypt.length,Z),z.decrypt(j,Z)}}}return Object.assign(m,f),m};e.wrapCipher=v;function D(f,y,m=!0){if(y===void 0)return new Uint8Array(f);if(y.length!==f)throw new Error("invalid output length, expected "+f+", got: "+y.length);if(m&&!C(y))throw new Error("invalid output, must be aligned");return y}function x(f,y,m,E){if(typeof f.setBigUint64=="function")return f.setBigUint64(y,m,E);const A=BigInt(32),M=BigInt(4294967295),z=Number(m>>A&M),O=Number(m&M),k=E?4:0,U=E?0:4;f.setUint32(y+k,z,E),f.setUint32(y+U,O,E)}function S(f,y,m){n(m);const E=new Uint8Array(16),A=h(E);return x(A,0,BigInt(y),m),x(A,8,BigInt(f),m),E}function C(f){return f.byteOffset%4===0}function V(f){return Uint8Array.from(f)}})(Qr)),Qr}var ei={},Me={},Os;function ti(){return Os||(Os=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.AEAD_TAG_LENGTH=Me.XCHACHA20_NONCE_LENGTH=Me.CURVE25519_PUBLIC_KEY_SIZE=Me.ETH_PUBLIC_KEY_SIZE=Me.UNCOMPRESSED_PUBLIC_KEY_SIZE=Me.COMPRESSED_PUBLIC_KEY_SIZE=Me.SECRET_KEY_LENGTH=void 0,Me.SECRET_KEY_LENGTH=32,Me.COMPRESSED_PUBLIC_KEY_SIZE=33,Me.UNCOMPRESSED_PUBLIC_KEY_SIZE=65,Me.ETH_PUBLIC_KEY_SIZE=64,Me.CURVE25519_PUBLIC_KEY_SIZE=32,Me.XCHACHA20_NONCE_LENGTH=24,Me.AEAD_TAG_LENGTH=16),Me}var Rs;function rr(){return Rs||(Rs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ephemeralKeySize=e.symmetricNonceLength=e.symmetricAlgorithm=e.isHkdfKeyCompressed=e.isEphemeralKeyCompressed=e.ellipticCurve=e.ECIES_CONFIG=void 0;var t=ti(),n=(function(){function u(){this.ellipticCurve="secp256k1",this.isEphemeralKeyCompressed=!1,this.isHkdfKeyCompressed=!1,this.symmetricAlgorithm="aes-256-gcm",this.symmetricNonceLength=16}return u})();e.ECIES_CONFIG=new n;var r=function(){return e.ECIES_CONFIG.ellipticCurve};e.ellipticCurve=r;var i=function(){return e.ECIES_CONFIG.isEphemeralKeyCompressed};e.isEphemeralKeyCompressed=i;var o=function(){return e.ECIES_CONFIG.isHkdfKeyCompressed};e.isHkdfKeyCompressed=o;var s=function(){return e.ECIES_CONFIG.symmetricAlgorithm};e.symmetricAlgorithm=s;var a=function(){return e.ECIES_CONFIG.symmetricNonceLength};e.symmetricNonceLength=a;var d=function(){var u={secp256k1:e.ECIES_CONFIG.isEphemeralKeyCompressed?t.COMPRESSED_PUBLIC_KEY_SIZE:t.UNCOMPRESSED_PUBLIC_KEY_SIZE,x25519:t.CURVE25519_PUBLIC_KEY_SIZE,ed25519:t.CURVE25519_PUBLIC_KEY_SIZE};if(e.ECIES_CONFIG.ellipticCurve in u)return u[e.ECIES_CONFIG.ellipticCurve];throw new Error("Not implemented")};e.ephemeralKeySize=d})(ei)),ei}var ni={},mn={},Lt={},ri={},ii={},_n={},Ps;function oh(){return Ps||(Ps=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.crypto=void 0,_n.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),_n}var Fs;function ks(){return Fs||(Fs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.gcm=e.ctr=e.cbc=e.utils=void 0,e.randomBytes=r,e.getWebcryptoSubtle=i,e.managedNonce=o;const t=oh(),n=Xe();function r(u=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(u));if(t.crypto&&typeof t.crypto.randomBytes=="function")return Uint8Array.from(t.crypto.randomBytes(u));throw new Error("crypto.getRandomValues must be defined")}function i(){if(t.crypto&&typeof t.crypto.subtle=="object"&&t.crypto.subtle!=null)return t.crypto.subtle;throw new Error("crypto.subtle must be defined")}function o(u){const{nonceLength:p}=u;return(0,n.anumber)(p),((h,...I)=>({encrypt(b,...g){const w=r(p),B=u(h,w,...I).encrypt(b,...g),T=(0,n.concatBytes)(w,B);return B.fill(0),T},decrypt(b,...g){const w=b.subarray(0,p),B=b.subarray(p);return u(h,w,...I).decrypt(B,...g)}}))}e.utils={async encrypt(u,p,h,I){const b=i(),g=await b.importKey("raw",u,p,!0,["encrypt"]),w=await b.encrypt(h,g,I);return new Uint8Array(w)},async decrypt(u,p,h,I){const b=i(),g=await b.importKey("raw",u,p,!0,["decrypt"]),w=await b.decrypt(h,g,I);return new Uint8Array(w)}};const s={CBC:"AES-CBC",CTR:"AES-CTR",GCM:"AES-GCM"};function a(u,p,h){if(u===s.CBC)return{name:s.CBC,iv:p};if(u===s.CTR)return{name:s.CTR,counter:p,length:64};if(u===s.GCM)return h?{name:s.GCM,iv:p,additionalData:h}:{name:s.GCM,iv:p};throw new Error("unknown aes block mode")}function d(u){return(p,h,I)=>{(0,n.abytes)(p),(0,n.abytes)(h);const b={name:u,length:p.length*8},g=a(u,h,I);let w=!1;return{encrypt(B){if((0,n.abytes)(B),w)throw new Error("Cannot encrypt() twice with same key / nonce");return w=!0,e.utils.encrypt(p,b,g,B)},decrypt(B){return(0,n.abytes)(B),e.utils.decrypt(p,b,g,B)}}}}e.cbc=d(s.CBC),e.ctr=d(s.CTR),e.gcm=d(s.GCM)})(ii)),ii}var oi={},Le={},Ue={},si={},bn={},Ms;function sh(){return Ms||(Ms=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.crypto=void 0,bn.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),bn}var Hs;function ut(){return Hs||(Hs=1,(function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=n,e.anumber=r,e.abytes=i,e.ahash=o,e.aexists=s,e.aoutput=a,e.u8=d,e.u32=u,e.clean=p,e.createView=h,e.rotr=I,e.rotl=b,e.byteSwap=g,e.byteSwap32=w,e.bytesToHex=H,e.hexToBytes=P,e.asyncLoop=q,e.utf8ToBytes=W,e.bytesToUtf8=K,e.toBytes=J,e.kdfInputToBytes=te,e.concatBytes=ne,e.checkOpts=Y,e.createHasher=v,e.createOptHasher=D,e.createXOFer=x,e.randomBytes=S;const t=sh();function n(C){return C instanceof Uint8Array||ArrayBuffer.isView(C)&&C.constructor.name==="Uint8Array"}function r(C){if(!Number.isSafeInteger(C)||C<0)throw new Error("positive integer expected, got "+C)}function i(C,...V){if(!n(C))throw new Error("Uint8Array expected");if(V.length>0&&!V.includes(C.length))throw new Error("Uint8Array expected of length "+V+", got length="+C.length)}function o(C){if(typeof C!="function"||typeof C.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");r(C.outputLen),r(C.blockLen)}function s(C,V=!0){if(C.destroyed)throw new Error("Hash instance has been destroyed");if(V&&C.finished)throw new Error("Hash#digest() has already been called")}function a(C,V){i(C);const f=V.outputLen;if(C.length<f)throw new Error("digestInto() expects output buffer of length at least "+f)}function d(C){return new Uint8Array(C.buffer,C.byteOffset,C.byteLength)}function u(C){return new Uint32Array(C.buffer,C.byteOffset,Math.floor(C.byteLength/4))}function p(...C){for(let V=0;V<C.length;V++)C[V].fill(0)}function h(C){return new DataView(C.buffer,C.byteOffset,C.byteLength)}function I(C,V){return C<<32-V|C>>>V}function b(C,V){return C<<V|C>>>32-V>>>0}e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function g(C){return C<<24&4278190080|C<<8&16711680|C>>>8&65280|C>>>24&255}e.swap8IfBE=e.isLE?C=>C:C=>g(C),e.byteSwapIfBE=e.swap8IfBE;function w(C){for(let V=0;V<C.length;V++)C[V]=g(C[V]);return C}e.swap32IfBE=e.isLE?C=>C:w;const B=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",T=Array.from({length:256},(C,V)=>V.toString(16).padStart(2,"0"));function H(C){if(i(C),B)return C.toHex();let V="";for(let f=0;f<C.length;f++)V+=T[C[f]];return V}const N={_0:48,_9:57,A:65,F:70,a:97,f:102};function X(C){if(C>=N._0&&C<=N._9)return C-N._0;if(C>=N.A&&C<=N.F)return C-(N.A-10);if(C>=N.a&&C<=N.f)return C-(N.a-10)}function P(C){if(typeof C!="string")throw new Error("hex string expected, got "+typeof C);if(B)return Uint8Array.fromHex(C);const V=C.length,f=V/2;if(V%2)throw new Error("hex string expected, got unpadded hex of length "+V);const y=new Uint8Array(f);for(let m=0,E=0;m<f;m++,E+=2){const A=X(C.charCodeAt(E)),M=X(C.charCodeAt(E+1));if(A===void 0||M===void 0){const z=C[E]+C[E+1];throw new Error('hex string expected, got non-hex character "'+z+'" at index '+E)}y[m]=A*16+M}return y}const F=async()=>{};e.nextTick=F;async function q(C,V,f){let y=Date.now();for(let m=0;m<C;m++){f(m);const E=Date.now()-y;E>=0&&E<V||(await(0,e.nextTick)(),y+=E)}}function W(C){if(typeof C!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(C))}function K(C){return new TextDecoder().decode(C)}function J(C){return typeof C=="string"&&(C=W(C)),i(C),C}function te(C){return typeof C=="string"&&(C=W(C)),i(C),C}function ne(...C){let V=0;for(let y=0;y<C.length;y++){const m=C[y];i(m),V+=m.length}const f=new Uint8Array(V);for(let y=0,m=0;y<C.length;y++){const E=C[y];f.set(E,m),m+=E.length}return f}function Y(C,V){if(V!==void 0&&{}.toString.call(V)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(C,V)}class Q{}e.Hash=Q;function v(C){const V=y=>C().update(J(y)).digest(),f=C();return V.outputLen=f.outputLen,V.blockLen=f.blockLen,V.create=()=>C(),V}function D(C){const V=(y,m)=>C(m).update(J(y)).digest(),f=C({});return V.outputLen=f.outputLen,V.blockLen=f.blockLen,V.create=y=>C(y),V}function x(C){const V=(y,m)=>C(m).update(J(y)).digest(),f=C({});return V.outputLen=f.outputLen,V.blockLen=f.blockLen,V.create=y=>C(y),V}e.wrapConstructor=v,e.wrapConstructorWithOpts=D,e.wrapXOFConstructorWithOpts=x;function S(C=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(C));if(t.crypto&&typeof t.crypto.randomBytes=="function")return Uint8Array.from(t.crypto.randomBytes(C));throw new Error("crypto.getRandomValues must be defined")}})(si)),si}var Us;function ah(){if(Us)return Ue;Us=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.SHA512_IV=Ue.SHA384_IV=Ue.SHA224_IV=Ue.SHA256_IV=Ue.HashMD=void 0,Ue.setBigUint64=t,Ue.Chi=n,Ue.Maj=r;const e=ut();function t(o,s,a,d){if(typeof o.setBigUint64=="function")return o.setBigUint64(s,a,d);const u=BigInt(32),p=BigInt(4294967295),h=Number(a>>u&p),I=Number(a&p),b=d?4:0,g=d?0:4;o.setUint32(s+b,h,d),o.setUint32(s+g,I,d)}function n(o,s,a){return o&s^~o&a}function r(o,s,a){return o&s^o&a^s&a}class i extends e.Hash{constructor(s,a,d,u){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=s,this.outputLen=a,this.padOffset=d,this.isLE=u,this.buffer=new Uint8Array(s),this.view=(0,e.createView)(this.buffer)}update(s){(0,e.aexists)(this),s=(0,e.toBytes)(s),(0,e.abytes)(s);const{view:a,buffer:d,blockLen:u}=this,p=s.length;for(let h=0;h<p;){const I=Math.min(u-this.pos,p-h);if(I===u){const b=(0,e.createView)(s);for(;u<=p-h;h+=u)this.process(b,h);continue}d.set(s.subarray(h,h+I),this.pos),this.pos+=I,h+=I,this.pos===u&&(this.process(a,0),this.pos=0)}return this.length+=s.length,this.roundClean(),this}digestInto(s){(0,e.aexists)(this),(0,e.aoutput)(s,this),this.finished=!0;const{buffer:a,view:d,blockLen:u,isLE:p}=this;let{pos:h}=this;a[h++]=128,(0,e.clean)(this.buffer.subarray(h)),this.padOffset>u-h&&(this.process(d,0),h=0);for(let B=h;B<u;B++)a[B]=0;t(d,u-8,BigInt(this.length*8),p),this.process(d,0);const I=(0,e.createView)(s),b=this.outputLen;if(b%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const g=b/4,w=this.get();if(g>w.length)throw new Error("_sha2: outputLen bigger than state");for(let B=0;B<g;B++)I.setUint32(4*B,w[B],p)}digest(){const{buffer:s,outputLen:a}=this;this.digestInto(s);const d=s.slice(0,a);return this.destroy(),d}_cloneInto(s){s||(s=new this.constructor),s.set(...this.get());const{blockLen:a,buffer:d,length:u,finished:p,destroyed:h,pos:I}=this;return s.destroyed=h,s.finished=p,s.length=u,s.pos=I,u%a&&s.buffer.set(d),s}clone(){return this._cloneInto()}}return Ue.HashMD=i,Ue.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ue.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Ue.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Ue.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Ue}var ve={},Ns;function ch(){if(Ns)return ve;Ns=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.toBig=ve.shrSL=ve.shrSH=ve.rotrSL=ve.rotrSH=ve.rotrBL=ve.rotrBH=ve.rotr32L=ve.rotr32H=ve.rotlSL=ve.rotlSH=ve.rotlBL=ve.rotlBH=ve.add5L=ve.add5H=ve.add4L=ve.add4H=ve.add3L=ve.add3H=void 0,ve.add=T,ve.fromBig=n,ve.split=r;const e=BigInt(2**32-1),t=BigInt(32);function n(K,J=!1){return J?{h:Number(K&e),l:Number(K>>t&e)}:{h:Number(K>>t&e)|0,l:Number(K&e)|0}}function r(K,J=!1){const te=K.length;let ne=new Uint32Array(te),Y=new Uint32Array(te);for(let Q=0;Q<te;Q++){const{h:v,l:D}=n(K[Q],J);[ne[Q],Y[Q]]=[v,D]}return[ne,Y]}const i=(K,J)=>BigInt(K>>>0)<<t|BigInt(J>>>0);ve.toBig=i;const o=(K,J,te)=>K>>>te;ve.shrSH=o;const s=(K,J,te)=>K<<32-te|J>>>te;ve.shrSL=s;const a=(K,J,te)=>K>>>te|J<<32-te;ve.rotrSH=a;const d=(K,J,te)=>K<<32-te|J>>>te;ve.rotrSL=d;const u=(K,J,te)=>K<<64-te|J>>>te-32;ve.rotrBH=u;const p=(K,J,te)=>K>>>te-32|J<<64-te;ve.rotrBL=p;const h=(K,J)=>J;ve.rotr32H=h;const I=(K,J)=>K;ve.rotr32L=I;const b=(K,J,te)=>K<<te|J>>>32-te;ve.rotlSH=b;const g=(K,J,te)=>J<<te|K>>>32-te;ve.rotlSL=g;const w=(K,J,te)=>J<<te-32|K>>>64-te;ve.rotlBH=w;const B=(K,J,te)=>K<<te-32|J>>>64-te;ve.rotlBL=B;function T(K,J,te,ne){const Y=(J>>>0)+(ne>>>0);return{h:K+te+(Y/2**32|0)|0,l:Y|0}}const H=(K,J,te)=>(K>>>0)+(J>>>0)+(te>>>0);ve.add3L=H;const N=(K,J,te,ne)=>J+te+ne+(K/2**32|0)|0;ve.add3H=N;const X=(K,J,te,ne)=>(K>>>0)+(J>>>0)+(te>>>0)+(ne>>>0);ve.add4L=X;const P=(K,J,te,ne,Y)=>J+te+ne+Y+(K/2**32|0)|0;ve.add4H=P;const F=(K,J,te,ne,Y)=>(K>>>0)+(J>>>0)+(te>>>0)+(ne>>>0)+(Y>>>0);ve.add5L=F;const q=(K,J,te,ne,Y,Q)=>J+te+ne+Y+Q+(K/2**32|0)|0;ve.add5H=q;const W={fromBig:n,split:r,toBig:i,shrSH:o,shrSL:s,rotrSH:a,rotrSL:d,rotrBH:u,rotrBL:p,rotr32H:h,rotr32L:I,rotlSH:b,rotlSL:g,rotlBH:w,rotlBL:B,add:T,add3L:H,add3H:N,add4L:X,add4H:P,add5H:q,add5L:F};return ve.default=W,ve}var Ds;function ai(){if(Ds)return Le;Ds=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.sha512_224=Le.sha512_256=Le.sha384=Le.sha512=Le.sha224=Le.sha256=Le.SHA512_256=Le.SHA512_224=Le.SHA384=Le.SHA512=Le.SHA224=Le.SHA256=void 0;const e=ah(),t=ch(),n=ut(),r=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),i=new Uint32Array(64);class o extends e.HashMD{constructor(N=32){super(64,N,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:N,B:X,C:P,D:F,E:q,F:W,G:K,H:J}=this;return[N,X,P,F,q,W,K,J]}set(N,X,P,F,q,W,K,J){this.A=N|0,this.B=X|0,this.C=P|0,this.D=F|0,this.E=q|0,this.F=W|0,this.G=K|0,this.H=J|0}process(N,X){for(let Y=0;Y<16;Y++,X+=4)i[Y]=N.getUint32(X,!1);for(let Y=16;Y<64;Y++){const Q=i[Y-15],v=i[Y-2],D=(0,n.rotr)(Q,7)^(0,n.rotr)(Q,18)^Q>>>3,x=(0,n.rotr)(v,17)^(0,n.rotr)(v,19)^v>>>10;i[Y]=x+i[Y-7]+D+i[Y-16]|0}let{A:P,B:F,C:q,D:W,E:K,F:J,G:te,H:ne}=this;for(let Y=0;Y<64;Y++){const Q=(0,n.rotr)(K,6)^(0,n.rotr)(K,11)^(0,n.rotr)(K,25),v=ne+Q+(0,e.Chi)(K,J,te)+r[Y]+i[Y]|0,x=((0,n.rotr)(P,2)^(0,n.rotr)(P,13)^(0,n.rotr)(P,22))+(0,e.Maj)(P,F,q)|0;ne=te,te=J,J=K,K=W+v|0,W=q,q=F,F=P,P=v+x|0}P=P+this.A|0,F=F+this.B|0,q=q+this.C|0,W=W+this.D|0,K=K+this.E|0,J=J+this.F|0,te=te+this.G|0,ne=ne+this.H|0,this.set(P,F,q,W,K,J,te,ne)}roundClean(){(0,n.clean)(i)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,n.clean)(this.buffer)}}Le.SHA256=o;class s extends o{constructor(){super(28),this.A=e.SHA224_IV[0]|0,this.B=e.SHA224_IV[1]|0,this.C=e.SHA224_IV[2]|0,this.D=e.SHA224_IV[3]|0,this.E=e.SHA224_IV[4]|0,this.F=e.SHA224_IV[5]|0,this.G=e.SHA224_IV[6]|0,this.H=e.SHA224_IV[7]|0}}Le.SHA224=s;const a=t.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(H=>BigInt(H))),d=a[0],u=a[1],p=new Uint32Array(80),h=new Uint32Array(80);class I extends e.HashMD{constructor(N=64){super(128,N,16,!1),this.Ah=e.SHA512_IV[0]|0,this.Al=e.SHA512_IV[1]|0,this.Bh=e.SHA512_IV[2]|0,this.Bl=e.SHA512_IV[3]|0,this.Ch=e.SHA512_IV[4]|0,this.Cl=e.SHA512_IV[5]|0,this.Dh=e.SHA512_IV[6]|0,this.Dl=e.SHA512_IV[7]|0,this.Eh=e.SHA512_IV[8]|0,this.El=e.SHA512_IV[9]|0,this.Fh=e.SHA512_IV[10]|0,this.Fl=e.SHA512_IV[11]|0,this.Gh=e.SHA512_IV[12]|0,this.Gl=e.SHA512_IV[13]|0,this.Hh=e.SHA512_IV[14]|0,this.Hl=e.SHA512_IV[15]|0}get(){const{Ah:N,Al:X,Bh:P,Bl:F,Ch:q,Cl:W,Dh:K,Dl:J,Eh:te,El:ne,Fh:Y,Fl:Q,Gh:v,Gl:D,Hh:x,Hl:S}=this;return[N,X,P,F,q,W,K,J,te,ne,Y,Q,v,D,x,S]}set(N,X,P,F,q,W,K,J,te,ne,Y,Q,v,D,x,S){this.Ah=N|0,this.Al=X|0,this.Bh=P|0,this.Bl=F|0,this.Ch=q|0,this.Cl=W|0,this.Dh=K|0,this.Dl=J|0,this.Eh=te|0,this.El=ne|0,this.Fh=Y|0,this.Fl=Q|0,this.Gh=v|0,this.Gl=D|0,this.Hh=x|0,this.Hl=S|0}process(N,X){for(let f=0;f<16;f++,X+=4)p[f]=N.getUint32(X),h[f]=N.getUint32(X+=4);for(let f=16;f<80;f++){const y=p[f-15]|0,m=h[f-15]|0,E=t.rotrSH(y,m,1)^t.rotrSH(y,m,8)^t.shrSH(y,m,7),A=t.rotrSL(y,m,1)^t.rotrSL(y,m,8)^t.shrSL(y,m,7),M=p[f-2]|0,z=h[f-2]|0,O=t.rotrSH(M,z,19)^t.rotrBH(M,z,61)^t.shrSH(M,z,6),k=t.rotrSL(M,z,19)^t.rotrBL(M,z,61)^t.shrSL(M,z,6),U=t.add4L(A,k,h[f-7],h[f-16]),j=t.add4H(U,E,O,p[f-7],p[f-16]);p[f]=j|0,h[f]=U|0}let{Ah:P,Al:F,Bh:q,Bl:W,Ch:K,Cl:J,Dh:te,Dl:ne,Eh:Y,El:Q,Fh:v,Fl:D,Gh:x,Gl:S,Hh:C,Hl:V}=this;for(let f=0;f<80;f++){const y=t.rotrSH(Y,Q,14)^t.rotrSH(Y,Q,18)^t.rotrBH(Y,Q,41),m=t.rotrSL(Y,Q,14)^t.rotrSL(Y,Q,18)^t.rotrBL(Y,Q,41),E=Y&v^~Y&x,A=Q&D^~Q&S,M=t.add5L(V,m,A,u[f],h[f]),z=t.add5H(M,C,y,E,d[f],p[f]),O=M|0,k=t.rotrSH(P,F,28)^t.rotrBH(P,F,34)^t.rotrBH(P,F,39),U=t.rotrSL(P,F,28)^t.rotrBL(P,F,34)^t.rotrBL(P,F,39),j=P&q^P&K^q&K,Z=F&W^F&J^W&J;C=x|0,V=S|0,x=v|0,S=D|0,v=Y|0,D=Q|0,{h:Y,l:Q}=t.add(te|0,ne|0,z|0,O|0),te=K|0,ne=J|0,K=q|0,J=W|0,q=P|0,W=F|0;const R=t.add3L(O,U,Z);P=t.add3H(R,z,k,j),F=R|0}({h:P,l:F}=t.add(this.Ah|0,this.Al|0,P|0,F|0)),{h:q,l:W}=t.add(this.Bh|0,this.Bl|0,q|0,W|0),{h:K,l:J}=t.add(this.Ch|0,this.Cl|0,K|0,J|0),{h:te,l:ne}=t.add(this.Dh|0,this.Dl|0,te|0,ne|0),{h:Y,l:Q}=t.add(this.Eh|0,this.El|0,Y|0,Q|0),{h:v,l:D}=t.add(this.Fh|0,this.Fl|0,v|0,D|0),{h:x,l:S}=t.add(this.Gh|0,this.Gl|0,x|0,S|0),{h:C,l:V}=t.add(this.Hh|0,this.Hl|0,C|0,V|0),this.set(P,F,q,W,K,J,te,ne,Y,Q,v,D,x,S,C,V)}roundClean(){(0,n.clean)(p,h)}destroy(){(0,n.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Le.SHA512=I;class b extends I{constructor(){super(48),this.Ah=e.SHA384_IV[0]|0,this.Al=e.SHA384_IV[1]|0,this.Bh=e.SHA384_IV[2]|0,this.Bl=e.SHA384_IV[3]|0,this.Ch=e.SHA384_IV[4]|0,this.Cl=e.SHA384_IV[5]|0,this.Dh=e.SHA384_IV[6]|0,this.Dl=e.SHA384_IV[7]|0,this.Eh=e.SHA384_IV[8]|0,this.El=e.SHA384_IV[9]|0,this.Fh=e.SHA384_IV[10]|0,this.Fl=e.SHA384_IV[11]|0,this.Gh=e.SHA384_IV[12]|0,this.Gl=e.SHA384_IV[13]|0,this.Hh=e.SHA384_IV[14]|0,this.Hl=e.SHA384_IV[15]|0}}Le.SHA384=b;const g=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),w=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class B extends I{constructor(){super(28),this.Ah=g[0]|0,this.Al=g[1]|0,this.Bh=g[2]|0,this.Bl=g[3]|0,this.Ch=g[4]|0,this.Cl=g[5]|0,this.Dh=g[6]|0,this.Dl=g[7]|0,this.Eh=g[8]|0,this.El=g[9]|0,this.Fh=g[10]|0,this.Fl=g[11]|0,this.Gh=g[12]|0,this.Gl=g[13]|0,this.Hh=g[14]|0,this.Hl=g[15]|0}}Le.SHA512_224=B;class T extends I{constructor(){super(32),this.Ah=w[0]|0,this.Al=w[1]|0,this.Bh=w[2]|0,this.Bl=w[3]|0,this.Ch=w[4]|0,this.Cl=w[5]|0,this.Dh=w[6]|0,this.Dl=w[7]|0,this.Eh=w[8]|0,this.El=w[9]|0,this.Fh=w[10]|0,this.Fl=w[11]|0,this.Gh=w[12]|0,this.Gl=w[13]|0,this.Hh=w[14]|0,this.Hl=w[15]|0}}return Le.SHA512_256=T,Le.sha256=(0,n.createHasher)(()=>new o),Le.sha224=(0,n.createHasher)(()=>new s),Le.sha512=(0,n.createHasher)(()=>new I),Le.sha384=(0,n.createHasher)(()=>new b),Le.sha512_256=(0,n.createHasher)(()=>new T),Le.sha512_224=(0,n.createHasher)(()=>new B),Le}var Je={},ci={},$s;function _t(){return $s||($s=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.notImplemented=e.bitMask=e.utf8ToBytes=e.randomBytes=e.isBytes=e.hexToBytes=e.concatBytes=e.bytesToUtf8=e.bytesToHex=e.anumber=e.abytes=void 0,e.abool=o,e._abool2=s,e._abytes2=a,e.numberToHexUnpadded=d,e.hexToNumber=u,e.bytesToNumberBE=p,e.bytesToNumberLE=h,e.numberToBytesBE=I,e.numberToBytesLE=b,e.numberToVarBytesBE=g,e.ensureBytes=w,e.equalBytes=B,e.copyBytes=T,e.asciiToBytes=H,e.inRange=X,e.aInRange=P,e.bitLen=F,e.bitGet=q,e.bitSet=W,e.createHmacDrbg=J,e.validateObject=ne,e.isHash=Y,e._validateObject=Q,e.memoized=D;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=ut();var n=ut();Object.defineProperty(e,"abytes",{enumerable:!0,get:function(){return n.abytes}}),Object.defineProperty(e,"anumber",{enumerable:!0,get:function(){return n.anumber}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return n.bytesToHex}}),Object.defineProperty(e,"bytesToUtf8",{enumerable:!0,get:function(){return n.bytesToUtf8}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return n.concatBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return n.hexToBytes}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return n.isBytes}}),Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return n.randomBytes}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return n.utf8ToBytes}});const r=BigInt(0),i=BigInt(1);function o(x,S){if(typeof S!="boolean")throw new Error(x+" boolean expected, got "+S)}function s(x,S=""){if(typeof x!="boolean"){const C=S&&`"${S}"`;throw new Error(C+"expected boolean, got type="+typeof x)}return x}function a(x,S,C=""){const V=(0,t.isBytes)(x),f=x?.length,y=S!==void 0;if(!V||y&&f!==S){const m=C&&`"${C}" `,E=y?` of length ${S}`:"",A=V?`length=${f}`:`type=${typeof x}`;throw new Error(m+"expected Uint8Array"+E+", got "+A)}return x}function d(x){const S=x.toString(16);return S.length&1?"0"+S:S}function u(x){if(typeof x!="string")throw new Error("hex string expected, got "+typeof x);return x===""?r:BigInt("0x"+x)}function p(x){return u((0,t.bytesToHex)(x))}function h(x){return(0,t.abytes)(x),u((0,t.bytesToHex)(Uint8Array.from(x).reverse()))}function I(x,S){return(0,t.hexToBytes)(x.toString(16).padStart(S*2,"0"))}function b(x,S){return I(x,S).reverse()}function g(x){return(0,t.hexToBytes)(d(x))}function w(x,S,C){let V;if(typeof S=="string")try{V=(0,t.hexToBytes)(S)}catch(y){throw new Error(x+" must be hex string or Uint8Array, cause: "+y)}else if((0,t.isBytes)(S))V=Uint8Array.from(S);else throw new Error(x+" must be hex string or Uint8Array");const f=V.length;if(typeof C=="number"&&f!==C)throw new Error(x+" of length "+C+" expected, got "+f);return V}function B(x,S){if(x.length!==S.length)return!1;let C=0;for(let V=0;V<x.length;V++)C|=x[V]^S[V];return C===0}function T(x){return Uint8Array.from(x)}function H(x){return Uint8Array.from(x,(S,C)=>{const V=S.charCodeAt(0);if(S.length!==1||V>127)throw new Error(`string contains non-ASCII character "${x[C]}" with code ${V} at position ${C}`);return V})}const N=x=>typeof x=="bigint"&&r<=x;function X(x,S,C){return N(x)&&N(S)&&N(C)&&S<=x&&x<C}function P(x,S,C,V){if(!X(S,C,V))throw new Error("expected valid "+x+": "+C+" <= n < "+V+", got "+S)}function F(x){let S;for(S=0;x>r;x>>=i,S+=1);return S}function q(x,S){return x>>BigInt(S)&i}function W(x,S,C){return x|(C?i:r)<<BigInt(S)}const K=x=>(i<<BigInt(x))-i;e.bitMask=K;function J(x,S,C){if(typeof x!="number"||x<2)throw new Error("hashLen must be a number");if(typeof S!="number"||S<2)throw new Error("qByteLen must be a number");if(typeof C!="function")throw new Error("hmacFn must be a function");const V=U=>new Uint8Array(U),f=U=>Uint8Array.of(U);let y=V(x),m=V(x),E=0;const A=()=>{y.fill(1),m.fill(0),E=0},M=(...U)=>C(m,y,...U),z=(U=V(0))=>{m=M(f(0),U),y=M(),U.length!==0&&(m=M(f(1),U),y=M())},O=()=>{if(E++>=1e3)throw new Error("drbg: tried 1000 values");let U=0;const j=[];for(;U<S;){y=M();const Z=y.slice();j.push(Z),U+=y.length}return(0,t.concatBytes)(...j)};return(U,j)=>{A(),z(U);let Z;for(;!(Z=j(O()));)z();return A(),Z}}const te={bigint:x=>typeof x=="bigint",function:x=>typeof x=="function",boolean:x=>typeof x=="boolean",string:x=>typeof x=="string",stringOrUint8Array:x=>typeof x=="string"||(0,t.isBytes)(x),isSafeInteger:x=>Number.isSafeInteger(x),array:x=>Array.isArray(x),field:(x,S)=>S.Fp.isValid(x),hash:x=>typeof x=="function"&&Number.isSafeInteger(x.outputLen)};function ne(x,S,C={}){const V=(f,y,m)=>{const E=te[y];if(typeof E!="function")throw new Error("invalid validator function");const A=x[f];if(!(m&&A===void 0)&&!E(A,x))throw new Error("param "+String(f)+" is invalid. Expected "+y+", got "+A)};for(const[f,y]of Object.entries(S))V(f,y,!1);for(const[f,y]of Object.entries(C))V(f,y,!0);return x}function Y(x){return typeof x=="function"&&Number.isSafeInteger(x.outputLen)}function Q(x,S,C={}){if(!x||typeof x!="object")throw new Error("expected valid options object");function V(f,y,m){const E=x[f];if(m&&E===void 0)return;const A=typeof E;if(A!==y||E===null)throw new Error(`param "${f}" is invalid: expected ${y}, got ${A}`)}Object.entries(S).forEach(([f,y])=>V(f,y,!1)),Object.entries(C).forEach(([f,y])=>V(f,y,!0))}const v=()=>{throw new Error("not implemented")};e.notImplemented=v;function D(x){const S=new WeakMap;return(C,...V)=>{const f=S.get(C);if(f!==void 0)return f;const y=x(C,...V);return S.set(C,y),y}}})(ci)),ci}var Ce={},Vs;function At(){if(Vs)return Ce;Vs=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.isNegativeLE=void 0,Ce.mod=h,Ce.pow=I,Ce.pow2=b,Ce.invert=g,Ce.tonelliShanks=N,Ce.FpSqrt=X,Ce.validateField=q,Ce.FpPow=W,Ce.FpInvertBatch=K,Ce.FpDiv=J,Ce.FpLegendre=te,Ce.FpIsSquare=ne,Ce.nLength=Y,Ce.Field=Q,Ce.FpSqrtOdd=v,Ce.FpSqrtEven=D,Ce.hashToPrivateScalar=x,Ce.getFieldBytesLength=S,Ce.getMinHashLength=C,Ce.mapHashToField=V;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=_t(),t=BigInt(0),n=BigInt(1),r=BigInt(2),i=BigInt(3),o=BigInt(4),s=BigInt(5),a=BigInt(7),d=BigInt(8),u=BigInt(9),p=BigInt(16);function h(f,y){const m=f%y;return m>=t?m:y+m}function I(f,y,m){return W(Q(m),f,y)}function b(f,y,m){let E=f;for(;y-- >t;)E*=E,E%=m;return E}function g(f,y){if(f===t)throw new Error("invert: expected non-zero number");if(y<=t)throw new Error("invert: expected positive modulus, got "+y);let m=h(f,y),E=y,A=t,M=n;for(;m!==t;){const O=E/m,k=E%m,U=A-M*O;E=m,m=k,A=M,M=U}if(E!==n)throw new Error("invert: does not exist");return h(A,y)}function w(f,y,m){if(!f.eql(f.sqr(y),m))throw new Error("Cannot find square root")}function B(f,y){const m=(f.ORDER+n)/o,E=f.pow(y,m);return w(f,E,y),E}function T(f,y){const m=(f.ORDER-s)/d,E=f.mul(y,r),A=f.pow(E,m),M=f.mul(y,A),z=f.mul(f.mul(M,r),A),O=f.mul(M,f.sub(z,f.ONE));return w(f,O,y),O}function H(f){const y=Q(f),m=N(f),E=m(y,y.neg(y.ONE)),A=m(y,E),M=m(y,y.neg(E)),z=(f+a)/p;return(O,k)=>{let U=O.pow(k,z),j=O.mul(U,E);const Z=O.mul(U,A),R=O.mul(U,M),G=O.eql(O.sqr(j),k),oe=O.eql(O.sqr(Z),k);U=O.cmov(U,j,G),j=O.cmov(R,Z,oe);const se=O.eql(O.sqr(j),k),ue=O.cmov(U,j,se);return w(O,ue,k),ue}}function N(f){if(f<i)throw new Error("sqrt is not defined for small field");let y=f-n,m=0;for(;y%r===t;)y/=r,m++;let E=r;const A=Q(f);for(;te(A,E)===1;)if(E++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(m===1)return B;let M=A.pow(E,y);const z=(y+n)/r;return function(k,U){if(k.is0(U))return U;if(te(k,U)!==1)throw new Error("Cannot find square root");let j=m,Z=k.mul(k.ONE,M),R=k.pow(U,y),G=k.pow(U,z);for(;!k.eql(R,k.ONE);){if(k.is0(R))return k.ZERO;let oe=1,se=k.sqr(R);for(;!k.eql(se,k.ONE);)if(oe++,se=k.sqr(se),oe===j)throw new Error("Cannot find square root");const ue=n<<BigInt(j-oe-1),de=k.pow(Z,ue);j=oe,Z=k.sqr(de),R=k.mul(R,Z),G=k.mul(G,de)}return G}}function X(f){return f%o===i?B:f%d===s?T:f%p===u?H(f):N(f)}const P=(f,y)=>(h(f,y)&n)===n;Ce.isNegativeLE=P;const F=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function q(f){const y={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},m=F.reduce((E,A)=>(E[A]="function",E),y);return(0,e._validateObject)(f,m),f}function W(f,y,m){if(m<t)throw new Error("invalid exponent, negatives unsupported");if(m===t)return f.ONE;if(m===n)return y;let E=f.ONE,A=y;for(;m>t;)m&n&&(E=f.mul(E,A)),A=f.sqr(A),m>>=n;return E}function K(f,y,m=!1){const E=new Array(y.length).fill(m?f.ZERO:void 0),A=y.reduce((z,O,k)=>f.is0(O)?z:(E[k]=z,f.mul(z,O)),f.ONE),M=f.inv(A);return y.reduceRight((z,O,k)=>f.is0(O)?z:(E[k]=f.mul(z,E[k]),f.mul(z,O)),M),E}function J(f,y,m){return f.mul(y,typeof m=="bigint"?g(m,f.ORDER):f.inv(m))}function te(f,y){const m=(f.ORDER-n)/r,E=f.pow(y,m),A=f.eql(E,f.ONE),M=f.eql(E,f.ZERO),z=f.eql(E,f.neg(f.ONE));if(!A&&!M&&!z)throw new Error("invalid Legendre symbol result");return A?1:M?0:-1}function ne(f,y){return te(f,y)===1}function Y(f,y){y!==void 0&&(0,e.anumber)(y);const m=y!==void 0?y:f.toString(2).length,E=Math.ceil(m/8);return{nBitLength:m,nByteLength:E}}function Q(f,y,m=!1,E={}){if(f<=t)throw new Error("invalid field: expected ORDER > 0, got "+f);let A,M,z=!1,O;if(typeof y=="object"&&y!=null){if(E.sqrt||m)throw new Error("cannot specify opts in two arguments");const R=y;R.BITS&&(A=R.BITS),R.sqrt&&(M=R.sqrt),typeof R.isLE=="boolean"&&(m=R.isLE),typeof R.modFromBytes=="boolean"&&(z=R.modFromBytes),O=R.allowedLengths}else typeof y=="number"&&(A=y),E.sqrt&&(M=E.sqrt);const{nBitLength:k,nByteLength:U}=Y(f,A);if(U>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let j;const Z=Object.freeze({ORDER:f,isLE:m,BITS:k,BYTES:U,MASK:(0,e.bitMask)(k),ZERO:t,ONE:n,allowedLengths:O,create:R=>h(R,f),isValid:R=>{if(typeof R!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof R);return t<=R&&R<f},is0:R=>R===t,isValidNot0:R=>!Z.is0(R)&&Z.isValid(R),isOdd:R=>(R&n)===n,neg:R=>h(-R,f),eql:(R,G)=>R===G,sqr:R=>h(R*R,f),add:(R,G)=>h(R+G,f),sub:(R,G)=>h(R-G,f),mul:(R,G)=>h(R*G,f),pow:(R,G)=>W(Z,R,G),div:(R,G)=>h(R*g(G,f),f),sqrN:R=>R*R,addN:(R,G)=>R+G,subN:(R,G)=>R-G,mulN:(R,G)=>R*G,inv:R=>g(R,f),sqrt:M||(R=>(j||(j=X(f)),j(Z,R))),toBytes:R=>m?(0,e.numberToBytesLE)(R,U):(0,e.numberToBytesBE)(R,U),fromBytes:(R,G=!0)=>{if(O){if(!O.includes(R.length)||R.length>U)throw new Error("Field.fromBytes: expected "+O+" bytes, got "+R.length);const se=new Uint8Array(U);se.set(R,m?0:se.length-R.length),R=se}if(R.length!==U)throw new Error("Field.fromBytes: expected "+U+" bytes, got "+R.length);let oe=m?(0,e.bytesToNumberLE)(R):(0,e.bytesToNumberBE)(R);if(z&&(oe=h(oe,f)),!G&&!Z.isValid(oe))throw new Error("invalid field element: outside of range 0..ORDER");return oe},invertBatch:R=>K(Z,R),cmov:(R,G,oe)=>oe?G:R});return Object.freeze(Z)}function v(f,y){if(!f.isOdd)throw new Error("Field doesn't have isOdd");const m=f.sqrt(y);return f.isOdd(m)?m:f.neg(m)}function D(f,y){if(!f.isOdd)throw new Error("Field doesn't have isOdd");const m=f.sqrt(y);return f.isOdd(m)?f.neg(m):m}function x(f,y,m=!1){f=(0,e.ensureBytes)("privateHash",f);const E=f.length,A=Y(y).nByteLength+8;if(A<24||E<A||E>1024)throw new Error("hashToPrivateScalar: expected "+A+"-1024 bytes of input, got "+E);const M=m?(0,e.bytesToNumberLE)(f):(0,e.bytesToNumberBE)(f);return h(M,y-n)+n}function S(f){if(typeof f!="bigint")throw new Error("field order must be bigint");const y=f.toString(2).length;return Math.ceil(y/8)}function C(f){const y=S(f);return y+Math.ceil(y/2)}function V(f,y,m=!1){const E=f.length,A=S(y),M=C(y);if(E<16||E<M||E>1024)throw new Error("expected "+M+"-1024 bytes of input, got "+E);const z=m?(0,e.bytesToNumberLE)(f):(0,e.bytesToNumberBE)(f),O=h(z,y-n)+n;return m?(0,e.numberToBytesLE)(O,A):(0,e.numberToBytesBE)(O,A)}return Ce}var js;function li(){if(js)return Je;js=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.wNAF=void 0,Je.negateCt=i,Je.normalizeZ=o,Je.mulEndoUnsafe=B,Je.pippenger=T,Je.precomputeMSMUnsafe=H,Je.validateBasic=N,Je._createCurveFields=P;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=_t(),t=At(),n=BigInt(0),r=BigInt(1);function i(F,q){const W=q.negate();return F?W:q}function o(F,q){const W=(0,t.FpInvertBatch)(F.Fp,q.map(K=>K.Z));return q.map((K,J)=>F.fromAffine(K.toAffine(W[J])))}function s(F,q){if(!Number.isSafeInteger(F)||F<=0||F>q)throw new Error("invalid window size, expected [1.."+q+"], got W="+F)}function a(F,q){s(F,q);const W=Math.ceil(q/F)+1,K=2**(F-1),J=2**F,te=(0,e.bitMask)(F),ne=BigInt(F);return{windows:W,windowSize:K,mask:te,maxNumber:J,shiftBy:ne}}function d(F,q,W){const{windowSize:K,mask:J,maxNumber:te,shiftBy:ne}=W;let Y=Number(F&J),Q=F>>ne;Y>K&&(Y-=te,Q+=r);const v=q*K,D=v+Math.abs(Y)-1,x=Y===0,S=Y<0,C=q%2!==0;return{nextN:Q,offset:D,isZero:x,isNeg:S,isNegF:C,offsetF:v}}function u(F,q){if(!Array.isArray(F))throw new Error("array expected");F.forEach((W,K)=>{if(!(W instanceof q))throw new Error("invalid point at index "+K)})}function p(F,q){if(!Array.isArray(F))throw new Error("array of scalars expected");F.forEach((W,K)=>{if(!q.isValid(W))throw new Error("invalid scalar at index "+K)})}const h=new WeakMap,I=new WeakMap;function b(F){return I.get(F)||1}function g(F){if(F!==n)throw new Error("invalid wNAF")}class w{constructor(q,W){this.BASE=q.BASE,this.ZERO=q.ZERO,this.Fn=q.Fn,this.bits=W}_unsafeLadder(q,W,K=this.ZERO){let J=q;for(;W>n;)W&r&&(K=K.add(J)),J=J.double(),W>>=r;return K}precomputeWindow(q,W){const{windows:K,windowSize:J}=a(W,this.bits),te=[];let ne=q,Y=ne;for(let Q=0;Q<K;Q++){Y=ne,te.push(Y);for(let v=1;v<J;v++)Y=Y.add(ne),te.push(Y);ne=Y.double()}return te}wNAF(q,W,K){if(!this.Fn.isValid(K))throw new Error("invalid scalar");let J=this.ZERO,te=this.BASE;const ne=a(q,this.bits);for(let Y=0;Y<ne.windows;Y++){const{nextN:Q,offset:v,isZero:D,isNeg:x,isNegF:S,offsetF:C}=d(K,Y,ne);K=Q,D?te=te.add(i(S,W[C])):J=J.add(i(x,W[v]))}return g(K),{p:J,f:te}}wNAFUnsafe(q,W,K,J=this.ZERO){const te=a(q,this.bits);for(let ne=0;ne<te.windows&&K!==n;ne++){const{nextN:Y,offset:Q,isZero:v,isNeg:D}=d(K,ne,te);if(K=Y,!v){const x=W[Q];J=J.add(D?x.negate():x)}}return g(K),J}getPrecomputes(q,W,K){let J=h.get(W);return J||(J=this.precomputeWindow(W,q),q!==1&&(typeof K=="function"&&(J=K(J)),h.set(W,J))),J}cached(q,W,K){const J=b(q);return this.wNAF(J,this.getPrecomputes(J,q,K),W)}unsafe(q,W,K,J){const te=b(q);return te===1?this._unsafeLadder(q,W,J):this.wNAFUnsafe(te,this.getPrecomputes(te,q,K),W,J)}createCache(q,W){s(W,this.bits),I.set(q,W),h.delete(q)}hasCache(q){return b(q)!==1}}Je.wNAF=w;function B(F,q,W,K){let J=q,te=F.ZERO,ne=F.ZERO;for(;W>n||K>n;)W&r&&(te=te.add(J)),K&r&&(ne=ne.add(J)),J=J.double(),W>>=r,K>>=r;return{p1:te,p2:ne}}function T(F,q,W,K){u(W,F),p(K,q);const J=W.length,te=K.length;if(J!==te)throw new Error("arrays of points and scalars must have equal length");const ne=F.ZERO,Y=(0,e.bitLen)(BigInt(J));let Q=1;Y>12?Q=Y-3:Y>4?Q=Y-2:Y>0&&(Q=2);const v=(0,e.bitMask)(Q),D=new Array(Number(v)+1).fill(ne),x=Math.floor((q.BITS-1)/Q)*Q;let S=ne;for(let C=x;C>=0;C-=Q){D.fill(ne);for(let f=0;f<te;f++){const y=K[f],m=Number(y>>BigInt(C)&v);D[m]=D[m].add(W[f])}let V=ne;for(let f=D.length-1,y=ne;f>0;f--)y=y.add(D[f]),V=V.add(y);if(S=S.add(V),C!==0)for(let f=0;f<Q;f++)S=S.double()}return S}function H(F,q,W,K){s(K,q.BITS),u(W,F);const J=F.ZERO,te=2**K-1,ne=Math.ceil(q.BITS/K),Y=(0,e.bitMask)(K),Q=W.map(v=>{const D=[];for(let x=0,S=v;x<te;x++)D.push(S),S=S.add(v);return D});return v=>{if(p(v,q),v.length>W.length)throw new Error("array of scalars must be smaller than array of points");let D=J;for(let x=0;x<ne;x++){if(D!==J)for(let C=0;C<K;C++)D=D.double();const S=BigInt(ne*K-(x+1)*K);for(let C=0;C<v.length;C++){const V=v[C],f=Number(V>>S&Y);f&&(D=D.add(Q[C][f-1]))}}return D}}function N(F){return(0,t.validateField)(F.Fp),(0,e.validateObject)(F,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,t.nLength)(F.n,F.nBitLength),...F,p:F.Fp.ORDER})}function X(F,q,W){if(q){if(q.ORDER!==F)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,t.validateField)(q),q}else return(0,t.Field)(F,{isLE:W})}function P(F,q,W={},K){if(K===void 0&&(K=F==="edwards"),!q||typeof q!="object")throw new Error(`expected valid ${F} CURVE object`);for(const Q of["p","n","h"]){const v=q[Q];if(!(typeof v=="bigint"&&v>n))throw new Error(`CURVE.${Q} must be positive bigint`)}const J=X(q.p,W.Fp,K),te=X(q.n,W.Fn,K),Y=["Gx","Gy","a",F==="weierstrass"?"b":"d"];for(const Q of Y)if(!J.isValid(q[Q]))throw new Error(`CURVE.${Q} must be valid field element of CURVE.Fp`);return q=Object.freeze(Object.assign({},q)),{CURVE:q,Fp:J,Fn:te}}return Je}var bt={},qs;function lh(){if(qs)return bt;qs=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.PrimeEdwardsPoint=void 0,bt.edwards=d,bt.eddsa=p,bt.twistedEdwards=b;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=_t(),t=li(),n=At(),r=BigInt(0),i=BigInt(1),o=BigInt(2),s=BigInt(8);function a(g,w,B,T){const H=g.sqr(B),N=g.sqr(T),X=g.add(g.mul(w.a,H),N),P=g.add(g.ONE,g.mul(w.d,g.mul(H,N)));return g.eql(X,P)}function d(g,w={}){const B=(0,t._createCurveFields)("edwards",g,w,w.FpFnLE),{Fp:T,Fn:H}=B;let N=B.CURVE;const{h:X}=N;(0,e._validateObject)(w,{},{uvRatio:"function"});const P=o<<BigInt(H.BYTES*8)-i,F=Q=>T.create(Q),q=w.uvRatio||((Q,v)=>{try{return{isValid:!0,value:T.sqrt(T.div(Q,v))}}catch{return{isValid:!1,value:r}}});if(!a(T,N,N.Gx,N.Gy))throw new Error("bad curve params: generator point");function W(Q,v,D=!1){const x=D?i:r;return(0,e.aInRange)("coordinate "+Q,v,x,P),v}function K(Q){if(!(Q instanceof ne))throw new Error("ExtendedPoint expected")}const J=(0,e.memoized)((Q,v)=>{const{X:D,Y:x,Z:S}=Q,C=Q.is0();v==null&&(v=C?s:T.inv(S));const V=F(D*v),f=F(x*v),y=T.mul(S,v);if(C)return{x:r,y:i};if(y!==i)throw new Error("invZ was invalid");return{x:V,y:f}}),te=(0,e.memoized)(Q=>{const{a:v,d:D}=N;if(Q.is0())throw new Error("bad point: ZERO");const{X:x,Y:S,Z:C,T:V}=Q,f=F(x*x),y=F(S*S),m=F(C*C),E=F(m*m),A=F(f*v),M=F(m*F(A+y)),z=F(E+F(D*F(f*y)));if(M!==z)throw new Error("bad point: equation left != right (1)");const O=F(x*S),k=F(C*V);if(O!==k)throw new Error("bad point: equation left != right (2)");return!0});class ne{constructor(v,D,x,S){this.X=W("x",v),this.Y=W("y",D),this.Z=W("z",x,!0),this.T=W("t",S),Object.freeze(this)}static CURVE(){return N}static fromAffine(v){if(v instanceof ne)throw new Error("extended point not allowed");const{x:D,y:x}=v||{};return W("x",D),W("y",x),new ne(D,x,i,F(D*x))}static fromBytes(v,D=!1){const x=T.BYTES,{a:S,d:C}=N;v=(0,e.copyBytes)((0,e._abytes2)(v,x,"point")),(0,e._abool2)(D,"zip215");const V=(0,e.copyBytes)(v),f=v[x-1];V[x-1]=f&-129;const y=(0,e.bytesToNumberLE)(V),m=D?P:T.ORDER;(0,e.aInRange)("point.y",y,r,m);const E=F(y*y),A=F(E-i),M=F(C*E-S);let{isValid:z,value:O}=q(A,M);if(!z)throw new Error("bad point: invalid y coordinate");const k=(O&i)===i,U=(f&128)!==0;if(!D&&O===r&&U)throw new Error("bad point: x=0 and x_0=1");return U!==k&&(O=F(-O)),ne.fromAffine({x:O,y})}static fromHex(v,D=!1){return ne.fromBytes((0,e.ensureBytes)("point",v),D)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(v=8,D=!0){return Y.createCache(this,v),D||this.multiply(o),this}assertValidity(){te(this)}equals(v){K(v);const{X:D,Y:x,Z:S}=this,{X:C,Y:V,Z:f}=v,y=F(D*f),m=F(C*S),E=F(x*f),A=F(V*S);return y===m&&E===A}is0(){return this.equals(ne.ZERO)}negate(){return new ne(F(-this.X),this.Y,this.Z,F(-this.T))}double(){const{a:v}=N,{X:D,Y:x,Z:S}=this,C=F(D*D),V=F(x*x),f=F(o*F(S*S)),y=F(v*C),m=D+x,E=F(F(m*m)-C-V),A=y+V,M=A-f,z=y-V,O=F(E*M),k=F(A*z),U=F(E*z),j=F(M*A);return new ne(O,k,j,U)}add(v){K(v);const{a:D,d:x}=N,{X:S,Y:C,Z:V,T:f}=this,{X:y,Y:m,Z:E,T:A}=v,M=F(S*y),z=F(C*m),O=F(f*x*A),k=F(V*E),U=F((S+C)*(y+m)-M-z),j=k-O,Z=k+O,R=F(z-D*M),G=F(U*j),oe=F(Z*R),se=F(U*R),ue=F(j*Z);return new ne(G,oe,ue,se)}subtract(v){return this.add(v.negate())}multiply(v){if(!H.isValidNot0(v))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:D,f:x}=Y.cached(this,v,S=>(0,t.normalizeZ)(ne,S));return(0,t.normalizeZ)(ne,[D,x])[0]}multiplyUnsafe(v,D=ne.ZERO){if(!H.isValid(v))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return v===r?ne.ZERO:this.is0()||v===i?this:Y.unsafe(this,v,x=>(0,t.normalizeZ)(ne,x),D)}isSmallOrder(){return this.multiplyUnsafe(X).is0()}isTorsionFree(){return Y.unsafe(this,N.n).is0()}toAffine(v){return J(this,v)}clearCofactor(){return X===i?this:this.multiplyUnsafe(X)}toBytes(){const{x:v,y:D}=this.toAffine(),x=T.toBytes(D);return x[x.length-1]|=v&i?128:0,x}toHex(){return(0,e.bytesToHex)(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(v){return(0,t.normalizeZ)(ne,v)}static msm(v,D){return(0,t.pippenger)(ne,H,v,D)}_setWindowSize(v){this.precompute(v)}toRawBytes(){return this.toBytes()}}ne.BASE=new ne(N.Gx,N.Gy,i,F(N.Gx*N.Gy)),ne.ZERO=new ne(r,i,i,r),ne.Fp=T,ne.Fn=H;const Y=new t.wNAF(ne,H.BITS);return ne.BASE.precompute(8),ne}class u{constructor(w){this.ep=w}static fromBytes(w){(0,e.notImplemented)()}static fromHex(w){(0,e.notImplemented)()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(w){return this.ep.toAffine(w)}toHex(){return(0,e.bytesToHex)(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(w){return this.assertSame(w),this.init(this.ep.add(w.ep))}subtract(w){return this.assertSame(w),this.init(this.ep.subtract(w.ep))}multiply(w){return this.init(this.ep.multiply(w))}multiplyUnsafe(w){return this.init(this.ep.multiplyUnsafe(w))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(w,B){return this.init(this.ep.precompute(w,B))}toRawBytes(){return this.toBytes()}}bt.PrimeEdwardsPoint=u;function p(g,w,B={}){if(typeof w!="function")throw new Error('"hash" function param is required');(0,e._validateObject)(B,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:T}=B,{BASE:H,Fp:N,Fn:X}=g,P=B.randomBytes||e.randomBytes,F=B.adjustScalarBytes||(m=>m),q=B.domain||((m,E,A)=>{if((0,e._abool2)(A,"phflag"),E.length||A)throw new Error("Contexts/pre-hash are not supported");return m});function W(m){return X.create((0,e.bytesToNumberLE)(m))}function K(m){const E=x.secretKey;m=(0,e.ensureBytes)("private key",m,E);const A=(0,e.ensureBytes)("hashed private key",w(m),2*E),M=F(A.slice(0,E)),z=A.slice(E,2*E),O=W(M);return{head:M,prefix:z,scalar:O}}function J(m){const{head:E,prefix:A,scalar:M}=K(m),z=H.multiply(M),O=z.toBytes();return{head:E,prefix:A,scalar:M,point:z,pointBytes:O}}function te(m){return J(m).pointBytes}function ne(m=Uint8Array.of(),...E){const A=(0,e.concatBytes)(...E);return W(w(q(A,(0,e.ensureBytes)("context",m),!!T)))}function Y(m,E,A={}){m=(0,e.ensureBytes)("message",m),T&&(m=T(m));const{prefix:M,scalar:z,pointBytes:O}=J(E),k=ne(A.context,M,m),U=H.multiply(k).toBytes(),j=ne(A.context,U,O,m),Z=X.create(k+j*z);if(!X.isValid(Z))throw new Error("sign failed: invalid s");const R=(0,e.concatBytes)(U,X.toBytes(Z));return(0,e._abytes2)(R,x.signature,"result")}const Q={zip215:!0};function v(m,E,A,M=Q){const{context:z,zip215:O}=M,k=x.signature;m=(0,e.ensureBytes)("signature",m,k),E=(0,e.ensureBytes)("message",E),A=(0,e.ensureBytes)("publicKey",A,x.publicKey),O!==void 0&&(0,e._abool2)(O,"zip215"),T&&(E=T(E));const U=k/2,j=m.subarray(0,U),Z=(0,e.bytesToNumberLE)(m.subarray(U,k));let R,G,oe;try{R=g.fromBytes(A,O),G=g.fromBytes(j,O),oe=H.multiplyUnsafe(Z)}catch{return!1}if(!O&&R.isSmallOrder())return!1;const se=ne(z,G.toBytes(),R.toBytes(),E);return G.add(R.multiplyUnsafe(se)).subtract(oe).clearCofactor().is0()}const D=N.BYTES,x={secretKey:D,publicKey:D,signature:2*D,seed:D};function S(m=P(x.seed)){return(0,e._abytes2)(m,x.seed,"seed")}function C(m){const E=y.randomSecretKey(m);return{secretKey:E,publicKey:te(E)}}function V(m){return(0,e.isBytes)(m)&&m.length===X.BYTES}function f(m,E){try{return!!g.fromBytes(m,E)}catch{return!1}}const y={getExtendedPublicKey:J,randomSecretKey:S,isValidSecretKey:V,isValidPublicKey:f,toMontgomery(m){const{y:E}=g.fromBytes(m),A=x.publicKey,M=A===32;if(!M&&A!==57)throw new Error("only defined for 25519 and 448");const z=M?N.div(i+E,i-E):N.div(E-i,E+i);return N.toBytes(z)},toMontgomerySecret(m){const E=x.secretKey;(0,e._abytes2)(m,E);const A=w(m.subarray(0,E));return F(A).subarray(0,E)},randomPrivateKey:S,precompute(m=8,E=g.BASE){return E.precompute(m,!1)}};return Object.freeze({keygen:C,getPublicKey:te,sign:Y,verify:v,utils:y,Point:g,lengths:x})}function h(g){const w={a:g.a,d:g.d,p:g.Fp.ORDER,n:g.n,h:g.h,Gx:g.Gx,Gy:g.Gy},B=g.Fp,T=(0,n.Field)(w.n,g.nBitLength,!0),H={Fp:B,Fn:T,uvRatio:g.uvRatio},N={randomBytes:g.randomBytes,adjustScalarBytes:g.adjustScalarBytes,domain:g.domain,prehash:g.prehash,mapToCurve:g.mapToCurve};return{CURVE:w,curveOpts:H,hash:g.hash,eddsaOpts:N}}function I(g,w){const B=w.Point;return Object.assign({},w,{ExtendedPoint:B,CURVE:g,nBitLength:B.Fn.BITS,nByteLength:B.Fn.BYTES})}function b(g){const{CURVE:w,curveOpts:B,hash:T,eddsaOpts:H}=h(g),N=d(w,B),X=p(N,T,H);return I(g,X)}return bt}var ui={},Ks;function Gs(){return Ks||(Ks=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._DST_scalar=void 0,e.expand_message_xmd=d,e.expand_message_xof=u,e.hash_to_field=p,e.isogenyMap=h,e.createHasher=I;const t=_t(),n=At(),r=t.bytesToNumberBE;function i(b,g){if(s(b),s(g),b<0||b>=1<<8*g)throw new Error("invalid I2OSP input: "+b);const w=Array.from({length:g}).fill(0);for(let B=g-1;B>=0;B--)w[B]=b&255,b>>>=8;return new Uint8Array(w)}function o(b,g){const w=new Uint8Array(b.length);for(let B=0;B<b.length;B++)w[B]=b[B]^g[B];return w}function s(b){if(!Number.isSafeInteger(b))throw new Error("number expected")}function a(b){if(!(0,t.isBytes)(b)&&typeof b!="string")throw new Error("DST must be Uint8Array or string");return typeof b=="string"?(0,t.utf8ToBytes)(b):b}function d(b,g,w,B){(0,t.abytes)(b),s(w),g=a(g),g.length>255&&(g=B((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),g)));const{outputLen:T,blockLen:H}=B,N=Math.ceil(w/T);if(w>65535||N>255)throw new Error("expand_message_xmd: invalid lenInBytes");const X=(0,t.concatBytes)(g,i(g.length,1)),P=i(0,H),F=i(w,2),q=new Array(N),W=B((0,t.concatBytes)(P,b,F,i(0,1),X));q[0]=B((0,t.concatBytes)(W,i(1,1),X));for(let J=1;J<=N;J++){const te=[o(W,q[J-1]),i(J+1,1),X];q[J]=B((0,t.concatBytes)(...te))}return(0,t.concatBytes)(...q).slice(0,w)}function u(b,g,w,B,T){if((0,t.abytes)(b),s(w),g=a(g),g.length>255){const H=Math.ceil(2*B/8);g=T.create({dkLen:H}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(g).digest()}if(w>65535||g.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return T.create({dkLen:w}).update(b).update(i(w,2)).update(g).update(i(g.length,1)).digest()}function p(b,g,w){(0,t._validateObject)(w,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:B,k:T,m:H,hash:N,expand:X,DST:P}=w;if(!(0,t.isHash)(w.hash))throw new Error("expected valid hash");(0,t.abytes)(b),s(g);const F=B.toString(2).length,q=Math.ceil((F+T)/8),W=g*H*q;let K;if(X==="xmd")K=d(b,P,W,N);else if(X==="xof")K=u(b,P,W,T,N);else if(X==="_internal_pass")K=b;else throw new Error('expand must be "xmd" or "xof"');const J=new Array(g);for(let te=0;te<g;te++){const ne=new Array(H);for(let Y=0;Y<H;Y++){const Q=q*(Y+te*H),v=K.subarray(Q,Q+q);ne[Y]=(0,n.mod)(r(v),B)}J[te]=ne}return J}function h(b,g){const w=g.map(B=>Array.from(B).reverse());return(B,T)=>{const[H,N,X,P]=w.map(W=>W.reduce((K,J)=>b.add(b.mul(K,B),J))),[F,q]=(0,n.FpInvertBatch)(b,[N,P],!0);return B=b.mul(H,F),T=b.mul(T,b.mul(X,q)),{x:B,y:T}}}e._DST_scalar=(0,t.utf8ToBytes)("HashToScalar-");function I(b,g,w){if(typeof g!="function")throw new Error("mapToCurve() must be defined");function B(H){return b.fromAffine(g(H))}function T(H){const N=H.clearCofactor();return N.equals(b.ZERO)?b.ZERO:(N.assertValidity(),N)}return{defaults:w,hashToCurve(H,N){const X=Object.assign({},w,N),P=p(H,2,X),F=B(P[0]),q=B(P[1]);return T(F.add(q))},encodeToCurve(H,N){const X=w.encodeDST?{DST:w.encodeDST}:{},P=Object.assign({},w,X,N),F=p(H,1,P),q=B(F[0]);return T(q)},mapToCurve(H){if(!Array.isArray(H))throw new Error("expected array of bigints");for(const N of H)if(typeof N!="bigint")throw new Error("expected array of bigints");return T(B(H))},hashToScalar(H,N){const X=b.Fn.ORDER,P=Object.assign({},w,{p:X,m:1,DST:e._DST_scalar},N);return p(H,1,P)[0][0]}}}})(ui)),ui}var ir={},zs;function uh(){if(zs)return ir;zs=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.montgomery=s;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=_t(),t=At(),n=BigInt(0),r=BigInt(1),i=BigInt(2);function o(a){return(0,e._validateObject)(a,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...a})}function s(a){const d=o(a),{P:u,type:p,adjustScalarBytes:h,powPminus2:I,randomBytes:b}=d,g=p==="x25519";if(!g&&p!=="x448")throw new Error("invalid type");const w=b||e.randomBytes,B=g?255:448,T=g?32:56,H=BigInt(g?9:5),N=BigInt(g?121665:39081),X=g?i**BigInt(254):i**BigInt(447),P=g?BigInt(8)*i**BigInt(251)-r:BigInt(4)*i**BigInt(445)-r,F=X+P+r,q=V=>(0,t.mod)(V,u),W=K(H);function K(V){return(0,e.numberToBytesLE)(q(V),T)}function J(V){const f=(0,e.ensureBytes)("u coordinate",V,T);return g&&(f[31]&=127),q((0,e.bytesToNumberLE)(f))}function te(V){return(0,e.bytesToNumberLE)(h((0,e.ensureBytes)("scalar",V,T)))}function ne(V,f){const y=v(J(f),te(V));if(y===n)throw new Error("invalid private or public key received");return K(y)}function Y(V){return ne(V,W)}function Q(V,f,y){const m=q(V*(f-y));return f=q(f-m),y=q(y+m),{x_2:f,x_3:y}}function v(V,f){(0,e.aInRange)("u",V,n,u),(0,e.aInRange)("scalar",f,X,F);const y=f,m=V;let E=r,A=n,M=V,z=r,O=n;for(let U=BigInt(B-1);U>=n;U--){const j=y>>U&r;O^=j,{x_2:E,x_3:M}=Q(O,E,M),{x_2:A,x_3:z}=Q(O,A,z),O=j;const Z=E+A,R=q(Z*Z),G=E-A,oe=q(G*G),se=R-oe,ue=M+z,de=M-z,he=q(de*Z),fe=q(ue*G),Ee=he+fe,ye=he-fe;M=q(Ee*Ee),z=q(m*q(ye*ye)),E=q(R*oe),A=q(se*(R+q(N*se)))}({x_2:E,x_3:M}=Q(O,E,M)),{x_2:A,x_3:z}=Q(O,A,z);const k=I(A);return q(E*k)}const D={secretKey:T,publicKey:T,seed:T},x=(V=w(T))=>((0,e.abytes)(V,D.seed),V);function S(V){const f=x(V);return{secretKey:f,publicKey:Y(f)}}return{keygen:S,getSharedSecret:(V,f)=>ne(V,f),getPublicKey:V=>Y(V),scalarMult:ne,scalarMultBase:Y,utils:{randomSecretKey:x,randomPrivateKey:x},GuBytes:W.slice(),lengths:D}}return ir}var Zs;function dh(){return Zs||(Zs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.encodeToCurve=e.hashToCurve=e.RistrettoPoint=e.edwardsToMontgomery=e.ED25519_TORSION_SUBGROUP=e.ristretto255_hasher=e.ristretto255=e.ed25519_hasher=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=void 0,e.edwardsToMontgomeryPub=M,e.edwardsToMontgomeryPriv=z;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=ai(),n=ut(),r=li(),i=lh(),o=Gs(),s=At(),a=uh(),d=_t(),u=BigInt(0),p=BigInt(1),h=BigInt(2),I=BigInt(3),b=BigInt(5),g=BigInt(8),w=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),B={p:w,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:g,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function T(O){const k=BigInt(10),U=BigInt(20),j=BigInt(40),Z=BigInt(80),R=w,oe=O*O%R*O%R,se=(0,s.pow2)(oe,h,R)*oe%R,ue=(0,s.pow2)(se,p,R)*O%R,de=(0,s.pow2)(ue,b,R)*ue%R,he=(0,s.pow2)(de,k,R)*de%R,fe=(0,s.pow2)(he,U,R)*he%R,Ee=(0,s.pow2)(fe,j,R)*fe%R,ye=(0,s.pow2)(Ee,Z,R)*Ee%R,pe=(0,s.pow2)(ye,Z,R)*Ee%R,le=(0,s.pow2)(pe,k,R)*de%R;return{pow_p_5_8:(0,s.pow2)(le,h,R)*O%R,b2:oe}}function H(O){return O[0]&=248,O[31]&=127,O[31]|=64,O}const N=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function X(O,k){const U=w,j=(0,s.mod)(k*k*k,U),Z=(0,s.mod)(j*j*k,U),R=T(O*Z).pow_p_5_8;let G=(0,s.mod)(O*j*R,U);const oe=(0,s.mod)(k*G*G,U),se=G,ue=(0,s.mod)(G*N,U),de=oe===O,he=oe===(0,s.mod)(-O,U),fe=oe===(0,s.mod)(-O*N,U);return de&&(G=se),(he||fe)&&(G=ue),(0,s.isNegativeLE)(G,U)&&(G=(0,s.mod)(-G,U)),{isValid:de||he,value:G}}const P=(0,s.Field)(B.p,{isLE:!0}),F=(0,s.Field)(B.n,{isLE:!0}),q={...B,Fp:P,hash:t.sha512,adjustScalarBytes:H,uvRatio:X};e.ed25519=(0,i.twistedEdwards)(q);function W(O,k,U){if(k.length>255)throw new Error("Context is too big");return(0,n.concatBytes)((0,n.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([U?1:0,k.length]),k,O)}e.ed25519ctx=(0,i.twistedEdwards)({...q,domain:W}),e.ed25519ph=(0,i.twistedEdwards)(Object.assign({},q,{domain:W,prehash:t.sha512})),e.x25519=(()=>{const O=P.ORDER;return(0,a.montgomery)({P:O,type:"x25519",powPminus2:k=>{const{pow_p_5_8:U,b2:j}=T(k);return(0,s.mod)((0,s.pow2)(U,I,O)*j,O)},adjustScalarBytes:H})})();const K=(w+I)/g,J=P.pow(h,K),te=P.sqrt(P.neg(P.ONE));function ne(O){const k=(w-b)/g,U=BigInt(486662);let j=P.sqr(O);j=P.mul(j,h);let Z=P.add(j,P.ONE),R=P.neg(U),G=P.sqr(Z),oe=P.mul(G,Z),se=P.mul(j,U);se=P.mul(se,R),se=P.add(se,G),se=P.mul(se,R);let ue=P.sqr(oe);G=P.sqr(ue),ue=P.mul(ue,oe),ue=P.mul(ue,se),G=P.mul(G,ue);let de=P.pow(G,k);de=P.mul(de,ue);let he=P.mul(de,te);G=P.sqr(de),G=P.mul(G,oe);let fe=P.eql(G,se),Ee=P.cmov(he,de,fe),ye=P.mul(R,j),pe=P.mul(de,O);pe=P.mul(pe,J);let le=P.mul(pe,te),ae=P.mul(se,j);G=P.sqr(pe),G=P.mul(G,oe);let ce=P.eql(G,ae),_=P.cmov(le,pe,ce);G=P.sqr(Ee),G=P.mul(G,oe);let c=P.eql(G,se),l=P.cmov(ye,R,c),L=P.cmov(_,Ee,c),$=P.isOdd(L);return L=P.cmov(L,P.neg(L),c!==$),{xMn:l,xMd:Z,yMn:L,yMd:p}}const Y=(0,s.FpSqrtEven)(P,P.neg(BigInt(486664)));function Q(O){const{xMn:k,xMd:U,yMn:j,yMd:Z}=ne(O);let R=P.mul(k,Z);R=P.mul(R,Y);let G=P.mul(U,j),oe=P.sub(k,U),se=P.add(k,U),ue=P.mul(G,se),de=P.eql(ue,P.ZERO);R=P.cmov(R,P.ZERO,de),G=P.cmov(G,P.ONE,de),oe=P.cmov(oe,P.ONE,de),se=P.cmov(se,P.ONE,de);const[he,fe]=(0,s.FpInvertBatch)(P,[G,se],!0);return{x:P.mul(R,he),y:P.mul(oe,fe)}}e.ed25519_hasher=(0,o.createHasher)(e.ed25519.Point,O=>Q(O[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:w,m:1,k:128,expand:"xmd",hash:t.sha512});const v=N,D=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),x=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),S=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),C=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),V=O=>X(p,O),f=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),y=O=>e.ed25519.Point.Fp.create((0,d.bytesToNumberLE)(O)&f);function m(O){const{d:k}=B,U=w,j=ae=>P.create(ae),Z=j(v*O*O),R=j((Z+p)*S);let G=BigInt(-1);const oe=j((G-k*Z)*j(Z+k));let{isValid:se,value:ue}=X(R,oe),de=j(ue*O);(0,s.isNegativeLE)(de,U)||(de=j(-de)),se||(ue=de),se||(G=Z);const he=j(G*(Z-p)*C-oe),fe=ue*ue,Ee=j((ue+ue)*oe),ye=j(he*D),pe=j(p-fe),le=j(p+fe);return new e.ed25519.Point(j(Ee*le),j(pe*ye),j(ye*le),j(Ee*pe))}function E(O){(0,n.abytes)(O,64);const k=y(O.subarray(0,32)),U=m(k),j=y(O.subarray(32,64)),Z=m(j);return new A(U.add(Z))}class A extends i.PrimeEdwardsPoint{constructor(k){super(k)}static fromAffine(k){return new A(e.ed25519.Point.fromAffine(k))}assertSame(k){if(!(k instanceof A))throw new Error("RistrettoPoint expected")}init(k){return new A(k)}static hashToCurve(k){return E((0,d.ensureBytes)("ristrettoHash",k,64))}static fromBytes(k){(0,n.abytes)(k,32);const{a:U,d:j}=B,Z=w,R=c=>P.create(c),G=y(k);if(!(0,d.equalBytes)(P.toBytes(G),k)||(0,s.isNegativeLE)(G,Z))throw new Error("invalid ristretto255 encoding 1");const oe=R(G*G),se=R(p+U*oe),ue=R(p-U*oe),de=R(se*se),he=R(ue*ue),fe=R(U*j*de-he),{isValid:Ee,value:ye}=V(R(fe*he)),pe=R(ye*ue),le=R(ye*pe*fe);let ae=R((G+G)*pe);(0,s.isNegativeLE)(ae,Z)&&(ae=R(-ae));const ce=R(se*le),_=R(ae*ce);if(!Ee||(0,s.isNegativeLE)(_,Z)||ce===u)throw new Error("invalid ristretto255 encoding 2");return new A(new e.ed25519.Point(ae,ce,p,_))}static fromHex(k){return A.fromBytes((0,d.ensureBytes)("ristrettoHex",k,32))}static msm(k,U){return(0,r.pippenger)(A,e.ed25519.Point.Fn,k,U)}toBytes(){let{X:k,Y:U,Z:j,T:Z}=this.ep;const R=w,G=le=>P.create(le),oe=G(G(j+U)*G(j-U)),se=G(k*U),ue=G(se*se),{value:de}=V(G(oe*ue)),he=G(de*oe),fe=G(de*se),Ee=G(he*fe*Z);let ye;if((0,s.isNegativeLE)(Z*Ee,R)){let le=G(U*v),ae=G(k*v);k=le,U=ae,ye=G(he*x)}else ye=fe;(0,s.isNegativeLE)(k*Ee,R)&&(U=G(-U));let pe=G((j-U)*ye);return(0,s.isNegativeLE)(pe,R)&&(pe=G(-pe)),P.toBytes(pe)}equals(k){this.assertSame(k);const{X:U,Y:j}=this.ep,{X:Z,Y:R}=k.ep,G=ue=>P.create(ue),oe=G(U*R)===G(j*Z),se=G(j*R)===G(U*Z);return oe||se}is0(){return this.equals(A.ZERO)}}A.BASE=new A(e.ed25519.Point.BASE),A.ZERO=new A(e.ed25519.Point.ZERO),A.Fp=P,A.Fn=F,e.ristretto255={Point:A},e.ristretto255_hasher={hashToCurve(O,k){const U=k?.DST||"ristretto255_XMD:SHA-512_R255MAP_RO_",j=(0,o.expand_message_xmd)(O,U,64,t.sha512);return E(j)},hashToScalar(O,k={DST:o._DST_scalar}){const U=(0,o.expand_message_xmd)(O,k.DST,64,t.sha512);return F.create((0,d.bytesToNumberLE)(U))}},e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];function M(O){return e.ed25519.utils.toMontgomery((0,d.ensureBytes)("pub",O))}e.edwardsToMontgomery=M;function z(O){return e.ed25519.utils.toMontgomerySecret((0,d.ensureBytes)("pub",O))}e.RistrettoPoint=A,e.hashToCurve=e.ed25519_hasher.hashToCurve,e.encodeToCurve=e.ed25519_hasher.encodeToCurve,e.hashToRistretto255=e.ristretto255_hasher.hashToCurve,e.hash_to_ristretto255=e.ristretto255_hasher.hashToCurve})(oi)),oi}var di={},wn={},fi={},hi={},Ws;function Ys(){return Ws||(Ws=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=ut();class n extends t.Hash{constructor(o,s){super(),this.finished=!1,this.destroyed=!1,(0,t.ahash)(o);const a=(0,t.toBytes)(s);if(this.iHash=o.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,u=new Uint8Array(d);u.set(a.length>d?o.create().update(a).digest():a);for(let p=0;p<u.length;p++)u[p]^=54;this.iHash.update(u),this.oHash=o.create();for(let p=0;p<u.length;p++)u[p]^=106;this.oHash.update(u),(0,t.clean)(u)}update(o){return(0,t.aexists)(this),this.iHash.update(o),this}digestInto(o){(0,t.aexists)(this),(0,t.abytes)(o,this.outputLen),this.finished=!0,this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const o=new Uint8Array(this.oHash.outputLen);return this.digestInto(o),o}_cloneInto(o){o||(o=Object.create(Object.getPrototypeOf(this),{}));const{oHash:s,iHash:a,finished:d,destroyed:u,blockLen:p,outputLen:h}=this;return o=o,o.finished=d,o.destroyed=u,o.blockLen=p,o.outputLen=h,o.oHash=s._cloneInto(o.oHash),o.iHash=a._cloneInto(o.iHash),o}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n;const r=(i,o,s)=>new n(i,o).update(s).digest();e.hmac=r,e.hmac.create=(i,o)=>new n(i,o)})(hi)),hi}var Xs;function Js(){return Xs||(Xs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=e.DERErr=void 0,e._splitEndoScalar=a,e._normFnElement=B,e.weierstrassN=T,e.SWUFpSqrtRatio=N,e.mapToCurveSimpleSWU=X,e.ecdh=F,e.ecdsa=q,e.weierstrassPoints=W,e._legacyHelperEquat=te,e.weierstrass=Q;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Ys(),n=ut(),r=_t(),i=li(),o=At(),s=(v,D)=>(v+(v>=0?D:-D)/b)/D;function a(v,D,x){const[[S,C],[V,f]]=D,y=s(f*v,x),m=s(-C*v,x);let E=v-y*S-m*V,A=-y*C-m*f;const M=E<h,z=A<h;M&&(E=-E),z&&(A=-A);const O=(0,r.bitMask)(Math.ceil((0,r.bitLen)(x)/2))+I;if(E<h||E>=O||A<h||A>=O)throw new Error("splitScalar (endomorphism): failed, k="+v);return{k1neg:M,k1:E,k2neg:z,k2:A}}function d(v){if(!["compact","recovered","der"].includes(v))throw new Error('Signature format must be "compact", "recovered", or "der"');return v}function u(v,D){const x={};for(let S of Object.keys(D))x[S]=v[S]===void 0?D[S]:v[S];return(0,r._abool2)(x.lowS,"lowS"),(0,r._abool2)(x.prehash,"prehash"),x.format!==void 0&&d(x.format),x}class p extends Error{constructor(D=""){super(D)}}e.DERErr=p,e.DER={Err:p,_tlv:{encode:(v,D)=>{const{Err:x}=e.DER;if(v<0||v>256)throw new x("tlv.encode: wrong tag");if(D.length&1)throw new x("tlv.encode: unpadded data");const S=D.length/2,C=(0,r.numberToHexUnpadded)(S);if(C.length/2&128)throw new x("tlv.encode: long form length too big");const V=S>127?(0,r.numberToHexUnpadded)(C.length/2|128):"";return(0,r.numberToHexUnpadded)(v)+V+C+D},decode(v,D){const{Err:x}=e.DER;let S=0;if(v<0||v>256)throw new x("tlv.encode: wrong tag");if(D.length<2||D[S++]!==v)throw new x("tlv.decode: wrong tlv");const C=D[S++],V=!!(C&128);let f=0;if(!V)f=C;else{const m=C&127;if(!m)throw new x("tlv.decode(long): indefinite length not supported");if(m>4)throw new x("tlv.decode(long): byte length is too big");const E=D.subarray(S,S+m);if(E.length!==m)throw new x("tlv.decode: length bytes not complete");if(E[0]===0)throw new x("tlv.decode(long): zero leftmost byte");for(const A of E)f=f<<8|A;if(S+=m,f<128)throw new x("tlv.decode(long): not minimal encoding")}const y=D.subarray(S,S+f);if(y.length!==f)throw new x("tlv.decode: wrong value length");return{v:y,l:D.subarray(S+f)}}},_int:{encode(v){const{Err:D}=e.DER;if(v<h)throw new D("integer: negative integers are not allowed");let x=(0,r.numberToHexUnpadded)(v);if(Number.parseInt(x[0],16)&8&&(x="00"+x),x.length&1)throw new D("unexpected DER parsing assertion: unpadded hex");return x},decode(v){const{Err:D}=e.DER;if(v[0]&128)throw new D("invalid signature integer: negative");if(v[0]===0&&!(v[1]&128))throw new D("invalid signature integer: unnecessary leading zero");return(0,r.bytesToNumberBE)(v)}},toSig(v){const{Err:D,_int:x,_tlv:S}=e.DER,C=(0,r.ensureBytes)("signature",v),{v:V,l:f}=S.decode(48,C);if(f.length)throw new D("invalid signature: left bytes after parsing");const{v:y,l:m}=S.decode(2,V),{v:E,l:A}=S.decode(2,m);if(A.length)throw new D("invalid signature: left bytes after parsing");return{r:x.decode(y),s:x.decode(E)}},hexFromSig(v){const{_tlv:D,_int:x}=e.DER,S=D.encode(2,x.encode(v.r)),C=D.encode(2,x.encode(v.s)),V=S+C;return D.encode(48,V)}};const h=BigInt(0),I=BigInt(1),b=BigInt(2),g=BigInt(3),w=BigInt(4);function B(v,D){const{BYTES:x}=v;let S;if(typeof D=="bigint")S=D;else{let C=(0,r.ensureBytes)("private key",D);try{S=v.fromBytes(C)}catch{throw new Error(`invalid private key: expected ui8a of size ${x}, got ${typeof D}`)}}if(!v.isValidNot0(S))throw new Error("invalid private key: out of range [1..N-1]");return S}function T(v,D={}){const x=(0,i._createCurveFields)("weierstrass",v,D),{Fp:S,Fn:C}=x;let V=x.CURVE;const{h:f,n:y}=V;(0,r._validateObject)(D,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:m}=D;if(m&&(!S.is0(V.a)||typeof m.beta!="bigint"||!Array.isArray(m.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const E=P(S,C);function A(){if(!S.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function M(pe,le,ae){const{x:ce,y:_}=le.toAffine(),c=S.toBytes(ce);if((0,r._abool2)(ae,"isCompressed"),ae){A();const l=!S.isOdd(_);return(0,r.concatBytes)(H(l),c)}else return(0,r.concatBytes)(Uint8Array.of(4),c,S.toBytes(_))}function z(pe){(0,r._abytes2)(pe,void 0,"Point");const{publicKey:le,publicKeyUncompressed:ae}=E,ce=pe.length,_=pe[0],c=pe.subarray(1);if(ce===le&&(_===2||_===3)){const l=S.fromBytes(c);if(!S.isValid(l))throw new Error("bad point: is not on curve, wrong x");const L=U(l);let $;try{$=S.sqrt(L)}catch(ge){const be=ge instanceof Error?": "+ge.message:"";throw new Error("bad point: is not on curve, sqrt error"+be)}A();const ee=S.isOdd($);return(_&1)===1!==ee&&($=S.neg($)),{x:l,y:$}}else if(ce===ae&&_===4){const l=S.BYTES,L=S.fromBytes(c.subarray(0,l)),$=S.fromBytes(c.subarray(l,l*2));if(!j(L,$))throw new Error("bad point: is not on curve");return{x:L,y:$}}else throw new Error(`bad point: got length ${ce}, expected compressed=${le} or uncompressed=${ae}`)}const O=D.toBytes||M,k=D.fromBytes||z;function U(pe){const le=S.sqr(pe),ae=S.mul(le,pe);return S.add(S.add(ae,S.mul(pe,V.a)),V.b)}function j(pe,le){const ae=S.sqr(le),ce=U(pe);return S.eql(ae,ce)}if(!j(V.Gx,V.Gy))throw new Error("bad curve params: generator point");const Z=S.mul(S.pow(V.a,g),w),R=S.mul(S.sqr(V.b),BigInt(27));if(S.is0(S.add(Z,R)))throw new Error("bad curve params: a or b");function G(pe,le,ae=!1){if(!S.isValid(le)||ae&&S.is0(le))throw new Error(`bad point coordinate ${pe}`);return le}function oe(pe){if(!(pe instanceof fe))throw new Error("ProjectivePoint expected")}function se(pe){if(!m||!m.basises)throw new Error("no endo");return a(pe,m.basises,C.ORDER)}const ue=(0,r.memoized)((pe,le)=>{const{X:ae,Y:ce,Z:_}=pe;if(S.eql(_,S.ONE))return{x:ae,y:ce};const c=pe.is0();le==null&&(le=c?S.ONE:S.inv(_));const l=S.mul(ae,le),L=S.mul(ce,le),$=S.mul(_,le);if(c)return{x:S.ZERO,y:S.ZERO};if(!S.eql($,S.ONE))throw new Error("invZ was invalid");return{x:l,y:L}}),de=(0,r.memoized)(pe=>{if(pe.is0()){if(D.allowInfinityPoint&&!S.is0(pe.Y))return;throw new Error("bad point: ZERO")}const{x:le,y:ae}=pe.toAffine();if(!S.isValid(le)||!S.isValid(ae))throw new Error("bad point: x or y not field elements");if(!j(le,ae))throw new Error("bad point: equation left != right");if(!pe.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function he(pe,le,ae,ce,_){return ae=new fe(S.mul(ae.X,pe),ae.Y,ae.Z),le=(0,i.negateCt)(ce,le),ae=(0,i.negateCt)(_,ae),le.add(ae)}class fe{constructor(le,ae,ce){this.X=G("x",le),this.Y=G("y",ae,!0),this.Z=G("z",ce),Object.freeze(this)}static CURVE(){return V}static fromAffine(le){const{x:ae,y:ce}=le||{};if(!le||!S.isValid(ae)||!S.isValid(ce))throw new Error("invalid affine point");if(le instanceof fe)throw new Error("projective point not allowed");return S.is0(ae)&&S.is0(ce)?fe.ZERO:new fe(ae,ce,S.ONE)}static fromBytes(le){const ae=fe.fromAffine(k((0,r._abytes2)(le,void 0,"point")));return ae.assertValidity(),ae}static fromHex(le){return fe.fromBytes((0,r.ensureBytes)("pointHex",le))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(le=8,ae=!0){return ye.createCache(this,le),ae||this.multiply(g),this}assertValidity(){de(this)}hasEvenY(){const{y:le}=this.toAffine();if(!S.isOdd)throw new Error("Field doesn't support isOdd");return!S.isOdd(le)}equals(le){oe(le);const{X:ae,Y:ce,Z:_}=this,{X:c,Y:l,Z:L}=le,$=S.eql(S.mul(ae,L),S.mul(c,_)),ee=S.eql(S.mul(ce,L),S.mul(l,_));return $&&ee}negate(){return new fe(this.X,S.neg(this.Y),this.Z)}double(){const{a:le,b:ae}=V,ce=S.mul(ae,g),{X:_,Y:c,Z:l}=this;let L=S.ZERO,$=S.ZERO,ee=S.ZERO,re=S.mul(_,_),ge=S.mul(c,c),be=S.mul(l,l),me=S.mul(_,c);return me=S.add(me,me),ee=S.mul(_,l),ee=S.add(ee,ee),L=S.mul(le,ee),$=S.mul(ce,be),$=S.add(L,$),L=S.sub(ge,$),$=S.add(ge,$),$=S.mul(L,$),L=S.mul(me,L),ee=S.mul(ce,ee),be=S.mul(le,be),me=S.sub(re,be),me=S.mul(le,me),me=S.add(me,ee),ee=S.add(re,re),re=S.add(ee,re),re=S.add(re,be),re=S.mul(re,me),$=S.add($,re),be=S.mul(c,l),be=S.add(be,be),re=S.mul(be,me),L=S.sub(L,re),ee=S.mul(be,ge),ee=S.add(ee,ee),ee=S.add(ee,ee),new fe(L,$,ee)}add(le){oe(le);const{X:ae,Y:ce,Z:_}=this,{X:c,Y:l,Z:L}=le;let $=S.ZERO,ee=S.ZERO,re=S.ZERO;const ge=V.a,be=S.mul(V.b,g);let me=S.mul(ae,c),Se=S.mul(ce,l),we=S.mul(_,L),Ze=S.add(ae,ce),Re=S.add(c,l);Ze=S.mul(Ze,Re),Re=S.add(me,Se),Ze=S.sub(Ze,Re),Re=S.add(ae,_);let Ne=S.add(c,L);return Re=S.mul(Re,Ne),Ne=S.add(me,we),Re=S.sub(Re,Ne),Ne=S.add(ce,_),$=S.add(l,L),Ne=S.mul(Ne,$),$=S.add(Se,we),Ne=S.sub(Ne,$),re=S.mul(ge,Re),$=S.mul(be,we),re=S.add($,re),$=S.sub(Se,re),re=S.add(Se,re),ee=S.mul($,re),Se=S.add(me,me),Se=S.add(Se,me),we=S.mul(ge,we),Re=S.mul(be,Re),Se=S.add(Se,we),we=S.sub(me,we),we=S.mul(ge,we),Re=S.add(Re,we),me=S.mul(Se,Re),ee=S.add(ee,me),me=S.mul(Ne,Re),$=S.mul(Ze,$),$=S.sub($,me),me=S.mul(Ze,Se),re=S.mul(Ne,re),re=S.add(re,me),new fe($,ee,re)}subtract(le){return this.add(le.negate())}is0(){return this.equals(fe.ZERO)}multiply(le){const{endo:ae}=D;if(!C.isValidNot0(le))throw new Error("invalid scalar: out of range");let ce,_;const c=l=>ye.cached(this,l,L=>(0,i.normalizeZ)(fe,L));if(ae){const{k1neg:l,k1:L,k2neg:$,k2:ee}=se(le),{p:re,f:ge}=c(L),{p:be,f:me}=c(ee);_=ge.add(me),ce=he(ae.beta,re,be,l,$)}else{const{p:l,f:L}=c(le);ce=l,_=L}return(0,i.normalizeZ)(fe,[ce,_])[0]}multiplyUnsafe(le){const{endo:ae}=D,ce=this;if(!C.isValid(le))throw new Error("invalid scalar: out of range");if(le===h||ce.is0())return fe.ZERO;if(le===I)return ce;if(ye.hasCache(this))return this.multiply(le);if(ae){const{k1neg:_,k1:c,k2neg:l,k2:L}=se(le),{p1:$,p2:ee}=(0,i.mulEndoUnsafe)(fe,ce,c,L);return he(ae.beta,$,ee,_,l)}else return ye.unsafe(ce,le)}multiplyAndAddUnsafe(le,ae,ce){const _=this.multiplyUnsafe(ae).add(le.multiplyUnsafe(ce));return _.is0()?void 0:_}toAffine(le){return ue(this,le)}isTorsionFree(){const{isTorsionFree:le}=D;return f===I?!0:le?le(fe,this):ye.unsafe(this,y).is0()}clearCofactor(){const{clearCofactor:le}=D;return f===I?this:le?le(fe,this):this.multiplyUnsafe(f)}isSmallOrder(){return this.multiplyUnsafe(f).is0()}toBytes(le=!0){return(0,r._abool2)(le,"isCompressed"),this.assertValidity(),O(fe,this,le)}toHex(le=!0){return(0,r.bytesToHex)(this.toBytes(le))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(le=!0){return this.toBytes(le)}_setWindowSize(le){this.precompute(le)}static normalizeZ(le){return(0,i.normalizeZ)(fe,le)}static msm(le,ae){return(0,i.pippenger)(fe,C,le,ae)}static fromPrivateKey(le){return fe.BASE.multiply(B(C,le))}}fe.BASE=new fe(V.Gx,V.Gy,S.ONE),fe.ZERO=new fe(S.ZERO,S.ONE,S.ZERO),fe.Fp=S,fe.Fn=C;const Ee=C.BITS,ye=new i.wNAF(fe,D.endo?Math.ceil(Ee/2):Ee);return fe.BASE.precompute(8),fe}function H(v){return Uint8Array.of(v?2:3)}function N(v,D){const x=v.ORDER;let S=h;for(let k=x-I;k%b===h;k/=b)S+=I;const C=S,V=b<<C-I-I,f=V*b,y=(x-I)/f,m=(y-I)/b,E=f-I,A=V,M=v.pow(D,y),z=v.pow(D,(y+I)/b);let O=(k,U)=>{let j=M,Z=v.pow(U,E),R=v.sqr(Z);R=v.mul(R,U);let G=v.mul(k,R);G=v.pow(G,m),G=v.mul(G,Z),Z=v.mul(G,U),R=v.mul(G,k);let oe=v.mul(R,Z);G=v.pow(oe,A);let se=v.eql(G,v.ONE);Z=v.mul(R,z),G=v.mul(oe,j),R=v.cmov(Z,R,se),oe=v.cmov(G,oe,se);for(let ue=C;ue>I;ue--){let de=ue-b;de=b<<de-I;let he=v.pow(oe,de);const fe=v.eql(he,v.ONE);Z=v.mul(R,j),j=v.mul(j,j),he=v.mul(oe,j),R=v.cmov(Z,R,fe),oe=v.cmov(he,oe,fe)}return{isValid:se,value:R}};if(v.ORDER%w===g){const k=(v.ORDER-g)/w,U=v.sqrt(v.neg(D));O=(j,Z)=>{let R=v.sqr(Z);const G=v.mul(j,Z);R=v.mul(R,G);let oe=v.pow(R,k);oe=v.mul(oe,G);const se=v.mul(oe,U),ue=v.mul(v.sqr(oe),Z),de=v.eql(ue,j);let he=v.cmov(se,oe,de);return{isValid:de,value:he}}}return O}function X(v,D){(0,o.validateField)(v);const{A:x,B:S,Z:C}=D;if(!v.isValid(x)||!v.isValid(S)||!v.isValid(C))throw new Error("mapToCurveSimpleSWU: invalid opts");const V=N(v,C);if(!v.isOdd)throw new Error("Field does not have .isOdd()");return f=>{let y,m,E,A,M,z,O,k;y=v.sqr(f),y=v.mul(y,C),m=v.sqr(y),m=v.add(m,y),E=v.add(m,v.ONE),E=v.mul(E,S),A=v.cmov(C,v.neg(m),!v.eql(m,v.ZERO)),A=v.mul(A,x),m=v.sqr(E),z=v.sqr(A),M=v.mul(z,x),m=v.add(m,M),m=v.mul(m,E),z=v.mul(z,A),M=v.mul(z,S),m=v.add(m,M),O=v.mul(y,E);const{isValid:U,value:j}=V(m,z);k=v.mul(y,f),k=v.mul(k,j),O=v.cmov(O,E,U),k=v.cmov(k,j,U);const Z=v.isOdd(f)===v.isOdd(k);k=v.cmov(v.neg(k),k,Z);const R=(0,o.FpInvertBatch)(v,[A],!0)[0];return O=v.mul(O,R),{x:O,y:k}}}function P(v,D){return{secretKey:D.BYTES,publicKey:1+v.BYTES,publicKeyUncompressed:1+2*v.BYTES,publicKeyHasPrefix:!0,signature:2*D.BYTES}}function F(v,D={}){const{Fn:x}=v,S=D.randomBytes||r.randomBytes,C=Object.assign(P(v.Fp,x),{seed:(0,o.getMinHashLength)(x.ORDER)});function V(O){try{return!!B(x,O)}catch{return!1}}function f(O,k){const{publicKey:U,publicKeyUncompressed:j}=C;try{const Z=O.length;return k===!0&&Z!==U||k===!1&&Z!==j?!1:!!v.fromBytes(O)}catch{return!1}}function y(O=S(C.seed)){return(0,o.mapHashToField)((0,r._abytes2)(O,C.seed,"seed"),x.ORDER)}function m(O,k=!0){return v.BASE.multiply(B(x,O)).toBytes(k)}function E(O){const k=y(O);return{secretKey:k,publicKey:m(k)}}function A(O){if(typeof O=="bigint")return!1;if(O instanceof v)return!0;const{secretKey:k,publicKey:U,publicKeyUncompressed:j}=C;if(x.allowedLengths||k===U)return;const Z=(0,r.ensureBytes)("key",O).length;return Z===U||Z===j}function M(O,k,U=!0){if(A(O)===!0)throw new Error("first arg must be private key");if(A(k)===!1)throw new Error("second arg must be public key");const j=B(x,O);return v.fromHex(k).multiply(j).toBytes(U)}return Object.freeze({getPublicKey:m,getSharedSecret:M,keygen:E,Point:v,utils:{isValidSecretKey:V,isValidPublicKey:f,randomSecretKey:y,isValidPrivateKey:V,randomPrivateKey:y,normPrivateKeyToScalar:O=>B(x,O),precompute(O=8,k=v.BASE){return k.precompute(O,!1)}},lengths:C})}function q(v,D,x={}){(0,n.ahash)(D),(0,r._validateObject)(x,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const S=x.randomBytes||r.randomBytes,C=x.hmac||((ae,...ce)=>(0,t.hmac)(D,ae,(0,r.concatBytes)(...ce))),{Fp:V,Fn:f}=v,{ORDER:y,BITS:m}=f,{keygen:E,getPublicKey:A,getSharedSecret:M,utils:z,lengths:O}=F(v,x),k={prehash:!1,lowS:typeof x.lowS=="boolean"?x.lowS:!1,format:void 0,extraEntropy:!1},U="compact";function j(ae){const ce=y>>I;return ae>ce}function Z(ae,ce){if(!f.isValidNot0(ce))throw new Error(`invalid signature ${ae}: out of range 1..Point.Fn.ORDER`);return ce}function R(ae,ce){d(ce);const _=O.signature,c=ce==="compact"?_:ce==="recovered"?_+1:void 0;return(0,r._abytes2)(ae,c,`${ce} signature`)}class G{constructor(ce,_,c){this.r=Z("r",ce),this.s=Z("s",_),c!=null&&(this.recovery=c),Object.freeze(this)}static fromBytes(ce,_=U){R(ce,_);let c;if(_==="der"){const{r:ee,s:re}=e.DER.toSig((0,r._abytes2)(ce));return new G(ee,re)}_==="recovered"&&(c=ce[0],_="compact",ce=ce.subarray(1));const l=f.BYTES,L=ce.subarray(0,l),$=ce.subarray(l,l*2);return new G(f.fromBytes(L),f.fromBytes($),c)}static fromHex(ce,_){return this.fromBytes((0,r.hexToBytes)(ce),_)}addRecoveryBit(ce){return new G(this.r,this.s,ce)}recoverPublicKey(ce){const _=V.ORDER,{r:c,s:l,recovery:L}=this;if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");if(y*b<_&&L>1)throw new Error("recovery id is ambiguous for h>1 curve");const ee=L===2||L===3?c+y:c;if(!V.isValid(ee))throw new Error("recovery id 2 or 3 invalid");const re=V.toBytes(ee),ge=v.fromBytes((0,r.concatBytes)(H((L&1)===0),re)),be=f.inv(ee),me=se((0,r.ensureBytes)("msgHash",ce)),Se=f.create(-me*be),we=f.create(l*be),Ze=v.BASE.multiplyUnsafe(Se).add(ge.multiplyUnsafe(we));if(Ze.is0())throw new Error("point at infinify");return Ze.assertValidity(),Ze}hasHighS(){return j(this.s)}toBytes(ce=U){if(d(ce),ce==="der")return(0,r.hexToBytes)(e.DER.hexFromSig(this));const _=f.toBytes(this.r),c=f.toBytes(this.s);if(ce==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return(0,r.concatBytes)(Uint8Array.of(this.recovery),_,c)}return(0,r.concatBytes)(_,c)}toHex(ce){return(0,r.bytesToHex)(this.toBytes(ce))}assertValidity(){}static fromCompact(ce){return G.fromBytes((0,r.ensureBytes)("sig",ce),"compact")}static fromDER(ce){return G.fromBytes((0,r.ensureBytes)("sig",ce),"der")}normalizeS(){return this.hasHighS()?new G(this.r,f.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,r.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,r.bytesToHex)(this.toBytes("compact"))}}const oe=x.bits2int||function(ce){if(ce.length>8192)throw new Error("input is too large");const _=(0,r.bytesToNumberBE)(ce),c=ce.length*8-m;return c>0?_>>BigInt(c):_},se=x.bits2int_modN||function(ce){return f.create(oe(ce))},ue=(0,r.bitMask)(m);function de(ae){return(0,r.aInRange)("num < 2^"+m,ae,h,ue),f.toBytes(ae)}function he(ae,ce){return(0,r._abytes2)(ae,void 0,"message"),ce?(0,r._abytes2)(D(ae),void 0,"prehashed message"):ae}function fe(ae,ce,_){if(["recovered","canonical"].some(Se=>Se in _))throw new Error("sign() legacy options not supported");const{lowS:c,prehash:l,extraEntropy:L}=u(_,k);ae=he(ae,l);const $=se(ae),ee=B(f,ce),re=[de(ee),de($)];if(L!=null&&L!==!1){const Se=L===!0?S(O.secretKey):L;re.push((0,r.ensureBytes)("extraEntropy",Se))}const ge=(0,r.concatBytes)(...re),be=$;function me(Se){const we=oe(Se);if(!f.isValidNot0(we))return;const Ze=f.inv(we),Re=v.BASE.multiply(we).toAffine(),Ne=f.create(Re.x);if(Ne===h)return;const Er=f.create(Ze*f.create(be+Ne*ee));if(Er===h)return;let Yc=(Re.x===Ne?0:2)|Number(Re.y&I),Xc=Er;return c&&j(Er)&&(Xc=f.neg(Er),Yc^=1),new G(Ne,Xc,Yc)}return{seed:ge,k2sig:me}}function Ee(ae,ce,_={}){ae=(0,r.ensureBytes)("message",ae);const{seed:c,k2sig:l}=fe(ae,ce,_);return(0,r.createHmacDrbg)(D.outputLen,f.BYTES,C)(c,l)}function ye(ae){let ce;const _=typeof ae=="string"||(0,r.isBytes)(ae),c=!_&&ae!==null&&typeof ae=="object"&&typeof ae.r=="bigint"&&typeof ae.s=="bigint";if(!_&&!c)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(c)ce=new G(ae.r,ae.s);else if(_){try{ce=G.fromBytes((0,r.ensureBytes)("sig",ae),"der")}catch(l){if(!(l instanceof e.DER.Err))throw l}if(!ce)try{ce=G.fromBytes((0,r.ensureBytes)("sig",ae),"compact")}catch{return!1}}return ce||!1}function pe(ae,ce,_,c={}){const{lowS:l,prehash:L,format:$}=u(c,k);if(_=(0,r.ensureBytes)("publicKey",_),ce=he((0,r.ensureBytes)("message",ce),L),"strict"in c)throw new Error("options.strict was renamed to lowS");const ee=$===void 0?ye(ae):G.fromBytes((0,r.ensureBytes)("sig",ae),$);if(ee===!1)return!1;try{const re=v.fromBytes(_);if(l&&ee.hasHighS())return!1;const{r:ge,s:be}=ee,me=se(ce),Se=f.inv(be),we=f.create(me*Se),Ze=f.create(ge*Se),Re=v.BASE.multiplyUnsafe(we).add(re.multiplyUnsafe(Ze));return Re.is0()?!1:f.create(Re.x)===ge}catch{return!1}}function le(ae,ce,_={}){const{prehash:c}=u(_,k);return ce=he(ce,c),G.fromBytes(ae,"recovered").recoverPublicKey(ce).toBytes()}return Object.freeze({keygen:E,getPublicKey:A,getSharedSecret:M,utils:z,lengths:O,Point:v,sign:Ee,verify:pe,recoverPublicKey:le,Signature:G,hash:D})}function W(v){const{CURVE:D,curveOpts:x}=K(v),S=T(D,x);return ne(v,S)}function K(v){const D={a:v.a,b:v.b,p:v.Fp.ORDER,n:v.n,h:v.h,Gx:v.Gx,Gy:v.Gy},x=v.Fp;let S=v.allowedPrivateKeyLengths?Array.from(new Set(v.allowedPrivateKeyLengths.map(f=>Math.ceil(f/2)))):void 0;const C=(0,o.Field)(D.n,{BITS:v.nBitLength,allowedLengths:S,modFromBytes:v.wrapPrivateKey}),V={Fp:x,Fn:C,allowInfinityPoint:v.allowInfinityPoint,endo:v.endo,isTorsionFree:v.isTorsionFree,clearCofactor:v.clearCofactor,fromBytes:v.fromBytes,toBytes:v.toBytes};return{CURVE:D,curveOpts:V}}function J(v){const{CURVE:D,curveOpts:x}=K(v),S={hmac:v.hmac,randomBytes:v.randomBytes,lowS:v.lowS,bits2int:v.bits2int,bits2int_modN:v.bits2int_modN};return{CURVE:D,curveOpts:x,hash:v.hash,ecdsaOpts:S}}function te(v,D,x){function S(C){const V=v.sqr(C),f=v.mul(V,C);return v.add(v.add(f,v.mul(C,D)),x)}return S}function ne(v,D){const{Fp:x,Fn:S}=D;function C(f){return(0,r.inRange)(f,I,S.ORDER)}const V=te(x,v.a,v.b);return Object.assign({},{CURVE:v,Point:D,ProjectivePoint:D,normPrivateKeyToScalar:f=>B(S,f),weierstrassEquation:V,isWithinCurveOrder:C})}function Y(v,D){const x=D.Point;return Object.assign({},D,{ProjectivePoint:x,CURVE:Object.assign({},v,(0,o.nLength)(x.Fn.ORDER,x.Fn.BITS))})}function Q(v){const{CURVE:D,curveOpts:x,hash:S,ecdsaOpts:C}=J(v),V=T(D,x),f=q(V,S,C);return Y(v,f)}})(fi)),fi}var Qs;function fh(){if(Qs)return wn;Qs=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.getHash=t,wn.createCurve=n;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=Js();function t(r){return{hash:r}}function n(r,i){const o=s=>(0,e.weierstrass)({...r,hash:s});return{...o(i),create:o}}return wn}var ea;function hh(){return ea||(ea=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.secp256k1_hasher=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=ai(),n=ut(),r=fh(),i=Gs(),o=At(),s=Js(),a=_t(),d={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},u={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},p=BigInt(0),h=BigInt(1),I=BigInt(2);function b(Y){const Q=d.p,v=BigInt(3),D=BigInt(6),x=BigInt(11),S=BigInt(22),C=BigInt(23),V=BigInt(44),f=BigInt(88),y=Y*Y*Y%Q,m=y*y*Y%Q,E=(0,o.pow2)(m,v,Q)*m%Q,A=(0,o.pow2)(E,v,Q)*m%Q,M=(0,o.pow2)(A,I,Q)*y%Q,z=(0,o.pow2)(M,x,Q)*M%Q,O=(0,o.pow2)(z,S,Q)*z%Q,k=(0,o.pow2)(O,V,Q)*O%Q,U=(0,o.pow2)(k,f,Q)*k%Q,j=(0,o.pow2)(U,V,Q)*O%Q,Z=(0,o.pow2)(j,v,Q)*m%Q,R=(0,o.pow2)(Z,C,Q)*z%Q,G=(0,o.pow2)(R,D,Q)*y%Q,oe=(0,o.pow2)(G,I,Q);if(!g.eql(g.sqr(oe),Y))throw new Error("Cannot find square root");return oe}const g=(0,o.Field)(d.p,{sqrt:b});e.secp256k1=(0,r.createCurve)({...d,Fp:g,lowS:!0,endo:u},t.sha256);const w={};function B(Y,...Q){let v=w[Y];if(v===void 0){const D=(0,t.sha256)((0,a.utf8ToBytes)(Y));v=(0,a.concatBytes)(D,D),w[Y]=v}return(0,t.sha256)((0,a.concatBytes)(v,...Q))}const T=Y=>Y.toBytes(!0).slice(1),H=e.secp256k1.Point,N=Y=>Y%I===p;function X(Y){const{Fn:Q,BASE:v}=H,D=(0,s._normFnElement)(Q,Y),x=v.multiply(D);return{scalar:N(x.y)?D:Q.neg(D),bytes:T(x)}}function P(Y){const Q=g;if(!Q.isValidNot0(Y))throw new Error("invalid x: Fail if x ≥ p");const v=Q.create(Y*Y),D=Q.create(v*Y+BigInt(7));let x=Q.sqrt(D);N(x)||(x=Q.neg(x));const S=H.fromAffine({x:Y,y:x});return S.assertValidity(),S}const F=a.bytesToNumberBE;function q(...Y){return H.Fn.create(F(B("BIP0340/challenge",...Y)))}function W(Y){return X(Y).bytes}function K(Y,Q,v=(0,n.randomBytes)(32)){const{Fn:D}=H,x=(0,a.ensureBytes)("message",Y),{bytes:S,scalar:C}=X(Q),V=(0,a.ensureBytes)("auxRand",v,32),f=D.toBytes(C^F(B("BIP0340/aux",V))),y=B("BIP0340/nonce",f,S,x),{bytes:m,scalar:E}=X(y),A=q(m,S,x),M=new Uint8Array(64);if(M.set(m,0),M.set(D.toBytes(D.create(E+A*C)),32),!J(M,x,S))throw new Error("sign: Invalid signature produced");return M}function J(Y,Q,v){const{Fn:D,BASE:x}=H,S=(0,a.ensureBytes)("signature",Y,64),C=(0,a.ensureBytes)("message",Q),V=(0,a.ensureBytes)("publicKey",v,32);try{const f=P(F(V)),y=F(S.subarray(0,32));if(!(0,a.inRange)(y,h,d.p))return!1;const m=F(S.subarray(32,64));if(!(0,a.inRange)(m,h,d.n))return!1;const E=q(D.toBytes(y),T(f),C),A=x.multiplyUnsafe(m).add(f.multiplyUnsafe(D.neg(E))),{x:M,y:z}=A.toAffine();return!(A.is0()||!N(z)||M!==y)}catch{return!1}}e.schnorr=(()=>{const v=(x=(0,n.randomBytes)(48))=>(0,o.mapHashToField)(x,d.n);e.secp256k1.utils.randomSecretKey;function D(x){const S=v(x);return{secretKey:S,publicKey:W(S)}}return{keygen:D,getPublicKey:W,sign:K,verify:J,Point:H,utils:{randomSecretKey:v,randomPrivateKey:v,taggedHash:B,lift_x:P,pointToBytes:T,numberToBytesBE:a.numberToBytesBE,bytesToNumberBE:a.bytesToNumberBE,mod:o.mod},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})();const te=(0,i.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(Y=>Y.map(Q=>BigInt(Q)))),ne=(0,s.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))});e.secp256k1_hasher=(0,i.createHasher)(e.secp256k1.Point,Y=>{const{x:Q,y:v}=ne(g.create(Y[0]));return te(Q,v)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256}),e.hashToCurve=e.secp256k1_hasher.hashToCurve,e.encodeToCurve=e.secp256k1_hasher.encodeToCurve})(di)),di}var pi={},ta;function na(){return ta||(ta=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHex=e.remove0x=void 0;var t=Xe(),n=function(i){return i.startsWith("0x")||i.startsWith("0X")?i.slice(2):i};e.remove0x=n;var r=function(i){return(0,t.hexToBytes)((0,e.remove0x)(i))};e.decodeHex=r})(pi)),pi}var ra;function ph(){return ra||(ra=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hexToPublicKey=e.convertPublicKeyFormat=e.getSharedPoint=e.getPublicKey=e.isValidPrivateKey=e.getValidSecret=void 0;var t=ks(),n=dh(),r=hh(),i=rr(),o=ti(),s=na(),a=function(B){var T;do T=(0,t.randomBytes)(o.SECRET_KEY_LENGTH);while(!(0,e.isValidPrivateKey)(T,B));return T};e.getValidSecret=a;var d=function(B,T){return b(T||(0,i.ellipticCurve)(),function(H){return H.utils.isValidPrivateKey(B)},function(){return!0},function(){return!0})};e.isValidPrivateKey=d;var u=function(B,T){return b(T||(0,i.ellipticCurve)(),function(H){return H.getPublicKey(B)},function(H){return H.getPublicKey(B)},function(H){return H.getPublicKey(B)})};e.getPublicKey=u;var p=function(B,T,H,N){return b(N||(0,i.ellipticCurve)(),function(X){return X.getSharedSecret(B,T,H)},function(X){return X.getSharedSecret(B,T)},function(X){return w(X,B,T)})};e.getSharedPoint=p;var h=function(B,T,H){return b(H||(0,i.ellipticCurve)(),function(N){return N.getSharedSecret(BigInt(1),B,T)},function(){return B},function(){return B})};e.convertPublicKeyFormat=h;var I=function(B,T){var H=(0,s.decodeHex)(B);return b(T||(0,i.ellipticCurve)(),function(){return g(H)},function(){return H},function(){return H})};e.hexToPublicKey=I;function b(B,T,H,N){if(B==="secp256k1")return T(r.secp256k1);if(B==="x25519")return H(n.x25519);if(B==="ed25519")return N(n.ed25519);throw new Error("Not implemented")}var g=function(B){if(B.length===o.ETH_PUBLIC_KEY_SIZE){var T=new Uint8Array(1+B.length);return T.set([4]),T.set(B,1),T}return B},w=function(B,T,H){var N=B.utils.getExtendedPublicKey(T).scalar,X=B.ExtendedPoint.fromHex(H).multiply(N);return X.toRawBytes()}})(ri)),ri}var yi={},Ct={},ia;function yh(){if(ia)return Ct;ia=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.hkdf=void 0,Ct.extract=n,Ct.expand=o;const e=Ys(),t=ut();function n(a,d,u){return(0,t.ahash)(a),u===void 0&&(u=new Uint8Array(a.outputLen)),(0,e.hmac)(a,(0,t.toBytes)(u),(0,t.toBytes)(d))}const r=Uint8Array.from([0]),i=Uint8Array.of();function o(a,d,u,p=32){(0,t.ahash)(a),(0,t.anumber)(p);const h=a.outputLen;if(p>255*h)throw new Error("Length should be <= 255*HashLen");const I=Math.ceil(p/h);u===void 0&&(u=i);const b=new Uint8Array(I*h),g=e.hmac.create(a,d),w=g._cloneInto(),B=new Uint8Array(g.outputLen);for(let T=0;T<I;T++)r[0]=T+1,w.update(T===0?i:B).update(u).update(r).digestInto(B),b.set(B,h*T),g._cloneInto(w);return g.destroy(),w.destroy(),(0,t.clean)(B,r),b.slice(0,p)}const s=(a,d,u,p,h)=>o(a,n(a,d,u),p,h);return Ct.hkdf=s,Ct}var oa;function gh(){return oa||(oa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getSharedKey=e.deriveKey=void 0;var t=Xe(),n=yh(),r=ai(),i=function(s,a,d){return(0,n.hkdf)(r.sha256,s,a,d,32)};e.deriveKey=i;var o=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return(0,e.deriveKey)(t.concatBytes.apply(void 0,s))};e.getSharedKey=o})(yi)),yi}var gi={},Tt={},mi={},wt={},sa;function mh(){if(sa)return wt;sa=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.polyval=wt.ghash=void 0,wt._toGHASHKey=a;const e=Xe(),t=16,n=new Uint8Array(16),r=(0,e.u32)(n),i=225,o=(I,b,g,w)=>{const B=w&1;return{s3:g<<31|w>>>1,s2:b<<31|g>>>1,s1:I<<31|b>>>1,s0:I>>>1^i<<24&-(B&1)}},s=I=>(I>>>0&255)<<24|(I>>>8&255)<<16|(I>>>16&255)<<8|I>>>24&255|0;function a(I){I.reverse();const b=I[15]&1;let g=0;for(let w=0;w<I.length;w++){const B=I[w];I[w]=B>>>1|g,g=(B&1)<<7}return I[0]^=-b&225,I}const d=I=>I>64*1024?8:I>1024?4:2;class u{constructor(b,g){this.blockLen=t,this.outputLen=t,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,b=(0,e.toBytes)(b),(0,e.abytes)(b,16);const w=(0,e.createView)(b);let B=w.getUint32(0,!1),T=w.getUint32(4,!1),H=w.getUint32(8,!1),N=w.getUint32(12,!1);const X=[];for(let J=0;J<128;J++)X.push({s0:s(B),s1:s(T),s2:s(H),s3:s(N)}),{s0:B,s1:T,s2:H,s3:N}=o(B,T,H,N);const P=d(g||1024);if(![1,2,4,8].includes(P))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=P;const q=128/P,W=this.windowSize=2**P,K=[];for(let J=0;J<q;J++)for(let te=0;te<W;te++){let ne=0,Y=0,Q=0,v=0;for(let D=0;D<P;D++){if(!(te>>>P-D-1&1))continue;const{s0:S,s1:C,s2:V,s3:f}=X[P*J+D];ne^=S,Y^=C,Q^=V,v^=f}K.push({s0:ne,s1:Y,s2:Q,s3:v})}this.t=K}_updateBlock(b,g,w,B){b^=this.s0,g^=this.s1,w^=this.s2,B^=this.s3;const{W:T,t:H,windowSize:N}=this;let X=0,P=0,F=0,q=0;const W=(1<<T)-1;let K=0;for(const J of[b,g,w,B])for(let te=0;te<4;te++){const ne=J>>>8*te&255;for(let Y=8/T-1;Y>=0;Y--){const Q=ne>>>T*Y&W,{s0:v,s1:D,s2:x,s3:S}=H[K*N+Q];X^=v,P^=D,F^=x,q^=S,K+=1}}this.s0=X,this.s1=P,this.s2=F,this.s3=q}update(b){(0,e.aexists)(this),b=(0,e.toBytes)(b),(0,e.abytes)(b);const g=(0,e.u32)(b),w=Math.floor(b.length/t),B=b.length%t;for(let T=0;T<w;T++)this._updateBlock(g[T*4+0],g[T*4+1],g[T*4+2],g[T*4+3]);return B&&(n.set(b.subarray(w*t)),this._updateBlock(r[0],r[1],r[2],r[3]),(0,e.clean)(r)),this}destroy(){const{t:b}=this;for(const g of b)g.s0=0,g.s1=0,g.s2=0,g.s3=0}digestInto(b){(0,e.aexists)(this),(0,e.aoutput)(b,this),this.finished=!0;const{s0:g,s1:w,s2:B,s3:T}=this,H=(0,e.u32)(b);return H[0]=g,H[1]=w,H[2]=B,H[3]=T,b}digest(){const b=new Uint8Array(t);return this.digestInto(b),this.destroy(),b}}class p extends u{constructor(b,g){b=(0,e.toBytes)(b),(0,e.abytes)(b);const w=a((0,e.copyBytes)(b));super(w,g),(0,e.clean)(w)}update(b){b=(0,e.toBytes)(b),(0,e.aexists)(this);const g=(0,e.u32)(b),w=b.length%t,B=Math.floor(b.length/t);for(let T=0;T<B;T++)this._updateBlock(s(g[T*4+3]),s(g[T*4+2]),s(g[T*4+1]),s(g[T*4+0]));return w&&(n.set(b.subarray(B*t)),this._updateBlock(s(r[3]),s(r[2]),s(r[1]),s(r[0])),(0,e.clean)(r)),this}digestInto(b){(0,e.aexists)(this),(0,e.aoutput)(b,this),this.finished=!0;const{s0:g,s1:w,s2:B,s3:T}=this,H=(0,e.u32)(b);return H[0]=g,H[1]=w,H[2]=B,H[3]=T,b.reverse()}}function h(I){const b=(w,B)=>I(B,w.length).update((0,e.toBytes)(w)).digest(),g=I(new Uint8Array(16),0);return b.outputLen=g.outputLen,b.blockLen=g.blockLen,b.create=(w,B)=>I(w,B),b}return wt.ghash=h((I,b)=>new u(I,b)),wt.polyval=h((I,b)=>new p(I,b)),wt}var aa;function _h(){return aa||(aa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unsafe=e.aeskwp=e.aeskw=e.siv=e.gcmsiv=e.gcm=e.cfb=e.cbc=e.ecb=e.ctr=void 0;const t=mh(),n=Xe(),r=16,i=4,o=new Uint8Array(r),s=283;function a(y){return y<<1^s&-(y>>7)}function d(y,m){let E=0;for(;m>0;m>>=1)E^=y&-(m&1),y=a(y);return E}const u=(()=>{const y=new Uint8Array(256);for(let E=0,A=1;E<256;E++,A^=a(A))y[E]=A;const m=new Uint8Array(256);m[0]=99;for(let E=0;E<255;E++){let A=y[255-E];A|=A<<8,m[y[E]]=(A^A>>4^A>>5^A>>6^A>>7^99)&255}return(0,n.clean)(y),m})(),p=u.map((y,m)=>u.indexOf(m)),h=y=>y<<24|y>>>8,I=y=>y<<8|y>>>24,b=y=>y<<24&4278190080|y<<8&16711680|y>>>8&65280|y>>>24&255;function g(y,m){if(y.length!==256)throw new Error("Wrong sbox length");const E=new Uint32Array(256).map((j,Z)=>m(y[Z])),A=E.map(I),M=A.map(I),z=M.map(I),O=new Uint32Array(256*256),k=new Uint32Array(256*256),U=new Uint16Array(256*256);for(let j=0;j<256;j++)for(let Z=0;Z<256;Z++){const R=j*256+Z;O[R]=E[j]^A[Z],k[R]=M[j]^z[Z],U[R]=y[j]<<8|y[Z]}return{sbox:y,sbox2:U,T0:E,T1:A,T2:M,T3:z,T01:O,T23:k}}const w=g(u,y=>d(y,3)<<24|y<<16|y<<8|d(y,2)),B=g(p,y=>d(y,11)<<24|d(y,13)<<16|d(y,9)<<8|d(y,14)),T=(()=>{const y=new Uint8Array(16);for(let m=0,E=1;m<16;m++,E=a(E))y[m]=E;return y})();function H(y){(0,n.abytes)(y);const m=y.length;if(![16,24,32].includes(m))throw new Error("aes: invalid key size, should be 16, 24 or 32, got "+m);const{sbox2:E}=w,A=[];(0,n.isAligned32)(y)||A.push(y=(0,n.copyBytes)(y));const M=(0,n.u32)(y),z=M.length,O=U=>P(E,U,U,U,U),k=new Uint32Array(m+28);k.set(M);for(let U=z;U<k.length;U++){let j=k[U-1];U%z===0?j=O(h(j))^T[U/z-1]:z>6&&U%z===4&&(j=O(j)),k[U]=k[U-z]^j}return(0,n.clean)(...A),k}function N(y){const m=H(y),E=m.slice(),A=m.length,{sbox2:M}=w,{T0:z,T1:O,T2:k,T3:U}=B;for(let j=0;j<A;j+=4)for(let Z=0;Z<4;Z++)E[j+Z]=m[A-j-4+Z];(0,n.clean)(m);for(let j=4;j<A-4;j++){const Z=E[j],R=P(M,Z,Z,Z,Z);E[j]=z[R&255]^O[R>>>8&255]^k[R>>>16&255]^U[R>>>24]}return E}function X(y,m,E,A,M,z){return y[E<<8&65280|A>>>8&255]^m[M>>>8&65280|z>>>24&255]}function P(y,m,E,A,M){return y[m&255|E&65280]|y[A>>>16&255|M>>>16&65280]<<16}function F(y,m,E,A,M){const{sbox2:z,T01:O,T23:k}=w;let U=0;m^=y[U++],E^=y[U++],A^=y[U++],M^=y[U++];const j=y.length/4-2;for(let se=0;se<j;se++){const ue=y[U++]^X(O,k,m,E,A,M),de=y[U++]^X(O,k,E,A,M,m),he=y[U++]^X(O,k,A,M,m,E),fe=y[U++]^X(O,k,M,m,E,A);m=ue,E=de,A=he,M=fe}const Z=y[U++]^P(z,m,E,A,M),R=y[U++]^P(z,E,A,M,m),G=y[U++]^P(z,A,M,m,E),oe=y[U++]^P(z,M,m,E,A);return{s0:Z,s1:R,s2:G,s3:oe}}function q(y,m,E,A,M){const{sbox2:z,T01:O,T23:k}=B;let U=0;m^=y[U++],E^=y[U++],A^=y[U++],M^=y[U++];const j=y.length/4-2;for(let se=0;se<j;se++){const ue=y[U++]^X(O,k,m,M,A,E),de=y[U++]^X(O,k,E,m,M,A),he=y[U++]^X(O,k,A,E,m,M),fe=y[U++]^X(O,k,M,A,E,m);m=ue,E=de,A=he,M=fe}const Z=y[U++]^P(z,m,M,A,E),R=y[U++]^P(z,E,m,M,A),G=y[U++]^P(z,A,E,m,M),oe=y[U++]^P(z,M,A,E,m);return{s0:Z,s1:R,s2:G,s3:oe}}function W(y,m,E,A){(0,n.abytes)(m,r),(0,n.abytes)(E);const M=E.length;A=(0,n.getOutput)(M,A),(0,n.complexOverlapBytes)(E,A);const z=m,O=(0,n.u32)(z);let{s0:k,s1:U,s2:j,s3:Z}=F(y,O[0],O[1],O[2],O[3]);const R=(0,n.u32)(E),G=(0,n.u32)(A);for(let se=0;se+4<=R.length;se+=4){G[se+0]=R[se+0]^k,G[se+1]=R[se+1]^U,G[se+2]=R[se+2]^j,G[se+3]=R[se+3]^Z;let ue=1;for(let de=z.length-1;de>=0;de--)ue=ue+(z[de]&255)|0,z[de]=ue&255,ue>>>=8;({s0:k,s1:U,s2:j,s3:Z}=F(y,O[0],O[1],O[2],O[3]))}const oe=r*Math.floor(R.length/i);if(oe<M){const se=new Uint32Array([k,U,j,Z]),ue=(0,n.u8)(se);for(let de=oe,he=0;de<M;de++,he++)A[de]=E[de]^ue[he];(0,n.clean)(se)}return A}function K(y,m,E,A,M){(0,n.abytes)(E,r),(0,n.abytes)(A),M=(0,n.getOutput)(A.length,M);const z=E,O=(0,n.u32)(z),k=(0,n.createView)(z),U=(0,n.u32)(A),j=(0,n.u32)(M),Z=m?0:12,R=A.length;let G=k.getUint32(Z,m),{s0:oe,s1:se,s2:ue,s3:de}=F(y,O[0],O[1],O[2],O[3]);for(let fe=0;fe+4<=U.length;fe+=4)j[fe+0]=U[fe+0]^oe,j[fe+1]=U[fe+1]^se,j[fe+2]=U[fe+2]^ue,j[fe+3]=U[fe+3]^de,G=G+1>>>0,k.setUint32(Z,G,m),{s0:oe,s1:se,s2:ue,s3:de}=F(y,O[0],O[1],O[2],O[3]);const he=r*Math.floor(U.length/i);if(he<R){const fe=new Uint32Array([oe,se,ue,de]),Ee=(0,n.u8)(fe);for(let ye=he,pe=0;ye<R;ye++,pe++)M[ye]=A[ye]^Ee[pe];(0,n.clean)(fe)}return M}e.ctr=(0,n.wrapCipher)({blockSize:16,nonceLength:16},function(m,E){function A(M,z){if((0,n.abytes)(M),z!==void 0&&((0,n.abytes)(z),!(0,n.isAligned32)(z)))throw new Error("unaligned destination");const O=H(m),k=(0,n.copyBytes)(E),U=[O,k];(0,n.isAligned32)(M)||U.push(M=(0,n.copyBytes)(M));const j=W(O,k,M,z);return(0,n.clean)(...U),j}return{encrypt:(M,z)=>A(M,z),decrypt:(M,z)=>A(M,z)}});function J(y){if((0,n.abytes)(y),y.length%r!==0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size "+r)}function te(y,m,E){(0,n.abytes)(y);let A=y.length;const M=A%r;if(!m&&M!==0)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");(0,n.isAligned32)(y)||(y=(0,n.copyBytes)(y));const z=(0,n.u32)(y);if(m){let k=r-M;k||(k=r),A=A+k}E=(0,n.getOutput)(A,E),(0,n.complexOverlapBytes)(y,E);const O=(0,n.u32)(E);return{b:z,o:O,out:E}}function ne(y,m){if(!m)return y;const E=y.length;if(!E)throw new Error("aes/pcks5: empty ciphertext not allowed");const A=y[E-1];if(A<=0||A>16)throw new Error("aes/pcks5: wrong padding");const M=y.subarray(0,-A);for(let z=0;z<A;z++)if(y[E-z-1]!==A)throw new Error("aes/pcks5: wrong padding");return M}function Y(y){const m=new Uint8Array(16),E=(0,n.u32)(m);m.set(y);const A=r-y.length;for(let M=r-A;M<r;M++)m[M]=A;return E}e.ecb=(0,n.wrapCipher)({blockSize:16},function(m,E={}){const A=!E.disablePadding;return{encrypt(M,z){const{b:O,o:k,out:U}=te(M,A,z),j=H(m);let Z=0;for(;Z+4<=O.length;){const{s0:R,s1:G,s2:oe,s3:se}=F(j,O[Z+0],O[Z+1],O[Z+2],O[Z+3]);k[Z++]=R,k[Z++]=G,k[Z++]=oe,k[Z++]=se}if(A){const R=Y(M.subarray(Z*4)),{s0:G,s1:oe,s2:se,s3:ue}=F(j,R[0],R[1],R[2],R[3]);k[Z++]=G,k[Z++]=oe,k[Z++]=se,k[Z++]=ue}return(0,n.clean)(j),U},decrypt(M,z){J(M);const O=N(m);z=(0,n.getOutput)(M.length,z);const k=[O];(0,n.isAligned32)(M)||k.push(M=(0,n.copyBytes)(M)),(0,n.complexOverlapBytes)(M,z);const U=(0,n.u32)(M),j=(0,n.u32)(z);for(let Z=0;Z+4<=U.length;){const{s0:R,s1:G,s2:oe,s3:se}=q(O,U[Z+0],U[Z+1],U[Z+2],U[Z+3]);j[Z++]=R,j[Z++]=G,j[Z++]=oe,j[Z++]=se}return(0,n.clean)(...k),ne(z,A)}}}),e.cbc=(0,n.wrapCipher)({blockSize:16,nonceLength:16},function(m,E,A={}){const M=!A.disablePadding;return{encrypt(z,O){const k=H(m),{b:U,o:j,out:Z}=te(z,M,O);let R=E;const G=[k];(0,n.isAligned32)(R)||G.push(R=(0,n.copyBytes)(R));const oe=(0,n.u32)(R);let se=oe[0],ue=oe[1],de=oe[2],he=oe[3],fe=0;for(;fe+4<=U.length;)se^=U[fe+0],ue^=U[fe+1],de^=U[fe+2],he^=U[fe+3],{s0:se,s1:ue,s2:de,s3:he}=F(k,se,ue,de,he),j[fe++]=se,j[fe++]=ue,j[fe++]=de,j[fe++]=he;if(M){const Ee=Y(z.subarray(fe*4));se^=Ee[0],ue^=Ee[1],de^=Ee[2],he^=Ee[3],{s0:se,s1:ue,s2:de,s3:he}=F(k,se,ue,de,he),j[fe++]=se,j[fe++]=ue,j[fe++]=de,j[fe++]=he}return(0,n.clean)(...G),Z},decrypt(z,O){J(z);const k=N(m);let U=E;const j=[k];(0,n.isAligned32)(U)||j.push(U=(0,n.copyBytes)(U));const Z=(0,n.u32)(U);O=(0,n.getOutput)(z.length,O),(0,n.isAligned32)(z)||j.push(z=(0,n.copyBytes)(z)),(0,n.complexOverlapBytes)(z,O);const R=(0,n.u32)(z),G=(0,n.u32)(O);let oe=Z[0],se=Z[1],ue=Z[2],de=Z[3];for(let he=0;he+4<=R.length;){const fe=oe,Ee=se,ye=ue,pe=de;oe=R[he+0],se=R[he+1],ue=R[he+2],de=R[he+3];const{s0:le,s1:ae,s2:ce,s3:_}=q(k,oe,se,ue,de);G[he++]=le^fe,G[he++]=ae^Ee,G[he++]=ce^ye,G[he++]=_^pe}return(0,n.clean)(...j),ne(O,M)}}}),e.cfb=(0,n.wrapCipher)({blockSize:16,nonceLength:16},function(m,E){function A(M,z,O){(0,n.abytes)(M);const k=M.length;if(O=(0,n.getOutput)(k,O),(0,n.overlapBytes)(M,O))throw new Error("overlapping src and dst not supported.");const U=H(m);let j=E;const Z=[U];(0,n.isAligned32)(j)||Z.push(j=(0,n.copyBytes)(j)),(0,n.isAligned32)(M)||Z.push(M=(0,n.copyBytes)(M));const R=(0,n.u32)(M),G=(0,n.u32)(O),oe=z?G:R,se=(0,n.u32)(j);let ue=se[0],de=se[1],he=se[2],fe=se[3];for(let ye=0;ye+4<=R.length;){const{s0:pe,s1:le,s2:ae,s3:ce}=F(U,ue,de,he,fe);G[ye+0]=R[ye+0]^pe,G[ye+1]=R[ye+1]^le,G[ye+2]=R[ye+2]^ae,G[ye+3]=R[ye+3]^ce,ue=oe[ye++],de=oe[ye++],he=oe[ye++],fe=oe[ye++]}const Ee=r*Math.floor(R.length/i);if(Ee<k){({s0:ue,s1:de,s2:he,s3:fe}=F(U,ue,de,he,fe));const ye=(0,n.u8)(new Uint32Array([ue,de,he,fe]));for(let pe=Ee,le=0;pe<k;pe++,le++)O[pe]=M[pe]^ye[le];(0,n.clean)(ye)}return(0,n.clean)(...Z),O}return{encrypt:(M,z)=>A(M,!0,z),decrypt:(M,z)=>A(M,!1,z)}});function Q(y,m,E,A,M){const z=M?M.length:0,O=y.create(E,A.length+z);M&&O.update(M);const k=(0,n.u64Lengths)(8*A.length,8*z,m);O.update(A),O.update(k);const U=O.digest();return(0,n.clean)(k),U}e.gcm=(0,n.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(m,E,A){if(E.length<8)throw new Error("aes/gcm: invalid nonce length");const M=16;function z(k,U,j){const Z=Q(t.ghash,!1,k,j,A);for(let R=0;R<U.length;R++)Z[R]^=U[R];return Z}function O(){const k=H(m),U=o.slice(),j=o.slice();if(K(k,!1,j,j,U),E.length===12)j.set(E);else{const R=o.slice(),G=(0,n.createView)(R);(0,n.setBigUint64)(G,8,BigInt(E.length*8),!1);const oe=t.ghash.create(U).update(E).update(R);oe.digestInto(j),oe.destroy()}const Z=K(k,!1,j,o);return{xk:k,authKey:U,counter:j,tagMask:Z}}return{encrypt(k){const{xk:U,authKey:j,counter:Z,tagMask:R}=O(),G=new Uint8Array(k.length+M),oe=[U,j,Z,R];(0,n.isAligned32)(k)||oe.push(k=(0,n.copyBytes)(k)),K(U,!1,Z,k,G.subarray(0,k.length));const se=z(j,R,G.subarray(0,G.length-M));return oe.push(se),G.set(se,k.length),(0,n.clean)(...oe),G},decrypt(k){const{xk:U,authKey:j,counter:Z,tagMask:R}=O(),G=[U,j,R,Z];(0,n.isAligned32)(k)||G.push(k=(0,n.copyBytes)(k));const oe=k.subarray(0,-M),se=k.subarray(-M),ue=z(j,R,oe);if(G.push(ue),!(0,n.equalBytes)(ue,se))throw new Error("aes/gcm: invalid ghash tag");const de=K(U,!1,Z,oe);return(0,n.clean)(...G),de}}});const v=(y,m,E)=>A=>{if(!Number.isSafeInteger(A)||m>A||A>E){const M="["+m+".."+E+"]";throw new Error(""+y+": expected value in range "+M+", got "+A)}};e.gcmsiv=(0,n.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(m,E,A){const z=v("AAD",0,68719476736),O=v("plaintext",0,2**36),k=v("nonce",12,12),U=v("ciphertext",16,2**36+16);(0,n.abytes)(m,16,24,32),k(E.length),A!==void 0&&z(A.length);function j(){const G=H(m),oe=new Uint8Array(m.length),se=new Uint8Array(16),ue=[G,oe];let de=E;(0,n.isAligned32)(de)||ue.push(de=(0,n.copyBytes)(de));const he=(0,n.u32)(de);let fe=0,Ee=he[0],ye=he[1],pe=he[2],le=0;for(const ce of[se,oe].map(n.u32)){const _=(0,n.u32)(ce);for(let c=0;c<_.length;c+=2){const{s0:l,s1:L}=F(G,fe,Ee,ye,pe);_[c+0]=l,_[c+1]=L,fe=++le}}const ae={authKey:se,encKey:H(oe)};return(0,n.clean)(...ue),ae}function Z(G,oe,se){const ue=Q(t.polyval,!0,oe,se,A);for(let pe=0;pe<12;pe++)ue[pe]^=E[pe];ue[15]&=127;const de=(0,n.u32)(ue);let he=de[0],fe=de[1],Ee=de[2],ye=de[3];return{s0:he,s1:fe,s2:Ee,s3:ye}=F(G,he,fe,Ee,ye),de[0]=he,de[1]=fe,de[2]=Ee,de[3]=ye,ue}function R(G,oe,se){let ue=(0,n.copyBytes)(oe);ue[15]|=128;const de=K(G,!0,ue,se);return(0,n.clean)(ue),de}return{encrypt(G){O(G.length);const{encKey:oe,authKey:se}=j(),ue=Z(oe,se,G),de=[oe,se,ue];(0,n.isAligned32)(G)||de.push(G=(0,n.copyBytes)(G));const he=new Uint8Array(G.length+16);return he.set(ue,G.length),he.set(R(oe,ue,G)),(0,n.clean)(...de),he},decrypt(G){U(G.length);const oe=G.subarray(-16),{encKey:se,authKey:ue}=j(),de=[se,ue];(0,n.isAligned32)(G)||de.push(G=(0,n.copyBytes)(G));const he=R(se,oe,G.subarray(0,-16)),fe=Z(se,ue,he);if(de.push(fe),!(0,n.equalBytes)(oe,fe))throw(0,n.clean)(...de),new Error("invalid polyval tag");return(0,n.clean)(...de),he}}}),e.siv=e.gcmsiv;function D(y){return y instanceof Uint32Array||ArrayBuffer.isView(y)&&y.constructor.name==="Uint32Array"}function x(y,m){if((0,n.abytes)(m,16),!D(y))throw new Error("_encryptBlock accepts result of expandKeyLE");const E=(0,n.u32)(m);let{s0:A,s1:M,s2:z,s3:O}=F(y,E[0],E[1],E[2],E[3]);return E[0]=A,E[1]=M,E[2]=z,E[3]=O,m}function S(y,m){if((0,n.abytes)(m,16),!D(y))throw new Error("_decryptBlock accepts result of expandKeyLE");const E=(0,n.u32)(m);let{s0:A,s1:M,s2:z,s3:O}=q(y,E[0],E[1],E[2],E[3]);return E[0]=A,E[1]=M,E[2]=z,E[3]=O,m}const C={encrypt(y,m){if(m.length>=2**32)throw new Error("plaintext should be less than 4gb");const E=H(y);if(m.length===16)x(E,m);else{const A=(0,n.u32)(m);let M=A[0],z=A[1];for(let O=0,k=1;O<6;O++)for(let U=2;U<A.length;U+=2,k++){const{s0:j,s1:Z,s2:R,s3:G}=F(E,M,z,A[U],A[U+1]);M=j,z=Z^b(k),A[U]=R,A[U+1]=G}A[0]=M,A[1]=z}E.fill(0)},decrypt(y,m){if(m.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");const E=N(y),A=m.length/8-1;if(A===1)S(E,m);else{const M=(0,n.u32)(m);let z=M[0],O=M[1];for(let k=0,U=A*6;k<6;k++)for(let j=A*2;j>=1;j-=2,U--){O^=b(U);const{s0:Z,s1:R,s2:G,s3:oe}=q(E,z,O,M[j],M[j+1]);z=Z,O=R,M[j]=G,M[j+1]=oe}M[0]=z,M[1]=O}E.fill(0)}},V=new Uint8Array(8).fill(166);e.aeskw=(0,n.wrapCipher)({blockSize:8},y=>({encrypt(m){if(!m.length||m.length%8!==0)throw new Error("invalid plaintext length");if(m.length===8)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");const E=(0,n.concatBytes)(V,m);return C.encrypt(y,E),E},decrypt(m){if(m.length%8!==0||m.length<24)throw new Error("invalid ciphertext length");const E=(0,n.copyBytes)(m);if(C.decrypt(y,E),!(0,n.equalBytes)(E.subarray(0,8),V))throw new Error("integrity check failed");return E.subarray(0,8).fill(0),E.subarray(8)}}));const f=2790873510;e.aeskwp=(0,n.wrapCipher)({blockSize:8},y=>({encrypt(m){if(!m.length)throw new Error("invalid plaintext length");const E=Math.ceil(m.length/8)*8,A=new Uint8Array(8+E);A.set(m,8);const M=(0,n.u32)(A);return M[0]=f,M[1]=b(m.length),C.encrypt(y,A),A},decrypt(m){if(m.length<16)throw new Error("invalid ciphertext length");const E=(0,n.copyBytes)(m),A=(0,n.u32)(E);C.decrypt(y,E);const M=b(A[1])>>>0,z=Math.ceil(M/8)*8;if(A[0]!==f||E.length-8!==z)throw new Error("integrity check failed");for(let O=M;O<z;O++)if(E[8+O]!==0)throw new Error("integrity check failed");return E.subarray(0,8).fill(0),E.subarray(8,8+M)}})),e.unsafe={expandKeyLE:H,expandKeyDecLE:N,encrypt:F,decrypt:q,encryptBlock:x,decryptBlock:S,ctrCounter:W,ctr32:K}})(mi)),mi}var ca;function bh(){if(ca)return Tt;ca=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.aes256cbc=Tt.aes256gcm=void 0;var e=_h(),t=function(r,i,o){return(0,e.gcm)(r,i,o)};Tt.aes256gcm=t;var n=function(r,i,o){return(0,e.cbc)(r,i)};return Tt.aes256cbc=n,Tt}var Ot={},_i={},vn={},la;function wh(){if(la)return vn;la=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.rotl=s,vn.createCipher=b;const e=Xe(),t=g=>Uint8Array.from(g.split("").map(w=>w.charCodeAt(0))),n=t("expand 16-byte k"),r=t("expand 32-byte k"),i=(0,e.u32)(n),o=(0,e.u32)(r);function s(g,w){return g<<w|g>>>32-w}function a(g){return g.byteOffset%4===0}const d=64,u=16,p=2**32-1,h=new Uint32Array;function I(g,w,B,T,H,N,X,P){const F=H.length,q=new Uint8Array(d),W=(0,e.u32)(q),K=a(H)&&a(N),J=K?(0,e.u32)(H):h,te=K?(0,e.u32)(N):h;for(let ne=0;ne<F;X++){if(g(w,B,T,W,X,P),X>=p)throw new Error("arx: counter overflow");const Y=Math.min(d,F-ne);if(K&&Y===d){const Q=ne/4;if(ne%4!==0)throw new Error("arx: invalid block position");for(let v=0,D;v<u;v++)D=Q+v,te[D]=J[D]^W[v];ne+=d;continue}for(let Q=0,v;Q<Y;Q++)v=ne+Q,N[v]=H[v]^q[Q];ne+=Y}}function b(g,w){const{allowShortKeys:B,extendNonceFn:T,counterLength:H,counterRight:N,rounds:X}=(0,e.checkOpts)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},w);if(typeof g!="function")throw new Error("core must be a function");return(0,e.anumber)(H),(0,e.anumber)(X),(0,e.abool)(N),(0,e.abool)(B),(P,F,q,W,K=0)=>{(0,e.abytes)(P),(0,e.abytes)(F),(0,e.abytes)(q);const J=q.length;if(W===void 0&&(W=new Uint8Array(J)),(0,e.abytes)(W),(0,e.anumber)(K),K<0||K>=p)throw new Error("arx: counter overflow");if(W.length<J)throw new Error(`arx: output (${W.length}) is shorter than data (${J})`);const te=[];let ne=P.length,Y,Q;if(ne===32)te.push(Y=(0,e.copyBytes)(P)),Q=o;else if(ne===16&&B)Y=new Uint8Array(32),Y.set(P),Y.set(P,16),Q=i,te.push(Y);else throw new Error(`arx: invalid 32-byte key, got length=${ne}`);a(F)||te.push(F=(0,e.copyBytes)(F));const v=(0,e.u32)(Y);if(T){if(F.length!==24)throw new Error("arx: extended nonce must be 24 bytes");T(Q,v,(0,e.u32)(F.subarray(0,16)),v),F=F.subarray(16)}const D=16-H;if(D!==F.length)throw new Error(`arx: nonce must be ${D} or 16 bytes`);if(D!==12){const S=new Uint8Array(12);S.set(F,N?0:12-F.length),F=S,te.push(F)}const x=(0,e.u32)(F);return I(g,Q,v,x,q,W,K,X),(0,e.clean)(...te),W}}return vn}var Zt={},ua;function vh(){if(ua)return Zt;ua=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.poly1305=void 0,Zt.wrapConstructorWithKey=r;const e=Xe(),t=(i,o)=>i[o++]&255|(i[o++]&255)<<8;class n{constructor(o){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,o=(0,e.toBytes)(o),(0,e.abytes)(o,32);const s=t(o,0),a=t(o,2),d=t(o,4),u=t(o,6),p=t(o,8),h=t(o,10),I=t(o,12),b=t(o,14);this.r[0]=s&8191,this.r[1]=(s>>>13|a<<3)&8191,this.r[2]=(a>>>10|d<<6)&7939,this.r[3]=(d>>>7|u<<9)&8191,this.r[4]=(u>>>4|p<<12)&255,this.r[5]=p>>>1&8190,this.r[6]=(p>>>14|h<<2)&8191,this.r[7]=(h>>>11|I<<5)&8065,this.r[8]=(I>>>8|b<<8)&8191,this.r[9]=b>>>5&127;for(let g=0;g<8;g++)this.pad[g]=t(o,16+2*g)}process(o,s,a=!1){const d=a?0:2048,{h:u,r:p}=this,h=p[0],I=p[1],b=p[2],g=p[3],w=p[4],B=p[5],T=p[6],H=p[7],N=p[8],X=p[9],P=t(o,s+0),F=t(o,s+2),q=t(o,s+4),W=t(o,s+6),K=t(o,s+8),J=t(o,s+10),te=t(o,s+12),ne=t(o,s+14);let Y=u[0]+(P&8191),Q=u[1]+((P>>>13|F<<3)&8191),v=u[2]+((F>>>10|q<<6)&8191),D=u[3]+((q>>>7|W<<9)&8191),x=u[4]+((W>>>4|K<<12)&8191),S=u[5]+(K>>>1&8191),C=u[6]+((K>>>14|J<<2)&8191),V=u[7]+((J>>>11|te<<5)&8191),f=u[8]+((te>>>8|ne<<8)&8191),y=u[9]+(ne>>>5|d),m=0,E=m+Y*h+Q*(5*X)+v*(5*N)+D*(5*H)+x*(5*T);m=E>>>13,E&=8191,E+=S*(5*B)+C*(5*w)+V*(5*g)+f*(5*b)+y*(5*I),m+=E>>>13,E&=8191;let A=m+Y*I+Q*h+v*(5*X)+D*(5*N)+x*(5*H);m=A>>>13,A&=8191,A+=S*(5*T)+C*(5*B)+V*(5*w)+f*(5*g)+y*(5*b),m+=A>>>13,A&=8191;let M=m+Y*b+Q*I+v*h+D*(5*X)+x*(5*N);m=M>>>13,M&=8191,M+=S*(5*H)+C*(5*T)+V*(5*B)+f*(5*w)+y*(5*g),m+=M>>>13,M&=8191;let z=m+Y*g+Q*b+v*I+D*h+x*(5*X);m=z>>>13,z&=8191,z+=S*(5*N)+C*(5*H)+V*(5*T)+f*(5*B)+y*(5*w),m+=z>>>13,z&=8191;let O=m+Y*w+Q*g+v*b+D*I+x*h;m=O>>>13,O&=8191,O+=S*(5*X)+C*(5*N)+V*(5*H)+f*(5*T)+y*(5*B),m+=O>>>13,O&=8191;let k=m+Y*B+Q*w+v*g+D*b+x*I;m=k>>>13,k&=8191,k+=S*h+C*(5*X)+V*(5*N)+f*(5*H)+y*(5*T),m+=k>>>13,k&=8191;let U=m+Y*T+Q*B+v*w+D*g+x*b;m=U>>>13,U&=8191,U+=S*I+C*h+V*(5*X)+f*(5*N)+y*(5*H),m+=U>>>13,U&=8191;let j=m+Y*H+Q*T+v*B+D*w+x*g;m=j>>>13,j&=8191,j+=S*b+C*I+V*h+f*(5*X)+y*(5*N),m+=j>>>13,j&=8191;let Z=m+Y*N+Q*H+v*T+D*B+x*w;m=Z>>>13,Z&=8191,Z+=S*g+C*b+V*I+f*h+y*(5*X),m+=Z>>>13,Z&=8191;let R=m+Y*X+Q*N+v*H+D*T+x*B;m=R>>>13,R&=8191,R+=S*w+C*g+V*b+f*I+y*h,m+=R>>>13,R&=8191,m=(m<<2)+m|0,m=m+E|0,E=m&8191,m=m>>>13,A+=m,u[0]=E,u[1]=A,u[2]=M,u[3]=z,u[4]=O,u[5]=k,u[6]=U,u[7]=j,u[8]=Z,u[9]=R}finalize(){const{h:o,pad:s}=this,a=new Uint16Array(10);let d=o[1]>>>13;o[1]&=8191;for(let h=2;h<10;h++)o[h]+=d,d=o[h]>>>13,o[h]&=8191;o[0]+=d*5,d=o[0]>>>13,o[0]&=8191,o[1]+=d,d=o[1]>>>13,o[1]&=8191,o[2]+=d,a[0]=o[0]+5,d=a[0]>>>13,a[0]&=8191;for(let h=1;h<10;h++)a[h]=o[h]+d,d=a[h]>>>13,a[h]&=8191;a[9]-=8192;let u=(d^1)-1;for(let h=0;h<10;h++)a[h]&=u;u=~u;for(let h=0;h<10;h++)o[h]=o[h]&u|a[h];o[0]=(o[0]|o[1]<<13)&65535,o[1]=(o[1]>>>3|o[2]<<10)&65535,o[2]=(o[2]>>>6|o[3]<<7)&65535,o[3]=(o[3]>>>9|o[4]<<4)&65535,o[4]=(o[4]>>>12|o[5]<<1|o[6]<<14)&65535,o[5]=(o[6]>>>2|o[7]<<11)&65535,o[6]=(o[7]>>>5|o[8]<<8)&65535,o[7]=(o[8]>>>8|o[9]<<5)&65535;let p=o[0]+s[0];o[0]=p&65535;for(let h=1;h<8;h++)p=(o[h]+s[h]|0)+(p>>>16)|0,o[h]=p&65535;(0,e.clean)(a)}update(o){(0,e.aexists)(this),o=(0,e.toBytes)(o),(0,e.abytes)(o);const{buffer:s,blockLen:a}=this,d=o.length;for(let u=0;u<d;){const p=Math.min(a-this.pos,d-u);if(p===a){for(;a<=d-u;u+=a)this.process(o,u);continue}s.set(o.subarray(u,u+p),this.pos),this.pos+=p,u+=p,this.pos===a&&(this.process(s,0,!1),this.pos=0)}return this}destroy(){(0,e.clean)(this.h,this.r,this.buffer,this.pad)}digestInto(o){(0,e.aexists)(this),(0,e.aoutput)(o,this),this.finished=!0;const{buffer:s,h:a}=this;let{pos:d}=this;if(d){for(s[d++]=1;d<16;d++)s[d]=0;this.process(s,0,!0)}this.finalize();let u=0;for(let p=0;p<8;p++)o[u++]=a[p]>>>0,o[u++]=a[p]>>>8;return o}digest(){const{buffer:o,outputLen:s}=this;this.digestInto(o);const a=o.slice(0,s);return this.destroy(),a}}function r(i){const o=(a,d)=>i(d).update((0,e.toBytes)(a)).digest(),s=i(new Uint8Array(32));return o.outputLen=s.outputLen,o.blockLen=s.blockLen,o.create=a=>i(a),o}return Zt.poly1305=r(i=>new n(i)),Zt}var da;function Eh(){return da||(da=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.xchacha20poly1305=e.chacha20poly1305=e._poly1305_aead=e.chacha12=e.chacha8=e.xchacha20=e.chacha20=e.chacha20orig=void 0,e.hchacha=o;const t=wh(),n=vh(),r=Xe();function i(h,I,b,g,w,B=20){let T=h[0],H=h[1],N=h[2],X=h[3],P=I[0],F=I[1],q=I[2],W=I[3],K=I[4],J=I[5],te=I[6],ne=I[7],Y=w,Q=b[0],v=b[1],D=b[2],x=T,S=H,C=N,V=X,f=P,y=F,m=q,E=W,A=K,M=J,z=te,O=ne,k=Y,U=Q,j=v,Z=D;for(let G=0;G<B;G+=2)x=x+f|0,k=(0,t.rotl)(k^x,16),A=A+k|0,f=(0,t.rotl)(f^A,12),x=x+f|0,k=(0,t.rotl)(k^x,8),A=A+k|0,f=(0,t.rotl)(f^A,7),S=S+y|0,U=(0,t.rotl)(U^S,16),M=M+U|0,y=(0,t.rotl)(y^M,12),S=S+y|0,U=(0,t.rotl)(U^S,8),M=M+U|0,y=(0,t.rotl)(y^M,7),C=C+m|0,j=(0,t.rotl)(j^C,16),z=z+j|0,m=(0,t.rotl)(m^z,12),C=C+m|0,j=(0,t.rotl)(j^C,8),z=z+j|0,m=(0,t.rotl)(m^z,7),V=V+E|0,Z=(0,t.rotl)(Z^V,16),O=O+Z|0,E=(0,t.rotl)(E^O,12),V=V+E|0,Z=(0,t.rotl)(Z^V,8),O=O+Z|0,E=(0,t.rotl)(E^O,7),x=x+y|0,Z=(0,t.rotl)(Z^x,16),z=z+Z|0,y=(0,t.rotl)(y^z,12),x=x+y|0,Z=(0,t.rotl)(Z^x,8),z=z+Z|0,y=(0,t.rotl)(y^z,7),S=S+m|0,k=(0,t.rotl)(k^S,16),O=O+k|0,m=(0,t.rotl)(m^O,12),S=S+m|0,k=(0,t.rotl)(k^S,8),O=O+k|0,m=(0,t.rotl)(m^O,7),C=C+E|0,U=(0,t.rotl)(U^C,16),A=A+U|0,E=(0,t.rotl)(E^A,12),C=C+E|0,U=(0,t.rotl)(U^C,8),A=A+U|0,E=(0,t.rotl)(E^A,7),V=V+f|0,j=(0,t.rotl)(j^V,16),M=M+j|0,f=(0,t.rotl)(f^M,12),V=V+f|0,j=(0,t.rotl)(j^V,8),M=M+j|0,f=(0,t.rotl)(f^M,7);let R=0;g[R++]=T+x|0,g[R++]=H+S|0,g[R++]=N+C|0,g[R++]=X+V|0,g[R++]=P+f|0,g[R++]=F+y|0,g[R++]=q+m|0,g[R++]=W+E|0,g[R++]=K+A|0,g[R++]=J+M|0,g[R++]=te+z|0,g[R++]=ne+O|0,g[R++]=Y+k|0,g[R++]=Q+U|0,g[R++]=v+j|0,g[R++]=D+Z|0}function o(h,I,b,g){let w=h[0],B=h[1],T=h[2],H=h[3],N=I[0],X=I[1],P=I[2],F=I[3],q=I[4],W=I[5],K=I[6],J=I[7],te=b[0],ne=b[1],Y=b[2],Q=b[3];for(let D=0;D<20;D+=2)w=w+N|0,te=(0,t.rotl)(te^w,16),q=q+te|0,N=(0,t.rotl)(N^q,12),w=w+N|0,te=(0,t.rotl)(te^w,8),q=q+te|0,N=(0,t.rotl)(N^q,7),B=B+X|0,ne=(0,t.rotl)(ne^B,16),W=W+ne|0,X=(0,t.rotl)(X^W,12),B=B+X|0,ne=(0,t.rotl)(ne^B,8),W=W+ne|0,X=(0,t.rotl)(X^W,7),T=T+P|0,Y=(0,t.rotl)(Y^T,16),K=K+Y|0,P=(0,t.rotl)(P^K,12),T=T+P|0,Y=(0,t.rotl)(Y^T,8),K=K+Y|0,P=(0,t.rotl)(P^K,7),H=H+F|0,Q=(0,t.rotl)(Q^H,16),J=J+Q|0,F=(0,t.rotl)(F^J,12),H=H+F|0,Q=(0,t.rotl)(Q^H,8),J=J+Q|0,F=(0,t.rotl)(F^J,7),w=w+X|0,Q=(0,t.rotl)(Q^w,16),K=K+Q|0,X=(0,t.rotl)(X^K,12),w=w+X|0,Q=(0,t.rotl)(Q^w,8),K=K+Q|0,X=(0,t.rotl)(X^K,7),B=B+P|0,te=(0,t.rotl)(te^B,16),J=J+te|0,P=(0,t.rotl)(P^J,12),B=B+P|0,te=(0,t.rotl)(te^B,8),J=J+te|0,P=(0,t.rotl)(P^J,7),T=T+F|0,ne=(0,t.rotl)(ne^T,16),q=q+ne|0,F=(0,t.rotl)(F^q,12),T=T+F|0,ne=(0,t.rotl)(ne^T,8),q=q+ne|0,F=(0,t.rotl)(F^q,7),H=H+N|0,Y=(0,t.rotl)(Y^H,16),W=W+Y|0,N=(0,t.rotl)(N^W,12),H=H+N|0,Y=(0,t.rotl)(Y^H,8),W=W+Y|0,N=(0,t.rotl)(N^W,7);let v=0;g[v++]=w,g[v++]=B,g[v++]=T,g[v++]=H,g[v++]=te,g[v++]=ne,g[v++]=Y,g[v++]=Q}e.chacha20orig=(0,t.createCipher)(i,{counterRight:!1,counterLength:8,allowShortKeys:!0}),e.chacha20=(0,t.createCipher)(i,{counterRight:!1,counterLength:4,allowShortKeys:!1}),e.xchacha20=(0,t.createCipher)(i,{counterRight:!1,counterLength:8,extendNonceFn:o,allowShortKeys:!1}),e.chacha8=(0,t.createCipher)(i,{counterRight:!1,counterLength:4,rounds:8}),e.chacha12=(0,t.createCipher)(i,{counterRight:!1,counterLength:4,rounds:12});const s=new Uint8Array(16),a=(h,I)=>{h.update(I);const b=I.length%16;b&&h.update(s.subarray(b))},d=new Uint8Array(32);function u(h,I,b,g,w){const B=h(I,b,d),T=n.poly1305.create(B);w&&a(T,w),a(T,g);const H=(0,r.u64Lengths)(g.length,w?w.length:0,!0);T.update(H);const N=T.digest();return(0,r.clean)(B,H),N}const p=h=>(I,b,g)=>({encrypt(B,T){const H=B.length;T=(0,r.getOutput)(H+16,T,!1),T.set(B);const N=T.subarray(0,-16);h(I,b,N,N,1);const X=u(h,I,b,N,g);return T.set(X,H),(0,r.clean)(X),T},decrypt(B,T){T=(0,r.getOutput)(B.length-16,T,!1);const H=B.subarray(0,-16),N=B.subarray(-16),X=u(h,I,b,H,g);if(!(0,r.equalBytes)(N,X))throw new Error("invalid tag");return T.set(B.subarray(0,-16)),h(I,b,T,T,1),(0,r.clean)(X),T}});e._poly1305_aead=p,e.chacha20poly1305=(0,r.wrapCipher)({blockSize:64,nonceLength:12,tagLength:16},(0,e._poly1305_aead)(e.chacha20)),e.xchacha20poly1305=(0,r.wrapCipher)({blockSize:64,nonceLength:24,tagLength:16},(0,e._poly1305_aead)(e.xchacha20))})(_i)),_i}var fa;function Sh(){if(fa)return Ot;fa=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.chacha20=Ot.xchacha20=void 0;var e=Eh(),t=function(r,i,o){return(0,e.xchacha20poly1305)(r,i,o)};Ot.xchacha20=t;var n=function(r,i,o){return(0,e.chacha20poly1305)(r,i,o)};return Ot.chacha20=n,Ot}var ha;function Bh(){return ha||(ha=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.aesDecrypt=e.aesEncrypt=e.symDecrypt=e.symEncrypt=void 0;var t=Xe(),n=ks(),r=bh(),i=Sh(),o=rr(),s=ti(),a=function(I,b,g){return u(p,I,b,g)};e.symEncrypt=a;var d=function(I,b,g){return u(h,I,b,g)};e.symDecrypt=d,e.aesEncrypt=e.symEncrypt,e.aesDecrypt=e.symDecrypt;function u(I,b,g,w){var B=(0,o.symmetricAlgorithm)();if(B==="aes-256-gcm")return I(r.aes256gcm,b,g,(0,o.symmetricNonceLength)(),s.AEAD_TAG_LENGTH,w);if(B==="xchacha20")return I(i.xchacha20,b,g,s.XCHACHA20_NONCE_LENGTH,s.AEAD_TAG_LENGTH,w);if(B==="aes-256-cbc")return I(r.aes256cbc,b,g,16,0);throw new Error("Not implemented")}function p(I,b,g,w,B,T){var H=(0,n.randomBytes)(w),N=I(b,H,T),X=N.encrypt(g);if(B===0)return(0,t.concatBytes)(H,X);var P=X.length-B,F=X.subarray(0,P),q=X.subarray(P);return(0,t.concatBytes)(H,q,F)}function h(I,b,g,w,B,T){var H=g.subarray(0,w),N=I(b,Uint8Array.from(H),T),X=g.subarray(w);if(B===0)return N.decrypt(X);var P=X.subarray(0,B),F=X.subarray(B);return N.decrypt((0,t.concatBytes)(F,P))}})(gi)),gi}var pa;function bi(){return pa||(pa=1,(function(e){var t=Lt&&Lt.__createBinding||(Object.create?(function(r,i,o,s){s===void 0&&(s=o);var a=Object.getOwnPropertyDescriptor(i,o);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,s,a)}):(function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]})),n=Lt&&Lt.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(ph(),e),n(gh(),e),n(na(),e),n(Bh(),e)})(Lt)),Lt}var En={},ya;function ga(){if(ya)return En;ya=1,Object.defineProperty(En,"__esModule",{value:!0}),En.PublicKey=void 0;var e=Xe(),t=bi(),n=(function(){function r(i,o){var s=(0,t.convertPublicKeyFormat)(i,!0,o),a=(0,t.convertPublicKeyFormat)(i,!1,o);this.data=s,this.dataUncompressed=s.length!==a.length?a:null}return r.fromHex=function(i,o){return new r((0,t.hexToPublicKey)(i,o),o)},Object.defineProperty(r.prototype,"_uncompressed",{get:function(){return this.dataUncompressed!==null?this.dataUncompressed:this.data},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uncompressed",{get:function(){return Buffer.from(this._uncompressed)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"compressed",{get:function(){return Buffer.from(this.data)},enumerable:!1,configurable:!0}),r.prototype.toBytes=function(i){return i===void 0&&(i=!0),i?this.data:this._uncompressed},r.prototype.toHex=function(i){return i===void 0&&(i=!0),(0,e.bytesToHex)(this.toBytes(i))},r.prototype.decapsulate=function(i,o){o===void 0&&(o=!1);var s=this.toBytes(o),a=i.multiply(this,o);return(0,t.getSharedKey)(s,a)},r.prototype.equals=function(i){return(0,e.equalBytes)(this.data,i.data)},r})();return En.PublicKey=n,En}var ma;function Ih(){if(ma)return mn;ma=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.PrivateKey=void 0;var e=Xe(),t=bi(),n=ga(),r=(function(){function i(o,s){if(this.curve=s,o===void 0)this.data=(0,t.getValidSecret)(s);else if((0,t.isValidPrivateKey)(o,s))this.data=o;else throw new Error("Invalid private key");this.publicKey=new n.PublicKey((0,t.getPublicKey)(this.data,s),s)}return i.fromHex=function(o,s){return new i((0,t.decodeHex)(o),s)},Object.defineProperty(i.prototype,"secret",{get:function(){return Buffer.from(this.data)},enumerable:!1,configurable:!0}),i.prototype.toHex=function(){return(0,e.bytesToHex)(this.data)},i.prototype.encapsulate=function(o,s){s===void 0&&(s=!1);var a=this.publicKey.toBytes(s),d=this.multiply(o,s);return(0,t.getSharedKey)(a,d)},i.prototype.multiply=function(o,s){return s===void 0&&(s=!1),(0,t.getSharedPoint)(this.data,o.toBytes(!0),s,this.curve)},i.prototype.equals=function(o){return(0,e.equalBytes)(this.data,o.data)},i})();return mn.PrivateKey=r,mn}var _a;function ba(){return _a||(_a=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.PrivateKey=void 0;var t=Ih();Object.defineProperty(e,"PrivateKey",{enumerable:!0,get:function(){return t.PrivateKey}});var n=ga();Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return n.PublicKey}})})(ni)),ni}var wa;function xh(){return wa||(wa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.PublicKey=e.PrivateKey=e.ECIES_CONFIG=void 0,e.encrypt=o,e.decrypt=a;var t=Xe(),n=rr(),r=ba(),i=bi();function o(h,I){return Buffer.from(s(h,I))}function s(h,I){var b=(0,n.ellipticCurve)(),g=new r.PrivateKey(void 0,b),w=h instanceof Uint8Array?new r.PublicKey(h,b):r.PublicKey.fromHex(h,b),B=g.encapsulate(w,(0,n.isHkdfKeyCompressed)()),T=g.publicKey.toBytes((0,n.isEphemeralKeyCompressed)()),H=(0,i.symEncrypt)(B,I);return(0,t.concatBytes)(T,H)}function a(h,I){return Buffer.from(d(h,I))}function d(h,I){var b=(0,n.ellipticCurve)(),g=h instanceof Uint8Array?new r.PrivateKey(h,b):r.PrivateKey.fromHex(h,b),w=(0,n.ephemeralKeySize)(),B=new r.PublicKey(I.subarray(0,w),b),T=I.subarray(w),H=B.decapsulate(g,(0,n.isHkdfKeyCompressed)());return(0,i.symDecrypt)(H,T)}var u=rr();Object.defineProperty(e,"ECIES_CONFIG",{enumerable:!0,get:function(){return u.ECIES_CONFIG}});var p=ba();Object.defineProperty(e,"PrivateKey",{enumerable:!0,get:function(){return p.PrivateKey}}),Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return p.PublicKey}}),e.utils={aesEncrypt:i.aesEncrypt,aesDecrypt:i.aesDecrypt,symEncrypt:i.symEncrypt,symDecrypt:i.symDecrypt,decodeHex:i.decodeHex,getValidSecret:i.getValidSecret,remove0x:i.remove0x}})(Jr)),Jr}var wi=xh();typeof globalThis.Buffer>"u"&&(globalThis.Buffer=ih.Buffer),wi.ECIES_CONFIG.ellipticCurve="secp256k1",wi.ECIES_CONFIG.symmetricAlgorithm="aes-256-gcm";const Lh=new TextEncoder;function Ah(e,t){return wi.encrypt(e,Lh.encode(t)).toString("hex")}const Ch=["CORE_SDK",...Yf()];async function va(e,t,n,r){if(!e||!t)throw new Error("appId and secret are required");try{const i=await Xf(),o=await Oh(n,r),{identifier:s,sdkVersion:a,...d}=o,u={"Content-Type":"text/plain",sdkVersion:a},p=Ph(i,{appId:e,secret:t,identifier:s,timestamp:Date.now(),products:Ch,...d}),h=await fetch(Go,{method:"POST",body:p,headers:u});if(!h.ok){const B=await h.json(),{code:T,message:H}=B;throw h.status===401&&T===7001005?(Bs(),new Error(H)):new Error(H||`HTTP error! status: ${h.status}`)}const I=await h.json(),{accessToken:b,expiresIn:g}=I,w=Date.now()+(g-90)*1e3;return{accessToken:b,expiredTime:w}}catch(i){throw i instanceof Error?new Error(`Failed to get access token: ${i.message}`,{cause:i}):new Error(`Failed to get access token: ${String(i)}`)}}const Th=typeof window<"u"&&window.location?.hostname?window.location.hostname:"restriction.test.example.com";async function Oh(e,t=Th){return e??Rh(t)}async function Rh(e){return{identifier:await xs(),origin:e,keyPlatform:"WEB",sdkVersion:yn.version}}function Ph(e,t){return Ah(e,JSON.stringify(t))}var Fh={value:()=>{}};function Wt(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new or(n)}function or(e){this._=e}function kh(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}or.prototype=Wt.prototype={constructor:or,on:function(e,t){var n=this._,r=kh(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=Mh(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=Ea(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ea(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new or(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function Mh(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ea(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Fh,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const vi="tokenUpdated",Hh={maxRetries:3,initialDelay:500};class nt{static instance;_appId="";_secret="";_platform;_accessToken="";_expiredTime=0;_version="";_identifier="";_webIdentifier="";_tokenGetter;_tokenPending=null;_dispatch=Wt(vi);_globalDispatcher;constructor(){}static getInstance(){return nt.instance||(nt.instance=new nt),nt.instance}async setAccessByAppKey(t){this._tokenGetter=this._fetchToken.bind(this);const{appId:n,secret:r,platform:i}=t;this._appId=n,this._secret=r,this._platform=i,this._version=i?.sdkVersion||yn.version,this._identifier=i?.identifier||await this.getWebIdentifier()}setTokenGetter(t){this._tokenGetter=t}async setupTokenManager(){if(!this._tokenGetter)throw new Error("getTokenAsync() is not set!");const{maxRetries:t,initialDelay:n}=Hh;let r=0;for(;r<=t;)try{const i=await this._tokenGetter();if(i){this._updateContext(i);return}}catch(i){if(r++,r>t)throw this._globalDispatcher.call("unauthorized"),i;await this._retryDelay(r,n)}}getSdkVersion(){return this._version||yn.version}async getIdentifier(){return this._identifier||await this.getWebIdentifier()}async getAccessToken(){if(this._accessToken&&!this._isTokenExpired)return this._accessToken;if(this._tokenPending)return this._tokenPending;if(!this._tokenGetter)throw new Error("Token getter not configured. Call setGetTokenAsync() first.");return this._tokenPending=this._tokenGetter().then(t=>(this._updateContext(t),this._dispatch.call(vi,null,t.accessToken),t.accessToken)).catch(t=>{throw this._tokenPending=null,t}).finally(()=>{this._tokenPending=null}),this._tokenPending}async getWebIdentifier(){if(!this._webIdentifier){const n=await(await Es.load()).get();this._webIdentifier=n.visitorId}return this._webIdentifier}on(t,n){return this._dispatch.on(t,n),{off:()=>this._dispatch.on(t,null)}}setGlobalDispatcher(t){this._globalDispatcher=t}getGlobalDispatcher(){return this._globalDispatcher}clearState(){this._appId="",this._secret="",this._platform=void 0,this._webIdentifier="",this._tokenPending=null,this._tokenGetter=void 0,this._accessToken="",this._expiredTime=0,this._version="",this._identifier=""}get _isTokenExpired(){return this._expiredTime<=Date.now()}_updateContext(t){const{accessToken:n,expiredTime:r,identifier:i,sdkVersion:o}=t;this._accessToken=n,this._expiredTime=r,i!==void 0&&(this._identifier=i),o!==void 0&&(this._version=o)}_fetchToken(){return va(this._appId,this._secret,this._platform)}async _retryDelay(t,n){const r=n*Math.pow(2,t-1);return console.warn(`Retrying in ${r} ms... (Attempt ${t})`),new Promise(i=>setTimeout(i,r))}}const sr=nt.getInstance();class st{static instance;_axios;_isRefreshingToken=!1;_retryCount=0;constructor(){this._axios=Pe.create({baseURL:zo}),this._setupInterceptors()}static getInstance(){return st.instance||(st.instance=new st),st.instance}async get(t){return this._axios.get(t)}async post(t,n){return this._axios.post(t,n)}async getRequestHeaders(){return{"Content-Type":"application/json",sdkVersion:sr.getSdkVersion(),identifier:await sr.getIdentifier(),token:await sr.getAccessToken()}}_setupInterceptors(){this._axios.interceptors.request.use(async t=>{const n=await this.getRequestHeaders();return t.headers=Object.assign({},t.headers,n),t},t=>{throw t}),this._axios.interceptors.response.use(null,async t=>{if(t.response?.status!==401||this._retryCount>=3)throw this._retryCount=0,t;if(this._isRefreshingToken)throw t;sr.getGlobalDispatcher().call("unauthorized"),this._isRefreshingToken=!0,this._retryCount++;try{const n=await this.getRequestHeaders(),r=t.config;return r.headers=Object.assign({},r.headers,n),this._axios.request(r)}catch(n){throw n}finally{this._isRefreshingToken=!1}})}}function at(e){if(!e)return null;const n=(Array.isArray(e)?e:[e]).filter(xe).map(r=>r.trim());return n.length>0?n.join(","):null}function xe(e){return typeof e=="string"&&e.trim().length>0}function Rt(e){return Array.isArray(e)&&e.length===2&&e.every(t=>typeof t=="number")}function Sn(e){return Array.isArray(e)&&e.length===2&&e.every(t=>Rt(t))}function Yt(e){return typeof e=="number"&&e>0}function Uh(){this.__data__=[],this.size=0}function Ei(e,t){return e===t||e!==e&&t!==t}function ar(e,t){for(var n=e.length;n--;)if(Ei(e[n][0],t))return n;return-1}var Nh=Array.prototype,Dh=Nh.splice;function $h(e){var t=this.__data__,n=ar(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Dh.call(t,n,1),--this.size,!0}function Vh(e){var t=this.__data__,n=ar(t,e);return n<0?void 0:t[n][1]}function jh(e){return ar(this.__data__,e)>-1}function qh(e,t){var n=this.__data__,r=ar(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function dt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dt.prototype.clear=Uh,dt.prototype.delete=$h,dt.prototype.get=Vh,dt.prototype.has=jh,dt.prototype.set=qh;function Kh(){this.__data__=new dt,this.size=0}function Gh(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function zh(e){return this.__data__.get(e)}function Zh(e){return this.__data__.has(e)}var Sa=typeof global=="object"&&global&&global.Object===Object&&global,Wh=typeof self=="object"&&self&&self.Object===Object&&self,ct=Sa||Wh||Function("return this")(),vt=ct.Symbol,Ba=Object.prototype,Yh=Ba.hasOwnProperty,Xh=Ba.toString,Bn=vt?vt.toStringTag:void 0;function Jh(e){var t=Yh.call(e,Bn),n=e[Bn];try{e[Bn]=void 0;var r=!0}catch{}var i=Xh.call(e);return r&&(t?e[Bn]=n:delete e[Bn]),i}var Qh=Object.prototype,e0=Qh.toString;function t0(e){return e0.call(e)}var n0="[object Null]",r0="[object Undefined]",Ia=vt?vt.toStringTag:void 0;function Xt(e){return e==null?e===void 0?r0:n0:Ia&&Ia in Object(e)?Jh(e):t0(e)}function ft(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var i0="[object AsyncFunction]",o0="[object Function]",s0="[object GeneratorFunction]",a0="[object Proxy]";function xa(e){if(!ft(e))return!1;var t=Xt(e);return t==o0||t==s0||t==i0||t==a0}var Si=ct["__core-js_shared__"],La=(function(){var e=/[^.]+$/.exec(Si&&Si.keys&&Si.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function c0(e){return!!La&&La in e}var l0=Function.prototype,u0=l0.toString;function Pt(e){if(e!=null){try{return u0.call(e)}catch{}try{return e+""}catch{}}return""}var d0=/[\\^$.*+?()[\]{}|]/g,f0=/^\[object .+?Constructor\]$/,h0=Function.prototype,p0=Object.prototype,y0=h0.toString,g0=p0.hasOwnProperty,m0=RegExp("^"+y0.call(g0).replace(d0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _0(e){if(!ft(e)||c0(e))return!1;var t=xa(e)?m0:f0;return t.test(Pt(e))}function b0(e,t){return e?.[t]}function Ft(e,t){var n=b0(e,t);return _0(n)?n:void 0}var In=Ft(ct,"Map"),xn=Ft(Object,"create");function w0(){this.__data__=xn?xn(null):{},this.size=0}function v0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var E0="__lodash_hash_undefined__",S0=Object.prototype,B0=S0.hasOwnProperty;function I0(e){var t=this.__data__;if(xn){var n=t[e];return n===E0?void 0:n}return B0.call(t,e)?t[e]:void 0}var x0=Object.prototype,L0=x0.hasOwnProperty;function A0(e){var t=this.__data__;return xn?t[e]!==void 0:L0.call(t,e)}var C0="__lodash_hash_undefined__";function T0(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=xn&&t===void 0?C0:t,this}function kt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kt.prototype.clear=w0,kt.prototype.delete=v0,kt.prototype.get=I0,kt.prototype.has=A0,kt.prototype.set=T0;function O0(){this.size=0,this.__data__={hash:new kt,map:new(In||dt),string:new kt}}function R0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function cr(e,t){var n=e.__data__;return R0(t)?n[typeof t=="string"?"string":"hash"]:n.map}function P0(e){var t=cr(this,e).delete(e);return this.size-=t?1:0,t}function F0(e){return cr(this,e).get(e)}function k0(e){return cr(this,e).has(e)}function M0(e,t){var n=cr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ht(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ht.prototype.clear=O0,ht.prototype.delete=P0,ht.prototype.get=F0,ht.prototype.has=k0,ht.prototype.set=M0;var H0=200;function U0(e,t){var n=this.__data__;if(n instanceof dt){var r=n.__data__;if(!In||r.length<H0-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ht(r)}return n.set(e,t),this.size=n.size,this}function pt(e){var t=this.__data__=new dt(e);this.size=t.size}pt.prototype.clear=Kh,pt.prototype.delete=Gh,pt.prototype.get=zh,pt.prototype.has=Zh,pt.prototype.set=U0;var N0="__lodash_hash_undefined__";function D0(e){return this.__data__.set(e,N0),this}function $0(e){return this.__data__.has(e)}function Ln(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ht;++t<n;)this.add(e[t])}Ln.prototype.add=Ln.prototype.push=D0,Ln.prototype.has=$0;function V0(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Aa(e,t){return e.has(t)}var j0=1,q0=2;function Ca(e,t,n,r,i,o){var s=n&j0,a=e.length,d=t.length;if(a!=d&&!(s&&d>a))return!1;var u=o.get(e),p=o.get(t);if(u&&p)return u==t&&p==e;var h=-1,I=!0,b=n&q0?new Ln:void 0;for(o.set(e,t),o.set(t,e);++h<a;){var g=e[h],w=t[h];if(r)var B=s?r(w,g,h,t,e,o):r(g,w,h,e,t,o);if(B!==void 0){if(B)continue;I=!1;break}if(b){if(!V0(t,function(T,H){if(!Aa(b,H)&&(g===T||i(g,T,n,r,o)))return b.push(H)})){I=!1;break}}else if(!(g===w||i(g,w,n,r,o))){I=!1;break}}return o.delete(e),o.delete(t),I}var Ta=ct.Uint8Array;function K0(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Bi(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var G0=1,z0=2,Z0="[object Boolean]",W0="[object Date]",Y0="[object Error]",X0="[object Map]",J0="[object Number]",Q0="[object RegExp]",ep="[object Set]",tp="[object String]",np="[object Symbol]",rp="[object ArrayBuffer]",ip="[object DataView]",Oa=vt?vt.prototype:void 0,Ii=Oa?Oa.valueOf:void 0;function op(e,t,n,r,i,o,s){switch(n){case ip:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case rp:return!(e.byteLength!=t.byteLength||!o(new Ta(e),new Ta(t)));case Z0:case W0:case J0:return Ei(+e,+t);case Y0:return e.name==t.name&&e.message==t.message;case Q0:case tp:return e==t+"";case X0:var a=K0;case ep:var d=r&G0;if(a||(a=Bi),e.size!=t.size&&!d)return!1;var u=s.get(e);if(u)return u==t;r|=z0,s.set(e,t);var p=Ca(a(e),a(t),r,i,o,s);return s.delete(e),p;case np:if(Ii)return Ii.call(e)==Ii.call(t)}return!1}function Ra(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var yt=Array.isArray;function Pa(e,t,n){var r=t(e);return yt(e)?r:Ra(r,n(e))}function sp(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function Fa(){return[]}var ap=Object.prototype,cp=ap.propertyIsEnumerable,ka=Object.getOwnPropertySymbols,Ma=ka?function(e){return e==null?[]:(e=Object(e),sp(ka(e),function(t){return cp.call(e,t)}))}:Fa;function lp(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Jt(e){return e!=null&&typeof e=="object"}var up="[object Arguments]";function Ha(e){return Jt(e)&&Xt(e)==up}var Ua=Object.prototype,dp=Ua.hasOwnProperty,fp=Ua.propertyIsEnumerable,Na=Ha((function(){return arguments})())?Ha:function(e){return Jt(e)&&dp.call(e,"callee")&&!fp.call(e,"callee")};function hp(){return!1}var Da=typeof _e=="object"&&_e&&!_e.nodeType&&_e,$a=Da&&typeof module=="object"&&module&&!module.nodeType&&module,pp=$a&&$a.exports===Da,Va=pp?ct.Buffer:void 0,yp=Va?Va.isBuffer:void 0,xi=yp||hp,gp=9007199254740991,mp=/^(?:0|[1-9]\d*)$/;function Li(e,t){var n=typeof e;return t=t??gp,!!t&&(n=="number"||n!="symbol"&&mp.test(e))&&e>-1&&e%1==0&&e<t}var _p=9007199254740991;function Ai(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=_p}var bp="[object Arguments]",wp="[object Array]",vp="[object Boolean]",Ep="[object Date]",Sp="[object Error]",Bp="[object Function]",Ip="[object Map]",xp="[object Number]",Lp="[object Object]",Ap="[object RegExp]",Cp="[object Set]",Tp="[object String]",Op="[object WeakMap]",Rp="[object ArrayBuffer]",Pp="[object DataView]",Fp="[object Float32Array]",kp="[object Float64Array]",Mp="[object Int8Array]",Hp="[object Int16Array]",Up="[object Int32Array]",Np="[object Uint8Array]",Dp="[object Uint8ClampedArray]",$p="[object Uint16Array]",Vp="[object Uint32Array]",Te={};Te[Fp]=Te[kp]=Te[Mp]=Te[Hp]=Te[Up]=Te[Np]=Te[Dp]=Te[$p]=Te[Vp]=!0,Te[bp]=Te[wp]=Te[Rp]=Te[vp]=Te[Pp]=Te[Ep]=Te[Sp]=Te[Bp]=Te[Ip]=Te[xp]=Te[Lp]=Te[Ap]=Te[Cp]=Te[Tp]=Te[Op]=!1;function jp(e){return Jt(e)&&Ai(e.length)&&!!Te[Xt(e)]}function qp(e){return function(t){return e(t)}}var ja=typeof _e=="object"&&_e&&!_e.nodeType&&_e,An=ja&&typeof module=="object"&&module&&!module.nodeType&&module,Kp=An&&An.exports===ja,Ci=Kp&&Sa.process,qa=(function(){try{var e=An&&An.require&&An.require("util").types;return e||Ci&&Ci.binding&&Ci.binding("util")}catch{}})(),Ka=qa&&qa.isTypedArray,Ga=Ka?qp(Ka):jp,Gp=Object.prototype,zp=Gp.hasOwnProperty;function za(e,t){var n=yt(e),r=!n&&Na(e),i=!n&&!r&&xi(e),o=!n&&!r&&!i&&Ga(e),s=n||r||i||o,a=s?lp(e.length,String):[],d=a.length;for(var u in e)(t||zp.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Li(u,d)))&&a.push(u);return a}var Zp=Object.prototype;function Za(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Zp;return e===n}function Wa(e,t){return function(n){return e(t(n))}}var Wp=Wa(Object.keys,Object),Yp=Object.prototype,Xp=Yp.hasOwnProperty;function Jp(e){if(!Za(e))return Wp(e);var t=[];for(var n in Object(e))Xp.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ya(e){return e!=null&&Ai(e.length)&&!xa(e)}function Xa(e){return Ya(e)?za(e):Jp(e)}function Ja(e){return Pa(e,Xa,Ma)}var Qp=1,ey=Object.prototype,ty=ey.hasOwnProperty;function ny(e,t,n,r,i,o){var s=n&Qp,a=Ja(e),d=a.length,u=Ja(t),p=u.length;if(d!=p&&!s)return!1;for(var h=d;h--;){var I=a[h];if(!(s?I in t:ty.call(t,I)))return!1}var b=o.get(e),g=o.get(t);if(b&&g)return b==t&&g==e;var w=!0;o.set(e,t),o.set(t,e);for(var B=s;++h<d;){I=a[h];var T=e[I],H=t[I];if(r)var N=s?r(H,T,I,t,e,o):r(T,H,I,e,t,o);if(!(N===void 0?T===H||i(T,H,n,r,o):N)){w=!1;break}B||(B=I=="constructor")}if(w&&!B){var X=e.constructor,P=t.constructor;X!=P&&"constructor"in e&&"constructor"in t&&!(typeof X=="function"&&X instanceof X&&typeof P=="function"&&P instanceof P)&&(w=!1)}return o.delete(e),o.delete(t),w}var Ti=Ft(ct,"DataView"),Oi=Ft(ct,"Promise"),Qt=Ft(ct,"Set"),Ri=Ft(ct,"WeakMap"),Qa="[object Map]",ry="[object Object]",ec="[object Promise]",tc="[object Set]",nc="[object WeakMap]",rc="[object DataView]",iy=Pt(Ti),oy=Pt(In),sy=Pt(Oi),ay=Pt(Qt),cy=Pt(Ri),Et=Xt;(Ti&&Et(new Ti(new ArrayBuffer(1)))!=rc||In&&Et(new In)!=Qa||Oi&&Et(Oi.resolve())!=ec||Qt&&Et(new Qt)!=tc||Ri&&Et(new Ri)!=nc)&&(Et=function(e){var t=Xt(e),n=t==ry?e.constructor:void 0,r=n?Pt(n):"";if(r)switch(r){case iy:return rc;case oy:return Qa;case sy:return ec;case ay:return tc;case cy:return nc}return t});var ly=1,ic="[object Arguments]",oc="[object Array]",lr="[object Object]",uy=Object.prototype,sc=uy.hasOwnProperty;function dy(e,t,n,r,i,o){var s=yt(e),a=yt(t),d=s?oc:Et(e),u=a?oc:Et(t);d=d==ic?lr:d,u=u==ic?lr:u;var p=d==lr,h=u==lr,I=d==u;if(I&&xi(e)){if(!xi(t))return!1;s=!0,p=!1}if(I&&!p)return o||(o=new pt),s||Ga(e)?Ca(e,t,n,r,i,o):op(e,t,d,n,r,i,o);if(!(n&ly)){var b=p&&sc.call(e,"__wrapped__"),g=h&&sc.call(t,"__wrapped__");if(b||g){var w=b?e.value():e,B=g?t.value():t;return o||(o=new pt),i(w,B,n,r,o)}}return I?(o||(o=new pt),ny(e,t,n,r,i,o)):!1}function Pi(e,t,n,r,i){return e===t?!0:e==null||t==null||!Jt(e)&&!Jt(t)?e!==e&&t!==t:dy(e,t,n,r,Pi,i)}var fy=1,hy=2;function py(e,t,n,r){var i=n.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var a=s[0],d=e[a],u=s[1];if(s[2]){if(d===void 0&&!(a in e))return!1}else{var p=new pt,h;if(!(h===void 0?Pi(u,d,fy|hy,r,p):h))return!1}}return!0}function ac(e){return e===e&&!ft(e)}function yy(e){for(var t=Xa(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ac(i)]}return t}function cc(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function gy(e){var t=yy(e);return t.length==1&&t[0][2]?cc(t[0][0],t[0][1]):function(n){return n===e||py(n,e,t)}}var my="[object Symbol]";function Cn(e){return typeof e=="symbol"||Jt(e)&&Xt(e)==my}var _y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,by=/^\w*$/;function Fi(e,t){if(yt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Cn(e)?!0:by.test(e)||!_y.test(e)||t!=null&&e in Object(t)}var wy="Expected a function";function ki(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(wy);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(ki.Cache||ht),n}ki.Cache=ht;var vy=500;function Ey(e){var t=ki(e,function(r){return n.size===vy&&n.clear(),r}),n=t.cache;return t}var Sy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,By=/\\(\\)?/g,Iy=Ey(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Sy,function(n,r,i,o){t.push(i?o.replace(By,"$1"):r||n)}),t});function lc(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var uc=vt?vt.prototype:void 0,dc=uc?uc.toString:void 0;function fc(e){if(typeof e=="string")return e;if(yt(e))return lc(e,fc)+"";if(Cn(e))return dc?dc.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function hc(e){return e==null?"":fc(e)}function ur(e,t){return yt(e)?e:Fi(e,t)?[e]:Iy(hc(e))}function Tn(e){if(typeof e=="string"||Cn(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Mi(e,t){t=ur(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Tn(t[n++])];return n&&n==r?e:void 0}function xy(e,t,n){var r=e==null?void 0:Mi(e,t);return r===void 0?n:r}function Ly(e,t){return e!=null&&t in Object(e)}function Ay(e,t,n){t=ur(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=Tn(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&Ai(i)&&Li(s,i)&&(yt(e)||Na(e)))}function Cy(e,t){return e!=null&&Ay(e,t,Ly)}var Ty=1,Oy=2;function Ry(e,t){return Fi(e)&&ac(t)?cc(Tn(e),t):function(n){var r=xy(n,e);return r===void 0&&r===t?Cy(n,e):Pi(t,r,Ty|Oy)}}function Py(e){return e}function Fy(e){return function(t){return t?.[e]}}function ky(e){return function(t){return Mi(t,e)}}function My(e){return Fi(e)?Fy(Tn(e)):ky(e)}function dr(e){return typeof e=="function"?e:e==null?Py:typeof e=="object"?yt(e)?Ry(e[0],e[1]):gy(e):My(e)}var Hy="Expected a function";function Uy(e){if(typeof e!="function")throw new TypeError(Hy);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var pc=(function(){try{var e=Ft(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Ny(e,t,n){t=="__proto__"&&pc?pc(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Dy=Object.prototype,$y=Dy.hasOwnProperty;function Vy(e,t,n){var r=e[t];(!($y.call(e,t)&&Ei(r,n))||n===void 0&&!(t in e))&&Ny(e,t,n)}function jy(e,t,n,r){if(!ft(e))return e;t=ur(t,e);for(var i=-1,o=t.length,s=o-1,a=e;a!=null&&++i<o;){var d=Tn(t[i]),u=n;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(i!=s){var p=a[d];u=void 0,u===void 0&&(u=ft(p)?p:Li(t[i+1])?[]:{})}Vy(a,d,u),a=a[d]}return e}function qy(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=Mi(e,s);n(a,s)&&jy(o,ur(s,e),a)}return o}var Ky=Wa(Object.getPrototypeOf,Object),Gy=Object.getOwnPropertySymbols,zy=Gy?function(e){for(var t=[];e;)Ra(t,Ma(e)),e=Ky(e);return t}:Fa;function Zy(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Wy=Object.prototype,Yy=Wy.hasOwnProperty;function Xy(e){if(!ft(e))return Zy(e);var t=Za(e),n=[];for(var r in e)r=="constructor"&&(t||!Yy.call(e,r))||n.push(r);return n}function Jy(e){return Ya(e)?za(e,!0):Xy(e)}function Qy(e){return Pa(e,Jy,zy)}function eg(e,t){if(e==null)return{};var n=lc(Qy(e),function(r){return[r]});return t=dr(t),qy(e,n,function(r,i){return t(r,i[0])})}function Hi(e,t){return eg(e,Uy(dr(t)))}const tg=["opening_hours","description","phone","website","email","appURL","icon"];class yc{_api="/api/v5/venues";_request=st.getInstance();constructor(){}searchByIds(t){const n=at(t);if(!n)throw new Error("Please input venue id at least one.");const r=`${this._api}/${n}`;return this._changedRes(r)}searchByDistance(t){const{center:n,distance:r,keywords:i="",offset:o=Ge,page:s=ze}=t;if(!Rt(n))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!Yt(r)||r>1e4)throw new Error("Invalid distance parameter. Expected a positive number and no more than 10000.");const a=new URLSearchParams;a.set("center",n.join(",")),a.set("distance",String(r)),a.set("offset",String(o)),a.set("page",String(s)),xe(i)&&a.set("keywords",i);const d=`${this._api}?${a.toString()}`;return this._changedRes(d)}searchByBounds(t){const{keywords:n,bounds:r,offset:i=Ge,page:o=ze}=t;if(!Sn(r))throw new Error("'bounds' must be an array of two arrays, each containing two numbers.");const s=new URLSearchParams;s.set("bbox",r.flat().join()),s.set("offset",String(i)),s.set("page",String(o)),xe(n)&&s.set("keywords",n);const a=`${this._api}?${s.toString()}`;return this._changedRes(a)}searchByGlobal(t){const{keywords:n,offset:r=Ge,page:i=ze}=t,o=new URLSearchParams;o.set("offset",String(r)),o.set("page",String(i)),xe(n)&&o.set("keywords",n);const s=`${this._api}?${o.toString()}`;return this._changedRes(s)}searchBySharedFloorId(t){if(!xe(t))throw new Error("Please input correct sharedFloorId.");const n=`${this._api}/shared_floors/${t}`;return this._changedRes(n)}search(t){const n=new URLSearchParams;return Object.entries(t).forEach(([r,i])=>{r==="bounds"?n.set("bbox",i.flat().join()):r==="center"?n.set("center",i.join()):n.set(r,String(i))}),this._changedRes(`${this._api}?${n.toString()}`)}async _changedRes(t){return this._request.get(t).then(n=>{if(n.data?.result?.venues){const r=n.data.result.venues.map(i=>Hi(i,(o,s)=>tg.includes(s)));return{...n,data:{...n.data,result:{...n.data.result,venues:r}}}}return n})}}const ng=["specialHours","businessStatus","serviceHours","keywords","siteCode","refPhotoId","totalPhotoCount","photos","description"];class gc{_api="/api/v5/buildings";_request=st.getInstance();constructor(){}searchByIds(t){const n=at(t);if(!n)throw new Error("Please input building id at least one.");const r=`${this._api}/${n}`;return this._changedRes(r)}searchByDistance(t){const{center:n,distance:r,keywords:i="",offset:o=Ge,page:s=ze}=t;if(!Rt(n))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!Yt(r)||r>1e4)throw new Error("Invalid distance parameter. Expected a positive number and no more than 10000.");const a=new URLSearchParams;a.set("center",n.join(",")),a.set("distance",String(r)),a.set("offset",String(o)),a.set("page",String(s)),xe(i)&&a.set("keywords",i);const d=`${this._api}?${a.toString()}`;return this._changedRes(d)}searchByBounds(t){const{bounds:n,offset:r=Ge,page:i=ze,keywords:o}=t;if(!Sn(n))throw new Error("'bounds' must be an array of two arrays, each containing two numbers.");const s=new URLSearchParams;s.set("bbox",n.flat().join()),s.set("offset",String(r)),s.set("page",String(i)),xe(o)&&s.set("keywords",o);const a=`${this._api}?${s.toString()}`;return this._changedRes(a)}searchByGlobal(t){const{keywords:n,offset:r=Ge,page:i=ze}=t,o=new URLSearchParams;o.set("searchGlobal",String(!0)),o.set("offset",String(r)),o.set("page",String(i)),xe(n)&&o.set("keywords",n);const s=`${this._api}?${o.toString()}`;return this._changedRes(s)}searchByFloorId(t){if(!xe(t))throw new Error("'floorId' cannot be empty.");return this._changedRes(`${this._api}/floors/${t}`)}search(t){const n=new URLSearchParams;return Object.entries(t).forEach(([r,i])=>{r==="bounds"?n.set("bbox",i.flat().join()):r==="center"?n.set("center",i.join()):n.set(r,String(i))}),this._changedRes(`${this._api}?${n.toString()}`)}async _changedRes(t){return this._request.get(t).then(n=>{if(n.data?.result?.buildings){const r=n.data.result.buildings.map(i=>Hi(i,(o,s)=>ng.includes(s)));return{...n,data:{...n.data,result:{...n.data.result,buildings:r}}}}return n})}}const rg=["specialHours","businessStatus","serviceHours","keywords","siteCode","refPhotoId","totalPhotoCount","photos","icon"];class mc{_poisApi="/api/v5/pois";_categoriesGroupApi="/api/v5/categories/group";_request=st.getInstance();constructor(){}searchByIds(t){const n=at(t);if(!n)throw new Error("Invalid ids parameter. Expected a non-empty string or an array of strings.");const r=`${this._poisApi}/${n}`;return this._changedRes(r)}searchByDistance(t){const{center:n,distance:r,keywords:i="",offset:o=Ge,page:s=ze}=t;if(!Rt(n))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!Yt(r)||r>1e4)throw new Error("Invalid distance parameter. Expected a positive number and no more than 10000.");const a=new URLSearchParams;a.set("center",n.join(",")),a.set("distance",String(Math.round(r))),a.set("offset",String(o)),a.set("page",String(s)),xe(i)&&a.set("keywords",i);const d=`${this._poisApi}?${a.toString()}`;return this._changedRes(d)}searchByBounds(t){const{bounds:n,offset:r=Ge,page:i=ze,keywords:o,orderBy:s}=t;if(!Sn(n))throw new Error("'bounds' must be an array of two arrays, each containing two numbers.");const a=new URLSearchParams;a.set("bbox",n.flat().join()),a.set("offset",String(r)),a.set("page",String(i)),xe(o)&&a.set("keywords",o),s&&a.set("orderBy",s);const d=`${this._poisApi}?${a.toString()}`;return this._changedRes(d)}searchByBuilding(t){const{buildingId:n,offset:r=Ge,page:i=ze,keywords:o,orderBy:s}=t;if(!xe(n))throw new Error("'buildingId' must be a non-empty string.");const a=new URLSearchParams;a.set("buildingId",n),a.set("offset",String(r)),a.set("page",String(i)),xe(o)&&a.set("keywords",o),s&&a.set("orderBy",s);const d=`${this._poisApi}?${a.toString()}`;return this._changedRes(d)}searchByVenue(t){const{venueId:n,offset:r=Ge,page:i=ze,keywords:o,orderBy:s}=t;if(!xe(n))throw new Error("'venueId' must be a non-empty string.");const a=new URLSearchParams;a.set("venueId",n),a.set("offset",String(r)),a.set("page",String(i)),xe(o)&&a.set("keywords",o),s&&a.set("orderBy",s);const d=`${this._poisApi}?${a.toString()}`;return this._changedRes(d)}searchByFloor(t){let n=null,r=null;if("floorId"in t&&xe(t.floorId)?(n="floorId",r=t.floorId):"sharedFloorId"in t&&xe(t.sharedFloorId)&&(n="sharedFloorId",r=t.sharedFloorId),!n||!r)throw new Error("Either 'floorId' or 'sharedFloorId' must be a non-empty string.");const{offset:i=Ge,page:o=ze,keywords:s,orderBy:a}=t,d=new URLSearchParams;d.set("offset",String(i)),d.set("page",String(o)),d.set(n,r),xe(s)&&d.set("keywords",s),a&&d.set("orderBy",a);const u=`${this._poisApi}?${d.toString()}`;return this._changedRes(u)}searchByFloors(t){let n=null,r=null;const i="floorIds"in t?at(t.floorIds):null,o="sharedFloorIds"in t?at(t.sharedFloorIds):null;if(i?(n="floorId",r=i):o&&(n="sharedFloorId",r=o),!n||!r)throw new Error("Either 'floorIds' or 'sharedFloorIds' must be a non-empty array.");const{offset:s=Ge,page:a=ze,keywords:d,orderBy:u}=t,p=new URLSearchParams;p.set("offset",String(s)),p.set("page",String(a)),p.set(n,r),xe(d)&&p.set("keywords",d),u&&p.set("orderBy",u);const h=`${this._poisApi}?${p.toString()}`;return this._changedRes(h)}searchByOrientation(t){const{center:n,angle:r,distance:i,distanceSearchType:o=Cr.POINT}=t;if(!Rt(n))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!Yt(i)||i>100)throw new Error("Invalid distance parameter. Expected a positive number and no more than 100.");if(!Yt(r))throw new Error("Invalid angle parameter. Expected a positive number.");const s=new URLSearchParams;if("ordinal"in t){if(!xe(t.ordinal))throw new Error("'ordinal' must be a non-empty string.");s.set("ordinal",t.ordinal)}else if("floorId"in t){if(!xe(t.floorId))throw new Error("'floorId' must be a non-empty string.");s.set("floorId",t.floorId)}else if("buildingId"in t){if(!xe(t.buildingId))throw new Error("'buildingId' must be a non-empty string.");s.set("buildingId",t.buildingId)}else throw new Error("Either 'ordinal', 'floorId', or 'buildingId' must be provided.");s.set("center",n.join()),s.set("angle",String(Math.round(r))),s.set("distance",String(i)),s.set("distanceSearchType",o);const a=`${this._poisApi}/orientation?${s.toString()}`;return this._request.get(a)}searchByCategory(t){const{center:n,distance:r,page:i=ze,offset:o=Ge}=t;if(!Rt(n))throw new Error("Invalid center parameter. Expected an array of two numbers.");if(!Yt(r)||r>1e4)throw new Error("Invalid distance parameter. Expected a positive number and no more than 10000");const s=new URLSearchParams;if("category"in t&&xe(t.category))s.set("category",String(t.category));else if("excludedCategories"in t&&at(t.excludedCategories))s.set("excludeCategories",at(t.excludedCategories));else throw new Error("Either 'category' or 'excludedCategories' must be provided.");s.set("center",n.join(",")),s.set("distance",String(r)),s.set("page",String(i)),s.set("offset",String(o));const a=`${this._poisApi}?${s.toString()}`;return this._changedRes(a)}searchCategories(t){const n=new URLSearchParams;if("floorId"in t&&xe(t.floorId)?n.set("floorId",t.floorId):"buildingId"in t&&xe(t.buildingId)?n.set("buildingId",t.buildingId):"sharedFloorId"in t&&xe(t.sharedFloorId)?n.set("sharedFloorId",t.sharedFloorId):"venueId"in t&&xe(t.venueId)&&n.set("venueId",t.venueId),"bounds"in t&&Sn(t.bounds)&&(n.set("bbox",t.bounds.flat().join()),xe(t.keywords)&&n.set("keywords",t.keywords)),n.toString().length===0)throw new Error("At least one of 'floorId', 'buildingId', 'sharedFloorId', 'venueId', or 'bounds' must be provided.");const r=`${this._categoriesGroupApi}?${n.toString()}`;return this._request.get(r)}search(t){const n=new URLSearchParams;Object.entries(t).forEach(([i,o])=>{switch(i){case"bounds":Sn(o)&&n.set("bbox",o.flat().join());break;case"center":Rt(o)&&n.set("center",o.join());break;case"excludedCategories":const s=at(o);s&&n.set("excludeCategories",s);break;case"floorIds":const a=at(o);a&&n.set("floorId",a);break;case"sharedFloorIds":const d=at(o);d&&n.set("sharedFloorId",d);break;default:n.set(i,String(o))}});const r=`${this._poisApi}?${n.toString()}`;return this._request.get(r)}async _changedRes(t){return this._request.get(t).then(n=>{if(n.data?.result?.pois){const r=n.data.result.pois.map(i=>Hi(i,(o,s)=>rg.includes(s)));return{...n,data:{...n.data,result:{...n.data.result,pois:r}}}}return n})}}class ig{_api="/api/v4/route/query";_request=st.getInstance();constructor(){}search(t){const{points:n,vehicle:r=Ar.FOOT,locale:i="en"}=t;if(!(n&&n.length>1&&n.length<6))throw new Error("Parameter error. It must be 1 < {points.length} < 6");if(og(n))throw new Error("Parameter error. Points must have lat and lon.");const o={points:n,vehicle:r,locale:i};return this._request.post(this._api,JSON.stringify(o))}}function og(e){return e.some(t=>!t||typeof t.lat!="number"||typeof t.lon!="number")}const _c=new gc,bc=new yc,sg=new mc;async function fr(e){try{return(await _c.searchByIds(e)).data.result.buildings[0]}catch(t){throw t}}async function ag(e){try{const n=(await _c.searchByFloorId(e)).data.result.buildings[0].buildingId;return await fr(n)}catch(t){throw t}}async function hr(e){try{return(await bc.searchByIds(e)).data.result.venues[0]}catch(t){throw t}}async function wc(e){try{return(await bc.searchBySharedFloorId(e)).data.result.venues[0]}catch(t){throw t}}async function cg(e){try{return(await sg.searchByIds([e])).data.result.pois[0]}catch(t){throw t}}class vc extends Error{status;constructor(t,n){super(t);const{status:r,name:i}=n;r!==void 0&&(this.status=r),i!==void 0&&(this.name=i)}}function lg(e,t=30){let n,r=null;return{promise:new Promise((s,a)=>{r=a;const d=performance.now(),u=()=>{e()?(clearInterval(n),s(!0)):(performance.now()-d)/1e3>t&&(a(new vc("Timeouts or Feature is not found in the map at current zoom level.",{status:404,name:"NetworkError"})),clearInterval(n))};u(),n=setInterval(u,100)}),abort:()=>{n&&(clearInterval(n),n=null),r&&(r(new vc("Query was aborted by the user.",{status:400,name:"AbortError"})),r=null)}}}class Mt{static instance;_buildingUnitsMap;_ordinalsMap;_visitedBuildingUnits;constructor(){this._buildingUnitsMap=new Map,this._ordinalsMap=new Map,this._visitedBuildingUnits=[]}static getInstance(){return Mt.instance||(Mt.instance=new Mt),Mt.instance}getBuildingUnitByVenue(t){return this._buildingUnitsMap.get(t)}setBuildingUnitByVenue(t,n){this._buildingUnitsMap.set(t,n)}getOrdinalByBuildingUnit(t){return this._ordinalsMap.get(t)}setOrdinalByBuildingUnit(t,n){this._ordinalsMap.set(t,n)}getVisitedBuildingUnits(){return this._visitedBuildingUnits}addVisitedBuildingUnit(t){this._visitedBuildingUnits.push(t),this._visitedBuildingUnits.length>100&&(this._visitedBuildingUnits=this._visitedBuildingUnits.slice(this._visitedBuildingUnits.length-100))}}class Ht{static instance;_hiddenBuildings;constructor(){this._hiddenBuildings=new Set}static getInstance(){return Ht.instance||(Ht.instance=new Ht),Ht.instance}getHiddenBuildings(){return this._hiddenBuildings}}class ug{_maplibre;_isAnimated=!0;_bounds=null;_boundsPadding;_center=null;_fitBoundsTimer=null;constructor(t,n){this._maplibre=t,this._boundsPadding=n}setAnimated(t){this._isAnimated=t}setBounds(t){this._bounds=t}getBounds(){return this._bounds}setCenter(t){this._center=t}async fitBounds(){if(!this._bounds)return;this._fitBoundsTimer&&(clearTimeout(this._fitBoundsTimer),this._fitBoundsTimer=null);const t=this._isAnimated?{animate:!0,duration:500}:{animate:!1},n=this._isAnimated?500:0;return new Promise(r=>{const i=()=>{this._maplibre.off("idle",i),r(!0)};this._maplibre.on("idle",i),this._maplibre.fitBounds(this._bounds,{...t,padding:this._boundsPadding,bearing:this._maplibre.getBearing()}),this._fitBoundsTimer=setTimeout(()=>{this._maplibre.off("idle",i),this._fitBoundsTimer=null,r(!0)},n+200)})}panToCenter(){this._center&&this._maplibre.panTo(this._center,{animate:this._isAnimated})}}function dg(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(s!=null&&(a===void 0?s===s&&!Cn(s):n(s,a)))var a=s,d=o}return d}function fg(e,t){return e<t}function hg(e,t){return e&&e.length?dg(e,dr(t),fg):void 0}var Ui=function(){return ct.Date.now()},pg=/\s/;function yg(e){for(var t=e.length;t--&&pg.test(e.charAt(t)););return t}var gg=/^\s+/;function mg(e){return e&&e.slice(0,yg(e)+1).replace(gg,"")}var Ec=NaN,_g=/^[-+]0x[0-9a-f]+$/i,bg=/^0b[01]+$/i,wg=/^0o[0-7]+$/i,vg=parseInt;function pr(e){if(typeof e=="number")return e;if(Cn(e))return Ec;if(ft(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ft(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=mg(e);var n=bg.test(e);return n||wg.test(e)?vg(e.slice(2),n?2:8):_g.test(e)?Ec:+e}var Eg="Expected a function",Sg=Math.max,Bg=Math.min;function Ni(e,t,n){var r,i,o,s,a,d,u=0,p=!1,h=!1,I=!0;if(typeof e!="function")throw new TypeError(Eg);t=pr(t)||0,ft(n)&&(p=!!n.leading,h="maxWait"in n,o=h?Sg(pr(n.maxWait)||0,t):o,I="trailing"in n?!!n.trailing:I);function b(F){var q=r,W=i;return r=i=void 0,u=F,s=e.apply(W,q),s}function g(F){return u=F,a=setTimeout(T,t),p?b(F):s}function w(F){var q=F-d,W=F-u,K=t-q;return h?Bg(K,o-W):K}function B(F){var q=F-d,W=F-u;return d===void 0||q>=t||q<0||h&&W>=o}function T(){var F=Ui();if(B(F))return H(F);a=setTimeout(T,w(F))}function H(F){return a=void 0,I&&r?b(F):(r=i=void 0,s)}function N(){a!==void 0&&clearTimeout(a),u=0,r=d=i=a=void 0}function X(){return a===void 0?s:H(Ui())}function P(){var F=Ui(),q=B(F);if(r=arguments,i=this,d=F,q){if(a===void 0)return g(d);if(h)return clearTimeout(a),a=setTimeout(T,t),b(d)}return a===void 0&&(a=setTimeout(T,t)),s}return P.cancel=N,P.flush=X,P}function Ig(e,t,n,r){for(var i=e.length,o=n+-1;++o<i;)if(t(e[o],o,e))return o;return-1}function xg(e){return e!==e}function Lg(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function Ag(e,t,n){return t===t?Lg(e,t,n):Ig(e,xg,n)}function Cg(e,t){var n=e==null?0:e.length;return!!n&&Ag(e,t,0)>-1}function Tg(){}var Og=1/0,Rg=Qt&&1/Bi(new Qt([,-0]))[1]==Og?function(e){return new Qt(e)}:Tg,Pg=200;function Fg(e,t,n){var r=-1,i=Cg,o=e.length,s=!0,a=[],d=a;if(o>=Pg){var u=t?null:Rg(e);if(u)return Bi(u);s=!1,i=Aa,d=new Ln}else d=t?[]:a;e:for(;++r<o;){var p=e[r],h=t?t(p):p;if(p=p!==0?p:0,s&&h===h){for(var I=d.length;I--;)if(d[I]===h)continue e;t&&d.push(h),a.push(p)}else i(d,h,n)||(d!==a&&d.push(h),a.push(p))}return a}function Sc(e,t){return e&&e.length?Fg(e,dr(t)):[]}var kg=0;function Ut(e){var t=++kg;return hc(e)+t}const On="Indoor_selectedFloorChanged",yr="Indoor_selectedBuildingChanged",Di="Indoor_mapxusMapLoaded",Bc="Indoor_maplibreMapLoaded",gr="mapxus-venue-fill",Nt="mapxus-building-line",Ic="mapxus-level-fill",$i="mapxus-shared-level-fill",Vi="highlight-mapxus_level",ji="highlight-mapxus_shared_level";class xc extends Sr.TinyEmitter{_map;_features=[];_allVenuesMap=new Map;_allBuildingsMap=new Map;_allSharedLevelsMap=new Map;_curBuildingId=null;_curBuildingFeature=null;_curSharedLevelId=null;_floor={code:null,id:null,ordinal:null};_sharedFloor={id:null,ordinal:null,name:null};_outdoorMapShown;_originIndoorLayers=[];_outdoorLayers=[];_curVenueId=null;_curVenueFeature=null;_selectedHighlightStyle;_upperLayers=[];_commonPoiLayers=[];_sectionFillLineLayers=[];_sectionSymbolLayers=[];_middleLayers=[];_lowerLayers=[];_excludedPoisInMiddle=[];_dispatch=Wt(On);_startWithIndoorView;_indoorMapLoaded=!1;_isSelectSharedFloor=!1;_isMaskMode;_upperLevels=new Set;_middleLevels=new Set;_lowerLevels=new Set;_featureIncomplete=!1;_fitBounds;_dragPan;_history=Mt.getInstance();_hiddenBuildings=Ht.getInstance().getHiddenBuildings();_maskBuildings=new Set;_maskSharedFloors=new Set;_enableIndoorClickSelection;_enableOutdoorClickSelection;_zIndexHistory=new Map;_isDestroyed=!1;_abortQueryFeature;_debounceRendering;dragPanHandler;constructor(t){super();const{map:n,startWithIndoorView:r,outdoorMapShown:i,selectedHighlightStyle:o,fitBounds:s,boundsPadding:a,maskNonSelectedAreas:d,enableIndoorClickSelection:u,enableOutdoorClickSelection:p}=t;this.dragPanHandler=new ug(n,a),this._map=n,this._enableIndoorClickSelection=u,this._enableOutdoorClickSelection=p,this._startWithIndoorView=r,this._outdoorMapShown=i,this._isMaskMode=d,this._fitBounds=s,this._selectedHighlightStyle=o?Object.assign({},Un,o):Un,this._bindMaplibreEventListeners()}destroy(){this._isDestroyed||(this._isDestroyed=!0,this._dispatch.on(`.${On}`,null),this.off(yr),this.off(Bc),this.off(Di),this._debounceRendering?.cancel(),this._abortQueryFeature&&(this._abortQueryFeature(),this._abortQueryFeature=null))}setAllowOutdoorSwitch(t){return this._enableOutdoorClickSelection=t,this}setAllowBuildingSwitch(t){return this._enableIndoorClickSelection=t,this}setAllowIndoorClickSelect(t){this._enableIndoorClickSelection=t}setAllowOutdoorClickSelect(t){this._enableOutdoorClickSelection=t}get floor(){return this._isSelectSharedFloor?this._sharedFloor:this._curBuildingId?this._floor:null}get building(){return this._curBuildingFeature}get venue(){return this._curVenueFeature}get features(){return this._features}getFeaturesById(t,n){const{layerIds:r,filter:i}=n||{},o=this._queryRenderedFeatures(r);if(!o.length)return[];const s=i?a=>a.properties.id===t&&i(a):a=>a.properties.id===t;return o.filter(s)}async switchFloorByOrdinal(t){this._updateFloorState(t),this._dispatch.call(On,null,{venue:this.venue,building:this.building,floor:this.floor}),this.venue&&t&&(this._dragPan===!0&&(this._fitBounds?await this.dragPanHandler.fitBounds():await this.panToBuildingCenter()),this._dragPan==="restrict"&&await this._checkAndPanToBuilding(),this._resetSelectedDisplayedLevel()),this.updateRendering()}setOutdoorMapShown(t){this._outdoorMapShown=t,this._setOutdoorVisibility(t)}setSelectedHighlightStyle(t){this._selectedHighlightStyle=Object.assign({},this._selectedHighlightStyle,t??{"line-opacity":0});for(const n of[Vi,ji])if(this._map.getLayer(n))if(t){const{lineColor:r,lineOpacity:i,lineWidth:o,lineOffset:s}=this._selectedHighlightStyle,a=Lc(o,s);this._map.setPaintProperty(n,"line-color",r),this._map.setPaintProperty(n,"line-opacity",i),this._map.setPaintProperty(n,"line-width",o),this._map.setPaintProperty(n,"line-offset",a)}else this._map.setPaintProperty(n,"line-opacity",0)}onMapChange(t){const n=Ut(`${On}.`);return this._dispatch.on(n,t),{unsubscribe:()=>this._dispatch.on(n,null)}}async selectBuilding(t,n){if(this._isCurrentFeature(t))return;this._isSelectSharedFloor=!1,this._curSharedLevelId=null;let r=null;if(!t||!t.properties)this.dragPanHandler.setCenter(null),this._clear();else{const{floorId:i,featureIncomplete:o}=n||{};this._featureIncomplete=o??this._featureIncomplete;const{id:s,"ref:venue":a,label_center:d}=t.properties,u=Ae(d).map(p=>parseFloat(p));this._curBuildingFeature=t,this._curBuildingId=s,this._history.addVisitedBuildingUnit({id:s,type:"building"}),this.dragPanHandler.setCenter(u),this._curVenueId!==a&&(this._curVenueId=a,this._curVenueFeature=await this._queryVenueFeature(a)),r=this._getBuildingDisplayedOrdinal(t,i)}await this.switchFloorByOrdinal(r),this.emit(yr,t?{building:t,ordinal:r,dragPan:this._dragPan}:null),this._dispatchIndoorMapLoaded()}async selectSharedFloor(t,n,r){if(t.id===this._curSharedLevelId)return;const{id:i,ordinal:o}=t;this._isSelectSharedFloor=!0,this._curBuildingId=null,this._curBuildingFeature=null,this._sharedFloor=t,this._curSharedLevelId=i,this._featureIncomplete=r?.featureIncomplete??this._featureIncomplete;const{label_center:s,id:a}=n.properties,d=Ae(s).map(u=>parseFloat(u));this._curVenueId=a,this._curVenueFeature=n,this.dragPanHandler.setCenter(d),this._history.addVisitedBuildingUnit({id:i,type:"sharedFloor"}),this._history.setOrdinalByBuildingUnit(i,o),this._history.setBuildingUnitByVenue(this._curVenueId,{id:i,type:"sharedFloor"}),this._dragPan===!0&&(this._fitBounds?await this.dragPanHandler.fitBounds():await this.panToVenueCenter()),this._dispatch.call(On,null,{venue:this.venue,building:this.building,floor:this.floor}),this.emit(yr,{...t,dragPan:this._dragPan}),this._dispatchIndoorMapLoaded(),this._resetSelectedDisplayedLevel(),this.updateRendering()}updateCustomLayers(){const t=this._map.getStyle();this._originIndoorLayers=Br(t),this._outdoorLayers=el(t),this._copyOverlapLayers(),this._copySharedFloorBackgroundLayers(),this._addSelectedHighlightLayers(),this._addReserveFloorLayers(),this._isMaskMode&&this._addBuildingMaskLayer(),this._outdoorMapShown||this._setOutdoorVisibility(!1)}updateRendering(){this._updateFeatures(),this._updateSelectedFeatures(),this._layerFloors(),this._calExcludedPoisInMiddle(),this._filterLayers(),this._filterSelectedHighlight(),this._updateUnselectedMask()}async panToBuildingCenter(){if(this.dragPanHandler.panToCenter(),this._featureIncomplete){const t=()=>this.getFeaturesById(this._curBuildingId,{layerIds:[Nt]})[0];await this._waitForFeatureLoaded(t)}}async panToVenueCenter(){if(this.dragPanHandler.panToCenter(),this._featureIncomplete){const t=()=>this.getFeaturesById(this._curVenueId,{layerIds:[gr]})[0];await this._waitForFeatureLoaded(t)}}async _waitForFeatureLoaded(t){const n=()=>this._isDestroyed?(this._abortQueryFeature?.(),!0):!!t(),{promise:r,abort:i}=lg(n);this._abortQueryFeature=i;try{await Promise.race([r,new Promise((o,s)=>{this._abortQueryFeature=()=>{s(new Error("Aborted")),this._abortQueryFeature=null}})])}catch(o){console.warn(o);return}}setDragPan(t){this._dragPan=t}setFitBounds(t){this._fitBounds=t}async queryIndoorFeaturesByClickPoint(t){const n=this._queryVisibleFeature(t);if(!n)return null;const r=async o=>{let s=this.getFeaturesById(o,{layerIds:[gr]})[0];if(!s){const a=await hr(o);s=Hn(a),this._featureIncomplete=!0}return s??null},i=async o=>{let s=this.getFeaturesById(o,{layerIds:[Nt]})[0];if(!s){const a=await fr(o);s=xr(a),this._featureIncomplete=!0}return s??null};if(mr(n.sourceLayer,n.layer.type)){const{id:o,"ref:building":s,name:a,ordinal:d}=n.properties,u=await i(s);if(u){const p=u.properties["ref:venue"];return{venue:await r(p),building:u,floor:{id:o,code:a,ordinal:d}}}}else if(Cc(n.sourceLayer,n.layer.type)){const{id:o,ordinal:s,name:a,"ref:venue":d}=n.properties;return{sharedFloor:{id:o,ordinal:s,name:typeof a=="string"?{default:a}:a},venue:await r(d)}}else{const o=n?.properties?.["ref:venue"];return n?{building:n,venue:await r(o)}:null}}async selectByClickMap(t){!this._enableIndoorClickSelection&&!this._enableOutdoorClickSelection||(this.setDragPan(!1),this.dragPanHandler.setBounds(null),this._featureIncomplete=!1,t?this._enableIndoorClickSelection&&("building"in t?await this.selectBuilding(t.building,{floorId:t?.floor?.id}):"sharedFloor"in t&&await this.selectSharedFloor(t.sharedFloor,t.venue)):this._enableOutdoorClickSelection&&await this.selectBuilding(null))}_bindMaplibreEventListeners(){this._map.once("styledata",()=>this.updateCustomLayers()),this._map.once("idle",()=>{this.emit(Bc),(!this._startWithIndoorView||this._map.getZoom()<14)&&this._dispatchIndoorMapLoaded()}),this._map.on("sourcedata",this._debounceRendering=Ni(()=>this.updateRendering(),300))}_clear(){this._curBuildingFeature=null,this._curBuildingId=null,this._floor={code:null,id:null,ordinal:null},this._curVenueId=null,this._curVenueFeature=null,this._curSharedLevelId=null}_getIndoorFeatures(){return this._queryRenderedFeatures().filter(t=>Ir(t.source))}_getBuildingFloorByOrdinal(t,n){let r=null,i=null;if(t?.properties){const{ordinals:o,level_names:s,level_ids:a}=t.properties,d=Ae(o).findIndex(u=>u===n);r=Ae(s)[d]??null,i=Ae(a)[d]??null}return{code:r,id:i,ordinal:n}}_isCurrentFeature(t){const n=t?.properties?.id??null,r=this._isSelectSharedFloor?this._curSharedLevelId:this._curBuildingId;return n===r}_setOutdoorVisibility(t){for(const{id:n}of this._outdoorLayers)this._map.getLayer(n)&&this._map.setLayoutProperty(n,"visibility",t?"visible":"none")}_addReserveFloorLayers(){for(const t of[nn,je]){if(this._map.getLayer(t))continue;const n=t.split("_")[1],r=this._map.getLayer(n);if(!r)continue;const{source:i,sourceLayer:o}=r,s=t===nn?this._middleLayers[0]:this._lowerLayers[0];let a={"fill-opacity":0};if(this._isMaskMode&&t===je){const d=this._originIndoorLayers.find(({id:u})=>u===Nt);d&&(a=Object.assign({},d.paint??{},a))}this._map.addLayer({id:t,source:i,"source-layer":o,type:"fill",paint:a},s.id)}}_addBuildingMaskLayer(){if(this._map.getLayer(rn))return;const t=this._originIndoorLayers.find(({id:n})=>n===Nt);if(t){const n=Object.assign({},t,{id:rn,layout:Object.assign({},t.layout??{},{visibility:"visible"}),paint:Object.assign({},t.paint??{},{"fill-opacity":0})});this._map.addLayer(n,Nt)}}_updateUnselectedMask(){if(!this._isMaskMode)return;const t=[...this._maskBuildings],n=[...this._maskSharedFloors];this._map.getLayer(rn)&&this._map.setPaintProperty(rn,"fill-opacity",["case",["in",["get","id"],["literal",t]],1,0]),this._map.getLayer(je)&&this._map.setPaintProperty(je,"fill-opacity",["case",["in",["get","id"],["literal",n]],1,0])}_addSelectedHighlightLayers(){const t=[{layerId:Vi,sourceLayer:"mapxus_level"},{layerId:ji,sourceLayer:"mapxus_shared_level"}];let n=this._originIndoorLayers.find(({type:r})=>Ki(r));if(!n){const r=this._originIndoorLayers.findIndex(({id:i})=>i===this._upperLayers[this._upperLayers.length-1].id);n=this._originIndoorLayers[r+1]}for(const{layerId:r,sourceLayer:i}of t){if(this._map.getLayer(r))continue;const{lineWidth:o,lineOpacity:s,lineColor:a,lineOffset:d}=this._selectedHighlightStyle,u=Lc(o,d);this._map.addLayer({id:r,source:"indoor-planet","source-layer":i,type:"line",filter:["==","id",""],paint:{"line-offset":u,"line-width":o,"line-color":a,"line-opacity":s}},n?.id)}}_filterSelectedHighlight(){for(const t of[Vi,ji])this._map.getLayer(t)&&this._map.setFilter(t,["==","id",this._isSelectSharedFloor?this._curSharedLevelId:this._floor.id??""])}_getBuildingDefaultOrdinal(t){let n=null;if(t?.properties){const{level_ids:r,ordinals:i,default_displayed_floor:o}=t.properties,s=Ae(i);if(s.length){if(o){const a=Ae(r).findIndex(d=>d===o);n=s[a]??null}n||(n=hg(s,a=>Math.abs(Number(a)-.1)))}}return n}_copyOverlapLayers(){const t=this._originIndoorLayers.findIndex(({type:a,"source-layer":d})=>Ac(d,a)),n=this._originIndoorLayers.findIndex(({type:a,"source-layer":d})=>qi(d,a)),r=this._originIndoorLayers.slice(t,n);this._upperLayers=r.filter(({type:a})=>Hg(a));const i=this._originIndoorLayers.slice(n),o=i.findIndex(({type:a,"source-layer":d})=>!qi(d,a));if(o>-1){this._commonPoiLayers=i.slice(0,o);const a=i.slice(o);this._sectionFillLineLayers=a.filter(({type:d})=>d!=="symbol"),this._sectionSymbolLayers=a.filter(({type:d})=>d==="symbol")}else this._commonPoiLayers=[...i],this._sectionSymbolLayers=r.filter(({type:a,"source-layer":d})=>d==="mapxus_section"&&a==="symbol");const s=this._upperLayers[0];this._middleLayers=this._upperLayers.filter(({type:a})=>!Ki(a)).map(a=>{const d=`${a.id}-overlap-copy`;let u=this._map.getLayer(d);return u||(u=Object.assign({},a,{id:d}),this._map.addLayer(u,s.id)),u})}_copySharedFloorBackgroundLayers(){if(!!!this._upperLayers.find(i=>i.id===je.split("_")[1]))return;const n=this._upperLayers.filter(({"source-layer":i,type:o})=>!mr(i,o)&&!Ki(o)),r=this._middleLayers[0]||this._upperLayers[0];this._lowerLayers=[...n,...this._commonPoiLayers].map(i=>{const o=`${i.id}-shared-bg`;let s=this._map.getLayer(o);return s||(s=Object.assign({},i,{id:o}),this._map.addLayer(s,r.id)),s})}_updateFeatures(){this._features=this._getIndoorFeatures();const t=Sc(this._features,o=>o.layer.id+":"+o.properties.id),n=[],r=[],i=[];for(const o of t){const s=o.layer.id;s===gr?n.push(o):s===Nt?r.push(o):s===je&&i.push(o)}this._allVenuesMap=new Map(n.map(o=>[o.properties.id,o])),this._allBuildingsMap=new Map(r.map(o=>[o.properties.id,o])),this._allSharedLevelsMap=new Map(i.map(o=>[o.properties.id,o]))}_calExcludedPoisInMiddle(){const t=this._map.querySourceFeatures("indoor-planet",{sourceLayer:"mapxus_place"}),n=i=>i?Ae(i).some(s=>this._upperLevels.has(s)):!1,r=t.filter(i=>{const o=i.properties["ref:level"]||i.properties["ref:shared_level"];return this._middleLevels.has(o)?n(i.properties.overlap):!1});this._excludedPoisInMiddle=r.map(i=>i.properties["osm:ref"])}_updateSelectedFeatures(){if(this._featureIncomplete){if(this._isSelectSharedFloor){const t=this._features.find(n=>n.properties.id===this._curVenueId);if(!t)return;this._curVenueFeature=t}else{const t=this._allBuildingsMap.get(this._curBuildingId);if(!t)return;this._curBuildingFeature=t}this._featureIncomplete=!1}}_layerFloors(){const{displayedLevels:t,selectedLevelIds:n,alwaysDisplayedSharedLevelIds:r,hiddenBuildingIds:i,maskBuildingIds:o,maskSharedFloorIds:s}=this._classifyFloors();this._upperLevels.clear(),this._middleLevels.clear(),this._lowerLevels.clear(),this._hiddenBuildings.clear(),this._layerSelectedLevels(t,n,r),this._layerUnselectedLevels(t,n,r),i.forEach(a=>{this._hiddenBuildings.add(a)}),this._isMaskMode&&(this._maskBuildings.clear(),this._maskSharedFloors.clear(),o.forEach(a=>{this._maskBuildings.add(a)}),s.forEach(a=>{this._maskSharedFloors.add(a)}))}_layerSelectedLevels(t,n,r){for(const i of n){this._upperLevels.add(i),this._zIndexHistory.set(i,!0);const o=t.find(({level:s,overlap:a})=>s===i&&!!a);if(o){for(const s of o.overlap)if(this._zIndexHistory.get(s)){if(this._zIndexHistory.delete(s),!t.find(({level:d})=>d===s))continue;r.includes(s)?(this._lowerLevels.add(s),this._zIndexHistory.delete(s)):(this._middleLevels.add(s),this._zIndexHistory.set(s,!1))}}}}_layerUnselectedLevels(t,n,r){for(const i of t){if(n.includes(i.level))continue;const{level:o,overlap:s,venueId:a}=i,d=this._zIndexHistory.get(o),u=!s||!s.some(h=>this._upperLevels.has(h)),p=r.includes(o);if(a===this._curVenueId&&p){this._lowerLevels.add(o),this._zIndexHistory.delete(o);continue}d?this._upperLevels.add(o):d===!1?this._middleLevels.add(o):p?this._lowerLevels.add(o):u?(this._upperLevels.add(o),this._zIndexHistory.set(o,!0)):(this._middleLevels.add(o),this._zIndexHistory.set(o,!1))}}_classifyFloors(){const t=[],n=[],r=[],i=[],o=[],s=[],a=[...this._allVenuesMap.values()],d=this._curVenueId?[this._allVenuesMap.get(this._curVenueId),...a.filter(u=>u.properties.id!==this._curVenueId)]:a;for(const u of d){if(!u||!u.properties)continue;const{id:p,overlap:h,building_ids:I,shared_level_ids:b,default_displayed_ordinal:g,default_displayed_building:w}=u.properties,B=p===this._curVenueId,T=Ug(h),H=Ae(I),N=this._history.getBuildingUnitByVenue(p);let X=N?this._history.getOrdinalByBuildingUnit(N.id):g;if(X)N||(this._history.setOrdinalByBuildingUnit(w,X),this._history.setBuildingUnitByVenue(p,{id:w,type:"building"}));else{const P=this._calcVenueInitDisplayedData(H);X=P.ordinal,X&&(this._history.setOrdinalByBuildingUnit(P.buildingId,X),this._history.setBuildingUnitByVenue(p,{id:P.buildingId,type:"building"}))}X&&(H.forEach(P=>{const F=this._allBuildingsMap.get(P),q=this._getBuildingDisplayedLevel(F,X);q?this._isMaskMode?B?(n.push(q),t.push({level:q,overlap:T.get(q)??null,venueId:p})):o.push(P):(t.push({level:q,overlap:T.get(q)??null,venueId:p}),B&&n.push(q)):i.push(P)}),Ae(b).forEach(P=>{const F=this._allSharedLevelsMap.get(P),{ordinal:q,persistence:W=!1}=F?.properties||{},K=!!W&&0<=q&&q<=X,J=q===X,te=K||J,ne={level:P,overlap:T.get(P)??null,venueId:p};te?this._isMaskMode?B?(t.push(ne),K&&r.push(P),J&&n.push(P)):s.push(P):(t.push(ne),B&&J&&n.push(P),K&&r.push(P)):i.push(P)}))}return{displayedLevels:t,hiddenBuildingIds:i,maskBuildingIds:o,maskSharedFloorIds:s,alwaysDisplayedSharedLevelIds:r,selectedLevelIds:n}}_calcVenueInitDisplayedData(t){const n=t.find(o=>this._allBuildingsMap.has(o))??t[0]??null,r=n?this._allBuildingsMap.get(n):null;return{ordinal:r?this._getBuildingDefaultOrdinal(r):null,buildingId:n}}_getBuildingDisplayedLevel(t,n){if(!t||!t.properties)return null;const{level_ids:r,ordinals:i}=t.properties,o=Ae(i).findIndex(s=>s===n);return Ae(r)[o]??null}_filterLayers(){this._filterIndoorLayers([...this._upperLevels,...this._middleLevels],this._commonPoiLayers),this._filterIndoorLayers([...this._upperLevels],this._upperLayers),this._filterIndoorLayers([...this._middleLevels],this._middleLayers),this._filterIndoorLayers([...this._lowerLevels],this._lowerLayers),this._sectionFillLineLayers.length?(this._filterIndoorLayers([...this._upperLevels],this._sectionFillLineLayers),this._filterIndoorLayers([...this._upperLevels],this._sectionSymbolLayers)):this._filterIndoorLayers([...this._upperLevels,...this._middleLevels,...this._lowerLevels],this._sectionSymbolLayers)}_filterIndoorLayers(t,n){let r;for(const i of n){const{id:o,filter:s,type:a,"source-layer":d}=i,u=s?[s]:[],p=o.includes("-shared-bg"),h=[...this._maskBuildings],I=[...this._maskSharedFloors];Ac(d,a)?r=["all",mr(d,a)?["!in","ref:building",...h]:["!in","id",...I],["in","id",...t],...u]:p?r=["all",["!in","ref:shared_level",...I],["in","ref:shared_level",...t],...u]:(r=["all",["any",["all",["!in","ref:building",...h],["in","ref:level",...t]],["all",["!in","ref:shared_level",...I],["in","ref:shared_level",...t]]],...u],qi(d,a)&&r.splice(1,0,["any",["!has","overlap"],["any",["in","ref:level",...this._upperLevels],["in","ref:shared_level",...this._upperLevels],["!in","osm:ref",...this._excludedPoisInMiddle]]])),this._map.setFilter(o,r)}}async _queryVenueFeature(t){let n=this.getFeaturesById(t,{layerIds:[gr]})[0]??null;if(!n)try{const r=await hr(t);n=Hn(r)}catch(r){console.error(r)}return n}_getBuildingDisplayedOrdinal(t,n){const{"ref:venue":r,level_ids:i,ordinals:o}=t.properties,s=Ae(i),a=Ae(o);if(n){const p=s.findIndex(h=>h===n);return a[p]??null}const d=this._history.getBuildingUnitByVenue(r);let u=null;if(d){const p=this._history.getOrdinalByBuildingUnit(d.id);p&&a.includes(p)&&(u=p)}return u||(u=this._getBuildingDefaultOrdinal(t)),u}_updateFloorState(t){if(!t){this._floor={code:null,id:null,ordinal:null};return}const{code:n,id:r}=this._getBuildingFloorByOrdinal(this._curBuildingFeature,t);(!n||!r)&&console.error(`Floor with ordinal "${t}" not found in building "${this._curBuildingId}".`),this._floor={code:n,id:r,ordinal:t},this._history.setOrdinalByBuildingUnit(this._curBuildingId,t),this._history.setBuildingUnitByVenue(this._curVenueId,{id:this._curBuildingId,type:"building"})}_resetSelectedDisplayedLevel(){const{building_ids:t,shared_level_ids:n}=this._curVenueFeature.properties,r=Ae(t),i=Ae(n);for(const o of r){const s=this._allBuildingsMap.get(o);if(!s)continue;const a=Ae(s.properties.level_ids);i.push(...a),this._hiddenBuildings.delete(o),this._isMaskMode&&this._maskBuildings.delete(o)}for(const o of i)this._upperLevels.delete(o),this._middleLevels.delete(o),this._lowerLevels.delete(o),this._isMaskMode&&this._maskSharedFloors.delete(o)}async _checkAndPanToBuilding(){this.getFeaturesById(this._curBuildingId,{layerIds:[Nt]})[0]||(this._fitBounds?this.dragPanHandler.fitBounds():this.dragPanHandler.panToCenter())}_queryVisibleFeature(t){const r=[Ic,$i,`${Ic}-overlap-copy`,`${$i}-overlap-copy`,`${$i}-shared-bg`,...this._isMaskMode?[je,rn]:[]].filter(s=>!!this._map.getLayer(s)),i=this._map.queryRenderedFeatures(t,{layers:r});let o=null;for(const s of r){const a=i.find(d=>d.layer.id===s);if(a){o=a;break}}return o&&Mg(o.sourceLayer,o.layer.type)&&(this._maskBuildings.has(o.properties?.id)||(o=null)),o}_queryRenderedFeatures(t){const n=(t||[]).filter(o=>this._map.getLayer(o));if(t&&t.length>0&&n.length===0)return[];const r=n.length?{layers:n}:{},i=this._map.getCanvas().getBoundingClientRect();return this._map.queryRenderedFeatures([[0,0],[i.width,i.height]],r)}_dispatchIndoorMapLoaded(){this._indoorMapLoaded||(this._indoorMapLoaded=!0,this.emit(Di))}}function Lc(e,t){const n=typeof e=="number"&&e===Un.lineWidth,r=typeof t=="number"&&t===Un.lineOffset;if(!r)return t;if(n&&r)return["interpolate",["linear"],["zoom"],18,-1.5,20.2,-3.75,20.4,-3.8,21.5,-7.5,22,-9.55];if(!n&&r)return typeof e=="number"?-(e/2):t}function Mg(e,t){return e==="mapxus_building"&&(t==="fill"||t==="line"||t==="symbol")}function Ac(e,t){return mr(e,t)||Cc(e,t)}function mr(e,t){return e==="mapxus_level"&&(t==="fill"||t==="line")}function Cc(e,t){return e==="mapxus_shared_level"&&(t==="fill"||t==="line")}function qi(e,t){return e==="mapxus_place"&&t==="symbol"}function Ki(e){return e==="fill-extrusion"}function Hg(e){return e==="line"||e==="fill"||e==="fill-extrusion"}function Ug(e){const t=new Map;if(!e)return t;for(const n of Ae(e,"/")){const[r,i]=Ae(n,":");t.set(r,Ae(i))}return t}const _r="Poi_poiClick";class Tc{_map;_currentStyle=null;_styleLayersLength=0;_layerIds=[];_dispatch=Wt(_r);_listeners=[];constructor(t){this._map=t,this._bindPoiClickEvent()}destroy(){this._dispatch.on(`.${_r}`,null),this._currentStyle=null,this._map=null,this._dispatch=null,this._listeners=[],this._layerIds=[]}onPoiClick(t){const n=Ut(`${_r}.`);return this._dispatch.on(n,t),this._listeners.push(n),{unsubscribe:()=>this._dispatch.on(n,null)}}_queryPoiLayers(){const t=this._map.getStyle();if(t.name===this._currentStyle&&t.layers.length===this._styleLayersLength)return;const n=Br(t).filter(r=>r["source-layer"]==="mapxus_place"&&r.type==="symbol");this._layerIds=n.map(({id:r})=>r),this._currentStyle=t.name,this._styleLayersLength=t.layers.length}_bindPoiClickEvent(){this._map.on("click",t=>{if(this._listeners.length===0)return;this._queryPoiLayers();const n=this._map.queryRenderedFeatures(t.point,{layers:this._layerIds});if(n.length===0)return;const r=n[0],i=Ae(r.properties["ref:sections"]),o=!!r.properties["ref:shared_level"],s={coordinate:t.lngLat,poi:r};if(i.length>0){const a=this._map.querySourceFeatures("indoor-planet",{sourceLayer:"mapxus_section"});s.sections=i.map(d=>{const u=a.find(g=>g.properties.id===d),{id:p,section:h="",correlation_id:I}=u?.properties||{},b=Oc(u?.properties);return{id:p,category:h,sectionName:b,...I&&{correlationId:I}}})}if(o){const a=r.properties["ref:shared_level"],{floor:d,venue:u}=this._queryIndoorFeaturesBySharedFloor(a);s.floor=d,s.venue=u}else{const a=r.properties["ref:level"],{floor:d,building:u,venue:p}=this._queryIndoorFeaturesByFloor(a);s.floor=d,s.building=u,s.venue=p}this._dispatch.call(_r,null,s)})}_queryIndoorFeaturesBySharedFloor(t){const n=this._map.queryRenderedFeatures({layers:[je,"mapxus-venue-fill"]}),r=n.find(u=>u.sourceLayer==="mapxus_shared_level"&&u.properties.id===t);if(!r)return{floor:null,venue:null};const i=r.properties["ref:venue"],o=n.find(u=>u.layer.id==="mapxus-venue-fill"&&u.properties.id===i)??null,{id:s,ordinal:a}=r.properties,d=Oc(r.properties);return{floor:{id:s,ordinal:a,name:d},venue:o}}_queryIndoorFeaturesByFloor(t){const n=this._map.queryRenderedFeatures({layers:[nn,"mapxus-building-line","mapxus-venue-fill"]}),r=n.find(p=>p.sourceLayer==="mapxus_level"&&p.properties.id===t);if(!r)return{floor:null,building:null,venue:null};const{id:i,ordinal:o,name:s,"ref:building":a}=r.properties||{},d=n.find(p=>p.layer.id==="mapxus-building-line"&&p.properties.id===a)??null,u=n.find(p=>p.layer.id==="mapxus-venue-fill"&&p.properties.id===d?.properties?.["ref:venue"])??null;return{floor:{id:i,ordinal:o,code:s},building:d,venue:u}}}function Oc(e){return e?Object.keys(e).filter(n=>n.includes("name")).reduce((n,r)=>{const[,i]=Ae(r,":");return i?n[i]=e[r]:n.default=e[r],n},{}):{default:""}}function Rn(e){e.parentNode&&e.parentNode.removeChild(e)}function Fe(e,t,n){const r=document.createElement(e);return t&&(r.className=t),n&&n.appendChild(r),r}class Rc{_map;_maplibre;_buildingId;_features;_$container;_$listContainer;_$buildingList;_listHeight;_language;_visible;_position="top-right";_isMobileMode;_isListShown=!1;constructor(t,n){this._map=t,this._language=t.getLanguage(),this._visible=n??!0,this._detectDeviceMode()}onAdd(t){return this._maplibre=t,this._$container=Fe("div",`maplibregl-ctrl maplibregl-ctrl-building-filter ${this._visible?"":"hide"}`,this._maplibre.getContainer()),this._$container.appendChild(this._buildingFilterIconCreate("div")),this._$container.appendChild(this._buildingNameListCreate("div")),this._bindEvents(),this._$container}onRemove(){Rn(this._$container)}get position(){return this._position}get enabled(){return this._visible}getDefaultPosition(){return"top-right"}setVisibility(t){this._visible=t,t?this._$showLayout():this._$hideLayout()}changePosition(t,n,r){const i=document.querySelector(`.maplibregl-ctrl-${t}`),o=i.querySelector(".maplibregl-ctrl-building-filter");if(t!==n){this._position=n;const s=document.querySelector(`.maplibregl-ctrl-${n}`);o&&(i.removeChild(o),Number.isFinite(r)?s.insertBefore(o,s.children[r]):s.append(o),this._updateBuildingListLayout(n))}else Number.isFinite(r)&&i.children[r]!==o&&(i.removeChild(o),i.insertBefore(o,i.children[r]))}_bindEvents(){this._maplibre.on("moveend",()=>this._refresh()),this._map.onMapChangeListener(t=>{const n=t.building?.properties?.id??"";this._buildingId!==n&&(this._buildingId=n,this._refresh())}),this._map.renderComplete(()=>this._init())}_init(){this._load()}_refresh(){this._load()}_load(){this._buildingNameListClean(),this._buildingNameListUpdate()}_buildingFilterIconCreate(t){const n=Fe(t,"mapxus-building-filter-icon");return this._bindMouseOnEvents(n,!1),this._bindMobileTouchEvents(n),n}_buildingNameListCreate(t){return this._$listContainer=Fe(t,"mapxus-building-name-layout"),this._$listContainer.style.display="none",this._$listContainer.style.top="20px",this._$buildingList=Fe(t,"mapxus-building-name-list",this._$listContainer),this._bindMouseOnEvents(this._$listContainer,!0),this._$listContainer}_buildingNameListUpdate(){this._features=[];const t=this._map.getMaplibre(),n=t?t.queryRenderedFeatures({layers:["mapxus-building-line"]}):[];for(const r of n){const{properties:i}=r,{id:o,name:s}=i,a=i?.[`name:${this._language}`]??s;this._features.find(d=>d.properties.id===o)||(this._features.push(r),this._$buildingList.appendChild(this._buildingNameCreate("p",a,o,o===this._map.building?.properties?.id)))}this._setBuildingListHeight(this._features),this._updateBuildingListLayout(this._position)}_buildingNameListClean(){this._$buildingList.replaceChildren()}_setBuildingListHeight(t){const i=t.map(o=>{const s=o?.properties?.[`name:${this._language}`]??o?.properties?.name;return s?Math.ceil(s.length*8/107):0}).reduce((o,s)=>o+s,0);this._listHeight=i*26+t.length*8,this._$buildingList.style.height=this._$listContainer.style.height=`${this._listHeight>=208?208:this._listHeight}px`}_buildingNameCreate(t,n,r,i){const o=Fe(t,`mapxus-building-name${i?" active":""}`);return o.dataset.id=r,o.innerText=n,this._buildingNameClickEvent(o),o}_toggleList(t){this._isListShown=t,this._$listContainer.style.display=t?"block":"none"}_buildingNameClickEvent(t){t.onclick||(t.onclick=async n=>{const r=n.target;await this._map.selectBuildingById(r.dataset.id)})}_bindMouseOnEvents(t,n){t.onmouseenter=()=>{this._isMobileMode||this._toggleList(!0)},n&&(t.onmouseleave=()=>this._toggleList(!1))}_bindMobileTouchEvents(t){window.addEventListener("resize",()=>this._detectDeviceMode()),t.ontouchend=()=>this._toggleList(!this._isListShown)}_$showLayout(){this._$container.classList.remove("hide")}_$hideLayout(){this._$container.classList.add("hide")}_updateBuildingListLayout(t){t.indexOf("left")>-1?(this._$listContainer.style.right=null,this._$listContainer.style.left="55px"):(this._$listContainer.style.left=null,this._$listContainer.style.right="55px");const n=this._$container.offsetParent?this._$container.offsetParent.clientHeight-(this._$container.offsetTop+this._$container.clientHeight)-25:0;t.includes("bottom")&&this._listHeight-20>n?(this._$listContainer.style.top=null,this._$listContainer.style.bottom="15px"):(this._$listContainer.style.bottom=null,this._$listContainer.style.top="20px")}_detectDeviceMode(){this._isMobileMode=window.matchMedia("(pointer: coarse) and (max-width: 768px)").matches}}var Ng=Math.max,Dg=Math.min;function $g(e,t,n){return e>=Dg(t,n)&&e<Ng(t,n)}var Pc=1/0,Vg=17976931348623157e292;function Fc(e){if(!e)return e===0?e:0;if(e=pr(e),e===Pc||e===-Pc){var t=e<0?-1:1;return t*Vg}return e===e?e:0}function kc(e,t,n){return t=Fc(t),n===void 0?(n=t,t=0):n=Fc(n),e=pr(e),$g(e,t,n)}class Mc{_container;_indoor;_maplibre;_position="top-right";_buildingId;_floorNames;_ordinals;_ordinal;_style;_$innerFloors;_$activeFloor;_centerSelectorIdx;_lastNormalScrollableIdx;_$arrowBtnUp;_$arrowBtnDown;_maxScrollTop;_$selectorExpanded;_$selectorFolded;_componentDidMount=!1;_visible=!1;_isEnabled;_dragPan;_language;_debounceScroll;_clearScrollEventListener;constructor(t,n){const{style:r,enabled:i=!0,language:o}=n;this._indoor=t,this._language=o,this._style=r?Object.assign({},ao,r):ao,this._isEnabled=i,this._addIndoorEventListeners()}onAdd(t){return this._maplibre=t,this._addMapMoveEventListener(),this._container=Fe("div","maplibregl-ctrl mapxus-ctrl-floors hidden"),this._container}onRemove(){this._debounceScroll&&this._debounceScroll.cancel(),this._clearScrollEventListener&&this._clearScrollEventListener(),Rn(this._container)}get position(){return this._position}get enabled(){return this._isEnabled}setEnabled(t){this._isEnabled=t,t&&!this._visible&&this._setVisibility(!0),!t&&this._visible&&this._setVisibility(!1)}getDefaultPosition(){return"top-right"}async switchByOrdinal(t,n){this._ordinal=t,this._dragPan=n??!0,await this._indoor.switchFloorByOrdinal(t),this._updateSelectorStatus(t),this._scrollCenterActiveFloor()}changePosition(t,n,r){const i=document.querySelector(`.maplibregl-ctrl-${t}`),o=i.querySelector(".mapxus-ctrl-floors");if(t!==n){this._position=n;const s=document.querySelector(`.maplibregl-ctrl-${n}`);o&&(i.removeChild(o),Number.isFinite(r)?s.insertBefore(o,s.children[r]):s.append(o),this._show(),this._scrollCenterActiveFloor())}else Number.isFinite(r)&&i.children[r]!==o&&(i.removeChild(o),i.insertBefore(o,i.children[r]),this._show(),this._scrollCenterActiveFloor())}setStyle(t){this._style=Object.assign({},this._style,t),this._componentDidMount&&(this._clearFloors(),this._calcSelectorLayout(),this._render(),this._scrollCenterActiveFloor())}_setVisibility(t){this._componentDidMount?t?(this._show(),this._scrollCenterActiveFloor()):this._hide():(this._visible=t,this._indoor.building&&t&&(this._render(),this._show(),this._scrollCenterActiveFloor()))}_addIndoorEventListeners(){this._indoor.on(yr,t=>{if(this._updatePrepared(),!t)return;const{ordinal:n,dragPan:r}=t;this._dragPan=r,"building"in t?this._renderBuildingFloors(t.building,n):this._renderSharedLevelFloor(t)})}_updatePrepared(){this._clearState(),this._visible&&this._hide(),this._componentDidMount&&this._clearFloors()}_renderBuildingFloors(t,n){const{level_names:r,ordinals:i,id:o}=t.properties;this._buildingId=o,this._floorNames=r.split(",").reverse(),this._ordinals=i.split(",").reverse(),this._ordinal=n,this._calcSelectorLayout(),this._render();const s=this._indoor.getFeaturesById(o,{filter:a=>a.layer.id==="mapxus-building-line"})[0];this._checkIfShowFloorSelector(s)}_renderSharedLevelFloor(t){const{name:n,ordinal:r,id:i}=t;this._floorNames=[n[this._language]||n.default],this._ordinals=[r],this._ordinal=r,this._calcSelectorLayout(),this._render();const o=this._indoor.getFeaturesById(i,{layerIds:[je]})[0];this._checkIfShowFloorSelector(o)}_checkIfShowFloorSelector(t){this.enabled&&(this._dragPan!==!1||this._dragPan===!1&&t)&&(this._show(),this._scrollCenterActiveFloor())}_addMapMoveEventListener(){this._maplibre.on("moveend",()=>{this.enabled&&this._dragPan===!1&&this._buildingId&&(this._indoor.getFeaturesById(this._buildingId,{layerIds:["mapxus-building-line"]})[0]?this._componentDidMount?this._visible||(this._show(),this._scrollCenterActiveFloor()):(this._render(),this._show(),this._scrollCenterActiveFloor()):this._componentDidMount&&this._visible&&this._hide())})}_clearState(){this._buildingId=null,this._floorNames=[],this._ordinals=[],this._ordinal=null}_calcSelectorLayout(){const{itemCount:t,itemSize:n}=this._style;this._centerSelectorIdx=Math.ceil(t/2)-1,this._maxScrollTop=(this._floorNames.length-t)*n,this._lastNormalScrollableIdx=this._floorNames.length-(t-this._centerSelectorIdx-1)-1}_render(){this._createFloors(),this._componentDidMount=!0}_hide(){this._container.classList.add("hidden"),this._visible=!1}_show(){this._container.classList.remove("hidden"),this._visible=!0}_createFloors(){this._$selectorFolded=this._$foldedSelector(this._container,()=>{this._expandSelector(!0),this._scrollCenterActiveFloor()}),this._$selectorExpanded=this._$expandedSelector(this._container,()=>this._expandSelector(!1))}_$expandedSelector(t,n){const{itemSize:r,itemCount:i,defaultFolded:o,backgroundColor:s}=this._style,a=Fe("div",`mapxus-ctrl-floors-expanded ${o?"hidden":""}`,t);if(this._floorNames.length>1){const u=Fe("div","mapxus-ctrl-floors-close",a);u.onclick=n}const d=Fe("div","mapxus-ctrl-floors-wrapper",a);return d.style.backgroundColor=s,this._floorNames.length>i&&(this._$arrowBtnUp=this._$createScrollButton(d,"up"),this._$arrowBtnUp.onclick=()=>this._handleScroll("up")),this._$innerFloors=Fe("div","mapxus-ctrl-floors-inner",d),Object.assign(this._$innerFloors.style,{maxHeight:`${r*i}px`,width:`${r}px`}),this._$createFloors(this._$innerFloors),this._floorNames.length>i&&(this._$arrowBtnDown=this._$createScrollButton(d,"down"),this._$arrowBtnDown.onclick=()=>this._handleScroll("down"),this._$innerFloors.addEventListener("scroll",this._debounceScroll=Ni(u=>{u.stopPropagation(),this._resetArrowBtnStatus(this._$innerFloors.scrollTop)},100)),this._clearScrollEventListener=()=>this._$innerFloors.removeEventListener("scroll",this._debounceScroll)),a}_$foldedSelector(t,n){const{itemSize:r,activeFontColor:i,activeBackgroundColor:o,defaultFolded:s}=this._style,a=Fe("div",`mapxus-ctrl-floors-folded mapxus-ctrl-floors-floor ${s?"":"hidden"}`,t);return a.onclick=n,Object.assign(a.style,{width:`${r}px`,height:`${r}px`,lineHeight:`${r}px`,color:i,backgroundColor:o}),a}_clearFloors(){this._container.replaceChildren(),this._componentDidMount=!1}_$createScrollButton(t,n){return Fe("div",`mapxus-ctrl-floors-arrow mapxus-ctrl-floors-floor ${n}`,t)}_$createFloors(t){const{fontColor:n,itemSize:r}=this._style;let i;this._floorNames.forEach((o,s)=>{i=Fe("div","mapxus-ctrl-floors-floor",t),i.dataset.floor=o,i.dataset.ordinal=this._ordinals[s],i.innerText=o,Object.assign(i.style,{color:n,height:`${r}px`,lineHeight:`${r}px`}),i.dataset.ordinal===this._ordinal&&(this._$activeFloor=i,this._resetActiveFloor(!0),this._$selectorFolded.innerText=o),i.onclick=async a=>{this._indoor.setDragPan("restrict"),this._indoor.dragPanHandler.setAnimated(!0),await this.switchByOrdinal(a.target.dataset.ordinal)}})}_updateSelectorStatus(t){const n=this._floorNames[this._ordinals.indexOf(t)];this._$activeFloor&&this._resetActiveFloor(!1);for(const r of this._$innerFloors.children){const i=r;i.dataset.ordinal===t&&(this._$activeFloor=i,this._resetActiveFloor(!0))}this._$selectorFolded.innerText=n}_resetArrowBtnStatus(t){t===0?this._$arrowBtnUp?.classList?.add("hidden"):this._$arrowBtnUp?.classList?.remove("hidden"),t===this._maxScrollTop?this._$arrowBtnDown?.classList?.add("hidden"):this._$arrowBtnDown?.classList?.remove("hidden")}_resetActiveFloor(t){const{activeBackgroundColor:n,backgroundColor:r,activeFontColor:i,fontColor:o}=this._style;Object.assign(this._$activeFloor.style,{color:t?i:o,backgroundColor:t?n:r,fontWeight:t?"bold":"normal",cursor:t?"auto":"pointer"}),this._$activeFloor.disabled=t}_scrollCenterActiveFloor(){if(this._ordinal){const t=this._ordinals.indexOf(this._ordinal);t>-1&&(this._$innerFloors.scrollTop=this._getScrollTop(t),this._$innerFloors.scrollTop||this._resetArrowBtnStatus(0))}}_getScrollTop(t){return kc(this._centerSelectorIdx,this._lastNormalScrollableIdx+1)?(t-this._centerSelectorIdx)*this._style.itemSize:t>this._lastNormalScrollableIdx?this._maxScrollTop:0}_handleScroll(t){const n=this._$innerFloors.scrollTop,{itemSize:r}=this._style;if(t==="up"){const i=n-r*2;this._$innerFloors.scrollTop=i<0?0:i}else if(t==="down"){const i=n+r*2;this._$innerFloors.scrollTop=i>this._maxScrollTop?this._maxScrollTop:i}}_expandSelector(t){t?(this._$selectorExpanded.classList.remove("hidden"),this._$selectorFolded.classList.add("hidden")):(this._$selectorExpanded.classList.add("hidden"),this._$selectorFolded.classList.remove("hidden"))}}class jg{_container;_isEnabled;constructor(t){this._isEnabled=t?.enabled??!0}onAdd(t){if(this._container=Fe("div","maplibregl-ctrl mapxus-ctrl-logo",t.getContainer()),this._isEnabled){const n=Fe("a","mapxus-logo",this._container);n.target="_blank",n.href="https://www.khi.co.jp/groupvision2030/mapxus.html",n.setAttribute("aria-label","Mapxus logo"),n.setAttribute("rel","noopener"),this._container.appendChild(n)}return this._container}onRemove(){Rn(this._container)}getDefaultPosition(){return"bottom-left"}}class qg{_container;_anchor;_theme;constructor(t){this._theme=t.theme?t.theme:"default"}onAdd(t){return this._container=Fe("div","maplibregl-ctrl mapxus-ctrl-attribution",t.getContainer()),this._anchor=Fe("a","mapxus-attribution",this._container),this._anchor.target="_blank",this._setCopyrightInfo(this._theme),this._anchor.setAttribute("aria-label","Mapxus attribution"),this._anchor.setAttribute("rel","noopener"),this._container.appendChild(this._anchor),this._container}onRemove(){Rn(this._container)}getDefaultPosition(){return"bottom-right"}changeTheme(t){this._setCopyrightInfo(t)}_setCopyrightInfo(t){this._anchor.innerText=t==="landsD"?"© The Government of the Hong Kong SAR":"©Mapxus driven by Kawasaki ©OpenStreetMap contributors",t==="landsD"&&(this._anchor.href="https://www.map.gov.hk/gm/")}}class Kg{_container;_$icon;_removeClickEventListener;onAdd(t){return this._container=Fe("div","maplibregl-ctrl mapxus-ctrl-collapsed-copyright",t.getContainer()),this._container.innerHTML=Gg(),this._bindEvents(),this._container}onRemove(){this._removeClickEventListener(),Rn(this._container)}getDefaultPosition(){return"bottom-right"}_bindEvents(){const t=this._container.querySelector(".mapxus-collapsed-copyright-menu");this._$icon=this._container.querySelector(".mapxus-collapsed-copyright-btn");let n=!1;this._$icon.addEventListener("click",r),this._removeClickEventListener=()=>this._$icon.removeEventListener("click",r);function r(){n=!n,i()}function i(){n?t.classList.remove("hidden"):t.classList.add("hidden")}}}function Gg(){return`
19
+ <div class="mapxus-collapsed-copyright-content">
20
+ <div class="mapxus-collapsed-copyright-menu hidden">
21
+ <div class="mapxus-collapsed-copyright-logo" onclick="window.open('https://www.khi.co.jp/groupvision2030/mapxus.html')"></div>
22
+ <div class="mapxus-collapsed-horizontal-divider"></div>
23
+ <div class="mapxus-collapsed-copyright-text" onclick="window.open('https://www.openstreetmap.org/copyright/')"></div>
24
+ </div>
25
+ <div class="mapxus-collapsed-copyright-btn"></div>
26
+ </div>
27
+ `}function Gi(e){return`${zo}/api/v3/tiles/styles/${e}`}class Hc{_buildingSelector;_isEnabled=!0;_position;constructor(t){this._buildingSelector=t}enable(){this._isEnabled=!0,this._buildingSelector.enabled||this._buildingSelector.setVisibility(!0)}disable(){this._isEnabled=!1,this._buildingSelector.enabled&&this._buildingSelector.setVisibility(!1)}setPosition(t,n){this._position=t,this._buildingSelector.changePosition(this._buildingSelector.position,t,n)}get isEnabled(){return this._isEnabled}get position(){return this._position}}class Uc{_floorSelector;_isEnabled;_position;constructor(t){this._floorSelector=t,this._position=t.position,this._isEnabled=this._floorSelector.enabled}enable(){this._isEnabled=!0,this._floorSelector.setEnabled(!0)}disable(){this._isEnabled=!1,this._floorSelector.setEnabled(!1)}setPosition(t,n){this._position=t,this._floorSelector.changePosition(this._floorSelector.position,t,n)}setStyle(t){this._floorSelector.setStyle(t)}get isEnabled(){return this._isEnabled}get position(){return this._position}}class Nc{_indoor;_isEnabled=!0;constructor(t){this._indoor=t}enable(){this._isEnabled=!0,this._indoor.setAllowBuildingSwitch(!0)}disable(){this._isEnabled=!1,this._indoor.setAllowBuildingSwitch(!1)}get isEnabled(){return this._isEnabled}}class Dc{_indoor;_isEnabled=!0;constructor(t){this._indoor=t}enable(){this._isEnabled=!0,this._indoor.setAllowOutdoorSwitch(!0)}disable(){this._isEnabled=!1,this._indoor.setAllowOutdoorSwitch(!1)}get isEnabled(){return this._isEnabled}}class $c{_indoor;_isEnabled=!0;constructor(t){this._indoor=t}enable(){this._isEnabled=!0,this._indoor.setAllowIndoorClickSelect(!0)}disable(){this._isEnabled=!1,this._indoor.setAllowIndoorClickSelect(!1)}get isEnabled(){return this._isEnabled}}class Vc{_indoor;_isEnabled=!0;constructor(t){this._indoor=t}enable(){this._isEnabled=!0,this._indoor.setAllowOutdoorClickSelect(!0)}disable(){this._isEnabled=!1,this._indoor.setAllowOutdoorClickSelect(!1)}get isEnabled(){return this._isEnabled}}const zi="Map_mapClick",Zi="Map_pointClick",Wi="Map_isRenderComplete",Pn="Map_isDestroyed",Dt=nt.getInstance();let zg=class{_map;_indoor;_poi;_floorsControl;_buildingFilterControl;_attributionControl;_language;_dispatch=Wt(zi,Zi,Wi,Pn);_fitBounds;_history=Mt.getInstance();_hiddenBuildings=Ht.getInstance().getHiddenBuildings();_debounceHTTPErrorHandler;_transformRequestHandler;_tokenRefreshingPromise=null;_request=st.getInstance();_cancelTokenChangedListener;isDestroyed=!1;switchOutdoor;outdoorClickSelection;switchBuilding;indoorClickSelection;buildingSelector;floorSelector;constructor(t){if(!t.map)throw new Error("Map is required.");if(!qc(t)&&!jc(t))throw new Error("Access params are required.");qc(t)?Dt.setAccessByAppKey({appId:t.appId,secret:t.secret,platform:t.platform}).then(async()=>{await Dt.setupTokenManager(),this._setup(t)}):jc(t)&&(Dt.setTokenGetter(t.getTokenAsync),Dt.setupTokenManager().then(()=>{this._setup(t)}))}renderComplete(t){const n=Ut(`${Wi}.`);this._dispatch.on(n,t)}destroyed(t){const n=Ut(`${Pn}.`);this._dispatch.on(n,()=>{t(),this._dispatch.on(n,null),this._dispatch._[Pn].length===0&&(delete this._dispatch,Object.freeze(this))})}setTransformRequest(t){this._transformRequestHandler=t}getIndoor(){return this._indoor}getMaplibre(){return this._map}get floor(){return this._indoor?.floor??null}get building(){return this._indoor?.building??null}get venue(){return this._indoor?.venue??null}setLanguage(t){this._language!==t&&(this._language=t);const i=(this._map?.getStyle()?.layers||[]).filter(({type:o})=>o==="symbol");for(const{id:o}of i){const s=this._map.getLayer(o),a=typeof this._map.getLayoutProperty(o,"text-field")=="string";s&&!a&&this._map.setLayoutProperty(o,"text-field",["coalesce",["get",`name:${t}`],["get","name"]])}}getLanguage(){return this._language}setOutdoorMapShown(t){this._indoor?.setOutdoorMapShown(t)}queryIndoorFeaturesByPoint(t){const{x:n,y:r}=t,i=this._map.queryRenderedFeatures([n,r],{layers:["mapxus-venue-fill","mapxus-building-line",nn,je]}),o=i.find(p=>p.layer.id==="mapxus-venue-fill");if(!o)return null;const{id:s}=o.properties,a=this._history.getBuildingUnitByVenue(s),d=this._history.getOrdinalByBuildingUnit(a.id),u=i.find(p=>p.properties?.ordinal===d);if(u){if(u.sourceLayer==="mapxus_shared_level")return{venue:o,sharedLevel:u};const p=i.find(h=>h.properties.id===u.properties["ref:building"]);return{venue:o,building:p,level:u}}}getIndoorFeaturesByCoordinates(t,n){const r=this._map.project(t),i=this._map.queryRenderedFeatures(r,{layers:["mapxus-venue-fill","mapxus-building-line","mapxus-level-fill","mapxus-level-fill-overlap-copy"]});if(i.length===0)return{venue:null,building:null,level:null};const s=i.filter(u=>u.layer.id.includes("mapxus-level-fill")).find(u=>Number.isFinite(n)?u.properties.ordinal===n+"":u.layer.id.startsWith("mapxus-level-fill"));if(!s)return{venue:null,building:null,level:null};const a=i.find(u=>u.properties.id===s.properties["ref:building"]);return{venue:i.find(u=>u.properties.id===a.properties["ref:venue"]),building:a,level:s}}getFeaturesById(t,n){return this._indoor?.getFeaturesById(t,n)||[]}async switchFloorByOrdinal(t){await this._indoor?.switchFloorByOrdinal(t)}async selectFloorById(t,n){const{dragPan:r=!0,animate:i=!0,fitBounds:o}=n||{},s=o??this._fitBounds,a=async()=>{const d=await Kc(t),{maxLat:u,maxLon:p,minLat:h,minLon:I}=d?.bbox||{};this._indoor.dragPanHandler.setBounds([I,h,p,u])};if(this._indoor.setDragPan(r),this._indoor.setFitBounds(s),this._indoor.dragPanHandler.setAnimated(i),t===this.floor?.id){if(!r)return;s?(this._indoor.dragPanHandler.getBounds()||await a(),await this._indoor.dragPanHandler.fitBounds()):this._indoor.dragPanHandler.panToCenter()}else{let d=!1,u=(this._map.getLayer("mapxus-building-line")?this._map.queryRenderedFeatures({layers:["mapxus-building-line"]}):[]).find(h=>h.properties?.level_ids?.includes(t))??null;if(u&&u.properties?.id===this.building?.properties?.id){s&&!this._indoor.dragPanHandler.getBounds()&&await a();const{level_ids:h,ordinals:I}=u.properties,b=Ae(h).indexOf(t),g=Ae(I)[b]??null;await this._floorsControl.switchByOrdinal(g,r)}else{if(u)s&&await a();else{const h=await Kc(t),{maxLat:I,maxLon:b,minLat:g,minLon:w}=h.bbox;d=!0,u=h.feature,this._indoor.dragPanHandler.setBounds([w,g,b,I])}await this._indoor.selectBuilding(u??null,{floorId:t,featureIncomplete:d})}}}async selectSharedFloorById(t,n){const{dragPan:r=!0,animate:i=!0,fitBounds:o}=n||{},s=o??this._fitBounds,a=async()=>{const d=await Zg(t),{maxLat:u,maxLon:p,minLat:h,minLon:I}=d?.bbox||{};this._indoor.dragPanHandler.setBounds([I,h,p,u])};if(this._indoor.setDragPan(r),this._indoor.setFitBounds(s),this._indoor.dragPanHandler.setAnimated(i),t===this.floor?.id){if(!r)return;s?(this._indoor.dragPanHandler.getBounds()||await a(),await this._indoor.dragPanHandler.fitBounds()):this._indoor.dragPanHandler.panToCenter()}else{let d=!1,u,p;const h=(this._map.getLayer(je)?this._map.queryRenderedFeatures({layers:[je]}):[]).find(I=>I.properties?.id===t)??null;if(h)s&&await a();else{const I=await wc(t);p=Hn(I),d=!0;const{maxLat:b,maxLon:g,minLat:w,minLon:B}=I?.bbox||{};this._indoor.dragPanHandler.setBounds([B,w,g,b]);const T=I.sharedFloors.find(({id:P})=>P===t),{id:H,name:N,ordinal:X}=T;u={id:H,name:N,ordinal:X+""}}if(!d){const{id:I,name:b,ordinal:g,"ref:venue":w}=h.properties||{};u={id:I,name:typeof b=="string"?{default:b}:b,ordinal:g},p=(this._map.getLayer("mapxus-venue-fill")?this._map.queryRenderedFeatures({layers:["mapxus-venue-fill"]}):[]).find(B=>B.properties?.id===w)??null}u&&p&&await this._indoor?.selectSharedFloor(u,p,{featureIncomplete:d})}}async selectBuildingById(t,n){const{dragPan:r=!0,animate:i=!0,fitBounds:o}=n||{},s=o??this._fitBounds,a=async()=>{const d=await fr(t),{maxLat:u,maxLon:p,minLat:h,minLon:I}=d?.bbox||{};this._indoor.dragPanHandler.setBounds([I,h,p,u])};if(this._indoor.setDragPan(r),this._indoor.setFitBounds(s),this._indoor.dragPanHandler.setAnimated(i),t===this.building?.properties?.id){if(!r)return;s?(this._indoor.dragPanHandler.getBounds()||await a(),await this._indoor.dragPanHandler.fitBounds()):this._indoor.dragPanHandler.panToCenter()}else{let d=!1,u=(this._map.getLayer("mapxus-building-line")?this._map.queryRenderedFeatures({layers:["mapxus-building-line"]}):[]).find(p=>p.properties?.id===t)??null;if(u)s&&await a();else{const p=await fr(t),{maxLat:h,maxLon:I,minLat:b,minLon:g}=p?.bbox||{};u=xr(p),d=!0,this._indoor.dragPanHandler.setBounds([g,b,I,h])}await this._indoor?.selectBuilding(u,{featureIncomplete:d})}}async selectVenueById(t,n){if(typeof t=="string"&&t.trim()===""||t===null){await this._indoor?.selectBuilding(null);return}const{dragPan:i=!0,animate:o=!0,fitBounds:s}=n||{},a=s??this._fitBounds,d=async()=>{const u=await hr(t),{maxLat:p,maxLon:h,minLat:I,minLon:b}=u?.bbox||{};this._indoor.dragPanHandler.setBounds([b,I,h,p])};if(this._indoor.setDragPan(i),this._indoor.setFitBounds(a),this._indoor.dragPanHandler.setAnimated(o),t===this.venue?.properties?.id){if(!i)return;a?(this._indoor.dragPanHandler.getBounds()||await d(),await this._indoor.dragPanHandler.fitBounds()):this._indoor.dragPanHandler.panToCenter()}else{const u=this._history.getBuildingUnitByVenue(t);if(u){const{id:p,type:h}=u;h==="building"?await this.selectBuildingById(p,n):await this.selectSharedFloorById(p,n)}else{const p=(this._map.getLayer("mapxus-venue-fill")?this._map.queryRenderedFeatures({layers:["mapxus-venue-fill"]}):[]).find(I=>I.properties?.id===t)??null;let h;if(p){const{default_displayed_building:I,building_ids:b}=p.properties;h=I||Ae(b)[0]}else{const I=await hr(t);h=I.defaultBuilding||I.buildings[0]?.id}await this.selectBuildingById(h,n)}}}onMapClickListener(t){const n=Ut(`${zi}.`);return this._dispatch.on(n,t),{unsubscribe:()=>this._dispatch.on(n,null)}}onPoiClickListener(t){return this._poi?.onPoiClick(t)}onPointClickListener(t){const n=Ut(`${Zi}.`);return this._dispatch.on(n,t),{unsubscribe:()=>this._dispatch.on(n,null)}}onMapChangeListener(t){return this._indoor?.onMapChange(t)}switchTheme(t){this._setStyle(Gi(t)),this._map?.once("styledata",()=>this._setIndoorFilter()),"changeTheme"in this._attributionControl&&this._attributionControl.changeTheme(t)}setTheme(t){this._setStyle(Gi(t)),this._map?.once("styledata",()=>this._setIndoorFilter()),"changeTheme"in this._attributionControl&&this._attributionControl.changeTheme(t)}setSelectedBuildingBorderStyle(t){return this._indoor?.setSelectedHighlightStyle(t),this}setSelectedHighlightStyle(t){return this._indoor?.setSelectedHighlightStyle(t),this}async _setup(t){const{map:n,poiId:r,sharedFloorId:i,floorId:o,buildingId:s,venueId:a,theme:d=Lr.MAPXUS_DEFAULT,floorSelectorEnabled:u,buildingSelectorEnabled:p,outdoorMapShown:h=!0,collapseCopyright:I=!1,maskNonSelectedAreas:b=!1,fitBuildingBounds:g,fitBounds:w,boundsPadding:B=30,selectedHighlightStyle:T,floorSelectorStyle:H,language:N=hl,autoSelectBuilding:X=!1,transformRequest:P=null,mapxusLogoEnabled:F=!0,enableIndoorClickSelection:q=!0,enableOutdoorClickSelection:W=!0}=t;this._map=n,this._language=N,this._fitBounds=w??g??!1,this._indoor=new xc({map:this._map,startWithIndoorView:!!(a||s||o||r||i),outdoorMapShown:h,fitBounds:this._fitBounds,boundsPadding:B,maskNonSelectedAreas:b,selectedHighlightStyle:T,enableIndoorClickSelection:q,enableOutdoorClickSelection:W}),this._poi=new Tc(this._map),this._transformRequestHandler=P,await this._resourceRequestTransform(),this._installRtlTextPlugin(),this._setStyle(Gi(d)),this._checkMapZoom(),I?this._attributionControl=new Kg:(this._attributionControl=new qg({theme:d}),this._addControl(new jg({enabled:F}))),this._addControl(this._attributionControl),this._addControl(this._buildingFilterControl=new Rc(this,p)),this._addControl(this._floorsControl=new Mc(this._indoor,{language:N,style:H,enabled:u})),r?this._selectPoiById(r):o?this.selectFloorById(o,{animate:!1}):s?this.selectBuildingById(s,{animate:!1}):a?this.selectVenueById(a,{animate:!1}):i&&this.selectSharedFloorById(i,{animate:!1}),this.switchOutdoor=new Dc(this._indoor),this.switchBuilding=new Nc(this._indoor),this.outdoorClickSelection=new Vc(this._indoor),this.indoorClickSelection=new $c(this._indoor),this.buildingSelector=new Hc(this._buildingFilterControl),this.floorSelector=new Uc(this._floorsControl),this._map.once("styledata",()=>this.setLanguage(this._language)),this._map.on("remove",()=>this._destroy()),this._map.on("error",this._debounceHTTPErrorHandler=Ni(K=>this._updatePermission(K),300)),this._indoor.once(Di,()=>{X&&this._map.on("moveend",()=>this._selectCenterBuilding()),this._bindMapClickListener(),this._bindTokenChangedListener(),this._dispatch.call(Wi)})}_setIndoorFilter(){this._indoor.updateCustomLayers(),this._indoor.updateRendering()}_setStyle(t){this._map?.setStyle(t,{localIdeographFontFamily:!1})}_addControl(t,n){this._map.addControl(t,n)}async _selectPoiById(t){try{const n=await cg(t),{lon:r,lat:i}=n.location;"floorId"in n?await this.selectFloorById(n.floorId,{animate:!1}):"sharedFloorId"in n&&await this.selectSharedFloorById(n.sharedFloorId,{animate:!1}),this._map.panTo([r,i],{animate:!1})}catch(n){this._handleSearchError(n)}}async _resourceRequestTransform(){const t=await this._request.getRequestHeaders();this._map.setTransformRequest((n,r)=>{const{host:i}=new URL(n);return i.includes("map-api")&&i.includes("mapxus")?{url:n,headers:t}:this._transformRequestHandler?this._transformRequestHandler(n,r):{url:n}})}_checkMapZoom(){const t=this._map.getZoom();(t<8||t>22)&&t>1&&console.warn("Indoor maps perform better at zoom levels [8, 22].")}async _updatePermission(t){if(t.error?.status===401)return this._tokenRefreshingPromise?this._tokenRefreshingPromise:(this._tokenRefreshingPromise=this._resourceRequestTransform().finally(()=>this._tokenRefreshingPromise=null),this._tokenRefreshingPromise)}_selectCenterBuilding(){const t=this._getCenterBuildingUnitsMap();if(!t.size)return;let n=t.entries().next().value[1];const r=this._history.getVisitedBuildingUnits().reverse();for(const i of r){const{id:o}=i;if(t.get(o)){n=i;break}}n.type==="building"?this.selectBuildingById(n.id,{dragPan:!1}):this.selectSharedFloorById(n.id,{dragPan:!1})}_getCenterBuildingUnitsMap(){const t=this._map.getCanvas().getBoundingClientRect(),n=t.width/4,r=t.height/4,i=[n,r],o=[t.width-n,t.height-r],s=["mapxus-building-line",je].filter(d=>this._map.getLayer(d));let a=this._map.queryRenderedFeatures([i,o],{layers:s});return a=Sc(a,"properties.id"),a=a.filter(d=>!this._hiddenBuildings.has(d.properties.id)),new globalThis.Map(a.map(({properties:d})=>[`${d.id}`,{id:d.id,type:d.building?"building":"sharedFloor"}]))}_bindMapClickListener(){this._map.on("click",async t=>{const{point:n,lngLat:r}=t,i=await this._indoor.queryIndoorFeaturesByClickPoint(n);await this._indoor.selectByClickMap(i),this._dispatch.call(Zi,null,{point:n,coordinate:r}),this._dispatch.call(zi,null,{coordinate:r,venue:i?.venue??null,building:i&&"building"in i?i.building:null,floor:i?"sharedFloor"in i?i.sharedFloor:i.floor??null:null})})}_bindTokenChangedListener(){const{off:t}=Dt.on(vi,async()=>{await this._resourceRequestTransform()});this._cancelTokenChangedListener=t}_handleSearchError(t){const n=t?.response?.status||"unknown",r=t?.response?.data?.message||"unknown";Dt.getGlobalDispatcher().call("initError",null,{status:n,message:r})}_installRtlTextPlugin(){Vt.getRTLTextPluginStatus()==="unavailable"&&Vt.setRTLTextPlugin("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js",!0)}_destroy(){if(this.isDestroyed)return;this.isDestroyed=!0,this._debounceHTTPErrorHandler?.cancel();const t=this._dispatch._;for(const n in t)n!==Pn&&t.hasOwnProperty(n)&&t[n].forEach(({name:r})=>{this._dispatch.on(`${n}.${r}`,null)});this._indoor.destroy(),this._poi.destroy(),Object.keys(this).forEach(n=>{n!=="isDestroyed"&&n!=="_dispatch"&&delete this[n]}),this._cancelTokenChangedListener&&this._cancelTokenChangedListener(),Dt.clearState(),this._dispatch.call(Pn)}};function jc(e){return"getTokenAsync"in e&&typeof e.getTokenAsync=="function"}function qc(e){return"appId"in e&&e.appId.trim()!==""&&"secret"in e&&e.secret.trim()!==""}async function Kc(e){const t=await ag(e);return{feature:xr(t),bbox:t.bbox}}async function Zg(e){const t=await wc(e);return{feature:Hn(t),bbox:t.bbox}}async function Fn(e,t){if(!e.hasImage(t))try{const n=await e.loadImage(t);e.addImage(t,n.data)}catch(n){throw new Error(n)}}class Wg{_maplibreMap;_layerId;_sourceId;_imageName="poi-01";_imageSize=.75;_iconAnchor="bottom";constructor(t){this._maplibreMap=t;const n=Ut();this._layerId=`MXMap_preset_marker_layer_${n}`,this._sourceId=`MXMap_preset_marker_source_${n}`}async setIcon(t){if(typeof t!="string"||!t.trim())throw new Error("Icon must be a non-empty string.");await Fn(this._maplibreMap,t.trim()),this._imageName=t}setIconSize(t){this._imageSize=t}setIconAnchor(t){this._iconAnchor=t}get layerId(){return this._layerId}get sourceId(){return this._sourceId}create(t){if(!(Array.isArray(t)&&t.length))return;const n=t.map(r=>this._createIconFeature(r));this._addIconSource(n),this._addIconLayer()}updateData(t){const n=!!(t.remove&&t.remove.length),r=!!(t.add&&t.add.length),i=!!(t.update&&t.update.length),o=this._maplibreMap.getSource(this._sourceId);if(!n&&!r&&!i||!o)return;const s={};n&&(s.remove=t.remove),r&&(s.add=t.add.map(a=>this._createIconFeature(a))),i&&(s.update=t.update.map(a=>{const d=this._createIconFeature(a),{id:u,geometry:p,properties:h}=d;return{id:u,...p&&{newGeometry:p},...h&&{addOrUpdateProperties:Object.entries(h).map(([I,b])=>({key:I,value:b}))},...!p&&!h&&{removeAllProperties:!0}}})),o.updateData(s)}remove(){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.removeLayer(this._layerId),this._maplibreMap.getSource(this._sourceId)&&this._maplibreMap.removeSource(this._sourceId)}on(t,n){const r=o=>this._handleEventListener(o,n),{unsubscribe:i}=this._maplibreMap.on(t,this._layerId,r);return{off:i}}setFilter(t){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.setFilter(this._layerId,t)}setFilterByVenue(t,n){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.setFilter(this._layerId,["any",["all",["==",["get","venueId"],t??""],["==",["get","ordinal"],n??""]],["all",["==",["get","venueId"],""],["==",["get","ordinal"],""]]])}setFilterByBuilding(t,n){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.setFilter(this._layerId,["any",["all",["==",["get","buildingId"],t??""],["==",["get","ordinal"],n??""]],["all",["==",["get","buildingId"],""],["==",["get","ordinal"],""]]])}setOpacity(t){this._maplibreMap.getLayer(this._layerId)&&this._maplibreMap.setPaintProperty(this._layerId,"icon-opacity",t)}setOpacityByVenue(t,n,r){if(this._maplibreMap.getLayer(this._layerId)){const i=["case",["all",["==",["get","venueId"],t??""],["==",["get","ordinal"],n??""]],1,["all",["==",["get","venueId"],""],["==",["get","ordinal"],""]],1,r??.5];this._maplibreMap.setPaintProperty(this._layerId,"icon-opacity",i)}}setOpacityByBuilding(t,n,r){if(this._maplibreMap.getLayer(this._layerId)){const i=["case",["all",["==",["get","buildingId"],t??""],["==",["get","ordinal"],n??""]],1,["all",["==",["get","buildingId"],""],["==",["get","ordinal"],""]],1,r??.5];this._maplibreMap.setPaintProperty(this._layerId,"icon-opacity",i)}}_createIconFeature(t){const{lngLat:n,properties:r}=t;return{id:"featureId"in t?t.featureId:void 0,type:"Feature",...n&&{geometry:{type:"Point",coordinates:n}},...r&&{properties:r}}}_addIconSource(t){const n={type:"geojson",data:{type:"FeatureCollection",features:t}};this._maplibreMap.addSource(this._sourceId,n)}_addIconLayer(){this._maplibreMap.addLayer({id:this._layerId,type:"symbol",source:this._sourceId,layout:{"icon-image":this._imageName,"icon-size":this._imageSize,"icon-anchor":this._iconAnchor,"icon-allow-overlap":!0,"icon-ignore-placement":!0}})}_handleEventListener(t,n){const{point:r}=t,i=this._maplibreMap.queryRenderedFeatures(r,{layers:[this._layerId]});n(i[0])}}function br(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}const Yi={indoorLineColor:"#45b1cc",outdoorLineColor:"#8183ba",dashedLineColor:"#969696",shuttleBusLineColor:"#fb923c",lineWidth:4,dashedLineWidth:4,disableDashedLine:!1,inactiveRouteOpacity:.5,outdoorLineOpacity:1,markerIconSize:.75,markers:{from:"poi-02",to:"poi-01",stops:["waypoint-01"]},lineSymbol:{image:"east-blue-arrow-01",size:.25,spacing:1}},wr="mmws-source-line-solid",en="mmws-layer-line-solid",tn="mmws-layer-icon-line-symbol",Xi="mmws-source-line-dashed",$t="mmws-layer-line-dashed",Ji="mmws-source-icon-connector",Gc="mmws-layer-icon-connector",vr="mmws-source-icon-marker",Qi="mmws-layer-icon-marker",zc=[en,tn,$t,Gc,Qi],Yg=[wr,Xi,Ji,vr];class Xg{_maplibreMap;_routeStyle=Yi;_styleDiffs={};_filterBy="venue";_curVenue=null;_curBuilding=null;_curOrdinal=null;_renderBoundaryLayer;constructor(t,n){this._maplibreMap=t,n&&(this._updateStyleProperties(n),t.on("load",()=>this._loadMarkerIcons()))}async setStyle(t){this._updateStyleProperties(t),await this._loadMarkerIcons(),await this._updateLayers()}async setMarkerIcons(t){if(Array.isArray(t)&&t.length){const n=t.slice(1,t.length-1);this._routeStyle.markers={from:t[0],to:br(t),stops:n.length?n:[t[0]]},this._styleDiffs={markers:this._routeStyle.markers}}else"from"in t&&(this._routeStyle.markers.from=t.from,this._styleDiffs.markers.from=t.from),"to"in t&&(this._routeStyle.markers.to=t.to,this._styleDiffs.markers.to=t.to),"stops"in t&&(this._routeStyle.markers.stops=t.stops??[null],this._styleDiffs.markers.stops=t.stops??[null]);await this._loadMarkerIcons()}setMarkerIconSize(t){return this._routeStyle.markerIconSize=t,this}setIndoorLineColor(t){return this._routeStyle.indoorLineColor=t,this}setOutdoorLineColor(t){return this._routeStyle.outdoorLineColor=t,this}setDashedLineColor(t){return this._routeStyle.dashedLineColor=t,this}setBusLineColor(t){return this._routeStyle.shuttleBusLineColor=t,this}render(t,n){if(!this._renderBoundaryLayer){const u=this._maplibreMap.getStyle(),p=Br(u);let h=p.find(({type:I,id:b})=>!b.includes("-overlap-copy")&&I==="fill-extrusion");h||(h=p.find(I=>I.type==="symbol"&&I?.["source-layer"]==="mapxus_place")),this._renderBoundaryLayer=h?.id}const{instructions:r,points:{coordinates:i}}=t,{lineFeatures:o,connectorFeatures:s,dashedLineFeatures:a,markerFeatures:d}=this._classifyFeatures(r,i,n);this._renderSolidLines(o),this._renderLineSymbols(wr,tn),this._routeStyle.disableDashedLine!==!0&&this._renderDashedLines(a),this._renderConnectors(s),this._renderMarkers(d)}remove(){zc.forEach(t=>{this._maplibreMap.getLayer(t)&&this._maplibreMap.removeLayer(t)}),Yg.forEach(t=>{this._maplibreMap.getSource(t)&&this._maplibreMap.removeSource(t)})}setFilterByVenue(t,n){this._filterBy="venue",this._curVenue=t??null,this._curOrdinal=n??null,this._filterRouteOpacity()}setFilterByBuilding(t,n){this._filterBy="building",this._curBuilding=t??null,this._curOrdinal=n??null,this._filterRouteOpacity()}_classifyFeatures(t,n,r){const i=[],o=[],s=[],a=[],d=[];t.forEach((W,K)=>{const{venue_id:J,building_id:te,floor_id:ne,ordinal:Y,sign:Q,type:v,interval:[D,x]}=W;if(Qg(Q))d.push(W);else if(Jg(Q)){K!==0&&K!==t.length-1&&o.push(this._createIconFeature(`connector-${o.length}`,n[D],{...gt({venue_id:J,building_id:te,floor_id:ne,ordinal:Y}),icon:v}));const S=t[K+1];if(S){const{venue_id:C,building_id:V,floor_id:f,ordinal:y}=S;o.push(this._createIconFeature(`connector-${o.length}`,n[x],{...gt({venue_id:C,building_id:V,floor_id:f,ordinal:y}),icon:v}))}}else i.push(this._createLineFeature(`solid-line-${i.length}`,n.slice(D,x+1),gt({venue_id:J,building_id:te,floor_id:ne,ordinal:Y,isShuttleBus:em(Q)?1:0})))});const u=t[0],{venue_id:p,building_id:h,floor_id:I,ordinal:b}=u,g=t[t.length-1],{venue_id:w,building_id:B,floor_id:T,ordinal:H}=g,N=n[0],X=n[n.length-1],P=r[0],F=r[r.length-1],q=r.slice(1,r.length-1);return P&&s.push(this._createLineFeature(`dashed-line-${s.length}`,[P,N],gt({venue_id:p,building_id:h,floor_id:I,ordinal:b}))),F&&s.push(this._createLineFeature(`dashed-line-${s.length}`,[X,F],gt({venue_id:w,building_id:B,floor_id:T,ordinal:H}))),d.length&&q.length&&d.forEach(({venue_id:W,building_id:K,floor_id:J,ordinal:te,interval:[ne]},Y)=>{s.push(this._createLineFeature(`dashed-line-${s.length}`,[n[ne],q[Y]],gt({venue_id:W,building_id:K,floor_id:J,ordinal:te}))),a.push(this._createIconFeature(`marker-${a.length}`,q[Y],{...gt({venue_id:W,building_id:K,floor_id:J,ordinal:te,markerType:`stops_${Y}`}),icon:this._routeStyle.markers.stops[Y]??br(this._routeStyle.markers.stops),iconSize:this._routeStyle.markerIconSize}))}),a.push(this._createIconFeature(`marker-${a.length}`,P??N,{...gt({venue_id:p,building_id:h,floor_id:I,ordinal:b,markerType:"from"}),icon:this._routeStyle.markers.from,iconSize:this._routeStyle.markerIconSize})),a.push(this._createIconFeature(`marker-${a.length}`,F??X,{...gt({venue_id:w,building_id:B,floor_id:T,ordinal:H,markerType:"to"}),icon:this._routeStyle.markers.to,iconSize:this._routeStyle.markerIconSize})),{lineFeatures:i,connectorFeatures:o,dashedLineFeatures:s,markerFeatures:a}}_createLineFeature(t,n,r){return{id:t,type:"Feature",geometry:{type:"LineString",coordinates:n},properties:r}}_createIconFeature(t,n,r){return{id:t,type:"Feature",geometry:{type:"Point",coordinates:n},properties:r}}_renderSolidLines(t){this._addCollectionSource(wr,t),this._addLineLayer(wr,en,{"line-color":["case",["==",["get","isShuttleBus"],"1"],this._routeStyle.shuttleBusLineColor,["==",["get","floor_id"],null],this._routeStyle.outdoorLineColor,this._routeStyle.indoorLineColor],"line-opacity":["case",["==",["get","floor_id"],null],this._routeStyle.outdoorLineOpacity,1],"line-width":this._routeStyle.lineWidth})}_renderDashedLines(t){this._addCollectionSource(Xi,t),this._addLineLayer(Xi,$t,{"line-color":this._routeStyle.dashedLineColor,"line-width":this._routeStyle.dashedLineWidth,"line-dasharray":[.1,1.8]})}_renderConnectors(t){this._addCollectionSource(Ji,t),this._addIconLayer(Ji,Gc)}_renderMarkers(t){this._addCollectionSource(vr,t),this._addIconLayer(vr,Qi,{"icon-anchor":"bottom","icon-allow-overlap":!0,"icon-ignore-placement":!0})}_addCollectionSource(t,n){this._maplibreMap.addSource(t,{type:"geojson",data:{type:"FeatureCollection",features:n}})}_addLineLayer(t,n,r){this._maplibreMap.addLayer({id:n,type:"line",source:t,layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":4,...r||{}}},this._renderBoundaryLayer)}_renderLineSymbols(t,n){this._maplibreMap.addLayer({id:n,type:"symbol",source:t,layout:{"symbol-placement":"line","symbol-spacing":this._routeStyle.lineSymbol.spacing,"icon-size":this._routeStyle.lineSymbol.size,"icon-image":this._routeStyle.lineSymbol.image},paint:{"icon-opacity":["case",["==",["get","floor_id"],null],this._routeStyle.outdoorLineOpacity,1]}},this._renderBoundaryLayer)}_addIconLayer(t,n,r){this._maplibreMap.addLayer({id:n,type:"symbol",source:t,layout:{"icon-image":["get","icon"],"icon-size":["case",["has","iconSize"],["get","iconSize"],1],...r||{}}})}_updateStyleProperties(t){if(this._styleDiffs=Zc(this._routeStyle,t??Yi),!t)this._routeStyle=Yi;else if(Object.keys(this._styleDiffs).length){const n={...this._routeStyle.lineSymbol,...this._styleDiffs.lineSymbol??{}},r=this._styleDiffs.markers;let i=this._routeStyle.markers;const o={outdoorLineOpacity:(this._styleDiffs.outdoorLineOpacity>1?1:this._styleDiffs.outdoorLineOpacity<0?0:this._styleDiffs.outdoorLineOpacity)??this._routeStyle.outdoorLineOpacity},s={inactiveRouteOpacity:(this._styleDiffs.inactiveRouteOpacity>1?1:this._styleDiffs.inactiveRouteOpacity<0?0:this._styleDiffs.inactiveRouteOpacity)??this._routeStyle.inactiveRouteOpacity};r&&Object.keys(r).length&&(i={...i,...r}),this._routeStyle={...this._routeStyle,...this._styleDiffs,...o,...s,markers:i,lineSymbol:n}}}async _loadMarkerIcons(){const{markers:t,lineSymbol:n}=this._styleDiffs;if(n?.image&&await Fn(this._maplibreMap,n.image),t&&Object.keys(t).length){const{from:r,to:i,stops:o}=t;if(r&&await Fn(this._maplibreMap,r),i&&await Fn(this._maplibreMap,i),o&&o.length){const s=o.filter(a=>!!a);s.length&&await Promise.all(s.map(a=>Fn(this._maplibreMap,a)))}}}async _updateLayers(){if(!this._maplibreMap.getLayer(en))return;const{indoorLineColor:t,outdoorLineColor:n,dashedLineColor:r,shuttleBusLineColor:i,lineWidth:o,dashedLineWidth:s,disableDashedLine:a,inactiveRouteOpacity:d,outdoorLineOpacity:u,markerIconSize:p,markers:h,lineSymbol:I}=this._styleDiffs;if((t||n||i)&&this._maplibreMap.setPaintProperty(en,"line-color",["case",["==",["get","isShuttleBus"],"1"],this._routeStyle.shuttleBusLineColor,["==",["get","floor_id"],null],this._routeStyle.outdoorLineColor,this._routeStyle.indoorLineColor]),o!==void 0&&o+""&&this._maplibreMap.setPaintProperty(en,"line-width",o),typeof a=="boolean"?a?this._maplibreMap.setPaintProperty($t,"line-color","transparent"):(this._maplibreMap.setPaintProperty($t,"line-color",this._routeStyle.dashedLineColor),this._maplibreMap.setPaintProperty($t,"line-width",this._routeStyle.dashedLineWidth)):this._routeStyle.disableDashedLine!==!0&&(r&&this._maplibreMap.setPaintProperty($t,"line-color",r),s!==void 0&&s+""&&this._maplibreMap.setPaintProperty($t,"line-width",s)),d!==void 0&&d+""&&this._filterRouteOpacity(),p!==void 0&&p+""&&this._maplibreMap.setLayoutProperty(Qi,"icon-size",p),h&&Object.keys(h).length){const{from:b,to:g,stops:w}=h,B=this._maplibreMap.getSource(vr),T=await B.getData();T.features=T.features.map(H=>{const{markerType:N}=H.properties;if(b!==void 0&&N==="from"&&(H.properties.icon=b),g!==void 0&&N==="to"&&(H.properties.icon=g),w&&N.includes("stops")){const X=parseInt(N.split("_")[1]);H.properties.icon=w[X]??br(w)}return H}),B.setData(T)}if(I){const{image:b,size:g,spacing:w}=I;b!==void 0&&this._maplibreMap.setLayoutProperty(tn,"icon-image",b),g!==void 0&&g+""&&this._maplibreMap.setLayoutProperty(tn,"icon-size",g),w!==void 0&&w+""&&this._maplibreMap.setLayoutProperty(tn,"symbol-spacing",w)}u!==void 0&&u+""&&(this._maplibreMap.setPaintProperty(en,"line-opacity",["case",["==",["get","floor_id"],null],u,1]),this._maplibreMap.setPaintProperty(tn,"icon-opacity",["case",["==",["get","floor_id"],null],u,1]),this._filterRouteOpacity())}_filterRouteOpacity(){let t;switch(this._filterBy){case"venue":t=["case",["all",["==",["get","ordinal"],this._curOrdinal??""],["==",["get","venue_id"],this._curVenue??""]],1,["==",["get","floor_id"],null],this._routeStyle.outdoorLineOpacity,this._routeStyle.inactiveRouteOpacity];break;case"building":t=["case",["all",["==",["get","ordinal"],this._curOrdinal??""],["==",["get","building_id"],this._curBuilding??""]],1,["==",["get","floor_id"],null],this._routeStyle.outdoorLineOpacity,this._routeStyle.inactiveRouteOpacity];break}zc.forEach(n=>{this._maplibreMap.getLayer(n)&&this._maplibreMap.setPaintProperty(n,n.includes("layer-line")?"line-opacity":"icon-opacity",t)})}}function gt(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Number.isFinite(n)?n+"":n]))}function Jg(e){return e===100||e===-100}function Qg(e){return e===5}function em(e){return kc(e,104,108)}function Zc(e,t){const n={};for(const r in t){const i=e[r],o=t[r];if(r==="markers"||r==="lineSymbol")if(Array.isArray(o)){const s=o.slice(1,o.length-1);n[r]={from:o[0],to:br(o),stops:s.length?s:[o[0]]}}else{const s=Zc(i,o);Object.keys(s).length&&(n[r]=s)}else o+""!=i+""&&(n[r]=r==="stops"?o??[null]:o)}return n}class kn extends Error{}kn.prototype.name="InvalidTokenError";function tm(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function nm(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return tm(t)}catch{return atob(t)}}function rm(e,t){if(typeof e!="string")throw new kn("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new kn(`Invalid token specified: missing part #${n+1}`);let i;try{i=nm(r)}catch(o){throw new kn(`Invalid token specified: invalid base64 for part #${n+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new kn(`Invalid token specified: invalid json for part #${n+1} (${o.message})`)}}const im="permission-disconnected";class ke extends Sr.TinyEmitter{static instance;static platform={sdkVersion:yn.version,identifier:""};_appIds=new Map([[St.Access,{}],[St.Map,{}]]);_tokenStorage={};_appIdsHistory=[];static getInstance(){return ke.instance||(ke.instance=new ke),ke.instance}static setPlatform(t){ke.platform=t}updateToken(t){const{appId:n,secret:r,token:i,from:o}=t;this._tokenStorage[n]=i,this._appIds.get(o)[n]=r,this._appIdsHistory.push(n)}deleteToken(t,n){delete this._tokenStorage[t],n&&(delete this._appIds.get(n)[t],this.emit(im,{appId:t,from:n}))}getVersion(){return ke.platform.sdkVersion}getToken(t){return this._tokenStorage[t]}async getIdentifier(){if(!ke.platform.identifier){const n=await(await Es.load()).get();ke.platform.identifier=n.visitorId}return ke.platform.identifier}getAppId(t){const n=t?Object.keys(this._appIds.get(t)):[...Object.keys(this._appIds.get(St.Access)),...Object.keys(this._appIds.get(St.Map))];return this._appIdsHistory.reverse().find(r=>n.includes(r))}async fetchToken(t,n,r=0){try{const i={appId:t,secret:n,..."bundleId"in ke.platform?{bundleId:ke.platform.bundleId}:"sha1"in ke.platform?{sha1:ke.platform.sha1,packageName:ke.platform.packageName}:{origin:window.location.hostname||"restriction.test.example.com",keyPlatform:"WEB"}},o={"Content-Type":"application/json",sdkVersion:ke.platform.sdkVersion,identifier:ke.platform.identifier??await this.getIdentifier()};return(await(await fetch(Go,{method:"POST",body:JSON.stringify(i),headers:o})).json()).result.idToken}catch(i){if(r<3){const o=500*Math.pow(2,r);return console.warn(`Retrying to fetch token in ${o} ms...`,++r),await new Promise(s=>setTimeout(s,o)),this.fetchToken(t,n,r)}else throw i}}}class om extends Sr.TinyEmitter{_appId=null;_secret=null;isClosed=!1;_timeoutId;_isInitialized=!1;_initializationPromise;_tokenManager=ke.getInstance();_from;constructor(t,n,r=St.Access){super(),this._from=r,this._appId=t,this._secret=n,this._initializationPromise=this._initToken()}async ready(){await this._initializationPromise}get appId(){return this._appId}get token(){if(!this._isInitialized)throw new Error("Token is not initialized yet. Use the 'ready' method to wait for initialization.");return this._tokenManager.getToken(this._appId)}close(){this.isClosed||(this._timeoutId&&clearTimeout(this._timeoutId),this._tokenManager.deleteToken(this._appId,this._from),this.emit("updated",{appId:this._appId,token:null}),Object.keys(this).forEach(t=>{t!=="isClosed"&&t!=="_events"&&delete this[t]}),this.isClosed=!0,this.emit("closed"),delete this._events,Object.freeze(this))}forceUpdateToken(){this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=null),this._isInitialized=!1,this._initializationPromise=this._initToken()}async _initToken(){try{const t=await this._tokenManager.fetchToken(this._appId,this._secret);this._isInitialized=!0,this._tokenManager.updateToken({appId:this._appId,secret:this._secret,token:t,from:this._from});const n=rm(t),r=(n.exp-n.iat-60)*1e3;this._loopUpdateToken(r)}catch(t){throw this.emit("error",new Error("Failed to initialize token.",{cause:t})),t}}_loopUpdateToken(t){this.isClosed||(this._timeoutId=setTimeout(async()=>{try{const n=await this._tokenManager.fetchToken(this._appId,this._secret);this._tokenManager.updateToken({appId:this._appId,secret:this._secret,token:n,from:this._from}),this.emit("updated",{appId:this._appId,token:n}),this._loopUpdateToken(t)}catch(n){this.emit("error",new Error("Failed to update token.",{cause:n}))}},t))}}const sm=yn.version,Wc=["unauthorized","initError"],eo=globalThis,to=Wt(...Wc);nt.getInstance().setGlobalDispatcher(to),eo.MapxusMapEvents=eo.MapxusMapEvents||{},eo.MapxusMapEvents.on=function(e,t){return to.on(e,t),{off:()=>to.on(e,null)}},_e.ASSISTANT_LAYER_INDOOR_FLOORS=nn,_e.ASSISTANT_LAYER_SHARED_FLOORS=je,_e.AccessControl=om,_e.AccessControlOrigin=St,_e.BuildingFilterControl=Rc,_e.BuildingSelectorHandler=Hc,_e.BuildingsService=gc,_e.DistanceSearchType=io,_e.ERRORS=Wc,_e.FloorSelectorHandler=Uc,_e.FloorsControl=Mc,_e.Indoor=xc,_e.IndoorClickSelection=$c,_e.Map=zg,_e.Marker=Wg,_e.OFFSET=Ge,_e.OrientationDistanceSearchType=Cr,_e.OutdoorClickSelection=Vc,_e.PAGE=ze,_e.Poi=Tc,_e.PoisOrderBy=oo,_e.PoisService=mc,_e.PoisSortBy=so,_e.PresetLanguage=De,_e.RoutePainter=Xg,_e.RouteService=ig,_e.SwitchBuildingHandler=Nc,_e.SwitchOutdoorHandler=Dc,_e.ThemeType=Lr,_e.VERSION=sm,_e.VehicleType=Ar,_e.VenuesService=yc,_e.__internal=Wf,_e.convertBrowserLangToPresetLang=ro,_e.getAccessToken=va,_e.getIdentifier=xs,_e.setGetTokenAsync=Qf,_e.setupTokenManager=eh,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})}));