forked from Simnation/Main
28 lines
108 KiB
JavaScript
28 lines
108 KiB
JavaScript
(()=>{var xn=Object.create;var Nt=Object.defineProperty;var Pn=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var Nn=Object.getPrototypeOf,In=Object.prototype.hasOwnProperty;var Se=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var kn=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of Tn(e))!In.call(o,u)&&u!==t&&Nt(o,u,{get:()=>e[u],enumerable:!(i=Pn(e,u))||i.enumerable});return o};var vt=(o,e,t)=>(t=o!=null?xn(Nn(o)):{},kn(e||!o||!o.__esModule?Nt(t,"default",{value:o,enumerable:!0}):t,o));var Ot=Se((Rt,St)=>{(function(o,e){typeof Rt=="object"&&typeof St<"u"?St.exports=e():typeof define=="function"&&define.amd?define(e):o.JSON5=e()})(Rt,function(){"use strict";function o(a,h){return h={exports:{}},a(h,h.exports),h.exports}var e=o(function(a){var h=a.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=h)}),t=o(function(a){var h=a.exports={version:"2.6.5"};typeof __e=="number"&&(__e=h)}),i=t.version,u=function(a){return typeof a=="object"?a!==null:typeof a=="function"},d=function(a){if(!u(a))throw TypeError(a+" is not an object!");return a},y=function(a){try{return!!a()}catch{return!0}},_=!y(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),b=e.document,A=u(b)&&u(b.createElement),v=function(a){return A?b.createElement(a):{}},re=!_&&!y(function(){return Object.defineProperty(v("div"),"a",{get:function(){return 7}}).a!=7}),J=function(a,h){if(!u(a))return a;var F,E;if(h&&typeof(F=a.toString)=="function"&&!u(E=F.call(a))||typeof(F=a.valueOf)=="function"&&!u(E=F.call(a))||!h&&typeof(F=a.toString)=="function"&&!u(E=F.call(a)))return E;throw TypeError("Can't convert object to primitive value")},z=Object.defineProperty,Q=_?Object.defineProperty:function(h,F,E){if(d(h),F=J(F,!0),d(E),re)try{return z(h,F,E)}catch{}if("get"in E||"set"in E)throw TypeError("Accessors not supported!");return"value"in E&&(h[F]=E.value),h},le={f:Q},Ee=function(a,h){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:h}},ce=_?function(a,h,F){return le.f(a,h,Ee(1,F))}:function(a,h,F){return a[h]=F,a},Be={}.hasOwnProperty,Ce=function(a,h){return Be.call(a,h)},Oe=0,_e=Math.random(),Me=function(a){return"Symbol(".concat(a===void 0?"":a,")_",(++Oe+_e).toString(36))},O=!1,ge=o(function(a){var h="__core-js_shared__",F=e[h]||(e[h]={});(a.exports=function(E,B){return F[E]||(F[E]=B!==void 0?B:{})})("versions",[]).push({version:t.version,mode:O?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),Le=ge("native-function-to-string",Function.toString),Ue=o(function(a){var h=Me("src"),F="toString",E=(""+Le).split(F);t.inspectSource=function(B){return Le.call(B)},(a.exports=function(B,T,I,ue){var $=typeof I=="function";$&&(Ce(I,"name")||ce(I,"name",T)),B[T]!==I&&($&&(Ce(I,h)||ce(I,h,B[T]?""+B[T]:E.join(String(T)))),B===e?B[T]=I:ue?B[T]?B[T]=I:ce(B,T,I):(delete B[T],ce(B,T,I)))})(Function.prototype,F,function(){return typeof this=="function"&&this[h]||Le.call(this)})}),Ze=function(a){if(typeof a!="function")throw TypeError(a+" is not a function!");return a},Qe=function(a,h,F){if(Ze(a),h===void 0)return a;switch(F){case 1:return function(E){return a.call(h,E)};case 2:return function(E,B){return a.call(h,E,B)};case 3:return function(E,B,T){return a.call(h,E,B,T)}}return function(){return a.apply(h,arguments)}},M="prototype",ee=function(a,h,F){var E=a&ee.F,B=a&ee.G,T=a&ee.S,I=a&ee.P,ue=a&ee.B,$=B?e:T?e[h]||(e[h]={}):(e[h]||{})[M],Te=B?t:t[h]||(t[h]={}),We=Te[M]||(Te[M]={}),de,me,ae,Ge;B&&(F=h);for(de in F)me=!E&&$&&$[de]!==void 0,ae=(me?$:F)[de],Ge=ue&&me?Qe(ae,e):I&&typeof ae=="function"?Qe(Function.call,ae):ae,$&&Ue($,de,ae,a&ee.U),Te[de]!=ae&&ce(Te,de,Ge),I&&We[de]!=ae&&(We[de]=ae)};e.core=t,ee.F=1,ee.G=2,ee.S=4,ee.P=8,ee.B=16,ee.W=32,ee.U=64,ee.R=128;var Ae=ee,Et=Math.ceil,n=Math.floor,r=function(a){return isNaN(a=+a)?0:(a>0?n:Et)(a)},s=function(a){if(a==null)throw TypeError("Can't call method on "+a);return a},l=function(a){return function(h,F){var E=String(s(h)),B=r(F),T=E.length,I,ue;return B<0||B>=T?a?"":void 0:(I=E.charCodeAt(B),I<55296||I>56319||B+1===T||(ue=E.charCodeAt(B+1))<56320||ue>57343?a?E.charAt(B):I:a?E.slice(B,B+2):(I-55296<<10)+(ue-56320)+65536)}},c=l(!1);Ae(Ae.P,"String",{codePointAt:function(h){return c(this,h)}});var f=t.String.codePointAt,C=Math.max,p=Math.min,g=function(a,h){return a=r(a),a<0?C(a+h,0):p(a,h)},m=String.fromCharCode,R=String.fromCodePoint;Ae(Ae.S+Ae.F*(!!R&&R.length!=1),"String",{fromCodePoint:function(h){for(var F=arguments,E=[],B=arguments.length,T=0,I;B>T;){if(I=+F[T++],g(I,1114111)!==I)throw RangeError(I+" is not a valid code point");E.push(I<65536?m(I):m(((I-=65536)>>10)+55296,I%1024+56320))}return E.join("")}});var X=t.String.fromCodePoint,k=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,V=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,j=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,K={Space_Separator:k,ID_Start:V,ID_Continue:j},G={isSpaceSeparator:function(h){return typeof h=="string"&&K.Space_Separator.test(h)},isIdStartChar:function(h){return typeof h=="string"&&(h>="a"&&h<="z"||h>="A"&&h<="Z"||h==="$"||h==="_"||K.ID_Start.test(h))},isIdContinueChar:function(h){return typeof h=="string"&&(h>="a"&&h<="z"||h>="A"&&h<="Z"||h>="0"&&h<="9"||h==="$"||h==="_"||h==="\u200C"||h==="\u200D"||K.ID_Continue.test(h))},isDigit:function(h){return typeof h=="string"&&/[0-9]/.test(h)},isHexDigit:function(h){return typeof h=="string"&&/[0-9A-Fa-f]/.test(h)}},we,U,se,oe,q,he,Z,At,Ke,mn=function(h,F){we=String(h),U="start",se=[],oe=0,q=1,he=0,Z=void 0,At=void 0,Ke=void 0;do Z=pn(),yn[U]();while(Z.type!=="eof");return typeof F=="function"?yt({"":Ke},"",F):Ke};function yt(a,h,F){var E=a[h];if(E!=null&&typeof E=="object")if(Array.isArray(E))for(var B=0;B<E.length;B++){var T=String(B),I=yt(E,T,F);I===void 0?delete E[T]:Object.defineProperty(E,T,{value:I,writable:!0,enumerable:!0,configurable:!0})}else for(var ue in E){var $=yt(E,ue,F);$===void 0?delete E[ue]:Object.defineProperty(E,ue,{value:$,writable:!0,enumerable:!0,configurable:!0})}return F.call(a,h,E)}var P,w,$e,ye,N;function pn(){for(P="default",w="",$e=!1,ye=1;;){N=Fe();var a=xt[P]();if(a)return a}}function Fe(){if(we[oe])return String.fromCodePoint(we.codePointAt(oe))}function D(){var a=Fe();return a===`
|
|
`?(q++,he=0):a?he+=a.length:he++,a&&(oe+=a.length),a}var xt={default:function(){switch(N){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|
`:case"\r":case"\u2028":case"\u2029":D();return;case"/":D(),P="comment";return;case void 0:return D(),Y("eof")}if(G.isSpaceSeparator(N)){D();return}return xt[U]()},comment:function(){switch(N){case"*":D(),P="multiLineComment";return;case"/":D(),P="singleLineComment";return}throw H(D())},multiLineComment:function(){switch(N){case"*":D(),P="multiLineCommentAsterisk";return;case void 0:throw H(D())}D()},multiLineCommentAsterisk:function(){switch(N){case"*":D();return;case"/":D(),P="default";return;case void 0:throw H(D())}D(),P="multiLineComment"},singleLineComment:function(){switch(N){case`
|
|
`:case"\r":case"\u2028":case"\u2029":D(),P="default";return;case void 0:return D(),Y("eof")}D()},value:function(){switch(N){case"{":case"[":return Y("punctuator",D());case"n":return D(),xe("ull"),Y("null",null);case"t":return D(),xe("rue"),Y("boolean",!0);case"f":return D(),xe("alse"),Y("boolean",!1);case"-":case"+":D()==="-"&&(ye=-1),P="sign";return;case".":w=D(),P="decimalPointLeading";return;case"0":w=D(),P="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":w=D(),P="decimalInteger";return;case"I":return D(),xe("nfinity"),Y("numeric",1/0);case"N":return D(),xe("aN"),Y("numeric",NaN);case'"':case"'":$e=D()==='"',w="",P="string";return}throw H(D())},identifierNameStartEscape:function(){if(N!=="u")throw H(D());D();var h=Ft();switch(h){case"$":case"_":break;default:if(!G.isIdStartChar(h))throw Pt();break}w+=h,P="identifierName"},identifierName:function(){switch(N){case"$":case"_":case"\u200C":case"\u200D":w+=D();return;case"\\":D(),P="identifierNameEscape";return}if(G.isIdContinueChar(N)){w+=D();return}return Y("identifier",w)},identifierNameEscape:function(){if(N!=="u")throw H(D());D();var h=Ft();switch(h){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!G.isIdContinueChar(h))throw Pt();break}w+=h,P="identifierName"},sign:function(){switch(N){case".":w=D(),P="decimalPointLeading";return;case"0":w=D(),P="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":w=D(),P="decimalInteger";return;case"I":return D(),xe("nfinity"),Y("numeric",ye*(1/0));case"N":return D(),xe("aN"),Y("numeric",NaN)}throw H(D())},zero:function(){switch(N){case".":w+=D(),P="decimalPoint";return;case"e":case"E":w+=D(),P="decimalExponent";return;case"x":case"X":w+=D(),P="hexadecimal";return}return Y("numeric",ye*0)},decimalInteger:function(){switch(N){case".":w+=D(),P="decimalPoint";return;case"e":case"E":w+=D(),P="decimalExponent";return}if(G.isDigit(N)){w+=D();return}return Y("numeric",ye*Number(w))},decimalPointLeading:function(){if(G.isDigit(N)){w+=D(),P="decimalFraction";return}throw H(D())},decimalPoint:function(){switch(N){case"e":case"E":w+=D(),P="decimalExponent";return}if(G.isDigit(N)){w+=D(),P="decimalFraction";return}return Y("numeric",ye*Number(w))},decimalFraction:function(){switch(N){case"e":case"E":w+=D(),P="decimalExponent";return}if(G.isDigit(N)){w+=D();return}return Y("numeric",ye*Number(w))},decimalExponent:function(){switch(N){case"+":case"-":w+=D(),P="decimalExponentSign";return}if(G.isDigit(N)){w+=D(),P="decimalExponentInteger";return}throw H(D())},decimalExponentSign:function(){if(G.isDigit(N)){w+=D(),P="decimalExponentInteger";return}throw H(D())},decimalExponentInteger:function(){if(G.isDigit(N)){w+=D();return}return Y("numeric",ye*Number(w))},hexadecimal:function(){if(G.isHexDigit(N)){w+=D(),P="hexadecimalInteger";return}throw H(D())},hexadecimalInteger:function(){if(G.isHexDigit(N)){w+=D();return}return Y("numeric",ye*Number(w))},string:function(){switch(N){case"\\":D(),w+=En();return;case'"':if($e)return D(),Y("string",w);w+=D();return;case"'":if(!$e)return D(),Y("string",w);w+=D();return;case`
|
|
`:case"\r":throw H(D());case"\u2028":case"\u2029":Fn(N);break;case void 0:throw H(D())}w+=D()},start:function(){switch(N){case"{":case"[":return Y("punctuator",D())}P="value"},beforePropertyName:function(){switch(N){case"$":case"_":w=D(),P="identifierName";return;case"\\":D(),P="identifierNameStartEscape";return;case"}":return Y("punctuator",D());case'"':case"'":$e=D()==='"',P="string";return}if(G.isIdStartChar(N)){w+=D(),P="identifierName";return}throw H(D())},afterPropertyName:function(){if(N===":")return Y("punctuator",D());throw H(D())},beforePropertyValue:function(){P="value"},afterPropertyValue:function(){switch(N){case",":case"}":return Y("punctuator",D())}throw H(D())},beforeArrayValue:function(){if(N==="]")return Y("punctuator",D());P="value"},afterArrayValue:function(){switch(N){case",":case"]":return Y("punctuator",D())}throw H(D())},end:function(){throw H(D())}};function Y(a,h){return{type:a,value:h,line:q,column:he}}function xe(a){for(var h=0,F=a;h<F.length;h+=1){var E=F[h],B=Fe();if(B!==E)throw H(D());D()}}function En(){var a=Fe();switch(a){case"b":return D(),"\b";case"f":return D(),"\f";case"n":return D(),`
|
|
`;case"r":return D(),"\r";case"t":return D()," ";case"v":return D(),"\v";case"0":if(D(),G.isDigit(Fe()))throw H(D());return"\0";case"x":return D(),An();case"u":return D(),Ft();case`
|
|
`:case"\u2028":case"\u2029":return D(),"";case"\r":return D(),Fe()===`
|
|
`&&D(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw H(D());case void 0:throw H(D())}return D()}function An(){var a="",h=Fe();if(!G.isHexDigit(h)||(a+=D(),h=Fe(),!G.isHexDigit(h)))throw H(D());return a+=D(),String.fromCodePoint(parseInt(a,16))}function Ft(){for(var a="",h=4;h-- >0;){var F=Fe();if(!G.isHexDigit(F))throw H(D());a+=D()}return String.fromCodePoint(parseInt(a,16))}var yn={start:function(){if(Z.type==="eof")throw Pe();bt()},beforePropertyName:function(){switch(Z.type){case"identifier":case"string":At=Z.value,U="afterPropertyName";return;case"punctuator":et();return;case"eof":throw Pe()}},afterPropertyName:function(){if(Z.type==="eof")throw Pe();U="beforePropertyValue"},beforePropertyValue:function(){if(Z.type==="eof")throw Pe();bt()},beforeArrayValue:function(){if(Z.type==="eof")throw Pe();if(Z.type==="punctuator"&&Z.value==="]"){et();return}bt()},afterPropertyValue:function(){if(Z.type==="eof")throw Pe();switch(Z.value){case",":U="beforePropertyName";return;case"}":et()}},afterArrayValue:function(){if(Z.type==="eof")throw Pe();switch(Z.value){case",":U="beforeArrayValue";return;case"]":et()}},end:function(){}};function bt(){var a;switch(Z.type){case"punctuator":switch(Z.value){case"{":a={};break;case"[":a=[];break}break;case"null":case"boolean":case"numeric":case"string":a=Z.value;break}if(Ke===void 0)Ke=a;else{var h=se[se.length-1];Array.isArray(h)?h.push(a):Object.defineProperty(h,At,{value:a,writable:!0,enumerable:!0,configurable:!0})}if(a!==null&&typeof a=="object")se.push(a),Array.isArray(a)?U="beforeArrayValue":U="beforePropertyName";else{var F=se[se.length-1];F==null?U="end":Array.isArray(F)?U="afterArrayValue":U="afterPropertyValue"}}function et(){se.pop();var a=se[se.length-1];a==null?U="end":Array.isArray(a)?U="afterArrayValue":U="afterPropertyValue"}function H(a){return tt(a===void 0?"JSON5: invalid end of input at "+q+":"+he:"JSON5: invalid character '"+Tt(a)+"' at "+q+":"+he)}function Pe(){return tt("JSON5: invalid end of input at "+q+":"+he)}function Pt(){return he-=5,tt("JSON5: invalid identifier character at "+q+":"+he)}function Fn(a){console.warn("JSON5: '"+Tt(a)+"' in strings is not valid ECMAScript; consider escaping")}function Tt(a){var h={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(h[a])return h[a];if(a<" "){var F=a.charCodeAt(0).toString(16);return"\\x"+("00"+F).substring(F.length)}return a}function tt(a){var h=new SyntaxError(a);return h.lineNumber=q,h.columnNumber=he,h}var bn=function(h,F,E){var B=[],T="",I,ue,$="",Te;if(F!=null&&typeof F=="object"&&!Array.isArray(F)&&(E=F.space,Te=F.quote,F=F.replacer),typeof F=="function")ue=F;else if(Array.isArray(F)){I=[];for(var We=0,de=F;We<de.length;We+=1){var me=de[We],ae=void 0;typeof me=="string"?ae=me:(typeof me=="number"||me instanceof String||me instanceof Number)&&(ae=String(me)),ae!==void 0&&I.indexOf(ae)<0&&I.push(ae)}}return E instanceof Number?E=Number(E):E instanceof String&&(E=String(E)),typeof E=="number"?E>0&&(E=Math.min(10,Math.floor(E)),$=" ".substr(0,E)):typeof E=="string"&&($=E.substr(0,10)),Ge("",{"":h});function Ge(L,ne){var x=ne[L];switch(x!=null&&(typeof x.toJSON5=="function"?x=x.toJSON5(L):typeof x.toJSON=="function"&&(x=x.toJSON(L))),ue&&(x=ue.call(ne,L,x)),x instanceof Number?x=Number(x):x instanceof String?x=String(x):x instanceof Boolean&&(x=x.valueOf()),x){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof x=="string")return nt(x,!1);if(typeof x=="number")return String(x);if(typeof x=="object")return Array.isArray(x)?Mn(x):Bn(x)}function nt(L){for(var ne={"'":.1,'"':.2},x={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},te="",fe=0;fe<L.length;fe++){var ie=L[fe];switch(ie){case"'":case'"':ne[ie]++,te+=ie;continue;case"\0":if(G.isDigit(L[fe+1])){te+="\\x00";continue}}if(x[ie]){te+=x[ie];continue}if(ie<" "){var Ne=ie.charCodeAt(0).toString(16);te+="\\x"+("00"+Ne).substring(Ne.length);continue}te+=ie}var be=Te||Object.keys(ne).reduce(function(Re,Ie){return ne[Re]<ne[Ie]?Re:Ie});return te=te.replace(new RegExp(be,"g"),x[be]),be+te+be}function Bn(L){if(B.indexOf(L)>=0)throw TypeError("Converting circular structure to JSON5");B.push(L);var ne=T;T=T+$;for(var x=I||Object.keys(L),te=[],fe=0,ie=x;fe<ie.length;fe+=1){var Ne=ie[fe],be=Ge(Ne,L);if(be!==void 0){var Re=_n(Ne)+":";$!==""&&(Re+=" "),Re+=be,te.push(Re)}}var Ie;if(te.length===0)Ie="{}";else{var it;if($==="")it=te.join(","),Ie="{"+it+"}";else{var wn=`,
|
|
`+T;it=te.join(wn),Ie=`{
|
|
`+T+it+`,
|
|
`+ne+"}"}}return B.pop(),T=ne,Ie}function _n(L){if(L.length===0)return nt(L,!0);var ne=String.fromCodePoint(L.codePointAt(0));if(!G.isIdStartChar(ne))return nt(L,!0);for(var x=ne.length;x<L.length;x++)if(!G.isIdContinueChar(String.fromCodePoint(L.codePointAt(x))))return nt(L,!0);return L}function Mn(L){if(B.indexOf(L)>=0)throw TypeError("Converting circular structure to JSON5");B.push(L);var ne=T;T=T+$;for(var x=[],te=0;te<L.length;te++){var fe=Ge(String(te),L);x.push(fe!==void 0?fe:"null")}var ie;if(x.length===0)ie="[]";else if($===""){var Ne=x.join(",");ie="["+Ne+"]"}else{var be=`,
|
|
`+T,Re=x.join(be);ie=`[
|
|
`+T+Re+`,
|
|
`+ne+"]"}return B.pop(),T=ne,ie}},vn={parse:mn,stringify:bn},Rn=vn,Sn=Rn;return Sn})});var Gt=Se(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.boolean=void 0;var Vn=function(o){switch(Object.prototype.toString.call(o)){case"[object String]":return["true","t","yes","y","on","1"].includes(o.trim().toLowerCase());case"[object Number]":return o.valueOf()===1;case"[object Boolean]":return o.valueOf();default:return!1}};ut.boolean=Vn});var Yt=Se(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.isBooleanable=void 0;var On=function(o){switch(Object.prototype.toString.call(o)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(o.trim().toLowerCase());case"[object Number]":return[0,1].includes(o.valueOf());case"[object Boolean]":return!0;default:return!1}};at.isBooleanable=On});var Ht=Se(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.isBooleanable=He.boolean=void 0;var Ln=Gt();Object.defineProperty(He,"boolean",{enumerable:!0,get:function(){return Ln.boolean}});var Wn=Yt();Object.defineProperty(He,"isBooleanable",{enumerable:!0,get:function(){return Wn.isBooleanable}})});var jt=Se(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.tokenize=void 0;var Gn=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,Yn=o=>{let e,t=[],i=0,u=0,d=null;for(;(e=Gn.exec(o))!==null;){e.index>u&&(d={literal:o.slice(u,e.index),type:"literal"},t.push(d));let y=e[0];u=e.index+y.length,y==="\\%"||y==="%%"?d&&d.type==="literal"?d.literal+="%":(d={literal:"%",type:"literal"},t.push(d)):e.groups&&(d={conversion:e.groups.conversion,flag:e.groups.flag||null,placeholder:y,position:e.groups.position?Number.parseInt(e.groups.position,10)-1:i++,precision:e.groups.precision?Number.parseInt(e.groups.precision.slice(1),10):null,type:"placeholder",width:e.groups.width?Number.parseInt(e.groups.width,10):null},t.push(d))}return u<=o.length-1&&(d&&d.type==="literal"?d.literal+=o.slice(u):t.push({literal:o.slice(u),type:"literal"})),t};ot.tokenize=Yn});var qt=Se(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.createPrintf=void 0;var zt=Ht(),Hn=jt(),jn=(o,e)=>e.placeholder,zn=o=>{var e;let t=(d,y,_)=>_==="-"?d.padEnd(y," "):_==="-+"?((Number(d)>=0?"+":"")+d).padEnd(y," "):_==="+"?((Number(d)>=0?"+":"")+d).padStart(y," "):_==="0"?d.padStart(y,"0"):d.padStart(y," "),i=(e=o?.formatUnboundExpression)!==null&&e!==void 0?e:jn,u={};return(d,...y)=>{let _=u[d];_||(_=u[d]=Hn.tokenize(d));let b="";for(let A of _)if(A.type==="literal")b+=A.literal;else{let v=y[A.position];if(v===void 0)b+=i(d,A,y);else if(A.conversion==="b")b+=zt.boolean(v)?"true":"false";else if(A.conversion==="B")b+=zt.boolean(v)?"TRUE":"FALSE";else if(A.conversion==="c")b+=v;else if(A.conversion==="C")b+=String(v).toUpperCase();else if(A.conversion==="i"||A.conversion==="d")v=String(Math.trunc(v)),A.width!==null&&(v=t(v,A.width,A.flag)),b+=v;else if(A.conversion==="e")b+=Number(v).toExponential();else if(A.conversion==="E")b+=Number(v).toExponential().toUpperCase();else if(A.conversion==="f")A.precision!==null&&(v=Number(v).toFixed(A.precision)),A.width!==null&&(v=t(String(v),A.width,A.flag)),b+=v;else if(A.conversion==="o")b+=(Number.parseInt(String(v),10)>>>0).toString(8);else if(A.conversion==="s")A.width!==null&&(v=t(String(v),A.width,A.flag)),b+=v;else if(A.conversion==="S")A.width!==null&&(v=t(String(v),A.width,A.flag)),b+=String(v).toUpperCase();else if(A.conversion==="u")b+=Number.parseInt(String(v),10)>>>0;else if(A.conversion==="x")v=(Number.parseInt(String(v),10)>>>0).toString(16),A.width!==null&&(v=t(String(v),A.width,A.flag)),b+=v;else throw new Error("Unknown format specifier.")}return b}};st.createPrintf=zn});var Kt=Se(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.printf=je.createPrintf=void 0;var Ut=qt();Object.defineProperty(je,"createPrintf",{enumerable:!0,get:function(){return Ut.createPrintf}});je.printf=Ut.createPrintf()});var Cn=Se((fn,Dn)=>{(function(o){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(r){return Object.prototype.toString.call(r)==="[object Array]"},i=10,u=typeof process=="object"&&typeof process.nextTick=="function",d=typeof Symbol=="function",y=typeof Reflect=="object",_=typeof setImmediate=="function",b=_?setImmediate:setTimeout,A=d?y&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(n){var r=Object.getOwnPropertyNames(n);return r.push.apply(r,Object.getOwnPropertySymbols(n)),r}:Object.keys;function v(){this._events={},this._conf&&re.call(this,this._conf)}function re(n){n&&(this._conf=n,n.delimiter&&(this.delimiter=n.delimiter),n.maxListeners!==o&&(this._maxListeners=n.maxListeners),n.wildcard&&(this.wildcard=n.wildcard),n.newListener&&(this._newListener=n.newListener),n.removeListener&&(this._removeListener=n.removeListener),n.verboseMemoryLeak&&(this.verboseMemoryLeak=n.verboseMemoryLeak),n.ignoreErrors&&(this.ignoreErrors=n.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function J(n,r){var s="(node) warning: possible EventEmitter memory leak detected. "+n+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(s+=" Event name: "+r+"."),typeof process<"u"&&process.emitWarning){var l=new Error(s);l.name="MaxListenersExceededWarning",l.emitter=this,l.count=n,process.emitWarning(l)}else console.error(s),console.trace&&console.trace()}var z=function(n,r,s){var l=arguments.length;switch(l){case 0:return[];case 1:return[n];case 2:return[n,r];case 3:return[n,r,s];default:for(var c=new Array(l);l--;)c[l]=arguments[l];return c}};function Q(n,r){for(var s={},l,c=n.length,f=r?r.length:0,C=0;C<c;C++)l=n[C],s[l]=C<f?r[C]:o;return s}function le(n,r,s){this._emitter=n,this._target=r,this._listeners={},this._listenersCount=0;var l,c;if((s.on||s.off)&&(l=s.on,c=s.off),r.addEventListener?(l=r.addEventListener,c=r.removeEventListener):r.addListener?(l=r.addListener,c=r.removeListener):r.on&&(l=r.on,c=r.off),!l&&!c)throw Error("target does not implement any known event API");if(typeof l!="function")throw TypeError("on method must be a function");if(typeof c!="function")throw TypeError("off method must be a function");this._on=l,this._off=c;var f=n._observers;f?f.push(this):n._observers=[this]}Object.assign(le.prototype,{subscribe:function(n,r,s){var l=this,c=this._target,f=this._emitter,C=this._listeners,p=function(){var g=z.apply(null,arguments),m={data:g,name:r,original:n};if(s){var R=s.call(c,m);R!==!1&&f.emit.apply(f,[m.name].concat(g));return}f.emit.apply(f,[r].concat(g))};if(C[n])throw Error("Event '"+n+"' is already listening");this._listenersCount++,f._newListener&&f._removeListener&&!l._onNewListener?(this._onNewListener=function(g){g===r&&C[n]===null&&(C[n]=p,l._on.call(c,n,p))},f.on("newListener",this._onNewListener),this._onRemoveListener=function(g){g===r&&!f.hasListeners(g)&&C[n]&&(C[n]=null,l._off.call(c,n,p))},C[n]=null,f.on("removeListener",this._onRemoveListener)):(C[n]=p,l._on.call(c,n,p))},unsubscribe:function(n){var r=this,s=this._listeners,l=this._emitter,c,f,C=this._off,p=this._target,g;if(n&&typeof n!="string")throw TypeError("event must be a string");function m(){r._onNewListener&&(l.off("newListener",r._onNewListener),l.off("removeListener",r._onRemoveListener),r._onNewListener=null,r._onRemoveListener=null);var R=Me.call(l,r);l._observers.splice(R,1)}if(n){if(c=s[n],!c)return;C.call(p,n,c),delete s[n],--this._listenersCount||m()}else{for(f=A(s),g=f.length;g-- >0;)n=f[g],C.call(p,n,s[n]);this._listeners={},this._listenersCount=0,m()}}});function Ee(n,r,s,l){var c=Object.assign({},r);if(!n)return c;if(typeof n!="object")throw TypeError("options must be an object");var f=Object.keys(n),C=f.length,p,g,m;function R(k){throw Error('Invalid "'+p+'" option value'+(k?". Reason: "+k:""))}for(var X=0;X<C;X++){if(p=f[X],!l&&!e.call(r,p))throw Error('Unknown "'+p+'" option');g=n[p],g!==o&&(m=s[p],c[p]=m?m(g,R):g)}return c}function ce(n,r){return(typeof n!="function"||!n.hasOwnProperty("prototype"))&&r("value must be a constructor"),n}function Be(n){var r="value must be type of "+n.join("|"),s=n.length,l=n[0],c=n[1];return s===1?function(f,C){if(typeof f===l)return f;C(r)}:s===2?function(f,C){var p=typeof f;if(p===l||p===c)return f;C(r)}:function(f,C){for(var p=typeof f,g=s;g-- >0;)if(p===n[g])return f;C(r)}}var Ce=Be(["function"]),Oe=Be(["object","function"]);function _e(n,r,s){var l,c,f=0,C,p=new n(function(g,m,R){s=Ee(s,{timeout:0,overload:!1},{timeout:function(j,K){return j*=1,(typeof j!="number"||j<0||!Number.isFinite(j))&&K("timeout must be a positive number"),j}}),l=!s.overload&&typeof n.prototype.cancel=="function"&&typeof R=="function";function X(){c&&(c=null),f&&(clearTimeout(f),f=0)}var k=function(j){X(),g(j)},V=function(j){X(),m(j)};l?r(k,V,R):(c=[function(j){V(j||Error("canceled"))}],r(k,V,function(j){if(C)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof j!="function")throw TypeError("onCancel callback must be a function");c.push(j)}),C=!0),s.timeout>0&&(f=setTimeout(function(){var j=Error("timeout");j.code="ETIMEDOUT",f=0,p.cancel(j),m(j)},s.timeout))});return l||(p.cancel=function(g){if(c){for(var m=c.length,R=1;R<m;R++)c[R](g);c[0](g),c=null}}),p}function Me(n){var r=this._observers;if(!r)return-1;for(var s=r.length,l=0;l<s;l++)if(r[l]._target===n)return l;return-1}function O(n,r,s,l,c){if(!s)return null;if(l===0){var f=typeof r;if(f==="string"){var C,p,g=0,m=0,R=this.delimiter,X=R.length;if((p=r.indexOf(R))!==-1){C=new Array(5);do C[g++]=r.slice(m,p),m=p+X;while((p=r.indexOf(R,m))!==-1);C[g++]=r.slice(m),r=C,c=g}else r=[r],c=1}else f==="object"?c=r.length:(r=[r],c=1)}var k=null,V,j,K,G,we,U=r[l],se=r[l+1],oe,q;if(l===c)s._listeners&&(typeof s._listeners=="function"?(n&&n.push(s._listeners),k=[s]):(n&&n.push.apply(n,s._listeners),k=[s]));else if(U==="*"){for(oe=A(s),p=oe.length;p-- >0;)V=oe[p],V!=="_listeners"&&(q=O(n,r,s[V],l+1,c),q&&(k?k.push.apply(k,q):k=q));return k}else if(U==="**"){for(we=l+1===c||l+2===c&&se==="*",we&&s._listeners&&(k=O(n,r,s,c,c)),oe=A(s),p=oe.length;p-- >0;)V=oe[p],V!=="_listeners"&&(V==="*"||V==="**"?(s[V]._listeners&&!we&&(q=O(n,r,s[V],c,c),q&&(k?k.push.apply(k,q):k=q)),q=O(n,r,s[V],l,c)):V===se?q=O(n,r,s[V],l+2,c):q=O(n,r,s[V],l,c),q&&(k?k.push.apply(k,q):k=q));return k}else s[U]&&(k=O(n,r,s[U],l+1,c));if(j=s["*"],j&&O(n,r,j,l+1,c),K=s["**"],K)if(l<c)for(K._listeners&&O(n,r,K,c,c),oe=A(K),p=oe.length;p-- >0;)V=oe[p],V!=="_listeners"&&(V===se?O(n,r,K[V],l+2,c):V===U?O(n,r,K[V],l+1,c):(G={},G[V]=K[V],O(n,r,{"**":G},l+1,c)));else K._listeners?O(n,r,K,c,c):K["*"]&&K["*"]._listeners&&O(n,r,K["*"],c,c);return k}function ge(n,r,s){var l=0,c=0,f,C=this.delimiter,p=C.length,g;if(typeof n=="string")if((f=n.indexOf(C))!==-1){g=new Array(5);do g[l++]=n.slice(c,f),c=f+p;while((f=n.indexOf(C,c))!==-1);g[l++]=n.slice(c)}else g=[n],l=1;else g=n,l=n.length;if(l>1){for(f=0;f+1<l;f++)if(g[f]==="**"&&g[f+1]==="**")return}var m=this.listenerTree,R;for(f=0;f<l;f++)if(R=g[f],m=m[R]||(m[R]={}),f===l-1)return m._listeners?(typeof m._listeners=="function"&&(m._listeners=[m._listeners]),s?m._listeners.unshift(r):m._listeners.push(r),!m._listeners.warned&&this._maxListeners>0&&m._listeners.length>this._maxListeners&&(m._listeners.warned=!0,J.call(this,m._listeners.length,R))):m._listeners=r,!0;return!0}function Le(n,r,s,l){for(var c=A(n),f=c.length,C,p,g,m=n._listeners,R;f-- >0;)p=c[f],C=n[p],p==="_listeners"?g=s:g=s?s.concat(p):[p],R=l||typeof p=="symbol",m&&r.push(R?g:g.join(this.delimiter)),typeof C=="object"&&Le.call(this,C,r,g,R);return r}function Ue(n){for(var r=A(n),s=r.length,l,c,f;s-- >0;)c=r[s],l=n[c],l&&(f=!0,c!=="_listeners"&&!Ue(l)&&delete n[c]);return f}function Ze(n,r,s){this.emitter=n,this.event=r,this.listener=s}Ze.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function Qe(n,r,s){if(s===!0)c=!0;else if(s===!1)l=!0;else{if(!s||typeof s!="object")throw TypeError("options should be an object or true");var l=s.async,c=s.promisify,f=s.nextTick,C=s.objectify}if(l||f||c){var p=r,g=r._origin||r;if(f&&!u)throw Error("process.nextTick is not supported");c===o&&(c=r.constructor.name==="AsyncFunction"),r=function(){var m=arguments,R=this,X=this.event;return c?f?Promise.resolve():new Promise(function(k){b(k)}).then(function(){return R.event=X,p.apply(R,m)}):(f?process.nextTick:b)(function(){R.event=X,p.apply(R,m)})},r._async=!0,r._origin=g}return[r,C?new Ze(this,n,r):this]}function M(n){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,re.call(this,n)}M.EventEmitter2=M,M.prototype.listenTo=function(n,r,s){if(typeof n!="object")throw TypeError("target musts be an object");var l=this;s=Ee(s,{on:o,off:o,reducers:o},{on:Ce,off:Ce,reducers:Oe});function c(f){if(typeof f!="object")throw TypeError("events must be an object");var C=s.reducers,p=Me.call(l,n),g;p===-1?g=new le(l,n,s):g=l._observers[p];for(var m=A(f),R=m.length,X,k=typeof C=="function",V=0;V<R;V++)X=m[V],g.subscribe(X,f[X]||X,k?C:C&&C[X])}return t(r)?c(Q(r)):c(typeof r=="string"?Q(r.split(/\s+/)):r),this},M.prototype.stopListeningTo=function(n,r){var s=this._observers;if(!s)return!1;var l=s.length,c,f=!1;if(n&&typeof n!="object")throw TypeError("target should be an object");for(;l-- >0;)c=s[l],(!n||c._target===n)&&(c.unsubscribe(r),f=!0);return f},M.prototype.delimiter=".",M.prototype.setMaxListeners=function(n){n!==o&&(this._maxListeners=n,this._conf||(this._conf={}),this._conf.maxListeners=n)},M.prototype.getMaxListeners=function(){return this._maxListeners},M.prototype.event="",M.prototype.once=function(n,r,s){return this._once(n,r,!1,s)},M.prototype.prependOnceListener=function(n,r,s){return this._once(n,r,!0,s)},M.prototype._once=function(n,r,s,l){return this._many(n,1,r,s,l)},M.prototype.many=function(n,r,s,l){return this._many(n,r,s,!1,l)},M.prototype.prependMany=function(n,r,s,l){return this._many(n,r,s,!0,l)},M.prototype._many=function(n,r,s,l,c){var f=this;if(typeof s!="function")throw new Error("many only accepts instances of Function");function C(){return--r===0&&f.off(n,C),s.apply(this,arguments)}return C._origin=s,this._on(n,C,l,c)},M.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||v.call(this);var n=arguments[0],r,s=this.wildcard,l,c,f,C,p;if(n==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(s&&(r=n,n!=="newListener"&&n!=="removeListener"&&typeof n=="object")){if(c=n.length,d){for(f=0;f<c;f++)if(typeof n[f]=="symbol"){p=!0;break}}p||(n=n.join(this.delimiter))}var g=arguments.length,m;if(this._all&&this._all.length)for(m=this._all.slice(),f=0,c=m.length;f<c;f++)switch(this.event=n,g){case 1:m[f].call(this,n);break;case 2:m[f].call(this,n,arguments[1]);break;case 3:m[f].call(this,n,arguments[1],arguments[2]);break;default:m[f].apply(this,arguments)}if(s)m=[],O.call(this,m,r,this.listenerTree,0,c);else if(m=this._events[n],typeof m=="function"){switch(this.event=n,g){case 1:m.call(this);break;case 2:m.call(this,arguments[1]);break;case 3:m.call(this,arguments[1],arguments[2]);break;default:for(l=new Array(g-1),C=1;C<g;C++)l[C-1]=arguments[C];m.apply(this,l)}return!0}else m&&(m=m.slice());if(m&&m.length){if(g>3)for(l=new Array(g-1),C=1;C<g;C++)l[C-1]=arguments[C];for(f=0,c=m.length;f<c;f++)switch(this.event=n,g){case 1:m[f].call(this);break;case 2:m[f].call(this,arguments[1]);break;case 3:m[f].call(this,arguments[1],arguments[2]);break;default:m[f].apply(this,l)}return!0}else if(!this.ignoreErrors&&!this._all&&n==="error")throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},M.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||v.call(this);var n=arguments[0],r=this.wildcard,s,l,c,f,C,p;if(n==="newListener"&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(r&&(s=n,n!=="newListener"&&n!=="removeListener"&&typeof n=="object")){if(f=n.length,d){for(C=0;C<f;C++)if(typeof n[C]=="symbol"){l=!0;break}}l||(n=n.join(this.delimiter))}var g=[],m=arguments.length,R;if(this._all)for(C=0,f=this._all.length;C<f;C++)switch(this.event=n,m){case 1:g.push(this._all[C].call(this,n));break;case 2:g.push(this._all[C].call(this,n,arguments[1]));break;case 3:g.push(this._all[C].call(this,n,arguments[1],arguments[2]));break;default:g.push(this._all[C].apply(this,arguments))}if(r?(R=[],O.call(this,R,s,this.listenerTree,0)):R=this._events[n],typeof R=="function")switch(this.event=n,m){case 1:g.push(R.call(this));break;case 2:g.push(R.call(this,arguments[1]));break;case 3:g.push(R.call(this,arguments[1],arguments[2]));break;default:for(c=new Array(m-1),p=1;p<m;p++)c[p-1]=arguments[p];g.push(R.apply(this,c))}else if(R&&R.length){if(R=R.slice(),m>3)for(c=new Array(m-1),p=1;p<m;p++)c[p-1]=arguments[p];for(C=0,f=R.length;C<f;C++)switch(this.event=n,m){case 1:g.push(R[C].call(this));break;case 2:g.push(R[C].call(this,arguments[1]));break;case 3:g.push(R[C].call(this,arguments[1],arguments[2]));break;default:g.push(R[C].apply(this,c))}}else if(!this.ignoreErrors&&!this._all&&n==="error")return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(g)},M.prototype.on=function(n,r,s){return this._on(n,r,!1,s)},M.prototype.prependListener=function(n,r,s){return this._on(n,r,!0,s)},M.prototype.onAny=function(n){return this._onAny(n,!1)},M.prototype.prependAny=function(n){return this._onAny(n,!0)},M.prototype.addListener=M.prototype.on,M.prototype._onAny=function(n,r){if(typeof n!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),r?this._all.unshift(n):this._all.push(n),this},M.prototype._on=function(n,r,s,l){if(typeof n=="function")return this._onAny(n,r),this;if(typeof r!="function")throw new Error("on only accepts instances of Function");this._events||v.call(this);var c=this,f;return l!==o&&(f=Qe.call(this,n,r,l),r=f[0],c=f[1]),this._newListener&&this.emit("newListener",n,r),this.wildcard?(ge.call(this,n,r,s),c):(this._events[n]?(typeof this._events[n]=="function"&&(this._events[n]=[this._events[n]]),s?this._events[n].unshift(r):this._events[n].push(r),!this._events[n].warned&&this._maxListeners>0&&this._events[n].length>this._maxListeners&&(this._events[n].warned=!0,J.call(this,this._events[n].length,n))):this._events[n]=r,c)},M.prototype.off=function(n,r){if(typeof r!="function")throw new Error("removeListener only takes instances of Function");var s,l=[];if(this.wildcard){var c=typeof n=="string"?n.split(this.delimiter):n.slice();if(l=O.call(this,null,c,this.listenerTree,0),!l)return this}else{if(!this._events[n])return this;s=this._events[n],l.push({_listeners:s})}for(var f=0;f<l.length;f++){var C=l[f];if(s=C._listeners,t(s)){for(var p=-1,g=0,m=s.length;g<m;g++)if(s[g]===r||s[g].listener&&s[g].listener===r||s[g]._origin&&s[g]._origin===r){p=g;break}if(p<0)continue;return this.wildcard?C._listeners.splice(p,1):this._events[n].splice(p,1),s.length===0&&(this.wildcard?delete C._listeners:delete this._events[n]),this._removeListener&&this.emit("removeListener",n,r),this}else(s===r||s.listener&&s.listener===r||s._origin&&s._origin===r)&&(this.wildcard?delete C._listeners:delete this._events[n],this._removeListener&&this.emit("removeListener",n,r))}return this.listenerTree&&Ue(this.listenerTree),this},M.prototype.offAny=function(n){var r=0,s=0,l;if(n&&this._all&&this._all.length>0){for(l=this._all,r=0,s=l.length;r<s;r++)if(n===l[r])return l.splice(r,1),this._removeListener&&this.emit("removeListenerAny",n),this}else{if(l=this._all,this._removeListener)for(r=0,s=l.length;r<s;r++)this.emit("removeListenerAny",l[r]);this._all=[]}return this},M.prototype.removeListener=M.prototype.off,M.prototype.removeAllListeners=function(n){if(n===o)return!this._events||v.call(this),this;if(this.wildcard){var r=O.call(this,null,n,this.listenerTree,0),s,l;if(!r)return this;for(l=0;l<r.length;l++)s=r[l],s._listeners=null;this.listenerTree&&Ue(this.listenerTree)}else this._events&&(this._events[n]=null);return this},M.prototype.listeners=function(n){var r=this._events,s,l,c,f,C;if(n===o){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!r)return[];for(s=A(r),f=s.length,c=[];f-- >0;)l=r[s[f]],typeof l=="function"?c.push(l):c.push.apply(c,l);return c}else{if(this.wildcard){if(C=this.listenerTree,!C)return[];var p=[],g=typeof n=="string"?n.split(this.delimiter):n.slice();return O.call(this,p,g,C,0),p}return r?(l=r[n],l?typeof l=="function"?[l]:l:[]):[]}},M.prototype.eventNames=function(n){var r=this._events;return this.wildcard?Le.call(this,this.listenerTree,[],null,n):r?A(r):[]},M.prototype.listenerCount=function(n){return this.listeners(n).length},M.prototype.hasListeners=function(n){if(this.wildcard){var r=[],s=typeof n=="string"?n.split(this.delimiter):n.slice();return O.call(this,r,s,this.listenerTree,0),r.length>0}var l=this._events,c=this._all;return!!(c&&c.length||l&&(n===o?A(l).length:l[n]))},M.prototype.listenersAny=function(){return this._all?this._all:[]},M.prototype.waitFor=function(n,r){var s=this,l=typeof r;return l==="number"?r={timeout:r}:l==="function"&&(r={filter:r}),r=Ee(r,{timeout:0,filter:o,handleError:!1,Promise,overload:!1},{filter:Ce,Promise:ce}),_e(r.Promise,function(c,f,C){function p(){var g=r.filter;if(!(g&&!g.apply(s,arguments)))if(s.off(n,p),r.handleError){var m=arguments[0];m?f(m):c(z.apply(null,arguments).slice(1))}else c(z.apply(null,arguments))}C(function(){s.off(n,p)}),s._on(n,p,!1)},{timeout:r.timeout,overload:r.overload})};function ee(n,r,s){s=Ee(s,{Promise,timeout:0,overload:!1},{Promise:ce});var l=s.Promise;return _e(l,function(c,f,C){var p;if(typeof n.addEventListener=="function"){p=function(){c(z.apply(null,arguments))},C(function(){n.removeEventListener(r,p)}),n.addEventListener(r,p,{once:!0});return}var g=function(){m&&n.removeListener("error",m),c(z.apply(null,arguments))},m;r!=="error"&&(m=function(R){n.removeListener(r,g),f(R)},n.once("error",m)),C(function(){m&&n.removeListener("error",m),n.removeListener(r,g)}),n.once(r,g)},{timeout:s.timeout,overload:s.overload})}var Ae=M.prototype;if(Object.defineProperties(M,{defaultMaxListeners:{get:function(){return Ae._maxListeners},set:function(n){if(typeof n!="number"||n<0||Number.isNaN(n))throw TypeError("n must be a non-negative number");Ae._maxListeners=n},enumerable:!0},once:{value:ee,writable:!0,configurable:!0}}),Object.defineProperties(Ae,{_maxListeners:{value:i,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return M});else if(typeof fn=="object")Dn.exports=M;else{var Et=new Function("","return this")();Et.EventEmitter2=M}})()});var It=PlayerId(),S=new Proxy({playerId:It,serverId:GetPlayerServerId(It),ped:PlayerPedId(),vehicle:!1,seat:!1,resource:GetCurrentResourceName(),game:GetGameName()},{set(o,e,t){return o[e]===t||(o[e]=t,emit(`yaca:cache:${e}`,t)),!0},get(o,e){return o[e]}});function kt(){setInterval(()=>{let e=PlayerPedId();S.ped=e;let t=GetVehiclePedIsIn(e,!1);if(t>0){if(t!==S.vehicle&&(S.seat=!1),S.vehicle=t,!S.seat||GetPedInVehicleSeat(t,S.seat)!==e){for(let i=-1;i<GetVehicleMaxNumberOfPassengers(t)-1;i++)if(GetPedInVehicleSeat(t,i)===e){S.seat=i;break}}}else S.vehicle=!1,S.seat=!1},100)}var Vt=(o,e)=>{on(`yaca:cache:${o}`,e)};function De(o,e){on(`__cfx_export_saltychat_${o}`,t=>{t(e)})}var Lt=vt(Ot());function Wt(o,e,t=[]){let i={...o};for(let u in o){if(Object.prototype.hasOwnProperty.call(o,u)===!1)continue;let d=[...t,u].join(".");u in e?typeof o[u]=="object"&&o[u]!==null&&!Array.isArray(o[u])&&typeof e[u]=="object"&&e[u]!==null&&!Array.isArray(e[u])?i[u]=Wt(o[u],e[u],[...t,u]):i[u]=e[u]:console.warn(`[YaCA] Missing config value for key '${d}' setting to default value: ${o[u]}
|
|
Missing config values can cause unexpected behavior of the script.`)}for(let u of Object.keys(e)){let d=[...t,u].join(".");u in o||console.warn(`[YaCA] Unknown config key '${d}' found in config file. This key will be ignored and can be removed.`)}return i}function Bt(o,e){let t=LoadResourceFile(GetCurrentResourceName(),o);if(!t)return e;let i=Lt.default.parse(t);return Wt(e,i)}var rt="yacaMegaphone",_t="yacaPhoneSpeaker",Mt="yacaLipSync",Je="yacaVoiceRange",pe="yacaGlobalErrorLevel";var Jt=vt(Kt()),$t=GetCurrentResourceName(),Xt={};function Zt(o,e,t){for(let[i,u]of Object.entries(o)){let d=t?`${t}.${i}`:i;typeof u=="object"?Zt(u,e,d):e[d]=String(u)}return e}var W=(o,...e)=>{let t=Xt[o];return t?e.length>0?(0,Jt.printf)(t,...e):t:o};var Qt=o=>{let e=o||"en",t=JSON.parse(LoadResourceFile($t,`locales/${e}.json`));if(!t&&(console.warn(`could not load 'locales/${e}.json'`),e!=="en"&&(t=JSON.parse(LoadResourceFile($t,"locales/en.json")),t||console.warn("could not load 'locales/en.json'")),!t))return;let i=Zt(t,{});for(let[u,d]of Object.entries(i)){let y=new RegExp(/\$\{([^}]+)}/g),_=d.match(y);if(_)for(let b of _){if(!b)break;let A=b.substring(2,b.length-1),v=i[A];v&&(i[u]=d.replace(b,v))}Xt[u]=d}};function lt(o){return new Promise(e=>setTimeout(e,o,null))}function Ye(o,e=0,t=1){return Math.max(e,Math.min(t,o))}async function en(o,e,t){let i=await o();if(i!==void 0)return i;(t||t==null)&&typeof t!="number"&&(t=1e3);let u=GetGameTimer(),d;return new Promise((y,_)=>{d=setTick(async()=>{let b=t&&GetGameTimer()-u;if(b&&b>t)return _(`${e||"failed to resolve callback"} (waited ${b}ms)`);i=await o(),i!==void 0&&y(i)})}).finally(()=>clearTick(d))}async function tn(o,e,t,i,u=3e4){return e(i)?i:(o(i),en(()=>{if(e(i))return i},`failed to load ${t} '${i}' - this may be caused by
|
|
- too many loaded assets
|
|
- oversized, invalid, or corrupted assets`,u))}var ct=o=>{if(!DoesAnimDictExist(o))throw new Error(`attempted to load invalid animDict '${o}'`);return tn(RequestAnimDict,HasAnimDictLoaded,"animDict",o)},nn=o=>{if(typeof o!="number"&&(o=ze(o)),!IsModelValid(o))throw new Error(`attempted to load invalid model '${o}'`);return tn(RequestModel,HasModelLoaded,"model",o)};var ze=(o,e=!0)=>{o=e?o:o.toLowerCase();let t=o.length,i,u;for(i=u=0;u<t;u++)i+=o.charCodeAt(u),i+=i<<10,i^=i>>>6;return i+=i<<3,i^=i>>>11,i+=i<<15,i>>>0},rn=async(o,e,t=[0,0,0],i=[0,0,0])=>{let u=await nn(o);if(!u)return;let[d,y,_]=GetEntityCoords(S.ped,!0),[b,A,v]=t,[re,J,z]=i,Q=CreateObject(u,d,y,_,!0,!0,!1);return SetEntityCollision(Q,!1,!1),AttachEntityToEntity(Q,S.ped,GetPedBoneIndex(S.ped,e),b,A,v,re,J,z,!0,!1,!1,!0,2,!0),Q};var un={fivem:{true:{name:"mic_chatter",dict:"mp_facial"},false:{name:"mood_normal_1",dict:"facials@gen_male@variations@normal"}},redm:{true:{name:"mood_talking_normal",dict:"face_human@gen_male@base"},false:{name:"mood_normal",dict:"face_human@gen_male@base"}}},an={A:1885667965,B:1287709438,C:2572789488,D:3034867124,E:3472724512,F:3002300392,G:1980406895,H:613911080,I:3248005013,J:4085452174,K:null,L:2163379861,M:3810290241,N:1271519931,O:4046460518,P:3626896338,Q:3732491838,R:3809269511,S:3531047651,T:null,U:3640078424,V:2139949496,W:2412778968,X:2362035522,Y:null,Z:652860416,RIGHTBRACKET:2780679484,LEFTBRACKET:1124438954,MOUSE1:130948705,MOUSE2:4165969743,MOUSE3:3470863184,MWUP:813099388,CTRL:3674827653,TAB:2990079499,SHIFT:2415687126,SPACEBAR:3654345152,ENTER:3350541322,BACKSPACE:359624985,LALT:2326399700,DEL:1257559155,PGUP:1147295926,PGDN:1010684785,F1:2833511527,F4:527275493,F6:1007304946,1:3874886372,2:484891115,3:1330236492,4:2409602648,5:2875386263,6:2717770406,7:2956628283,8:1110987810,DOWN:97156178,UP:1662638961,LEFT:2791226036,RIGHT:3736290067};var ke=(y=>(y.RADIO="RADIO",y.MEGAPHONE="MEGAPHONE",y.PHONE="PHONE",y.PHONE_SPEAKER="PHONE_SPEAKER",y.INTERCOM="INTERCOM",y.PHONE_HISTORICAL="PHONE_HISTORICAL",y))(ke||{});var wt={versionCheck:!0,autoConnectOnJoin:!0,buildType:0,locale:"en",unmuteDelay:400,maxPhoneSpeakerRange:5,phoneHearPlayersNearby:!1,notifications:{oxLib:!1,okoknotify:!1,gta:!0,redm:!1,own:!1},keyBinds:{increaseVoiceRange:"ADD",decreaseVoiceRange:"SUBTRACT",primaryRadioTransmit:"N",secondaryRadioTransmit:"CAPITAL",megaphone:"B",voiceRangeWithMouseWheel:"LCONTROL"},radioSettings:{animation:{dictionary:"random@arrests",name:"generic_radio_chatter",flag:49},propWhileTalking:{prop:!1,boneId:28422,position:[0,0,0],rotation:[0,0,0]},channelCount:9,mode:"None",maxDistance:1e3},voiceRange:{defaultIndex:1,ranges:[1,3,8,15,20,25,30,40],sendNotification:!0,markerColor:{enabled:!0,r:0,g:255,b:0,a:50,duration:1e3,type:1,rotate:!0}},megaphone:{range:30,automaticVehicleDetection:!0,allowedVehicleClasses:[18,19],allowedVehicleModels:["polmav"]},saltyChatBridge:!1,mufflingSettings:{mufflingRange:-1,vehicleMuffling:{enabled:!0,vehicleWhitelist:["gauntlet6","draugur","bodhi2","vagrant","outlaw","trophytruck","ratel","drifttampa","sm722","tornado4","swinger","locust","hotring"]},intensities:{differentRoom:10,bothCarsClosed:10,oneCarClosed:6,megaPhoneInCar:6}},radioAntiSpamCooldown:!1,useLocalLipSync:!1};var sn={towerPositions:[[2572,5397,56],[2663,4972,56],[2892,3911,56],[2720,3304,64],[2388,2949,64],[1830,2368,64],[1650,1316,102],[1363,680,102],[918,230,92],[567,303,58],[-47,-666,74],[-585,-902,53],[2572,5397,56],[2338,5940,77],[1916,6244,65],[1591,6371,42],[953,6504,42],[76,6606,42],[408,6587,42],[-338,-579,48],[-293,-632,47],[-269,-962,143],[98,-870,136],[-214,-744,219],[-166,-590,199],[124,-654,261],[149,-769,261],[580,89,117],[423,15,151],[424,18,151],[551,-28,93],[305,-284,68],[299,-313,68],[1240,-1090,44],[-418,-2804,14],[802,-2996,27],[253,-3145,39],[207,-3145,39],[207,-3307,39],[247,-3307,39],[484,-2178,40],[548,-2219,67],[-701,58,68],[-696,208,139],[-769,255,134],[-150,-150,96],[-202,-327,65],[-1913,-3031,22],[-1918,-3028,22],[-1039,-2385,27],[-1042,-2390,27],[-1583,-3216,28],[-1590,-3212,28],[-1308,-2626,36],[-1311,-2624,36],[-984,-2778,48],[-991,-2774,48],[-556,-119,50],[-619,-106,51],[-1167,-575,40],[-1152,-443,42],[-1156,-498,49],[-1290,-445,106],[-928,-383,135],[-902,-443,170],[-770,-786,83],[-824,-719,120],[-598,-917,35],[-678,-717,54],[-669,-804,31],[-1463,-526,83],[-1525,-596,66],[-1375,-465,83],[-1711,478,127],[-2311,335,187],[-2214,342,198],[-2234,187,193],[202,1204,230],[217,1140,230],[668,590,136],[722,562,134],[838,510,138],[773,575,138],[735,231,145],[450,5566,795],[-449,6019,35],[-142,6286,39],[-368,6105,38],[2792,5996,355],[2796,5992,354],[3460,3653,51],[3459,3659,51],[3615,3642,51],[3614,3636,51],[-2180,3252,54],[-2124,3219,54],[-2050,3178,54],[1858,3694,37],[1695,3614,37],[1692,2532,60],[1692,2647,60],[1824,2574,60],[1407,2117,104]]};var ht=class{constructor(e){this.clientModule=e,this.registerEvents()}registerEvents(){onNet("client:yaca:addRemovePlayerIntercomFilter",(e,t)=>{Array.isArray(e)||(e=[e]);let i=new Set;for(let u of e){let d=this.clientModule.getPlayerByID(u);d&&i.add(d)}i.size<1||this.clientModule.setPlayersCommType(Array.from(i),"INTERCOM",t,void 0,void 0,2,2)})}};var ft=class{constructor(e){this.currentPluginState=-1;this.isPrimarySending=!1;this.isSecondarySending=!1;this.isPrimaryReceiving=!1;this.isSecondaryReceiving=!1;this.clientModule=e,this.registerSaltyChatExports(),this.enableRadio().then(),console.log("[YaCA] SaltyChat bridge loaded"),on("onResourceStop",t=>{S.resource===t&&emit("onClientResourceStop","saltychat")})}async enableRadio(){for(;!this.clientModule.isPluginInitialized(!0);)await lt(1e3);this.clientModule.radioModule.enableRadio(!0)}registerSaltyChatExports(){De("GetVoiceRange",()=>this.clientModule.getVoiceRange()),De("GetRadioChannel",e=>{let t=e?1:2,i=this.clientModule.radioModule.getRadioFrequency(t);return i==="0"?"":i}),De("GetRadioVolume",()=>this.clientModule.radioModule.getRadioChannelVolume(1)),De("GetRadioSpeaker",()=>(console.warn("GetRadioSpeaker is not implemented in YaCA"),!1)),De("GetMicClick",()=>(console.warn("GetMicClick is not implemented in YaCA"),!1)),De("SetRadioChannel",(e,t)=>{let i=t?1:2,u=e===""?"0":e;this.clientModule.radioModule.changeRadioFrequencyRaw(u,i)}),De("SetRadioVolume",e=>{this.clientModule.radioModule.changeRadioChannelVolumeRaw(e,1),this.clientModule.radioModule.changeRadioChannelVolumeRaw(e,2)}),De("SetRadioSpeaker",()=>{console.warn("SetRadioSpeaker is not implemented in YaCA")}),De("SetMicClick",()=>{console.warn("SetMicClick is not implemented in YaCA")}),De("GetPluginState",()=>this.currentPluginState)}handleChangePluginState(e){let t=0;switch(e){case"IN_EXCLUDED_CHANNEL":t=3;break;case"IN_INGAME_CHANNEL":t=2;break;case"CONNECTED":t=1;break;case"WRONG_TS_SERVER":case"OUTDATED_VERSION":t=0;break;case"NOT_CONNECTED":t=-1;break;default:return}emit("SaltyChat_PluginStateChanged",t),this.currentPluginState=t}sendRadioTalkingState(){emit("SaltyChat_RadioTrafficStateChanged",this.isPrimaryReceiving,this.isPrimarySending,this.isSecondaryReceiving,this.isSecondarySending)}handleRadioTalkingStateChange(e,t){t===1?this.isPrimarySending=e:this.isSecondarySending=e,this.sendRadioTalkingState()}handleRadioReceivingStateChange(e,t){t===1?this.isPrimaryReceiving=e:this.isSecondaryReceiving=e,this.sendRadioTalkingState()}};var Dt=class{constructor(e){this.canUseMegaphone=!1;this.lastMegaphoneState=!1;this.megaphoneVehicleWhitelistHashes=new Set;if(this.clientModule=e,this.registerEvents(),this.clientModule.isFiveM){this.registerKeybinds();for(let t of this.clientModule.sharedConfig.megaphone.allowedVehicleModels)this.megaphoneVehicleWhitelistHashes.add(ze(t))}else this.clientModule.isRedM&&this.registerRdrKeybinds();this.registerExports(),this.registerStateBagHandlers()}registerEvents(){onNet("client:yaca:setLastMegaphoneState",e=>{this.lastMegaphoneState=e}),this.clientModule.isFiveM&&this.clientModule.sharedConfig.megaphone.automaticVehicleDetection&&Vt("seat",e=>{if(e===!1||e>0||!S.vehicle){this.canUseMegaphone=!1,emitNet("server:yaca:playerLeftVehicle");return}let t=GetVehicleClass(S.vehicle),i=GetEntityModel(S.vehicle);this.canUseMegaphone=this.clientModule.sharedConfig.megaphone.allowedVehicleClasses.includes(t)||this.megaphoneVehicleWhitelistHashes.has(i)})}registerKeybinds(){this.clientModule.sharedConfig.keyBinds.megaphone!==!1&&(RegisterCommand("+yaca:megaphone",()=>{this.useMegaphone(!0)},!1),RegisterCommand("-yaca:megaphone",()=>{this.useMegaphone(!1)},!1),RegisterKeyMapping("+yaca:megaphone",W("use_megaphone"),"keyboard",this.clientModule.sharedConfig.keyBinds.megaphone))}registerRdrKeybinds(){this.clientModule.sharedConfig.keyBinds.megaphone!==!1&&ve(this.clientModule.sharedConfig.keyBinds.megaphone,()=>{this.useMegaphone(!this.lastMegaphoneState)})}registerExports(){exports("getCanUseMegaphone",()=>this.canUseMegaphone),exports("setCanUseMegaphone",e=>{this.canUseMegaphone=e,!e&&this.lastMegaphoneState&&emitNet("server:yaca:playerLeftVehicle")}),exports("useMegaphone",(e=!1)=>{this.useMegaphone(e)})}registerStateBagHandlers(){AddStateBagChangeHandler(rt,"",(e,t,i,u,d)=>{if(d)return;let y=GetPlayerFromStateBagName(e);if(y===0)return;let _=GetPlayerServerId(y);if(_!==0)if(_===S.serverId)this.clientModule.setPlayersCommType([],"MEGAPHONE",typeof i=="number",void 0,i,0,1);else{let b=this.clientModule.getPlayerByID(_);if(!b)return;this.clientModule.setPlayersCommType(b,"MEGAPHONE",typeof i=="number",void 0,i,1,0)}})}useMegaphone(e=!1){!S.vehicle&&this.clientModule.sharedConfig.megaphone.automaticVehicleDetection||!this.canUseMegaphone||e===this.lastMegaphoneState||(this.lastMegaphoneState=!this.lastMegaphoneState,emitNet("server:yaca:useMegaphone",e),emit("yaca:external:megaphoneState",e))}};var Ct=class{constructor(e){this.inCallWith=new Set;this.phoneSpeakerActive=!1;this.clientModule=e,this.registerEvents(),this.registerExports(),this.registerStateBagHandlers()}registerEvents(){onNet("client:yaca:phone",(e,t,i="PHONE")=>{Array.isArray(e)||(e=[e]),this.enablePhoneCall(e,t,i)}),onNet("client:yaca:phoneHearAround",(e,t)=>{if(!e.length)return;let i=Array.from(e).map(u=>({clientId:u}));this.clientModule.setPlayersCommType(i,"PHONE",t,void 0,void 0,2,2,GlobalState[_t]??void 0)}),onNet("client:yaca:phoneMute",(e,t,i=!1)=>{let u=this.clientModule.getPlayerByID(e);u&&(u.mutedOnPhone=t,!i&&(this.clientModule.useWhisper&&u.remoteID===S.serverId?this.clientModule.setPlayersCommType([],"PHONE",!t,void 0,void 0,0):!this.clientModule.useWhisper&&this.inCallWith.has(e)&&this.clientModule.setPlayersCommType(u,"PHONE",t,void 0,void 0,2,2)))}),onNet("client:yaca:playersToPhoneSpeakerEmitWhisper",(e,t)=>{if(!this.clientModule.useWhisper)return;Array.isArray(e)||(e=[e]);let i=new Set;for(let u of e){let d=this.clientModule.getPlayerByID(u);d&&i.add(d)}i.size<1||this.clientModule.setPlayersCommType(Array.from(i),"PHONE_SPEAKER",t,void 0,void 0,0,1)})}registerExports(){exports("isInCall",()=>this.inCallWith.size>0)}registerStateBagHandlers(){AddStateBagChangeHandler(_t,"",(e,t,i)=>{let u=GetPlayerFromStateBagName(e);if(u===0)return;let d=GetPlayerServerId(u);d!==0&&(d===S.serverId&&(this.phoneSpeakerActive=i!==null),this.removePhoneSpeakerFromEntity(d),i!==null&&this.clientModule.setPlayerVariable(d,"phoneCallMemberIds",Array.isArray(i)?i:[i]))})}removePhoneSpeakerFromEntity(e){let t=this.clientModule.getPlayerByID(e);if(!t?.phoneCallMemberIds)return;let i=[];for(let u of t.phoneCallMemberIds){let d=this.clientModule.getPlayerByID(u);d&&i.push(d)}this.clientModule.setPlayersCommType(i,"PHONE_SPEAKER",!1,void 0,void 0,1,0),t.phoneCallMemberIds=void 0}handleDisconnect(e){this.inCallWith.delete(e)}reestablishCalls(e){if(!this.inCallWith.size||(Array.isArray(e)||(e=[e]),!e.length))return;let t=[];for(let i of e)this.inCallWith.has(i)&&t.push(i);t.length&&this.enablePhoneCall(t,!0,"PHONE")}enablePhoneCall(e,t,i="PHONE"){if(!e.length)return;let u=[];for(let d of e){let y=this.clientModule.getPlayerByID(d);if(!y){t||this.inCallWith.delete(d);continue}t?this.inCallWith.add(d):this.inCallWith.delete(d),u.push(y)}this.clientModule.setPlayersCommType(u,i,t,void 0,void 0,t||!t&&this.inCallWith.size?2:void 0,2,GlobalState[pe]??void 0)}};var gt=class{constructor(e){this.radioEnabled=!1;this.radioInitialized=!1;this.talkingInChannels=new Set;this.radioChannelSettings=new Map;this.playersWithShortRange=new Map;this.playersInRadioChannel=new Map;this.radioTowerCalculation=new Map;this.radioMode="None";this.activeRadioChannel=1;this.secondaryRadioChannel=2;this.radioOnCooldown=!1;this.defaultRadioSettings={frequency:"0",muted:!1,volume:1,stereo:"STEREO"};this.clientModule=e,this.radioMode=this.clientModule.sharedConfig.radioSettings.mode,this.registerExports(),this.registerEvents(),this.clientModule.isFiveM?this.registerKeybinds():this.registerRdrKeybinds()}registerExports(){exports("enableRadio",e=>this.enableRadio(e)),exports("isRadioEnabled",()=>this.radioEnabled),exports("changeRadioFrequency",e=>this.changeRadioFrequencyRaw(e)),exports("changeRadioFrequencyRaw",(e,t)=>this.changeRadioFrequencyRaw(t,e)),exports("getRadioFrequency",e=>this.getRadioFrequency(e)),exports("muteRadioChannel",e=>this.muteRadioChannel(e)),exports("muteRadioChannelRaw",(e,t)=>this.muteRadioChannelRaw(e,t)),exports("isRadioChannelMuted",(e=this.activeRadioChannel)=>this.isRadioChannelMuted(e)),exports("setActiveRadioChannel",e=>this.setActiveRadioChannel(e)),exports("getActiveRadioChannel",()=>this.activeRadioChannel),exports("setSecondaryRadioChannel",e=>this.setSecondaryRadioChannel(e)),exports("getSecondaryRadioChannel",()=>this.secondaryRadioChannel),exports("changeRadioChannelVolume",e=>this.changeRadioChannelVolume(e)),exports("changeRadioChannelVolumeRaw",(e,t)=>this.changeRadioChannelVolumeRaw(t,e)),exports("getRadioChannelVolume",e=>this.getRadioChannelVolume(e)),exports("changeRadioChannelStereo",()=>this.changeRadioChannelStereo()),exports("changeRadioChannelStereoRaw",(e,t)=>this.changeRadioChannelStereoRaw(t,e)),exports("getRadioChannelStereo",e=>this.getRadioChannelStereo(e)),exports("radioTalkingStart",(e,t)=>this.radioTalkingStart(e,t)),exports("setRadioMode",e=>{this.radioMode=e}),exports("getRadioMode",()=>this.radioMode)}registerEvents(){onNet("client:yaca:setRadioFreq",(e,t)=>{this.setRadioFrequency(e,t)}),onNet("client:yaca:radioTalking",(e,t,i,u,d=-1,y=[0,0,0])=>{let _=this.findRadioChannelByFrequency(t);if(!_)return;let b=this.getDistanceToTowerOrSender(y);if(i&&(this.radioMode!=="None"&&b>this.clientModule.sharedConfig.radioSettings.maxDistance||this.radioMode==="Tower"&&d>this.clientModule.sharedConfig.radioSettings.maxDistance))return;let A=this.clientModule.getPlayerByID(e);if(!A)return;let v=u[S.serverId];if(!v?.shortRange||v?.shortRange&&GetPlayerFromServerId(e)!==-1){let re=this.getErrorLevelFromDistance(b,d);this.clientModule.setPlayersCommType(A,"RADIO",i,_,void 0,1,0,re)}if(i)this.playersInRadioChannel.get(_)?.add(e),v?.shortRange&&this.playersWithShortRange.set(e,t),emit("yaca:external:isRadioReceiving",!0,_),this.clientModule.saltyChatBridge?.handleRadioReceivingStateChange(!0,_);else{this.playersInRadioChannel.get(_)?.delete(e),v?.shortRange&&this.playersWithShortRange.delete(e);let J=(this.playersInRadioChannel.get(_)?.size||0)>0;emit("yaca:external:isRadioReceiving",J,_),this.clientModule.saltyChatBridge?.handleRadioReceivingStateChange(J,_)}}),onNet("client:yaca:radioTalkingWhisper",(e,t,i,u=[0,0,0])=>{let d=this.findRadioChannelByFrequency(t);if(!d)return;let y=this.getDistanceToTowerOrSender(u);i&&this.radioMode!=="None"&&y>this.clientModule.sharedConfig.radioSettings.maxDistance&&(e=[]),this.radioTalkingStateToPluginWithWhisper(i,e,d)}),onNet("client:yaca:setRadioMuteState",(e,t)=>{let i=this.radioChannelSettings.get(e);i&&(i.muted=t,emit("yaca:external:setRadioMuteState",e,t),this.disableRadioFromPlayerInChannel(e),this.updateRadioChannelData(e))}),onNet("client:yaca:leaveRadioChannel",(e,t)=>{Array.isArray(e)||(e=[e]);let i=this.findRadioChannelByFrequency(t);if(!i)return;let u=this.clientModule.getPlayerByID(S.serverId);!u||!u.clientId||(e.includes(u.clientId)&&this.setRadioFrequency(i,"0"),this.clientModule.sendWebsocket({base:{request_type:"INGAME"},comm_device_left:{comm_type:"RADIO",client_ids:e,channel:i}}))})}registerKeybinds(){this.clientModule.sharedConfig.keyBinds.primaryRadioTransmit!==!1&&(RegisterCommand("+yaca:radioTalking",()=>{this.radioTalkingStart(!0,this.activeRadioChannel)},!1),RegisterCommand("-yaca:radioTalking",()=>{this.radioTalkingStart(!1,this.activeRadioChannel)},!1),RegisterKeyMapping("+yaca:radioTalking",W("use_radio"),"keyboard",this.clientModule.sharedConfig.keyBinds.primaryRadioTransmit)),this.clientModule.sharedConfig.keyBinds.secondaryRadioTransmit!==!1&&(RegisterCommand("+yaca:secondaryRadioTalking",()=>{this.radioTalkingStart(!0,this.secondaryRadioChannel)},!1),RegisterCommand("-yaca:secondaryRadioTalking",()=>{this.radioTalkingStart(!1,this.secondaryRadioChannel)},!1),RegisterKeyMapping("+yaca:secondaryRadioTalking",W("use_secondary_radio"),"keyboard",this.clientModule.sharedConfig.keyBinds.secondaryRadioTransmit))}registerRdrKeybinds(){this.clientModule.sharedConfig.keyBinds.primaryRadioTransmit!==!1&&ve(this.clientModule.sharedConfig.keyBinds.primaryRadioTransmit,()=>{this.radioTalkingStart(!0,this.activeRadioChannel)},()=>{this.radioTalkingStart(!1,this.activeRadioChannel)}),this.clientModule.sharedConfig.keyBinds.secondaryRadioTransmit!==!1&&ve(this.clientModule.sharedConfig.keyBinds.secondaryRadioTransmit,()=>{this.radioTalkingStart(!0,this.secondaryRadioChannel)},()=>{this.radioTalkingStart(!1,this.secondaryRadioChannel)})}getErrorLevelFromDistance(e,t){let i,u=GlobalState[pe]||0;if(this.radioMode==="Tower"){let d=this.calculateSignalStrength(e),y=this.calculateSignalStrength(t);i=Math.max(d,y,u)}else if(this.radioMode==="Direct"){let d=this.calculateSignalStrength(e);i=Math.max(d,u)}else i=u;return i}getDistanceToTowerOrSender(e){let t=Number.MAX_VALUE;return this.radioMode==="Tower"?t=this.getNearestRadioTower():this.radioMode==="Direct"&&(t=Xe(GetEntityCoords(S.ped,!1),e)),t}enableRadio(e){if(this.clientModule.isPluginInitialized()&&this.radioEnabled!==e){if(this.radioEnabled=e,emitNet("server:yaca:enableRadio",e),!e)for(let t=1;t<=this.clientModule.sharedConfig.radioSettings.channelCount;t++)this.disableRadioFromPlayerInChannel(t);e&&!this.radioInitialized&&(this.radioInitialized=!0,this.initRadioSettings(),this.updateRadioChannelData(this.activeRadioChannel)),emit("yaca:external:isRadioEnabled",e)}}calculateSignalStrength(e,t=this.clientModule.sharedConfig.radioSettings.maxDistance){let i=e/t;return Ye(Math.log10(1+i*8.5)/Math.log10(10),0,1)}getNearestRadioTower(){let e=Number.MAX_VALUE,t=GetEntityCoords(S.ped,!1);for(let i of this.clientModule.towerConfig.towerPositions){let u=Xe(t,i);(!e||u<e)&&(e=u)}return e}changeRadioFrequencyRaw(e,t=this.activeRadioChannel){this.clientModule.isPluginInitialized()&&emitNet("server:yaca:changeRadioFrequency",t,e)}getRadioFrequency(e=this.activeRadioChannel){let t=this.radioChannelSettings.get(e);return t?t.frequency:"0"}muteRadioChannel(e){this.muteRadioChannelRaw(this.activeRadioChannel,e)}muteRadioChannelRaw(e=this.activeRadioChannel,t){if(!this.clientModule.isPluginInitialized()||!this.radioEnabled)return;let i=this.radioChannelSettings.get(e);i&&i.frequency!=="0"&&emitNet("server:yaca:muteRadioChannel",e,t)}isRadioChannelMuted(e=this.activeRadioChannel){let t=this.radioChannelSettings.get(e);return t?t.muted:!0}setActiveRadioChannel(e){return!this.clientModule.isPluginInitialized()||!this.radioEnabled?!1:(emit("yaca:external:changedActiveRadioChannel",e),this.activeRadioChannel=e,this.updateRadioChannelData(this.activeRadioChannel),!0)}setSecondaryRadioChannel(e){return!this.clientModule.isPluginInitialized()||!this.radioEnabled?!1:(this.secondaryRadioChannel===e?(this.secondaryRadioChannel=-1,this.clientModule.notification(W("secondary_radio_channel_disabled"),"inform")):(this.secondaryRadioChannel=e,this.clientModule.notification(W("secondary_radio_channel_enabled",e),"inform")),emit("yaca:external:changedSecondaryRadioChannel",this.secondaryRadioChannel),!0)}changeRadioChannelVolume(e){let t=this.activeRadioChannel,i=this.radioChannelSettings.get(t);if(!i)return!1;let u=i.volume;return this.changeRadioChannelVolumeRaw(u+(e?.17:-.17),t)}changeRadioChannelVolumeRaw(e,t=this.activeRadioChannel){if(!this.clientModule.isPluginInitialized()||!this.radioEnabled)return!1;let i=this.radioChannelSettings.get(t);if(!i)return!1;let u=i.volume;return i.volume=Ye(e,0,1),u===i.volume||((i.volume===0||u===0&&i.volume>0)&&emitNet("server:yaca:muteRadioChannel",t,i.volume===0),i.volume>0&&(emit("yaca:external:setRadioVolume",t,i.volume),this.updateRadioChannelData(t)),this.clientModule.setCommDeviceVolume("RADIO",i.volume,t)),!0}getRadioChannelVolume(e=this.activeRadioChannel){let t=this.radioChannelSettings.get(e);return t?t.volume:0}changeRadioChannelStereo(e=this.activeRadioChannel){let t=this.radioChannelSettings.get(e);if(!t)return!1;switch(t.stereo){case"STEREO":if(this.changeRadioChannelStereoRaw("MONO_LEFT",e))return this.clientModule.notification(W("changed_stereo_mode",e,W("left_ear")),"inform"),!0;break;case"MONO_LEFT":if(this.changeRadioChannelStereoRaw("MONO_RIGHT",e))return this.clientModule.notification(W("changed_stereo_mode",e,W("right_ear")),"inform"),!0;break;default:if(this.changeRadioChannelStereoRaw("STEREO",e))return this.clientModule.notification(W("changed_stereo_mode",e,W("both_ears")),"inform"),!0;break}return!1}changeRadioChannelStereoRaw(e,t=this.activeRadioChannel){if(!this.clientModule.isPluginInitialized()||!this.radioEnabled)return!1;let i=this.radioChannelSettings.get(t);return i?(i.stereo=e,this.clientModule.setCommDeviceStereoMode("RADIO",e,t),emit("yaca:external:setRadioChannelStereo",t,e.toString()),!0):!1}getRadioChannelStereo(e=this.activeRadioChannel){let t=this.radioChannelSettings.get(e);return t?t.stereo.toString():"STEREO".toString()}initRadioSettings(){for(let e=1;e<=this.clientModule.sharedConfig.radioSettings.channelCount;e++){this.radioChannelSettings.has(e)||this.radioChannelSettings.set(e,{...this.defaultRadioSettings}),this.playersInRadioChannel.has(e)||this.playersInRadioChannel.set(e,new Set);let{volume:t,stereo:i,frequency:u}=this.radioChannelSettings.get(e)??this.defaultRadioSettings;this.clientModule.setCommDeviceStereoMode("RADIO",i,e),this.clientModule.setCommDeviceVolume("RADIO",t,e),u!=="0"&&emitNet("server:yaca:changeRadioFrequency",e,u)}}radioTalkingStateToPlugin(e,t){let i=this.clientModule.getPlayerByID(S.serverId);i&&this.clientModule.setPlayersCommType(i,"RADIO",e,t)}radioTalkingStateToPluginWithWhisper(e,t,i){let u=[];for(let d of t){let y=this.clientModule.getPlayerByID(d);y&&u.push(y)}this.clientModule.setPlayersCommType(u,"RADIO",e,i,void 0,0,1)}findRadioChannelByFrequency(e){for(let[t,i]of this.radioChannelSettings)if(i.frequency===e)return t;return null}setRadioFrequency(e,t){let i=this.radioChannelSettings.get(e);if(i&&(i.frequency!==t&&this.disableRadioFromPlayerInChannel(e),i.frequency=t,emit("yaca:external:setRadioFrequency",e,t),this.clientModule.saltyChatBridge)){let u=i.frequency==="0"?"":i.frequency;emit("SaltyChat_RadioChannelChanged",u,e===1)}}disableRadioFromPlayerInChannel(e){let t=this.playersInRadioChannel.get(e);if(!t||!t.size)return;let i=[];for(let u of t){let d=this.clientModule.getPlayerByID(u);!d||!d.remoteID||(i.push(d),t.delete(d.remoteID))}i.length&&this.clientModule.setPlayersCommType(i,"RADIO",!1,e,void 0,1,0)}async radioTalkingStart(e,t){if(t===-1)return;if(!e){this.talkingInChannels.has(t)&&(this.talkingInChannels.delete(t),this.radioTowerCalculation.has(t)&&(clearInterval(this.radioTowerCalculation.get(t)),this.radioTowerCalculation.delete(t)),this.clientModule.saltyChatBridge?.handleRadioTalkingStateChange(!1,t),this.clientModule.useWhisper||this.radioTalkingStateToPlugin(!1,t),emitNet("server:yaca:radioTalking",!1,t,-1),emit("yaca:external:isRadioTalking",!1,t),StopAnimTask(S.ped,this.clientModule.sharedConfig.radioSettings.animation.dictionary,this.clientModule.sharedConfig.radioSettings.animation.name,4),RemoveAnimDict(this.clientModule.sharedConfig.radioSettings.animation.dictionary),this.currentRadioProp!==null&&(DoesEntityExist(this.currentRadioProp)&&DeleteEntity(this.currentRadioProp),this.clientModule.sharedConfig.radioSettings.propWhileTalking.prop!==!1&&SetModelAsNoLongerNeeded(this.clientModule.sharedConfig.radioSettings.propWhileTalking.prop),this.currentRadioProp=null));return}if(this.clientModule.sharedConfig.radioAntiSpamCooldown){if(this.radioOnCooldown)return;this.radioOnCooldown=!0,setTimeout(()=>{this.radioOnCooldown=!1},this.clientModule.sharedConfig.radioAntiSpamCooldown)}let i=this.radioChannelSettings.get(t);if(!this.radioEnabled||i?.frequency==="0"||this.talkingInChannels.has(t))return;if(this.talkingInChannels.add(t),this.clientModule.useWhisper||this.radioTalkingStateToPlugin(!0,t),this.clientModule.sharedConfig.radioSettings.propWhileTalking.prop!==!1){let d=await rn(this.clientModule.sharedConfig.radioSettings.propWhileTalking.prop,this.clientModule.sharedConfig.radioSettings.propWhileTalking.boneId,this.clientModule.sharedConfig.radioSettings.propWhileTalking.position,this.clientModule.sharedConfig.radioSettings.propWhileTalking.rotation);this.currentRadioProp=d??null}let u=await ct(this.clientModule.sharedConfig.radioSettings.animation.dictionary);u&&TaskPlayAnim(S.ped,u,this.clientModule.sharedConfig.radioSettings.animation.name,3,-4,-1,this.clientModule.sharedConfig.radioSettings.animation.flag,0,!1,!1,!1),this.clientModule.saltyChatBridge?.handleRadioTalkingStateChange(!0,t),this.sendRadioRequestToServer(t),this.radioTowerCalculation.has(t)||this.radioTowerCalculation.set(t,setInterval(()=>{this.sendRadioRequestToServer(t)},1e3)),emit("yaca:external:isRadioTalking",!0,t)}sendRadioRequestToServer(e){let t=this.getNearestRadioTower()??-1;emitNet("server:yaca:radioTalking",!0,e,t)}updateRadioChannelData(e){e!==this.activeRadioChannel||GetResourceState("yaca-ui")!=="started"||exports["yaca-ui"].setRadioChannelData(this.radioChannelSettings.get(e))}};var mt=class o{constructor(){this.mufflingVehicleWhitelistHash=new Set;this.allPlayers=new Map;this.firstConnect=!0;this.canChangeVoiceRange=!0;this.defaultVoiceRange=1;this.maxVoiceRange=-1;this.rangeInterval=null;this.visualVoiceRangeTimeout=null;this.visualVoiceRangeTick=null;this.voiceRangeViaMouseWheelTick=null;this.isTalking=!1;this.useWhisper=!1;this.spectatingPlayer=!1;this.notificationTimeout=new Map;this.isMicrophoneMuted=!1;this.isMicrophoneDisabled=!1;this.isSoundMuted=!1;this.isSoundDisabled=!1;this.currentlyPhoneSpeakerApplied=new Set;this.currentlySendingPhoneSpeakerSender=new Set;this.phoneHearNearbyPlayer=new Set;this.isFiveM=S.game==="fivem";this.isRedM=S.game==="redm";if(this.sharedConfig=Bt("config/shared.json5",wt),this.towerConfig=Bt("config/tower.json5",sn),Qt(this.sharedConfig.locale),this.rangeIndex=this.sharedConfig.voiceRange.defaultIndex,this.sharedConfig.voiceRange.ranges[this.rangeIndex]?this.defaultVoiceRange=this.sharedConfig.voiceRange.ranges[this.rangeIndex]:(this.defaultVoiceRange=1,this.rangeIndex=0,this.sharedConfig.voiceRange.ranges=[1],console.error("[YaCA] Default voice range is not set correctly in the config.")),this.isFiveM)for(let e of this.sharedConfig.mufflingSettings.vehicleMuffling.vehicleWhitelist)this.mufflingVehicleWhitelistHash.add(ze(e));this.websocket=new pt,this.setCurrentPluginState("NOT_CONNECTED"),RegisterNuiCallbackType("YACA_OnNuiReady"),on("__cfx_nui:YACA_OnNuiReady",(e,t)=>{this.websocket.nuiReady=!0,this.sharedConfig.autoConnectOnJoin&&setTimeout(()=>{emitNet("server:yaca:nuiReady")},5e3),t({})}),this.registerExports(),this.registerEvents(),this.isFiveM?this.registerKeybindings():this.isRedM&&this.registerRdrKeybindings(),this.intercomModule=new ht(this),this.megaphoneModule=new Dt(this),this.phoneModule=new Ct(this),this.radioModule=new gt(this),this.sharedConfig.useLocalLipSync||(AddStateBagChangeHandler(Mt,"",(e,t,i,u)=>{let d=GetPlayerFromStateBagName(e);d!==0&&SetPlayerTalkingOverride(d,i)}),AddStateBagChangeHandler(pe,"",(e,t,i,u)=>{setImmediate(()=>{this.phoneModule.enablePhoneCall(Array.from(this.phoneModule.inCallWith),!0)})})),this.sharedConfig.saltyChatBridge&&(this.radioModule.secondaryRadioChannel=2,this.saltyChatBridge=new ft(this)),console.log("[Client] YaCA Client loaded.")}setCurrentPluginState(e){this.currentPluginState!==e&&(this.currentPluginState=e,emit("yaca:external:pluginStateChanged",e),this.saltyChatBridge?.handleChangePluginState(e))}notification(e,t){if(this.sharedConfig.notifications.oxLib&&emit("ox_lib:notify",{id:"yaca",title:"YaCA",description:e,type:t}),this.sharedConfig.notifications.okoknotify&&GetResourceState("okokNotify")==="started"){let i=t==="inform"?"info":t;exports.okokNotify.Alert("YaCA",e,2e3,i)}this.sharedConfig.notifications.gta&&(this.isFiveM?(BeginTextCommandThefeedPost("STRING"),AddTextComponentSubstringPlayerName(`YaCA: ${e}`),t==="error"&&ThefeedSetNextPostBackgroundColor(6),EndTextCommandThefeedPostTicker(!1,!1)):console.warn("[YaCA] GTA notification is only available in FiveM.")),this.sharedConfig.notifications.redm&&(this.isRedM?cn(`YaCA: ${e}`,2e3):console.warn("[YaCA] RedM notification is only available in RedM.")),this.sharedConfig.notifications.own&&emit("yaca:external:notification",e,t)}registerExports(){exports("getVoiceRange",()=>this.getVoiceRange()),exports("getVoiceRanges",()=>this.sharedConfig.voiceRange.ranges),exports("changeVoiceRange",(e=!0)=>{this.changeVoiceRange(e)}),exports("setVoiceRange",e=>{this.setVoiceRange(e)}),exports("setVoiceRangeChangeAllowedState",e=>{this.canChangeVoiceRange=e}),exports("getVoiceRangeChangeAllowedState",()=>this.canChangeVoiceRange),exports("setMaxVoiceRange",e=>{this.maxVoiceRange=e}),exports("getMaxVoiceRange",()=>this.maxVoiceRange),exports("getMicrophoneMuteState",()=>this.isMicrophoneMuted),exports("getMicrophoneDisabledState",()=>this.isMicrophoneDisabled),exports("getSoundMuteState",()=>this.isSoundMuted),exports("getSoundDisabledState",()=>this.isSoundDisabled),exports("getPluginState",()=>this.currentPluginState??"NOT_CONNECTED"),exports("getGlobalErrorLevel",()=>GlobalState[pe]??0),exports("setSpectatingPlayer",e=>{this.spectatingPlayer=e}),exports("getSpectatingPlayer",()=>this.spectatingPlayer),exports("setVoiceRangeMarkerColor",(e,t,i,u)=>{if(typeof e!="number"||typeof t!="number"||typeof i!="number"||typeof u!="number"){console.error("[YaCA] Invalid color value in setVoiceRangeMarkerColor");return}this.sharedConfig.voiceRange.markerColor.r=e,this.sharedConfig.voiceRange.markerColor.g=t,this.sharedConfig.voiceRange.markerColor.b=i,this.sharedConfig.voiceRange.markerColor.a=u}),exports("getVoiceRangeMarkerColor",()=>{let{r:e,g:t,b:i,a:u}=this.sharedConfig.voiceRange.markerColor;return[e,t,i,u]}),exports("resetVoiceRangeMarkerColor",()=>{let e=wt.voiceRange.markerColor;this.sharedConfig.voiceRange.markerColor.r=e.r,this.sharedConfig.voiceRange.markerColor.g=e.g,this.sharedConfig.voiceRange.markerColor.b=e.b,this.sharedConfig.voiceRange.markerColor.a=e.a})}registerKeybindings(){this.sharedConfig.keyBinds.increaseVoiceRange!==!1&&(RegisterCommand("yaca:increaseVoiceRange",()=>{this.changeVoiceRange(!0)},!1),RegisterKeyMapping("yaca:increaseVoiceRange",W("change_voice_range_increase"),"keyboard",this.sharedConfig.keyBinds.increaseVoiceRange)),this.sharedConfig.keyBinds.decreaseVoiceRange!==!1&&(RegisterCommand("yaca:decreaseVoiceRange",()=>{this.changeVoiceRange(!1)},!1),RegisterKeyMapping("yaca:decreaseVoiceRange",W("change_voice_range_decrease"),"keyboard",this.sharedConfig.keyBinds.decreaseVoiceRange)),this.sharedConfig.keyBinds.voiceRangeWithMouseWheel!==!1&&(RegisterCommand("+yaca:changeVoiceRangeWithMousewheel",()=>{this.voiceRangeViaMouseWheelTick=setInterval(()=>{this.handleVoiceRangeViaMouseWheel()})},!1),RegisterCommand("-yaca:changeVoiceRangeWithMousewheel",()=>{this.voiceRangeViaMouseWheelTick&&(clearInterval(this.voiceRangeViaMouseWheelTick),this.voiceRangeViaMouseWheelTick=null)},!1),RegisterKeyMapping("+yaca:changeVoiceRangeWithMousewheel",W("change_voice_range_via_mousewheel"),"keyboard",this.sharedConfig.keyBinds.voiceRangeWithMouseWheel))}registerRdrKeybindings(){this.sharedConfig.keyBinds.increaseVoiceRange!==!1&&ve(this.sharedConfig.keyBinds.increaseVoiceRange,()=>{this.changeVoiceRange()}),this.sharedConfig.keyBinds.decreaseVoiceRange!==!1&&ve(this.sharedConfig.keyBinds.decreaseVoiceRange,()=>{this.changeVoiceRange(!1)}),this.sharedConfig.keyBinds.voiceRangeWithMouseWheel!==!1&&ve(this.sharedConfig.keyBinds.voiceRangeWithMouseWheel,()=>{this.voiceRangeViaMouseWheelTick=setInterval(()=>{this.handleVoiceRangeViaMouseWheel()})},()=>{this.voiceRangeViaMouseWheelTick&&(clearInterval(this.voiceRangeViaMouseWheelTick),this.voiceRangeViaMouseWheelTick=null)})}registerEvents(){onNet("onPlayerJoining",e=>{let t=this.getPlayerByID(e);if(!t)return;let i=this.radioModule?.playersWithShortRange.get(e);if(i){let u=this.radioModule?.findRadioChannelByFrequency(i);u&&(this.setPlayersCommType(t,"RADIO",!0,u,void 0,1,0,GlobalState[pe]??void 0),this.saltyChatBridge?.handleRadioReceivingStateChange(!0,u))}}),onNet("onPlayerDropped",e=>{let t=this.getPlayerByID(e);if(!t)return;this.phoneModule.removePhoneSpeakerFromEntity(e);let i=this.radioModule?.playersWithShortRange.get(e);if(i){let u=this.radioModule?.findRadioChannelByFrequency(i);if(u&&(this.setPlayersCommType(t,"RADIO",!1,u,void 0,1,0,GlobalState[pe]??void 0),this.saltyChatBridge)){let d=this.radioModule?.playersInRadioChannel.get(u);if(d){let _=[...d].filter(b=>b!==e).length>0;this.saltyChatBridge.handleRadioReceivingStateChange(_,u)}}}}),on("onResourceStop",e=>{S.resource===e&&this.websocket.initialized&&this.websocket.close()}),onNet("client:yaca:init",async e=>{this.rangeInterval&&(clearInterval(this.rangeInterval),this.rangeInterval=null),this.websocket.initialized||(this.websocket.initialized=!0,this.websocket.on("message",t=>{this.handleResponse(t)}),this.websocket.on("close",(t,i)=>{this.setCurrentPluginState("NOT_CONNECTED"),console.error("[YACA-Websocket]: client disconnected",t,i)}),this.websocket.on("open",()=>{this.setCurrentPluginState("CONNECTED"),this.firstConnect?(this.initRequest(e),this.firstConnect=!1):emitNet("server:yaca:wsReady"),console.log("[YACA-Websocket]: Successfully connected to the voice plugin")}),await this.websocket.start()),!this.firstConnect&&this.initRequest(e)}),onNet("client:yaca:disconnect",e=>{this.phoneModule.handleDisconnect(e),this.allPlayers.delete(e)}),onNet("client:yaca:addPlayers",e=>{Array.isArray(e)||(e=[e]);let t=[];for(let i of e){if(!i||typeof i.clientId>"u"||typeof i.playerId>"u")continue;let u=this.getPlayerByID(i.playerId);this.allPlayers.set(i.playerId,{remoteID:i.playerId,clientId:i.clientId,forceMuted:i.forceMuted||!1,phoneCallMemberIds:u?.phoneCallMemberIds||void 0,mutedOnPhone:i.mutedOnPhone||!1}),t.push(i.playerId)}this.phoneModule.reestablishCalls(t)}),onNet("client:yaca:muteTarget",(e,t)=>{let i=this.getPlayerByID(e);i&&(i.forceMuted=t)}),onNet("client:yaca:changeVoiceRange",e=>{emit("yaca:external:voiceRangeUpdate",e,this.rangeIndex),this.saltyChatBridge&&emit("SaltyChat_VoiceRangeChanged",e.toFixed(1),this.rangeIndex,this.sharedConfig.voiceRange.ranges.length)}),onNet("client:yaca:notification",(e,t)=>{this.notification(e,t)}),onNet("txcl:spectate:start",e=>{this.spectatingPlayer=e}),onNet("client:yaca:txadmin:stopspectate",()=>{this.spectatingPlayer=!1})}getPlayerByID(e){return this.allPlayers.get(e)}getPlayerByClientId(e){for(let t of this.allPlayers.values())if(t.clientId===e)return t;return null}initRequest(e){if(!e||!e.suid||typeof e.chid!="number"||!e.deChid||!e.ingameName||typeof e.channelPassword>"u"){console.log("[YACA-Websocket]: Error while initializing plugin"),this.notification(W("connect_error"),"error");return}this.sendWebsocket({base:{request_type:"INIT"},server_guid:e.suid,ingame_name:e.ingameName,ingame_channel:e.chid,default_channel:e.deChid,ingame_channel_password:e.channelPassword,excluded_channels:e.excludeChannels,muffling_range:this.sharedConfig.mufflingSettings.mufflingRange,build_type:this.sharedConfig.buildType,unmute_delay:this.sharedConfig.unmuteDelay,operation_mode:e.useWhisper?1:0}),this.useWhisper=e.useWhisper??!1}isPluginInitialized(e=!1){let t=!!this.getPlayerByID(S.serverId);return!t&&!e&&this.notification(W("plugin_not_initialized"),"error"),t}sendWebsocket(e){if(!this.websocket){console.error("[Voice-Websocket]: No websocket created");return}this.websocket.send(e)}handleResponse(e){if(!e)return;let t;try{t=JSON.parse(e)}catch(i){console.error("[YaCA-Websocket]: Error while parsing message: ",i);return}switch(t.code){case"OK":if(t.requestType==="JOIN"){let i=Number.parseInt(t.message);emitNet("server:yaca:addPlayer",i),this.rangeInterval&&(clearInterval(this.rangeInterval),this.rangeInterval=null),this.rangeInterval=setInterval(this.calcPlayers.bind(this),250),this.radioModule.radioInitialized&&this.radioModule.initRadioSettings(),emit("yaca:external:pluginInitialized",i);return}return;case"TALK_STATE":this.handleTalkState(t);return;case"SOUND_STATE":this.handleSoundState(t);return;case"OTHER_TALK_STATE":this.handleOtherTalkState(t);return;case"MOVED_CHANNEL":this.handleMovedChannel(t.message);return;case"WRONG_TS_SERVER":{this.setCurrentPluginState("WRONG_TS_SERVER");let i=this.notificationTimeout.get("WRONG_TS_SERVER");if(i&&i>Date.now())return;this.notificationTimeout.set("WRONG_TS_SERVER",Date.now()+1e4),this.notification(W("wrong_ts_server")??"You are connected to the wrong teamspeak server!","error");return}case"OUTDATED_VERSION":this.setCurrentPluginState("OUTDATED_VERSION"),this.notification(W("outdated_plugin",t.message)??`Your plugin is outdated, please update to version ${t.message}!`,"error");return;case"MAX_PLAYER_COUNT_REACHED":this.notification(W("max_players_reached")??"Your license reached the maximum player count. Please upgrade your license.","error");return;case"LICENSE_SERVER_TIMED_OUT":this.notification(W("license_server_timed_out")??"The connection to the license server timed out, while verifying the license. Please wait a moment.","error");return;case"MOVE_ERROR":this.notification(W("move_error")??"You are not connected to the teamspeak server!","error");return;case"WAIT_GAME_INIT":case"HEARTBEAT":case"MUTE_STATE":return;default:console.log(`[YaCA-Websocket]: Unknown error code: ${t.code}`),this.notification(W("unknown_error",t.code)??`Unknown error code: ${t.code}`,"error");return}}setPlayerVariable(e,t,i){let u=this.getPlayerByID(e);u&&(u[t]=i)}getVoiceRange(){return LocalPlayer.state[Je]??this.defaultVoiceRange}changeVoiceRange(e=!0){if(!this.canChangeVoiceRange)return;let t=this.getVoiceRange();if(e){let u=this.sharedConfig.voiceRange.ranges.findIndex(d=>(this.maxVoiceRange!==-1&&d<=this.maxVoiceRange||this.maxVoiceRange===-1)&&d>t);this.rangeIndex=u!==-1?u:0}else{let u=this.sharedConfig.voiceRange.ranges.slice().reverse().findIndex(d=>d<t);if(this.rangeIndex=u!==-1?this.sharedConfig.voiceRange.ranges.length-1-u:this.sharedConfig.voiceRange.ranges.length-1,this.maxVoiceRange!==-1&&this.sharedConfig.voiceRange.ranges[this.rangeIndex]>this.maxVoiceRange){let d=this.sharedConfig.voiceRange.ranges.slice().reverse().findIndex(y=>y<=this.maxVoiceRange);this.rangeIndex=d!==-1?this.sharedConfig.voiceRange.ranges.length-1-d:this.sharedConfig.voiceRange.ranges.length-1}}let i=this.sharedConfig.voiceRange.ranges[this.rangeIndex]??1;this.changeVoiceRangeInternal(i)}setVoiceRange(e){this.rangeIndex=-1,this.changeVoiceRangeInternal(e)}changeVoiceRangeInternal(e){this.canChangeVoiceRange&&(this.maxVoiceRange!==-1&&e>this.maxVoiceRange||(this.showRangeVisual(e),LocalPlayer.state.set(Je,e,!0),emit("yaca:external:voiceRangeUpdate",e,this.rangeIndex),this.saltyChatBridge&&emit("SaltyChat_VoiceRangeChanged",e.toFixed(1),this.rangeIndex,this.sharedConfig.voiceRange.ranges.length)))}showRangeVisual(e){if(this.visualVoiceRangeTimeout&&(clearTimeout(this.visualVoiceRangeTimeout),this.visualVoiceRangeTimeout=null),this.visualVoiceRangeTick&&(clearInterval(this.visualVoiceRangeTick),this.visualVoiceRangeTick=null),this.sharedConfig.voiceRange.sendNotification&&this.notification(W("voice_range_changed",e),"inform"),this.sharedConfig.voiceRange.markerColor.enabled){let t=this.sharedConfig.voiceRange.markerColor.r,i=this.sharedConfig.voiceRange.markerColor.g,u=this.sharedConfig.voiceRange.markerColor.b,d=this.sharedConfig.voiceRange.markerColor.a,y=this.sharedConfig.voiceRange.markerColor.duration;this.visualVoiceRangeTimeout=setTimeout(()=>{this.visualVoiceRangeTick&&(clearInterval(this.visualVoiceRangeTick),this.visualVoiceRangeTick=null),this.visualVoiceRangeTimeout=null},y),!this.isFiveM&&this.sharedConfig.voiceRange.markerColor.type<1e3&&(this.sharedConfig.voiceRange.markerColor.type=2499653143,console.warn("[YaCA] Marker type is not supported in RedM. Using default marker type.")),this.visualVoiceRangeTick=setInterval(()=>{let _=S.vehicle||S.ped,b=GetEntityCoords(_,!1),A=S.vehicle?b[2]-.6:b[2]-.98;DrawMarker(this.sharedConfig.voiceRange.markerColor.type,b[0],b[1],A,0,0,0,0,0,0,e*2,e*2,1,t,i,u,d,!1,!0,2,this.sharedConfig.voiceRange.markerColor.rotate,null,null,!1)})}}static isCommTypeValid(e){let t=e in ke;return t||console.error(`[YaCA-Websocket]: Invalid comm type: ${e}`),t}setPlayersCommType(e,t,i,u,d,y,_,b){Array.isArray(e)||(e=[e]);let A=[];typeof y<"u"&&A.push({client_id:this.getPlayerByID(S.serverId)?.clientId,mode:y});for(let re of e){if(!re)continue;let J={client_id:re.clientId,mode:_};typeof b<"u"&&b!==null&&(J.errorLevel=b),A.push(J)}let v={on:i,comm_type:t,members:A};typeof u<"u"&&u!==null&&(v.channel=u),typeof d<"u"&&d!==null&&(v.range=d),this.sendWebsocket({base:{request_type:"INGAME"},comm_device:v})}setCommDeviceVolume(e,t,i){if(!o.isCommTypeValid(e))return;let u={comm_type:e,volume:Ye(t,0,1)};typeof i<"u"&&(u.channel=i),this.sendWebsocket({base:{request_type:"INGAME"},comm_device_settings:u})}setCommDeviceStereoMode(e,t,i){if(!o.isCommTypeValid(e))return;let u={comm_type:e,output_mode:t};typeof i<"u"&&(u.channel=i),this.sendWebsocket({base:{request_type:"INGAME"},comm_device_settings:u})}syncLipsPlayer(e,t,i){let u=un[S.game][i?"true":"false"];SetPlayerTalkingOverride(t,i),this.isFiveM?PlayFacialAnim(e,u.name,u.dict):this.isRedM&&ln(e,u.name,u.dict)}handleTalkState(e){let t=e.message==="1",u=!(this.isMicrophoneMuted||this.isMicrophoneDisabled||this.isSoundMuted||this.isSoundDisabled)&&t;this.isTalking!==u&&(this.isTalking=u,this.syncLipsPlayer(S.ped,S.serverId,u),LocalPlayer.state.set(Mt,u,!0),emit("yaca:external:isTalking",u),this.saltyChatBridge&&emit("SaltyChat_TalkStateChanged",u))}handleSoundState(e){let t=JSON.parse(e.message);this.isMicrophoneMuted!==t.microphoneMuted&&(this.isMicrophoneMuted=t.microphoneMuted,emit("yaca:external:microphoneMuteStateChanged",t.microphoneMuted),emit("yaca:external:muteStateChanged",t.microphoneMuted),this.saltyChatBridge&&emit("SaltyChat_MicStateChanged",t.microphoneMuted)),this.isMicrophoneDisabled!==t.microphoneDisabled&&(this.isMicrophoneDisabled=t.microphoneDisabled,emit("yaca:external:microphoneDisabledStateChanged",t.microphoneDisabled),this.saltyChatBridge&&emit("SaltyChat_MicEnabledChanged",t.microphoneDisabled)),this.isSoundMuted!==t.soundMuted&&(this.isSoundMuted=t.soundMuted,emit("yaca:external:soundMuteStateChanged",t.soundMuted),this.saltyChatBridge&&emit("SaltyChat_SoundStateChanged",t.soundMuted)),this.isSoundDisabled!==t.soundDisabled&&(this.isSoundDisabled=t.soundDisabled,emit("yaca:external:soundDisabledStateChanged",t.soundDisabled),this.saltyChatBridge&&emit("SaltyChat_SoundEnabledChanged",t.soundDisabled))}handleOtherTalkState(e){if(!this.sharedConfig.useLocalLipSync)return;let t;try{t=JSON.parse(e.message)}catch{console.error("[YaCA-Websocket]: Error while parsing other talk state message");return}let i=this.getPlayerByClientId(t.clientId);if(!i||!i.remoteID)return;let u=GetPlayerFromServerId(i.remoteID);u!==-1&&SetPlayerTalkingOverride(u,t.isTalking)}handleMovedChannel(e){if(e!=="INGAME_CHANNEL"&&e!=="EXCLUDED_CHANNEL"){console.error("[YaCA-Websocket]: Unknown channel type: ",e);return}e==="INGAME_CHANNEL"?this.setCurrentPluginState("IN_INGAME_CHANNEL"):this.setCurrentPluginState("IN_EXCLUDED_CHANNEL"),emit("yaca:external:channelChanged",e)}checkIfVehicleHasOpening(e){return!e||this.mufflingVehicleWhitelistHash.has(GetEntityModel(e))?!0:hn(e)}getMuffleIntensity(e,t,i,u,d,y=!1){if(u!==GetRoomKeyFromEntity(t)&&!HasEntityClearLosToEntity(e,t,17))return this.sharedConfig.mufflingSettings.intensities.differentRoom;let _=this.sharedConfig.mufflingSettings.vehicleMuffling.enabled;if(this.isRedM||!_)return 0;let b=GetVehiclePedIsIn(t,!1);if((i||0)===b)return 0;if(y)return d?0:this.sharedConfig.mufflingSettings.intensities.megaPhoneInCar;let v=this.checkIfVehicleHasOpening(b);return!d&&!v?this.sharedConfig.mufflingSettings.intensities.bothCarsClosed:!d||!v?this.sharedConfig.mufflingSettings.intensities.oneCarClosed:0}handlePhoneSpeakerEmit(e,t){if(this.useWhisper&&(this.phoneModule.phoneSpeakerActive&&this.phoneModule.inCallWith.size||(!this.phoneModule.phoneSpeakerActive||!this.phoneModule.inCallWith.size)&&this.currentlySendingPhoneSpeakerSender.size)){let i=[...this.currentlySendingPhoneSpeakerSender].filter(d=>!e.has(d)),u=[...e].filter(d=>!this.currentlySendingPhoneSpeakerSender.has(d));this.currentlySendingPhoneSpeakerSender=new Set(e),(u.length||i.length)&&emitNet("server:yaca:phoneSpeakerEmitWhisper",u,i)}for(let i of this.currentlyPhoneSpeakerApplied){if(t.has(i))continue;this.currentlyPhoneSpeakerApplied.delete(i);let u=this.getPlayerByID(i);u&&this.setPlayersCommType(u,"PHONE_SPEAKER",!1,void 0,this.sharedConfig.maxPhoneSpeakerRange,1,0)}}handlePhoneEmit(e){if(!this.sharedConfig.phoneHearPlayersNearby)return;if(this.sharedConfig.phoneHearPlayersNearby==="PHONE_SPEAKER"){if(!(this.phoneModule.phoneSpeakerActive&&this.phoneModule.inCallWith.size||(!this.phoneModule.phoneSpeakerActive||!this.phoneModule.inCallWith.size)&&this.phoneHearNearbyPlayer.size))return}else if(!(this.phoneModule.inCallWith.size||!this.phoneModule.inCallWith.size&&this.phoneHearNearbyPlayer.size))return;let t=[...this.phoneHearNearbyPlayer].filter(u=>!e.has(u)),i=[...e].filter(u=>!this.phoneHearNearbyPlayer.has(u));this.phoneHearNearbyPlayer=new Set(e),(i.length||t.length)&&emitNet("server:yaca:phoneEmit",i,t)}handleVoiceRangeViaMouseWheel(){this.isFiveM&&HudWeaponWheelIgnoreSelection();let e=0,t=this.getVoiceRange();IsControlPressed(0,242)?e=Math.max(1,t-1):IsControlPressed(0,241)&&(e=Math.min(this.sharedConfig.voiceRange.ranges[this.sharedConfig.voiceRange.ranges.length-1],t+1),this.maxVoiceRange!==-1&&e>this.maxVoiceRange&&(e=this.maxVoiceRange)),!(e<=0||t===e)&&this.setVoiceRange(e)}calcPlayers(){let e=this.getPlayerByID(S.serverId);if(!e)return;let t=new Map,i=new Set,u=new Set,d=new Set,y=S.ped,_=S.vehicle;if(this.spectatingPlayer){let J=GetPlayerFromServerId(this.spectatingPlayer);if(J!==-1){let z=GetPlayerPed(J);if(z!==0){y=z;let Q=GetVehiclePedIsIn(z,!1);Q!==0?_=Q:_=!1}}}let b=GetEntityCoords(y,!1),A=GetRoomKeyFromEntity(y),v=this.isFiveM?this.checkIfVehicleHasOpening(_):!0,re=this.phoneModule.phoneSpeakerActive&&this.phoneModule.inCallWith.size;for(let J of GetActivePlayers()){let z=GetPlayerServerId(J),Q=GetPlayerPed(J);if(z===0||z===S.serverId||Q<=0)continue;let le=this.getPlayerByID(z);if(!le||!le.clientId)continue;let Ee=Player(z).state,ce=Ee[Je]??this.defaultVoiceRange,Be=this.getMuffleIntensity(y,Q,_,A,v,Ee[rt]!==null),Ce=GetEntityCoords(Q,!1),Oe=Xe(b,Ce),_e=GetEntityForwardVector(Q),Me=IsPedSwimmingUnderWater(Q)===1;if(u.has(z)||t.set(z,{client_id:le.clientId,position:qe(Ce),direction:qe(_e),range:ce,is_underwater:Me,muffle_intensity:Be,is_muted:le.forceMuted??!1}),this.sharedConfig.phoneHearPlayersNearby&&!e.mutedOnPhone&&!le.forceMuted&&Oe<=ce&&(this.sharedConfig.phoneHearPlayersNearby==="PHONE_SPEAKER"&&re||this.sharedConfig.phoneHearPlayersNearby===!0&&this.phoneModule.inCallWith.size)&&d.add(z),!(Oe>this.sharedConfig.maxPhoneSpeakerRange)&&(this.useWhisper&&re&&i.add(z),!!le.phoneCallMemberIds))for(let O of le.phoneCallMemberIds){let ge=this.getPlayerByID(O);!ge||!ge.clientId||ge.mutedOnPhone||ge.forceMuted||(t.delete(O),t.set(O,{client_id:ge.clientId,position:qe(Ce),direction:qe(_e),range:this.sharedConfig.maxPhoneSpeakerRange,is_underwater:Me,muffle_intensity:Be,is_muted:!1}),u.add(O),!this.currentlyPhoneSpeakerApplied.has(O)&&(this.setPlayersCommType(ge,"PHONE_SPEAKER",!0,void 0,this.sharedConfig.maxPhoneSpeakerRange,1,0),this.currentlyPhoneSpeakerApplied.add(O)))}}this.handlePhoneSpeakerEmit(i,u),this.handlePhoneEmit(d),this.sendWebsocket({base:{request_type:"INGAME"},player:{player_direction:dn(),player_position:qe(b),player_range:LocalPlayer.state[Je]??this.defaultVoiceRange,player_is_underwater:IsPedSwimmingUnderWater(y)===1,player_is_muted:e.forceMuted??!1,players_list:Array.from(t.values())}})}};var ln=async(o,e,t)=>{let i=await ct(t);i&&SetFacialIdleAnimOverride(o,e,i)},cn=(o,e)=>{let t=VarString(10,"LITERAL_STRING",o),i=new DataView(new ArrayBuffer(96));i.setUint32(0,e,!0);let u=new DataView(new ArrayBuffer(16));u.setBigUint64(8,BigInt(t),!0),Citizen.invokeNative("0x049D5C615BD38BAD",i,u,1)},ve=(o,e,t)=>{let i=an[o];if(!i){console.error(`[YaCA] No key hash available for ${o}, please choose another keybind`);return}setTick(()=>{DisableControlAction(0,i,!0),e&&IsDisabledControlJustPressed(0,i)&&e(),t&&IsDisabledControlJustReleased(0,i)&&t()})};function Xe(o,e){return Math.sqrt((o[0]-e[0])**2+(o[1]-e[1])**2+(o[2]-e[2])**2)}function qe(o){return{x:Ve(o[0]),y:Ve(o[1]),z:Ve(o[2])}}function Kn(o,e){switch(e){case 0:return GetEntityBoneIndexByName(o,"window_lf")!==-1;case 1:return GetEntityBoneIndexByName(o,"window_rf")!==-1;case 2:return GetEntityBoneIndexByName(o,"window_lr")!==-1;case 3:return GetEntityBoneIndexByName(o,"window_rr")!==-1;default:return!1}}function $n(o,e){switch(e){case 0:return GetEntityBoneIndexByName(o,"door_dside_f")!==-1;case 1:return GetEntityBoneIndexByName(o,"door_pside_f")!==-1;case 2:return GetEntityBoneIndexByName(o,"door_dside_r")!==-1;case 3:return GetEntityBoneIndexByName(o,"door_pside_r")!==-1;case 4:return GetEntityBoneIndexByName(o,"bonnet")!==-1;case 5:return GetEntityBoneIndexByName(o,"boot")!==-1;default:return!1}}function hn(o){let e=[];for(let t=0;t<6;t++)t===4||!$n(o,t)||e.push(t);if(e.length===0)return!0;for(let t of e)if(GetVehicleDoorAngleRatio(o,t)>0||IsVehicleDoorDamaged(o,t))return!0;if(!AreAllVehicleWindowsIntact(o))return!0;for(let t=0;t<8;t++)if(Kn(o,t)&&!IsVehicleWindowIntact(o,t))return!0;return!!(IsVehicleAConvertible(o,!1)&&GetConvertibleRoofState(o)!==0)}var gn=vt(Cn(),1),pt=class extends gn.default{constructor(){super();this.readyState=0;this.nuiReady=!1;this.initialized=!1;RegisterNuiCallbackType("YACA_OnMessage"),RegisterNuiCallbackType("YACA_OnConnected"),RegisterNuiCallbackType("YACA_OnDisconnected"),on("__cfx_nui:YACA_OnMessage",(t,i)=>{this.emit("message",t),i({})}),on("__cfx_nui:YACA_OnConnected",(t,i)=>{this.readyState=1,this.emit("open"),i({})}),on("__cfx_nui:YACA_OnDisconnected",(t,i)=>{this.readyState=3,this.emit("close",t.code,t.reason),i({})})}async start(){for(;!this.nuiReady;)await lt(100);SendNuiMessage(JSON.stringify({action:"connect"}))}send(t){this.readyState===1&&SendNuiMessage(JSON.stringify({action:"command",data:t}))}close(){this.readyState!==3&&SendNuiMessage(JSON.stringify({action:"close"}))}};function Ve(o,e=17){return Number.parseFloat(o.toFixed(e))}function dn(){let o=GetGameplayCamRot(0),e=o[2]*.0174532924,t=o[0]*.0174532924,i=Math.abs(Math.cos(t));return{x:Ve(-Math.sin(e)*i),y:Ve(Math.cos(e)*i),z:Ve(GetEntityForwardVector(S.ped)[2])}}kt();new mt;})();
|
|
/*! Bundled license information:
|
|
|
|
eventemitter2/lib/eventemitter2.js:
|
|
(*!
|
|
* EventEmitter2
|
|
* https://github.com/hij1nx/EventEmitter2
|
|
*
|
|
* Copyright (c) 2013 hij1nx
|
|
* Licensed under the MIT license.
|
|
*)
|
|
*/
|