EndcordInstaller.exePE analysis report - Malicious
Run integrity
sample ranThe guest staged the sample and launched it, so what follows describes this file rather than an empty desktop.
Malicious
71/100
1 point past the malicious line at 70.
Why this verdict
- Configuration parser matched without a decoded endpoint or key (PhemedroneStealer): corroboration, not an identity
- 1 high-risk capability(ies): sandbox evasion
- 1 hunting rule(s) that name the file suspicious: SUSP_PE_Discord_Attachment_Oct21_1
- 1 embedded secret(s): Google API key
- Malicious strings: exfiltration / C2
- Local ML score 100.0 (calibrated probability 0.89, gate 0.74)
- 1 evasion behavior(s)
- findings review (advisory, not scored): suspicious - anti-analysis, file-permission-tampering, process-termination, encoded-payload-indicators
Model reading
Evidence ledger above, row by row. Published verdict rests on this column and on nothing to its right.
Reads this report's derived findings, never the sample itself.
A model reading exists for this scan and is shown to the submitter and to staff only. It is a second opinion about evidence the score already priced, it is worth no points, and on a public page it would stand beside the verdict with no grounding a stranger could check.
- HIGH Extracted PhemedroneStealer malware configuration
Analysis layers
Detection signatures
7 detected · 1 withheld as common| Severity | Detection | Evidence | Layer |
|---|---|---|---|
| HIGH |
Embedded secret: Google API key
MITRE T1552.001
|
secret
Google API key
found in the sample's strings
|
static |
| HIGH |
Extracted PhemedroneStealer malware configuration
MITRE T1071
|
- | static |
| MED |
Anti-analysis strings present
MITRE T1497
|
string
vbox
matched string
|
static |
| MED |
Evasion: veh present
MITRE T1497
|
runtime
veh present
evasion signal
|
dynamic |
| MED |
Injection/execution API strings
MITRE T1055
|
string
bypass
matched string
|
static |
| MED |
Ransomware-related strings
MITRE T1486
|
string
.locked
matched string
|
static |
| INFO |
.NET managed assembly (decompiled)
|
- | static |
These rules matched this sample, and they also match this much of known-clean software (measured over 1145 signed Windows and third-party binaries). A rule that fires on most clean files cannot move a verdict, so it is held back unless the detonation confirms the behaviour. They are listed because a count that shrinks without saying so is not a count an analyst can check.
What the tests returned
7 testsEach test this run performed and what it returned. A test that was not performed says so rather than reading as a negative result.
| Test | Result |
|---|---|
| Persistence mechanisms | none established at runtime |
| Cross-process injection | none observed |
| Payloads written to disk | none observed |
| Network connections | not tested - this run had no route out, so an empty network section is a property of the run and not an observation about the sample |
| Behavioural rule matches (Sigma) | none observed |
| Known-malicious hash (reputation sources) | no source reported this file |
| Local anti-virus engine | reported no detection |
Absence of an observation is not proof of absence - see Coverage for what this run could and could not test.
Arguing against malice
- The local anti-virus engine reported no detection.
- No reputation source reported this file as malicious.
How much weight this carries
Structure only. Structural evidence only. Nothing matching this verdict was seen running. The one fact that decided it: capability analysis of the file's imports.
Instrument coverage
3 of 5 measuredWhat this run was able to observe, as the run itself recorded it. A layer that did not run makes an empty result a fact about the sandbox rather than about the sample.
| Layer | Ran | What that means |
|---|---|---|
| Runtime anti-analysis watch | measured | Measured. The in-process hook group for debugger, timing and hypervisor checks armed on this run, so an empty signal list means something looked and saw nothing. |
| API call sequence | measured | Measured for the hooked anti-analysis calls. It is not a full API trace: the sequence carries interpreter spawns plus the hooked anti-analysis calls, and nothing else. |
| Explicit module loads | measured | Measured, with two limits. Only a module the sample asks for by hand is recorded, so one brought in by its own import table never appears, and the hooks arrive a few seconds after a process starts. |
| Network capture | not on this plan | Not included on this scan's plan. |
| Memory capture | not measured | Not measured. This run did not ask for the memory-dump option and nothing forced it, so the guest's memory was not read. |
| Live kernel introspection | not measured | Not measured. This run did not ask for the memory-dump option, which is what starts the introspection loop. |
This lists the layers this run recorded for itself. A layer that is not listed was not recorded either way, so its absence here is not a result.
Structure
What the file is made of: headers, imports, how it was built and whether it was signed.
Sections & resources
How the file is laid out in memory, and what is embedded in it: section roles, access rights, entropy and every resource entry.
Signatures & packing
What matched and what is hidden: signature rules, detected capabilities, family attribution, packer detection, unpacked payloads and recovered configuration.
Strings
The readable content: embedded secrets, flagged strings and everything extraction recovered.
Code
What the sample would execute: the emulated API call sequence, and the disassembled entry point.
Antivirus engine
no signature matched signature set 28163 - 3.6M signaturesNothing in the signature set below matched this file. That is one engine's negative answer against one signature set on one day, and it is not a verdict. A signature engine only recognises what has already been named and published, so a file nobody has named yet scans exactly like a file that is harmless. What this file does when it runs is the stronger evidence; read the behaviour sections for that.
| Signature set | Value |
|---|---|
| Set version | 28163 |
| Signatures in the set | 3,642,895 |
| Set published | 24 Oct 2026 06:26 +0000 |
| Age when this file was scanned | same day |
A negative answer is only as good as the signature set that gave it, so the set is recorded with the result and the result can be reproduced against it.
Local ML assessment
100.0 of 100 8 strongest of 2568 featuresA gradient-boosted model running entirely on this host scored this file 100.0 of 100 on structure alone: its headers, sections, imports, strings and signature. The file was not executed and nothing about it left this machine.
Read this as corroboration and not as a verdict. Measured across this corpus the model separates signed software from unsigned software more sharply than malicious from benign, so it is charged at most 15 of 100 verdict points and only on top of evidence this report measured for itself. The eight features below are the ones that moved it furthest.
| Structural feature | What it means | Pushes | Weight |
|---|---|---|---|
| image flag dll | Image flag: a library rather than a program | towards malicious | +2.3323 |
| section entropy .rsrc | Byte randomness of section .rsrc | towards malicious | +0.7423 |
| feature column 679 | Text in the file matching the pattern powershell | towards malicious | +0.7159 |
| debug directory address | Location of the debug table (0) | towards malicious | +0.6440 |
| debug directory size | Size of the debug table (0) | towards malicious | +0.5905 |
| feature column 681 | Text in the file matching the pattern process | towards malicious | +0.5334 |
| import mscoree.dll:_CorExeMain | Calls _CorExeMain from mscoree.dll | towards malicious | +0.5170 |
| optional.checksum | Header checksum, which is zero on most files that were never signed (0) | towards malicious | +0.4500 |
A weight is a log-odds nudge away from the model's own baseline, not a percentage point. Where a feature names a section, an import or a build id, the number beside it is the model's own hashed cell for that name rather than a measurement of the file: two names can share one cell and the sign comes from the hash, so no number is shown for those rows.
- High-entropy resource (possible packed payload)
- .NET managed binary (no obfuscator signature matched)
Extracted malware config
PhemedroneStealer| raw | LargeTitle=True, Title=True, Subtitle=False, Code=False, TabText=True, ButtonText=True, LabelText=False, MutedText=False |
|---|
Secrets & malicious strings
3 secrets 4 flagged strings| Severity | Type | Value (redacted) |
|---|---|---|
| high | Google API key | AIzaSyDL...kCXA (39 chars) |
| low | API key assignment | ct.store...iKey (24 chars) |
| low | Password assignment | password...ord" (23 chars) |
Flagged string categories
| Indicator | Found in | Evidence from the sample |
|---|---|---|
| gofile.io | extracted string | `).filter(d=>!!d),h=Number.parseFloat(o),f=await oa({id:i,name:n,artist:c,album:s});return{name:n,album:s,artist:c,playerPosition:e,duration:h,...f}}var ur={};F(ur,{chooseVideoFile:()=>da,createTempVi |
| Indicator | Found in | Evidence from the sample |
|---|---|---|
| vbox | extracted string | </>;`});function DX(e){_R.id!==e.id&&(Object.assign(_R,e),TX.forEach(t=>t(e)))}var _R,TX,xRe,PX=g(()=>{"use strict";d();I();_R={id:null,theme:null},TX=new Set,xRe=()=>{let[,e]=J.useState(_R);return J. |
| Indicator | Found in | Evidence from the sample |
|---|---|---|
| bypass | extracted string | `,classNames:{},dom:null});Vme="src/plugins/betterForwards/style.css"});var Ys,zG,jme,QYe,af,Zk,GG=g(()=>{"use strict";d();G();jt();Ae();Mt();pt();_a();F();ye();Oe();L();te();I();Gme();Hme();Ys=j("vc- |
| Indicator | Found in | Evidence from the sample |
|---|---|---|
| .locked | extracted string | }`,classNames:{},dom:null});Kge="src/plugins/callTimer/alignedChatInputFix.css"});function eet(e){let t=Zge.store.format==="human",n=p=>t?p:p.toString().padStart(2,"0"),r=p=>t?p:"",o=t?" ":":",a=Math. |
Capabilities
1 behaviour bucket| Severity | Capability | MITRE | APIs |
|---|---|---|---|
| med | Code execution Creates processes / runs commands or shellcode |
T1059 | system |
Security mitigations
partial postureBuild and packaging
1 of 6 checks matched| Check | Result | Detail |
|---|---|---|
| PyInstaller bundle | not found | analyser ran over the bytes, no marker |
| Nuitka build | not found | analyser ran over the bytes, no marker |
| Electron application (asar) | not found | analyser ran over the bytes, no marker |
| HTML / SVG smuggling | not found | analyser ran over the bytes, no marker |
| Rust / Nim / Zig toolchain | not found | analyser ran over the bytes, no marker |
| LLM-enabled code | found | googleopenrouter 1 API key (redacted), 2 vendor endpoints, 7 prompt phrasesgoogle AIzaSyDL...(39 chars) (39 chars) openrouter.ai/api/v1/chat/completions role_assignment: "ent_time}",default:`You are a helpful assistant who answers questions for the user in a c…"; task_framing x5: "ait Tc())return pi("You must be logged in to delete reviews.");await E4e(e.id)&&t()}}))}f…"; api_message_schema: "tiveLogChunk(t,`{"
|
.NET managed
| Assembly | EndcordInstaller 4.0.23.0 |
|---|---|
| Streams | #~ #Strings #US #GUID #Blob |
| P/Invoke | 2 unmanaged import(s): CreateRoundRectRgn, DeleteObject |
| Resources | patcher.js, preload.js, renderer.js, renderer.css, app_logo.png |
Sections
3 sections · the file's memory layout| Section | Virtual addr | Raw size | Virtual size | Access | Entropy |
|---|---|---|---|---|---|
|
.textEP
Executable code
|
0x2000 |
3.4 MB
|
3.4 MB
|
EXECUTEREAD
|
5.9305
|
|
.rsrc
Resources
|
0x362000 |
41.5 KB
|
41.2 KB
|
READ
|
7.8644
|
|
.reloc
Base relocations
|
0x36e000 |
512.0 B
|
12.0 B
|
READ
|
0.0815
|
Imports
1 funcs / 1 DLL0 of these function were seen called at runtime.
Open the imports pageBinary metadata
what the headers declare about this build| Resource langs | NEU |
|---|---|
| Debug info | no |
| TLS callbacks | no |
Code signing
UnsignedThis binary carries no Authenticode signature. Unsigned executables are a weak suspicious signal - most legitimate vendor software is signed.
Resources
Everything the binary carries inside it: icons, bitmaps, cursors, dialogs, string tables, the manifest and the version block. Select an entry to preview it and take a copy.
Resources
Resource Hacker viewSelect a resource from the tree to inspect its language, size, RVA offset, MD5, entropy and detected content signature - like opening the binary in Resource Hacker.
| Type | Group Icon |
|---|---|
| Name / ID | 32512 |
| Language | NEU |
| Size | 20.0 B |
| RVA offset | 0x36c200 |
| Content signature | Icon |
| MD5 | 090912a95eb6d3553db416877a4b4095 |
| Entropy | 1.517 |
| Type | Icon |
|---|---|
| Name / ID | 2 |
| Language | NEU |
| Size | 39.0 KB |
| RVA offset | 0x3625f8 |
| Content signature | PNG |
| MD5 | eaad8f3f97379a90460d40b340dbc06a |
| Entropy | 7.926 |
| Type | Manifest |
|---|---|
| Name / ID | 1 |
| Language | NEU |
| Size | 651.0 B |
| RVA offset | 0x36c218 |
| Content signature | XML manifest |
| MD5 | e4a3aa586957bcf421787ba723fd0a46 |
| Entropy | 5.023 |
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="4.0.13.0" name="EndcordInstaller"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>
| Type | Version Info |
|---|---|
| Name / ID | 1 |
| Language | NEU |
| Size | 1.2 KB |
| RVA offset | 0x362130 |
| Content signature | Version Info |
| MD5 | 33a3c09ab8b146b21ceb5176ea1e5940 |
| Entropy | 3.386 |
| Comments | Official Endcord desktop installer. Installs, repairs, or removes the open-source Endcord Discord client modification. Source: https://github.com/rootpoii/endcord |
|---|---|
| CompanyName | Endcord |
| FileVersion | 4.0.23.0 |
| ProductName | Endcord |
| InternalName | EndcordInstaller.exe |
| LegalCopyright | Copyright © 2026 Endcord. Licensed under GPL-3.0-or-later. |
| ProductVersion | 4.0.23 |
| FileDescription | Endcord Installer |
| Assembly Version | 4.0.23.0 |
| OriginalFilename | EndcordInstaller.exe |
Similar samples
22 related samplesRanked by fuzzy hash (TLSH distance - lower is closer) and ssdeep similarity, plus an identical import table and functions shared once library code is removed. A near-identical neighbour is usually the same build; a variant is the same family rebuilt or repacked.
| Relation | Sample | Verdict | Why it matched |
|---|---|---|---|
| related | Dungeons2SkinLoader.exe | No threats detected | identical import table (imphash) |
| related | AlyxMP-Setup.exe | Suspicious | identical import table (imphash) |
| related | VM.v2.1.exe | Malicious | identical import table (imphash) |
| related | SpyTeam.exe | Suspicious | identical import table (imphash) |
| related | IronCrownSetup (2).exe | Malicious | identical import table (imphash) |
| related | XIAOMI BOOTLOADER TOOL.exe | Suspicious | identical import table (imphash) |
| related | Capri-Setup.exe | Malicious | identical import table (imphash) |
| related | XWorm V3.1.exe | Malicious | identical import table (imphash) |
| related | M4R7HGroup.exe | Suspicious | identical import table (imphash) |
| related | Capri-Setup.exe | Malicious | identical import table (imphash) |
| related | Capri-Setup.exe | Malicious | identical import table (imphash) |
| related | cr-keygen.exe | Malicious | identical import table (imphash) |
| related | WeMod Geometry Dash Setup.exe | No threats detected | identical import table (imphash) |
| related | MetaDataStringEditor.exe | No threats detected | identical import table (imphash) |
| related | dotnet_b64_3des_cbc_to_404keylo… | Malicious | identical import table (imphash) |
| related | CrackPotassium.exe | Malicious | identical import table (imphash) |
| related | Server.exe | Malicious | identical import table (imphash) |
| related | ZuLauncher.exe | Suspicious | identical import table (imphash) |
| related | Bind Remover.exe | Malicious | identical import table (imphash) |
| related | svchost_update.exe | Malicious | identical import table (imphash) |
| related | START.exe | Suspicious | identical import table (imphash) |
| related | dfsvc.exe | No threats detected | identical import table (imphash) |
Threat classification
Signature family candidates| Family | Agreeing rules | Matched rules | Disposition |
|---|---|---|---|
| SIGNATURE BASE SUSP PE Discord Attachment Oct21 1 | 1 | SIGNATURE_BASE_SUSP_PE_Discord_Attachment_Oct21_1 | Not a classification: one rule cannot establish a family, so this named nothing and scored nothing. |
Capability detection
27 capabilitiesThe capability analysis reports a limitation on this class of file: (internal) .NET file limitation.
Read what follows as the capabilities of the code that could be read, not of the file as a whole.
| Capability | Namespace |
|---|---|
| read file in .NET | host-interaction/file-system/read |
| create process in .NET | host-interaction/process/create |
| write file in .NET | host-interaction/file-system/write |
| set file attributes | host-interaction/file-system/meta |
| create thread | host-interaction/thread/create |
| suspend thread | host-interaction/thread/suspend |
| contain loop | - |
| terminate process | host-interaction/process/terminate |
| find process by name | host-interaction/process/list |
| terminate process by name in .NET | host-interaction/process/terminate |
| check if directory exists | host-interaction/file-system/exists |
| enumerate files in .NET | host-interaction/file-system/files/list |
| delete file | host-interaction/file-system/delete |
| delete directory | host-interaction/file-system/delete |
| check if file exists | host-interaction/file-system/exists |
| access .NET resource | executable/resource |
| unmanaged call | runtime |
| get common file path | host-interaction/file-system |
| copy file | host-interaction/file-system/copy |
| get file size | host-interaction/file-system/meta |
| move file | host-interaction/file-system/move |
| create directory | host-interaction/file-system/create |
| compiled to the .NET platform | runtime/dotnet |
| reference analysis tools strings | anti-analysis |
| reference Base64 string | data-manipulation/encoding/base64 |
| reference anti-VM strings targeting VirtualBox | anti-analysis/anti-vm/vm-detection |
Signature matches
4 findings · 3 file properties · 1 scored| Rule | What it matched | Corpus | Weight |
|---|---|---|---|
|
possible_includes_base64_packed_functions
|
Detects possible includes and packed functions
2 of 2 strings matched
$f
atob
at 0xa2b7 · 82 hits
$fff
This
at 0x4e · 1000000 hits
|
Tier 3 - community corpus
casts no family vote; every measured false family match came from here
|
SCORED 0
Scored 0: the rule declares no category. No branch of the score model reads it.
|
|
powershell
|
No description
1 of 1 string matched
$a
PowerShell
at 0x13e604
|
Tier 3 - community corpus
casts no family vote; every measured false family match came from here
|
SCORED 0
Scored 0: the rule declares no category. No branch of the score model reads it.
|
|
SUSP_PE_Discord_Attachment_Oct21_1
rule dated 2021-10-12
|
Detects suspicious executable with reference to a Discord attachment (often used for malware hosting on a legitimate FQDN)
1 of 1 string matched
$x1
https://cdn.discordapp.com/attac...
at 0x2dfad
|
Tier 3 - community corpus
casts no family vote; every measured false family match came from here
|
SCORED 10
Scored 10, sharing a 30 point cap with every other hunting rule that names the file suspicious.
|
|
SIGNATURE_BASE_SUSP_PE_Discord_Attachment_Oct21_1
FILE
rule dated 2021-10-12
|
Detects suspicious executable with reference to a Discord attachment (often used for malware hosting on a legitimate FQDN)
1 of 1 string matched
$x1
https://cdn.discordapp.com/attac...
at 0x2dfad
|
Tier 2 - community rule feed
may confirm a family name, never establish one on its own
|
SCORED 0
Scored 0: the rule declares no category. No branch of the score model reads it.
Names SIGNATURE BASE SUSP PE Discord Attachment Oct21 1, but one rule cannot establish a family: two independent rules must agree, so this named nothing.
|
These say what the file IS or holds - bitness, subsystem, an overlay, an embedded macro stream, which compiler built it. Ordinary files match several, and none of them carry weight in the score.
Extracted strings
showing 200 of 2180- !This program cannot be run in DOS mode.
- .text
- `.rsrc
- @.reloc
- // Endcord 27c2964
- // Standalone: true
- // Platform: Universal
- // Updater Disabled: false
- "use strict";var Hs=Object.create;var yt=Object.defineProperty;var Vs=Object.getOwnPropertyDescriptor;var Zs=Object.getOwnPropertyNames;var Ys=Object.getPrototypeOf,Js=Object.prototype.hasOwnProperty;var G=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(i){throw t=[i],i}};var q=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},F=(r,e)=>{for(var t in e)yt(r,t,{get:e[t],enumerable:!0})},wn=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Zs(e))!Js.call(r,n)&&n!==t&&yt(r,n,{get:()=>e[n],enumerable:!(i=Vs(e,n))||i.enumerable});return r};var Re=(r,e,t)=>(t=r!=null?Hs(Ys(r)):{},wn(e||!r||!r.__esModule?yt(t,"default",{value:r,enumerable:!0}):t,r)),Wt=r=>wn(yt({},"__esModule",{value:!0}),r);var w=G(()=>{"use strict"});var Be=G(()=>{"use strict";w()});var Ht,yn,st,kn=G(()=>{"use strict";w();Ht=Symbol("SettingsStore.isProxy"),yn=Symbol("SettingsStore.getRawTarget"),st=class{pathListeners=new Map;prefixListeners=new Map;globalListeners=new Set;proxyContexts=new WeakMap;proxyHandler=(()=>{let e=this;return{get(t,i,n){if(i===Ht)return!0;if(i===yn)return t;let s=Reflect.get(t,i,n),c=e.proxyContexts.get(t);if(c==null)return s;let{root:o,path:h}=c;if(!(i in t)&&e.getDefaultValue!=null&&(s=e.getDefaultValue({target:t,key:i,root:o,path:h})),typeof s=="object"&&s!==null&&!s[Ht]){let f=`${h}${h&&"."}${i}`;return e.makeProxy(s,o,f)}return s},set(t,i,n){if(n?.[Ht]&&(n=n[yn]),t[i]===n)return!0;if(!Reflect.set(t,i,n))return!1;let s=e.proxyContexts.get(t);if(s==null)return!0;let{root:c,path:o}=s,h=`${o}${o&&"."}${i}`;return e.notifyListeners(h,n,c),!0},deleteProperty(t,i){if(!Reflect.deleteProperty(t,i))return!1;let n=e.proxyContexts.get(t);if(n==null)return!0;let{root:s,path:c}=n,o=`${c}${c&&"."}${i}`;return e.notifyListeners(o,void 0,s),!0}}})();constructor(e,t={}){this.plain=e,this.store=this.makeProxy(e),Object.assign(this,t)}makeProxy(e,t=e,i=""){return this.proxyContexts.set(e,{root:t,path:i}),new Proxy(e,this.proxyHandler)}notifyPrefixListeners(e,t,i){for(let n=1;n<=t.length;n++){let s=t.slice(0,n).join(".");this.prefixListeners.get(s)?.forEach(c=>c(i,e))}}notifyListeners(e,t,i){let n=e.split(".");if(n.length>3&&n[0]==="plugins"){let s=n.slice(0,3),c=s.join("."),o=s.reduce((h,f)=>h[f],i);this.globalListeners.forEach(h=>h(i,c)),this.pathListeners.get(c)?.forEach(h=>h(o))}else this.globalListeners.forEach(s=>s(i,e));this.pathListeners.get(e)?.forEach(s=>s(t)),this.notifyPrefixListeners(e,n,t)}setData(e,t){if(this.readOnly)throw new Error("SettingsStore is read-only");if(this.plain=e,this.store=this.makeProxy(e),t){let i=e,n=t.split(".");for(let s of n){if(!i){console.warn(`Settings#setData: Path ${t} does not exist in new data. Not dispatching update`);return}i=i[s]}this.pathListeners.get(t)?.forEach(s=>s(i)),this.notifyPrefixListeners(t,n,i)}this.markAsChanged()}addGlobalChangeListener(e){this.globalListeners.add(e)}addChangeListener(e,t){let i=this.pathListeners.get(e)??new Set;i.add(t),this.pathListeners.set(e,i)}addPrefixChangeListener(e,t){let i=this.prefixListeners.get(e)??new Set;i.add(t),this.prefixListeners.set(e,i)}removeGlobalChangeListener(e){this.globalListeners.delete(e)}removeChangeListener(e,t){let i=this.pathListeners.get(e);i&&(i.delete(t),i.size||this.pathListeners.delete(e))}removePrefixChangeListener(e,t){let i=this.prefixListeners.get(e);i&&(i.delete(t),i.size||this.prefixListeners.delete(e))}markAsChanged(){this.globalListeners.forEach(e=>e(this.plain,""))}}});function Vt(r,e){for(let t in e){let i=e[t];typeof i=="object"&&!Array.isArray(i)?(r[t]??={},Vt(r[t],i)):r[t]??=i}return r}var bn=G(()=>{"use strict";w()});var xn,ke,be,Ce,ue,Ge,Zt,Yt,En,kt,me=G(()=>{"use strict";w();xn=require("electron"),ke=require("path"),be=process.env.ENDCORD_USER_DATA_DIR??(process.env.DISCORD_USER_DATA_DIR?(0,ke.join)(process.env.DISCORD_USER_DATA_DIR,"..","EndcordData"):(0,ke.join)(xn.app.getPath("userData"),"..","Endcord")),Ce=(0,ke.join)(be,"settings"),ue=(0,ke.join)(be,"themes"),Ge=(0,ke.join)(Ce,"quickCss.css"),Zt=(0,ke.join)(Ce,"settings.json"),Yt=(0,ke.join)(Ce,"native-settings.json"),En=["https:","http:","steam:","spotify:","com.epicgames.launcher:","tidal:","itunes:"],kt=process.argv.includes("--vanilla")});function Sn(r,e){try{return JSON.parse((0,Me.readFileSync)(e,"utf-8"))}catch(t){return t?.code!=="ENOENT"&&console.error(`Failed to read ${r} settings`,t),{}}}var Jt,Me,$,Ks,Tn,z,ae=G(()=>{"use strict";w();Be();kn();bn();Jt=require("electron"),Me=require("fs");me();(0,Me.mkdirSync)(Ce,{recursive:!0});$=new st(Sn("renderer",Zt));$.addGlobalChangeListener(()=>{try{(0,Me.writeFileSync)(Zt,JSON.stringify($.plain,null,4))}catch(r){console.error("Failed to write renderer settings",r)}});Jt.ipcMain.on("EndcordGetSettings",r=>r.returnValue=$.plain);Jt.ipcMain.handle("EndcordSetSettings",(r,e,t)=>{$.setData(e,t)});Ks={plugins:{},customCspRules:{}},Tn=Sn("native",Yt);Vt(Tn,Ks);z=new st(Tn);z.addGlobalChangeListener(()=>{try{(0,Me.writeFileSync)(Yt,JSON.stringify(z.plain,null,4))}catch(r){console.error("Failed to write native settings",r)}})});async function An(r,e){try{var t=await fetch(r,e)}catch(n){throw n instanceof Error&&n.cause&&(n=n.cause),new Error(`${e?.method??"GET"} ${r} failed: ${n}`)}if(t.ok)return t;let i=`${e?.method??"GET"} ${r}: ${t.status} ${t.statusText}`;try{let n=await t.text();i+=`
- ${n}`}catch{}throw new Error(i)}async function er(r,e){return(await An(r,e)).json()}async function xt(r,e){let i=await(await An(r,e)).arrayBuffer();return Buffer.from(i)}var ta,tr=G(()=>{"use strict";w();ta=require("original-fs")});var at,rr=G(()=>{w();at="27c2964"});var nr,Rn=G(()=>{w();nr="rootpoii/endcord"});var Et,ir=G(()=>{"use strict";w();rr();Rn();Et=`Endcord/${at}${nr?` (https://github.com/${nr})`:""}`});function ot(r){return async function(){try{return{ok:!0,value:await r(...arguments)}}catch(e){return{ok:!1,error:e instanceof Error?{...e,message:e.message,name:e.name,stack:e.stack}:e}}}}var Cn=G(()=>{"use strict";w()});var aa={};async function na(r){return er(ra+r,{headers:{Accept:"application/vnd.github+json","User-Agent":Et}})}async function ia(){if(!await Ln())return[];try{return(await na(`/compare/${at}...HEAD`)).commits.map(t=>({hash:t.sha.slice(0,7),author:t.author?.login??t.commit?.author?.name??"Unknown Author",message:t.commit.message.split(`
- `)[0]}))}catch{return[{hash:"new",author:"GitHub",message:"New update available on GitHub"}]}}async function Ln(){try{let r=`?t=${Date.now()}`,e=await er(`https://raw.githubusercontent.com/rootpoii/endcord/main/version.json${r}`);if(e&&e.assets&&Array.isArray(e.assets)&&e.assets.length>0&&Number(e.updatedAt||0)>1790968510489&&e.hash!==at)return sr=e.assets.map(n=>[n.name,n.url]),!0}catch{}return!1}async function sa(){let r=await Promise.all(sr.map(async([e,t])=>{let i=await xt(t);return[(0,Nn.join)(__dirname,e),i]}));return await Promise.all(r.map(async([e,t])=>(0,Mn.writeFile)(e,t))),sr=[],!0}var lt,Mn,Nn,ra,sr,Un=G(()=>{"use strict";w();tr();ir();Be();lt=require("electron"),Mn=require("fs/promises"),Nn=require("path");rr();Cn();ra="https://api.github.com/repos/rootpoii/endcord",sr=[];lt.ipcMain.handle("EndcordGetRepo",ot(()=>"https://github.com/rootpoii/endcord"));lt.ipcMain.handle("EndcordGetUpdates",ot(ia));lt.ipcMain.handle("EndcordUpdate",ot(Ln));lt.ipcMain.handle("EndcordBuild",ot(sa))});var Xe=q(Mi=>{w();(function(){this.Event=class{constructor(e,t){this.start_mark=e,this.end_mark=t}},this.NodeEvent=class extends this.Event{constructor(e,t,i){super(t,i),this.anchor=e}},this.CollectionStartEvent=class extends this.NodeEvent{constructor(e,t,i,n,s,c){super(e,n,s),this.tag=t,this.implicit=i,this.flow_style=c}},this.CollectionEndEvent=class extends this.Event{},this.StreamStartEvent=class extends this.Event{constructor(e,t,i){super(e,t),this.encoding=i}},this.StreamEndEvent=class extends this.Event{},this.DocumentStartEvent=class extends this.Event{constructor(e,t,i,n,s){super(e,t),this.explicit=i,this.version=n,this.tags=s}},this.DocumentEndEvent=class extends this.Event{constructor(e,t,i){super(e,t),this.explicit=i}},this.AliasEvent=class extends this.NodeEvent{},this.ScalarEvent=class extends this.NodeEvent{constructor(e,t,i,n,s,c,o){super(e,s,c),this.tag=t,this.implicit=i,this.value=n,this.style=o}},this.SequenceStartEvent=class extends this.CollectionStartEvent{},this.SequenceEndEvent=class extends this.CollectionEndEvent{},this.MappingStartEvent=class extends this.CollectionStartEvent{},this.MappingEndEvent=class extends this.CollectionEndEvent{}}).call(Mi)});var ce=q(Ni=>{w();(function(){var r=[].indexOf;this.Mark=class{constructor(t,i,n,s){this.line=t,this.column=i,this.buffer=n,this.pointer=s}get_snippet(t=4,i=75){var n,s,c,o,h,f,d;if(this.buffer==null)return null;for(n=`\0\r
- \x85\u2028\u2029`,c="",f=this.pointer;f>0&&(o=this.buffer[f-1],r.call(n,o)<0);)if(f--,this.pointer-f>i/2-1){c=" ... ",f+=5;break}for(d="",s=this.pointer;s<this.buffer.length&&(h=this.buffer[s],r.call(n,h)<0);)if(s++,s-this.pointer>i/2-1){d=" ... ",s-=5;break}return`${new Array(t).join(" ")}${c}${this.buffer.slice(f,s)}${d}
- ${new Array(t+this.pointer-f+c.length).join(" ")}^`}toString(){var t,i;return t=this.get_snippet(),i=` on line ${this.line+1}, column ${this.column+1}`,t?i:`${i}:
- ${t}`}},this.YAMLError=class extends Error{constructor(t){super(t),Object.defineProperty(this,"stack",{get:function(){return this.toString()+`
- `+new Error().stack.split(`
- `).slice(1).join(`
- `)}})}toString(){return this.message}},this.MarkedYAMLError=class extends this.YAMLError{constructor(t,i,n,s,c){super(),this.context=t,this.context_mark=i,this.problem=n,this.problem_mark=s,this.note=c}toString(){var t;return t=[],this.context!=null&&t.push(this.context),this.context_mark!=null&&(this.problem==null||this.problem_mark==null||this.context_mark.line!==this.problem_mark.line||this.context_mark.column!==this.problem_mark.column)&&t.push(this.context_mark.toString()),this.problem!=null&&t.push(this.problem),this.problem_mark!=null&&t.push(this.problem_mark.toString()),this.note!=null&&t.push(this.note),t.join(`
- `)}}}).call(Ni)});var Ue=q(Li=>{w();(function(){var r;r=0,this.Node=class{constructor(t,i,n,s){this.tag=t,this.value=i,this.start_mark=n,this.end_mark=s,this.unique_id=`node_${r++}`}},this.ScalarNode=(function(){class e extends this.Node{constructor(i,n,s,c,o){super(i,n,s,c),this.style=o}}return e.prototype.id="scalar",e}).call(this),this.CollectionNode=class extends this.Node{constructor(t,i,n,s,c){super(t,i,n,s),this.flow_style=c}},this.SequenceNode=(function(){class e extends this.CollectionNode{}return e.prototype.id="sequence",e}).call(this),this.MappingNode=(function(){class e extends this.CollectionNode{}return e.prototype.id="mapping",e}).call(this)}).call(Li)});var Or=q(_t=>{w();(function(){var r,e,t;e=Xe(),{MarkedYAMLError:r}=ce(),t=Ue(),this.ComposerError=class extends r{},this.Composer=(function(){var i;class n{constructor(){return i.apply(this,arguments)}initialise(){return this.anchors={}}check_node(){return this.check_event(e.StreamStartEvent)&&this.get_event(),!this.check_event(e.StreamEndEvent)}get_node(){if(!this.check_event(e.StreamEndEvent))return this.compose_document()}get_single_node(){var c,o;if(this.get_event(),c=null,this.check_event(e.StreamEndEvent)||(c=this.compose_document()),!this.check_event(e.StreamEndEvent))throw o=this.get_event(),new _t.ComposerError("expected a single document in the stream",c.start_mark,"but found another document",o.start_mark);return this.get_event(),c}compose_document(){var c;return this.get_event(),c=this.compose_node(),this.get_event(),this.anchors={},c}compose_node(c,o){var h,f,d;if(this.check_event(e.AliasEvent)){if(f=this.get_event(),h=f.anchor,!(h in this.anchors))throw new _t.ComposerError(null,null,`found undefined alias ${h}`,f.start_mark);return this.anchors[h]}if(f=this.peek_event(),h=f.anchor,h!==null&&h in this.anchors)throw new _t.ComposerError(`found duplicate anchor ${h}; first occurence`,this.anchors[h].start_mark,"second occurrence",f.start_mark);return this.descend_resolver(c,o),this.check_event(e.ScalarEvent)?d=this.compose_scalar_node(h):this.check_event(e.SequenceStartEvent)?d=this.compose_sequence_node(h):this.check_event(e.MappingStartEvent)&&(d=this.compose_mapping_node(h)),this.ascend_resolver(),d}compose_scalar_node(c){var o,h,f;return o=this.get_event(),f=o.tag,(f===null||f==="!")&&(f=this.resolve(t.ScalarNode,o.value,o.implicit)),h=new t.ScalarNode(f,o.value,o.start_mark,o.end_mark,o.style),c!==null&&(this.anchors[c]=h),h}compose_sequence_node(c){var o,h,f,d,g;for(d=this.get_event(),g=d.tag,(g===null||g==="!")&&(g=this.resolve(t.SequenceNode,null,d.implicit)),f=new t.SequenceNode(g,[],d.start_mark,null,d.flow_style),c!==null&&(this.anchors[c]=f),h=0;!this.check_event(e.SequenceEndEvent);)f.value.push(this.compose_node(f,h)),h++;return o=this.get_event(),f.end_mark=o.end_mark,f}compose_mapping_node(c){var o,h,f,d,g,u;for(g=this.get_event(),u=g.tag,(u===null||u==="!")&&(u=this.resolve(t.MappingNode,null,g.implicit)),d=new t.MappingNode(u,[],g.start_mark,null,g.flow_style),c!==null&&(this.anchors[c]=d);!this.check_event(e.MappingEndEvent);)h=this.compose_node(d),f=this.compose_node(d,h),d.value.push([h,f]);return o=this.get_event(),d.end_mark=o.end_mark,d}}return i=n.prototype.initialise,n}).call(this)}).call(_t)});var _e=q(Ui=>{w();(function(){var r,e,t,i={}.hasOwnProperty;this.StringStream=class{constructor(){this.string=""}write(s){return this.string+=s}},this.clone=n=>Object.assign({},n),this.extend=function(n,...s){var c,o,h,f,d,g,u;for(c=0,h=s.length;c<h;c++)for(u=s[c];u!==Object.prototype;){for(g=Object.getOwnPropertyNames(u),o=0,f=g.length;o<f;o++)d=g[o],n[d]==null&&(n[d]=u[d]);u=Object.getPrototypeOf(u)}return n},this.is_empty=function(n){var s;if(Array.isArray(n)||typeof n=="string")return n.length===0;for(s in n)if(i.call(n,s))return!1;return!0},this.inspect=(r=(e=(t=require("util"))!=null?t.inspect:void 0)!=null?e:global.inspect)!=null?r:function(n){return`${n}`},this.pad_left=function(n,s,c){return n=String(n),n.length>=c?n:n.length+1===c?`${s}${n}`:`${new Array(c-n.length+1).join(s)}${n}`},this.to_hex=function(n){return typeof n=="string"&&(n=n.charCodeAt(0)),n.toString(16)}}).call(Ui)});var Fr=q(V=>{w();(function(){var r,e,t,i=[].indexOf;({MarkedYAMLError:r}=ce()),e=Ue(),t=_e(),this.ConstructorError=class extends r{},this.BaseConstructor=(function(){var n;class s{constructor(){return n.apply(this,arguments)}static add_constructor(o,h){return this.prototype.hasOwnProperty("yaml_constructors")||(this.prototype.yaml_constructors=t.extend({},this.prototype.yaml_constructors)),this.prototype.yaml_constructors[o]=h}static add_multi_constructor(o,h){return this.prototype.hasOwnProperty("yaml_multi_constructors")||(this.prototype.yaml_multi_constructors=t.extend({},this.prototype.yaml_multi_constructors)),this.prototype.yaml_multi_constructors[o]=h}initialise(){return this.constructed_objects={},this.constructing_nodes=[],this.deferred_constructors=[]}check_data(){return this.check_node()}get_data(){if(this.check_node())return this.construct_document(this.get_node())}get_single_data(){var o;return o=this.get_single_node(),o!=null?this.construct_document(o):null}construct_document(o){var h;for(h=this.construct_object(o);!t.is_empty(this.deferred_constructors);)this.deferred_constructors.pop()();return h}defer(o){return this.deferred_constructors.push(o)}construct_object(o){var h,f,d,g,u;if(o.unique_id in this.constructed_objects)return this.constructed_objects[o.unique_id];if(d=o.unique_id,i.call(this.constructing_nodes,d)>=0)throw new V.ConstructorError(null,null,"found unconstructable recursive node",o.start_mark);if(this.constructing_nodes.push(o.unique_id),h=null,u=null,o.tag in this.yaml_constructors)h=this.yaml_constructors[o.tag];else{for(g in this.yaml_multi_constructors)if(o.tag.indexOf(g===0)){u=o.tag.slice(g.length),h=this.yaml_multi_constructors[g];break}h==null&&(null in this.yaml_multi_constructors?(u=o.tag,h=this.yaml_multi_constructors[null]):null in this.yaml_constructors?h=this.yaml_constructors[null]:o instanceof e.ScalarNode?h=this.construct_scalar:o instanceof e.SequenceNode?h=this.construct_sequence:o instanceof e.MappingNode&&(h=this.construct_mapping))}return f=h.call(this,u??o,o),this.constructed_objects[o.unique_id]=f,this.constructing_nodes.pop(),f}construct_scalar(o){if(!(o instanceof e.ScalarNode))throw new V.ConstructorError(null,null,`expected a scalar node but found ${o.id}`,o.start_mark);return o.value}construct_sequence(o){var h,f,d,g,u;if(!(o instanceof e.SequenceNode))throw new V.ConstructorError(null,null,`expected a sequence node but found ${o.id}`,o.start_mark);for(g=o.value,u=[],f=0,d=g.length;f<d;f++)h=g[f],u.push(this.construct_object(h));return u}construct_mapping(o){var h,f,d,g,u,_,a,l;if(!(o instanceof e.MappingNode))throw new ConstructorError(null,null,`expected a mapping node but found ${o.id}`,o.start_mark);for(u={},_=o.value,h=0,g=_.length;h<g;h++){if([d,l]=_[h],f=this.construct_object(d),typeof f=="object")throw new V.ConstructorError("while constructing a mapping",o.start_mark,"found unhashable key",d.start_mark);a=this.construct_object(l),u[f]=a}return u}construct_pairs(o){var h,f,d,g,u,_,a,l;if(!(o instanceof e.MappingNode))throw new V.ConstructorError(null,null,`expected a mapping node but found ${o.id}`,o.start_mark);for(u=[],_=o.value,h=0,g=_.length;h<g;h++)[d,l]=_[h],f=this.construct_object(d),a=this.construct_object(l),u.push([f,a]);return u}}return s.prototype.yaml_constructors={},s.prototype.yaml_multi_constructors={},n=s.prototype.initialise,s}).call(this),this.Constructor=(function(){var n,s,c;class o extends this.BaseConstructor{construct_scalar(f){var d,g,u,_,a;if(f instanceof e.MappingNode){for(_=f.value,d=0,u=_.length;d<u;d++)if([g,a]=_[d],g.tag==="tag:yaml.org,2002:value")return this.construct_scalar(a)}return super.construct_scalar(f)}flatten_mapping(f){var d,g,u,_,a,l,p,m,v,k,y,b;for(p=[],g=0;g<f.value.length;)if([_,b]=f.value[g],_.tag==="tag:yaml.org,2002:merge")if(f.value.splice(g,1),b instanceof e.MappingNode)this.flatten_mapping(b),p=p.concat(b.value);else if(b instanceof e.SequenceNode){for(v=[],m=b.value,d=0,a=m.length;d<a;d++){if(k=m[d],!(k instanceof e.MappingNode))throw new V.ConstructorError("while constructing a mapping",f.start_mark,`expected a mapping for merging, but found ${k.id}`,k.start_mark);this.flatten_mapping(k),v.push(k.value)}for(v.reverse(),u=0,l=v.length;u<l;u++)y=v[u],p=p.concat(y)}else throw new V.ConstructorError("while constructing a mapping",f.start_mark,`expected a mapping or list of mappings for merging but found ${b.id}`,b.start_mark);else _.tag==="tag:yaml.org,2002:value"&&(_.tag="tag:yaml.org,2002:str"),g++;if(p.length)return f.value=p.concat(f.value)}construct_mapping(f){return f instanceof e.MappingNode&&this.flatten_mapping(f),super.construct_mapping(f)}construct_yaml_null(f){return this.construct_scalar(f),null}construct_yaml_bool(f){var d;return d=this.construct_scalar(f),n[d.toLowerCase()]}construct_yaml_int(f){var d,g,u,_,a,l,p,m,v;if(v=this.construct_scalar(f),v=v.replace(/_/g,""),m=v[0]==="-"?-1:1,p=v[0],i.call("+-",p)>=0&&(v=v.slice(1)),v==="0")return 0;if(v.indexOf("0b")===0)return m*parseInt(v.slice(2),2);if(v.indexOf("0x")===0)return m*parseInt(v.slice(2),16);if(v.indexOf("0o")===0)return m*parseInt(v.slice(2),8);if(v[0]==="0")return m*parseInt(v,8);if(i.call(v,":")>=0){for(u=(function(){var k,y,b,S;for(b=v.split(/:/g),S=[],k=0,y=b.length;k<y;k++)l=b[k],S.push(parseInt(l));return S})(),u.reverse(),d=1,v=0,_=0,a=u.length;_<a;_++)g=u[_],v+=g*d,d*=60;return m*v}else return m*parseInt(v)}construct_yaml_float(f){var d,g,u,_,a,l,p,m,v;if(v=this.construct_scalar(f),v=v.replace(/_/g,"").toLowerCase(),m=v[0]==="-"?-1:1,p=v[0],i.call("+-",p)>=0&&(v=v.slice(1)),v===".inf")return m*(1/0);if(v===".nan")return NaN;if(i.call(v,":")>=0){for(u=(function(){var k,y,b,S;for(b=v.split(/:/g),S=[],k=0,y=b.length;k<y;k++)l=b[k],S.push(parseFloat(l));return S})(),u.reverse(),d=1,v=0,_=0,a=u.length;_<a;_++)g=u[_],v+=g*d,d*=60;return m*v}else return m*parseFloat(v)}construct_yaml_binary(f){var d,g;g=this.construct_scalar(f);try{return typeof window<"u"&&window!==null?atob(g):new Buffer(g,"base64").toString("ascii")}catch(u){throw d=u,new V.ConstructorError(null,null,`failed to decode base64 data: ${d}`,f.start_mark)}}construct_yaml_timestamp(f){var d,g,u,_,a,l,p,m,v,k,y,b,S,T,D,I,C;D=this.construct_scalar(f),p=f.value.match(c),I={};for(l in s)a=s[l],I[l]=p[a];if(C=parseInt(I.year),k=parseInt(I.month)-1,g=parseInt(I.day),!I.hour)return new Date(Date.UTC(C,k,g));if(_=parseInt(I.hour),v=parseInt(I.minute),y=parseInt(I.second),m=0,I.fraction){for(u=I.fraction.slice(0,6);u.length<6;)u+="0";u=parseInt(u),m=Math.round(u/1e3)}return I.tz_sign&&(T=I.tz_sign==="-"?1:-1,(b=parseInt(I.tz_hour))&&(_+=T*b),(S=parseInt(I.tz_minute))&&(v+=T*S)),d=new Date(Date.UTC(C,k,g,_,v,y,m)),d}construct_yaml_pair_list(f,d){var g;if(g=[],!(d instanceof e.SequenceNode))throw new V.ConstructorError(`while constructing ${f}`,d.start_mark,`expected a sequence but found ${d.id}`,d.start_mark);return this.defer(()=>{var u,_,a,l,p,m,v,k,y;for(p=d.value,m=[],u=0,l=p.length;u<l;u++){if(v=p[u],!(v instanceof e.MappingNode))throw new V.ConstructorError(`while constructing ${f}`,d.start_mark,`expected a mapping of length 1 but found ${v.id}`,v.start_mark);if(v.value.length!==1)throw new V.ConstructorError(`while constructing ${f}`,d.start_mark,`expected a mapping of length 1 but found ${v.id}`,v.start_mark);[a,y]=v.value[0],_=this.construct_object(a),k=this.construct_object(y),m.push(g.push([_,k]))}return m}),g}construct_yaml_omap(f){return this.construct_yaml_pair_list("an ordered map",f)}construct_yaml_pairs(f){return this.construct_yaml_pair_list("pairs",f)}construct_yaml_set(f){var d;return d=[],this.defer(()=>{var g,u;u=[];for(g in this.construct_mapping(f))u.push(d.push(g));return u}),d}construct_yaml_str(f){return this.construct_scalar(f)}construct_yaml_seq(f){var d;return d=[],this.defer(()=>{var g,u,_,a,l;for(a=this.construct_sequence(f),l=[],g=0,_=a.length;g<_;g++)u=a[g],l.push(d.push(u));return l}),d}construct_yaml_map(f){var d;return d={},this.defer(()=>{var g,u,_,a;u=this.construct_mapping(f),_=[];for(g in u)a=u[g],_.push(d[g]=a);return _}),d}construct_yaml_object(f,d){var g;return g=new d,this.defer(()=>{var u,_,a,l;_=this.construct_mapping(f,!0),a=[];for(u in _)l=_[u],a.push(g[u]=l);return a}),g}construct_undefined(f){throw new V.ConstructorError(null,null,`could not determine a constructor for the tag ${f.tag}`,f.start_mark)}}return n={on:!0,off:!1,true:!0,false:!1,yes:!0,no:!1},c=/^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[\x20\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\.([0-9]*))?(?:[\x20\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$/,s={year:1,month:2,day:3,hour:4,minute:5,second:6,fraction:7,tz:8,tz_sign:9,tz_hour:10,tz_minute:11},o}).call(this),this.Constructor.add_constructor("tag:yaml.org,2002:null",this.Constructor.prototype.construct_yaml_null),this.Constructor.add_constructor("tag:yaml.org,2002:bool",this.Constructor.prototype.construct_yaml_bool),this.Constructor.add_constructor("tag:yaml.org,2002:int",this.Constructor.prototype.construct_yaml_int),this.Constructor.add_constructor("tag:yaml.org,2002:float",this.Constructor.prototype.construct_yaml_float),this.Constructor.add_constructor("tag:yaml.org,2002:binary",this.Constructor.prototype.construct_yaml_binary),this.Constructor.add_constructor("tag:yaml.org,2002:timestamp",this.Constructor.prototype.construct_yaml_timestamp),this.Constructor.add_constructor("tag:yaml.org,2002:omap",this.Constructor.prototype.construct_yaml_omap),this.Constructor.add_constructor("tag:yaml.org,2002:pairs",this.Constructor.prototype.construct_yaml_pairs),this.Constructor.add_constructor("tag:yaml.org,2002:set",this.Constructor.prototype.construct_yaml_set),this.Constructor.add_constructor("tag:yaml.org,2002:str",this.Constructor.prototype.construct_yaml_str),this.Constructor.add_constructor("tag:yaml.org,2002:seq",this.Constructor.prototype.construct_yaml_seq),this.Constructor.add_constructor("tag:yaml.org,2002:map",this.Constructor.prototype.construct_yaml_map),this.Constructor.add_constructor(null,this.Constructor.prototype.construct_undefined)}).call(V)});var Oi=q(qr=>{w();(function(){var r,e,t,i,n={}.hasOwnProperty,s=[].indexOf;t=Xe(),i=_e(),{YAMLError:e}=ce(),this.EmitterError=class extends e{},this.Emitter=(function(){var c,o,h,f;class d{constructor(){return f.apply(this,arguments)}initialise(u,_){var a;return this.stream=u,this.encoding=null,this.states=[],this.state=this.expect_stream_start,this.events=[],this.event=null,this.indents=[],this.indent=null,this.flow_level=0,this.root_context=!1,this.sequence_context=!1,this.mapping_context=!1,this.simple_key_context=!1,this.line=0,this.column=0,this.whitespace=!0,this.indentation=!0,this.open_ended=!1,{canonical:this.canonical,allow_unicode:this.allow_unicode}=_,this.canonical==null&&(this.canonical=!1),this.allow_unicode==null&&(this.allow_unicode=!0),this.best_indent=1<_.indent&&_.indent<10?_.indent:2,this.best_width=_.width>this.indent*2?_.width:80,this.best_line_break=(a=_.line_break)==="\r"||a===`
- `?_.line_break:`
- `,this.tag_prefixes=null,this.prepared_anchor=null,this.prepared_tag=null,this.analysis=null,this.style=null}dispose(){return this.states=[],this.state=null}emit(u){var _;for(this.events.push(u),_=[];!this.need_more_events();)this.event=this.events.shift(),this.state(),_.push(this.event=null);return _}need_more_events(){var u;return this.events.length===0?!0:(u=this.events[0],u instanceof t.DocumentStartEvent?this.need_events(1):u instanceof t.SequenceStartEvent?this.need_events(2):u instanceof t.MappingStartEvent?this.need_events(3):!1)}need_events(u){var _,a,l,p,m;for(p=0,m=this.events.slice(1),a=0,l=m.length;a<l;a++)if(_=m[a],_ instanceof t.DocumentStartEvent||_ instanceof t.CollectionStartEvent?p++:_ instanceof t.DocumentEndEvent||_ instanceof t.CollectionEndEvent?p--:_ instanceof t.StreamEndEvent&&(p=-1),p<0)return!1;return this.events.length<u+1}increase_indent(u={}){if(this.indents.push(this.indent),this.indent==null)return this.indent=u.flow?this.best_indent:0;if(!u.indentless)return this.indent+=this.best_indent}expect_stream_start(){return this.event instanceof t.StreamStartEvent?(this.event.encoding&&!("encoding"in this.stream)&&(this.encoding=this.event.encoding),this.write_stream_start(),this.state=this.expect_first_document_start):this.error("expected StreamStartEvent, but got",this.event)}expect_nothing(){return this.error("expected nothing, but got",this.event)}expect_first_document_start(){return this.expect_document_start(!0)}expect_document_start(u=!1){var _,a,l,p,m,v,k;if(this.event instanceof t.DocumentStartEvent){if((this.event.version||this.event.tags)&&this.open_ended&&(this.write_indicator("...",!0),this.write_indent()),this.event.version&&this.write_version_directive(this.prepare_version(this.event.version)),this.tag_prefixes=i.clone(o),this.event.tags)for(k=(function(){var y,b;y=this.event.tags,b=[];for(p in y)n.call(y,p)&&b.push(p);return b}).call(this).sort(),l=0,m=k.length;l<m;l++)a=k[l],v=this.event.tags[a],this.tag_prefixes[v]=a,this.write_tag_directive(this.prepare_tag_handle(a),this.prepare_tag_prefix(v));return _=!u||this.event.explicit||this.canonical||this.event.version||this.event.tags||this.check_empty_document(),_&&(this.write_indent(),this.write_indicator("---",!0),this.canonical&&this.write_indent()),this.state=this.expect_document_root}else return this.event instanceof t.StreamEndEvent?(this.open_ended&&(this.write_indicator("...",!0),this.write_indent()),this.write_stream_end(),this.state=this.expect_nothing):this.error("expected DocumentStartEvent, but got",this.event)}expect_document_end(){return this.event instanceof t.DocumentEndEvent?(this.write_indent(),this.event.explicit&&(this.write_indicator("...",!0),this.write_indent()),this.flush_stream(),this.state=this.expect_document_start):this.error("expected DocumentEndEvent, but got",this.event)}expect_document_root(){return this.states.push(this.expect_document_end),this.expect_node({root:!0})}expect_node(u={}){if(this.root_context=!!u.root,this.sequence_context=!!u.sequence,this.mapping_context=!!u.mapping,this.simple_key_context=!!u.simple_key,this.event instanceof t.AliasEvent)return this.expect_alias();if(this.event instanceof t.ScalarEvent||this.event instanceof t.CollectionStartEvent){if(this.process_anchor("&"),this.process_tag(),this.event instanceof t.ScalarEvent)return this.expect_scalar();if(this.event instanceof t.SequenceStartEvent)return this.flow_level||this.canonical||this.event.flow_style||this.check_empty_sequence()?this.expect_flow_sequence():this.expect_block_sequence();if(this.event instanceof t.MappingStartEvent)return this.flow_level||this.canonical||this.event.flow_style||this.check_empty_mapping()?this.expect_flow_mapping():this.expect_block_mapping()}else return this.error("expected NodeEvent, but got",this.event)}expect_alias(){return this.event.anchor||this.error("anchor is not specified for alias"),this.process_anchor("*"),this.state=this.states.pop()}expect_scalar(){return this.increase_indent({flow:!0}),this.process_scalar(),this.indent=this.indents.pop(),this.state=this.states.pop()}expect_flow_sequence(){return this.write_indicator("[",!0,{whitespace:!0}),this.flow_level++,this.increase_indent({flow:!0}),this.state=this.expect_first_flow_sequence_item}expect_first_flow_sequence_item(){return this.event instanceof t.SequenceEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.write_indicator("]",!1),this.state=this.states.pop()):((this.canonical||this.column>this.best_width)&&this.write_indent(),this.states.push(this.expect_flow_sequence_item),this.expect_node({sequence:!0}))}expect_flow_sequence_item(){return this.event instanceof t.SequenceEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.canonical&&(this.write_indicator(",",!1),this.write_indent()),this.write_indicator("]",!1),this.state=this.states.pop()):(this.write_indicator(",",!1),(this.canonical||this.column>this.best_width)&&this.write_indent(),this.states.push(this.expect_flow_sequence_item),this.expect_node({sequence:!0}))}expect_flow_mapping(){return this.write_indicator("{",!0,{whitespace:!0}),this.flow_level++,this.increase_indent({flow:!0}),this.state=this.expect_first_flow_mapping_key}expect_first_flow_mapping_key(){return this.event instanceof t.MappingEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.write_indicator("}",!1),this.state=this.states.pop()):((this.canonical||this.column>this.best_width)&&this.write_indent(),!this.canonical&&this.check_simple_key()?(this.states.push(this.expect_flow_mapping_simple_value),this.expect_node({mapping:!0,simple_key:!0})):(this.write_indicator("?",!0),this.states.push(this.expect_flow_mapping_value),this.expect_node({mapping:!0})))}expect_flow_mapping_key(){return this.event instanceof t.MappingEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.canonical&&(this.write_indicator(",",!1),this.write_indent()),this.write_indicator("}",!1),this.state=this.states.pop()):(this.write_indicator(",",!1),(this.canonical||this.column>this.best_width)&&this.write_indent(),!this.canonical&&this.check_simple_key()?(this.states.push(this.expect_flow_mapping_simple_value),this.expect_node({mapping:!0,simple_key:!0})):(this.write_indicator("?",!0),this.states.push(this.expect_flow_mapping_value),this.expect_node({mapping:!0})))}expect_flow_mapping_simple_value(){return this.write_indicator(":",!1),this.states.push(this.expect_flow_mapping_key),this.expect_node({mapping:!0})}expect_flow_mapping_value(){return(this.canonical||this.column>this.best_width)&&this.write_indent(),this.write_indicator(":",!0),this.states.push(this.expect_flow_mapping_key),this.expect_node({mapping:!0})}expect_block_sequence(){var u;return u=this.mapping_context&&!this.indentation,this.increase_indent({indentless:u}),this.state=this.expect_first_block_sequence_item}expect_first_block_sequence_item(){return this.expect_block_sequence_item(!0)}expect_block_sequence_item(u=!1){return!u&&this.event instanceof t.SequenceEndEvent?(this.indent=this.indents.pop(),this.state=this.states.pop()):(this.write_indent(),this.write_indicator("-",!0,{indentation:!0}),this.states.push(this.expect_block_sequence_item),this.expect_node({sequence:!0}))}expect_block_mapping(){return this.increase_indent(),this.state=this.expect_first_block_mapping_key}expect_first_block_mapping_key(){return this.expect_block_mapping_key(!0)}expect_block_mapping_key(u=!1){return!u&&this.event instanceof t.MappingEndEvent?(this.indent=this.indents.pop(),this.state=this.states.pop()):(this.write_indent(),this.check_simple_key()?(this.states.push(this.expect_block_mapping_simple_value),this.expect_node({mapping:!0,simple_key:!0})):(this.write_indicator("?",!0,{indentation:!0}),this.states.push(this.expect_block_mapping_value),this.expect_node({mapping:!0})))}expect_block_mapping_simple_value(){return this.write_indicator(":",!1),this.states.push(this.expect_block_mapping_key),this.expect_node({mapping:!0})}expect_block_mapping_value(){return this.write_indent(),this.write_indicator(":",!0,{indentation:!0}),this.states.push(this.expect_block_mapping_key),this.expect_node({mapping:!0})}check_empty_document(){var u;return!(this.event instanceof t.DocumentStartEvent)||this.events.length===0?!1:(u=this.events[0],u instanceof t.ScalarEvent&&u.anchor==null&&u.tag==null&&u.implicit&&u.value==="")}check_empty_sequence(){return this.event instanceof t.SequenceStartEvent&&this.events[0]instanceof t.SequenceEndEvent}check_empty_mapping(){return this.event instanceof t.MappingStartEvent&&this.events[0]instanceof t.MappingEndEvent}check_simple_key(){var u;return u=0,this.event instanceof t.NodeEvent&&this.event.anchor!=null&&(this.prepared_anchor==null&&(this.prepared_anchor=this.prepare_anchor(this.event.anchor)),u+=this.prepared_anchor.length),this.event.tag!=null&&(this.event instanceof t.ScalarEvent||this.event instanceof t.CollectionStartEvent)&&(this.prepared_tag==null&&(this.prepared_tag=this.prepare_tag(this.event.tag)),u+=this.prepared_tag.length),this.event instanceof t.ScalarEvent&&(this.analysis==null&&(this.analysis=this.analyze_scalar(this.event.value)),u+=this.analysis.scalar.length),u<128&&(this.event instanceof t.AliasEvent||this.event instanceof t.ScalarEvent&&!this.analysis.empty&&!this.analysis.multiline||this.check_empty_sequence()||this.check_empty_mapping())}process_anchor(u){if(this.event.anchor==null){this.prepared_anchor=null;return}return this.prepared_anchor==null&&(this.prepared_anchor=this.prepare_anchor(this.event.anchor)),this.prepared_anchor&&this.write_indicator(`${u}${this.prepared_anchor}`,!0),this.prepared_anchor=null}process_tag(){var u;if(u=this.event.tag,this.event instanceof t.ScalarEvent){if(this.style==null&&(this.style=this.choose_scalar_style()),(!this.canonical||u==null)&&(this.style===""&&this.event.implicit[0]||this.style!==""&&this.event.implicit[1])){this.prepared_tag=null;return}this.event.implicit[0]&&u==null&&(u="!",this.prepared_tag=null)}else if((!this.canonical||u==null)&&this.event.implicit){this.prepared_tag=null;return}return u==null&&this.error("tag is not specified"),this.prepared_tag==null&&(this.prepared_tag=this.prepare_tag(u)),this.write_indicator(this.prepared_tag,!0),this.prepared_tag=null}process_scalar(){var u;switch(this.analysis==null&&(this.analysis=this.analyze_scalar(this.event.value)),this.style==null&&(this.style=this.choose_scalar_style()),u=!this.simple_key_context,this.style){case'"':this.write_double_quoted(this.analysis.scalar,u);break;case"'":this.write_single_quoted(this.analysis.scalar,u);break;case">":this.write_folded(this.analysis.scalar);break;case"|":this.write_literal(this.analysis.scalar);break;default:this.write_plain(this.analysis.scalar,u)}return this.analysis=null,this.style=null}choose_scalar_style(){var u;return this.analysis==null&&(this.analysis=this.analyze_scalar(this.event.value)),this.event.style==='"'||this.canonical?'"':!this.event.style&&this.event.implicit[0]&&!(this.simple_key_context&&(this.analysis.empty||this.analysis.multiline))&&(this.flow_level&&this.analysis.allow_flow_plain||!this.flow_level&&this.analysis.allow_block_plain)?"":this.event.style&&(u=this.event.style,s.call("|>",u)>=0)&&!this.flow_level&&!this.simple_key_context&&this.analysis.allow_block?this.event.style:(!this.event.style||this.event.style==="'")&&this.analysis.allow_single_quoted&&!(this.simple_key_context&&this.analysis.multiline)?"'":'"'}prepare_version([u,_]){var a;return a=`${u}.${_}`,u===1?a:this.error("unsupported YAML version",a)}prepare_tag_handle(u){var _,a,l,p;for(u||this.error("tag handle must not be empty"),(u[0]!=="!"||u.slice(-1)!=="!")&&this.error("tag handle must start and end with '!':",u),p=u.slice(1,-1),a=0,l=p.length;a<l;a++)_=p[a],"0"<=_&&_<="9"||"A"<=_&&_<="Z"||"a"<=_&&_<="z"||s.call("-_",_)>=0||this.error(`invalid character '${_}' in the tag handle:`,u);return u}prepare_tag_prefix(u){var _,a,l,p;for(u||this.error("tag prefix must not be empty"),a=[],p=0,l=+(u[0]==="!");l<u.length;)_=u[l],"0"<=_&&_<="9"||"A"<=_&&_<="Z"||"a"<=_&&_<="z"||s.call("-;/?!:@&=+$,_.~*'()[]",_)>=0?l++:(p<l&&a.push(u.slice(p,l)),p=l=l+1,a.push(_));return p<l&&a.push(u.slice(p,l)),a.join("")}prepare_tag(u){var _,a,l,p,m,v,k,y,b,S,T,D;if(u||this.error("tag must not be empty"),u==="!")return u;for(p=null,T=u,b=(function(){var I,C;I=this.tag_prefixes,C=[];for(v in I)n.call(I,v)&&C.push(v);return C}).call(this).sort(),m=0,k=b.length;m<k;m++)y=b[m],u.indexOf(y)===0&&(y==="!"||y.length<u.length)&&(p=this.tag_prefixes[y],T=u.slice(y.length));for(a=[],S=l=0;l<T.length;)_=T[l],"0"<=_&&_<="9"||"A"<=_&&_<="Z"||"a"<=_&&_<="z"||s.call("-;/?!:@&=+$,_.~*'()[]",_)>=0||_==="!"&&p!=="!"?l++:(S<l&&a.push(T.slice(S,l)),S=l=l+1,a.push(_));return S<l&&a.push(T.slice(S,l)),D=a.join(""),p?`${p}${D}`:`!<${D}>`}prepare_anchor(u){var _,a,l;for(u||this.error("anchor must not be empty"),a=0,l=u.length;a<l;a++)_=u[a],"0"<=_&&_<="9"||"A"<=_&&_<="Z"||"a"<=_&&_<="z"||s.call("-_",_)>=0||this.error(`invalid character '${_}' in the anchor:`,u);return u}analyze_scalar(u){var _,a,l,p,m,v,k,y,b,S,T,D,I,C,M,Y,we,Q,ye,de,Ae,qe,J,nt,$e,je;for(u||new r(u,!0,!1,!1,!0,!0,!0,!1),v=!1,b=!1,Y=!1,J=!1,je=!1,C=!1,I=!1,$e=!1,nt=!1,k=!1,qe=!1,(u.indexOf("---")===0||u.indexOf("...")===0)&&(v=!0,b=!0),we=!0,S=u.length===1||(de=u[1],s.call(`\0
- \x85\u2028\u2029`,de)>=0),ye=!1,Q=!1,D=0,D=T=0,M=u.length;T<M;D=++T)y=u[D],D===0?s.call("#,[]{}&*!|>'\"%@`",y)>=0||y==="-"&&S?(b=!0,v=!0):s.call("?:",y)>=0&&(b=!0,S&&(v=!0)):s.call(",?[]{}",y)>=0?b=!0:y===":"?(b=!0,S&&(v=!0)):y==="#"&&we&&(b=!0,v=!0),s.call(`
- `||" "<=y&&y<="~"||(y!=="\uFEFF"&&(y==="\x85"||"\xA0"<=y&&y<="\uD7FF"||"\uE000"<=y&&y<="\uFFFD")?(je=!0,this.allow_unicode||(J=!0)):J=!0),y===" "?(D===0&&(C=!0),D===u.length-1&&($e=!0),Q&&(k=!0),Q=!1,ye=!0):s.call(`
- \x85\u2028\u2029`,y)>=0?(D===0&&(I=!0),D===u.length-1&&(nt=!0),ye&&(qe=!0),Q=!0,ye=!1):(Q=!1,ye=!1),we=s.call(c,y)>=0,S=D+2>=u.length||(Ae=u[D+2],s.call(c,Ae)>=0);return p=!0,a=!0,m=!0,l=!0,_=!0,(C||I||$e||nt)&&(p=a=!1),$e&&(_=!1),k&&(p=a=m=!1),(qe||J)&&(p=a=m=_=!1),Y&&(p=a=!1),b&&(p=!1),v&&(a=!1),new r(u,!1,Y,p,a,m,l,_)}write_stream_start(){if(this.encoding&&this.encoding.indexOf("utf-16")===0)return this.stream.write("\uFEFF",this.encoding)}write_stream_end(){return this.flush_stream()}write_indicator(u,_,a={}){var l;return l=this.whitespace||!_?u:" "+u,this.whitespace=!!a.whitespace,this.indentation&&(this.indentation=!!a.indentation),this.column+=l.length,this.open_ended=!1,this.stream.write(l,this.encoding)}write_indent(){var u,_,a;if(_=(a=this.indent)!=null?a:0,(!this.indentation||this.column>_||this.column===_&&!this.whitespace)&&this.write_line_break(),this.column<_)return this.whitespace=!0,u=new Array(_-this.column+1).join(" "),this.column=_,this.stream.write(u,this.encoding)}write_line_break(u){return this.whitespace=!0,this.indentation=!0,this.line+=1,this.column=0,this.stream.write(u??this.best_line_break,this.encoding)}write_version_directive(u){return this.stream.write(`%YAML ${u}`,this.encoding),this.write_line_break()}write_tag_directive(u,_){return this.stream.write(`%TAG ${u} ${_}`,this.encoding),this.write_line_break()}write_single_quoted(u,_=!0){var a,l,p,m,v,k,y,b,S,T;for(this.write_indicator("'",!0),S=!1,l=!1,T=v=0;v<=u.length;){if(p=u[v],S)(p==null||p!==" ")&&(T+1===v&&this.column>this.best_width&&_&&T!==0&&v!==u.length?this.write_indent():(m=u.slice(T,v),this.column+=m.length,this.stream.write(m,this.encoding)),T=v);else if(l){if(p==null||s.call(`
- `&&this.write_line_break(),b=u.slice(T,v),k=0,y=b.length;k<y;k++)a=b[k],a===`
- `?this.write_line_break():this.write_line_break(a);this.write_indent(),T=v}}else(p==null||s.call(`
- \x85\u2028\u2029`,p)>=0||p==="'")&&T<v&&(m=u.slice(T,v),this.column+=m.length,this.stream.write(m,this.encoding),T=v);p==="'"&&(this.column+=2,this.stream.write("''",this.encoding),T=v+1),p!=null&&(S=p===" ",l=s.call(`
- \x85\u2028\u2029`,p)>=0),v++}return this.write_indicator("'",!1)}write_double_quoted(u,_=!0){var a,l,p,m;for(this.write_indicator('"',!0),m=p=0;p<=u.length;)a=u[p],(a==null||s.call('"\\\x85\u2028\u2029\uFEFF',a)>=0||!(" "<=a&&a<="~"||this.allow_unicode&&("\xA0"<=a&&a<="\uD7FF"||"\uE000"<=a&&a<="\uFFFD")))&&(m<p&&(l=u.slice(m,p),this.column+=l.length,this.stream.write(l,this.encoding),m=p),a!=null&&(l=a in h?"\\"+h[a]:a<="\xFF"?`\\x${i.pad_left(i.to_hex(a),"0",2)}`:a<="\uFFFF"?`\\u${i.pad_left(i.to_hex(a),"0",4)}`:`\\U${i.pad_left(i.to_hex(a),"0",16)}`,this.column+=l.length,this.stream.write(l,this.encoding),m=p+1)),_&&0<p&&p<u.length-1&&(a===" "||m>=p)&&this.column+(p-m)>this.best_width&&(l=`${u.slice(m,p)}\\`,m<p&&(m=p),this.column+=l.length,this.stream.write(l,this.encoding),this.write_indent(),this.whitespace=!1,this.indentation=!1,u[m]===" "&&(l="\\",this.column+=l.length,this.stream.write(l,this.encoding))),p++;return this.write_indicator('"',!1)}write_folded(u){var _,a,l,p,m,v,k,y,b,S,T,D,I;for(v=this.determine_block_hints(u),this.write_indicator(`>${v}`,!0),v.slice(-1)==="+"&&(this.open_ended=!0),this.write_line_break(),y=!0,a=!0,D=!1,I=m=0,T=[];m<=u.length;){if(l=u[m],a){if(l==null||s.call(`
- `&&this.write_line_break(),y=l===" ",S=u.slice(I,m),k=0,b=S.length;k<b;k++)_=S[k],_===`
- `?this.write_line_break():this.write_line_break(_);l!=null&&this.write_indent(),I=m}}else D?l!==" "&&(I+1===m&&this.column>this.best_width?this.write_indent():(p=u.slice(I,m),this.column+=p.length,this.stream.write(p,this.encoding)),I=m):(l==null||s.call(`
- \x85\u2028\u2029`,l)>=0)&&(p=u.slice(I,m),this.column+=p.length,this.stream.write(p,this.encoding),l==null&&this.write_line_break(),I=m);l!=null&&(a=s.call(`
- \x85\u2028\u2029`,l)>=0,D=l===" "),T.push(m++)}return T}write_literal(u){var _,a,l,p,m,v,k,y,b,S,T;for(v=this.determine_block_hints(u),this.write_indicator(`|${v}`,!0),v.slice(-1)==="+"&&(this.open_ended=!0),this.write_line_break(),a=!0,T=m=0,S=[];m<=u.length;){if(l=u[m],a){if(l==null||s.call(`
- `?this.write_line_break():this.write_line_break(_);l!=null&&this.write_indent(),T=m}}else(l==null||s.call(`
- \x85\u2028\u2029`,l)>=0)&&(p=u.slice(T,m),this.stream.write(p,this.encoding),l==null&&this.write_line_break(),T=m);l!=null&&(a=s.call(`
- \x85\u2028\u2029`,l)>=0),S.push(m++)}return S}write_plain(u,_=!0){var a,l,p,m,v,k,y,b,S,T,D;if(u){for(this.root_context&&(this.open_ended=!0),this.whitespace||(m=" ",this.column+=m.length,this.stream.write(m,this.encoding)),this.whitespace=!1,this.indentation=!1,T=!1,l=!1,D=v=0,S=[];v<=u.length;){if(p=u[v],T)p!==" "&&(D+1===v&&this.column>this.best_width&&_?(this.write_indent(),this.whitespace=!1,this.indentation=!1):(m=u.slice(D,v),this.column+=m.length,this.stream.write(m,this.encoding)),D=v);else if(l){if(s.call(`
- `&&this.write_line_break(),b=u.slice(D,v),k=0,y=b.length;k<y;k++)a=b[k],a===`
- `?this.write_line_break():this.write_line_break(a);this.write_indent(),this.whitespace=!1,this.indentation=!1,D=v}}else(p==null||s.call(`
- \x85\u2028\u2029`,p)>=0)&&(m=u.slice(D,v),this.column+=m.length,this.stream.write(m,this.encoding),D=v);p!=null&&(T=p===" ",l=s.call(`
- \x85\u2028\u2029`,p)>=0),S.push(v++)}return S}}determine_block_hints(u){var _,a,l,p,m;return a="",_=u[0],l=u.length-2,m=u[l++],p=u[l++],s.call(`
- \x85\u2028\u2029`,_)>=0&&(a+=this.best_indent),s.call(`
- \x85\u2028\u2029`,p)<0?a+="-":(u.length===1||s.call(`
- \x85\u2028\u2029`,m)>=0)&&(a+="+"),a}flush_stream(){var u;return typeof(u=this.stream).flush=="function"?u.flush():void 0}error(u,_){var a,l;throw _&&(_=(a=_!=null&&(l=_.constructor)!=null?l.name:void 0)!=null?a:i.inspect(_)),new qr.EmitterError(`${u}${_?` ${_}`:""}`)}}return c=`\0
- \x85\u2028\u2029`,o={"!":"!","tag:yaml.org,2002:":"!!"},h={"\0":"0","\x07":"a","\b":"b","
- ":"t","\n":"n","\v":"v","\f":"f","\r":"r","\x1B":"e",'"':'"',"\\":"\\","\x85":"N","\xA0":"_","\u2028":"L","\u2029":"P"},f=d.prototype.initialise,d}).call(this),r=class{constructor(o,h,f,d,g,u,_,a){this.scalar=o,this.empty=h,this.multiline=f,this.allow_flow_plain=d,this.allow_block_plain=g,this.allow_single_quoted=u,this.allow_double_quoted=_,this.allow_block=a}}}).call(qr)});var qi=q(Fi=>{w();(function(){var r,e,t,i;e=Xe(),t=Ue(),i=_e(),{YAMLError:r}=ce(),this.SerializerError=class extends r{},this.Serializer=(function(){var n;class s{constructor(){return n.apply(this,arguments)}initialise({encoding:o,explicit_start:h,explicit_end:f,version:d,tags:g}={}){return this.encoding=o,this.explicit_start=h,this.explicit_end=f,this.version=d,this.tags=g,this.serialized_nodes={},this.anchors={},this.last_anchor_id=0,this.closed=null}open(){if(this.closed===null)return this.emit(new e.StreamStartEvent(this.encoding)),this.closed=!1;throw this.closed?new SerializerError("serializer is closed"):new SerializerError("serializer is already open")}close(){if(this.closed===null)throw new SerializerError("serializer is not opened");if(!this.closed)return this.emit(new e.StreamEndEvent),this.closed=!0}serialize(o){if(this.closed===null)throw new SerializerError("serializer is not opened");if(this.closed)throw new SerializerError("serializer is closed");return o!=null&&(this.emit(new e.DocumentStartEvent(void 0,void 0,this.explicit_start,this.version,this.tags)),this.anchor_node(o),this.serialize_node(o),this.emit(new e.DocumentEndEvent(void 0,void 0,this.explicit_end))),this.serialized_nodes={},this.anchors={},this.last_anchor_id=0}anchor_node(o){var h,f,d,g,u,_,a,l,p,m,v,k,y;if(o.unique_id in this.anchors)return(h=this.anchors)[l=o.unique_id]!=null?h[l]:h[l]=this.generate_anchor(o);if(this.anchors[o.unique_id]=null,o instanceof t.SequenceNode){for(p=o.value,v=[],f=0,_=p.length;f<_;f++)d=p[f],v.push(this.anchor_node(d));return v}else if(o instanceof t.MappingNode){for(m=o.value,k=[],g=0,a=m.length;g<a;g++)[u,y]=m[g],this.anchor_node(u),k.push(this.anchor_node(y));return k}}generate_anchor(o){return`id${i.pad_left(++this.last_anchor_id,"0",4)}`}serialize_node(o,h,f){var d,g,u,_,a,l,p,m,v,k,y,b,S;if(d=this.anchors[o.unique_id],o.unique_id in this.serialized_nodes)return this.emit(new e.AliasEvent(d));if(this.serialized_nodes[o.unique_id]=!0,this.descend_resolver(h,f),o instanceof t.ScalarNode)u=this.resolve(t.ScalarNode,o.value,[!0,!1]),g=this.resolve(t.ScalarNode,o.value,[!1,!0]),a=[o.tag===u,o.tag===g],this.emit(new e.ScalarEvent(d,o.tag,a,o.value,void 0,void 0,o.style));else if(o instanceof t.SequenceNode){for(a=o.tag===this.resolve(t.SequenceNode,o.value,!0),this.emit(new e.SequenceStartEvent(d,o.tag,a,void 0,void 0,o.flow_style)),y=o.value,f=_=0,v=y.length;_<v;f=++_)l=y[f],this.serialize_node(l,o,f);this.emit(new e.SequenceEndEvent)}else if(o instanceof t.MappingNode){for(a=o.tag===this.resolve(t.MappingNode,o.value,!0),this.emit(new e.MappingStartEvent(d,o.tag,a,void 0,void 0,o.flow_style)),b=o.value,p=0,k=b.length;p<k;p++)[m,S]=b[p],this.serialize_node(m,o,null),this.serialize_node(S,o,m);this.emit(new e.MappingEndEvent)}return this.ascend_resolver()}}return n=s.prototype.initialise,s}).call(this)}).call(Fi)});var $i=q($r=>{w();(function(){var r,e,t={}.hasOwnProperty;e=Ue(),{YAMLError:r}=ce(),this.RepresenterError=class extends r{},this.BaseRepresenter=(function(){var i;class n{constructor(){return i.apply(this,arguments)}static add_representer(c,o){return this.prototype.hasOwnProperty("yaml_representers_types")||(this.prototype.yaml_representers_types=[].concat(this.prototype.yaml_representers_types)),this.prototype.hasOwnProperty("yaml_representers_handlers")||(this.prototype.yaml_representers_handlers=[].concat(this.prototype.yaml_representers_handlers)),this.prototype.yaml_representers_types.push(c),this.prototype.yaml_representers_handlers.push(o)}static add_multi_representer(c,o){return this.prototype.hasOwnProperty("yaml_multi_representers_types")||(this.prototype.yaml_multi_representers_types=[].concat(this.prototype.yaml_multi_representers_types)),this.prototype.hasOwnProperty("yaml_multi_representers_handlers")||(this.prototype.yaml_multi_representers_handlers=[].concat(this.prototype.yaml_multi_representers_handlers)),this.prototype.yaml_multi_representers_types.push(c),this.prototype.yaml_multi_representers_handlers.push(o)}initialise({default_style:c,default_flow_style:o}={}){return this.default_style=c,this.default_flow_style=o,this.represented_objects={},this.object_keeper=[],this.alias_key=null}represent(c){var o;return o=this.represent_data(c),this.serialize(o),this.represented_objects={},this.object_keeper=[],this.alias_key=null}represent_data(c){var o,h,f,d,g,u,_;if(this.ignore_aliases(c))this.alias_key=null;else if((h=this.object_keeper.indexOf(c))!==-1){if(this.alias_key=h,this.alias_key in this.represented_objects)return this.represented_objects[this.alias_key]}else this.alias_key=this.object_keeper.length,this.object_keeper.push(c);if(u=null,o=c===null?"null":typeof c,o==="object"&&(o=c.constructor),(h=this.yaml_representers_types.lastIndexOf(o))!==-1&&(u=this.yaml_representers_handlers[h]),u==null){for(g=this.yaml_multi_representers_types,h=f=0,d=g.length;f<d;h=++f)if(_=g[h],c instanceof _){u=this.yaml_multi_representers_handlers[h];break}}return u==null&&((h=this.yaml_multi_representers_types.lastIndexOf(void 0))!==-1?u=this.yaml_multi_representers_handlers[h]:(h=this.yaml_representers_types.lastIndexOf(void 0))!==-1&&(u=this.yaml_representers_handlers[h])),u!=null?u.call(this,c):new e.ScalarNode(null,`${c}`)}represent_scalar(c,o,h=this.default_style){var f;return f=new e.ScalarNode(c,o,null,null,h),this.alias_key!=null&&(this.represented_objects[this.alias_key]=f),f}represent_sequence(c,o,h){var f,d,g,u,_,a,l,p;for(p=[],_=new e.SequenceNode(c,p,null,null,h),this.alias_key!=null&&(this.represented_objects[this.alias_key]=_),f=!0,g=0,u=o.length;g<u;g++)d=o[g],a=this.represent_data(d),a instanceof e.ScalarNode||a.style||(f=!1),p.push(a);return h==null&&(_.flow_style=(l=this.default_flow_style)!=null?l:f),_}represent_mapping(c,o,h){var f,d,g,u,_,a,l,p;p=[],u=new e.MappingNode(c,p,h),this.alias_key&&(this.represented_objects[this.alias_key]=u),f=!0;for(d in o)t.call(o,d)&&(g=o[d],_=this.represent_data(d),a=this.represent_data(g),_ instanceof e.ScalarNode||_.style||(f=!1),a instanceof e.ScalarNode||a.style||(f=!1),p.push([_,a]));return h||(u.flow_style=(l=this.default_flow_style)!=null?l:f),u}ignore_aliases(c){return!1}}return n.prototype.yaml_representers_types=[],n.prototype.yaml_representers_handlers=[],n.prototype.yaml_multi_representers_types=[],n.prototype.yaml_multi_representers_handlers=[],i=n.prototype.initialise,n}).call(this),this.Representer=class extends this.BaseRepresenter{represent_boolean(n){return this.represent_scalar("tag:yaml.org,2002:bool",n?"true":"false")}represent_null(n){return this.represent_scalar("tag:yaml.org,2002:null","null")}represent_number(n){var s,c;return s=`tag:yaml.org,2002:${n%1===0?"int":"float"}`,c=n!==n?".nan":n===1/0?".inf":n===-1/0?"-.inf":n.toString(),this.represent_scalar(s,c)}represent_string(n){return this.represent_scalar("tag:yaml.org,2002:str",n)}represent_array(n){return this.represent_sequence("tag:yaml.org,2002:seq",n)}represent_date(n){return this.represent_scalar("tag:yaml.org,2002:timestamp",n.toISOString())}represent_object(n){return this.represent_mapping("tag:yaml.org,2002:map",n)}represent_undefined(n){throw new $r.RepresenterError(`cannot represent an onbject: ${n}`)}ignore_aliases(n){var s;return n==null||(s=typeof n)=="boolean"||s==="number"||s==="string"}},this.Representer.add_representer("boolean",this.Representer.prototype.represent_boolean),this.Representer.add_representer("null",this.Representer.prototype.represent_null),this.Representer.add_representer("number",this.Representer.prototype.represent_number),this.Representer.add_representer("string",this.Representer.prototype.represent_string),this.Representer.add_representer(Array,this.Representer.prototype.represent_array),this.Representer.add_representer(Date,this.Representer.prototype.represent_date),this.Representer.add_representer(Object,this.Representer.prototype.represent_object),this.Representer.add_representer(null,this.Representer.prototype.represent_undefined)}).call($r)});var Mt=q(ji=>{w();(function(){var r,e,t,i=[].indexOf;e=Ue(),t=_e(),{YAMLError:r}=ce(),this.ResolverError=class extends r{},this.BaseResolver=(function(){var n,s,c,o;class h{constructor(){return o.apply(this,arguments)}static add_implicit_resolver(d,g,u=[null]){var _,a,l,p,m;for(this.prototype.hasOwnProperty("yaml_implicit_resolvers")||(this.prototype.yaml_implicit_resolvers=t.extend({},this.prototype.yaml_implicit_resolvers)),m=[],l=0,p=u.length;l<p;l++)a=u[l],m.push(((_=this.prototype.yaml_implicit_resolvers)[a]!=null?_[a]:_[a]=[]).push([d,g]));return m}initialise(){return this.resolver_exact_paths=[],this.resolver_prefix_paths=[]}descend_resolver(d,g){var u,_,a,l,p,m,v,k,y,b,S;if(!t.is_empty(this.yaml_path_resolvers)){if(_={},y=[],d)for(u=this.resolver_prefix_paths.length,b=this.resolver_prefix_paths.slice(-1)[0],a=0,m=b.length;a<m;a++)[k,p]=b[a],this.check_resolver_prefix(u,k,p,d,g)&&(k.length>u?y.push([k,p]):_[p]=this.yaml_path_resolvers[k][p]);else for(S=this.yaml_path_resolvers,l=0,v=S.length;l<v;l++)[k,p]=S[l],k?y.push([k,p]):_[p]=this.yaml_path_resolvers[k][p];return this.resolver_exact_paths.push(_),this.resolver_prefix_paths.push(y)}}ascend_resolver(){if(!t.is_empty(this.yaml_path_resolvers))return this.resolver_exact_paths.pop(),this.resolver_prefix_paths.pop()}check_resolver_prefix(d,g,u,_,a){var l,p;if([p,l]=g[d-1],typeof p=="string"){if(_.tag!==p)return}else if(p!==null&&!(_ instanceof p))return;if(!(l===!0&&a!==null)&&!((l===!1||l===null)&&a===null)){if(typeof l=="string"){if(!(a instanceof e.ScalarNode)&&l===a.value)return}else if(typeof l=="number"&&l!==a)return;return!0}}resolve(d,g,u){var _,a,l,p,m,v,k,y,b,S,T;if(d===e.ScalarNode&&u[0]){for(g===""?S=(v=this.yaml_implicit_resolvers[""])!=null?v:[]:S=(k=this.yaml_implicit_resolvers[g[0]])!=null?k:[],S=S.concat((y=this.yaml_implicit_resolvers[null])!=null?y:[]),l=0,m=S.length;l<m;l++)if([T,b]=S[l],g.match(b))return T;u=u[1]}_=!0;for(p in this.yaml_path_resolvers)({})[p]==null&&(_=!1);if(!_){if(a=this.resolver_exact_paths.slice(-1)[0],i.call(a,d)>=0)return a[d];if(i.call(a,null)>=0)return a[null]}if(d===e.ScalarNode)return s;if(d===e.SequenceNode)return c;if(d===e.MappingNode)return n}}return s="tag:yaml.org,2002:str",c="tag:yaml.org,2002:seq",n="tag:yaml.org,2002:map",h.prototype.yaml_implicit_resolvers={},h.prototype.yaml_path_resolvers={},o=h.prototype.initialise,h}).call(this),this.Resolver=class extends this.BaseResolver{},this.Resolver.add_implicit_resolver("tag:yaml.org,2002:bool",/^(?:yes|Yes|YES|true|True|TRUE|on|On|ON|no|No|NO|false|False|FALSE|off|Off|OFF)$/,"yYnNtTfFoO"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:float",/^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)?|\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,"-+0123456789."),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:int",/^(?:[-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[0-9a-fA-F_]+|[-+]?0o[0-7_]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$/,"-+0123456789"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:merge",/^(?:<<)$/,"<"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:null",/^(?:~|null|Null|NULL|)$/,["~","n","N",""]),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:timestamp",/^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9][0-9]?-[0-9][0-9]?(?:[Tt]|[\x20\t]+)[0-9][0-9]?:[0-9][0-9]:[0-9][0-9](?:\.[0-9]*)?(?:[\x20\t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$/,"0123456789"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:value",/^(?:=)$/,"="),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:yaml",/^(?:!|&|\*)$/,"!&*")}).call(ji)});var Bi=q(zi=>{w();(function(){var r,e,t,i,n;n=_e(),r=Oi(),i=qi(),e=$i(),t=Mt(),this.make_dumper=function(s=r.Emitter,c=i.Serializer,o=e.Representer,h=t.Resolver){var f,d;return d=[s,c,o,h],f=(function(){var g;class u{constructor(a,l={}){var p,m,v;for(d[0].prototype.initialise.call(this,a,l),v=d.slice(1),p=0,m=v.length;p<m;p++)g=v[p],g.prototype.initialise.call(this,l)}}return n.extend(u.prototype,...(function(){var _,a,l;for(l=[],_=0,a=d.length;_<a;_++)g=d[_],l.push(g.prototype);return l})()),u}).call(this)},this.Dumper=this.make_dumper()}).call(zi)});var zr=q(jr=>{w();(function(){var r,e,t=[].indexOf;({Mark:r,YAMLError:e}=ce()),this.ReaderError=class extends e{constructor(n,s,c){super(),this.position=n,this.character=s,this.reason=c}toString(){return`unacceptable character #${this.character.charCodeAt(0).toString(16)}: ${this.reason}
- position ${this.position}`}},this.Reader=(function(){var i,n;class s{constructor(){return n.apply(this,arguments)}initialise(o){return this.string=o,this.line=0,this.column=0,this.index=0,this.check_printable(),this.string+="\0"}peek(o=0){return this.string[this.index+o]}prefix(o=1){return this.string.slice(this.index,this.index+o)}forward(o=1){var h,f;for(f=[];o;)h=this.string[this.index],this.index++,t.call(`
- `?(this.line++,this.column=0):this.column++,f.push(o--);return f}get_mark(){return new r(this.line,this.column,this.string,this.index)}check_printable(){var o,h,f;if(h=i.exec(this.string),h)throw o=h[0],f=this.string.length-this.index+h.index,new jr.ReaderError(f,o,"special characters are not allowed")}}return i=/[^\x09\x0A\x0D\x20-\x7E\x85\xA0-\uFFFD]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,n=s.prototype.initialise,s}).call(this)}).call(jr)});var Nt=q(Gi=>{w();(function(){this.Token=class{constructor(e,t){this.start_mark=e,this.end_mark=t}},this.DirectiveToken=(function(){class r extends this.Token{constructor(t,i,n,s){super(n,s),this.name=t,this.value=i}}return r.prototype.id="<directive>",r}).call(this),this.DocumentStartToken=(function(){class r extends this.Token{}return r.prototype.id="<document start>",r}).call(this),this.DocumentEndToken=(function(){class r extends this.Token{}return r.prototype.id="<document end>",r}).call(this),this.StreamStartToken=(function(){class r extends this.Token{constructor(t,i,n){super(t,i),this.encoding=n}}return r.prototype.id="<stream start>",r}).call(this),this.StreamEndToken=(function(){class r extends this.Token{}return r.prototype.id="<stream end>",r}).call(this),this.BlockSequenceStartToken=(function(){class r extends this.Token{}return r.prototype.id="<block sequence start>",r}).call(this),this.BlockMappingStartToken=(function(){class r extends this.Token{}return r.prototype.id="<block mapping end>",r}).call(this),this.BlockEndToken=(function(){class r extends this.Token{}return r.prototype.id="<block end>",r}).call(this),this.FlowSequenceStartToken=(function(){class r extends this.Token{}return r.prototype.id="[",r}).call(this),this.FlowMappingStartToken=(function(){class r extends this.Token{}return r.prototype.id="{",r}).call(this),this.FlowSequenceEndToken=(function(){class r extends this.Token{}return r.prototype.id="]",r}).call(this),this.FlowMappingEndToken=(function(){class r extends this.Token{}return r.prototype.id="}",r}).call(this),this.KeyToken=(function(){class r extends this.Token{}return r.prototype.id="?",r}).call(this),this.ValueToken=(function(){class r extends this.Token{}return r.prototype.id=":",r}).call(this),this.BlockEntryToken=(function(){class r extends this.Token{}return r.prototype.id="-",r}).call(this),this.FlowEntryToken=(function(){class r extends this.Token{}return r.prototype.id=",",r}).call(this),this.AliasToken=(function(){class r extends this.Token{constructor(t,i,n){super(i,n),this.value=t}}return r.prototype.id="<alias>",r}).call(this),this.AnchorToken=(function(){class r extends this.Token{constructor(t,i,n){super(i,n),this.value=t}}return r.prototype.id="<anchor>",r}).call(this),this.TagToken=(function(){class r extends this.Token{constructor(t,i,n){super(i,n),this.value=t}}return r.prototype.id="<tag>",r}).call(this),this.ScalarToken=(function(){class r extends this.Token{constructor(t,i,n,s,c){super(n,s),this.value=t,this.plain=i,this.style=c}}return r.prototype.id="<scalar>",r}).call(this)}).call(Gi)});var Br=q(P=>{w();(function(){var r,e,t,i,n={}.hasOwnProperty,s=[].indexOf;({MarkedYAMLError:r}=ce()),t=Nt(),i=_e(),this.ScannerError=class extends r{},e=class{constructor(o,h,f,d,g,u){this.token_number=o,this.required=h,this.index=f,this.line=d,this.column=g,this.mark=u}},this.Scanner=(function(){var c,o,h,f,d,g;class u{constructor(){return g.apply(this,arguments)}initialise(){return this.done=!1,this.flow_level=0,this.tokens=[],this.fetch_stream_start(),this.tokens_taken=0,this.indent=-1,this.indents=[],this.allow_simple_key=!0,this.possible_simple_keys={}}check_token(...a){for(var l,p,m;this.need_more_tokens();)this.fetch_more_tokens();if(this.tokens.length!==0){if(a.length===0)return!0;for(p=0,m=a.length;p<m;p++)if(l=a[p],this.tokens[0]instanceof l)return!0}return!1}peek_token(){for(;this.need_more_tokens();)this.fetch_more_tokens();if(this.tokens.length!==0)return this.tokens[0]}get_token(){for(;this.need_more_tokens();)this.fetch_more_tokens();if(this.tokens.length!==0)return this.tokens_taken++,this.tokens.shift()}need_more_tokens(){return this.done?!1:this.tokens.length===0||(this.stale_possible_simple_keys(),this.next_possible_simple_key()===this.tokens_taken)}fetch_more_tokens(){var a;if(this.scan_to_next_token(),this.stale_possible_simple_keys(),this.unwind_indent(this.column),a=this.peek(),a==="\0")return this.fetch_stream_end();if(a==="%"&&this.check_directive())return this.fetch_directive();if(a==="-"&&this.check_document_start())return this.fetch_document_start();if(a==="."&&this.check_document_end())return this.fetch_document_end();if(a==="[")return this.fetch_flow_sequence_start();if(a==="{")return this.fetch_flow_mapping_start();if(a==="]")return this.fetch_flow_sequence_end();if(a==="}")return this.fetch_flow_mapping_end();if(a===",")return this.fetch_flow_entry();if(a==="-"&&this.check_block_entry())return this.fetch_block_entry();if(a==="?"&&this.check_key())return this.fetch_key();if(a===":"&&this.check_value())return this.fetch_value();if(a==="*")return this.fetch_alias();if(a==="&")return this.fetch_anchor();if(a==="!")return this.fetch_tag();if(a==="|"&&this.flow_level===0)return this.fetch_literal();if(a===">"&&this.flow_level===0)return this.fetch_folded();if(a==="'")return this.fetch_single();if(a==='"')return this.fetch_double();if(this.check_plain())return this.fetch_plain();throw new P.ScannerError("while scanning for the next token",null,`found character ${a} that cannot start any token`,this.get_mark())}next_possible_simple_key(){var a,l,p,m;p=null,m=this.possible_simple_keys;for(l in m)n.call(m,l)&&(a=m[l],(p===null||a.token_number<p)&&(p=a.token_number));return p}stale_possible_simple_keys(){var a,l,p,m;p=this.possible_simple_keys,m=[];for(l in p)if(n.call(p,l)&&(a=p[l],!(a.line===this.line&&this.index-a.index<=1024)))if(!a.required)m.push(delete this.possible_simple_keys[l]);else throw new P.ScannerError("while scanning a simple key",a.mark,"could not find expected ':'",this.get_mark());return m}save_possible_simple_key(){var a,l;if(a=this.flow_level===0&&this.indent===this.column,a&&!this.allow_simple_key)throw new Error("logic failure");if(this.allow_simple_key)return this.remove_possible_simple_key(),l=this.tokens_taken+this.tokens.length,this.possible_simple_keys[this.flow_level]=new e(l,a,this.index,this.line,this.column,this.get_mark())}remove_possible_simple_key(){var a;if(a=this.possible_simple_keys[this.flow_level]){if(a.required)throw new P.ScannerError("while scanning a simple key",a.mark,"could not find expected ':'",this.get_mark());return delete this.possible_simple_keys[this.flow_level]}}unwind_indent(a){var l,p;if(this.flow_level===0){for(p=[];this.indent>a;)l=this.get_mark(),this.indent=this.indents.pop(),p.push(this.tokens.push(new t.BlockEndToken(l,l)));return p}}add_indent(a){return a>this.indent?(this.indents.push(this.indent),this.indent=a,!0):!1}fetch_stream_start(){var a;return a=this.get_mark(),this.tokens.push(new t.StreamStartToken(a,a,this.encoding))}fetch_stream_end(){var a;return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_possible_simple_key=!1,this.possible_simple_keys={},a=this.get_mark(),this.tokens.push(new t.StreamEndToken(a,a)),this.done=!0}fetch_directive(){return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_directive())}fetch_document_start(){return this.fetch_document_indicator(t.DocumentStartToken)}fetch_document_end(){return this.fetch_document_indicator(t.DocumentEndToken)}fetch_document_indicator(a){var l;return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_simple_key=!1,l=this.get_mark(),this.forward(3),this.tokens.push(new a(l,this.get_mark()))}fetch_flow_sequence_start(){return this.fetch_flow_collection_start(t.FlowSequenceStartToken)}fetch_flow_mapping_start(){return this.fetch_flow_collection_start(t.FlowMappingStartToken)}fetch_flow_collection_start(a){var l;return this.save_possible_simple_key(),this.flow_level++,this.allow_simple_key=!0,l=this.get_mark(),this.forward(),this.tokens.push(new a(l,this.get_mark()))}fetch_flow_sequence_end(){return this.fetch_flow_collection_end(t.FlowSequenceEndToken)}fetch_flow_mapping_end(){return this.fetch_flow_collection_end(t.FlowMappingEndToken)}fetch_flow_collection_end(a){var l;return this.remove_possible_simple_key(),this.flow_level--,this.allow_simple_key=!1,l=this.get_mark(),this.forward(),this.tokens.push(new a(l,this.get_mark()))}fetch_flow_entry(){var a;return this.allow_simple_key=!0,this.remove_possible_simple_key(),a=this.get_mark(),this.forward(),this.tokens.push(new t.FlowEntryToken(a,this.get_mark()))}fetch_block_entry(){var a,l;if(this.flow_level===0){if(!this.allow_simple_key)throw new P.ScannerError(null,null,"sequence entries are not allowed here",this.get_mark());this.add_indent(this.column)&&(a=this.get_mark(),this.tokens.push(new t.BlockSequenceStartToken(a,a)))}return this.allow_simple_key=!0,this.remove_possible_simple_key(),l=this.get_mark(),this.forward(),this.tokens.push(new t.BlockEntryToken(l,this.get_mark()))}fetch_key(){var a,l;if(this.flow_level===0){if(!this.allow_simple_key)throw new P.ScannerError(null,null,"mapping keys are not allowed here",this.get_mark());this.add_indent(this.column)&&(a=this.get_mark(),this.tokens.push(new t.BlockMappingStartToken(a,a)))}return this.allow_simple_key=!this.flow_level,this.remove_possible_simple_key(),l=this.get_mark(),this.forward(),this.tokens.push(new t.KeyToken(l,this.get_mark()))}fetch_value(){var a,l,p;if(a=this.possible_simple_keys[this.flow_level])delete this.possible_simple_keys[this.flow_level],this.tokens.splice(a.token_number-this.tokens_taken,0,new t.KeyToken(a.mark,a.mark)),this.flow_level===0&&this.add_indent(a.column)&&this.tokens.splice(a.token_number-this.tokens_taken,0,new t.BlockMappingStartToken(a.mark,a.mark)),this.allow_simple_key=!1;else{if(this.flow_level===0){if(!this.allow_simple_key)throw new P.ScannerError(null,null,"mapping values are not allowed here",this.get_mark());this.add_indent(this.column)&&(l=this.get_mark(),this.tokens.push(new t.BlockMappingStartToken(l,l)))}this.allow_simple_key=!this.flow_level,this.remove_possible_simple_key()}return p=this.get_mark(),this.forward(),this.tokens.push(new t.ValueToken(p,this.get_mark()))}fetch_alias(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_anchor(t.AliasToken))}fetch_anchor(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_anchor(t.AnchorToken))}fetch_tag(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_tag())}fetch_literal(){return this.fetch_block_scalar("|")}fetch_folded(){return this.fetch_block_scalar(">")}fetch_block_scalar(a){return this.allow_simple_key=!0,this.remove_possible_simple_key(),this.tokens.push(this.scan_block_scalar(a))}fetch_single(){return this.fetch_flow_scalar("'")}fetch_double(){return this.fetch_flow_scalar('"')}fetch_flow_scalar(a){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_flow_scalar(a))}fetch_plain(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_plain())}check_directive(){return this.column===0}check_document_start(){var a;return this.column===0&&this.prefix(3)==="---"&&(a=this.peek(3),s.call(c+h+"\0",a)>=0)}check_document_end(){var a;return this.column===0&&this.prefix(3)==="..."&&(a=this.peek(3),s.call(c+h+"\0",a)>=0)}check_block_entry(){var a;return a=this.peek(1),s.call(c+h+"\0",a)>=0}check_key(){var a;return this.flow_level!==0?!0:(a=this.peek(1),s.call(c+h+"\0",a)>=0)}check_value(){var a;return this.flow_level!==0?!0:(a=this.peek(1),s.call(c+h+"\0",a)>=0)}check_plain(){var a,l;return a=this.peek(),s.call(c+h+"\0-?:,[]{}#&*!|>'\"%@`",a)<0||(l=this.peek(1),s.call(c+h+"\0",l)<0&&(a==="-"||this.flow_level===0&&s.call("?:",a)>=0))}scan_to_next_token(){var a,l,p;for(this.index===0&&this.peek()==="\uFEFF"&&this.forward(),a=!1,p=[];!a;){for(;this.peek()===" ";)this.forward();if(this.peek()==="#")for(;l=this.peek(),s.call(c+"\0",l)<0;)this.forward();this.scan_line_break()?this.flow_level===0?p.push(this.allow_simple_key=!0):p.push(void 0):p.push(a=!0)}return p}scan_directive(){var a,l,p,m,v;if(m=this.get_mark(),this.forward(),l=this.scan_directive_name(m),v=null,l==="YAML")v=this.scan_yaml_directive_value(m),a=this.get_mark();else if(l==="TAG")v=this.scan_tag_directive_value(m),a=this.get_mark();else for(a=this.get_mark();p=this.peek(),s.call(c+"\0",p)<0;)this.forward();return this.scan_directive_ignored_line(m),new t.DirectiveToken(l,v,m,a)}scan_directive_name(a){var l,p,m;for(p=0,l=this.peek(p);"0"<=l&&l<="9"||"A"<=l&&l<="Z"||"a"<=l&&l<="z"||s.call("-_",l)>=0;)p++,l=this.peek(p);if(p===0)throw new P.ScannerError("while scanning a directive",a,`expected alphanumeric or numeric character but found ${l}`,this.get_mark());if(m=this.prefix(p),this.forward(p),l=this.peek(),s.call(c+"\0 ",l)<0)throw new P.ScannerError("while scanning a directive",a,`expected alphanumeric or numeric character but found ${l}`,this.get_mark());return m}scan_yaml_directive_value(a){for(var l,p,m;this.peek()===" ";)this.forward();if(l=this.scan_yaml_directive_number(a),this.peek()!==".")throw new P.ScannerError("while scanning a directive",a,`expected a digit or '.' but found ${this.peek()}`,this.get_mark());if(this.forward(),p=this.scan_yaml_directive_number(a),m=this.peek(),s.call(c+"\0 ",m)<0)throw new P.ScannerError("while scanning a directive",a,`expected a digit or ' ' but found ${this.peek()}`,this.get_mark());return[l,p]}scan_yaml_directive_number(a){var l,p,m,v;if(l=this.peek(),!("0"<=l&&l<="9"))throw new P.ScannerError("while scanning a directive",a,`expected a digit but found ${l}`,this.get_mark());for(p=0;"0"<=(m=this.peek(p))&&m<="9";)p++;return v=parseInt(this.prefix(p)),this.forward(p),v}scan_tag_directive_value(a){for(var l,p;this.peek()===" ";)this.forward();for(l=this.scan_tag_directive_handle(a);this.peek()===" ";)this.forward();return p=this.scan_tag_directive_prefix(a),[l,p]}scan_tag_directive_handle(a){var l,p;if(p=this.scan_tag_handle("directive",a),l=this.peek(),l!==" ")throw new P.ScannerError("while scanning a directive",a,`expected ' ' but found ${l}`,this.get_mark());return p}scan_tag_directive_prefix(a){var l,p;if(p=this.scan_tag_uri("directive",a),l=this.peek(),s.call(c+"\0 ",l)<0)throw new P.ScannerError("while scanning a directive",a,`expected ' ' but found ${l}`,this.get_mark());return p}scan_directive_ignored_line(a){for(var l,p;this.peek()===" ";)this.forward();if(this.peek()==="#")for(;p=this.peek(),s.call(c+"\0",p)<0;)this.forward();if(l=this.peek(),s.call(c+"\0",l)<0)throw new P.ScannerError("while scanning a directive",a,`expected a comment or a line break but found ${l}`,this.get_mark());return this.scan_line_break()}scan_anchor(a){var l,p,m,v,k,y;for(k=this.get_mark(),p=this.peek(),p==="*"?v="alias":v="anchor",this.forward(),m=0,l=this.peek(m);"0"<=l&&l<="9"||"A"<=l&&l<="Z"||"a"<=l&&l<="z"||s.call("-_",l)>=0;)m++,l=this.peek(m);if(m===0)throw new P.ScannerError(`while scanning an ${v}`,k,`expected alphabetic or numeric character but found '${l}'`,this.get_mark());if(y=this.prefix(m),this.forward(m),l=this.peek(),s.call(c+h+"\0?:,]}%@`",l)<0)throw new P.ScannerError(`while scanning an ${v}`,k,`expected alphabetic or numeric character but found '${l}'`,this.get_mark());return new a(y,k,this.get_mark())}scan_tag(){var a,l,p,m,v,k;if(m=this.get_mark(),a=this.peek(1),a==="<"){if(l=null,this.forward(2),v=this.scan_tag_uri("tag",m),this.peek()!==">")throw new P.ScannerError("while parsing a tag",m,`expected '>' but found ${this.peek()}`,this.get_mark());this.forward()}else if(s.call(c+h+"\0",a)>=0)l=null,v="!",this.forward();else{for(p=1,k=!1;s.call(c+"\0 ",a)<0;){if(a==="!"){k=!0;break}p++,a=this.peek(p)}k?l=this.scan_tag_handle("tag",m):(l="!",this.forward()),v=this.scan_tag_uri("tag",m)}if(a=this.peek(),s.call(c+"\0 ",a)<0)throw new P.ScannerError("while scanning a tag",m,`expected ' ' but found ${a}`,this.get_mark());return new t.TagToken([l,v],m,this.get_mark())}scan_block_scalar(a){var l,p,m,v,k,y,b,S,T,D,I,C,M,Y,we,Q;for(k=a===">",m=[],Q=this.get_mark(),this.forward(),[p,y]=this.scan_block_scalar_indicators(Q),this.scan_block_scalar_ignored_line(Q),C=this.indent+1,C<1&&(C=1),y==null?([l,I,v]=this.scan_block_scalar_indentation(),b=Math.max(C,I)):(b=C+y-1,[l,v]=this.scan_block_scalar_breaks(b)),D="";this.column===b&&this.peek()!=="\0";){for(m=m.concat(l),S=(M=this.peek(),s.call("
- ",M)<0),T=0;Y=this.peek(T),s.call(c+"\0",Y)<0;)T++;if(m.push(this.prefix(T)),this.forward(T),D=this.scan_line_break(),[l,v]=this.scan_block_scalar_breaks(b),this.column===b&&this.peek()!=="\0")k&&D===`
- `&&S&&(we=this.peek(),s.call("
- ",we)<0)?i.is_empty(l)&&m.push(" "):m.push(D);else break}return p!==!1&&m.push(D),p===!0&&(m=m.concat(l)),new t.ScalarToken(m.join(""),!1,Q,v,a)}scan_block_scalar_indicators(a){var l,p,m;if(p=null,m=null,l=this.peek(),s.call("+-",l)>=0){if(p=l==="+",this.forward(),l=this.peek(),s.call(o,l)>=0){if(m=parseInt(l),m===0)throw new P.ScannerError("while scanning a block scalar",a,"expected indentation indicator in the range 1-9 but found 0",this.get_mark());this.forward()}}else if(s.call(o,l)>=0){if(m=parseInt(l),m===0)throw new P.ScannerError("while scanning a block scalar",a,"expected indentation indicator in the range 1-9 but found 0",this.get_mark());this.forward(),l=this.peek(),s.call("+-",l)>=0&&(p=l==="+",this.forward())}if(l=this.peek(),s.call(c+"\0 ",l)<0)throw new P.ScannerError("while scanning a block scalar",a,`expected chomping or indentation indicators, but found ${l}`,this.get_mark());return[p,m]}scan_block_scalar_ignored_line(a){for(var l,p;this.peek()===" ";)this.forward();if(this.peek()==="#")for(;p=this.peek(),s.call(c+"\0",p)<0;)this.forward();if(l=this.peek(),s.call(c+"\0",l)<0)throw new P.ScannerError("while scanning a block scalar",a,`expected a comment or a line break but found ${l}`,this.get_mark());return this.scan_line_break()}scan_block_scalar_indentation(){var a,l,p,m;for(a=[],p=0,l=this.get_mark();m=this.peek(),s.call(c+" ",m)>=0;)this.peek()!==" "?(a.push(this.scan_line_break()),l=this.get_mark()):(this.forward(),this.column>p&&(p=this.column));return[a,p,l]}scan_block_scalar_breaks(a){var l,p,m;for(l=[],p=this.get_mark();this.column<a&&this.peek()===" ";)this.forward();for(;m=this.peek(),s.call(c,m)>=0;)for(l.push(this.scan_line_break()),p=this.get_mark();this.column<a&&this.peek()===" ";)this.forward();return[l,p]}scan_flow_scalar(a){var l,p,m,v;for(p=a==='"',l=[],v=this.get_mark(),m=this.peek(),this.forward(),l=l.concat(this.scan_flow_scalar_non_spaces(p,v));this.peek()!==m;)l=l.concat(this.scan_flow_scalar_spaces(p,v)),l=l.concat(this.scan_flow_scalar_non_spaces(p,v));return this.forward(),new t.ScalarToken(l.join(""),!1,v,this.get_mark(),a)}scan_flow_scalar_non_spaces(a,l){var p,m,v,k,y,b,S,T,D;for(m=[];;){for(b=0;S=this.peek(b),s.call(c+h+`'"\\\0`,S)<0;)b++;if(b!==0&&(m.push(this.prefix(b)),this.forward(b)),p=this.peek(),!a&&p==="'"&&this.peek(1)==="'")m.push("'"),this.forward(2);else if(a&&p==="'"||!a&&s.call('"\\',p)>=0)m.push(p),this.forward();else if(a&&p==="\\")if(this.forward(),p=this.peek(),p in d)m.push(d[p]),this.forward();else if(p in f){for(b=f[p],this.forward(),y=k=0,T=b;0<=T?k<T:k>T;y=0<=T?++k:--k)if(D=this.peek(y),s.call(`${o}ABCDEFabcdef`,D)<0)throw new P.ScannerError("while scanning a double-quoted scalar",l,`expected escape sequence of ${b} hexadecimal numbers, but found ${this.peek(y)}`,this.get_mark());v=parseInt(this.prefix(b),16),m.push(String.fromCharCode(v)),this.forward(b)}else if(s.call(c,p)>=0)this.scan_line_break(),m=m.concat(this.scan_flow_scalar_breaks(a,l));else throw new P.ScannerError("while scanning a double-quoted scalar",l,`found unknown escape character ${p}`,this.get_mark());else return m}}scan_flow_scalar_spaces(a,l){var p,m,v,k,y,b,S;for(v=[],k=0;b=this.peek(k),s.call(h,b)>=0;)k++;if(S=this.prefix(k),this.forward(k),m=this.peek(),m==="\0")throw new P.ScannerError("while scanning a quoted scalar",l,"found unexpected end of stream",this.get_mark());return s.call(c,m)>=0?(y=this.scan_line_break(),p=this.scan_flow_scalar_breaks(a,l),y!==`
- `?v.push(y):p.length===0&&v.push(" "),v=v.concat(p)):v.push(S),v}scan_flow_scalar_breaks(a,l){var p,m,v,k,y;for(p=[];;){if(m=this.prefix(3),m==="---"||m==="..."&&(v=this.peek(3),s.call(c+h+"\0",v)>=0))throw new P.ScannerError("while scanning a quoted scalar",l,"found unexpected document separator",this.get_mark());for(;k=this.peek(),s.call(h,k)>=0;)this.forward();if(y=this.peek(),s.call(c,y)>=0)p.push(this.scan_line_break());else return p}}scan_plain(){var a,l,p,m,v,k,y,b,S;for(l=[],S=p=this.get_mark(),m=this.indent+1,b=[];v=0,this.peek()!=="#";){for(;a=this.peek(v),!(s.call(c+h+"\0",a)>=0||this.flow_level===0&&a===":"&&(k=this.peek(v+1),s.call(c+h+"\0",k)>=0)||this.flow_level!==0&&s.call(",:?[]{}",a)>=0);)v++;if(this.flow_level!==0&&a===":"&&(y=this.peek(v+1),s.call(c+h+"\0,[]{}",y)<0))throw this.forward(v),new P.ScannerError("while scanning a plain scalar",S,"found unexpected ':'",this.get_mark(),"Please check http://pyyaml.org/wiki/YAMLColonInFlowContext");if(v===0||(this.allow_simple_key=!1,l=l.concat(b),l.push(this.prefix(v)),this.forward(v),p=this.get_mark(),b=this.scan_plain_spaces(m,S),b==null||b.length===0||this.peek()==="#"||this.flow_level===0&&this.column<m))break}return new t.ScalarToken(l.join(""),!0,S,p)}scan_plain_spaces(a,l){var p,m,v,k,y,b,S,T,D,I,C;for(v=[],k=0;S=this.peek(k),s.call(" ",S)>=0;)k++;if(C=this.prefix(k),this.forward(k),m=this.peek(),s.call(c,m)>=0){if(y=this.scan_line_break(),this.allow_simple_key=!0,b=this.prefix(3),b==="---"||b==="..."&&(T=this.peek(3),s.call(c+h+"\0",T)>=0))return;for(p=[];I=this.peek(),s.call(c+" ",I)>=0;)if(this.peek()===" ")this.forward();else if(p.push(this.scan_line_break()),b=this.prefix(3),b==="---"||b==="..."&&(D=this.peek(3),s.call(c+h+"\0",D)>=0))return;y!==`
- `?v.push(y):p.length===0&&v.push(" "),v=v.concat(p)}else C&&v.push(C);return v}scan_tag_handle(a,l){var p,m,v;if(p=this.peek(),p!=="!")throw new P.ScannerError(`while scanning a ${a}`,l,`expected '!' but found ${p}`,this.get_mark());if(m=1,p=this.peek(m),p!==" "){for(;"0"<=p&&p<="9"||"A"<=p&&p<="Z"||"a"<=p&&p<="z"||s.call("-_",p)>=0;)m++,p=this.peek(m);if(p!=="!")throw this.forward(m),new P.ScannerError(`while scanning a ${a}`,l,`expected '!' but found ${p}`,this.get_mark());m++}return v=this.prefix(m),this.forward(m),v}scan_tag_uri(a,l){var p,m,v;for(m=[],v=0,p=this.peek(v);"0"<=p&&p<="9"||"A"<=p&&p<="Z"||"a"<=p&&p<="z"||s.call("-;/?:@&=+$,_.!~*'()[]%",p)>=0;)p==="%"?(m.push(this.prefix(v)),this.forward(v),v=0,m.push(this.scan_uri_escapes(a,l))):v++,p=this.peek(v);if(v!==0&&(m.push(this.prefix(v)),this.forward(v),v=0),m.length===0)throw new P.ScannerError(`while parsing a ${a}`,l,`expected URI but found ${p}`,this.get_mark());return m.join("")}scan_uri_escapes(a,l){var p,m,v,k;for(p=[],k=this.get_mark();this.peek()==="%";){for(this.forward(),v=m=0;m<=2;v=++m)throw new P.ScannerError(`while scanning a ${a}`,l,`expected URI escape sequence of 2 hexadecimal numbers but found ${this.peek(v)}`,this.get_mark());p.push(String.fromCharCode(parseInt(this.prefix(2),16))),this.forward(2)}return p.join("")}scan_line_break(){var a;return a=this.peek(),s.call(`\r
- `?this.forward(2):this.forward(),`
- `):s.call("\u2028\u2029",a)>=0?(this.forward(),a):""}}return c=`\r
- `,v:"\v",f:"\f",r:"\r",e:"\x1B"," ":" ",'"':'"',"\\":"\\",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"},f={x:2,u:4,U:8},g=u.prototype.initialise,u}).call(this)}).call(P)});var Gr=q(re=>{w();(function(){var r,e,t,i={}.hasOwnProperty;e=Xe(),{MarkedYAMLError:r}=ce(),t=Nt(),this.ParserError=class extends r{},this.Parser=(function(){var n,s;class c{constructor(){return s.apply(this,arguments)}initialise(){return this.current_event=null,this.yaml_version=null,this.tag_handles={},this.states=[],this.marks=[],this.state="parse_stream_start"}dispose(){return this.states=[],this.state=null}check_event(...h){var f,d,g;if(this.current_event===null&&this.state!=null&&(this.current_event=this[this.state]()),this.current_event!==null){if(h.length===0)return!0;for(d=0,g=h.length;d<g;d++)if(f=h[d],this.current_event instanceof f)return!0}return!1}peek_event(){return this.current_event===null&&this.state!=null&&(this.current_event=this[this.state]()),this.current_event}get_event(){var h;return this.current_event===null&&this.state!=null&&(this.current_event=this[this.state]()),h=this.current_event,this.current_event=null,h}parse_stream_start(){var h,f;return f=this.get_token(),h=new e.StreamStartEvent(f.start_mark,f.end_mark),this.state="parse_implicit_document_start",h}parse_implicit_document_start(){var h,f,d,g;return this.check_token(t.DirectiveToken,t.DocumentStartToken,t.StreamEndToken)?this.parse_document_start():(this.tag_handles=n,g=this.peek_token(),d=h=g.start_mark,f=new e.DocumentStartEvent(d,h,!1),this.states.push("parse_document_end"),this.state="parse_block_node",f)}parse_document_start(){for(var h,f,d,g,u,_;this.check_token(t.DocumentEndToken);)this.get_token();if(this.check_token(t.StreamEndToken)){if(u=this.get_token(),f=new e.StreamEndEvent(u.start_mark,u.end_mark),this.states.length!==0)throw new Error("assertion error, states should be empty");if(this.marks.length!==0)throw new Error("assertion error, marks should be empty");this.state=null}else{if(d=this.peek_token().start_mark,[_,g]=this.process_directives(),!this.check_token(t.DocumentStartToken))throw new re.ParserError(`expected '<document start>', but found ${this.peek_token().id}`,this.peek_token().start_mark);u=this.get_token(),h=u.end_mark,f=new e.DocumentStartEvent(d,h,!0,_,g),this.states.push("parse_document_end"),this.state="parse_document_content"}return f}parse_document_end(){var h,f,d,g,u;return u=this.peek_token(),g=h=u.start_mark,d=!1,this.check_token(t.DocumentEndToken)&&(u=this.get_token(),h=u.end_mark,d=!0),f=new e.DocumentEndEvent(g,h,d),this.state="parse_document_start",f}parse_document_content(){var h;return this.check_token(t.DirectiveToken,t.DocumentStartToken,t.DocumentEndToken,t.StreamEndToken)?(h=this.process_empty_scalar(this.peek_token().start_mark),this.state=this.states.pop(),h):this.parse_block_node()}process_directives(){var h,f,d,g,u,_,a,l;for(this.yaml_version=null,this.tag_handles={};this.check_token(t.DirectiveToken);)if(a=this.get_token(),a.name==="YAML"){if(this.yaml_version!==null)throw new re.ParserError(null,null,"found duplicate YAML directive",a.start_mark);if([f,d]=a.value,f!==1)throw new re.ParserError(null,null,"found incompatible YAML document (version 1.* is required)",a.start_mark);this.yaml_version=a.value}else if(a.name==="TAG"){if([h,g]=a.value,h in this.tag_handles)throw new re.ParserError(null,null,`duplicate tag handle ${h}`,a.start_mark);this.tag_handles[h]=g}_=null,u=this.tag_handles;for(h in u)i.call(u,h)&&(g=u[h],_==null&&(_={}),_[h]=g);l=[this.yaml_version,_];for(h in n)i.call(n,h)&&(g=n[h],g in this.tag_handles||(this.tag_handles[h]=g));return l}parse_block_node(){return this.parse_node(!0)}parse_flow_node(){return this.parse_node()}parse_block_node_or_indentless_sequence(){return this.parse_node(!0,!0)}parse_node(h=!1,f=!1){var d,g,u,_,a,l,p,m,v,k,y;if(this.check_token(t.AliasToken))y=this.get_token(),u=new e.AliasEvent(y.value,y.start_mark,y.end_mark),this.state=this.states.pop();else{if(d=null,v=null,p=g=k=null,this.check_token(t.AnchorToken)?(y=this.get_token(),p=y.start_mark,g=y.end_mark,d=y.value,this.check_token(t.TagToken)&&(y=this.get_token(),k=y.start_mark,g=y.end_mark,v=y.value)):this.check_token(t.TagToken)&&(y=this.get_token(),p=k=y.start_mark,g=y.end_mark,v=y.value,this.check_token(t.AnchorToken)&&(y=this.get_token(),g=y.end_mark,d=y.value)),v!==null)if([_,m]=v,_!==null){if(!(_ in this.tag_handles))throw new re.ParserError("while parsing a node",p,`found undefined tag handle ${_}`,k);v=this.tag_handles[_]+m}else v=m;if(p===null&&(p=g=this.peek_token().start_mark),u=null,a=v===null||v==="!",f&&this.check_token(t.BlockEntryToken))g=this.peek_token().end_mark,u=new e.SequenceStartEvent(d,v,a,p,g),this.state="parse_indentless_sequence_entry";else if(this.check_token(t.ScalarToken))y=this.get_token(),g=y.end_mark,y.plain&&v===null||v==="!"?a=[!0,!1]:v===null?a=[!1,!0]:a=[!1,!1],u=new e.ScalarEvent(d,v,a,y.value,p,g,y.style),this.state=this.states.pop();else if(this.check_token(t.FlowSequenceStartToken))g=this.peek_token().end_mark,u=new e.SequenceStartEvent(d,v,a,p,g,!0),this.state="parse_flow_sequence_first_entry";else if(this.check_token(t.FlowMappingStartToken))g=this.peek_token().end_mark,u=new e.MappingStartEvent(d,v,a,p,g,!0),this.state="parse_flow_mapping_first_key";else if(h&&this.check_token(t.BlockSequenceStartToken))g=this.peek_token().end_mark,u=new e.SequenceStartEvent(d,v,a,p,g,!1),this.state="parse_block_sequence_first_entry";else if(h&&this.check_token(t.BlockMappingStartToken))g=this.peek_token().end_mark,u=new e.MappingStartEvent(d,v,a,p,g,!1),this.state="parse_block_mapping_first_key";else if(d!==null||v!==null)u=new e.ScalarEvent(d,v,[a,!1],"",p,g),this.state=this.states.pop();else throw h?l="block":l="flow",y=this.peek_token(),new re.ParserError(`while parsing a ${l} node`,p,`expected the node content, but found ${y.id}`,y.start_mark)}return u}parse_block_sequence_first_entry(){var h;return h=this.get_token(),this.marks.push(h.start_mark),this.parse_block_sequence_entry()}parse_block_sequence_entry(){var h,f;if(this.check_token(t.BlockEntryToken))return f=this.get_token(),this.check_token(t.BlockEntryToken,t.BlockEndToken)?(this.state="parse_block_sequence_entry",this.process_empty_scalar(f.end_mark)):(this.states.push("parse_block_sequence_entry"),this.parse_block_node());if(!this.check_token(t.BlockEndToken))throw f=this.peek_token(),new re.ParserError("while parsing a block collection",this.marks.slice(-1)[0],`expected <block end>, but found ${f.id}`,f.start_mark);return f=this.get_token(),h=new e.SequenceEndEvent(f.start_mark,f.end_mark),this.state=this.states.pop(),this.marks.pop(),h}parse_indentless_sequence_entry(){var h,f;return this.check_token(t.BlockEntryToken)?(f=this.get_token(),this.check_token(t.BlockEntryToken,t.KeyToken,t.ValueToken,t.BlockEndToken)?(this.state="parse_indentless_sequence_entry",this.process_empty_scalar(f.end_mark)):(this.states.push("parse_indentless_sequence_entry"),this.parse_block_node())):(f=this.peek_token(),h=new e.SequenceEndEvent(f.start_mark,f.start_mark),this.state=this.states.pop(),h)}parse_block_mapping_first_key(){var h;return h=this.get_token(),this.marks.push(h.start_mark),this.parse_block_mapping_key()}parse_block_mapping_key(){var h,f;if(this.check_token(t.KeyToken))return f=this.get_token(),this.check_token(t.KeyToken,t.ValueToken,t.BlockEndToken)?(this.state="parse_block_mapping_value",this.process_empty_scalar(f.end_mark)):(this.states.push("parse_block_mapping_value"),this.parse_block_node_or_indentless_sequence());if(!this.check_token(t.BlockEndToken))throw f=this.peek_token(),new re.ParserError("while parsing a block mapping",this.marks.slice(-1)[0],`expected <block end>, but found ${f.id}`,f.start_mark);return f=this.get_token(),h=new e.MappingEndEvent(f.start_mark,f.end_mark),this.state=this.states.pop(),this.marks.pop(),h}parse_block_mapping_value(){var h;return this.check_token(t.ValueToken)?(h=this.get_token(),this.check_token(t.KeyToken,t.ValueToken,t.BlockEndToken)?(this.state="parse_block_mapping_key",this.process_empty_scalar(h.end_mark)):(this.states.push("parse_block_mapping_key"),this.parse_block_node_or_indentless_sequence())):(this.state="parse_block_mapping_key",h=this.peek_token(),this.process_empty_scalar(h.start_mark))}parse_flow_sequence_first_entry(){var h;return h=this.get_token(),this.marks.push(h.start_mark),this.parse_flow_sequence_entry(!0)}parse_flow_sequence_entry(h=!1){var f,d;if(!this.check_token(t.FlowSequenceEndToken)){if(!h)if(this.check_token(t.FlowEntryToken))this.get_token();else throw d=this.peek_token(),new re.ParserError("while parsing a flow sequence",this.marks.slice(-1)[0],`expected ',' or ']', but got ${d.id}`,d.start_mark);if(this.check_token(t.KeyToken))return d=this.peek_token(),f=new e.MappingStartEvent(null,null,!0,d.start_mark,d.end_mark,!0),this.state="parse_flow_sequence_entry_mapping_key",f;if(!this.check_token(t.FlowSequenceEndToken))return this.states.push("parse_flow_sequence_entry"),this.parse_flow_node()}return d=this.get_token(),f=new e.SequenceEndEvent(d.start_mark,d.end_mark),this.state=this.states.pop(),this.marks.pop(),f}parse_flow_sequence_entry_mapping_key(){var h;return h=this.get_token(),this.check_token(t.ValueToken,t.FlowEntryToken,t.FlowSequenceEndToken)?(this.state="parse_flow_sequence_entry_mapping_value",this.process_empty_scalar(h.end_mark)):(this.states.push("parse_flow_sequence_entry_mapping_value"),this.parse_flow_node())}parse_flow_sequence_entry_mapping_value(){var h;return this.check_token(t.ValueToken)?(h=this.get_token(),this.check_token(t.FlowEntryToken,t.FlowSequenceEndToken)?(this.state="parse_flow_sequence_entry_mapping_end",this.process_empty_scalar(h.end_mark)):(this.states.push("parse_flow_sequence_entry_mapping_end"),this.parse_flow_node())):(this.state="parse_flow_sequence_entry_mapping_end",h=this.peek_token(),this.process_empty_scalar(h.start_mark))}parse_flow_sequence_entry_mapping_end(){var h;return this.state="parse_flow_sequence_entry",h=this.peek_token(),new e.MappingEndEvent(h.start_mark,h.start_mark)}parse_flow_mapping_first_key(){var h;return h=this.get_token(),this.marks.push(h.start_mark),this.parse_flow_mapping_key(!0)}parse_flow_mapping_key(h=!1){var f,d;if(!this.check_token(t.FlowMappingEndToken)){if(!h)if(this.check_token(t.FlowEntryToken))this.get_token();else throw d=this.peek_token(),new re.ParserError("while parsing a flow mapping",this.marks.slice(-1)[0],`expected ',' or '}', but got ${d.id}`,d.start_mark);if(this.check_token(t.KeyToken))return d=this.get_token(),this.check_token(t.ValueToken,t.FlowEntryToken,t.FlowMappingEndToken)?(this.state="parse_flow_mapping_value",this.process_empty_scalar(d.end_mark)):(this.states.push("parse_flow_mapping_value"),this.parse_flow_node());if(!this.check_token(t.FlowMappingEndToken))return this.states.push("parse_flow_mapping_empty_value"),this.parse_flow_node()}return d=this.get_token(),f=new e.MappingEndEvent(d.start_mark,d.end_mark),this.state=this.states.pop(),this.marks.pop(),f}parse_flow_mapping_value(){var h;return this.check_token(t.ValueToken)?(h=this.get_token(),this.check_token(t.FlowEntryToken,t.FlowMappingEndToken)?(this.state="parse_flow_mapping_key",this.process_empty_scalar(h.end_mark)):(this.states.push("parse_flow_mapping_key"),this.parse_flow_node())):(this.state="parse_flow_mapping_key",h=this.peek_token(),this.process_empty_scalar(h.start_mark))}parse_flow_mapping_empty_value(){return this.state="parse_flow_mapping_key",this.process_empty_scalar(this.peek_token().start_mark)}process_empty_scalar(h){return new e.ScalarEvent(null,null,[!0,!1],"",h,h)}}return n={"!":"!","!!":"tag:yaml.org,2002:"},s=c.prototype.initialise,c}).call(this)}).call(re)});var Hi=q(Wi=>{w();(function(){var r,e,t,i,n,s,c;c=_e(),i=zr(),s=Br(),t=Gr(),r=Or(),n=Mt(),e=Fr(),this.make_loader=function(o=i.Reader,h=s.Scanner,f=t.Parser,d=r.Composer,g=n.Resolver,u=e.Constructor){var _,a;return a=[o,h,f,d,g,u],_=(function(){var l;class p{constructor(v){var k,y,b;for(a[0].prototype.initialise.call(this,v),b=a.slice(1),k=0,y=b.length;k<y;k++)l=b[k],l.prototype.initialise.call(this)}}return c.extend(p.prototype,...(function(){var m,v,k;for(k=[],m=0,v=a.length;m<v;m++)l=a[m],k.push(l.prototype);return k})()),p}).call(this)},this.Loader=this.make_loader()}).call(Wi)});var Vi=q(Lt=>{w();(function(){var r,e,t,i,n,s,c,o,h,f,d,g,u;r=this.composer=Or(),e=this.constructor=Fr(),t=this.dumper=Bi(),i=this.errors=ce(),n=this.events=Xe(),s=this.loader=Hi(),c=this.nodes=Ue(),o=this.parser=Gr(),h=this.reader=zr(),f=this.resolver=Mt(),d=this.scanner=Br(),g=this.tokens=Nt(),u=_e(),this.scan=function(_,a=s.Loader){var l,p;for(l=new a(_),p=[];l.check_token();)p.push(l.get_token());return p},this.parse=function(_,a=s.Loader){var l,p;for(l=new a(_),p=[];l.check_event();)p.push(l.get_event());return p},this.compose=function(_,a=s.Loader){var l;return l=new a(_),l.get_single_node()},this.compose_all=function(_,a=s.Loader){var l,p;for(l=new a(_),p=[];l.check_node();)p.push(l.get_node());return p},this.load=function(_,a=s.Loader){var l;return l=new a(_),l.get_single_data()},this.load_all=function(_,a=s.Loader){var l,p;for(l=new a(_),p=[];l.check_data();)p.push(l.get_data());return p},this.emit=function(_,a,l=t.Dumper,p={}){var m,v,k,y,b;v=a||new u.StringStream,m=new l(v,p);try{for(y=0,b=_.length;y<b;y++)k=_[y],m.emit(k)}finally{m.dispose()}return a||v.string},this.serialize=function(_,a,l=t.Dumper,p={}){return Lt.serialize_all([_],a,l,p)},this.serialize_all=function(_,a,l=t.Dumper,p={}){var m,v,k,y,b;v=a||new u.StringStream,m=new l(v,p);try{for(m.open(),k=0,y=_.length;k<y;k++)b=_[k],m.serialize(b);m.close()}finally{m.dispose()}return a||v.string},this.dump=function(_,a,l=t.Dumper,p={}){return Lt.dump_all([_],a,l,p)},this.dump_all=function(_,a,l=t.Dumper,p={}){var m,v,k,y,b;v=a||new u.StringStream,m=new l(v,p);try{for(m.open(),y=0,b=_.length;y<b;y++)k=_[y],m.represent(k);m.close()}finally{m.dispose()}return a||v.string}}).call(Lt)});function Os(r,e,t){let i=e;if(e in r)return void t(r[i]);Object.defineProperty(r,e,{set(n){delete r[i],r[i]=n,t(n)},configurable:!0,enumerable:!1})}var Fs=G(()=>{"use strict";w()});var Ll={};function Ml(r,e){let t=r.slice(4).split(".").map(Number),i=e.slice(4).split(".").map(Number);for(let n=0;n<i.length;n++){if(t[n]>i[n])return!0;if(t[n]<i[n])return!1}return!1}function Nl(){if(!process.env.DISABLE_UPDATER_AUTO_PATCHING)try{let r=(0,X.dirname)(process.execPath),e=(0,X.basename)(r),t=(0,X.join)(r,".."),i=(0,Z.readdirSync)(t).reduce((h,f)=>f.startsWith("app-")&&Ml(f,h)?f:h,e);if(i===e)return;let n=(0,X.join)(t,i,"resources"),s=(0,X.join)(n,"app.asar"),c=(0,X.join)(n,"_app.asar"),o=(0,X.join)(n,"app");if(!(0,Z.existsSync)(s)||(0,Z.statSync)(s).isDirectory())return;console.info("[Endcord] Detected Host Update. Repatching..."),(0,Z.renameSync)(s,c),(0,Z.existsSync)(o)||(0,Z.mkdirSync)(o),(0,Z.writeFileSync)((0,X.join)(o,"package.json"),JSON.stringify({name:"discord",main:"index.js"})),(0,Z.writeFileSync)((0,X.join)(o,"index.js"),`require(${JSON.stringify((0,X.join)(__dirname,"patcher.js"))});`)}catch(r){console.error("[Endcord] Failed to repatch latest host update",r)}}var qs,Z,X,$s=G(()=>{"use strict";w();qs=require("electron"),Z=require("original-fs"),X=require("path");qs.app.on("before-quit",Nl)});var Fl={};var U,fe,js,Ul,zs,wt,Ol,Bs=G(()=>{"use strict";w();Fs();U=Re(require("electron")),fe=require("path");ae();me();js=require("fs");console.log("[Endcord] Starting up...");Ul=require.main.filename,zs=(0,fe.join)((0,fe.dirname)(Ul),".."),wt=(0,fe.join)(zs,"_app.asar");(0,js.existsSync)(wt)||(wt=(0,fe.join)(zs,"app.asar"));Ol=require((0,fe.join)(wt,"package.json"));require.main.filename=(0,fe.join)(wt,Ol.main);U.app.setAppPath(wt);if(kt)console.log("[Endcord] Running in vanilla mode. Not loading Endcord");else{let r=$.store;if(process.platform==="win32"&&($s(),r.winCtrlQ)){let n=U.Menu.buildFromTemplate;U.Menu.buildFromTemplate=function(s){if(s[0]?.label==="&File"){let{submenu:c}=s[0];Array.isArray(c)&&c.push({label:"Quit (Hidden)",visible:!1,acceleratorWorksWhenHidden:!0,accelerator:"Control+Q",click:()=>U.app.quit()})}return n.call(this,s)}}class e extends U.default.BrowserWindow{constructor(s){if(!s?.webPreferences?.preload){super(s);return}let{frameless:c,winNativeTitleBar:o,disableMinSize:h,transparent:f,macosVibrancyStyle:d,windowsMaterial:g}=r,u=s.webPreferences.preload;s.webPreferences.preload=(0,fe.join)(__dirname,"preload.js"),s.webPreferences.sandbox=!1,s.webPreferences.backgroundThrottling=!1,c?s.frame=!1:process.platform==="win32"&&o&&delete s.frame,h&&(s.minWidth=0,s.minHeight=0),f&&(s.transparent=!0,s.backgroundColor="#00000000"),process.platform==="darwin"&&d&&(s.vibrancy=d,s.backgroundColor="#00000000"),process.platform==="win32"&&g&&g!=="none"&&(s.backgroundMaterial=g,s.backgroundColor="#00000000"),process.env.DISCORD_PRELOAD=u,super(s),h&&(this.setMinimumSize=(_,a)=>{})}}Object.assign(e,U.default.BrowserWindow),Object.defineProperty(e,"name",{value:"BrowserWindow",configurable:!0});let t=require.resolve("electron");delete require.cache[t].exports,require.cache[t].exports={...U.default,BrowserWindow:e},Os(global,"appSettings",n=>{n.set("DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING",!0)}),process.env.DATA_DIR=(0,fe.join)(U.app.getPath("userData"),"..","Endcord");let i=U.app.commandLine.appendSwitch;U.app.commandLine.appendSwitch=function(...n){if(n[0]==="disable-features"){let s=new Set((n[1]??"").split(",").filter(Boolean));s.add("WidgetLayering"),s.add("UseEcoQoSForBackgroundProcess"),s.add("CalculateNativeWinOcclusion"),s.add("IntensiveWakeUpThrottling"),n[1]=[...s].join(",")}else if(n[0]==="enable-features"){let s=new Set((n[1]??"").split(",").filter(Boolean));s.add("CanvasOopRasterization"),n[1]=[...s].join(",")}return i.apply(this,n)},U.app.commandLine.appendSwitch("disable-renderer-backgrounding"),U.app.commandLine.appendSwitch("disable-background-timer-throttling"),U.app.commandLine.appendSwitch("disable-backgrounding-occluded-windows"),U.app.commandLine.appendSwitch("ignore-gpu-blocklist"),U.app.commandLine.appendSwitch("enable-gpu-rasterization"),U.app.commandLine.appendSwitch("enable-zero-copy"),U.app.commandLine.appendSwitch("enable-native-gpu-memory-buffers"),U.app.commandLine.appendSwitch("enable-features","CanvasOopRasterization")}console.log("[Endcord] Loading original Discord app.asar");require(require.main.filename)});w();var Fe=require("electron"),Gs=require("path"),pn=require("url");w();ae();var Kt=require("electron"),xe=["connect-src"],ee=[...xe,"img-src"],Dn=["style-src","font-src"],O=[...ee,...Dn],In=[...O,"script-src","worker-src"],Qt={"http://localhost:*":O,"http://127.0.0.1:*":O,"localhost:*":O,"127.0.0.1:*":O,"*.github.io":O,"github.com":O,"raw.githubusercontent.com":O,"*.gitlab.io":O,"gitlab.com":O,"*.codeberg.page":O,"codeberg.org":O,"*.githack.com":O,"jsdelivr.net":O,"fonts.googleapis.com":Dn,"i.imgur.com":ee,"i.ibb.co":ee,"i.pinimg.com":ee,"*.tenor.com":ee,"files.catbox.moe":O,"cdn.discordapp.com":O,"media.discordapp.net":ee,"cdnjs.cloudflare.com":In,"cdn.jsdelivr.net":In,"api.github.com":xe,"ws.audioscrobbler.com":xe,"translate-pa.googleapis.com":xe,"*.endcord.com":ee,"endcord.com":xe,"api.endcord.com":xe,"manti.vendicated.dev":ee,"decor.fieryflames.dev":xe,"ugc.decor.fieryflames.dev":ee,"sponsor.ajay.app":xe,"dearrow-thumb.ajay.app":ee,"usrbg.is-hardly.online":ee,"icons.duckduckgo.com":ee,"themes.equicord.org":O},Xt=(r,e)=>Object.keys(r).find(t=>t.toLowerCase()===e),Xs=r=>{let e={};return r.split(";").forEach(t=>{let[i,...n]=t.trim().split(/\s+/g);i&&!Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=n)}),e},Qs=r=>Object.entries(r).filter(([,e])=>e?.length).map(e=>e.flat().join(" ")).join("; "),ea=r=>{let e=Xt(r,"content-security-policy-report-only");e&&delete r[e];let t=Xt(r,"content-security-policy");if(t){let i=Xs(r[t][0]),n=(s,...c)=>{i[s]??=[...i["default-src"]??[]],i[s].push(...c)};n("style-src","'unsafe-inline'"),n("script-src","'unsafe-inline'","'unsafe-eval'");for(let s of["style-src","connect-src","img-src","font-src","media-src","worker-src"])n(s,"blob:","data:","endcord:","vesktop:");for(let[s,c]of Object.entries(z.store.customCspRules))for(let o of c)n(o,s);for(let[s,c]of Object.entries(Qt))for(let o of c)n(o,s);r[t]=[Qs(i)]}};function Pn(){Kt.session.defaultSession.webRequest.onHeadersReceived(({responseHeaders:r,resourceType:e},t)=>{if(r&&(e==="mainFrame"&&ea(r),e==="stylesheet")){let i=Xt(r,"content-type");i&&(r[i]=["text/css"])}t({cancel:!1,responseHeaders:r})}),Kt.session.defaultSession.webRequest.onHeadersReceived=()=>{}}w();w();var On=require("fs"),Fn=require("path");{let r=(0,On.existsSync)((0,Fn.join)(__dirname,"..",".git"));Un()}w();Be();var en=require("electron");w();var or={};F(or,{fetchTrackData:()=>la});w();ir();var qn=require("child_process"),$n=require("util"),jn=(0,$n.promisify)(qn.execFile);async function ar(r){let{stdout:e}=await jn("osascript",r.map(t=>["-e",t]).flat());return e}var oe=null;async function oa({id:r,name:e,artist:t,album:i}){if(r===oe?.id){if("data"in oe)return oe.data;if("failures"in oe&&oe.failures>=5)return null}try{let n=new URL("https://itunes.apple.com/search");n.searchParams.set("term",`${e} ${t} ${i}`),n.searchParams.set("media","music"),n.searchParams.set("entity","song");let s=await fetch(n,{headers:{"user-agent":Et}}).then(o=>o.json()).then(o=>o.results.find(h=>h.collectionName===i)||o.results[0]),c=await fetch(s.artistViewUrl).then(o=>o.text()).then(o=>{let h=o.match(/<meta property="og:image" content="(.+?)">/);return h?h[1].replace(/[0-9]+x.+/,"220x220bb-60.png"):void 0}).catch(()=>{});return oe={id:r,data:{appleMusicLink:s.trackViewUrl,appleMusicArtistLink:s.artistViewUrl,songLink:`https://song.link/i/${new URL(s.trackViewUrl).searchParams.get("i")}`,albumArtwork:s.artworkUrl100.replace("100x100","512x512"),artistArtwork:c}},oe.data}catch(n){return console.error("[AppleMusicRichPresence] Failed to fetch remote data:",n),oe={id:r,failures:(r===oe?.id&&"failures"in oe?oe.failures:0)+1},null}}async function la(){try{await jn("pgrep",["^Music$"])}catch{return null}if(await ar(['tell application "Music"',"get player state","end tell"]).then(d=>d.trim())!=="playing")return null;let e=await ar(['tell application "Music"',"get player position","end tell"]).then(d=>Number.parseFloat(d.trim())),t=await ar(['set output to ""','tell application "Music"',"set t_id to database id of current track","set t_name to name of current track","set t_album to album of current track","set t_artist to artist of current track","set t_duration to duration of current track",'set output to "" & t_id & "\\n" & t_name & "\\n" & t_album & "\\n" & t_artist & "\\n" & t_duration',"end tell","return output"]),[i,n,s,c,o]=t.split(`
- `).filter(d=>!!d),h=Number.parseFloat(o),f=await oa({id:i,name:n,artist:c,album:s});return{name:n,album:s,artist:c,playerPosition:e,duration:h,...f}}var ur={};F(ur,{chooseVideoFile:()=>da,createTempVideoFile:()=>ma,createTempVideoFileFromBytes:()=>_a,deleteTempVideoFile:()=>wa,getTempVideoFilePath:()=>ga,parseClipFileMetadata:()=>ya,readVideoFile:()=>va});w();me();w();var We=require("path");function He(r,e){let t=(0,We.normalize)(r+"/"),i=(0,We.join)(r,e),n=(0,We.normalize)(i);return n===(0,We.normalize)(r)||n.startsWith(t)?n:null}var Ve=require("crypto"),Bn=require("electron"),te=require("fs/promises"),j=require("path"),St=new Map,Ze=new Map,lr=(0,j.join)(be,"clipUpload"),Gn=new Set([".mp4",".m4v"]),ca=500*1024*1024,ua={".mp4":"video/mp4",".m4v":"video/mp4"},cr=Buffer.from([117,117,105,100,161,200,82,153,51,70,77,184,136,240,131,245,122,117,165,239]),zn=cr.length;function ha(r){return ua[(0,j.extname)(r).toLowerCase()]??"application/octet-stream"}function pa(r){let e=r.indexOf(cr);return e===-1?r:r.subarray(0,e)}async function fa(r){try{let e=await(0,te.readFile)(r);if(e.length<=zn)return null;let t=e.indexOf(cr);if(t===-1)return null;let i=e.subarray(t+zn).toString("utf-8"),n=JSON.parse(i);return n&&typeof n=="object"?Array.isArray(n)?n:[n]:null}catch{return null}}async function da(r){try{let{filePaths:e,canceled:t}=await Bn.dialog.showOpenDialog({title:"Select clip file",filters:[{name:"MP4 Video",extensions:["mp4","m4v"]}],properties:["openFile"]});if(t||e.length===0)return null;let i=(0,j.resolve)(e[0]);if(!Gn.has((0,j.extname)(i).toLowerCase()))return null;let n=(0,Ve.randomUUID)();return St.set(n,i),{token:n,name:(0,j.basename)(i),type:ha(i)}}catch{return null}}async function ma(r,e){let t=St.get(e);if(!t)return null;St.delete(e);try{let i=(0,j.join)(lr,(0,Ve.randomUUID)()),n=(0,j.join)(i,(0,j.basename)(t));if(!He(i,(0,j.basename)(t)))return null;await(0,te.mkdir)(i,{recursive:!0}),await(0,te.writeFile)(n,pa(await(0,te.readFile)(t)));let s=(0,Ve.randomUUID)();return Ze.set(s,{tmpDir:i,tmpPath:n}),s}catch{return null}}async function _a(r,e,t){if(typeof e!="string"||!(t instanceof Uint8Array)||t.byteLength===0||t.byteLength>ca)return null;let i=(0,j.basename)(e);if(i!==e||!Gn.has((0,j.extname)(i).toLowerCase()))return null;try{let n=(0,j.join)(lr,(0,Ve.randomUUID)()),s=(0,j.join)(n,i);if(!He(n,i))return null;await(0,te.mkdir)(n,{recursive:!0}),await(0,te.writeFile)(s,t);let c=(0,Ve.randomUUID)();return Ze.set(c,{tmpDir:n,tmpPath:s}),c}catch{return null}}function ga(r,e){return Ze.get(e)?.tmpPath??null}async function va(r,e){let t=Ze.get(e);if(!t)return null;try{let i=await(0,te.readFile)(t.tmpPath);return new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}catch{return null}}async function wa(r,e){let t=Ze.get(e);if(t&&(Ze.delete(e),!!He(lr,t.tmpDir)))try{await(0,te.rm)(t.tmpDir,{force:!0,recursive:!0})}catch{}}async function ya(r,e){let t=St.get(e);return t?fa(t):null}var hr={};F(hr,{initDevtoolsOpenEagerLoad:()=>ka});w();function ka(r){let e=()=>r.sender.executeJavaScript("Endcord.Plugins.plugins.ConsoleShortcuts.eagerLoad(true)");r.sender.isDevToolsOpened()?e():r.sender.once("devtools-opened",()=>e())}var pr={};F(pr,{fetchAttachment:()=>xa});w();var ba=new Set(["cdn.discordapp.com","images-ext-1.discordapp.net","images-ext-2.discordapp.net","media.discordapp.net"]);async function xa(r,e){let{content_type:t,filename:i}=e,n=URL.parse(e.url);if(!n||!ba.has(n.hostname))throw new Error("Invalid URL");let s=await fetch(n,{headers:{Accept:"*/*"}});if(!s.ok)throw new Error("Server error");let c=await s.blob(),o=c.type||t||"application/octet-stream",h=await c.arrayBuffer();return{type:o,data:h,filename:i}}var fr={};F(fr,{fetchFile:()=>qa,uploadTo0x0:()=>Ta,uploadToBuzzheavier:()=>Ca,uploadToCatbox:()=>Da,uploadToEzHost:()=>Sa,uploadToFilebin:()=>Na,uploadToGofile:()=>Aa,uploadToLitterbox:()=>Pa,uploadToNest:()=>Ea,uploadToPixelDrain:()=>Ua,uploadToPixelVault:()=>La,uploadToS3:()=>Ia,uploadToTempSh:()=>Ma,uploadToTmpfiles:()=>Ra,uploadToWebdav:()=>Fa});w();async function Ea(r,e,t,i){try{let n=new FormData;n.append("file",new Blob([e]),t);let s=await fetch("https://nest.rip/api/files/upload",{method:"POST",headers:{Authorization:i},body:n});if(!s.ok){let o=await s.text();return{success:!1,error:`Upload failed: ${s.status} ${o}`}}let c=await s.json();return c.fileURL?{success:!0,url:c.fileURL}:{success:!1,error:"No URL returned from upload"}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function Sa(r,e,t,i){try{let n=new FormData;n.append("file",new Blob([e]),t);let s=await fetch("https://api.e-z.host/files",{method:"POST",headers:{key:i},body:n});if(!s.ok){let o=await s.text();return{success:!1,error:`Upload failed: ${s.status} ${o}`}}let c=await s.json();return!c||!c.success?{success:!1,error:c?.error||"Upload failed"}:c.imageUrl||c.rawUrl?{success:!0,url:c.imageUrl||c.rawUrl}:{success:!1,error:"No URL returned from upload"}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function Ta(r,e,t){try{let i=new FormData;i.append("file",new Blob([e]),t);let n=await fetch("https://0x0.st",{method:"POST",body:i});if(!n.ok){let c=await n.text();return{success:!1,error:`Upload failed: ${n.status} ${c}`}}let s=(await n.text()).trim();return s?{success:!0,url:s}:{success:!1,error:"No URL returned from upload"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error"}}}async function Ia(r,e,t,i){try{let n=await fetch(t,{method:"PUT",headers:i,body:new Blob([e])});if(!n.ok){let s=await n.text();return{success:!1,error:`Upload failed: ${n.status} ${s}`}}return{success:!0,url:t}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function Da(r,e,t,i){try{let n=new FormData;n.append("reqtype","fileupload"),i&&n.append("userhash",i),n.append("fileToUpload",new Blob([e]),t);let s=await fetch("https://catbox.moe/user/api.php",{method:"POST",body:n});if(!s.ok){let o=await s.text();return{success:!1,error:`Upload failed: ${s.status} ${o}`}}let c=(await s.text()).trim();return c?{success:!0,url:c}:{success:!1,error:"No URL returned from upload"}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function Pa(r,e,t,i){try{let n=new FormData;n.append("reqtype","fileupload"),n.append("time",i),n.append("fileToUpload",new Blob([e]),t);let s=await fetch("https://litterbox.catbox.moe/resources/internals/api.php",{method:"POST",body:n});if(!s.ok){let o=await s.text();return{success:!1,error:`Upload failed: ${s.status} ${o}`}}let c=(await s.text()).trim();return c?{success:!0,url:c}:{success:!1,error:"No URL returned from upload"}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function Aa(r,e,t,i){try{let n=new FormData;i?.trim()&&n.append("token",i.trim()),n.append("file",new Blob([e]),t);let s=await fetch("https://upload.gofile.io/uploadfile",{method:"POST",body:n});if(!s.ok){let h=await s.text();return{success:!1,error:`Upload failed: ${s.status} ${h}`}}let c=await s.json();if(c.status!=="ok")return{success:!1,error:c.error||"Upload failed"};let o=c.data?.downloadPage||(c.data?.code?`https://gofile.io/d/${c.data.code}`:"");return o?{success:!0,url:o}:{success:!1,error:"No URL returned from upload"}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function Ra(r,e,t){try{let i=new FormData;i.append("file",new Blob([e]),t);let n=await fetch("https://tmpfiles.org/api/v1/upload",{method:"POST",body:i});if(!n.ok){let h=await n.text();return{success:!1,error:`Upload failed: ${n.status} ${h}`}}let s=await n.json(),c=s.data?.url||"";return!c||s.status!=="success"?{success:!1,error:"No URL returned from upload"}:{success:!0,url:c.includes("tmpfiles.org/")&&!c.includes("/dl/")?c.replace(/tmpfiles\.org\/(\d+)/,"tmpfiles.org/dl/$1"):c}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error"}}}async function Ca(r,e,t){try{let i=await fetch(`https://w.buzzheavier.com/${encodeURIComponent(t)}`,{method:"PUT",body:new Blob([e])}),n=await i.text();if(!i.ok)return{success:!1,error:`Upload failed: ${i.status} ${n}`};try{let c=JSON.parse(n);if(c.code===201&&c.data?.id)return{success:!0,url:`https://buzzheavier.com/${c.data.id}`}}catch{}let s=n.trim();return s?{success:!0,url:s}:{success:!1,error:"No URL returned from upload"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error"}}}async function Ma(r,e,t){try{let i=new FormData;i.append("file",new Blob([e]),t);let n=await fetch("https://temp.sh/upload",{method:"POST",body:i});if(!n.ok){let c=await n.text();return{success:!1,error:`Upload failed: ${n.status} ${c}`}}let s=(await n.text()).trim();return s?{success:!0,url:s}:{success:!1,error:"No URL returned from upload"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error"}}}async function Na(r,e,t){try{let i=`${Date.now().toString(16)}${Math.random().toString(16).slice(2,10)}`,n=`https://filebin.net/${i}/${encodeURIComponent(t)}`,s=new FormData;s.append("file",new Blob([e]),t);let c=await fetch(n,{method:"POST",body:s});if(!c.ok){let o=await c.text();return{success:!1,error:`Upload failed: ${c.status} ${o}`}}return{success:!0,url:`https://filebin.net/${i}/${encodeURIComponent(t)}`}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error"}}}async function La(r,e,t,i){try{let n=new FormData;n.append("file",new Blob([e]),t);let s=await fetch("https://pixelvault.co/",{method:"POST",headers:{Authorization:i},body:n}),c=await s.text(),o=null;try{o=c?JSON.parse(c):null}catch{o=null}if(!s.ok)return{success:!1,error:`Upload failed: ${s.status} ${c}`};let h=o?.resource||o?.url||c.trim();return h?{success:!0,url:h}:{success:!1,error:"No URL returned from upload"}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function Ua(r,e,t,i){try{let n={};i?.trim()&&(n.Authorization=`Basic ${Buffer.from(`:${i.trim()}`).toString("base64")}`);let s=await fetch(`https://pixeldrain.com/api/file/${encodeURIComponent(t)}`,{method:"PUT",headers:n,body:new Blob([e])}),c=await s.text(),o=null;try{o=c?JSON.parse(c):null}catch{o=null}return s.ok?o?.id?{success:!0,url:`https://pixeldrain.com/u/${o.id}`}:{success:!1,error:o?.message||"No URL returned from upload"}:{success:!1,error:o?.message||`Upload failed: ${s.status} ${c}`}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}function Oa(r){try{return new URL(r).protocol==="https:"}catch{return!1}}async function Fa(r,e,t,i){if(!Oa(t))return{success:!1,error:"Invalid or non-HTTPS upload URL"};try{let n=await fetch(t,{method:"PUT",headers:i,body:new Blob([e])});if(!n.ok){let s=await n.text();return{success:!1,error:`Upload failed: ${n.status} ${s}`}}return{success:!0,url:t}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function qa(r,e){try{let t=await fetch(e);if(!t.ok)return{success:!1,error:`Fetch failed: ${t.status} ${t.statusText}`};let i=await t.arrayBuffer(),n=t.headers.get("content-type")||"";return{success:!0,data:i,contentType:n}}catch(t){return{success:!1,error:t instanceof Error?t.message:"Unknown error"}}}var Hn={};w();ae();var It=require("electron"),Tt=[];function Wn(){let r=[];for(let e=Tt.length-1;e>=0;e--){let{processId:t,routingId:i}=Tt[e],n=It.webFrameMain.fromId(t,i);if(!n){Tt.splice(e,1);continue}r.push(n)}return r}It.app.on("browser-window-created",(r,e)=>{e.webContents.on("frame-created",(t,{frame:i})=>{i?.once("dom-ready",()=>{if(i.url.startsWith("https://open.spotify.com/embed/")){Wn();let{routingId:n,processId:s}=i;Tt.push({routingId:n,processId:s});let c=$.store.plugins?.FixSpotifyEmbeds;if(!c?.enabled)return;i.executeJavaScript(`
- globalThis._vcVolume = ${c.volume/100};
- const original = Audio.prototype.play;
- Audio.prototype.play = function() {
- this.volume = _vcVolume;
- return original.apply(this, arguments);
- `)}})}),$.addChangeListener("plugins.FixSpotifyEmbeds.volume",t=>{try{Wn().forEach(i=>i.executeJavaScript(`globalThis._vcVolume = ${t/100}`))}catch(i){console.error("FixSpotifyEmbeds: Failed to update volume",i)}})});var Zn={};w();ae();var Vn=require("electron");Vn.app.on("browser-window-created",(r,e)=>{e.webContents.on("frame-created",(t,{frame:i})=>{i?.once("dom-ready",()=>{if(i.url.startsWith("https://www.youtube.com/")){if(!$.store.plugins?.FixYoutubeEmbeds?.enabled)return;i.executeJavaScript(`
- new MutationObserver(() => {
- document.querySelector('div.ytp-error-content-wrap-subreason a[href*="www.youtube.com/watch?v="]')
- ) location.reload()
- }).observe(document.body, { childList: true, subtree:true });
- `)}})})});var dr={};F(dr,{fetchMedia:()=>ja});w();var $a=new Set(["cdn.discordapp.com","images-ext-1.discordapp.net","images-ext-2.discordapp.net","media.discordapp.net","media.tenor.com","tenor.com","media.giphy.com","media0.giphy.com","media1.giphy.com","media2.giphy.com","media3.giphy.com","media4.giphy.com"]);async function ja(r,e){let t=URL.parse(e);if(!t||!$a.has(t.hostname))throw new Error("Invalid URL");let i=await fetch(t,{headers:{Accept:"*/*"}});if(!i.ok)throw new Error(`Server error ${i.status}`);let n=await i.blob();if(n.size===0)throw new Error(`Empty body (${i.status}) from ${e}`);return{data:await n.arrayBuffer(),type:n.type||"application/octet-stream"}}var yr={};F(yr,{chooseDir:()=>ro,chooseFile:()=>io,closeNativeLogImport:()=>Za,deleteFileNative:()=>eo,downloadAttachment:()=>ui,finishNativeLogExport:()=>Wa,getDefaultAttachmentFileExtensions:()=>gr,getDefaultNativeDataDir:()=>Ee,getDefaultNativeImageDir:()=>ut,getImageNative:()=>Xa,getNativeSavedImages:()=>Ja,getSettings:()=>Je,init:()=>ci,initDirs:()=>li,messageLoggerEnhancedUniqueIdThingyIdkMan:()=>Ya,readNativeLogChunk:()=>Va,showItemInFolder:()=>no,startNativeLogExport:()=>Ba,startNativeLogImport:()=>Ha,updateAllowedExtensions:()=>so,writeImageNative:()=>Qa,writeLogs:()=>to,writeNativeLogChunk:()=>Ga});w();var le=require("node:fs/promises"),Ne=Re(require("node:path"));me();var ft=require("electron");w();var _r=Re(require("fs/promises")),Kn=Re(require("path"));w();var Dt=require("fs/promises"),Yn=Re(require("path"));async function za(r){try{return await(0,Dt.access)(r),!0}catch{return!1}}async function Ye(r){await za(r)||await(0,Dt.mkdir)(r)}function mr(r){return Yn.default.parse(r).name}var Jn=r=>new Promise(e=>setTimeout(e,r));async function Je(){try{let r=await _r.default.readFile(await Xn(),"utf8");return JSON.parse(r)}catch{let e={logsDir:await Ee(),imageCacheDir:await ut(),attachmentFileExtensions:await gr()};try{await ct(e)}catch{}return e}}async function ct(r){r&&await _r.default.writeFile(await Xn(),JSON.stringify(r,null,4),"utf8")}async function Xn(){let r=await Ee();return await Ye(r),Kn.default.join(r,"mlSettings.json")}w();var Qn=require("node:crypto"),ei=require("node:fs"),ti=require("electron"),ht=new Map;async function Ba(r,e){let{filePath:t,canceled:i}=await ti.dialog.showSaveDialog({defaultPath:e??"message-logger-logs-idb.json",filters:[{name:"JSON",extensions:["json"]}]});if(i||!t)throw new Error("No file path selected");let n=(0,ei.createWriteStream)(t,{flags:"w",encoding:"utf-8"}),s=(0,Qn.randomUUID)();return ht.set(s,n),n.on("error",c=>{console.error("Stream error",c),ht.delete(s)}),s}async function Ga(r,e,t){let i=ht.get(e);if(!i)throw new Error("Stream not found or closed");i.write(t)||await new Promise(s=>i.once("drain",s))}async function Wa(r,e){let t=ht.get(e);if(t)return new Promise(i=>{t.end(()=>{ht.delete(e),i()})})}w();var ri=require("node:crypto"),ni=require("node:fs/promises"),ii=require("electron"),pt=new Map;async function Ha(r,e){let t=await ii.dialog.showOpenDialog({title:"Import Logs",filters:[{name:"Logs",extensions:["json"]}],properties:["openFile"],defaultPath:e}),[i]=t.filePaths;if(!i)throw Error("No file selected");let n=await(0,ni.open)(i,"r"),s=(0,ri.randomUUID)();return pt.set(s,n),s}async function Va(r,e,t=64*1024){let i=pt.get(e);if(!i)return null;let n=Buffer.alloc(t),{bytesRead:s}=await i.read(n,0,t);return s===0?(await i.close(),pt.delete(e),null):n.toString("utf-8",0,s)}async function Za(r,e){let t=pt.get(e);t&&(await t.close(),pt.delete(e))}w();var si=["com","exe","dll","ocx","ps1","ps1xml","ps2","ps2xml","psc1","psc2","msh","msh1","msh2","mshxml","msh1xml","msh2xml","js","jse","vbs","vb","vbe","cmd","bat","hta","inf","reg","pif","scr","cpl","scf","msc","pol","hlp","chm","ws","wsf","wsc","wsh","jar","z","bz2","cab","tar","ace","msi","msp","mst","msu","ppkg","bak","tmp","ost","pst","pkg","iso","img","vhd","vhdx","application","lock","lck","sln","cs","csproj","resx","config","resources","pdb","manifest","doc","dot","wbk","xls","xlt","xlm","xla","ppt","pot","pps","ade","adp","mdb","cdb","mda","mdn","mdt","mdf","mde","ldb","wps","xlsb","xlam","xll","xlw","ppam"];w();var ai="png,jpg,jpeg,gif,webp,mp4,webm,mp3,ogg,wav";var oi="message-logger-logs.json";function Ya(){}var Se=new Map,Ja=()=>Se,vr,wr,Pt=async()=>wr??await ut(),Ka=async()=>vr??await Ee();async function li(){let{logsDir:r,imageCacheDir:e}=await Je();vr=r||await Ee(),wr=e||await ut()}li();async function ci(r){let e=await Pt();await Ye(e);let t=await(0,le.readdir)(e);for(let i of t){let n=mr(i);Se.set(n,Ne.default.join(e,i))}}async function Xa(r,e){let t=Se.get(e);if(!t)return null;try{return await(0,le.readFile)(t)}catch(i){return console.error(i),null}}async function Qa(r,e,t){if(!e||!t)return;let i=await Pt(),n=mr(e);if(Se.get(n))return;let c=Ne.default.join(i,e);await Ye(i),await(0,le.writeFile)(c,t),Se.set(n,c)}async function eo(r,e){let t=Se.get(e);t&&await(0,le.unlink)(t)}async function to(r,e){let t=await Ka();(0,le.writeFile)(Ne.default.join(t,oi),e)}async function ut(){return Ne.default.join(await Ee(),"savedImages")}async function Ee(){return Ne.default.join(be,"MessageLoggerData")}async function gr(){return ai}async function ro(r,e){let t=await Je(),i=t[e]||await Ee(),s=(await ft.dialog.showOpenDialog({properties:["openDirectory"],defaultPath:i})).filePaths[0];if(!s)throw Error("Invalid Directory");switch(t[e]=s,await ct(t),e){case"logsDir":vr=s;break;case"imageCacheDir":wr=s;break}return e==="imageCacheDir"&&await ci(r),s}async function no(r){ft.shell.showItemInFolder(await Pt())}async function io(r,e,t,i){let n=await ft.dialog.showOpenDialog({title:e,filters:t,properties:["openFile"],defaultPath:i}),[s]=n.filePaths;if(!s)throw Error("Invalid file");return await(0,le.readFile)(s,"utf-8")}async function ui(r,e,t=0,i=!1){try{if(!e?.url||!e.oldUrl||!e?.id)return{error:"Invalid Attachment",path:null};if(e.id.match(/[\\/.]/))return{error:"Invalid Attachment ID",path:null};let s=(await Je()).attachmentFileExtensions?.trim()||"";if(s===""||s.toLowerCase()==="none")return{error:"All attachment downloads are currently blocked by settings configurations.",path:null};let c=s.split(",").map(_=>_.trim().toLowerCase()),o=e.fileExtension?.replace(".","").toLowerCase();if(!o||!c.includes(o))return{error:`File type .${o} is blocked by settings configurations.`,path:null};let h=Se.get(e.id);if(h)return{error:null,path:h};let f=await fetch(i?e.oldUrl:e.url);if(f.status!==200)return(f.status===404||f.status===403||f.status===415)&&(i=!0),t++,t>3?{error:`Failed to get attachment ${e.id} for caching. too many attempts, error code ${f.status}`,path:null}:(await Jn(1e3),ui(r,e,t,i));let d=await f.arrayBuffer(),g=await Pt();await Ye(g);let u=Ne.default.join(g,`${e.id}${e.fileExtension}`);return await(0,le.writeFile)(u,Buffer.from(d)),Se.set(e.id,u),{error:null,path:u}}catch(n){return console.error(n),{error:n.message,path:null}}}async function so(r,e){let t=await Je(),i=e?.trim()||"";if(i===""){t.attachmentFileExtensions="none",await ct(t);return}let n=i.split(",").map(s=>s.trim().toLowerCase()).filter(s=>s.length>0&&!si.includes(s));n.length===0?t.attachmentFileExtensions="none":t.attachmentFileExtensions=n.join(","),await ct(t)}var kr={};F(kr,{resolveRedirect:()=>oo});w();var hi=require("https"),ao=/^https:\/\/(spotify\.link|s\.team)\/.+$/;function pi(r){return new Promise((e,t)=>{let i=(0,hi.request)(new URL(r),{method:"HEAD"},n=>{e(n.headers.location?pi(n.headers.location):r)});i.on("error",t),i.end()})}async function oo(r,e){return ao.test(e)?pi(e):e}var br={};F(br,{canOpenDevTools:()=>di,complete:()=>co,openDevTools:()=>lo});w();var fi=require("electron");function di(r){return!r.sender.isDestroyed()}function lo(r){if(!di(r))return!1;let e=fi.BrowserWindow.fromWebContents(r.sender);return r.sender.isDevToolsOpened()?(e?.focus(),!0):(r.sender.openDevTools(),!0)}async function co(r,e,t,i,n,s){let c=await po(e,t,n,s);if(c.error||!c.token)return{success:!1,error:"AUTH: "+JSON.stringify(c.error)};let o=await fo(e,c.token,i,n,s);return o.error||!o.success?{success:!1,error:"PROGRESS: "+JSON.stringify(o.error)}:{success:!0,error:null}}function mi(r,e="",t){let i={"Content-Type":"application/json","X-Auth-Token":e,"X-Discord-Quest-ID":r};return t&&(i.Referer=t),i}async function uo(r){try{return await r.json()}catch{return null}}function ho(r){return r!=null&&typeof r=="object"&&"token"in r&&typeof r.token=="string"?r.token:!1}async function po(r,e,t,i){let n=null;return{token:await fetch(`https://${r}.discordsays.com/.proxy/acf/authorize`,{headers:mi(t,"",i),body:JSON.stringify({code:e}),method:"POST",mode:"cors",credentials:"include"}).then(async c=>{let o=await uo(c),h=ho(o);return!c.ok||!h?(n={status:c.status,body:o},!1):h}).catch(c=>(n=c,!1)),error:n}}async function fo(r,e,t,i,n){let s=null;return{success:await fetch(`https://${r}.discordsays.com/.proxy/acf/quest/progress`,{headers:mi(i,e,n),body:JSON.stringify({progress:t}),method:"POST",mode:"cors",credentials:"include"}).then(o=>o.ok).catch(o=>(s=o,!1)),error:s}}var xr={};F(xr,{fetchTrackData:()=>mo});w();async function mo(){let r=await(await fetch("https://gensokyoradio.net/api/station/playing/")).json();return{title:r.SONGINFO.TITLE,album:r.SONGINFO.ALBUM,artist:r.SONGINFO.ARTIST,position:r.SONGTIMES.SONGSTART,duration:r.SONGTIMES.SONGEND,artwork:r.MISC.ALBUMART?`https://gensokyoradio.net/images/albums/500/${r.MISC.ALBUMART}`:""}}var Er={};F(Er,{getTrackData:()=>_o});w();ae();async function _o(r,e){let t=new URL("https://api.song.link/v1-alpha.1/links");t.searchParams.set("url",e),t.searchParams.set("userCountry",$.store.plugins?.SongLink.userCountry||"US");let i=await fetch(t.toString()).then(c=>c.json()),[,n]=Object.entries(i.entitiesByUniqueId).find(([c])=>!c.includes("YOUTUBE"))||[];return{info:n?{title:n.title,artist:n.artistName}:null,links:Object.fromEntries(Object.entries(i.linksByPlatform).map(([c,o])=>[c,{url:o.url,nativeUri:o.nativeAppUriDesktop}]))}}var Nr={};F(Nr,{parseLink:()=>Ro,renderSong:()=>Co,validateSong:()=>Mo});w();w();w();var go="2.2.0";function vo(r){let e=new URL(r);return e.protocol="https",e.username=e.password=e.port=e.search=e.hash="",e.toString().replace(/\/?$/,"")}var gi=fetch;function Tr(r){gi=r}async function H(r){if(r.body){let s=JSON.stringify(r.body);r.body=s,r.headers??={},r.headers["content-type"]??="application/json",r.headers["content-length"]??=String(s.length)}let e=new URL(r.url);for(let[s,c]of Object.entries(r.query??{}))e.searchParams.set(s,c);let t=await gi(e,{method:r.method,redirect:"follow",headers:{accept:"*/*","user-agent":`SongSpotlight/${go}`,"cache-control":"public, max-age=3600",...r.headers??{}},cf:{cacheTtl:3600,cacheEverything:!0},body:r.body}),i=await t.text(),n;try{n=JSON.parse(i)}catch{n=null}return{ok:t.ok,redirected:t.redirected,url:t.url,status:t.status,headers:t.headers,text:i,json:n}}function Ir(r){let e=r.match(/id="__NEXT_DATA__" type="application\/json">(.*?)<\/script>/)?.[1];if(e)try{return JSON.parse(e)}catch{return}}function mt(r){return[r.service,r.type,r.id].join(":")}var Le={services:[],parsers:[]},Sr=new Map,dt=new Map;async function Ke(r){let e=vo(r);if(Sr.has(e))return Sr.get(e);let{hostname:t,pathname:i}=new URL(e),n=i.slice(1).split(/\/+/),s=null;for(let c of Le.parsers)if(c.hosts.includes(t)&&(s=await c.parse(e,t,n),s))break;return Sr.set(e,s),s&&dt.set(mt(s),!0),s}var _i=new Map;async function Dr(r){let e=mt(r),t=_i.get(e);if(t!==void 0&&(!t?.expiresAt||t.expiresAt>Date.now()))return t;let i=null,n=Le.services.find(s=>s.name===r.service);return n?.types.includes(r.type)&&(i=await n.render(r.type,r.id)),_i.set(e,i),r&&dt.set(mt(r),!0),i}async function Pr(r){let e=mt(r);if(dt.has(e))return dt.get(e);let t=!1,i=Le.services.find(n=>n.name===r.service);return i?.types.includes(r.type)&&(t=await i.validate(r.type,r.id)),dt.set(e,t),t}w();var vi=/^[^-_][a-z0-9-_]+[^-_]$/i,wo=["spotify","soundcloud","appleMusic","tidal"],yo={name:"song.link",label:"song.link",hosts:["song.link","album.link","artist.link","pods.link","playlist.link","mylink.page","odesli.co"],async parse(r,e,t){let[i,n,s]=t;if(!i||s||n&&!vi.test(n))return null;if(!n&&!vi.test(i))return null;let c=(await H({url:r})).text,o=Ir(c)?.props?.pageProps?.pageData?.sections;if(!o)return null;let h=o.flatMap(f=>f.links??[]).filter(f=>f.url&&f.platform);for(let f of wo){let d=h.find(g=>g.platform===f);if(d){let g=await Ke(d.url);if(g)return g}}return null}},At=new Map;function ko(r,e){return{retrieve(...t){if(At.has(r))return At.get(r);let i=e(...t);return i instanceof Promise?i.then(n=>(At.set(r,n),n)):(At.set(r,i),i)}}}var Rr="us",bo="songspotlight";function wi(r,e){return`https://music.apple.com/${Rr}/${r}/${bo}/${e}`}var yi=ko("applemusicToken",async r=>{r??=(await H({url:`https://music.apple.com/${Rr}/new`})).text;let e=r.match(/src="(\/assets\/index~\w+\.js)"/i)?.[1];if(e)return(await H({url:`https://music.apple.com${e}`})).text.match(/\w+="(ey.*?)"/i)?.[1]}),xo={name:"applemusic",label:"Apple Music",hosts:["music.apple.com","geo.music.apple.com"],types:["artist","album","playlist","song"],async parse(r,e,t){let[i,n,s,c,o]=t;if(!i||!n||!this.types.includes(n)||!s||!c||o)return null;let h=await H({url:wi(n,c)});return h.status!==200?null:(await yi.retrieve(h.text),{service:this.name,type:n,id:c})},async render(r,e){let t=await yi.retrieve();if(!t)return null;let i=await H({url:`https://amp-api.music.apple.com/v1/catalog/${Rr}/${r}s`,query:{include:"songs",ids:e},headers:{authorization:`Bearer ${t}`,origin:"https://music.apple.com"}});if(i.status!==200)return null;let{attributes:n,relationships:s}=i.json.data[0],c={label:n.name,sublabel:n.artistName??"Top songs",link:n.url,explicit:n.contentRating==="explicit"},o=n.artwork?.url?.replace(/{[wh]}/g,"128");if(r==="song"){let h=n.durationInMillis,f=n.previews?.[0]?.url;return{form:"single",...c,thumbnailUrl:o,single:{audio:f&&h?{previewUrl:f,duration:h}:void 0}}}else return{form:"list",...c,thumbnailUrl:o,list:(s.tracks?.data??s.songs?.data??[]).slice(0,15).map(({attributes:h})=>{let f=h.durationInMillis,d=h.previews?.[0]?.url;return{label:h.name,sublabel:h.artistName,link:h.url,explicit:h.contentRating==="explicit",audio:d&&f?{previewUrl:d,duration:f}:void 0}})}},async validate(r,e){return(await H({url:wi(r,e)})).status===200}},Cr="nIjtjiYnjkOhMyh5xrbqEW12DxeJVnic",Pi="1782997503";async function Ar(r,e,t){return(await H({url:`https://api-widget.soundcloud.com/${r}s/${e}${t?"/tracks":""}`,query:{format:"json",limit:"20",client_id:Cr,app_version:Pi}})).json}async function Eo(r,e){return(await H({url:"https://api-widget.soundcloud.com/tracks",query:{ids:e.join(","),playlistId:r,playlistSecretToken:"",format:"json",client_id:Cr,app_version:Pi}})).json}function ki(r){return r.format.protocol==="progressive"&&r.format.mime_type==="audio/mpeg"&&r?.url&&r?.duration}var So=.4,To=3e4;async function bi(r){let e=r.sort((t,i)=>+ki(i)-+ki(t))?.[0];if(e?.url&&e?.duration){let t=(await H({url:e.url,query:{client_id:Cr}})).json;if(!t?.url)return;if(e.duration>=1e3){let i=Math.min(To,e.duration),n=Math.ceil(e.duration*So);return{duration:e.duration,previewUrl:t.url,previewStart:n,previewSlice:Math.min(i,e.duration-n)}}else return{duration:e.duration,previewUrl:t.url}}}function xi(r){try{let e=new URL(r).searchParams.get("Policy");return e?JSON.parse(atob(e.replace(/_/g,"="))).Statement[0].Condition.DateLessThan["AWS:EpochTime"]*1e3:void 0}catch{return}}var Io={name:"soundcloud",label:"Soundcloud",hosts:["soundcloud.com","m.soundcloud.com","on.soundcloud.com"],types:["user","track","playlist"],async parse(r,e,t){if(e==="on.soundcloud.com"){if(!t[0]||t[1])return null;let{url:i,status:n}=await H({url:r});return n===200?await Ke(i):null}else{let[i,n,s,c]=t,o=!1;if((i&&!n||i&&n&&n!=="sets"&&!s||i&&n==="sets"&&s&&!c)&&(o=!0),!o)return null;let h=(await H({url:"https://soundcloud.com/oembed",query:{format:"json",url:r}})).json;if(!h?.html)return null;let f=h.html.match(/w\.soundcloud\.com.*?url=(.*?)[&"]/)?.[1];if(!f)return null;let d=decodeURIComponent(f).split(/\/+/),g=d[2],u=d[3];return!g||!u?null:{service:this.name,type:g.slice(0,-1),id:u}}},async render(r,e){let t=await Ar(r,e);if(!t?.id)return null;let i={label:t.title??t.username,sublabel:t.user?.username??"Top tracks",link:t.permalink_url,explicit:!!t.publisher_metadata?.explicit},n=t.artwork_url??t.avatar_url;if(r==="track"){let s=await bi(t.media?.transcodings??[]).catch(()=>{});return{form:"single",...i,thumbnailUrl:n,single:{audio:s},expiresAt:s?xi(s.previewUrl):void 0}}else{let s=[];if(r==="user"){let h=await Ar(r,e,!0).catch(()=>{});h?.collection&&(s=h.collection)}else if(t.tracks){s=t.tracks;let h=s.filter(d=>d.policy==="ALLOW"&&!d.uri).map(d=>d.id).slice(0,15),f=h.length>=1&&await Eo(e,h);if(f)for(let d=0;d<s.length;d++){let g=f.find(u=>u.id===s[d]?.id);g&&(s[d]=g)}}let c=await Promise.all(s.filter(h=>h.uri).slice(0,15).map(async h=>({label:h.title,sublabel:h.user?.username??"unknown",link:h.permalink_url,explicit:!!h.publisher_metadata.explicit,audio:await bi(h.media?.transcodings??[]).catch(()=>{})}))),o=c.map(({audio:h})=>h?xi(h.previewUrl):void 0).filter(h=>typeof h=="number");return{form:"list",...i,thumbnailUrl:n,list:c,expiresAt:o[0]?Math.min(...o):void 0}}},async validate(r,e){return(await Ar(r,e))?.id!==void 0}};async function Ei(r,e){return Ir((await H({url:`https://open.spotify.com/embed/${r}/${e}`})).text)}function Si(r){let[e,t,i]=r.split(":");return e==="spotify"&&t&&i?`https://open.spotify.com/${t}/${i}`:null}var Do={name:"spotify",label:"Spotify",hosts:["open.spotify.com"],types:["track","album","playlist","artist"],async parse(r,e,t){let[i,n,s]=t;return!i||!this.types.includes(i)||!n||s||!await this.validate(i,n)?null:{service:this.name,type:i,id:n}},async render(r,e){let t=(await Ei(r,e))?.props?.pageProps?.state?.data?.entity;if(!t)return null;let i={label:t.title,sublabel:t.subtitle??t.artists?.map(s=>s.name).join(", "),link:Si(t.uri),explicit:!!t.isExplicit},n=t.visualIdentity.image.sort((s,c)=>s.maxWidth-c.maxWidth)[0]?.url.replace(/:\/\/.*?\.spotifycdn\.com\/image/,"://i.scdn.co/image");return r==="track"?{form:"single",...i,thumbnailUrl:n,single:{audio:t.audioPreview&&t.duration?{duration:t.duration,previewUrl:t.audioPreview.url}:void 0}}:{form:"list",...i,thumbnailUrl:n,list:(t.trackList??[]).slice(0,15).map(s=>({label:s.title,sublabel:s.subtitle??s.artists?.map(c=>c.name).join(", "),link:Si(s.uri),explicit:!!s.isExplicit,audio:s.audioPreview&&s.duration?{duration:s.duration,previewUrl:s.audioPreview.url}:void 0}))}},async validate(r,e){return!(await Ei(r,e))?.props?.pageProps?.title}},Po="vNVdglQOjFJJGG2U";async function Rt(r,e,t="",i={}){return await H({url:`https://api.tidal.com/v1/${r}s/${e}/${t}`,query:{countryCode:"US",...i},headers:{"X-Tidal-Token":Po}}).then(n=>n.ok?n.json:void 0)}async function Ti(r){let e=await Rt("track",r,"playbackinfo",{audioquality:"HIGH",playbackmode:"STREAM",assetpresentation:"FULL"});if(e?.manifest)return JSON.parse(atob(e.manifest)).urls[0]}function Ii(r){try{let e=new URL(r);return e.protocol="https://",e.toString()}catch{return r}}function Di(r){try{let e=new URL(r).searchParams.get("token");if(!e)return;let t=Number(e.split("~")[0]);return Number.isNaN(t)?void 0:t*1e3}catch{return}}var Mr=[xo,Io,Do,{name:"tidal",label:"Tidal",hosts:["tidal.com","www.tidal.com","listen.tidal.com"],types:["artist","album","playlist","track"],async parse(r,e,t){let[i,n,s,c]=t,o=s&&c?s:i,h=s&&c?c:n;return!o||!this.types.includes(o)||!h||o==="playlist"&&!/^[-a-f0-9]+$/.test(h)||o!=="playlist"&&Number.isNaN(Number(h))||!await this.validate(o,h)?null:{service:this.name,type:o,id:h}},async render(r,e){let t=await Rt(r,e);if(!t)return null;let i=t.type==="playlist"?"TIDAL":"Top tracks",n={label:t.title||t.name||"Unknown",sublabel:t.artists?.map(o=>o.name).join(", ")||t.creator?.name||i,link:Ii(t.url),explicit:!!t.explicit},s=t.picture??t.squareImage??t.cover,c=s?`https://resources.tidal.com/images/${s.replace(/-/g,"/")}/160x160.jpg`:void 0;if(r==="track"){let o=t.duration&&await Ti(e).catch(()=>{});return{form:"single",...n,thumbnailUrl:c,single:{audio:o&&t.duration?{previewUrl:o,duration:t.duration*1e3}:void 0},expiresAt:o?Di(o):void 0}}else{let o=await Rt(r,e,r==="artist"?"toptracks":"tracks",{limit:String(15)}),h=await Promise.all(o?.items.slice(0,15).map(async d=>{let g=d.duration&&await Ti(d.id).catch(()=>{});return{label:d.title,sublabel:d.artists.map(u=>u.name).join(", "),link:Ii(d.url),explicit:!!d.explicit,audio:g&&d.duration?{previewUrl:g,duration:d.duration*1e3}:void 0}})??[]),f=h.map(({audio:d})=>d?Di(d.previewUrl):void 0).filter(d=>typeof d=="number");return{form:"list",...n,thumbnailUrl:c,list:h,expiresAt:f[0]?Math.min(...f):void 0}}},async validate(r,e){return!!await Rt(r,e)}}];Le.services=Mr;var Ai=[yo,...Mr];Le.parsers=Ai;w();var Ri=require("electron");Tr(Ri.net.fetch);async function Ro(r,e){return Ke(e)}async function Co(r,e){return Dr(e)}async function Mo(r,e){return Pr(e)}var Lr={};F(Lr,{downloadTheme:()=>Lo,themeExists:()=>No});w();me();var Ct=require("fs");function Ci(r){return r?.name?He(ue,`${r.name}.theme.css`):null}async function No(r,e){let t=Ci(e);return t?(0,Ct.existsSync)(t):!1}async function Lo(r,e){if(!e?.content||!e?.name||!e?.id)return;let t=Ci(e);if(!t)throw new Error("Invalid theme name");let n=await(await fetch(`https://themes.equicord.org/api/download/${encodeURIComponent(e.id)}`)).text();(0,Ct.writeFileSync)(t,n)}var Ur={};F(Ur,{makeDeeplTranslateRequest:()=>Uo,makeKagiTranslateRequest:()=>Oo});w();async function Uo(r,e,t,i){let n=e?"https://api.deepl.com/v2/translate":"https://api-free.deepl.com/v2/translate";try{let s=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`DeepL-Auth-Key ${t}`},body:i}),c=await s.text();return{status:s.status,data:c}}catch(s){return{status:-1,data:String(s)}}}async function Oo(r,e,t,i,n){let s="https://translate.kagi.com/api/translate";try{let c=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Cookie:`kagi_session=${e}`},body:JSON.stringify({text:t,from:i,to:n,model:"standard"})}),o=await c.json();return{status:c.status,data:o}}catch(c){return{status:-1,data:String(c)}}}var Zr={};F(Zr,{ensurePluginsDirectory:()=>Bo,getUserplugins:()=>Xi,initPluginInstall:()=>Ho,isUpdateAvailableForPlugin:()=>Wo,openGitPathModal:()=>Jo,rmPlugin:()=>Go,updatePlugin:()=>Yo});w();ae();var Ie=require("child_process"),L=require("electron"),Te=require("fs"),K=require("fs/promises"),N=require("path"),Wr=Re(Vi());var Zi=`<!DOCTYPE html>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Review userplugin</title>
- document.addEventListener("DOMContentLoaded", () => {
- document
- .querySelector("#abort")
- document.title = "abortInstall";
- .querySelector("#install")
- !document
- .querySelector("style")
- .innerHTML.includes(
- "#native-ts-warning { display: none !important; }"
- !document.querySelector("input[type='checkbox']")
- .checked
- return alert(
- "Make sure to acknowledge all warnings before installing."
- document.title = "install";
- document.querySelector("style").innerHTML +=
- document.querySelector("addAtRuntimeStyle").innerHTML;
- <style>
- addAtRuntimeStyle {
- display: none !important;
- font-family: sans-serif;
- color: #cdd6f4;
- background-color: #1e1e2e;
- padding: 10px;
- display: flex;
- flex-direction: column;
- .card {
- padding: 10px 12px;
- border: 1px solid #9399b2;
- border-radius: 10px;
- margin-bottom: 10px; /* Added margin for better spacing */
- .warn-card {
- border-color: #f38ba8;
- background-color: #313244;
- .danger-card {
- color: #cdd6f4;
- .card * {
- margin: 0;
- .card h3 {
- margin-bottom: 5px;
- input[type="checkbox"] {
- margin-right: 5px;
- #validate {
- color: #f38ba8;
- margin: 5px;
- padding: 10px 5px;
- border: 1px solid #cdd6f4;
- border-radius: 5px;
- background-color: #f38ba8;
- color: #11111b;
- #install {
- color: #a6e3a1;
- border-color: #a6e3a1;
- background-color: #00000000;
- #abort:hover {
- background-color: #ec9393;
- font-weight: bold;
- #install:hover {
- background-color: #425040;
- <addAtRuntimeStyle>
- %WARNINGHIDER% %NATIVETSHIDER% %PRESENDHIDER%
- </addAtRuntimeStyle>
- <h2>Plugin info</h2>
- <div class="card" id="plugin-info-card">
- <h3>%PLUGINNAME%</h3>
- <h2 data-useless="warning">Warnings</h2>
- data-useless="warning"
- class="card danger-card"
- id="native-ts-warning"
- <h3>Uses a native.ts file</h3>
- Use of this file allows the plugin to escape the browser sandbox
- and potentially do anything to your system and data.
- >ONLY INSTALL THIS PLUGIN AFTER REVIEWING THE CODE AND BEING
- 100% SURE THAT NOTHING BAD CAN BE DONE!</b
- <input type="checkbox" /> Acknowledge warning (required to allow
- install)
- class="card warn-card"
- id="pre-send-warning"
- <h3>Has pre-send listeners</h3>
- This allows the plugin to edit your messages before they are
- sent.
- Reminder: installing a userplugin can be a destructive action. Make
- sure that you know and trust the developer before installing any.
- <button id="abort">Cancel installation</button>
- <button id="install">Install plugin</button>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Git Path</title>
- document.addEventListener("DOMContentLoaded", () => {
- document.title
- document.querySelector("#abort").addEventListener("click", () => {document.title = "abort";})
- document.querySelector("#check").addEventListener("click", () => {document.title = \`check-\${document.querySelector("input").value.trim()}\`; setTimeout(() => {document.title = "git";}, 1000)})
- document.querySelector("#install").addEventListener("click", () => {document.title = \`ok-\${document.querySelector("input").value.trim()}\`;})
- <style>
- font-family: sans-serif;
- color: #cdd6f4;
- background-color: #1e1e2e;
- padding: 10px;
- display: flex;
- flex-direction: column;
- margin: 5px;
- padding: 10px 5px;
- border: 1px solid #cdd6f4;
- border-radius: 5px;
- border-color: #f38ba8;
- color: #f38ba8;
- background-color: #00000000;
- #install {
- color: #a6e3a1;
- border-color: #a6e3a1;
- color: #a1afe3;
- border-color: #a1afe3;
- #abort:hover {
- background-color: #504040;
- font-weight: bold;
- #check:hover {
- background-color: #404550;
- #install:hover {
- background-color: #425040;
- input {
- background-color: #313244;
- padding: 5px 10px;
- margin-bottom: 15px;
- border: 1px solid #6c7086;
- outline: none;
- border: 2px solid #cdd6f4;
- padding: 4px 9px;
- &::placeholder {
- color: #6c7086;
- If you're having issues downloading userplugins because Git isn't properly detected, you can manually set a Git
- path
- that'll be used instead of
- simply looking in PATH.
No strings match this filter.
Stack and decoded strings were not recovered: no reason was recorded. Only literal strings present in the file are listed above.
Disassembly
entry point · x86 · 60 insns (listing capped)Nothing in this view
This sample produced no results for this part of the static analysis.
Import fingerprint
no related sample| Fingerprint | 3:rGsLdAIEK:tf |
|---|---|
| Imports read | 1 function from 1 library (1 distinct) |
| Comparable | no (fewer than 8 distinct imports) |
No comparison was run: this import table is not distinctive enough for a match to mean anything.
AI security review
not on this plan paid plansAI security review is on the paid plans
On a paid scan a model reads the decompiled code end to end and returns a verdict with the lines it rests on, above the source.
Nothing is being withheld here. No model read this assembly, so no verdict is stored behind the lock. Findings, the type tree and the full decompiled source below are on every plan and are unaffected.
Decompiled .NET source
C# 15 types · 2545 linesDecompiled from IL. Every type defined in the assembly is listed below; on a merged or packed sample some of it belongs to a bundled library rather than to the author. Behaviour review and the AI layer read only the author's own types.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
[assembly: AssemblyTitle("Endcord Installer")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyDescription("Official Endcord desktop installer. Installs, repairs, or removes the open-source Endcord Discord client modification. Source: https://github.com/rootpoii/endcord")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Endcord")]
[assembly: AssemblyProduct("Endcord")]
[assembly: AssemblyCopyright("Copyright © 2026 Endcord. Licensed under GPL-3.0-or-later.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyFileVersion("4.0.23.0")]
[assembly: AssemblyInformationalVersion("4.0.23")]
[assembly: ComVisible(false)]
[assembly: Guid("e8760626-8dd3-498f-abb9-eeac29266e0b")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyVersion("4.0.23.0")]
namespace EndcordInstaller;
internal static class Program
{
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run((Form)(object)new MainForm());
}
}
internal static class AppFiles
{
public static void CloseByName(string processName)
{
try
{
string text = processName;
if (text.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
{
text = text.Substring(0, text.Length - 4);
}
Process[] processesByName = Process.GetProcessesByName(text);
foreach (Process process in processesByName)
{
try
{
if (!process.HasExited)
{
process.CloseMainWindow();
if (!process.WaitForExit(8000) && !process.HasExited)
{
process.Kill();
}
}
}
catch
{
}
try
{
process.Dispose();
}
catch
{
}
}
}
catch
{
}
}
public static void DeleteDirectory(string path)
{
try
{
if (Directory.Exists(path))
{
Directory.Delete(path, recursive: true);
}
}
catch
{
try
{
string[] files = Directory.GetFiles(path, "*", SearchOption.AllDirectories);
foreach (string path2 in files)
{
try
{
File.SetAttributes(path2, FileAttributes.Normal);
File.Delete(path2);
}
catch
{
}
}
string[] directories = Directory.GetDirectories(path, "*", SearchOption.AllDirectories);
foreach (string path3 in directories)
{
try
{
Directory.Delete(path3, recursive: true);
}
catch
{
}
}
Directory.Delete(path, recursive: true);
}
catch
{
}
}
}
}
internal static class C
{
public static readonly Color Bg = Color.FromArgb(10, 11, 18);
public static readonly Color Sidebar = Color.FromArgb(16, 17, 28);
public static readonly Color Card = Color.FromArgb(23, 25, 42);
public static readonly Color CardHov = Color.FromArgb(31, 33, 56);
public static readonly Color CardSel = Color.FromArgb(28, 32, 68);
public static readonly Color Accent = Color.FromArgb(99, 102, 241);
public static readonly Color AccentLight = Color.FromArgb(129, 140, 248);
public static readonly Color AccentLo = Color.FromArgb(55, 58, 140);
public static readonly Color Green = Color.FromArgb(16, 185, 129);
public static readonly Color GreenBg = Color.FromArgb(25, 16, 185, 129);
public static readonly Color Red = Color.FromArgb(239, 68, 68);
public static readonly Color Amber = Color.FromArgb(245, 158, 11);
public static readonly Color AmberBg = Color.FromArgb(25, 245, 158, 11);
public static readonly Color Blue = Color.FromArgb(59, 130, 246);
public static readonly Color Text = Color.FromArgb(243, 244, 246);
public static readonly Color TextDim = Color.FromArgb(156, 163, 175);
public static readonly Color TextDark = Color.FromArgb(75, 85, 99);
public static readonly Color Border = Color.FromArgb(31, 41, 55);
public static readonly Color BorderLight = Color.FromArgb(55, 65, 81);
}
internal static class F
{
public static readonly Font LargeTitle = new Font("Segoe UI", 15f, (FontStyle)1);
public static readonly Font Title = new Font("Segoe UI Semibold", 10.5f, (FontStyle)1);
public static readonly Font Subtitle = new Font("Segoe UI", 8.5f, (FontStyle)0);
public static readonly Font Code = new Font("Consolas", 8.5f, (FontStyle)0);
public static readonly Font TabText = new Font("Segoe UI Semibold", 9.5f, (FontStyle)1);
public static readonly Font ButtonText = new Font("Segoe UI Semibold", 10f, (FontStyle)1);
public static readonly Font LabelText = new Font("Segoe UI", 8.5f, (FontStyle)0);
public static readonly Font MutedText = new Font("Segoe UI", 7.5f, (FontStyle)0);
}
internal static class Gfx
{
public static float GlobalTick;
public static GraphicsPath RoundRect(Rectangle r, int rad)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Expected O, but got Unknown
GraphicsPath val = new GraphicsPath();
int num = rad * 2;
val.AddArc(r.X, r.Y, num, num, 180f, 90f);
val.AddArc(r.Right - num, r.Y, num, num, 270f, 90f);
val.AddArc(r.Right - num, r.Bottom - num, num, num, 0f, 90f);
val.AddArc(r.X, r.Bottom - num, num, num, 90f, 90f);
val.CloseFigure();
return val;
}
public static void FillRoundRect(Graphics g, Rectangle r, int rad, Color color)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Expected O, but got Unknown
GraphicsPath val = RoundRect(r, rad);
try
{
SolidBrush val2 = new SolidBrush(color);
try
{
g.FillPath((Brush)(object)val2, val);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
public static void DrawRoundRect(Graphics g, Rectangle r, int rad, Color color, float width)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
GraphicsPath val = RoundRect(r, rad);
try
{
Pen val2 = new Pen(color, width);
try
{
g.DrawPath(val2, val);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
public static void FillGradientRoundRect(Graphics g, Rectangle r, int rad, Color c1, Color c2, float angle)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Expected O, but got Unknown
if (r.Width <= 0 || r.Height <= 0)
{
return;
}
GraphicsPath val = RoundRect(r, rad);
try
{
LinearGradientBrush val2 = new LinearGradientBrush(r, c1, c2, angle);
try
{
g.FillPath((Brush)(object)val2, val);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
public static void DrawGlow(Graphics g, Rectangle r, int rad, Color glowColor, int layers, float spread)
{
for (int num = layers; num >= 1; num--)
{
int num2 = (int)((float)(int)glowColor.A * (1f - (float)(num - 1) / (float)layers));
if (num2 > 0)
{
Color color = Color.FromArgb(Math.Min(255, num2), glowColor.R, glowColor.G, glowColor.B);
int num3 = (int)((float)num * spread);
Rectangle r2 = new Rectangle(r.X - num3, r.Y - num3, r.Width + num3 * 2, r.Height + num3 * 2);
DrawRoundRect(g, r2, Math.Max(2, rad + num3), color, 1.5f);
}
}
}
public static float Approach(float current, float target, float speed)
{
if (current < target)
{
current += speed;
if (current > target)
{
current = target;
}
}
else if (current > target)
{
current -= speed;
if (current < target)
{
current = target;
}
}
return current;
}
}
internal class DiscordClient
{
public string Name { get; set; }
public string RootPath { get; set; }
public string AppPath { get; set; }
public string ResourcesPath { get; set; }
public string ExeName { get; set; }
public string Version => Path.GetFileName(AppPath);
public bool HasEndcord()
{
try
{
if (!Directory.Exists(RootPath))
{
return false;
}
string[] directories = Directory.GetDirectories(RootPath, "app-*");
string[] array = directories;
foreach (string path in array)
{
string path2 = Path.Combine(path, "resources");
string text = Path.Combine(path2, "app");
string text2 = Path.Combine(path2, "app.asar");
if (Directory.Exists(text))
{
string path3 = Path.Combine(text, "index.js");
if (File.Exists(path3) && File.ReadAllText(path3).Contains("patcher.js"))
{
return true;
}
}
if (Directory.Exists(text2))
{
string path4 = Path.Combine(text2, "index.js");
if (File.Exists(path4) && File.ReadAllText(path4).Contains("patcher.js"))
{
return true;
}
}
}
}
catch
{
}
return false;
}
public bool IsRunning()
{
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(ExeName ?? "Discord.exe");
try
{
return Process.GetProcessesByName(fileNameWithoutExtension).Length > 0;
}
catch
{
return false;
}
}
public void CloseApp()
{
AppFiles.CloseByName(ExeName ?? "Discord.exe");
}
public void Launch()
{
try
{
string text = Path.Combine(AppPath, ExeName ?? "Discord.exe");
if (!File.Exists(text))
{
text = Path.Combine(RootPath, ExeName ?? "Discord.exe");
}
if (File.Exists(text))
{
Process.Start(text);
}
}
catch
{
}
}
}
internal class MainForm : Form
{
private static readonly string DistPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Endcord", "dist");
private List<DiscordClient> clients = new List<DiscordClient>();
private List<ClientCard> cards = new List<ClientCard>();
private bool _updatingSelectAll;
private Timer _animTimer;
private Panel sidebarPanel;
private Panel mainContent;
private Panel titleBar;
private Panel statusBar;
private FlowLayoutPanel clientFlow;
private RichTextBox logBox;
private CustomProgress progress;
private CustomCheckBox chkAll;
private CustomCheckBox chkRestart;
private CustomLink btnRefresh;
private CustomLink btnAddPath;
private Label lblStatus;
private CustomActionButton btnAction;
private SidebarTab[] sidebarTabs = new SidebarTab[4];
private static readonly Image LogoImg = GetEmbeddedLogo();
private int activeTab;
private static readonly string[] tabTitlesText = new string[4] { "Install", "Uninstall", "Repair", "Close Discord" };
[DllImport("Gdi32.dll")]
private static extern IntPtr CreateRoundRectRgn(int nLeft, int nTop, int nRight, int nBottom, int nWidthEllipse, int nHeightEllipse);
[DllImport("gdi32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DeleteObject(IntPtr hObject);
private static Image GetEmbeddedLogo()
{
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Expected O, but got Unknown
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Expected O, but got Unknown
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Expected O, but got Unknown
try
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
string[] manifestResourceNames = executingAssembly.GetManifestResourceNames();
foreach (string text in manifestResourceNames)
{
if (!text.EndsWith("app_logo.png", StringComparison.OrdinalIgnoreCase) && !text.EndsWith("logo.png", StringComparison.OrdinalIgnoreCase))
{
continue;
}
using Stream stream = executingAssembly.GetManifestResourceStream(text);
if (stream != null)
{
return Image.FromStream(stream);
}
}
}
catch
{
}
try
{
string text2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "app_logo.png");
if (File.Exists(text2))
{
return Image.FromFile(text2);
}
}
catch
{
}
try
{
Bitmap val = new Bitmap(28, 28);
Graphics val2 = Graphics.FromImage((Image)(object)val);
try
{
val2.SmoothingMode = (SmoothingMode)4;
Brush val3 = (Brush)new LinearGradientBrush(new Rectangle(0, 0, 28, 28), Color.FromArgb(88, 101, 242), Color.FromArgb(114, 137, 218), 45f);
try
{
val2.FillEllipse(val3, 0, 0, 28, 28);
}
finally
{
((IDisposable)val3)?.Dispose();
}
Font val4 = new Font("Segoe UI", 12f, (FontStyle)1);
try
{
TextRenderer.DrawText((IDeviceContext)(object)val2, "E", val4, new Rectangle(0, 0, 28, 28), Color.White, (TextFormatFlags)5);
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
return (Image)(object)val;
}
catch
{
}
return null;
}
public MainForm()
{
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Expected O, but got Unknown
((Control)this).SetStyle((ControlStyles)204802, true);
try
{
((Form)this).Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
}
catch
{
}
((Control)this).SuspendLayout();
BuildUI();
((Control)this).ResumeLayout(false);
_animTimer = new Timer();
_animTimer.Interval = 25;
_animTimer.Tick += delegate
{
Gfx.GlobalTick += 0.05f;
if (Gfx.GlobalTick > 1000f)
{
Gfx.GlobalTick = 0f;
}
if (titleBar != null)
{
((Control)titleBar).Invalidate();
}
if (statusBar != null)
{
((Control)statusBar).Invalidate();
}
if (sidebarPanel != null)
{
((Control)sidebarPanel).Invalidate();
}
if (btnAction != null)
{
((Control)btnAction).Invalidate();
}
if (chkAll != null)
{
((Control)chkAll).Invalidate();
}
if (chkRestart != null)
{
((Control)chkRestart).Invalidate();
}
if (btnRefresh != null)
{
((Control)btnRefresh).Invalidate();
}
if (btnAddPath != null)
{
((Control)btnAddPath).Invalidate();
}
if (progress != null && ((Control)progress).Visible)
{
((Control)progress).Invalidate();
}
foreach (ClientCard card in cards)
{
((Control)card).Invalidate();
}
for (int i = 0; i < sidebarTabs.Length; i++)
{
if (sidebarTabs[i] != null)
{
((Control)sidebarTabs[i]).Invalidate();
}
}
};
_animTimer.Start();
RefreshClients();
}
protected override void OnResize(EventArgs e)
{
((Form)this).OnResize(e);
IntPtr intPtr = CreateRoundRectRgn(0, 0, ((Control)this).Width, ((Control)this).Height, 20, 20);
((Control)this).Region = Region.FromHrgn(intPtr);
DeleteObject(intPtr);
}
private void UpdateSelectAllState()
{
if (_updatingSelectAll)
{
return;
}
_updatingSelectAll = true;
try
{
bool @checked = cards.Count > 0;
foreach (ClientCard card in cards)
{
if (!card.Selected)
{
@checked = false;
break;
}
}
chkAll.Checked = @checked;
}
finally
{
_updatingSelectAll = false;
}
}
private void BuildUI()
{
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Expected O, but got Unknown
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Expected O, but got Unknown
//IL_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Expected O, but got Unknown
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: Expected O, but got Unknown
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02d3: Expected O, but got Unknown
//IL_0308: Unknown result type (might be due to invalid IL or missing references)
//IL_0312: Expected O, but got Unknown
//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
//IL_0408: Unknown result type (might be due to invalid IL or missing references)
//IL_040f: Expected O, but got Unknown
//IL_050e: Unknown result type (might be due to invalid IL or missing references)
//IL_0518: Expected O, but got Unknown
//IL_0562: Unknown result type (might be due to invalid IL or missing references)
//IL_066d: Unknown result type (might be due to invalid IL or missing references)
//IL_0677: Expected O, but got Unknown
//IL_06d6: Unknown result type (might be due to invalid IL or missing references)
((Control)this).Text = "Endcord Installer";
((Form)this).ClientSize = new Size(880, 620);
((Control)this).MinimumSize = new Size(880, 620);
((Control)this).BackColor = C.Bg;
((Control)this).ForeColor = C.Text;
((Form)this).FormBorderStyle = (FormBorderStyle)0;
((Form)this).StartPosition = (FormStartPosition)1;
titleBar = (Panel)(object)new DBPanel();
((Control)titleBar).Dock = (DockStyle)1;
((Control)titleBar).Height = 44;
((Control)titleBar).BackColor = C.Sidebar;
((Control)titleBar).Paint += (PaintEventHandler)delegate(object s, PaintEventArgs e)
{
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Expected O, but got Unknown
Graphics graphics2 = e.Graphics;
graphics2.TextRenderingHint = (TextRenderingHint)5;
graphics2.SmoothingMode = (SmoothingMode)4;
int num5 = 16;
if (LogoImg != null)
{
graphics2.DrawImage(LogoImg, new Rectangle(14, 8, 28, 28));
num5 = 50;
}
Font val7 = new Font("Segoe UI", 12f, (FontStyle)1);
try
{
Font val8 = new Font("Segoe UI", 11f, (FontStyle)0);
try
{
Size size = TextRenderer.MeasureText((IDeviceContext)(object)graphics2, "Endcord", val7);
int num6 = (((Control)titleBar).Height - size.Height) / 2;
TextRenderer.DrawText((IDeviceContext)(object)graphics2, "Endcord", val7, new Point(num5, num6), Color.White);
TextRenderer.DrawText((IDeviceContext)(object)graphics2, "Installer", val8, new Point(num5 + size.Width - 4, num6 + 1), Color.FromArgb(140, 155, 230));
}
finally
{
((IDisposable)val8)?.Dispose();
}
}
finally
{
((IDisposable)val7)?.Dispose();
}
Pen val9 = new Pen(Color.FromArgb(30, C.BorderLight), 1f);
try
{
graphics2.DrawLine(val9, 0, ((Control)titleBar).Height - 1, ((Control)titleBar).Width, ((Control)titleBar).Height - 1);
}
finally
{
((IDisposable)val9)?.Dispose();
}
};
Control val = WinBtn("r", C.Red, (DockStyle)4);
Control val2 = WinBtn("0", C.TextDim, (DockStyle)4);
val.Click += delegate
{
Application.Exit();
};
val2.Click += delegate
{
((Form)this).WindowState = (FormWindowState)1;
};
((Control)titleBar).Controls.Add(val2);
((Control)titleBar).Controls.Add(val);
bool drag = false;
Point dp = Point.Empty;
((Control)titleBar).MouseDown += (MouseEventHandler)delegate(object s, MouseEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Invalid comparison between Unknown and I4
if ((int)e.Button == 1048576)
{
drag = true;
dp = e.Location;
}
};
((Control)titleBar).MouseMove += (MouseEventHandler)delegate(object s, MouseEventArgs e)
{
if (drag)
{
((Form)this).Location = new Point(((Form)this).Location.X + e.X - dp.X, ((Form)this).Location.Y + e.Y - dp.Y);
}
};
((Control)titleBar).MouseUp += (MouseEventHandler)delegate
{
drag = false;
};
sidebarPanel = (Panel)(object)new DBPanel();
((Control)sidebarPanel).Dock = (DockStyle)3;
((Control)sidebarPanel).Width = 210;
((Control)sidebarPanel).BackColor = C.Sidebar;
string[] array = new string[4] { "Install Endcord", "Uninstall", "Repair Install", "Close Discord" };
string[] array2 = new string[4] { "Inject client mod", "Restore vanilla", "Fix broken files", "Force exit clients" };
for (int i = 0; i < 4; i++)
{
int idx = i;
SidebarTab sidebarTab = new SidebarTab(array[i], array2[i], idx == 0);
((Control)sidebarTab).Top = 16 + i * 62;
((Control)sidebarTab).Left = 10;
((Control)sidebarTab).Width = 190;
((Control)sidebarTab).Click += delegate
{
SwitchTab(idx);
};
sidebarTabs[i] = sidebarTab;
((Control)sidebarPanel).Controls.Add((Control)(object)sidebarTab);
}
((Control)sidebarPanel).Paint += (PaintEventHandler)delegate(object s, PaintEventArgs e)
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Expected O, but got Unknown
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Expected O, but got Unknown
Graphics graphics = e.Graphics;
graphics.SmoothingMode = (SmoothingMode)4;
int num = ((Control)sidebarPanel).Width - 1;
Pen val4 = new Pen(Color.FromArgb(35, C.BorderLight), 1f);
try
{
graphics.DrawLine(val4, num, 0, num, ((Control)sidebarPanel).Height);
}
finally
{
((IDisposable)val4)?.Dispose();
}
int num2 = 86;
float num3 = ((Control)sidebarPanel).Height + num2 + 50;
float num4 = (float)(((Control)sidebarPanel).Height + 25) - Gfx.GlobalTick * 48f % num3;
Rectangle rectangle = new Rectangle(num - 2, (int)num4, 5, num2);
if (rectangle.Height > 2)
{
try
{
LinearGradientBrush val5 = new LinearGradientBrush(rectangle, Color.Transparent, Color.FromArgb(120, Color.White), 90f);
try
{
ColorBlend val6 = new ColorBlend(3);
val6.Colors = new Color[3]
{
Color.Transparent,
Color.FromArgb(130, Color.White),
Color.Transparent
};
val6.Positions = new float[3] { 0f, 0.5f, 1f };
val5.InterpolationColors = val6;
graphics.FillRectangle((Brush)(object)val5, rectangle);
}
finally
{
((IDisposable)val5)?.Dispose();
}
}
catch
{
}
}
};
statusBar = (Panel)(object)new DBPanel();
((Control)statusBar).Dock = (DockStyle)2;
((Control)statusBar).Height = 36;
((Control)statusBar).BackColor = C.Sidebar;
lblStatus = new Label();
((Control)lblStatus).Font = F.Subtitle;
((Control)lblStatus).ForeColor = C.TextDim;
((Control)lblStatus).Location = new Point(16, 9);
((Control)lblStatus).AutoSize = true;
((Control)lblStatus).Text = "Ready";
((Control)statusBar).Controls.Add((Control)(object)lblStatus);
progress = new CustomProgress();
((Control)progress).Dock = (DockStyle)4;
((Control)progress).Width = 220;
((Control)progress).Visible = false;
((Control)statusBar).Controls.Add((Control)(object)progress);
mainContent = (Panel)(object)new DBPanel();
((Control)mainContent).Dock = (DockStyle)5;
((Control)mainContent).Padding = new Padding(20, 16, 20, 16);
DBPanel dBPanel = new DBPanel();
((Control)dBPanel).Dock = (DockStyle)1;
((Control)dBPanel).Height = 32;
Label val3 = new Label();
((Control)val3).Text = "DETECTED DISCORD INSTALLATIONS";
((Control)val3).Font = F.MutedText;
((Control)val3).ForeColor = C.TextDark;
((Control)val3).Location = new Point(0, 8);
((Control)val3).AutoSize = true;
((Control)dBPanel).Controls.Add((Control)(object)val3);
btnRefresh = new CustomLink("Refresh");
((Control)btnRefresh).Dock = (DockStyle)4;
((Control)btnRefresh).Width = 65;
((Control)btnRefresh).Click += delegate
{
RefreshClients();
};
((Control)dBPanel).Controls.Add((Control)(object)btnRefresh);
btnAddPath = new CustomLink("+ Custom Path");
((Control)btnAddPath).Dock = (DockStyle)4;
((Control)btnAddPath).Width = 100;
((Control)btnAddPath).Click += BtnAddPath_Click;
((Control)dBPanel).Controls.Add((Control)(object)btnAddPath);
((Control)mainContent).Controls.Add((Control)(object)dBPanel);
clientFlow = new FlowLayoutPanel();
((Control)clientFlow).Dock = (DockStyle)1;
((Control)clientFlow).Height = 240;
((ScrollableControl)clientFlow).AutoScroll = true;
clientFlow.WrapContents = false;
clientFlow.FlowDirection = (FlowDirection)1;
((Control)clientFlow).Padding = new Padding(0, 4, 0, 4);
((Control)clientFlow).SizeChanged += delegate
{
int width = ((((Control)clientFlow).ClientSize.Width > 200) ? (((Control)clientFlow).ClientSize.Width - 2) : 628);
foreach (ClientCard card in cards)
{
((Control)card).Width = width;
}
};
((Control)mainContent).Controls.Add((Control)(object)clientFlow);
DBPanel dBPanel2 = new DBPanel();
((Control)dBPanel2).Dock = (DockStyle)1;
((Control)dBPanel2).Height = 32;
chkAll = new CustomCheckBox("Select All");
((Control)chkAll).Location = new Point(0, 4);
((Control)chkAll).Width = 100;
chkAll.CheckedChanged += delegate
{
if (_updatingSelectAll)
{
return;
}
_updatingSelectAll = true;
try
{
foreach (ClientCard card2 in cards)
{
card2.Selected = chkAll.Checked;
}
}
finally
{
_updatingSelectAll = false;
}
};
((Control)dBPanel2).Controls.Add((Control)(object)chkAll);
chkRestart = new CustomCheckBox("Relaunch Discord after action");
((Control)chkRestart).Location = new Point(120, 4);
((Control)chkRestart).Width = 230;
chkRestart.Checked = true;
((Control)dBPanel2).Controls.Add((Control)(object)chkRestart);
((Control)mainContent).Controls.Add((Control)(object)dBPanel2);
logBox = new RichTextBox();
((Control)logBox).Dock = (DockStyle)5;
((Control)logBox).BackColor = C.Sidebar;
((Control)logBox).ForeColor = C.TextDim;
((TextBoxBase)logBox).BorderStyle = (BorderStyle)0;
((Control)logBox).Font = F.Code;
((TextBoxBase)logBox).ReadOnly = true;
((Control)logBox).Margin = new Padding(0, 12, 0, 8);
((Control)mainContent).Controls.Add((Control)(object)logBox);
DBPanel dBPanel3 = new DBPanel();
((Control)dBPanel3).Dock = (DockStyle)2;
((Control)dBPanel3).Height = 52;
btnAction = new CustomActionButton("INSTALL ENDCORD");
((Control)btnAction).Dock = (DockStyle)4;
((Control)btnAction).Width = 220;
((Control)btnAction).Click += delegate
{
if (activeTab == 3)
{
DoKill();
}
else
{
DoOperation();
}
};
((Control)dBPanel3).Controls.Add((Control)(object)btnAction);
((Control)mainContent).Controls.Add((Control)(object)dBPanel3);
((Control)this).Controls.Add((Control)(object)mainContent);
((Control)this).Controls.Add((Control)(object)sidebarPanel);
((Control)this).Controls.Add((Control)(object)statusBar);
((Control)this).Controls.Add((Control)(object)titleBar);
}
private Control WinBtn(string sym, Color hovCol, DockStyle dock)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Expected O, but got Unknown
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
Label b = new Label();
((Control)b).Text = ((sym == "r") ? "✕" : "—");
((Control)b).Font = new Font("Segoe UI", 9f, (FontStyle)1);
((Control)b).ForeColor = C.TextDim;
b.TextAlign = (ContentAlignment)32;
((Control)b).Size = new Size(44, 44);
((Control)b).Dock = dock;
((Control)b).Cursor = Cursors.Hand;
((Control)b).MouseEnter += delegate
{
((Control)b).BackColor = hovCol;
((Control)b).ForeColor = Color.White;
};
((Control)b).MouseLeave += delegate
{
((Control)b).BackColor = Color.Transparent;
((Control)b).ForeColor = C.TextDim;
};
return (Control)(object)b;
}
private void SwitchTab(int idx)
{
activeTab = idx;
for (int i = 0; i < 4; i++)
{
sidebarTabs[i].SetActive(i == idx);
}
chkAll.Checked = true;
foreach (ClientCard card in cards)
{
card.Selected = true;
}
string[] array = new string[4] { "INSTALL ENDCORD", "UNINSTALL ENDCORD", "REPAIR INSTALLATION", "CLOSE ALL DISCORD" };
((Control)btnAction).Text = array[activeTab];
SetStatus("Selected Mode: " + tabTitlesText[activeTab]);
}
private void RefreshClients()
{
clients.Clear();
cards.Clear();
((Control)clientFlow).Controls.Clear();
string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string[,] array = new string[4, 3]
{
{
"Discord Stable",
Path.Combine(folderPath, "Discord"),
"Discord.exe"
},
{
"Discord Canary",
Path.Combine(folderPath, "DiscordCanary"),
"DiscordCanary.exe"
},
{
"Discord PTB",
Path.Combine(folderPath, "DiscordPTB"),
"DiscordPTB.exe"
},
{
"Discord Dev",
Path.Combine(folderPath, "DiscordDevelopment"),
"DiscordDevelopment.exe"
}
};
List<DiscordClient> list = new List<DiscordClient>();
for (int i = 0; i < 4; i++)
{
DiscordClient client = GetClient(array[i, 0], array[i, 1], array[i, 2]);
if (client != null)
{
list.Add(client);
}
}
foreach (DiscordClient item in list)
{
clients.Add(item);
ClientCard clientCard = new ClientCard(item);
((Control)clientCard).Width = ((((Control)clientFlow).ClientSize.Width > 200) ? (((Control)clientFlow).ClientSize.Width - 2) : 628);
clientCard.Selected = true;
clientCard.SelectionChanged += delegate
{
UpdateSelectAllState();
};
cards.Add(clientCard);
((Control)clientFlow).Controls.Add((Control)(object)clientCard);
}
chkAll.Checked = true;
if (clients.Count == 0)
{
Log("No Discord installations detected on this machine.", C.Amber);
SetStatus("No Discord installations found");
}
else
{
Log("Detected " + clients.Count + " Discord client installation(s).", C.Green);
SetStatus("Ready");
}
}
private DiscordClient GetClient(string name, string root, string exe)
{
if (!Directory.Exists(root))
{
return null;
}
string[] directories = Directory.GetDirectories(root, "app-*");
if (directories.Length == 0)
{
return null;
}
Array.Sort(directories, delegate(string a, string b)
{
string input = Path.GetFileName(a).Replace("app-", "");
string input2 = Path.GetFileName(b).Replace("app-", "");
Version result;
Version result2;
return (Version.TryParse(input, out result) && Version.TryParse(input2, out result2)) ? result.CompareTo(result2) : string.Compare(a, b, StringComparison.OrdinalIgnoreCase);
});
string text = directories[^1];
string text2 = Path.Combine(text, "resources");
if (!Directory.Exists(text2))
{
return null;
}
DiscordClient discordClient = new DiscordClient();
discordClient.Name = name;
discordClient.RootPath = root;
discordClient.AppPath = text;
discordClient.ResourcesPath = text2;
discordClient.ExeName = exe;
return discordClient;
}
private bool TryAddClient(string name, string root, string exe)
{
DiscordClient client = GetClient(name, root, exe);
if (client == null)
{
return false;
}
clients.Add(client);
ClientCard clientCard = new ClientCard(client);
((Control)clientCard).Width = ((((Control)clientFlow).ClientSize.Width > 200) ? (((Control)clientFlow).ClientSize.Width - 2) : 628);
clientCard.Selected = true;
clientCard.SelectionChanged += delegate
{
UpdateSelectAllState();
};
cards.Add(clientCard);
((Control)clientFlow).Controls.Add((Control)(object)clientCard);
return true;
}
private void BtnAddPath_Click(object sender, EventArgs e)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Invalid comparison between Unknown and I4
PathDialog pathDialog = new PathDialog();
try
{
if ((int)((Form)pathDialog).ShowDialog() != 1)
{
return;
}
string text = pathDialog.SelectedPath.Trim();
if (!Directory.Exists(text))
{
Log("Directory does not exist: " + text, C.Red);
return;
}
bool flag = TryAddClient("Custom Path", text, "Discord.exe");
if (!flag)
{
DirectoryInfo parent = Directory.GetParent(text);
if (parent != null)
{
flag = TryAddClient("Custom Path", parent.FullName, "Discord.exe");
}
}
if (flag)
{
Log("Added custom path: " + text, C.Green);
}
else
{
Log("Failed to find valid Discord in: " + text, C.Red);
}
}
finally
{
((IDisposable)pathDialog)?.Dispose();
}
}
private void DoKill()
{
SetBusy(b: true);
Thread thread = new Thread((ThreadStart)delegate
{
SafeLog("Stopping all running Discord instances...", C.TextDim);
string[] array = new string[4] { "Discord", "DiscordCanary", "DiscordPTB", "DiscordDevelopment" };
string[] array2 = array;
foreach (string processName in array2)
{
try
{
AppFiles.CloseByName(processName);
}
catch
{
}
}
SafeLog("All Discord instances closed successfully.", C.Green);
((Control)this).Invoke((Delegate)(Action)delegate
{
SetBusy(b: false);
SetStatus("Discord terminated");
});
});
thread.IsBackground = true;
thread.Start();
}
private void DoOperation()
{
List<DiscordClient> targets = new List<DiscordClient>();
for (int i = 0; i < cards.Count; i++)
{
if (cards[i].Selected)
{
targets.Add(clients[i]);
}
}
if (targets.Count == 0)
{
Log("Please select at least one Discord version.", C.Amber);
return;
}
SetBusy(b: true);
progress.Value = 0;
((Control)progress).Visible = true;
Thread thread = new Thread((ThreadStart)delegate
{
try
{
SafeLog("Closing selected target Discord instances...", C.TextDim);
CloseSelectedClients(targets);
Thread.Sleep(1200);
if (activeTab == 0 || activeTab == 2)
{
DoInstall(targets, activeTab == 2);
}
else
{
DoUninstall(targets);
}
Thread.Sleep(1000);
if (chkRestart.Checked)
{
foreach (DiscordClient item in targets)
{
SafeLog("Relaunching " + item.Name + "...", C.Blue);
item.Launch();
}
}
SafeLog("Operation finished successfully.", C.Green);
}
catch (Exception ex)
{
SafeLog("Error occurred: " + ex.Message, C.Red);
}
finally
{
((Control)this).Invoke((Delegate)(Action)delegate
{
((Control)progress).Visible = false;
SetBusy(b: false);
RefreshClients();
});
}
});
thread.IsBackground = true;
thread.Start();
}
private static void SafeDeleteDir(string path)
{
if (Directory.Exists(path))
{
AppFiles.DeleteDirectory(path);
}
}
private static void SafeDeleteFile(string path)
{
if (!File.Exists(path))
{
return;
}
try
{
File.SetAttributes(path, FileAttributes.Normal);
File.Delete(path);
}
catch
{
}
}
private static List<string> FindAllDesktopCoreIndices(string appVerDir)
{
List<string> list = new List<string>();
string path = Path.Combine(appVerDir, "modules");
if (!Directory.Exists(path))
{
return list;
}
string[] directories = Directory.GetDirectories(path, "discord_desktop_core-*");
string[] array = directories;
foreach (string path2 in array)
{
string text = Path.Combine(path2, "discord_desktop_core", "index.js");
if (File.Exists(text))
{
list.Add(text);
}
}
return list;
}
private static void RestoreDesktopCore(string indexJs)
{
string path = indexJs + ".bak";
bool flag = false;
if (File.Exists(path))
{
try
{
string text = File.ReadAllText(path);
if (!text.Contains("Endcord") && text.Contains("core.asar"))
{
File.WriteAllText(indexJs, text);
flag = true;
}
}
catch
{
}
SafeDeleteFile(path);
}
if (flag)
{
return;
}
if (File.Exists(indexJs))
{
string text2 = File.ReadAllText(indexJs);
string[] array = text2.Split(new char[1] { '\n' });
List<string> list = new List<string>();
string[] array2 = array;
foreach (string text3 in array2)
{
if (!text3.Contains("Endcord") && !text3.Contains("patcher.js"))
{
list.Add(text3.TrimEnd(new char[1] { '\r' }));
}
}
string text4 = string.Join("\r\n", list).Trim();
if (!text4.Contains("core.asar"))
{
text4 = "module.exports = require('./core.asar');";
}
File.WriteAllText(indexJs, text4 + "\r\n");
}
else
{
File.WriteAllText(indexJs, "module.exports = require('./core.asar');\r\n");
}
}
private static void SafeBackupAsar(string origAsar, string backupAsar)
{
if (!File.Exists(origAsar) || (File.Exists(backupAsar) && new FileInfo(backupAsar).Length > 100000))
{
return;
}
try
{
File.Copy(origAsar, backupAsar, overwrite: true);
}
catch
{
}
}
private static void SafeRestoreAsar(string resDir)
{
string path = Path.Combine(resDir, "app");
string text = Path.Combine(resDir, "app.asar");
string text2 = Path.Combine(resDir, "_app.asar");
if (Directory.Exists(path))
{
SafeDeleteDir(path);
}
if (Directory.Exists(text))
{
SafeDeleteDir(text);
}
if (!File.Exists(text2))
{
return;
}
if (File.Exists(text))
{
SafeDeleteFile(text);
}
try
{
File.Move(text2, text);
}
catch
{
try
{
File.Copy(text2, text, overwrite: true);
SafeDeleteFile(text2);
}
catch
{
}
}
}
private void DoInstall(List<DiscordClient> targets, bool repair)
{
SafeLog(repair ? "Starting Endcord repair..." : "Starting Endcord installation...", C.AccentLight);
SetProg(5);
try
{
Directory.CreateDirectory(DistPath);
string[] array = new string[4] { "patcher.js", "preload.js", "renderer.js", "renderer.css" };
SafeLog("Copying Endcord files...", C.TextDim);
for (int i = 0; i < array.Length; i++)
{
string text = Path.Combine(DistPath, array[i]);
SafeDeleteFile(text);
ExtractRes(array[i], text);
SetProg(5 + 40 * (i + 1) / array.Length);
}
}
catch (Exception ex)
{
SafeLog("Extraction failed: " + ex.Message, C.Red);
return;
}
SafeLog("Installing Endcord into selected Discord clients...", C.TextDim);
SetProg(48);
for (int j = 0; j < targets.Count; j++)
{
DiscordClient discordClient = targets[j];
try
{
CloseClient(discordClient);
Thread.Sleep(600);
string[] directories = Directory.GetDirectories(discordClient.RootPath, "app-*");
if (directories.Length == 0)
{
SafeLog("No app-* version folders found for " + discordClient.Name, C.Red);
}
bool flag = false;
string[] array2 = directories;
foreach (string text2 in array2)
{
List<string> list = FindAllDesktopCoreIndices(text2);
foreach (string item in list)
{
RestoreDesktopCore(item);
}
string text3 = Path.Combine(text2, "resources");
if (!Directory.Exists(text3))
{
continue;
}
string text4 = Path.Combine(text3, "app");
string text5 = Path.Combine(text3, "app.asar");
string text6 = Path.Combine(text3, "_app.asar");
if (Directory.Exists(text5))
{
SafeDeleteDir(text5);
}
if (File.Exists(text5))
{
if (!File.Exists(text6) || new FileInfo(text6).Length < 100000)
{
SafeDeleteFile(text6);
File.Move(text5, text6);
}
else
{
SafeDeleteFile(text5);
}
}
if (Directory.Exists(text4))
{
SafeDeleteDir(text4);
}
Directory.CreateDirectory(text4);
File.WriteAllText(Path.Combine(text4, "package.json"), "{\n \"name\": \"discord\",\n \"main\": \"index.js\"\n}\n");
string contents = "const { join } = require('path');\nconst appData = process.env.APPDATA || (process.platform === 'darwin' ? join(process.env.HOME, 'Library/Application Support') : join(process.env.HOME, '.config'));\nconst patcherPath = join(appData, 'Endcord', 'dist', 'patcher.js');\nrequire(patcherPath);\n";
File.WriteAllText(Path.Combine(text4, "index.js"), contents);
SafeLog(" installed " + text4, C.TextDim);
flag = true;
}
if (flag)
{
SafeLog("Successfully installed Endcord into " + discordClient.Name + " (" + discordClient.Version + ")", C.Green);
}
else
{
SafeLog("No patchable paths found for " + discordClient.Name, C.Red);
}
}
catch (Exception ex2)
{
SafeLog("Failed patching " + discordClient.Name + ": " + ex2.Message, C.Red);
}
SetProg(48 + 52 * (j + 1) / targets.Count);
}
SafeLog("Operations complete.", C.AccentLight);
SetProg(100);
}
private void DoUninstall(List<DiscordClient> targets)
{
SafeLog("Removing Endcord from selected installations...", C.AccentLight);
for (int i = 0; i < targets.Count; i++)
{
DiscordClient discordClient = targets[i];
try
{
CloseClient(discordClient);
Thread.Sleep(600);
string[] directories = Directory.GetDirectories(discordClient.RootPath, "app-*");
string[] array = directories;
foreach (string text in array)
{
List<string> list = FindAllDesktopCoreIndices(text);
foreach (string item in list)
{
RestoreDesktopCore(item);
}
string text2 = Path.Combine(text, "resources");
if (Directory.Exists(text2))
{
SafeRestoreAsar(text2);
}
}
SafeLog("Successfully uninstalled from " + discordClient.Name, C.Green);
}
catch (Exception ex)
{
SafeLog("Failed to restore " + discordClient.Name + ": " + ex.Message, C.Red);
}
SetProg(100 * (i + 1) / targets.Count);
}
try
{
if (Directory.Exists(DistPath))
{
SafeDeleteDir(DistPath);
}
}
catch
{
}
SafeLog("Uninstall complete.", C.AccentLight);
}
private static void CloseClient(DiscordClient c)
{
if (c == null)
{
return;
}
try
{
c.CloseApp();
}
catch
{
}
}
private static void CloseSelectedClients(List<DiscordClient> targets)
{
foreach (DiscordClient target in targets)
{
try
{
CloseClient(target);
}
catch
{
}
}
}
private static void ExtractRes(string name, string dest)
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
string text = null;
string[] manifestResourceNames = executingAssembly.GetManifestResourceNames();
foreach (string text2 in manifestResourceNames)
{
if (string.Equals(text2, name, StringComparison.OrdinalIgnoreCase))
{
text = text2;
break;
}
}
if (text == null)
{
string[] manifestResourceNames2 = executingAssembly.GetManifestResourceNames();
foreach (string text3 in manifestResourceNames2)
{
if (text3.EndsWith(name, StringComparison.OrdinalIgnoreCase))
{
text = text3;
break;
}
}
}
if (text == null)
{
throw new Exception("Embedded asset not found: " + name);
}
using Stream stream = executingAssembly.GetManifestResourceStream(text);
using FileStream destination = new FileStream(dest, FileMode.Create);
stream.CopyTo(destination);
}
private void Log(string msg, Color col)
{
((TextBoxBase)logBox).SelectionStart = ((TextBoxBase)logBox).TextLength;
logBox.SelectionColor = col;
((TextBoxBase)logBox).AppendText(DateTime.Now.ToString("[HH:mm:ss] ") + msg + "\n");
((TextBoxBase)logBox).ScrollToCaret();
}
private void SafeLog(string m, Color c)
{
if (((Control)this).InvokeRequired)
{
((Control)this).Invoke((Delegate)(Action)delegate
{
Log(m, c);
});
}
else
{
Log(m, c);
}
}
private void SetProg(int v)
{
if (((Control)this).InvokeRequired)
{
((Control)this).Invoke((Delegate)(Action)delegate
{
progress.Value = v;
});
}
else
{
progress.Value = v;
}
}
private void SetStatus(string s)
{
if (((Control)this).InvokeRequired)
{
((Control)this).Invoke((Delegate)(Action)delegate
{
((Control)lblStatus).Text = s;
});
}
else
{
((Control)lblStatus).Text = s;
}
}
private void SetBusy(bool b)
{
((Control)btnAction).Enabled = !b;
((Control)btnRefresh).Enabled = !b;
((Control)btnAddPath).Enabled = !b;
((Control)chkAll).Enabled = !b;
}
}
internal class DBPanel : Panel
{
public DBPanel()
{
((Control)this).SetStyle((ControlStyles)204802, true);
}
}
internal class SidebarTab : Control
{
private bool _active;
private bool _hov;
private float _hoverAnim;
private float _activeAnim;
private string _title;
private string _desc;
public SidebarTab(string title, string desc, bool active)
{
_title = title;
_desc = desc;
_active = active;
_activeAnim = (active ? 1f : 0f);
((Control)this).Height = 54;
((Control)this).Cursor = Cursors.Hand;
((Control)this).DoubleBuffered = true;
((Control)this).MouseEnter += delegate
{
_hov = true;
((Control)this).Invalidate();
};
((Control)this).MouseLeave += delegate
{
_hov = false;
((Control)this).Invalidate();
};
}
public void SetActive(bool a)
{
_active = a;
((Control)this).Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics graphics = e.Graphics;
graphics.SmoothingMode = (SmoothingMode)4;
graphics.TextRenderingHint = (TextRenderingHint)5;
_hoverAnim = Gfx.Approach(_hoverAnim, _hov ? 1f : 0f, 0.12f);
_activeAnim = Gfx.Approach(_activeAnim, _active ? 1f : 0f, 0.12f);
Rectangle r = new Rectangle(0, 0, ((Control)this).Width - 1, ((Control)this).Height - 1);
if (_activeAnim > 0.01f)
{
float num = (float)(Math.Sin(Gfx.GlobalTick * 3f) * 0.5 + 0.5);
int alpha = (int)((30f + 20f * num) * _activeAnim);
Gfx.DrawGlow(graphics, r, 8, Color.FromArgb(alpha, C.AccentLight), 2, 2f);
int alpha2 = (int)(60f * _activeAnim);
int alpha3 = (int)(15f * _activeAnim);
Gfx.FillGradientRoundRect(graphics, r, 8, Color.FromArgb(alpha2, C.Accent), Color.FromArgb(alpha3, C.Accent), 90f);
int alpha4 = (int)((120f + 40f * num) * _activeAnim);
Gfx.DrawRoundRect(graphics, r, 8, Color.FromArgb(alpha4, C.AccentLight), 1f);
int num2 = (int)(24f * _activeAnim);
if (num2 > 2)
{
Rectangle r2 = new Rectangle(0, (((Control)this).Height - num2) / 2, 3, num2);
Gfx.FillRoundRect(graphics, r2, 1, Color.FromArgb((int)(255f * _activeAnim), Color.White));
}
}
if (_hoverAnim > 0.01f && _activeAnim < 0.99f)
{
float num3 = _hoverAnim * (1f - _activeAnim);
int num4 = (int)(25f * num3);
int num5 = (int)(50f * num3);
if (num4 > 0)
{
Gfx.FillRoundRect(graphics, r, 8, Color.FromArgb(num4, 30, 33, 58));
}
if (num5 > 0)
{
Gfx.DrawRoundRect(graphics, r, 8, Color.FromArgb(num5, C.AccentLight), 1f);
}
}
int num6 = 18;
float num7 = Math.Max(_activeAnim, _hoverAnim);
Color textDim = C.TextDim;
float num8 = (int)textDim.R;
Color textDim2 = C.TextDim;
int red = (int)(num8 + (float)(255 - textDim2.R) * num7);
Color textDim3 = C.TextDim;
float num9 = (int)textDim3.G;
Color textDim4 = C.TextDim;
int green = (int)(num9 + (float)(255 - textDim4.G) * num7);
Color textDim5 = C.TextDim;
float num10 = (int)textDim5.B;
Color textDim6 = C.TextDim;
Color color = Color.FromArgb(red, green, (int)(num10 + (float)(255 - textDim6.B) * num7));
TextRenderer.DrawText((IDeviceContext)(object)graphics, _title, F.TabText, new Rectangle(num6, 9, ((Control)this).Width - num6 - 10, 18), color, (TextFormatFlags)0);
Color color2;
if (_activeAnim > 0.01f)
{
Color textDark = C.TextDark;
float num11 = (int)textDark.R;
Color accentLight = C.AccentLight;
byte r3 = accentLight.R;
Color textDark2 = C.TextDark;
int red2 = (int)(num11 + (float)(r3 - textDark2.R) * _activeAnim);
Color textDark3 = C.TextDark;
float num12 = (int)textDark3.G;
Color accentLight2 = C.AccentLight;
byte g = accentLight2.G;
Color textDark4 = C.TextDark;
int green2 = (int)(num12 + (float)(g - textDark4.G) * _activeAnim);
Color textDark5 = C.TextDark;
float num13 = (int)textDark5.B;
Color accentLight3 = C.AccentLight;
byte b = accentLight3.B;
Color textDark6 = C.TextDark;
color2 = Color.FromArgb(red2, green2, (int)(num13 + (float)(b - textDark6.B) * _activeAnim));
}
else
{
Color textDark7 = C.TextDark;
float num14 = (int)textDark7.R;
Color textDim7 = C.TextDim;
byte r4 = textDim7.R;
Color textDark8 = C.TextDark;
int red3 = (int)(num14 + (float)(r4 - textDark8.R) * _hoverAnim);
Color textDark9 = C.TextDark;
float num15 = (int)textDark9.G;
Color textDim8 = C.TextDim;
byte g2 = textDim8.G;
Color textDark10 = C.TextDark;
int green3 = (int)(num15 + (float)(g2 - textDark10.G) * _hoverAnim);
Color textDark11 = C.TextDark;
float num16 = (int)textDark11.B;
Color textDim9 = C.TextDim;
byte b2 = textDim9.B;
Color textDark12 = C.TextDark;
color2 = Color.FromArgb(red3, green3, (int)(num16 + (float)(b2 - textDark12.B) * _hoverAnim));
}
TextRenderer.DrawText((IDeviceContext)(object)graphics, _desc, F.MutedText, new Rectangle(num6, 29, ((Control)this).Width - num6 - 10, 16), color2, (TextFormatFlags)0);
}
}
internal class ClientCard : Control
{
private DiscordClient dc;
private bool _sel;
private bool _hov;
private float _hoverAnim;
private float _selectAnim;
public bool Selected
{
get
{
return _sel;
}
set
{
_sel = value;
((Control)this).Invalidate();
if (this.SelectionChanged != null)
{
this.SelectionChanged(this, EventArgs.Empty);
}
}
}
public event EventHandler SelectionChanged;
public ClientCard(DiscordClient client)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
dc = client;
_selectAnim = 0f;
((Control)this).Height = 78;
((Control)this).Margin = new Padding(0, 0, 0, 8);
((Control)this).Cursor = Cursors.Hand;
((Control)this).DoubleBuffered = true;
EventHandler eventHandler = delegate
{
_hov = true;
((Control)this).Invalidate();
};
((Control)this).MouseEnter += eventHandler;
((Control)this).MouseLeave += delegate
{
_hov = false;
((Control)this).Invalidate();
};
((Control)this).Click += delegate
{
Selected = !_sel;
};
}
protected override void OnPaint(PaintEventArgs e)
{
//IL_0482: Unknown result type (might be due to invalid IL or missing references)
//IL_0489: Expected O, but got Unknown
//IL_0607: Unknown result type (might be due to invalid IL or missing references)
//IL_060e: Expected O, but got Unknown
//IL_0633: Unknown result type (might be due to invalid IL or missing references)
//IL_063a: Expected O, but got Unknown
Graphics graphics = e.Graphics;
graphics.SmoothingMode = (SmoothingMode)4;
graphics.TextRenderingHint = (TextRenderingHint)5;
_hoverAnim = Gfx.Approach(_hoverAnim, _hov ? 1f : 0f, 0.12f);
_selectAnim = Gfx.Approach(_selectAnim, _sel ? 1f : 0f, 0.12f);
Rectangle r = new Rectangle(0, 0, ((Control)this).Width - 1, ((Control)this).Height - 1);
Color card = C.Card;
byte r2 = card.R;
Color cardHov = C.CardHov;
byte r3 = cardHov.R;
Color card2 = C.Card;
int red = r2 + (int)((float)(r3 - card2.R) * _hoverAnim);
Color card3 = C.Card;
byte g = card3.G;
Color cardHov2 = C.CardHov;
byte g2 = cardHov2.G;
Color card4 = C.Card;
int green = g + (int)((float)(g2 - card4.G) * _hoverAnim);
Color card5 = C.Card;
byte b = card5.B;
Color cardHov3 = C.CardHov;
byte b2 = cardHov3.B;
Color card6 = C.Card;
int blue = b + (int)((float)(b2 - card6.B) * _hoverAnim);
Gfx.FillRoundRect(graphics, r, 10, Color.FromArgb(red, green, blue));
if (_selectAnim > 0.01f)
{
float num = (float)(Math.Sin(Gfx.GlobalTick * 3f) * 0.5 + 0.5);
int alpha = (int)((35f + 25f * num) * _selectAnim);
Gfx.DrawGlow(graphics, r, 10, Color.FromArgb(alpha, C.AccentLight), 2, 2f);
Color c = Color.FromArgb((int)(255f * _selectAnim), 38, 42, 90);
Color c2 = Color.FromArgb((int)(255f * _selectAnim), 22, 25, 54);
Gfx.FillGradientRoundRect(graphics, r, 10, c, c2, 45f);
}
Color border = C.Border;
float num2 = (int)border.R;
Color accentLight = C.AccentLight;
byte r4 = accentLight.R;
Color border2 = C.Border;
int red2 = (int)(num2 + (float)(r4 - border2.R) * (_hoverAnim * 0.4f));
Color border3 = C.Border;
float num3 = (int)border3.G;
Color accentLight2 = C.AccentLight;
byte g3 = accentLight2.G;
Color border4 = C.Border;
int green2 = (int)(num3 + (float)(g3 - border4.G) * (_hoverAnim * 0.4f));
Color border5 = C.Border;
float num4 = (int)border5.B;
Color accentLight3 = C.AccentLight;
byte b3 = accentLight3.B;
Color border6 = C.Border;
Color color = Color.FromArgb(red2, green2, (int)(num4 + (float)(b3 - border6.B) * (_hoverAnim * 0.4f)));
float num5 = (int)color.R;
Color accentLight4 = C.AccentLight;
int red3 = (int)(num5 + (float)(accentLight4.R - color.R) * _selectAnim);
float num6 = (int)color.G;
Color accentLight5 = C.AccentLight;
int green3 = (int)(num6 + (float)(accentLight5.G - color.G) * _selectAnim);
float num7 = (int)color.B;
card = C.AccentLight;
Color color2 = Color.FromArgb(red3, green3, (int)(num7 + (float)(card.B - color.B) * _selectAnim));
Gfx.DrawRoundRect(graphics, r, 10, color2, 1f);
int num8 = 26;
int num9 = ((Control)this).Height / 2;
Rectangle r5 = new Rectangle(num8 - 10, num9 - 10, 20, 20);
Gfx.FillRoundRect(graphics, r5, 6, Color.FromArgb(15, C.Bg));
card = C.TextDark;
float num10 = (int)card.R;
card = C.TextDim;
byte r6 = card.R;
card = C.TextDark;
int red4 = (int)(num10 + (float)(r6 - card.R) * _hoverAnim);
card = C.TextDark;
float num11 = (int)card.G;
card = C.TextDim;
byte g4 = card.G;
card = C.TextDark;
int green4 = (int)(num11 + (float)(g4 - card.G) * _hoverAnim);
card = C.TextDark;
float num12 = (int)card.B;
card = C.TextDim;
byte b4 = card.B;
card = C.TextDark;
Color color3 = Color.FromArgb(red4, green4, (int)(num12 + (float)(b4 - card.B) * _hoverAnim));
Gfx.DrawRoundRect(graphics, r5, 6, color3, 1.5f);
if (_selectAnim > 0.01f)
{
int alpha2 = (int)(255f * _selectAnim);
Gfx.FillRoundRect(graphics, r5, 6, Color.FromArgb(alpha2, C.Accent));
Gfx.DrawRoundRect(graphics, r5, 6, Color.FromArgb(alpha2, Color.White), 1f);
Pen val = new Pen(Color.FromArgb(alpha2, Color.White), 2f);
try
{
val.StartCap = (LineCap)2;
val.EndCap = (LineCap)2;
val.LineJoin = (LineJoin)2;
graphics.DrawLine(val, num8 - 4, num9, num8 - 1, num9 + 4);
graphics.DrawLine(val, num8 - 1, num9 + 4, num8 + 5, num9 - 3);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
int num13 = 56;
bool flag = dc.IsRunning();
card = C.Text;
float num14 = (int)card.R;
card = C.Text;
int red5 = (int)(num14 + (float)(255 - card.R) * _selectAnim);
card = C.Text;
float num15 = (int)card.G;
card = C.Text;
int green5 = (int)(num15 + (float)(255 - card.G) * _selectAnim);
card = C.Text;
float num16 = (int)card.B;
card = C.Text;
Color color4 = Color.FromArgb(red5, green5, (int)(num16 + (float)(255 - card.B) * _selectAnim));
TextRenderer.DrawText((IDeviceContext)(object)graphics, dc.Name, F.Title, new Rectangle(num13, 12, ((Control)this).Width - num13 - 170, 20), color4, (TextFormatFlags)32768);
int num17 = num13;
if (flag)
{
float num18 = (float)(Math.Sin((double)Gfx.GlobalTick * 3.5) * 0.5 + 0.5);
int alpha3 = (int)(25f + 35f * num18);
SolidBrush val2 = new SolidBrush(Color.FromArgb(alpha3, C.Green));
try
{
graphics.FillEllipse((Brush)(object)val2, num13 - 2, 35, 10, 10);
}
finally
{
((IDisposable)val2)?.Dispose();
}
SolidBrush val3 = new SolidBrush(C.Green);
try
{
graphics.FillEllipse((Brush)(object)val3, num13, 37, 6, 6);
}
finally
{
((IDisposable)val3)?.Dispose();
}
num17 += 13;
}
string text = dc.Version + (flag ? " • Running" : " • Closed");
TextRenderer.DrawText((IDeviceContext)(object)graphics, text, F.Subtitle, new Rectangle(num17, 32, ((Control)this).Width - num17 - 170, 18), flag ? C.Green : C.TextDim, (TextFormatFlags)0);
TextRenderer.DrawText((IDeviceContext)(object)graphics, dc.ResourcesPath, F.MutedText, new Rectangle(num13, 52, ((Control)this).Width - num13 - 170, 14), C.TextDark, (TextFormatFlags)32768);
string text2 = "CUSTOM";
Color color5 = C.TextDim;
Color color6 = Color.FromArgb(20, C.TextDim);
if (dc.Name.Contains("Stable"))
{
text2 = "STABLE";
color5 = C.Blue;
color6 = Color.FromArgb(30, C.Blue);
}
else if (dc.Name.Contains("Canary"))
{
text2 = "CANARY";
color5 = C.Amber;
color6 = Color.FromArgb(30, C.Amber);
}
else if (dc.Name.Contains("PTB"))
{
text2 = "PTB";
color5 = C.Accent;
color6 = Color.FromArgb(30, C.Accent);
}
else if (dc.Name.Contains("Dev"))
{
text2 = "DEV";
color5 = C.Red;
color6 = Color.FromArgb(30, C.Red);
}
Size size = TextRenderer.MeasureText(text2, F.MutedText);
bool flag2 = dc.HasEndcord();
string text3 = (flag2 ? "ENDCORD" : "VANILLA");
Color color7 = (flag2 ? C.Green : C.Amber);
Color color8 = (flag2 ? Color.FromArgb(25, C.Green) : Color.FromArgb(25, C.Amber));
Size size2 = TextRenderer.MeasureText(text3, F.MutedText);
int num19 = 16;
int y = (((Control)this).Height - 24) / 2;
int num20 = size2.Width + 18;
Rectangle rectangle = new Rectangle(((Control)this).Width - num20 - num19, y, num20, 24);
int num21 = size.Width + 16;
Rectangle rectangle2 = new Rectangle(rectangle.Left - num21 - 8, y, num21, 24);
Gfx.FillRoundRect(graphics, rectangle2, 6, color6);
Gfx.DrawRoundRect(graphics, rectangle2, 6, Color.FromArgb(120, color5), 1f);
TextRenderer.DrawText((IDeviceContext)(object)graphics, text2, F.MutedText, rectangle2, color5, (TextFormatFlags)5);
Gfx.FillRoundRect(graphics, rectangle, 6, color8);
Gfx.DrawRoundRect(graphics, rectangle, 6, Color.FromArgb(120, color7), 1f);
TextRenderer.DrawText((IDeviceContext)(object)graphics, text3, F.MutedText, rectangle, color7, (TextFormatFlags)5);
}
}
internal class CustomCheckBox : Control
{
private bool _checked;
private bool _hov;
private float _hoverAnim;
private float _checkAnim;
public bool Checked
{
get
{
return _checked;
}
set
{
_checked = value;
((Control)this).Invalidate();
if (this.CheckedChanged != null)
{
this.CheckedChanged(this, EventArgs.Empty);
}
}
}
public event EventHandler CheckedChanged;
public CustomCheckBox(string text)
{
((Control)this).Text = text;
((Control)this).Height = 22;
((Control)this).Cursor = Cursors.Hand;
((Control)this).DoubleBuffered = true;
EventHandler eventHandler = delegate
{
_hov = true;
((Control)this).Invalidate();
};
((Control)this).MouseEnter += eventHandler;
((Control)this).MouseLeave += delegate
{
_hov = false;
((Control)this).Invalidate();
};
((Control)this).Click += delegate
{
Checked = !_checked;
};
}
protected override void OnPaint(PaintEventArgs e)
{
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Expected O, but got Unknown
Graphics graphics = e.Graphics;
graphics.SmoothingMode = (SmoothingMode)4;
graphics.TextRenderingHint = (TextRenderingHint)5;
_hoverAnim = Gfx.Approach(_hoverAnim, _hov ? 1f : 0f, 0.12f);
_checkAnim = Gfx.Approach(_checkAnim, _checked ? 1f : 0f, 0.14f);
Rectangle r = new Rectangle(0, 3, 16, 16);
Color textDark = C.TextDark;
float num = (int)textDark.R;
Color textDim = C.TextDim;
byte r2 = textDim.R;
Color textDark2 = C.TextDark;
int red = (int)(num + (float)(r2 - textDark2.R) * _hoverAnim);
Color textDark3 = C.TextDark;
float num2 = (int)textDark3.G;
Color textDim2 = C.TextDim;
byte g = textDim2.G;
Color textDark4 = C.TextDark;
int green = (int)(num2 + (float)(g - textDark4.G) * _hoverAnim);
Color textDark5 = C.TextDark;
float num3 = (int)textDark5.B;
Color textDim3 = C.TextDim;
byte b = textDim3.B;
Color textDark6 = C.TextDark;
Color color = Color.FromArgb(red, green, (int)(num3 + (float)(b - textDark6.B) * _hoverAnim));
Gfx.DrawRoundRect(graphics, r, 4, color, 1.5f);
if (_checkAnim > 0.01f)
{
int alpha = (int)(255f * _checkAnim);
Gfx.FillRoundRect(graphics, r, 4, Color.FromArgb(alpha, C.Accent));
Pen val = new Pen(Color.FromArgb(alpha, Color.White), 2f);
try
{
val.StartCap = (LineCap)2;
val.EndCap = (LineCap)2;
val.LineJoin = (LineJoin)2;
graphics.DrawLine(val, 3, 10, 6, 13);
graphics.DrawLine(val, 6, 13, 12, 6);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
Color textDim4 = C.TextDim;
float num4 = (int)textDim4.R;
Color textDim5 = C.TextDim;
int red2 = (int)(num4 + (float)(255 - textDim5.R) * _hoverAnim);
Color textDim6 = C.TextDim;
float num5 = (int)textDim6.G;
Color textDim7 = C.TextDim;
int green2 = (int)(num5 + (float)(255 - textDim7.G) * _hoverAnim);
Color textDim8 = C.TextDim;
float num6 = (int)textDim8.B;
Color textDim9 = C.TextDim;
Color color2 = Color.FromArgb(red2, green2, (int)(num6 + (float)(255 - textDim9.B) * _hoverAnim));
TextRenderer.DrawText((IDeviceContext)(object)graphics, ((Control)this).Text, F.LabelText, new Rectangle(24, 0, ((Control)this).Width - 24, ((Control)this).Height), color2, (TextFormatFlags)4);
}
}
internal class CustomLink : Control
{
private bool _hov;
private float _hoverAnim;
public CustomLink(string text)
{
((Control)this).Text = text;
((Control)this).Height = 20;
((Control)this).Cursor = Cursors.Hand;
((Control)this).DoubleBuffered = true;
EventHandler eventHandler = delegate
{
_hov = true;
((Control)this).Invalidate();
};
((Control)this).MouseEnter += eventHandler;
((Control)this).MouseLeave += delegate
{
_hov = false;
((Control)this).Invalidate();
};
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics graphics = e.Graphics;
graphics.TextRenderingHint = (TextRenderingHint)5;
_hoverAnim = Gfx.Approach(_hoverAnim, _hov ? 1f : 0f, 0.12f);
Color textDim = C.TextDim;
float num = (int)textDim.R;
Color accentLight = C.AccentLight;
byte r = accentLight.R;
Color textDim2 = C.TextDim;
int red = (int)(num + (float)(r - textDim2.R) * _hoverAnim);
Color textDim3 = C.TextDim;
float num2 = (int)textDim3.G;
Color accentLight2 = C.AccentLight;
byte g = accentLight2.G;
Color textDim4 = C.TextDim;
int green = (int)(num2 + (float)(g - textDim4.G) * _hoverAnim);
Color textDim5 = C.TextDim;
float num3 = (int)textDim5.B;
Color accentLight3 = C.AccentLight;
byte b = accentLight3.B;
Color textDim6 = C.TextDim;
Color color = Color.FromArgb(red, green, (int)(num3 + (float)(b - textDim6.B) * _hoverAnim));
TextRenderer.DrawText((IDeviceContext)(object)graphics, ((Control)this).Text, F.Subtitle, new Rectangle(0, 0, ((Control)this).Width, ((Control)this).Height), color, (TextFormatFlags)6);
}
}
internal class CustomProgress : Control
{
private int _val;
public int Value
{
get
{
return _val;
}
set
{
_val = Math.Max(0, Math.Min(100, value));
((Control)this).Invalidate();
}
}
public CustomProgress()
{
((Control)this).Height = 8;
((Control)this).DoubleBuffered = true;
}
protected override void OnPaint(PaintEventArgs e)
{
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Expected O, but got Unknown
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Expected O, but got Unknown
Graphics graphics = e.Graphics;
graphics.SmoothingMode = (SmoothingMode)4;
Rectangle r = new Rectangle(0, (((Control)this).Height - 6) / 2, ((Control)this).Width, 6);
Gfx.FillRoundRect(graphics, r, 3, C.Card);
if (_val <= 0)
{
return;
}
int num = (int)((float)((Control)this).Width * ((float)_val / 100f));
if (num <= 6)
{
return;
}
Rectangle r2 = new Rectangle(0, (((Control)this).Height - 6) / 2, num, 6);
Gfx.FillGradientRoundRect(graphics, r2, 3, C.Accent, C.AccentLight, 0f);
float num2 = Gfx.GlobalTick * 150f % (float)(((Control)this).Width + 60) - 30f;
if (!(num2 >= 0f) || !(num2 < (float)num))
{
return;
}
Rectangle rectangle = new Rectangle((int)num2, (((Control)this).Height - 6) / 2, 30, 6);
try
{
LinearGradientBrush val = new LinearGradientBrush(rectangle, Color.Transparent, Color.FromArgb(180, Color.White), 0f);
try
{
ColorBlend val2 = new ColorBlend(3);
val2.Colors = new Color[3]
{
Color.Transparent,
Color.FromArgb(180, Color.White),
Color.Transparent
};
val2.Positions = new float[3] { 0f, 0.5f, 1f };
val.InterpolationColors = val2;
graphics.FillRectangle((Brush)(object)val, rectangle);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
catch
{
}
}
}
internal class CustomActionButton : Control
{
private bool _hov;
private bool _down;
private float _hoverAnim;
private float _pressAnim;
private float _clickRipple;
public CustomActionButton(string text)
{
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Expected O, but got Unknown
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Expected O, but got Unknown
MouseEventHandler val = null;
MouseEventHandler val2 = null;
((Control)this)..ctor();
((Control)this).Text = text;
((Control)this).Height = 44;
((Control)this).Cursor = Cursors.Hand;
((Control)this).DoubleBuffered = true;
EventHandler eventHandler = delegate
{
_hov = true;
((Control)this).Invalidate();
};
((Control)this).MouseEnter += eventHandler;
((Control)this).MouseLeave += delegate
{
_hov = false;
_down = false;
((Control)this).Invalidate();
};
if (val == null)
{
val = (MouseEventHandler)delegate
{
_down = true;
((Control)this).Invalidate();
};
}
((Control)this).MouseDown += val;
if (val2 == null)
{
val2 = (MouseEventHandler)delegate
{
_down = false;
_clickRipple = 1f;
((Control)this).Invalidate();
};
}
((Control)this).MouseUp += val2;
}
protected override void OnPaint(PaintEventArgs e)
{
//IL_0425: Unknown result type (might be due to invalid IL or missing references)
//IL_042c: Expected O, but got Unknown
//IL_042d: Unknown result type (might be due to invalid IL or missing references)
//IL_0434: Expected O, but got Unknown
Graphics graphics = e.Graphics;
graphics.SmoothingMode = (SmoothingMode)4;
graphics.TextRenderingHint = (TextRenderingHint)5;
_hoverAnim = Gfx.Approach(_hoverAnim, _hov ? 1f : 0f, 0.12f);
_pressAnim = Gfx.Approach(_pressAnim, _down ? 1f : 0f, 0.2f);
if (_clickRipple > 0.01f)
{
_clickRipple -= 0.08f;
if (_clickRipple < 0f)
{
_clickRipple = 0f;
}
}
Rectangle rectangle = new Rectangle(0, 0, ((Control)this).Width - 1, ((Control)this).Height - 1);
if (!((Control)this).Enabled)
{
Gfx.FillRoundRect(graphics, rectangle, 9, C.Border);
TextRenderer.DrawText((IDeviceContext)(object)graphics, ((Control)this).Text, F.ButtonText, rectangle, C.TextDark, (TextFormatFlags)5);
return;
}
float num = (float)(Math.Sin(Gfx.GlobalTick * 3f) * 0.5 + 0.5);
int alpha = (int)(15f + 10f * num + (35f + 20f * num) * _hoverAnim + 30f * _clickRipple);
Gfx.DrawGlow(graphics, rectangle, 10, Color.FromArgb(alpha, C.AccentLight), 2, 2f);
Color accent = C.Accent;
Color accentLight = C.AccentLight;
Color accentLo = C.AccentLo;
Color accentLo2 = C.AccentLo;
Color accent2 = C.Accent;
Color accent3 = C.Accent;
int val = (int)((float)(int)accent.R + (float)(accentLight.R - accent.R) * _hoverAnim + (float)(accentLo.R - accent.R) * _pressAnim);
int val2 = (int)((float)(int)accent.G + (float)(accentLight.G - accent.G) * _hoverAnim + (float)(accentLo.G - accent.G) * _pressAnim);
int val3 = (int)((float)(int)accent.B + (float)(accentLight.B - accent.B) * _hoverAnim + (float)(accentLo.B - accent.B) * _pressAnim);
Color c = Color.FromArgb(Math.Max(0, Math.Min(255, val)), Math.Max(0, Math.Min(255, val2)), Math.Max(0, Math.Min(255, val3)));
int val4 = (int)((float)(int)accentLo2.R + (float)(accent2.R - accentLo2.R) * _hoverAnim + (float)(accent3.R - accentLo2.R) * _pressAnim);
int val5 = (int)((float)(int)accentLo2.G + (float)(accent2.G - accentLo2.G) * _hoverAnim + (float)(accent3.G - accentLo2.G) * _pressAnim);
int val6 = (int)((float)(int)accentLo2.B + (float)(accent2.B - accentLo2.B) * _hoverAnim + (float)(accent3.B - accentLo2.B) * _pressAnim);
Color c2 = Color.FromArgb(Math.Max(0, Math.Min(255, val4)), Math.Max(0, Math.Min(255, val5)), Math.Max(0, Math.Min(255, val6)));
Gfx.FillGradientRoundRect(graphics, rectangle, 10, c, c2, 45f);
if (_clickRipple > 0.01f)
{
int alpha2 = (int)(45f * _clickRipple);
Gfx.FillRoundRect(graphics, rectangle, 10, Color.FromArgb(alpha2, Color.White));
}
if (_hoverAnim > 0.02f)
{
float num2 = Gfx.GlobalTick * 160f % (float)(((Control)this).Width + 80) - 40f;
if (num2 >= 0f && num2 < (float)((Control)this).Width)
{
int alpha3 = (int)(50f * _hoverAnim);
Rectangle rectangle2 = new Rectangle((int)num2, 0, 40, ((Control)this).Height);
try
{
LinearGradientBrush val7 = new LinearGradientBrush(rectangle2, Color.Transparent, Color.FromArgb(alpha3, Color.White), 0f);
try
{
ColorBlend val8 = new ColorBlend(3);
val8.Colors = new Color[3]
{
Color.Transparent,
Color.FromArgb(alpha3, Color.White),
Color.Transparent
};
val8.Positions = new float[3] { 0f, 0.5f, 1f };
val7.InterpolationColors = val8;
GraphicsPath val9 = Gfx.RoundRect(rectangle, 10);
try
{
graphics.SetClip(val9);
graphics.FillRectangle((Brush)(object)val7, rectangle2);
graphics.ResetClip();
}
finally
{
((IDisposable)val9)?.Dispose();
}
}
finally
{
((IDisposable)val7)?.Dispose();
}
}
catch
{
}
}
}
int num3 = ((_pressAnim > 0.5f) ? 1 : 0);
Rectangle rectangle3 = new Rectangle(rectangle.X, rectangle.Y + num3, rectangle.Width, rectangle.Height);
TextRenderer.DrawText((IDeviceContext)(object)graphics, ((Control)this).Text, F.ButtonText, rectangle3, Color.White, (TextFormatFlags)5);
}
}
internal class PathDialog : Form
{
private TextBox txt;
public string SelectedPath { get; private set; }
public PathDialog()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Expected O, but got Unknown
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Expected O, but got Unknown
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Expected O, but got Unknown
((Control)this).Text = "Custom Discord Path";
((Form)this).Size = new Size(480, 160);
((Control)this).BackColor = C.Sidebar;
((Control)this).ForeColor = C.Text;
((Form)this).FormBorderStyle = (FormBorderStyle)3;
((Form)this).MaximizeBox = false;
((Form)this).MinimizeBox = false;
((Form)this).StartPosition = (FormStartPosition)4;
Label val = new Label();
((Control)val).Text = "Select or paste path to Discord app folder:";
((Control)val).Left = 20;
((Control)val).Top = 16;
((Control)val).AutoSize = true;
((Control)val).Font = F.Subtitle;
((Control)val).ForeColor = C.TextDim;
Label val2 = val;
TextBox val3 = new TextBox();
((Control)val3).Left = 20;
((Control)val3).Top = 42;
((Control)val3).Width = 424;
((Control)val3).Font = F.Subtitle;
((Control)val3).BackColor = C.Bg;
((Control)val3).ForeColor = C.Text;
((TextBoxBase)val3).BorderStyle = (BorderStyle)1;
txt = val3;
Button val4 = new Button();
((Control)val4).Text = "Add";
((Control)val4).Left = 264;
((Control)val4).Top = 80;
((Control)val4).Width = 80;
((Control)val4).Height = 30;
val4.DialogResult = (DialogResult)1;
((Control)val4).BackColor = C.Accent;
((Control)val4).ForeColor = Color.White;
((ButtonBase)val4).FlatStyle = (FlatStyle)0;
Button val5 = val4;
Button val6 = new Button();
((Control)val6).Text = "Cancel";
((Control)val6).Left = 364;
((Control)val6).Top = 80;
((Control)val6).Width = 80;
((Control)val6).Height = 30;
val6.DialogResult = (DialogResult)2;
((Control)val6).BackColor = C.Card;
((Control)val6).ForeColor = C.Text;
((ButtonBase)val6).FlatStyle = (FlatStyle)0;
Button val7 = val6;
EventHandler eventHandler = delegate
{
SelectedPath = ((Control)txt).Text;
};
((Control)val5).Click += eventHandler;
((Control)this).Controls.Add((Control)(object)val2);
((Control)this).Controls.Add((Control)(object)txt);
((Control)this).Controls.Add((Control)(object)val5);
((Control)this).Controls.Add((Control)(object)val7);
}
}Screen recording
28 frames · screen recording · 150sBehavior summary
ran 150s1 process(es) observed
Evasion / anti-analysis checks
7 checksmonitor intact 33 monitor trampolines on 1 page were watched from the shipper thread and none was overwritten; the ETW and AMSI stubs kept their bytes. Measured, not assumed.
Statically visible checks (RDTSC/CPUID/red-pill instructions, anti-debug APIs) plus runtime evasion signals. Instruction-level interception at runtime requires hypervisor introspection (VMI).
Anti-analysis API trace
3 APIs · 1 process hookedCalls counted inside the running sample by in-process hooks. Scored means the call crossed the threshold that separates a deliberate check from what ordinary software does; a call that scored nothing is still listed, with the reason.
| API | Signal | Calls | Sleep | Scored |
|---|---|---|---|---|
| GetTickCount | timing | 10 | - | no corroborates, never convicts on its own - ordinary software calls this |
| GetTickCount64 | timing | 100000 | - | no corroborates, never convicts on its own - ordinary software calls this |
| IsDebuggerPresent | anti_debug | 1 | - | no one call only, which some build configurations make at startup without asking the question |
How to read the numbers: a repeated call is sampled at 1, 10, 100 and so on while the run is live and made exact when the process exits, so a count is a floor and not a total. The count kept for a name is the highest a single process reported, not a sum across the process tree. The hooks are placed a few seconds after a process starts, so a check made in the first moments of a launch is missed - and a sample that exits in those first seconds is never watched at all.
Kernel audit saw no cross-process reach. Kernel object-access auditing and the thread trace were active on this run and attributed no handle to another process, no remote or unbacked thread start and no spoofed parent to the sample tree. An observation, not a gap.
No .NET load worth listing. 57 loader events were seen and none belonged to the sample tree (29 from the agent, 2 from other processes), so no assembly came from memory on this run as far as the loader trace saw.
No module load worth listing. In-process hooks were placed in 1 process and recorded no explicit module load, so this is an observation rather than a gap. Modules brought in by the sample's own import table are never seen here.
No WMI attributed to the sample. The WMI-Activity trace was running and recorded 931 operations on the machine during the run; none of them came from the sample's process tree.
Command lines, unwrapped
1 read1 captured text was read and unwrapped locally. No address was recovered from any of them, and none of them was hiding its own contents behind an encoding or a format string. This is a result, not a gap.
Network activity
The network section is a paid-plan layer: the DNS the sample resolved, the connections it opened, the TLS it negotiated, and the rule engine's reading of the capture.
This run was captured, and what it captured is on a paid plan rather than absent. An internet-connected detonation is the same plan, so a paid run also shows what the sample reached rather than only what it tried.
Process tree
What ran during the detonation, and what each process did. Select a node to see the activity attributed to it.
EndcordInstaller.exe
1 processAttributed activity
Nothing in this run was attributed to this process. That is not the same as "it did nothing" - it means no captured operation carried its pid.
Not attributed to any process
1 kindThese operations were captured but carry no pid this tree could match, so they are not shown against any node above.
Persistence mechanisms
cleanNo persistence established
None of the 90 auto-start methods below were established during this run.
Detection coverage
0 / 90Every auto-start method checked on this sample, grouped by family. A method with no result is reported clean, and one the sample only names in its own strings reads "named" rather than "detected".
- Active Setup Installed Component T1547.014 clean
- Explorer Delay-Load Object T1547.001 clean
- Explorer Run Key T1547.001 clean
- Explorer SharedTaskScheduler T1547.001 clean
- Group Policy Extension DLL T1547.004 clean
- Group Policy Run Key T1547.001 clean
- Logon Script T1037.001 clean
- RDP WDS Startup Program T1547.001 clean
- Registry Run Key T1547.001 clean
- Registry RunEx Key T1547.001 clean
- Registry RunOnce Key T1547.001 clean
- Registry RunOnceEx Key T1547.001 clean
- Registry RunServices Key T1547.001 clean
- Startup Folder Item T1547.001 clean
- Startup Folder Redirection T1547.001 clean
- Terminal Services Initial Program T1547.001 clean
- Winlogon GINA DLL T1547.004 clean
- Winlogon MPNotify Value T1547.004 clean
- Winlogon Notify Package T1547.004 clean
- Winlogon Shell Value T1547.004 clean
- Winlogon Taskman Value T1547.004 clean
- Winlogon Userinit Value T1547.004 clean
- BITS Job T1197 clean
- Print Monitor DLL T1547.010 clean
- Print Processor DLL T1547.012 clean
- Scheduled Task T1053.005 clean
- Scheduled Task Registry Implant T1053.005 clean
- Service Control Manager Security Descriptor T1574.011 clean
- Service DLL Hijack T1543.003 clean
- Time Provider DLL T1547.003 clean
- Windows Service Creation T1543.003 clean
- .NET Managed Debugger T1546.012 clean
- Accessibility Tool Hijack T1546.008 clean
- AeDebug Postmortem Debugger T1546.012 clean
- App Paths Hijack T1546.012 clean
- Application Shim Database T1546.011 clean
- Boot Verification Program T1547.002 clean
- Command Processor AutoRun T1546.011 clean
- Explorer Load Value T1547.001 clean
- Explorer MyComputer Tool Hijack T1546.001 clean
- Registry Image File Execution Options T1546.012 clean
- Screensaver Hijack T1546.002 clean
- Setup ErrorHandler Script T1546 clean
- Shell Open Command Hijack T1546.001 clean
- SilentProcessExit Monitor T1546.012 clean
- Telemetry Controller Command T1546.015 clean
- WER ReflectDebugger T1546.012 clean
- Windows Error Reporting Debugger T1546.012 clean
- .NET CLR Profiler DLL T1574.012 clean
- .NET Startup Hook DLL T1574 clean
- AppCert DLLs T1546.009 clean
- AppInit DLLs T1546.010 clean
- AutodialDLL Winsock Injection T1546.006 clean
- DLL Search-Order Hijack T1574.001 T1574.002 clean
- DNS Server Plugin DLL T1574.001 clean
- HTML Help Helper DLL T1546 clean
- KnownDLLs Manipulation T1574.001 clean
- Natural Language Platform DLL Override T1546 clean
- Netsh Helper DLL T1546.007 clean
- Winsock Layered Service Provider T1546.006 clean
- Browser Extension T1176 clean
- Browser Helper Object T1176 clean
- COM Server Hijack T1546.015 clean
- HTML Help COM Object Hijack T1546.015 clean
- Shell Context Menu Handler T1546.001 clean
- Shell Extension Handler T1546.001 clean
- Account RID Hijack T1098 clean
- AMSI Provider T1562.001 clean
- Credential Provider T1547.014 clean
- DSRM Admin Logon Backdoor T1556 clean
- Hidden Local Account T1136.001 clean
- LSA Authentication Package T1547.002 clean
- LSA Extension DLL T1547.005 clean
- LSA Notification Package T1547.005 clean
- LSA Security Package T1547.005 clean
- Network Provider DLL T1556.008 clean
- Security Support Provider T1547.005 clean
- Netsh Port Proxy T1090.001 clean
- Office Add-in T1137.006 clean
- Office Executable Sideload T1574.002 clean
- Office Startup Template T1137.001 clean
- Office Test Key T1137.002 clean
- Power Automate Flow T1546 clean
- PowerShell Profile T1546.013 clean
- Windows Terminal Startup Action T1546 clean
- WMI Event Subscription T1546.003 clean
- BootExecute Native Image T1547.002 clean
- PlatformExecute Native Image T1547.002 clean
- SetupExecute Native Image T1547.002 clean
- UEFI / Bootkit Artifact T1542.003 T1542.001 clean
File activity summary
Dropped payload analysis
not observedNo payload write was recorded and no capture ran on this run, so nothing here is a measurement about dropped files either way.
File & registry ops
0 file · 0 registry · sample scope
| Operation | Target | Process |
|---|---|---|
| setvalue |
System\CurrentControlSet\Services\BITS
Start = 3
|
- |
No operations match your filter.
External reputation was not produced for this scan. Threat intelligence enrichment is a paid-plan layer: every extracted indicator - hashes, addresses, hostnames - is checked against the external reputation services. Our own ingested feeds ran on this scan and every result below is theirs. Adding the paid layer adds an external reputation verdict on each indicator, so MalwareBazaar and filescan.io are listed below as not checked. See plans.
File reputation
4 clear · 2 not checked| Source | Checks | Result | Detail | Feed |
|---|---|---|---|---|
| MalwareBazaar hash feed | File hash | clean | not in feed | 3,396 records 6 minutes ago |
| MalwareBazaar ransomware feed | File hash | clean | not in feed | 3,348 records 4 hours ago |
| ThreatFox hash IOCs | File hash | clean | not in feed | 1,681 records 7 minutes ago |
| URLhaus payload hashes | File hash | clean | not in feed | 1,320 records 6 minutes ago |
| filescan.io | File hash | not checked | no hash lookup ran for this scan | live lookup |
| MalwareBazaar | File hash | not checked | no hash lookup ran for this scan | live lookup |
Hash lookups only - the sample itself is never uploaded to any third party.
Network indicators
7 clear · 1 could not answer| Source | Checks | Result | Detail | Feed |
|---|---|---|---|---|
| URLhaus | IP / domain / URL | feed unavailable | 80 observed indicators, none listed | no records ingested |
| blocklist.de | IP / domain / URL | clean | 80 observed indicators, none listed | 26.3k records 6 minutes ago |
| CINS Army | IP / domain / URL | clean | 80 observed indicators, none listed | 15k records 6 minutes ago |
| Emerging Threats | IP / domain / URL | clean | 80 observed indicators, none listed | 511 records 7 minutes ago |
| Feodo Tracker | IP / domain / URL | clean | 80 observed indicators, none listed | 5 records 7 minutes ago |
| IPsum | IP / domain / URL | clean | 80 observed indicators, none listed | 18.4k records 7 minutes ago |
| Phishing.Database | IP / domain / URL | clean | 80 observed indicators, none listed | 391.5k records 4 hours ago |
| ThreatFox | IP / domain / URL | clean | 80 observed indicators, none listed | 1,681 records 7 minutes ago |
TLS fingerprints
nothing of this kind to check| Source | Checks | Result | Detail | Feed |
|---|---|---|---|---|
| JA3 / JA4 fingerprint blocklists | JA3 / JA4 | not checked | no TLS client fingerprint observed | 97 records 11 hours ago |
| SSL blocklist | Server certificate | not checked | no server certificate fingerprint is extracted to check | live lookup |
Detection rules
1 of 2 listed| Source | Checks | Result | Detail | Feed |
|---|---|---|---|---|
| Signature rules | Sample content | 4 matches | possible_includes_base64_packed_functions, powershell, SUSP_PE_Discor… | 110 records 7 minutes ago |
| Sigma rules | Behavior log | clean | - | 2,275 records 7 hours ago |
Tooling catalogs
4 clear| Source | Checks | Result | Detail | Feed |
|---|---|---|---|---|
| LOLBAS | Process image paths | clean | 1 process image path, none masqueraded | 245 records 7 minutes ago |
| LOLBootloaders | File hash | clean | not a known vulnerable bootloader | 520 records 6 minutes ago |
| LOLDrivers | File hash | clean | not a known vulnerable driver | 2,346 records 7 minutes ago |
| LOLRMM | Names and domains | clean | 2 name/domain indicators checked, no remote-management tooling | 358 records 6 minutes ago |
AI analysis
The AI layer is a paid-plan feature. It reads what the other layers produced - the behaviour summary, the call sequence, the indicator list - and writes the narrative and the kill-chain walkthrough.
Nothing is being withheld. This layer did not run for this scan, so there is no result stored behind the lock.
File indicators
3| Severity | Type | Indicator | Description |
|---|---|---|---|
| malicious | sample_sha256 | 323d505219f6785ff23949391d672ac2c7a2ca7659085aa731591a8675cab7e5 | Submitted sample (SHA256) |
| malicious | sample_md5 | e5df981de0ee11d2c14536d4f3a5ce2c | Submitted sample (MD5) |
| malicious | imphash | f34d5f2d4577ed6d9ceec516c1f5a744 | Import table hash (imphash) |
Sigma detections
0 matches of 2275 rulesThe Sigma corpus was evaluated against this run's processes, registry, file, network, DNS and script activity. Nothing matched.
Generated rules
YARA: auto_file_2966_yara_drafted
Auto-generatedrule auto_file_2966_yara_drafted
{
meta:
description = "Model-drafted from scan 2966, corpus-validated"
author = "sandbox auto-generator"
source = "model-drafted, corpus-validated"
strings:
$s0 = "<div class=\"ec-fake-lag-track\"><div class=\"ec-fake-lag-track-fill\"></div></div>" ascii wide
$s1 = "shhhhh did you know that you're my favourite user? But don't tell the others!!" ascii wide
$s2 = ".questify-quest-item-restyle > :nth-child(2) [class*=\"textOverflowBlur\"] {" ascii wide
$s3 = "/* BetterFolders renders a duplicate guilds nav inside its folder sidebar." ascii wide
$s4 = "[data-vc-collapsible-ui-members-list-collapsed]:is(:hover, :focus-within) {" ascii wide
$s5 = "Unclaimed only shows it while you have relevant unclaimed Quest rewards." ascii wide
condition:
uint16(0) == 0x5a4d and 4 of them
}Extracted files
What came out of the sample: unpacked payloads, carved objects and captured memory. Each one is stored by content hash, so the same object extracted twice is the same row.
No extracted files
Nothing was unpacked or carved out of this sample. Packed samples, documents with embedded objects and installers are the ones that usually produce artifacts here.
Export & download
/s/2966Structured exports for your SIEM/TIP - ATT&CK Navigator layer, STIX 2.1 bundle, MISP event and a defanged IOC list - are free on every report. The packet capture follows this scan's plan, because a capture is the rawest network output this platform produces.
Analysis report
PDF and DOCX reports are available to signed-in accounts on every plan, free included. Sign in to generate one.
Headers
Body
Headers
Body
You are about to download the raw, live sample. It is real, potentially destructive malware and can harm your machine if opened or run. Only handle it inside an isolated analysis environment.
Delivered as a ZIP encrypted with the password infected so the bytes are never handled unprotected.
Report this analysis
Analysis reports are produced automatically from files, addresses and text submitted by visitors. If this one publishes your material, identifies you, or should not be public for any other reason, tell us why and an administrator will review it.
Public analyses of this file
1 run| Submitted | Environment | Verdict | Score |
|---|---|---|---|
| 2026-10-25 02:38 Shown below | Windows 10 22H2 | Malicious | 71/100 |