Files
2026-07-28 01:06:53 +03:00

434 lines
18 KiB
TypeScript

/* Metro module 9681; source: lib/QueryTokenizer.tsx; dependencies: [6, 7, 2] */
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun76045(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:6, offset: 0x01dc26e3, size: 219 bytes, params: 8, frame: 18
const fixMatchIndex = function(a0, a1) {
if (a0 == null) {
return null;
}
var items = [];
arraySpread(items, a0, 0, a0);
items.index = a1;
return items;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = RegExp('.+', 'g');
const value = _fun76048();
const value2 = _fun76059();
value.NON_TOKEN_TYPE = 'NON_TOKEN';
value.Token = value2;
(FileImportTrackerModule).fileFinishedImporting('lib/QueryTokenizer.tsx');
exports.default = value;
exports.NON_TOKEN_TYPE = 'NON_TOKEN';
exports.QueryTokenizer = value;
exports.Token = value2;
function getMatch(a0, a1, a2) { // fn#76046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:141, offset: 0x01dc27be, size: 307 bytes, params: 4, frame: 25
var r8;
var r2;
var r15;
var r1;
var r7;
var r4;
var property;
var fixMatchIndexBinding;
var match;
var regex;
var value4;
var cache;
var value5;
var get;
var value6;
var value7;
var binding;
var prototype;
var value8;
var binding2;
var value10;
var index;
var type;
var value11;
var binding3;
var value13;
var validator;
var value14;
var value15;
var value16;
var has;
var value17;
var set;
if (a1 != null) {
var length = a1.length;
var value = 0;
if (value < length) {
r8 = value;
reducibleLoop2: while (true) {
property = a1[r8];
fixMatchIndexBinding = fixMatchIndex;
match = a0.match;
regex = property.regex;
value4 = fixMatchIndexBinding(Reflect.apply(match, a0, [regex]), a2);
if (value4 != null) {
cache = property.cache;
value5 = cache != null;
reducibleJoin5: while (true) {
if (value5) {
get = cache.get;
value6 = Reflect.apply(get, cache, [value4[value]]);
value7 = value6 != null;
r2 = value7;
r15 = value6;
break reducibleJoin5;
}
r2 = value5;
r15 = undefined;
break reducibleJoin5;
}
reducibleJoin7: while (true) {
if (r2) {
binding = env0_3;
prototype = binding.prototype;
value8 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value10 = binding2 instanceof Object ? binding2 : value8;
index = value4.index;
value10.start = index;
r1 = value10;
break reducibleJoin7;
}
r1 = r15;
break reducibleJoin7;
}
reducibleJoin10: while (true) {
reducibleJoin18: while (true) {
if (r1 != null) {
break reducibleJoin18;
}
binding = env0_3;
type = property.type;
prototype = binding.prototype;
value11 = Object.create(prototype, {constructor: {value: binding}});
binding3 = new binding();
value13 = binding3 instanceof Object ? binding3 : value11;
validator = property.validator;
if (validator == null) {
break reducibleLoop2;
}
validator = property.validator;
if (Reflect.apply(validator, property, [value13])) {
break reducibleLoop2;
}
break reducibleJoin10;
}
return r1;
}
}
value14 = typeof r8 === 'bigint' ? r8 + 1n : +r8 + 1;
length = a1.length;
if (!(value14 < length)) {
return null;
}
r8 = value14;
continue reducibleLoop2;
}
value15 = cache == null;
reducibleJoin16: while (true) {
if (value15) {
r4 = value15;
break reducibleJoin16;
}
value16 = cache != null;
reducibleJoin15: while (true) {
if (value16) {
has = cache.has;
value17 = Reflect.apply(has, cache, [value4[value]]);
r7 = value17;
break reducibleJoin15;
}
r7 = value16;
break reducibleJoin15;
}
r4 = r7;
break reducibleJoin16;
}
reducibleJoin18: while (true) {
if (r4) {
r1 = value13;
break reducibleJoin18;
}
set = cache.set;
Reflect.apply(set, cache, [value4[value], value13]);
r1 = value13;
break reducibleJoin18;
}
return r1;
}
}
return null;
}
function _fun76048() { // fn#76048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:593, offset: 0x01dc2917, size: 161 bytes, params: 1, frame: 15
return CreateClass(QueryTokenizer, [{key: 'reset', value: function() {
this._rules = [];
this._followers = {};
this._nonTokenType = 'NON_TOKEN';
}}, {key: 'addRule', value: value_76052}, {key: 'tokenize', value: value_76054}, {key: 'clearCache',
value: function() {
var propertyName;
var property2;
this._rules.forEach(_fun76056);
for (propertyName in this._followers) {
property2 = this._followers[propertyName];
property2.forEach(_fun76057);
}
}}, {key: '_getMatch', value: value_76058}]);
function QueryTokenizer() { // fn#76049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:614, offset: 0x01dc29b8, size: 101 bytes, params: 1, frame: 15
var environment;
let value = a0;
const r3 = value !== undefined ? value : [];
value = environment.__proto__;
env1_0(this, QueryTokenizer);
this._rules = [];
this._followers = {};
this._nonTokenType = 'NON_TOKEN';
this.reset();
r3.forEach(_fun76050);
function _fun76050(a0) { // fn#76050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:746, offset: 0x01dc2a1d, size: 23 bytes, params: 2, frame: 11
return ClassCallCheck.addRule(a0);
}
}
function value_76052({type, follows, validator, regex}) { // fn#76052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:878, offset: 0x01dc2a59, size: 247 bytes, params: 2, frame: 20
var r6;
var map;
var _rules;
const r9 = regex.source.charAt(0) === '^' ? regex : new global.RegExp('^' + regex.source);
value = undefined;
if (validator != null) {
map = new global.Map();
} else {
r6 = value;
}
if (follows != null) {
follows.forEach(_fun76053);
} else {
_rules = this._rules;
_rules.push({regex: r9, type: type, validator: validator, cache: r6});
}
return value;
function _fun76053(a0) { // fn#76053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:1046, offset: 0x01dc2b50, size: 109 bytes, params: 2, frame: 13
if (ClassCallCheck._followers[a0] == null) {
ClassCallCheck._followers[a0] = [];
}
ClassCallCheck._followers[a0].push({regex: regex, type: type, validator: validator, cache: CreateClass});
}
}
function value_76054(a0) { // fn#76054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:1244, offset: 0x01dc2bbd, size: 345 bytes, params: 2, frame: 33
var r8;
var r10;
var r11;
var r14;
var r5;
var r15;
var r16;
var r6;
var r9;
var _getMatch;
var substring;
var value6;
var value7;
var value8;
var push;
var binding;
var fixMatchIndexBinding;
var match;
var value9;
var _nonTokenType;
var prototype;
var value10;
var binding2;
var value12;
var length2;
var value13;
var value14;
let value = a0;
const items2 = [];
let length = value.length;
const value2 = 0;
const value3 = undefined;
const value4 = '';
if (length > value2) {
r8 = value2;
r10 = value4;
r11 = value3;
r14 = value;
while (true) {
_getMatch = this._getMatch;
length = r10.length;
value = Reflect.apply(_getMatch, this, [r14, r11, r8 + length]);
if (value != null) {
value7 = r10 != null;
if (!value7) {
r5 = value7;
continue;
}
value8 = value4 !== r10;
r5 = value8;
if (!r5) {
continue;
}
push = items2.push;
binding = env1_3;
fixMatchIndexBinding = fixMatchIndex;
match = r10.match;
value9 = fixMatchIndexBinding(Reflect.apply(match, r10, [env1_2]), r8);
_nonTokenType = this._nonTokenType;
prototype = binding.prototype;
value10 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value12 = binding2 instanceof Object ? binding2 : value10;
Reflect.apply(push, items2, [value12]);
items2.push(value);
length = value.length;
length2 = r10.length;
value13 = r8 + (length + length2);
substring = r14.substring;
length = value.length;
value14 = Reflect.apply(substring, r14, [length]);
r11 = value;
r14 = value14;
r15 = value13;
r16 = value4;
} else {
value = r10 + r14[value2];
value6 = r14.substring(1);
r14 = value6;
r15 = r8;
r16 = value;
}
length = r14.length;
if (length > value2) {
r8 = r15;
r10 = r16;
continue;
}
r6 = r15;
r9 = r16;
break;
}
} else {
r6 = value2;
r9 = value4;
}
if (r9 != null && value4 !== r9) {
push = items2.push;
binding = env1_3;
value = fixMatchIndex(r9.match(env1_2), r6);
_nonTokenType = this._nonTokenType;
value = new binding(value);
Reflect.apply(push, items2, [value]);
}
return items2;
}
function value_76055() { // fn#76055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:1628, offset: 0x01dc2d16, size: 87 bytes, params: 1, frame: 18
var propertyName;
var _followers2;
var property;
this._rules.forEach(function({cache}) {
return cache?.clear();
});
for (propertyName in this._followers) {
_followers2 = this._followers;
property = _followers2[propertyName];
property.forEach(function({cache}) {
return cache?.clear();
});
}
}
function value_76058(a0, a1, a2) { // fn#76058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:1854, offset: 0x01dc2d8d, size: 113 bytes, params: 4, frame: 20
let value = null;
const type = value != a1 ? a1.type : value;
const value2 = undefined;
let r0 = (value == a1 ? value2 : a1.end) !== a2 ? value2 : getMatch(a0, this._followers[global.String(type)], a2);
if (value == r0) {
value = environment.__proto__;
value = getMatch(a0, this._rules, a2);
r0 = value;
}
return r0;
}
}
function _fun76059() { // fn#76059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:2027, offset: 0x01dc2dfe, size: 209 bytes, params: 1, frame: 15
return CreateClass(Token, [{key: 'end', get: function() {
return this.start + this.length;
}}, {key: 'length', get: function() {
return this.match[0].length;
}}, {key: 'valueOf', value: function() {
return this.match[0];
}}, {key: 'getFullMatch', value: function() {
return this.match[0];
}}, {key: 'getMatch', value: function() {
var value = a0;
return this.match[value !== undefined ? value : 0];
}}, {key: 'setData', value: function(a0, a1) {
if (this._data == null) {
this._data = new global.Map();
}
this._data.set(a0, a1);
}}, {key: 'getData', value: function(a0) {
if (this._data != null) {
return this._data.get(a0);
}
}}]);
function Token(a0, a1) { // fn#76060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:2048, offset: 0x01dc2ecf, size: 215 bytes, params: 3, frame: 19
var items2;
var match;
let value = environment.__proto__;
env1_0(this, Token);
if (a0 instanceof Token) {
match = a0.match;
items2 = [];
arraySpread(items2, match, 0, undefined);
this.match = items2;
this.start = a0.start;
this.type = a0.type;
if (a0._data != null) {
this._data = a0._data;
}
} else if (a0 != null) {
items2 = [];
value = 0;
arraySpread(items2, a0, value, undefined);
this.match = items2;
this.start = typeof a0 === 'string' ? value : a0.index ?? value;
this.type = a1;
} else {
this.match = [];
this.start = 0;
this.type = a1;
}
}
}
}
function _fun76056({cache}) { // fn#76056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:1673, offset: 0x01dc2d6d, size: 32 bytes, params: 2, frame: 10
return cache?.clear();
}
function _fun76057({cache}) { // fn#76057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9867:1773, offset: 0x01dc2d6d, size: 32 bytes, params: 2, frame: 10
return cache?.clear();
}
global.__d(_fun76045, 9681, [6, 7, 2]) /* metro module 9681, dependencies: [6, 7, 2] */;