hytopia 0.6.20 → 0.6.21
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/bun-server.mjs +3 -3
- package/node-server.mjs +2 -2
- package/package.json +1 -1
package/node-server.mjs
CHANGED
@@ -457,12 +457,12 @@ qYGMwU/HBVHkLAn5XvT2a9xM0mzZ558d+ahbw8qAgRxg7BZ+2PW/bf7F2WRBUk1f
|
|
457
457
|
xauhAoGBALEspoxQozwohGQnP7EMF0/0JoKNpdNv0b0qCVvNiMo0+N297lI2mFQp
|
458
458
|
6xYlW/1l9afLokklF/J2IsyBrTCZoY7SaEk/lMMrQSyra+y0z71ogZ8A4ny9fxsj
|
459
459
|
0dDYJZGllL+3E/MQfd7k+KnOM/+A+cPoAnci76+L3vdkUb2P8SJk
|
460
|
-
-----END RSA PRIVATE KEY-----`;var Uv=process.env.PORT??8080,Lv="0.6.
|
460
|
+
-----END RSA PRIVATE KEY-----`;var Uv=process.env.PORT??8080,Lv="0.6.21",Bv;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(Bv||={});class IW extends j0{static instance=new IW;_webserver=Cj.default();_internalHttpServer;constructor(){super();this._webserver.use((Z,J,X)=>{J.header("Access-Control-Allow-Origin","*"),X()}),this._webserver.get("/",(Z,J)=>{J.json({status:"OK",version:Lv,runtime:typeof Bun!=="undefined"?"bun":"node"})}),this._webserver.use(Cj.default.static("assets"));try{this._webserver.use(Cj.default.static(Cn1.dirname(g.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?Pn1.createServer(this._webserver):Dn1.createServer({key:Dj.existsSync("assets/certs/localhost.key")?Dj.readFileSync("assets/certs/localhost.key"):pY0,cert:Dj.existsSync("assets/certs/localhost.crt")?Dj.readFileSync("assets/certs/localhost.crt"):lY0},this._webserver),this._internalHttpServer.on("upgrade",this._onUpgrade),this._internalHttpServer.on("error",this._onError),this._internalHttpServer.on("close",this._onStopped);else u.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(Uv,this._onStarted),console.info(`WebServer.start(): Server running on port ${Uv}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return u.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let Y=Tn1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&S7.instance.isValidConnectionId($))Z.connectionId=$;else{let K=await N7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
|
461
461
|
Content-Type: text/plain\r
|
462
462
|
Content-Length: ${W.length}\r
|
463
463
|
Connection: close\r
|
464
464
|
\r
|
465
|
-
${W}`),J.end();return}if(K)Z.session=K}J.setNoDelay(!0),this.emitWithGlobal("WEBSERVER.UPGRADE",{req:Z,socket:J,head:X})};_onError=(Z)=>{u.error(`WebServer._onError(): ${Z.message}`),this.emitWithGlobal("WEBSERVER.ERROR",{error:Z})};_onStopped=()=>{this.emitWithGlobal("WEBSERVER.STOPPED",{})}}class S7 extends j0{static instance=new S7;_connections=new Map;_wss;_wrtcMinPort=process.env.WRTC_MIN_PORT?parseInt(process.env.WRTC_MIN_PORT):40000;_wrtcMaxPort=process.env.WRTC_MAX_PORT?parseInt(process.env.WRTC_MAX_PORT):41023;_wrtcPublicIpv4=process.env.NODE_ENV==="production"?process.env.WRTC_PUBLIC_IPV4:"127.0.0.1";_wrtcPublicIpv6=process.env.NODE_ENV==="production"?process.env.WRTC_PUBLIC_IPV6:"::";_wrtcRouter=null;_wrtcWorker=null;constructor(){super();this._wss=new fk.default({noServer:!0}),this._wss.on("connection",this._onConnection),this._wss.on("error",this._onError),this._initWrtc().catch((Z)=>{u.warning(`Socket._constructor(): Failed to initialize WebRTC, falling back to Websockets. This can be ignored for local development. Error: ${Z.message}`)}),j0.globalInstance.on("WEBSERVER.UPGRADE",({req:Z,socket:J,head:X})=>{this._onUpgrade(Z,J,X)})}get isWrtcEnabled(){return this._wrtcWorker&&!this._wrtcWorker.died&&this._wrtcRouter}get wrtcRouter(){return this._wrtcRouter}async createWrtcTransports(){if(!this.isWrtcEnabled)u.fatalError("Socket.createWrtcTransports(): WebRTC not enabled, unable to create transports.");let Z={listenIps:[{ip:"::",announcedIp:this._wrtcPublicIpv6},{ip:"0.0.0.0",announcedIp:this._wrtcPublicIpv4}],preferUdp:!0,enableSctp:!0,enableTcp:!1},J=await this._wrtcRouter.createDirectTransport(),X=await this._wrtcRouter.createWebRtcTransport(Z),Y=await this._wrtcRouter.createWebRtcTransport(Z);return{directTransport:J,clientServerTransport:X,serverClientTransport:Y}}isValidConnectionId(Z){return this._connections.has(Z)}async _initWrtc(){if(!this._wrtcPublicIpv4||!this._wrtcPublicIpv6)throw new Error("Socket._initWrtc(): WebRTC disabled, falling back to Websockets. Env variables WRTC_PUBLIC_IPV4 and WRTC_PUBLIC_IPV6 must be set in production");this._wrtcWorker=await En1.createWorker({rtcMinPort:this._wrtcMinPort,rtcMaxPort:this._wrtcMaxPort}),this._wrtcWorker.on("died",this._onWrtcWorkerDied),this._wrtcRouter=await this._wrtcWorker.createRouter({mediaCodecs:[]}),console.log("Socket._initWrtc(): WebRTC enabled and ready!")}_onConnection=(Z,J)=>{let X=J.connectionId;if(X&&this._connections.has(X))this._connections.get(X).bindWs(Z);else{let Y=new _4(Z,J);Y.on("CONNECTION.CLOSED",()=>{this._connections.delete(Y.id)}),this._connections.set(Y.id,Y)}};_onError=(Z,J)=>{this.emitWithGlobal("SOCKET.ERROR",{ws:Z,error:J})};_onUpgrade=(Z,J,X)=>{this._wss.handleUpgrade(Z,J,X,(Y)=>{this._wss.emit("connection",Y,Z)})};_onWrtcWorkerDied=(Z)=>{u.warning(`Socket._onWrtcWorkerDied(): WebRTC worker unexpectedly died, falling back to Websockets for all players. Internal error: ${Z}`),$9.instance.getConnectedPlayers().forEach((J)=>{J.connection.closeWrtc()}),this._wrtcRouter?.close(),this._wrtcRouter=null,this._wrtcWorker?.close(),this._wrtcWorker=null}}var q0=typeof __SENTRY_DEBUG__==="undefined"||__SENTRY_DEBUG__;var x8="9.22.0";var I0=globalThis;function W5(){return WX(I0),I0}function WX(Z){let J=Z.__SENTRY__=Z.__SENTRY__||{};return J.version=J.version||x8,J[x8]=J[x8]||{}}function D$(Z,J,X=I0){let Y=X.__SENTRY__=X.__SENTRY__||{},$=Y[x8]=Y[x8]||{};return $[Z]||($[Z]=J())}var iY0=Object.prototype.toString;function Tj(Z){switch(iY0.call(Z)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return yZ(Z,Error)}}function Ej(Z,J){return iY0.call(Z)===`[object ${J}]`}function nY0(Z){return Ej(Z,"ErrorEvent")}function C$(Z){return Ej(Z,"String")}function kz(Z){return typeof Z==="object"&&Z!==null&&"__sentry_template_string__"in Z&&"__sentry_template_values__"in Z}function Iz(Z){return Z===null||kz(Z)||typeof Z!=="object"&&typeof Z!=="function"}function GX(Z){return Ej(Z,"Object")}function aY0(Z){return typeof Event!=="undefined"&&yZ(Z,Event)}function sY0(Z){return typeof Element!=="undefined"&&yZ(Z,Element)}function oY0(Z){return Ej(Z,"RegExp")}function A7(Z){return Boolean(Z?.then&&typeof Z.then==="function")}function rY0(Z){return GX(Z)&&"nativeEvent"in Z&&"preventDefault"in Z&&"stopPropagation"in Z}function yZ(Z,J){try{return Z instanceof J}catch(X){return!1}}function kj(Z){return!!(typeof Z==="object"&&Z!==null&&(Z.__isVue||Z._isVue))}var In1=I0,_n1=80;function tY0(Z,J={}){if(!Z)return"<unknown>";try{let X=Z,Y=5,$=[],Q=0,K=0,W=" > ",G=W.length,V,H=Array.isArray(J)?J:J.keyAttrs,F=!Array.isArray(J)&&J.maxStringLength||_n1;while(X&&Q++<Y){if(V=vn1(X,H),V==="html"||Q>1&&K+$.length*G+V.length>=F)break;$.push(V),K+=V.length,X=X.parentNode}return $.reverse().join(W)}catch(X){return"<unknown>"}}function vn1(Z,J){let X=Z,Y=[];if(!X?.tagName)return"";if(In1.HTMLElement){if(X instanceof HTMLElement&&X.dataset){if(X.dataset.sentryComponent)return X.dataset.sentryComponent;if(X.dataset.sentryElement)return X.dataset.sentryElement}}Y.push(X.tagName.toLowerCase());let $=J?.length?J.filter((K)=>X.getAttribute(K)).map((K)=>[K,X.getAttribute(K)]):null;if($?.length)$.forEach((K)=>{Y.push(`[${K[0]}="${K[1]}"]`)});else{if(X.id)Y.push(`#${X.id}`);let K=X.className;if(K&&C$(K)){let W=K.split(/\s+/);for(let G of W)Y.push(`.${G}`)}}let Q=["aria-label","type","name","title","alt"];for(let K of Q){let W=X.getAttribute(K);if(W)Y.push(`[${K}="${W}"]`)}return Y.join("")}var Sn1="Sentry Logger ",T$=["debug","info","warn","error","log","assert","trace"],_W={};function D8(Z){if(!("console"in I0))return Z();let J=I0.console,X={},Y=Object.keys(_W);Y.forEach(($)=>{let Q=_W[$];X[$]=J[$],J[$]=Q});try{return Z()}finally{Y.forEach(($)=>{J[$]=X[$]})}}function An1(){let Z=!1,J={enable:()=>{Z=!0},disable:()=>{Z=!1},isEnabled:()=>Z};if(q0)T$.forEach((X)=>{J[X]=(...Y)=>{if(Z)D8(()=>{I0.console[X](`${Sn1}[${X}]:`,...Y)})}});else T$.forEach((X)=>{J[X]=()=>{return}});return J}var l=D$("logger",An1);function x7(Z,J=0){if(typeof Z!=="string"||J===0)return Z;return Z.length<=J?Z:`${Z.slice(0,J)}...`}function wv(Z,J){let X=Z,Y=X.length;if(Y<=150)return X;if(J>Y)J=Y;let $=Math.max(J-60,0);if($<5)$=0;let Q=Math.min($+140,Y);if(Q>Y-5)Q=Y;if(Q===Y)$=Math.max(Q-140,0);if(X=X.slice($,Q),$>0)X=`'{snip} ${X}`;if(Q<Y)X+=" {snip}";return X}function jv(Z,J){if(!Array.isArray(Z))return"";let X=[];for(let Y=0;Y<Z.length;Y++){let $=Z[Y];try{if(kj($))X.push("[VueViewModel]");else X.push(String($))}catch(Q){X.push("[value cannot be serialized]")}}return X.join(J)}function eY0(Z,J,X=!1){if(!C$(Z))return!1;if(oY0(J))return J.test(Z);if(C$(J))return X?Z===J:Z.includes(J);return!1}function VX(Z,J=[],X=!1){return J.some((Y)=>eY0(Z,Y,X))}function Ov(Z,J,X){if(!(J in Z))return;let Y=Z[J];if(typeof Y!=="function")return;let $=X(Y);if(typeof $==="function")X$0($,Y);try{Z[J]=$}catch{q0&&l.log(`Failed to replace method "${J}" in object`,Z)}}function W6(Z,J,X){try{Object.defineProperty(Z,J,{value:X,writable:!0,configurable:!0})}catch(Y){q0&&l.log(`Failed to add non-enumerable property "${J}" to object`,Z)}}function X$0(Z,J){try{let X=J.prototype||{};Z.prototype=J.prototype=X,W6(Z,"__sentry_original__",J)}catch(X){}}function Nv(Z){return Z.__sentry_original__}function Ij(Z){if(Tj(Z))return{message:Z.message,name:Z.name,stack:Z.stack,...J$0(Z)};else if(aY0(Z)){let J={type:Z.type,target:Z$0(Z.target),currentTarget:Z$0(Z.currentTarget),...J$0(Z)};if(typeof CustomEvent!=="undefined"&&yZ(Z,CustomEvent))J.detail=Z.detail;return J}else return Z}function Z$0(Z){try{return sY0(Z)?tY0(Z):Object.prototype.toString.call(Z)}catch(J){return"<unknown>"}}function J$0(Z){if(typeof Z==="object"&&Z!==null){let J={};for(let X in Z)if(Object.prototype.hasOwnProperty.call(Z,X))J[X]=Z[X];return J}else return{}}function Rv(Z,J=40){let X=Object.keys(Ij(Z));X.sort();let Y=X[0];if(!Y)return"[object has no keys]";if(Y.length>=J)return x7(Y,J);for(let $=X.length;$>0;$--){let Q=X.slice(0,$).join(", ");if(Q.length>J)continue;if($===X.length)return Q;return x7(Q,J)}return""}function xn1(){let Z=I0;return Z.crypto||Z.msCrypto}function l8(Z=xn1()){let J=()=>Math.random()*16;try{if(Z?.randomUUID)return Z.randomUUID().replace(/-/g,"");if(Z?.getRandomValues)J=()=>{let X=new Uint8Array(1);return Z.getRandomValues(X),X[0]}}catch(X){}return([1e7]+1000+4000+8000+100000000000).replace(/[018]/g,(X)=>(X^(J()&15)>>X/4).toString(16))}function Y$0(Z){return Z.exception?.values?.[0]}function HX(Z){let{message:J,event_id:X}=Z;if(J)return J;let Y=Y$0(Z);if(Y){if(Y.type&&Y.value)return`${Y.type}: ${Y.value}`;return Y.type||Y.value||X||"<unknown>"}return X||"<unknown>"}function Pv(Z,J,X){let Y=Z.exception=Z.exception||{},$=Y.values=Y.values||[],Q=$[0]=$[0]||{};if(!Q.value)Q.value=J||"";if(!Q.type)Q.type=X||"Error"}function vW(Z,J){let X=Y$0(Z);if(!X)return;let Y={type:"generic",handled:!0},$=X.mechanism;if(X.mechanism={...Y,...$,...J},J&&"data"in J){let Q={...$?.data,...J.data};X.mechanism.data=Q}}var hn1=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function Mv(Z){return parseInt(Z||"",10)}function Dv(Z){let J=Z.match(hn1)||[],X=Mv(J[1]),Y=Mv(J[2]),$=Mv(J[3]);return{buildmetadata:J[5],major:isNaN(X)?void 0:X,minor:isNaN(Y)?void 0:Y,patch:isNaN($)?void 0:$,prerelease:J[4]}}function _j(Z){if(fn1(Z))return!0;try{W6(Z,"__sentry_captured__",!0)}catch(J){}return!1}function fn1(Z){try{return Z.__sentry_captured__}catch{}}var $$0=1000;function bZ(){return Date.now()/$$0}function yn1(){let{performance:Z}=I0;if(!Z?.now)return bZ;let J=Date.now()-Z.now(),X=Z.timeOrigin==null?J:Z.timeOrigin;return()=>{return(X+Z.now())/$$0}}var zX=yn1();function Q$0(Z){let J=zX(),X={sid:l8(),init:!0,timestamp:J,started:J,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>bn1(X)};if(Z)gZ(X,Z);return X}function gZ(Z,J={}){if(J.user){if(!Z.ipAddress&&J.user.ip_address)Z.ipAddress=J.user.ip_address;if(!Z.did&&!J.did)Z.did=J.user.id||J.user.email||J.user.username}if(Z.timestamp=J.timestamp||zX(),J.abnormal_mechanism)Z.abnormal_mechanism=J.abnormal_mechanism;if(J.ignoreDuration)Z.ignoreDuration=J.ignoreDuration;if(J.sid)Z.sid=J.sid.length===32?J.sid:l8();if(J.init!==void 0)Z.init=J.init;if(!Z.did&&J.did)Z.did=`${J.did}`;if(typeof J.started==="number")Z.started=J.started;if(Z.ignoreDuration)Z.duration=void 0;else if(typeof J.duration==="number")Z.duration=J.duration;else{let X=Z.timestamp-Z.started;Z.duration=X>=0?X:0}if(J.release)Z.release=J.release;if(J.environment)Z.environment=J.environment;if(!Z.ipAddress&&J.ipAddress)Z.ipAddress=J.ipAddress;if(!Z.userAgent&&J.userAgent)Z.userAgent=J.userAgent;if(typeof J.errors==="number")Z.errors=J.errors;if(J.status)Z.status=J.status}function K$0(Z,J){let X={};if(J)X={status:J};else if(Z.status==="ok")X={status:"exited"};gZ(Z,X)}function bn1(Z){return{sid:`${Z.sid}`,init:Z.init,started:new Date(Z.started*1000).toISOString(),timestamp:new Date(Z.timestamp*1000).toISOString(),status:Z.status,errors:Z.errors,did:typeof Z.did==="number"||typeof Z.did==="string"?`${Z.did}`:void 0,duration:Z.duration,abnormal_mechanism:Z.abnormal_mechanism,attrs:{release:Z.release,environment:Z.environment,ip_address:Z.ipAddress,user_agent:Z.userAgent}}}function FX(Z,J,X=2){if(!J||typeof J!=="object"||X<=0)return J;if(Z&&Object.keys(J).length===0)return Z;let Y={...Z};for(let $ in J)if(Object.prototype.hasOwnProperty.call(J,$))Y[$]=FX(Y[$],J[$],X-1);return Y}var Cv="_sentrySpan";function SW(Z,J){if(J)W6(Z,Cv,J);else delete Z[Cv]}function mZ(Z){return Z[Cv]}function v4(){return l8()}function Q9(){return l8().substring(16)}var gn1=100;class G5{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:v4(),sampleRand:Math.random()}}clone(){let Z=new G5;if(Z._breadcrumbs=[...this._breadcrumbs],Z._tags={...this._tags},Z._extra={...this._extra},Z._contexts={...this._contexts},this._contexts.flags)Z._contexts.flags={values:[...this._contexts.flags.values]};return Z._user=this._user,Z._level=this._level,Z._session=this._session,Z._transactionName=this._transactionName,Z._fingerprint=this._fingerprint,Z._eventProcessors=[...this._eventProcessors],Z._attachments=[...this._attachments],Z._sdkProcessingMetadata={...this._sdkProcessingMetadata},Z._propagationContext={...this._propagationContext},Z._client=this._client,Z._lastEventId=this._lastEventId,SW(Z,mZ(this)),Z}setClient(Z){this._client=Z}setLastEventId(Z){this._lastEventId=Z}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(Z){this._scopeListeners.push(Z)}addEventProcessor(Z){return this._eventProcessors.push(Z),this}setUser(Z){if(this._user=Z||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session)gZ(this._session,{user:Z});return this._notifyScopeListeners(),this}getUser(){return this._user}setTags(Z){return this._tags={...this._tags,...Z},this._notifyScopeListeners(),this}setTag(Z,J){return this._tags={...this._tags,[Z]:J},this._notifyScopeListeners(),this}setExtras(Z){return this._extra={...this._extra,...Z},this._notifyScopeListeners(),this}setExtra(Z,J){return this._extra={...this._extra,[Z]:J},this._notifyScopeListeners(),this}setFingerprint(Z){return this._fingerprint=Z,this._notifyScopeListeners(),this}setLevel(Z){return this._level=Z,this._notifyScopeListeners(),this}setTransactionName(Z){return this._transactionName=Z,this._notifyScopeListeners(),this}setContext(Z,J){if(J===null)delete this._contexts[Z];else this._contexts[Z]=J;return this._notifyScopeListeners(),this}setSession(Z){if(!Z)delete this._session;else this._session=Z;return this._notifyScopeListeners(),this}getSession(){return this._session}update(Z){if(!Z)return this;let J=typeof Z==="function"?Z(this):Z,X=J instanceof G5?J.getScopeData():GX(J)?Z:void 0,{tags:Y,extra:$,user:Q,contexts:K,level:W,fingerprint:G=[],propagationContext:V}=X||{};if(this._tags={...this._tags,...Y},this._extra={...this._extra,...$},this._contexts={...this._contexts,...K},Q&&Object.keys(Q).length)this._user=Q;if(W)this._level=W;if(G.length)this._fingerprint=G;if(V)this._propagationContext=V;return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,SW(this,void 0),this._attachments=[],this.setPropagationContext({traceId:v4(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(Z,J){let X=typeof J==="number"?J:gn1;if(X<=0)return this;let Y={timestamp:bZ(),...Z,message:Z.message?x7(Z.message,2048):Z.message};if(this._breadcrumbs.push(Y),this._breadcrumbs.length>X)this._breadcrumbs=this._breadcrumbs.slice(-X),this._client?.recordDroppedEvent("buffer_overflow","log_item");return this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(Z){return this._attachments.push(Z),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:mZ(this)}}setSDKProcessingMetadata(Z){return this._sdkProcessingMetadata=FX(this._sdkProcessingMetadata,Z,2),this}setPropagationContext(Z){return this._propagationContext=Z,this}getPropagationContext(){return this._propagationContext}captureException(Z,J){let X=J?.event_id||l8();if(!this._client)return l.warn("No client configured on scope - will not capture exception!"),X;let Y=new Error("Sentry syntheticException");return this._client.captureException(Z,{originalException:Z,syntheticException:Y,...J,event_id:X},this),X}captureMessage(Z,J,X){let Y=X?.event_id||l8();if(!this._client)return l.warn("No client configured on scope - will not capture message!"),Y;let $=new Error(Z);return this._client.captureMessage(Z,J,{originalException:Z,syntheticException:$,...X,event_id:Y},this),Y}captureEvent(Z,J){let X=J?.event_id||l8();if(!this._client)return l.warn("No client configured on scope - will not capture event!"),X;return this._client.captureEvent(Z,{...J,event_id:X},this),X}_notifyScopeListeners(){if(!this._notifyingListeners)this._notifyingListeners=!0,this._scopeListeners.forEach((Z)=>{Z(this)}),this._notifyingListeners=!1}}function AW(){return D$("defaultCurrentScope",()=>new G5)}function S4(){return D$("defaultIsolationScope",()=>new G5)}class G$0{constructor(Z,J){let X;if(!Z)X=new G5;else X=Z;let Y;if(!J)Y=new G5;else Y=J;this._stack=[{scope:X}],this._isolationScope=Y}withScope(Z){let J=this._pushScope(),X;try{X=Z(J)}catch(Y){throw this._popScope(),Y}if(A7(X))return X.then((Y)=>{return this._popScope(),Y},(Y)=>{throw this._popScope(),Y});return this._popScope(),X}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let Z=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:Z}),Z}_popScope(){if(this._stack.length<=1)return!1;return!!this._stack.pop()}}function xW(){let Z=W5(),J=WX(Z);return J.stack=J.stack||new G$0(AW(),S4())}function mn1(Z){return xW().withScope(Z)}function un1(Z,J){let X=xW();return X.withScope(()=>{return X.getStackTop().scope=Z,J(Z)})}function W$0(Z){return xW().withScope(()=>{return Z(xW().getIsolationScope())})}function V$0(){return{withIsolationScope:W$0,withScope:mn1,withSetScope:un1,withSetIsolationScope:(Z,J)=>{return W$0(J)},getCurrentScope:()=>xW().getScope(),getIsolationScope:()=>xW().getIsolationScope()}}function Tv(Z){let J=W5(),X=WX(J);X.acs=Z}function A4(Z){let J=WX(Z);if(J.acs)return J.acs;return V$0()}function O1(){let Z=W5();return A4(Z).getCurrentScope()}function K1(){let Z=W5();return A4(Z).getIsolationScope()}function vj(){return D$("globalScope",()=>new G5)}function hW(...Z){let J=W5(),X=A4(J);if(Z.length===2){let[Y,$]=Z;if(!Y)return X.withScope($);return X.withSetScope(Y,$)}return X.withScope(Z[0])}function _z(...Z){let J=W5(),X=A4(J);if(Z.length===2){let[Y,$]=Z;if(!Y)return X.withIsolationScope($);return X.withSetIsolationScope(Y,$)}return X.withIsolationScope(Z[0])}function R0(){return O1().getClient()}function fW(Z){let J=Z.getPropagationContext(),{traceId:X,parentSpanId:Y,propagationSpanId:$}=J,Q={trace_id:X,span_id:$||Q9()};if(Y)Q.parent_span_id=Y;return Q}var p8="sentry.source",x4="sentry.sample_rate",Ev="sentry.previous_trace_sample_rate",y0="sentry.op",W1="sentry.origin";var kv="sentry.measurement_unit",Iv="sentry.measurement_value",h7="sentry.custom_span_name",yW="sentry.profile_id",bW="sentry.exclusive_time",_v="cache.hit",vv="cache.key",Sv="cache.item_size";var Av=0,gW=1,f7=2;function Sj(Z){if(Z<400&&Z>=100)return{code:1};if(Z>=400&&Z<500)switch(Z){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(Z>=500&&Z<600)switch(Z){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"unknown_error"}}var H$0="_sentryScope",z$0="_sentryIsolationScope";function vz(Z,J,X){if(Z)W6(Z,z$0,X),W6(Z,H$0,J)}function h4(Z){return{scope:Z[H$0],isolationScope:Z[z$0]}}function K9(Z){if(typeof Z==="boolean")return Number(Z);let J=typeof Z==="string"?parseFloat(Z):Z;if(typeof J!=="number"||isNaN(J)||J<0||J>1)return;return J}var Sz="sentry-",q$0=/^sentry-/,U$0=8192;function qX(Z){let J=k$(Z);if(!J)return;let X=Object.entries(J).reduce((Y,[$,Q])=>{if($.match(q$0)){let K=$.slice(Sz.length);Y[K]=Q}return Y},{});if(Object.keys(X).length>0)return X;else return}function E$(Z){if(!Z)return;let J=Object.entries(Z).reduce((X,[Y,$])=>{if($)X[`${Sz}${Y}`]=$;return X},{});return Aj(J)}function k$(Z){if(!Z||!C$(Z)&&!Array.isArray(Z))return;if(Array.isArray(Z))return Z.reduce((J,X)=>{let Y=F$0(X);return Object.entries(Y).forEach(([$,Q])=>{J[$]=Q}),J},{});return F$0(Z)}function F$0(Z){return Z.split(",").map((J)=>J.split("=").map((X)=>{try{return decodeURIComponent(X.trim())}catch{return}})).reduce((J,[X,Y])=>{if(X&&Y)J[X]=Y;return J},{})}function Aj(Z){if(Object.keys(Z).length===0)return;return Object.entries(Z).reduce((J,[X,Y],$)=>{let Q=`${encodeURIComponent(X)}=${encodeURIComponent(Y)}`,K=$===0?Q:`${J},${Q}`;if(K.length>U$0)return q0&&l.warn(`Not adding key: ${X} with val: ${Y} to baggage header due to exceeding baggage size limits.`),J;else return K},"")}var Az=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function L$0(Z){if(!Z)return;let J=Z.match(Az);if(!J)return;let X;if(J[3]==="1")X=!0;else if(J[3]==="0")X=!1;return{traceId:J[1],parentSampled:X,parentSpanId:J[2]}}function xz(Z,J){let X=L$0(Z),Y=qX(J);if(!X?.traceId)return{traceId:v4(),sampleRand:Math.random()};let $=dn1(X,Y);if(Y)Y.sample_rand=$.toString();let{traceId:Q,parentSpanId:K,parentSampled:W}=X;return{traceId:Q,parentSpanId:K,sampled:W,dsc:Y||{},sampleRand:$}}function UX(Z=v4(),J=Q9(),X){let Y="";if(X!==void 0)Y=X?"-1":"-0";return`${Z}-${J}${Y}`}function dn1(Z,J){let X=K9(J?.sample_rand);if(X!==void 0)return X;let Y=K9(J?.sample_rate);if(Y&&Z?.parentSampled!==void 0)return Z.parentSampled?Math.random()*Y:Y+Math.random()*(1-Y);else return Math.random()}var xj=0,hj=1,B$0=!1;function j$0(Z){let{spanId:J,traceId:X}=Z.spanContext(),{data:Y,op:$,parent_span_id:Q,status:K,origin:W,links:G}=M0(Z);return{parent_span_id:Q,span_id:J,trace_id:X,data:Y,op:$,status:K,origin:W,links:G}}function LX(Z){let{spanId:J,traceId:X,isRemote:Y}=Z.spanContext(),$=Y?J:M0(Z).parent_span_id,Q=h4(Z).scope,K=Y?Q?.getPropagationContext().propagationSpanId||Q9():J;return{parent_span_id:$,span_id:K,trace_id:X}}function fj(Z){let{traceId:J,spanId:X}=Z.spanContext(),Y=y7(Z);return UX(J,X,Y)}function I$(Z){if(Z&&Z.length>0)return Z.map(({context:{spanId:J,traceId:X,traceFlags:Y,...$},attributes:Q})=>({span_id:J,trace_id:X,sampled:Y===hj,attributes:Q,...$}));else return}function y5(Z){if(typeof Z==="number")return w$0(Z);if(Array.isArray(Z))return Z[0]+Z[1]/1e9;if(Z instanceof Date)return w$0(Z.getTime());return zX()}function w$0(Z){return Z>9999999999?Z/1000:Z}function M0(Z){if(ln1(Z))return Z.getSpanJSON();let{spanId:J,traceId:X}=Z.spanContext();if(cn1(Z)){let{attributes:Y,startTime:$,name:Q,endTime:K,status:W,links:G}=Z,V="parentSpanId"in Z?Z.parentSpanId:("parentSpanContext"in Z)?Z.parentSpanContext?.spanId:void 0;return{span_id:J,trace_id:X,data:Y,description:Q,parent_span_id:V,start_timestamp:y5($),timestamp:y5(K)||void 0,status:_$(W),op:Y[y0],origin:Y[W1],links:I$(G)}}return{span_id:J,trace_id:X,start_timestamp:0,data:{}}}function cn1(Z){let J=Z;return!!J.attributes&&!!J.startTime&&!!J.name&&!!J.endTime&&!!J.status}function ln1(Z){return typeof Z.getSpanJSON==="function"}function y7(Z){let{traceFlags:J}=Z.spanContext();return J===hj}function _$(Z){if(!Z||Z.code===Av)return;if(Z.code===gW)return"ok";return Z.message||"unknown_error"}var hz="_sentryChildSpans",xv="_sentryRootSpan";function mW(Z,J){let X=Z[xv]||Z;if(W6(J,xv,X),Z[hz])Z[hz].add(J);else W6(Z,hz,new Set([J]))}function yj(Z){let J=new Set;function X(Y){if(J.has(Y))return;else if(y7(Y)){J.add(Y);let $=Y[hz]?Array.from(Y[hz]):[];for(let Q of $)X(Q)}}return X(Z),Array.from(J)}function H8(Z){return Z[xv]||Z}function uW(){let Z=W5(),J=A4(Z);if(J.getActiveSpan)return J.getActiveSpan();return mZ(O1())}function fz(){if(!B$0)D8(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),B$0=!0}var fv="?",O$0=/\(error: (.*)\)/,N$0=/captureMessage|captureException/;function gj(...Z){let J=Z.sort((X,Y)=>X[0]-Y[0]).map((X)=>X[1]);return(X,Y=0,$=0)=>{let Q=[],K=X.split(`
|
465
|
+
${W}`),J.end();return}if(K)Z.session=K}J.setNoDelay(!0),this.emitWithGlobal("WEBSERVER.UPGRADE",{req:Z,socket:J,head:X})};_onError=(Z)=>{u.error(`WebServer._onError(): ${Z.message}`),this.emitWithGlobal("WEBSERVER.ERROR",{error:Z})};_onStopped=()=>{this.emitWithGlobal("WEBSERVER.STOPPED",{})}}class S7 extends j0{static instance=new S7;_connectionIdConnections=new Map;_userIdConnections=new Map;_wss;_wrtcMinPort=process.env.WRTC_MIN_PORT?parseInt(process.env.WRTC_MIN_PORT):40000;_wrtcMaxPort=process.env.WRTC_MAX_PORT?parseInt(process.env.WRTC_MAX_PORT):41023;_wrtcPublicIpv4=process.env.NODE_ENV==="production"?process.env.WRTC_PUBLIC_IPV4:"127.0.0.1";_wrtcPublicIpv6=process.env.NODE_ENV==="production"?process.env.WRTC_PUBLIC_IPV6:"::";_wrtcRouter=null;_wrtcWorker=null;constructor(){super();this._wss=new fk.default({noServer:!0}),this._wss.on("connection",this._onConnection),this._wss.on("error",this._onError),this._initWrtc().catch((Z)=>{u.warning(`Socket._constructor(): Failed to initialize WebRTC, falling back to Websockets. This can be ignored for local development. Error: ${Z.message}`)}),j0.globalInstance.on("WEBSERVER.UPGRADE",({req:Z,socket:J,head:X})=>{this._onUpgrade(Z,J,X)})}get isWrtcEnabled(){return this._wrtcWorker&&!this._wrtcWorker.died&&this._wrtcRouter}get wrtcRouter(){return this._wrtcRouter}async createWrtcTransports(){if(!this.isWrtcEnabled)u.fatalError("Socket.createWrtcTransports(): WebRTC not enabled, unable to create transports.");let Z={listenIps:[{ip:"::",announcedIp:this._wrtcPublicIpv6},{ip:"0.0.0.0",announcedIp:this._wrtcPublicIpv4}],preferUdp:!0,enableSctp:!0,enableTcp:!1},J=await this._wrtcRouter.createDirectTransport(),X=await this._wrtcRouter.createWebRtcTransport(Z),Y=await this._wrtcRouter.createWebRtcTransport(Z);return{directTransport:J,clientServerTransport:X,serverClientTransport:Y}}isValidConnectionId(Z){return this._connectionIdConnections.has(Z)}async _initWrtc(){if(!this._wrtcPublicIpv4||!this._wrtcPublicIpv6)throw new Error("Socket._initWrtc(): WebRTC disabled, falling back to Websockets. Env variables WRTC_PUBLIC_IPV4 and WRTC_PUBLIC_IPV6 must be set in production");this._wrtcWorker=await En1.createWorker({rtcMinPort:this._wrtcMinPort,rtcMaxPort:this._wrtcMaxPort}),this._wrtcWorker.on("died",this._onWrtcWorkerDied),this._wrtcRouter=await this._wrtcWorker.createRouter({mediaCodecs:[]}),console.log("Socket._initWrtc(): WebRTC enabled and ready!")}_onConnection=(Z,J)=>{let X=J.connectionId,Y=J.session?.user.id,$=X&&this._connectionIdConnections.get(X)||Y&&this._userIdConnections.get(Y);if($)$.bindWs(Z);else{let Q=new _4(Z,J);if(Q.on("CONNECTION.CLOSED",()=>{if(this._connectionIdConnections.delete(Q.id),Y)this._userIdConnections.delete(Y)}),this._connectionIdConnections.set(Q.id,Q),Y)this._userIdConnections.set(Y,Q)}};_onError=(Z,J)=>{this.emitWithGlobal("SOCKET.ERROR",{ws:Z,error:J})};_onUpgrade=(Z,J,X)=>{this._wss.handleUpgrade(Z,J,X,(Y)=>{this._wss.emit("connection",Y,Z)})};_onWrtcWorkerDied=(Z)=>{u.warning(`Socket._onWrtcWorkerDied(): WebRTC worker unexpectedly died, falling back to Websockets for all players. Internal error: ${Z}`),$9.instance.getConnectedPlayers().forEach((J)=>{J.connection.closeWrtc()}),this._wrtcRouter?.close(),this._wrtcRouter=null,this._wrtcWorker?.close(),this._wrtcWorker=null}}var q0=typeof __SENTRY_DEBUG__==="undefined"||__SENTRY_DEBUG__;var x8="9.22.0";var I0=globalThis;function W5(){return WX(I0),I0}function WX(Z){let J=Z.__SENTRY__=Z.__SENTRY__||{};return J.version=J.version||x8,J[x8]=J[x8]||{}}function D$(Z,J,X=I0){let Y=X.__SENTRY__=X.__SENTRY__||{},$=Y[x8]=Y[x8]||{};return $[Z]||($[Z]=J())}var iY0=Object.prototype.toString;function Tj(Z){switch(iY0.call(Z)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return yZ(Z,Error)}}function Ej(Z,J){return iY0.call(Z)===`[object ${J}]`}function nY0(Z){return Ej(Z,"ErrorEvent")}function C$(Z){return Ej(Z,"String")}function kz(Z){return typeof Z==="object"&&Z!==null&&"__sentry_template_string__"in Z&&"__sentry_template_values__"in Z}function Iz(Z){return Z===null||kz(Z)||typeof Z!=="object"&&typeof Z!=="function"}function GX(Z){return Ej(Z,"Object")}function aY0(Z){return typeof Event!=="undefined"&&yZ(Z,Event)}function sY0(Z){return typeof Element!=="undefined"&&yZ(Z,Element)}function oY0(Z){return Ej(Z,"RegExp")}function A7(Z){return Boolean(Z?.then&&typeof Z.then==="function")}function rY0(Z){return GX(Z)&&"nativeEvent"in Z&&"preventDefault"in Z&&"stopPropagation"in Z}function yZ(Z,J){try{return Z instanceof J}catch(X){return!1}}function kj(Z){return!!(typeof Z==="object"&&Z!==null&&(Z.__isVue||Z._isVue))}var In1=I0,_n1=80;function tY0(Z,J={}){if(!Z)return"<unknown>";try{let X=Z,Y=5,$=[],Q=0,K=0,W=" > ",G=W.length,V,H=Array.isArray(J)?J:J.keyAttrs,F=!Array.isArray(J)&&J.maxStringLength||_n1;while(X&&Q++<Y){if(V=vn1(X,H),V==="html"||Q>1&&K+$.length*G+V.length>=F)break;$.push(V),K+=V.length,X=X.parentNode}return $.reverse().join(W)}catch(X){return"<unknown>"}}function vn1(Z,J){let X=Z,Y=[];if(!X?.tagName)return"";if(In1.HTMLElement){if(X instanceof HTMLElement&&X.dataset){if(X.dataset.sentryComponent)return X.dataset.sentryComponent;if(X.dataset.sentryElement)return X.dataset.sentryElement}}Y.push(X.tagName.toLowerCase());let $=J?.length?J.filter((K)=>X.getAttribute(K)).map((K)=>[K,X.getAttribute(K)]):null;if($?.length)$.forEach((K)=>{Y.push(`[${K[0]}="${K[1]}"]`)});else{if(X.id)Y.push(`#${X.id}`);let K=X.className;if(K&&C$(K)){let W=K.split(/\s+/);for(let G of W)Y.push(`.${G}`)}}let Q=["aria-label","type","name","title","alt"];for(let K of Q){let W=X.getAttribute(K);if(W)Y.push(`[${K}="${W}"]`)}return Y.join("")}var Sn1="Sentry Logger ",T$=["debug","info","warn","error","log","assert","trace"],_W={};function D8(Z){if(!("console"in I0))return Z();let J=I0.console,X={},Y=Object.keys(_W);Y.forEach(($)=>{let Q=_W[$];X[$]=J[$],J[$]=Q});try{return Z()}finally{Y.forEach(($)=>{J[$]=X[$]})}}function An1(){let Z=!1,J={enable:()=>{Z=!0},disable:()=>{Z=!1},isEnabled:()=>Z};if(q0)T$.forEach((X)=>{J[X]=(...Y)=>{if(Z)D8(()=>{I0.console[X](`${Sn1}[${X}]:`,...Y)})}});else T$.forEach((X)=>{J[X]=()=>{return}});return J}var l=D$("logger",An1);function x7(Z,J=0){if(typeof Z!=="string"||J===0)return Z;return Z.length<=J?Z:`${Z.slice(0,J)}...`}function wv(Z,J){let X=Z,Y=X.length;if(Y<=150)return X;if(J>Y)J=Y;let $=Math.max(J-60,0);if($<5)$=0;let Q=Math.min($+140,Y);if(Q>Y-5)Q=Y;if(Q===Y)$=Math.max(Q-140,0);if(X=X.slice($,Q),$>0)X=`'{snip} ${X}`;if(Q<Y)X+=" {snip}";return X}function jv(Z,J){if(!Array.isArray(Z))return"";let X=[];for(let Y=0;Y<Z.length;Y++){let $=Z[Y];try{if(kj($))X.push("[VueViewModel]");else X.push(String($))}catch(Q){X.push("[value cannot be serialized]")}}return X.join(J)}function eY0(Z,J,X=!1){if(!C$(Z))return!1;if(oY0(J))return J.test(Z);if(C$(J))return X?Z===J:Z.includes(J);return!1}function VX(Z,J=[],X=!1){return J.some((Y)=>eY0(Z,Y,X))}function Ov(Z,J,X){if(!(J in Z))return;let Y=Z[J];if(typeof Y!=="function")return;let $=X(Y);if(typeof $==="function")X$0($,Y);try{Z[J]=$}catch{q0&&l.log(`Failed to replace method "${J}" in object`,Z)}}function W6(Z,J,X){try{Object.defineProperty(Z,J,{value:X,writable:!0,configurable:!0})}catch(Y){q0&&l.log(`Failed to add non-enumerable property "${J}" to object`,Z)}}function X$0(Z,J){try{let X=J.prototype||{};Z.prototype=J.prototype=X,W6(Z,"__sentry_original__",J)}catch(X){}}function Nv(Z){return Z.__sentry_original__}function Ij(Z){if(Tj(Z))return{message:Z.message,name:Z.name,stack:Z.stack,...J$0(Z)};else if(aY0(Z)){let J={type:Z.type,target:Z$0(Z.target),currentTarget:Z$0(Z.currentTarget),...J$0(Z)};if(typeof CustomEvent!=="undefined"&&yZ(Z,CustomEvent))J.detail=Z.detail;return J}else return Z}function Z$0(Z){try{return sY0(Z)?tY0(Z):Object.prototype.toString.call(Z)}catch(J){return"<unknown>"}}function J$0(Z){if(typeof Z==="object"&&Z!==null){let J={};for(let X in Z)if(Object.prototype.hasOwnProperty.call(Z,X))J[X]=Z[X];return J}else return{}}function Rv(Z,J=40){let X=Object.keys(Ij(Z));X.sort();let Y=X[0];if(!Y)return"[object has no keys]";if(Y.length>=J)return x7(Y,J);for(let $=X.length;$>0;$--){let Q=X.slice(0,$).join(", ");if(Q.length>J)continue;if($===X.length)return Q;return x7(Q,J)}return""}function xn1(){let Z=I0;return Z.crypto||Z.msCrypto}function l8(Z=xn1()){let J=()=>Math.random()*16;try{if(Z?.randomUUID)return Z.randomUUID().replace(/-/g,"");if(Z?.getRandomValues)J=()=>{let X=new Uint8Array(1);return Z.getRandomValues(X),X[0]}}catch(X){}return([1e7]+1000+4000+8000+100000000000).replace(/[018]/g,(X)=>(X^(J()&15)>>X/4).toString(16))}function Y$0(Z){return Z.exception?.values?.[0]}function HX(Z){let{message:J,event_id:X}=Z;if(J)return J;let Y=Y$0(Z);if(Y){if(Y.type&&Y.value)return`${Y.type}: ${Y.value}`;return Y.type||Y.value||X||"<unknown>"}return X||"<unknown>"}function Pv(Z,J,X){let Y=Z.exception=Z.exception||{},$=Y.values=Y.values||[],Q=$[0]=$[0]||{};if(!Q.value)Q.value=J||"";if(!Q.type)Q.type=X||"Error"}function vW(Z,J){let X=Y$0(Z);if(!X)return;let Y={type:"generic",handled:!0},$=X.mechanism;if(X.mechanism={...Y,...$,...J},J&&"data"in J){let Q={...$?.data,...J.data};X.mechanism.data=Q}}var hn1=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function Mv(Z){return parseInt(Z||"",10)}function Dv(Z){let J=Z.match(hn1)||[],X=Mv(J[1]),Y=Mv(J[2]),$=Mv(J[3]);return{buildmetadata:J[5],major:isNaN(X)?void 0:X,minor:isNaN(Y)?void 0:Y,patch:isNaN($)?void 0:$,prerelease:J[4]}}function _j(Z){if(fn1(Z))return!0;try{W6(Z,"__sentry_captured__",!0)}catch(J){}return!1}function fn1(Z){try{return Z.__sentry_captured__}catch{}}var $$0=1000;function bZ(){return Date.now()/$$0}function yn1(){let{performance:Z}=I0;if(!Z?.now)return bZ;let J=Date.now()-Z.now(),X=Z.timeOrigin==null?J:Z.timeOrigin;return()=>{return(X+Z.now())/$$0}}var zX=yn1();function Q$0(Z){let J=zX(),X={sid:l8(),init:!0,timestamp:J,started:J,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>bn1(X)};if(Z)gZ(X,Z);return X}function gZ(Z,J={}){if(J.user){if(!Z.ipAddress&&J.user.ip_address)Z.ipAddress=J.user.ip_address;if(!Z.did&&!J.did)Z.did=J.user.id||J.user.email||J.user.username}if(Z.timestamp=J.timestamp||zX(),J.abnormal_mechanism)Z.abnormal_mechanism=J.abnormal_mechanism;if(J.ignoreDuration)Z.ignoreDuration=J.ignoreDuration;if(J.sid)Z.sid=J.sid.length===32?J.sid:l8();if(J.init!==void 0)Z.init=J.init;if(!Z.did&&J.did)Z.did=`${J.did}`;if(typeof J.started==="number")Z.started=J.started;if(Z.ignoreDuration)Z.duration=void 0;else if(typeof J.duration==="number")Z.duration=J.duration;else{let X=Z.timestamp-Z.started;Z.duration=X>=0?X:0}if(J.release)Z.release=J.release;if(J.environment)Z.environment=J.environment;if(!Z.ipAddress&&J.ipAddress)Z.ipAddress=J.ipAddress;if(!Z.userAgent&&J.userAgent)Z.userAgent=J.userAgent;if(typeof J.errors==="number")Z.errors=J.errors;if(J.status)Z.status=J.status}function K$0(Z,J){let X={};if(J)X={status:J};else if(Z.status==="ok")X={status:"exited"};gZ(Z,X)}function bn1(Z){return{sid:`${Z.sid}`,init:Z.init,started:new Date(Z.started*1000).toISOString(),timestamp:new Date(Z.timestamp*1000).toISOString(),status:Z.status,errors:Z.errors,did:typeof Z.did==="number"||typeof Z.did==="string"?`${Z.did}`:void 0,duration:Z.duration,abnormal_mechanism:Z.abnormal_mechanism,attrs:{release:Z.release,environment:Z.environment,ip_address:Z.ipAddress,user_agent:Z.userAgent}}}function FX(Z,J,X=2){if(!J||typeof J!=="object"||X<=0)return J;if(Z&&Object.keys(J).length===0)return Z;let Y={...Z};for(let $ in J)if(Object.prototype.hasOwnProperty.call(J,$))Y[$]=FX(Y[$],J[$],X-1);return Y}var Cv="_sentrySpan";function SW(Z,J){if(J)W6(Z,Cv,J);else delete Z[Cv]}function mZ(Z){return Z[Cv]}function v4(){return l8()}function Q9(){return l8().substring(16)}var gn1=100;class G5{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:v4(),sampleRand:Math.random()}}clone(){let Z=new G5;if(Z._breadcrumbs=[...this._breadcrumbs],Z._tags={...this._tags},Z._extra={...this._extra},Z._contexts={...this._contexts},this._contexts.flags)Z._contexts.flags={values:[...this._contexts.flags.values]};return Z._user=this._user,Z._level=this._level,Z._session=this._session,Z._transactionName=this._transactionName,Z._fingerprint=this._fingerprint,Z._eventProcessors=[...this._eventProcessors],Z._attachments=[...this._attachments],Z._sdkProcessingMetadata={...this._sdkProcessingMetadata},Z._propagationContext={...this._propagationContext},Z._client=this._client,Z._lastEventId=this._lastEventId,SW(Z,mZ(this)),Z}setClient(Z){this._client=Z}setLastEventId(Z){this._lastEventId=Z}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(Z){this._scopeListeners.push(Z)}addEventProcessor(Z){return this._eventProcessors.push(Z),this}setUser(Z){if(this._user=Z||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session)gZ(this._session,{user:Z});return this._notifyScopeListeners(),this}getUser(){return this._user}setTags(Z){return this._tags={...this._tags,...Z},this._notifyScopeListeners(),this}setTag(Z,J){return this._tags={...this._tags,[Z]:J},this._notifyScopeListeners(),this}setExtras(Z){return this._extra={...this._extra,...Z},this._notifyScopeListeners(),this}setExtra(Z,J){return this._extra={...this._extra,[Z]:J},this._notifyScopeListeners(),this}setFingerprint(Z){return this._fingerprint=Z,this._notifyScopeListeners(),this}setLevel(Z){return this._level=Z,this._notifyScopeListeners(),this}setTransactionName(Z){return this._transactionName=Z,this._notifyScopeListeners(),this}setContext(Z,J){if(J===null)delete this._contexts[Z];else this._contexts[Z]=J;return this._notifyScopeListeners(),this}setSession(Z){if(!Z)delete this._session;else this._session=Z;return this._notifyScopeListeners(),this}getSession(){return this._session}update(Z){if(!Z)return this;let J=typeof Z==="function"?Z(this):Z,X=J instanceof G5?J.getScopeData():GX(J)?Z:void 0,{tags:Y,extra:$,user:Q,contexts:K,level:W,fingerprint:G=[],propagationContext:V}=X||{};if(this._tags={...this._tags,...Y},this._extra={...this._extra,...$},this._contexts={...this._contexts,...K},Q&&Object.keys(Q).length)this._user=Q;if(W)this._level=W;if(G.length)this._fingerprint=G;if(V)this._propagationContext=V;return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,SW(this,void 0),this._attachments=[],this.setPropagationContext({traceId:v4(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(Z,J){let X=typeof J==="number"?J:gn1;if(X<=0)return this;let Y={timestamp:bZ(),...Z,message:Z.message?x7(Z.message,2048):Z.message};if(this._breadcrumbs.push(Y),this._breadcrumbs.length>X)this._breadcrumbs=this._breadcrumbs.slice(-X),this._client?.recordDroppedEvent("buffer_overflow","log_item");return this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(Z){return this._attachments.push(Z),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:mZ(this)}}setSDKProcessingMetadata(Z){return this._sdkProcessingMetadata=FX(this._sdkProcessingMetadata,Z,2),this}setPropagationContext(Z){return this._propagationContext=Z,this}getPropagationContext(){return this._propagationContext}captureException(Z,J){let X=J?.event_id||l8();if(!this._client)return l.warn("No client configured on scope - will not capture exception!"),X;let Y=new Error("Sentry syntheticException");return this._client.captureException(Z,{originalException:Z,syntheticException:Y,...J,event_id:X},this),X}captureMessage(Z,J,X){let Y=X?.event_id||l8();if(!this._client)return l.warn("No client configured on scope - will not capture message!"),Y;let $=new Error(Z);return this._client.captureMessage(Z,J,{originalException:Z,syntheticException:$,...X,event_id:Y},this),Y}captureEvent(Z,J){let X=J?.event_id||l8();if(!this._client)return l.warn("No client configured on scope - will not capture event!"),X;return this._client.captureEvent(Z,{...J,event_id:X},this),X}_notifyScopeListeners(){if(!this._notifyingListeners)this._notifyingListeners=!0,this._scopeListeners.forEach((Z)=>{Z(this)}),this._notifyingListeners=!1}}function AW(){return D$("defaultCurrentScope",()=>new G5)}function S4(){return D$("defaultIsolationScope",()=>new G5)}class G$0{constructor(Z,J){let X;if(!Z)X=new G5;else X=Z;let Y;if(!J)Y=new G5;else Y=J;this._stack=[{scope:X}],this._isolationScope=Y}withScope(Z){let J=this._pushScope(),X;try{X=Z(J)}catch(Y){throw this._popScope(),Y}if(A7(X))return X.then((Y)=>{return this._popScope(),Y},(Y)=>{throw this._popScope(),Y});return this._popScope(),X}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let Z=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:Z}),Z}_popScope(){if(this._stack.length<=1)return!1;return!!this._stack.pop()}}function xW(){let Z=W5(),J=WX(Z);return J.stack=J.stack||new G$0(AW(),S4())}function mn1(Z){return xW().withScope(Z)}function un1(Z,J){let X=xW();return X.withScope(()=>{return X.getStackTop().scope=Z,J(Z)})}function W$0(Z){return xW().withScope(()=>{return Z(xW().getIsolationScope())})}function V$0(){return{withIsolationScope:W$0,withScope:mn1,withSetScope:un1,withSetIsolationScope:(Z,J)=>{return W$0(J)},getCurrentScope:()=>xW().getScope(),getIsolationScope:()=>xW().getIsolationScope()}}function Tv(Z){let J=W5(),X=WX(J);X.acs=Z}function A4(Z){let J=WX(Z);if(J.acs)return J.acs;return V$0()}function O1(){let Z=W5();return A4(Z).getCurrentScope()}function K1(){let Z=W5();return A4(Z).getIsolationScope()}function vj(){return D$("globalScope",()=>new G5)}function hW(...Z){let J=W5(),X=A4(J);if(Z.length===2){let[Y,$]=Z;if(!Y)return X.withScope($);return X.withSetScope(Y,$)}return X.withScope(Z[0])}function _z(...Z){let J=W5(),X=A4(J);if(Z.length===2){let[Y,$]=Z;if(!Y)return X.withIsolationScope($);return X.withSetIsolationScope(Y,$)}return X.withIsolationScope(Z[0])}function R0(){return O1().getClient()}function fW(Z){let J=Z.getPropagationContext(),{traceId:X,parentSpanId:Y,propagationSpanId:$}=J,Q={trace_id:X,span_id:$||Q9()};if(Y)Q.parent_span_id=Y;return Q}var p8="sentry.source",x4="sentry.sample_rate",Ev="sentry.previous_trace_sample_rate",y0="sentry.op",W1="sentry.origin";var kv="sentry.measurement_unit",Iv="sentry.measurement_value",h7="sentry.custom_span_name",yW="sentry.profile_id",bW="sentry.exclusive_time",_v="cache.hit",vv="cache.key",Sv="cache.item_size";var Av=0,gW=1,f7=2;function Sj(Z){if(Z<400&&Z>=100)return{code:1};if(Z>=400&&Z<500)switch(Z){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(Z>=500&&Z<600)switch(Z){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"unknown_error"}}var H$0="_sentryScope",z$0="_sentryIsolationScope";function vz(Z,J,X){if(Z)W6(Z,z$0,X),W6(Z,H$0,J)}function h4(Z){return{scope:Z[H$0],isolationScope:Z[z$0]}}function K9(Z){if(typeof Z==="boolean")return Number(Z);let J=typeof Z==="string"?parseFloat(Z):Z;if(typeof J!=="number"||isNaN(J)||J<0||J>1)return;return J}var Sz="sentry-",q$0=/^sentry-/,U$0=8192;function qX(Z){let J=k$(Z);if(!J)return;let X=Object.entries(J).reduce((Y,[$,Q])=>{if($.match(q$0)){let K=$.slice(Sz.length);Y[K]=Q}return Y},{});if(Object.keys(X).length>0)return X;else return}function E$(Z){if(!Z)return;let J=Object.entries(Z).reduce((X,[Y,$])=>{if($)X[`${Sz}${Y}`]=$;return X},{});return Aj(J)}function k$(Z){if(!Z||!C$(Z)&&!Array.isArray(Z))return;if(Array.isArray(Z))return Z.reduce((J,X)=>{let Y=F$0(X);return Object.entries(Y).forEach(([$,Q])=>{J[$]=Q}),J},{});return F$0(Z)}function F$0(Z){return Z.split(",").map((J)=>J.split("=").map((X)=>{try{return decodeURIComponent(X.trim())}catch{return}})).reduce((J,[X,Y])=>{if(X&&Y)J[X]=Y;return J},{})}function Aj(Z){if(Object.keys(Z).length===0)return;return Object.entries(Z).reduce((J,[X,Y],$)=>{let Q=`${encodeURIComponent(X)}=${encodeURIComponent(Y)}`,K=$===0?Q:`${J},${Q}`;if(K.length>U$0)return q0&&l.warn(`Not adding key: ${X} with val: ${Y} to baggage header due to exceeding baggage size limits.`),J;else return K},"")}var Az=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function L$0(Z){if(!Z)return;let J=Z.match(Az);if(!J)return;let X;if(J[3]==="1")X=!0;else if(J[3]==="0")X=!1;return{traceId:J[1],parentSampled:X,parentSpanId:J[2]}}function xz(Z,J){let X=L$0(Z),Y=qX(J);if(!X?.traceId)return{traceId:v4(),sampleRand:Math.random()};let $=dn1(X,Y);if(Y)Y.sample_rand=$.toString();let{traceId:Q,parentSpanId:K,parentSampled:W}=X;return{traceId:Q,parentSpanId:K,sampled:W,dsc:Y||{},sampleRand:$}}function UX(Z=v4(),J=Q9(),X){let Y="";if(X!==void 0)Y=X?"-1":"-0";return`${Z}-${J}${Y}`}function dn1(Z,J){let X=K9(J?.sample_rand);if(X!==void 0)return X;let Y=K9(J?.sample_rate);if(Y&&Z?.parentSampled!==void 0)return Z.parentSampled?Math.random()*Y:Y+Math.random()*(1-Y);else return Math.random()}var xj=0,hj=1,B$0=!1;function j$0(Z){let{spanId:J,traceId:X}=Z.spanContext(),{data:Y,op:$,parent_span_id:Q,status:K,origin:W,links:G}=M0(Z);return{parent_span_id:Q,span_id:J,trace_id:X,data:Y,op:$,status:K,origin:W,links:G}}function LX(Z){let{spanId:J,traceId:X,isRemote:Y}=Z.spanContext(),$=Y?J:M0(Z).parent_span_id,Q=h4(Z).scope,K=Y?Q?.getPropagationContext().propagationSpanId||Q9():J;return{parent_span_id:$,span_id:K,trace_id:X}}function fj(Z){let{traceId:J,spanId:X}=Z.spanContext(),Y=y7(Z);return UX(J,X,Y)}function I$(Z){if(Z&&Z.length>0)return Z.map(({context:{spanId:J,traceId:X,traceFlags:Y,...$},attributes:Q})=>({span_id:J,trace_id:X,sampled:Y===hj,attributes:Q,...$}));else return}function y5(Z){if(typeof Z==="number")return w$0(Z);if(Array.isArray(Z))return Z[0]+Z[1]/1e9;if(Z instanceof Date)return w$0(Z.getTime());return zX()}function w$0(Z){return Z>9999999999?Z/1000:Z}function M0(Z){if(ln1(Z))return Z.getSpanJSON();let{spanId:J,traceId:X}=Z.spanContext();if(cn1(Z)){let{attributes:Y,startTime:$,name:Q,endTime:K,status:W,links:G}=Z,V="parentSpanId"in Z?Z.parentSpanId:("parentSpanContext"in Z)?Z.parentSpanContext?.spanId:void 0;return{span_id:J,trace_id:X,data:Y,description:Q,parent_span_id:V,start_timestamp:y5($),timestamp:y5(K)||void 0,status:_$(W),op:Y[y0],origin:Y[W1],links:I$(G)}}return{span_id:J,trace_id:X,start_timestamp:0,data:{}}}function cn1(Z){let J=Z;return!!J.attributes&&!!J.startTime&&!!J.name&&!!J.endTime&&!!J.status}function ln1(Z){return typeof Z.getSpanJSON==="function"}function y7(Z){let{traceFlags:J}=Z.spanContext();return J===hj}function _$(Z){if(!Z||Z.code===Av)return;if(Z.code===gW)return"ok";return Z.message||"unknown_error"}var hz="_sentryChildSpans",xv="_sentryRootSpan";function mW(Z,J){let X=Z[xv]||Z;if(W6(J,xv,X),Z[hz])Z[hz].add(J);else W6(Z,hz,new Set([J]))}function yj(Z){let J=new Set;function X(Y){if(J.has(Y))return;else if(y7(Y)){J.add(Y);let $=Y[hz]?Array.from(Y[hz]):[];for(let Q of $)X(Q)}}return X(Z),Array.from(J)}function H8(Z){return Z[xv]||Z}function uW(){let Z=W5(),J=A4(Z);if(J.getActiveSpan)return J.getActiveSpan();return mZ(O1())}function fz(){if(!B$0)D8(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),B$0=!0}var fv="?",O$0=/\(error: (.*)\)/,N$0=/captureMessage|captureException/;function gj(...Z){let J=Z.sort((X,Y)=>X[0]-Y[0]).map((X)=>X[1]);return(X,Y=0,$=0)=>{let Q=[],K=X.split(`
|
466
466
|
`);for(let W=Y;W<K.length;W++){let G=K[W];if(G.length>1024)continue;let V=O$0.test(G)?G.replace(O$0,"$1"):G;if(V.match(/\S*Error: /))continue;for(let H of J){let F=H(V);if(F){Q.push(F);break}}if(Q.length>=50+$)break}return R$0(Q.slice($))}}function yv(Z){if(Array.isArray(Z))return gj(...Z);return Z}function R$0(Z){if(!Z.length)return[];let J=Array.from(Z);if(/sentryWrapped/.test(bj(J).function||""))J.pop();if(J.reverse(),N$0.test(bj(J).function||"")){if(J.pop(),N$0.test(bj(J).function||""))J.pop()}return J.slice(0,50).map((X)=>({...X,filename:X.filename||bj(J).filename,function:X.function||"?"}))}function bj(Z){return Z[Z.length-1]||{}}var hv="<anonymous>";function yz(Z){try{if(!Z||typeof Z!=="function")return hv;return Z.name||hv}catch(J){return hv}}var mj={},M$0={};function dW(Z,J){mj[Z]=mj[Z]||[],mj[Z].push(J)}function cW(Z,J){if(!M$0[Z]){M$0[Z]=!0;try{J()}catch(X){q0&&l.error(`Error while instrumenting ${Z}`,X)}}}function lW(Z,J){let X=Z&&mj[Z];if(!X)return;for(let Y of X)try{Y(J)}catch($){q0&&l.error(`Error while triggering instrumentation handler.
|
467
467
|
Type: ${Z}
|
468
468
|
Name: ${yz(Y)}
|
package/package.json
CHANGED