import java.util.*;
import java.util.zip.*;
import java.util.List;
import java.util.regex.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.table.*;
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.management.*;
import java.security.*;
import java.security.spec.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.imageio.*;
import java.math.*;
import java.nio.file.Paths;
import java.nio.file.Files;
import java.nio.file.attribute.PosixFilePermission;
import javax.net.ssl.*;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.text.SimpleDateFormat;
import java.text.NumberFormat;
import java.nio.file.Path;
import javax.imageio.metadata.*;
import javax.imageio.stream.*;
import javax.swing.undo.UndoManager;
import java.awt.datatransfer.StringSelection;
class main {
static File packageDiscordFan(Object... __) {
Standalone_OSWithSplashScreens s = new Standalone_OSWithSplashScreens();
s.programName = "Discord Fan";
s.mainModules = ll(
"Discord Fan", "#1024978/DiscordFan",
"Mouse Mover", "#1025003/MouseMoverModule");
return packageModules(s, paramsPlus(__,
"extraSnippets" , ll("#1102638", "#1102637")));
}
static List ll(A... a) {
ArrayList l = new ArrayList(a.length);
if (a != null) for (A x : a) l.add(x);
return l;
}
static File packageModules(Standalone_OSWithSplashScreens s, Object... __) {
File outJar = javaxArtifactsDir(replace(s.programName, " ", "-") + ".jar");
ProgramPackager p = new ProgramPackager (outJar, "#1025015");
Collection excludeSnippets = (Collection) (optPar("excludeSnippets",__));
Collection extraSnippets = (Collection) (optPar("extraSnippets",__));
p.extraSnippets = concatLists(extraSnippets, map("beforeSlash_orAll",concatLists(oddEntries(s.mainModules), oddEntries(s.helperModules))));
print("Have extra snippets: " + p.extraSnippets);
p.excludeSnippets = excludeSnippets != null ? asSet(excludeSnippets)
: programPackager_standardExcludedSnippets();
p.copyAdditionalFiles = new VF1() { public void get(ZipOutputStream jar) { try {
addTextFileToZip(jar, "start.struct", struct(s));
} catch (Exception __e) { throw rethrow(__e); } }
public String toString() { return "addTextFileToZip(jar, \"start.struct\", struct(s));"; }};
p.includeBinaries = boolPar("includeBinaries",__);
p.go();
return outJar;
}
static Object[] paramsPlus(Object[] a1, Object... a2) {
if (a2 == null) return a1;
if (a1 == null) return a2;
if (l(a1) == 1 && a1[0] instanceof Map)
return new Object[] { mapPlus((Map) a1[0], a2) };
assertEvenLength(a1);
assertEvenLength(a2);
Map map = paramsToOrderedMap(a1);
int n = l(a2);
for (int i = 0; i < n; i += 2) {
Object key = a2[i];
if (key != null) map.put(key, a2[i+1]);
}
return mapToParams(map);
}
static File javaxArtifactsDir_dir; // can be set to work on different base dir
static File javaxArtifactsDir() {
return javaxArtifactsDir_dir != null ? javaxArtifactsDir_dir : new File(userHome(), "JavaX-Artifacts");
}
static File javaxArtifactsDir(String... subs) {
return newFile(javaxArtifactsDir(), subs);
}
static List replace(List l, A a, A b) {
for (int i = 0; i < l(l); i++)
if (eq(l.get(i), a))
l.set(i, b);
return l;
}
static String replace(String s, String a, String b) {
return s == null ? null : a == null || b == null ? s : s.replace(a, b);
}
static String replace(String s, char a, char b) {
return s == null ? null : s.replace(a, b);
}
static A optPar(ThreadLocal tl, A defaultValue) {
A a = tl.get();
if (a != null) {
tl.set(null);
return a;
}
return defaultValue;
}
static A optPar(ThreadLocal tl) {
return optPar(tl, null);
}
static Object optPar(Object[] params, String name) {
return optParam(params, name);
}
static Object optPar(String name, Object[] params) {
return optParam(params, name);
}
static Object optPar(String name, Map params) {
return optParam(name, params);
}
static A optPar(Object[] params, String name, A defaultValue) {
return optParam(params, name, defaultValue);
}
static A optPar(String name, Object[] params, A defaultValue) {
return optParam(params, name, defaultValue);
}
static List concatLists(Collection... lists) {
List l = new ArrayList();
if (lists != null) for (Collection list : lists)
if (list != null)
l.addAll(list);
return l;
}
static List concatLists(Collection extends Collection> lists) {
List l = new ArrayList();
if (lists != null) for (Collection list : lists)
if (list != null)
l.addAll(list);
return l;
}
static List map(Iterable l, Object f) { return map(f, l); }
static List map(Object f, Iterable l) {
List x = emptyList(l);
if (l != null) for (Object o : l)
x.add(callF(f, o));
return x;
}
static List map(Iterable l, F1 f) { return map(f, l); }
static List map(F1 f, Iterable l) {
List x = emptyList(l);
if (l != null) for (A o : l)
x.add(callF(f, o));
return x;
}
static List map(IF1 f, Iterable l) { return map(l, f); }
static List map(Iterable l, IF1 f) {
List x = emptyList(l);
if (l != null) for (A o : l)
x.add(f.get(o));
return x;
}
static List map(IF1 f, A[] l) { return map(l, f); }
static List map(A[] l, IF1 f) {
List x = emptyList(l);
if (l != null) for (A o : l)
x.add(f.get(o));
return x;
}
static List map(Object f, Object[] l) { return map(f, asList(l)); }
static List map(Object[] l, Object f) { return map(f, l); }
static List map(Object f, Map map) {
return map(map, f);
}
// map: func(key, value) -> list element
static List map(Map map, Object f) {
List x = new ArrayList();
if (map != null) for (Object _e : map.entrySet()) {
Map.Entry e = (Map.Entry) _e;
x.add(callF(f, e.getKey(), e.getValue()));
}
return x;
}
static List map(Map map, IF2 f) {
return map(map, (Object) f);
}
static String beforeSlash_orAll(String s) {
return takeFirst(smartIndexOf(s, '/'), s);
}
static List oddEntries(List l) {
int n = l(l)/2;
List out = emptyList(n);
for (int i = 0; i < n; i++)
out.add(l.get(i*2+1));
return out;
}
static volatile StringBuffer local_log = new StringBuffer(); // not redirected
static volatile Appendable print_log = local_log; // might be redirected, e.g. to main bot
// in bytes - will cut to half that
static volatile int print_log_max = 1024*1024;
static volatile int local_log_max = 100*1024;
static boolean print_silent = false; // total mute if set
static Object print_byThread_lock = new Object();
static volatile ThreadLocal