repo_name
stringlengths 5
122
| path
stringlengths 3
232
| text
stringlengths 6
1.05M
|
|---|---|---|
paullouismas/shifts-manager
|
src/store/shifts/index.ts
|
<reponame>paullouismas/shifts-manager
import Vue from 'vue';
import { FirestoreWrapper } from '@/helpers';
// Models
import { Shift } from '@/models/Shift';
import { RetrievableEntity } from '@/models/RetrievableEntity';
export interface ShiftsState {
shifts: RetrievableEntity<Shift>[];
}
type ShiftsModule = import('vuex').Module<ShiftsState, Record<string, unknown>>;
const module: ShiftsModule = {
namespaced: true,
state: {
shifts: [],
},
getters: {
shifts: ({ shifts }) => shifts,
},
actions: {
async syncShifts({ rootGetters, commit }): Promise<() => void> {
const currentUser = rootGetters['auth/currentUser'];
if (!currentUser) {
throw new Error('User is not logged in');
}
return FirestoreWrapper(currentUser.uid)
.user()
.collection('shifts')
.onSnapshot((snapshot) =>
snapshot.docChanges().forEach((change) => {
const { id } = change.doc;
const payload = change.doc.data();
// eslint-disable-next-line no-underscore-dangle
if (payload?._deleted) {
// The doc has the deleted flag
commit('REMOVE_SHIFT', id);
return;
}
if (change.type === 'removed') {
commit('REMOVE_SHIFT', id);
} else {
commit('SET_SHIFT', { id, ...payload });
}
}),
);
},
async addShift({ rootGetters }, shift: Shift): Promise<void> {
const { workplaceId, startTime, endTime, title, description } = shift;
const currentUser = rootGetters['auth/currentUser'];
if (!currentUser) {
throw new Error('User is not logged in');
}
const timestamp = Date.now();
await FirestoreWrapper(currentUser.uid)
.shift()
.set({
workplaceId,
startTime,
endTime,
title,
description,
_createdAt: timestamp,
_updatedAt: timestamp,
});
},
async saveShift({ rootGetters }, shift: RetrievableEntity<Shift>): Promise<void> {
const { id, workplaceId, startTime, endTime, title, description } = shift;
const currentUser = rootGetters['auth/currentUser'];
if (!currentUser) {
throw new Error('User is not logged in');
}
await FirestoreWrapper(currentUser.uid)
.shift(id)
.update({
workplaceId,
startTime,
endTime,
title,
description,
_updatedAt: Date.now(),
});
},
async removeShift({ rootGetters }, shiftId: RetrievableEntity<Shift>['id']): Promise<void> {
const currentUser = rootGetters['auth/currentUser'];
if (!currentUser) {
throw new Error('User is not logged in');
}
await FirestoreWrapper(currentUser.uid)
.shift(shiftId)
.update({
_deleted: true,
_updatedAt: Date.now(),
});
},
},
mutations: {
SET_SHIFT({ shifts }, shift: RetrievableEntity<Shift>) {
const index = shifts.findIndex(({ id }) => id === shift.id);
if (index < 0) {
// The shift does not already exist, so add it
shifts.push(shift);
} else {
// The shift already exist, update it
Vue.set(shifts, index, shift);
}
},
REMOVE_SHIFT({ shifts }, shiftId: RetrievableEntity<Shift>['id']) {
const index = shifts.findIndex(({ id }) => id === shiftId);
if (index >= 0) {
shifts.splice(index, 1);
}
},
},
};
export default module;
|
paullouismas/shifts-manager
|
src/helpers/index.ts
|
import firebase from 'firebase/app';
export const getUserLocale = () =>
/^(?<locale>[a-z]{2})-[A-Z]{2}$/.exec(navigator.language)?.groups?.locale || 'en';
export const FirestoreWrapper = (userId: string) => {
const db = firebase.firestore();
const user = () => db.collection('users').doc(userId);
const workplace = (workplaceId: string | undefined = undefined) =>
user()
.collection('workplaces')
.doc(workplaceId);
const shift = (shiftId: string | undefined = undefined) =>
user()
.collection('shifts')
.doc(shiftId);
return {
user,
workplace,
shift,
};
};
export class PageTitleManager {
private _baseTitle: string;
public constructor(baseTitle: string) {
this._baseTitle = baseTitle;
}
public updateTitle(titleSegment: string): string {
document.title = `${this._baseTitle} - ${titleSegment}`;
return document.title;
}
}
|
paullouismas/shifts-manager
|
src/bootstraps/page-title.ts
|
import { PageTitleManager } from '@/helpers';
import config from '@/config';
export default new PageTitleManager(config.APP_NAME);
|
paullouismas/shifts-manager
|
src/store/manage/workplaces/index.ts
|
import Vue from 'vue';
import { FirestoreWrapper } from '@/helpers';
// Models
import { Workplace } from '@/models/Workplace';
import { RetrievableEntity } from '@/models/RetrievableEntity';
export interface ManageWorkplacesState {
workplaces: RetrievableEntity<Workplace>[];
}
type ManageWorkplacesModule = import('vuex').Module<ManageWorkplacesState, Record<string, unknown>>;
const module: ManageWorkplacesModule = {
namespaced: true,
state: {
workplaces: [],
},
getters: {
workplaces: ({ workplaces }) => workplaces,
},
actions: {
async syncWorkplaces({ rootGetters, commit }): Promise<() => void> {
const currentUser = rootGetters['auth/currentUser'];
if (!currentUser) {
throw new Error('User is not logged in');
}
return FirestoreWrapper(currentUser.uid)
.user()
.collection('workplaces')
.onSnapshot((snapshot) =>
snapshot.docChanges().forEach((change) => {
const { id } = change.doc;
const payload = change.doc.data();
// eslint-disable-next-line no-underscore-dangle
if (payload?._deleted) {
// The doc has the deleted flag
commit('REMOVE_WORKPLACE', id);
return;
}
if (change.type === 'removed') {
commit('REMOVE_WORKPLACE', id);
} else {
commit('SET_WORKPLACE', { id, ...payload });
}
}),
);
},
async addWorkplace({ rootGetters }, workplace: Workplace): Promise<void> {
const { name, address, description } = workplace;
const currentUser = rootGetters['auth/currentUser'];
if (!currentUser) {
throw new Error('User is not logged in');
}
const timestamp = Date.now();
await FirestoreWrapper(currentUser.uid)
.workplace()
.set({
name,
address,
description,
_createdAt: timestamp,
_updatedAt: timestamp,
});
},
async saveWorkplace({ rootGetters }, workplace: RetrievableEntity<Workplace>): Promise<void> {
const { id, name, address, description } = workplace;
const currentUser = rootGetters['auth/currentUser'];
if (!currentUser) {
throw new Error('User is not logged in');
}
await FirestoreWrapper(currentUser.uid)
.workplace(id)
.update({
name,
address,
description,
_updatedAt: Date.now(),
});
},
async removeWorkplace(
{ rootGetters },
workplaceId: RetrievableEntity<Workplace>['id'],
): Promise<void> {
const currentUser = rootGetters['auth/currentUser'];
if (!currentUser) {
throw new Error('User is not logged in');
}
FirestoreWrapper(currentUser.uid)
.workplace(workplaceId)
.update({
_deleted: true,
_updatedAt: Date.now(),
});
},
},
mutations: {
SET_WORKPLACE({ workplaces }, workplace: RetrievableEntity<Workplace>) {
const index = workplaces.findIndex(({ id }) => id === workplace.id);
if (index < 0) {
// The workplace does not already exist, so add it
workplaces.push(workplace);
} else {
// The workplace already exist, update it
Vue.set(workplaces, index, workplace);
}
},
REMOVE_WORKPLACE({ workplaces }, workplaceId: RetrievableEntity<Workplace>['id']) {
const index = workplaces.findIndex(({ id }) => id === workplaceId);
if (index >= 0) {
workplaces.splice(index, 1);
}
},
},
};
export default module;
|
paullouismas/shifts-manager
|
src/store/index.ts
|
<filename>src/store/index.ts<gh_stars>0
import Vue from 'vue';
import Vuex from 'vuex';
import auth from './auth';
import manage from './manage';
import shifts from './shifts';
Vue.use(Vuex);
export default new Vuex.Store({
modules: {
auth,
manage,
shifts,
},
});
|
paullouismas/shifts-manager
|
src/bootstraps/firebase.ts
|
<reponame>paullouismas/shifts-manager
import firebase from 'firebase/app';
import 'firebase/firestore';
import 'firebase/auth';
import store from '../store';
firebase.initializeApp({
apiKey: 'AIzaSyBWLrSoa99txl7TBAiDMNCb7ynknydilwE',
authDomain: 'shifts-manager-610bb.firebaseapp.com',
projectId: 'shifts-manager-610bb',
storageBucket: 'shifts-manager-610bb.appspot.com',
messagingSenderId: '800988943525',
appId: '1:800988943525:web:df659bee658a146482e94c',
});
const modules = {
list: {} as Record<string, () => void>,
async sync(maps: Record<string, (actionName: string) => void>): Promise<unknown[]> {
const list: Promise<unknown>[] = [];
// eslint-disable-next-line no-restricted-syntax
for await (const [action, callback] of Object.entries(maps)) {
// Unsubscribe first
if (action in this.list && this.list[action]) {
this.list[action]();
delete this.list[action];
}
const dispatch = store.dispatch(action);
list.push(dispatch);
this.list[action] = await dispatch;
callback.call(null, action);
}
return Promise.all(list);
},
};
firebase.auth().onAuthStateChanged(async (user) => {
await store.dispatch('auth/setUser', user);
try {
if (user) {
await modules.sync({
'manage/workplaces/syncWorkplaces': () => console.log('Synced workplaces'),
'shifts/syncShifts': () => console.log('Synced shifts'),
});
}
} catch (error) {
console.error(error);
}
});
|
paullouismas/shifts-manager
|
src/router/index.ts
|
import Vue from 'vue';
import VueRouter, { RouteConfig } from 'vue-router';
import { AuthState } from '@/store/auth';
import store from '@/store';
import titleManager from '@/bootstraps/page-title';
import i18n from '@/bootstraps/i18n';
import protectedRoutes from './protectedRoutes';
import unprotectedRoutes from './unprotectedRoutes';
Vue.use(VueRouter);
/**
* Hydrate all the routes (including their children) with some meta values
*
* @param routes The routes to hydrate
* @param meta The meta values to use
*/
const hydrateRoutes = (
routes: RouteConfig[] = [],
meta: Record<string, unknown> = {},
): RouteConfig[] =>
routes.map((route) => ({
...route,
meta: {
...(route.meta || {}),
...meta,
},
children: hydrateRoutes(route.children, meta),
}));
const routes: Array<RouteConfig> = [
// The protected routes: require auth
...hydrateRoutes(protectedRoutes, { requireAuth: true }),
// The unprotected routes: doesn't require auth, can be used as guest
...hydrateRoutes(unprotectedRoutes, { requireAuth: false }),
// 404
{
path: '*',
name: 'NotFound',
component: () => import('@/components/NotFound.vue'),
},
];
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
linkExactActiveClass: 'is-active',
});
// Logger
router.beforeEach((to, from, next) => {
console.log(`[Navigation] Navigating to '${to.fullPath}'`);
next();
});
// Auth verification
router.beforeEach((to, from, next) => {
if (
to.matched.some(({ meta: { requireAuth } }) => requireAuth) &&
!store.getters['auth/currentUser']
) {
console.log('Authentication required');
next({ name: 'Auth/LogIn', query: { redirect: to.fullPath } });
return;
}
next();
});
// Title update
router.beforeEach((to, from, next) => {
const title: string | undefined = to.meta?.title;
if (title) {
titleManager.updateTitle(title);
}
next();
});
// i18n
router.beforeEach((to, from, next) => {
const currentUser = store.getters['auth/currentUser'] as AuthState['currentUser'];
i18n.locale = currentUser?.metadata?.language || i18n.locale;
next();
});
export default router;
|
paullouismas/shifts-manager
|
src/bootstraps/i18n/english.ts
|
<gh_stars>0
import config from '@/config';
export default {
MISC: {
APP_NAME: config.APP_NAME,
AUTH: {
SIGN_UP: 'Sign-up',
SIGN_OUT: 'Sign-out',
LOG_IN: 'Log-in',
},
ACTIONS: {
EDIT: 'Edit',
DELETE: 'Delete',
CANCEL: 'Cancel',
},
NONE: 'None',
NOW: 'Now',
},
ENTITIES: {
USER: {
NAME: {
LABEL: 'Name',
PLACEHOLDER: '<NAME>',
},
EMAIL: {
LABEL: 'Email',
PLACEHOLDER: 'e.g. <EMAIL>',
},
PASSWORD: {
LABEL: 'Password',
PLACEHOLDER: '****************',
},
},
WORKPLACE: {
NAME: {
LABEL: 'Name',
PLACEHOLDER: 'Workplace name',
},
ADDRESS: {
LABEL: 'Address',
PLACEHOLDER: 'Workplace address',
},
DESCRIPTION: {
LABEL: 'Description',
PLACEHOLDER: 'Workplace description',
},
},
SHIFT: {
WORKPLACE: {
LABEL: 'Workplace',
},
START_TIME: {
LABEL: 'Start time',
PLACEHOLDER: 'Click to select start time',
RESET: 'Reset start time',
},
END_TIME: {
LABEL: 'End time',
PLACEHOLDER: 'Click to select end time',
RESET: 'Reset end time',
VALIDATION_MSG: 'End time must come after start time',
},
SHIFT_LENGTH: {
LABEL: 'Shift length',
},
TITLE: {
LABEL: 'Title',
PLACEHOLDER: 'Shift title',
},
DESCRIPTION: {
LABEL: 'Description',
PLACEHOLDER: 'Shift description',
},
},
},
COMPONENTS: {
NAVBAR: {
// Authenticated navbar
AUTHENTICATED: {
SHIFTS_DROPDOWN: {
HEADER: 'Shifts',
ITEMS: {
MY_SHIFTS: 'My shifts',
LOG_SHIFT: 'Log shift',
},
},
GREETING_MESSAGE: 'Welcome {name}',
MANAGE_WORKPLACES: 'My workplaces',
},
// Unauthenticated navbar
UNAUTHENTICATED: {
//
},
},
NOT_FOUND: {
TITLE: 'Error 404 page not found',
SUBTITLE: 'Page {url} not found',
RETURN: 'Return to the homepage',
},
},
VIEWS: {
HOME: {
PAGE_TITLE: 'Home',
},
AUTH: {
SIGN_UP: {
PAGE_TITLE: 'Sign-up',
FIELDS: {
CONFIRM_PASSWORD: {
LABEL: 'Confirm password',
PLACEHOLDER: '****************',
},
},
},
LOG_IN: {
PAGE_TITLE: 'Log-in',
},
},
MANAGE: {
WORKPLACES: {
PAGE_TITLE: 'My workplaces',
ADD_WORKPLACE_BTN: 'Add workplace',
NO_WOKPLACES_MSG: 'You do not have any workplaces',
WORKPLACE_ADDED_SUCCESS_MSG: 'Workplace added successfully',
WORKPLACE_SAVED_SUCCESS_MSG: 'Workplace saved successfully',
WORKPLACE_REMOVED_SUCCESS_MSG: 'Workplace removed successfully',
NEW: {
TITLE: 'Add workplace',
SAVE_WORKPLACE_BTN: 'Save workplace',
},
EDIT: {
TITLE: 'Edit workplace',
SAVE_WORKPLACE_BTN: 'Save workplace',
},
DELETE: {
TITLE: 'Remove workplace',
MESSAGE_PROMPT: 'Are you sure you want to remove this workplace?',
MESSAGE_WARNING: 'You will not be able to assign shifts to it anymore.',
REMOVE_WORKPLACE_BTN: 'Remove workplace',
},
},
ACCOUNT: {
PAGE_TITLE: 'My account',
PAGES: {
PROFILE: {
HEADER: 'Profile',
UPDATE_PROFILE_BTN: 'Update profile',
},
SECURITY: {
HEADER: 'Security',
},
},
},
},
SHIFTS: {
HOME: {
PAGE_TITLE: 'My shifts',
VIEWS: {
LIST: 'List',
CALENDAR: 'Calendar',
},
FINISH_SHIFT_BTN: 'Finish now',
NO_SHIFTS_MSG: 'You do not have any shift',
},
NEW: {
PAGE_TITLE: 'Log shift',
SHIFT_ADDED_SUCCESS_MSG: 'Shifts added successfully',
},
EDIT: {
PAGE_TITLE: 'Update shift',
SHIFT_UPDATED_SUCCESS_MSG: 'Shift updated successfully',
},
EDITOR: {
NO_WORKPLACE_SELECTED: '--- None selected ---',
SAVE_SHIFT_BTN: 'Save shift',
},
},
},
ERRORS: {
INVALID_LOGIN_CREDENTIALS: 'Invalid email and/or passwword',
SHIFT_NOT_FOUND: 'This shift does not exist',
},
};
|
paullouismas/shifts-manager
|
src/models/Shift.ts
|
<filename>src/models/Shift.ts
import { Entity } from './Entity';
import { RetrievableEntity } from './RetrievableEntity';
import { Workplace } from './Workplace';
export interface Shift extends Entity {
/** The shift's workplace id, if any */
workplaceId: RetrievableEntity<Workplace>['id'] | null;
/** The shift's start time */
startTime: number;
/** The shift's end time, if any */
endTime: number | null;
/** The shift's title */
title: string;
/** The shift's description, if any */
description: string | null;
}
|
paullouismas/shifts-manager
|
src/bootstraps/index.ts
|
<gh_stars>0
import './styles';
import './font-awesome';
import './firebase';
|
paullouismas/shifts-manager
|
src/router/protectedRoutes.ts
|
<gh_stars>0
import i18n from '@/bootstraps/i18n';
import { RouteConfig } from 'vue-router';
import RootView from '@/components/RootView.vue';
const routes: Array<RouteConfig> = [
{
path: '/shifts',
redirect: { name: 'Shifts/Home' },
component: () => import('@/views/shifts/ShiftRoot.vue'),
children: [
{
path: '',
name: 'Shifts/Home',
component: () => import('@/views/shifts/ShiftHome.vue'),
meta: {
title: i18n.t('VIEWS.SHIFTS.HOME.PAGE_TITLE'),
},
},
{
path: 'new',
name: 'Shifts/New',
component: () => import('@/views/shifts/ShiftNew.vue'),
meta: {
title: i18n.t('VIEWS.SHIFTS.NEW.PAGE_TITLE'),
},
},
{
path: 'edit/:shiftId',
name: 'Shifts/Edit',
props: true,
component: () => import('@/views/shifts/ShiftEdit.vue'),
meta: {
title: i18n.t('VIEWS.SHIFTS.EDIT.PAGE_TITLE'),
},
},
],
},
{
path: '/manage',
redirect: { name: 'HomePage' },
component: () => import('@/views/manage/ManageRoot.vue'),
children: [
{
path: 'workplaces',
redirect: { name: 'Manage/Workplaces/Home' },
component: RootView,
children: [
{
path: '',
name: 'Manage/Workplaces/Home',
component: () => import('@/views/manage/workplaces/ManageWorkplacesHome.vue'),
meta: {
title: i18n.t('VIEWS.MANAGE.WORKPLACES.PAGE_TITLE'),
},
},
],
},
{
path: 'account',
redirect: { name: 'Manage/Account/Home' },
component: RootView,
children: [
{
path: '',
name: 'Manage/Account/Home',
redirect: { path: './profile' },
component: () => import('@/views/manage/account/ManageAccountHome.vue'),
meta: {
title: i18n.t('VIEWS.MANAGE.ACCOUNT.PAGE_TITLE'),
},
children: [
{
path: 'profile',
name: 'Manage/Account/Profile',
component: () => import('@/views/manage/account/ManageAccountProfile.vue'),
},
{
path: 'security',
name: 'Manage/Account/Security',
component: () => import('@/views/manage/account/ManageAccountSecurity.vue'),
},
],
},
],
},
],
},
];
export default routes;
|
paullouismas/shifts-manager
|
src/router/unprotectedRoutes.ts
|
import { RouteConfig } from 'vue-router';
import store from '@/store';
import i18n from '@/bootstraps/i18n';
const routes: Array<RouteConfig> = [
// Homepage
{
path: '/',
name: 'HomePage',
component: () => import('@/views/HomePage.vue'),
meta: {
title: i18n.t('VIEWS.HOME.PAGE_TITLE'),
},
},
// Auth
{
path: '/auth',
component: () => import('@/views/auth/AuthRoot.vue'),
children: [
{
path: '',
name: 'Auth/Home',
redirect: { name: 'Auth/LogIn' },
},
{
path: 'signup',
name: 'Auth/SignUp',
component: () => import('@/views/auth/SignUp.vue'),
meta: {
title: i18n.t('VIEWS.AUTH.SIGN_UP.PAGE_TITLE'),
},
},
{
path: 'login',
name: 'Auth/LogIn',
component: () => import('@/views/auth/LogIn.vue'),
meta: {
title: i18n.t('VIEWS.AUTH.LOG_IN.PAGE_TITLE'),
},
},
{
path: 'signout',
name: 'Auth/SignOut',
async beforeEnter(to, from, next) {
try {
await store.dispatch('auth/signout');
} catch (error) {
console.error(error);
} finally {
const returnPath = to.query.redirect;
if (returnPath) {
next({ path: returnPath.toString() });
} else {
next({ name: 'HomePage' });
}
}
},
},
],
},
];
export default routes;
|
paullouismas/shifts-manager
|
src/store/manage/index.ts
|
<filename>src/store/manage/index.ts
import { Module } from 'vuex';
import workplaces from './workplaces';
const module: Module<unknown, Record<string, unknown>> = {
namespaced: true,
modules: {
workplaces,
},
};
export default module;
|
paullouismas/shifts-manager
|
src/models/Entity.ts
|
export interface Entity {
/** @flag */
_deleted?: boolean;
/** @flag */
_createdAt: number;
/** @flag */
_updatedAt: number;
}
|
paullouismas/shifts-manager
|
src/bootstraps/font-awesome.ts
|
<filename>src/bootstraps/font-awesome.ts<gh_stars>0
import Vue from 'vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { library } from '@fortawesome/fontawesome-svg-core';
/** @temporary */
import { fas } from '@fortawesome/free-solid-svg-icons';
Vue.component('font-awesome-icon', FontAwesomeIcon);
library.add(fas);
|
michaelketzer/esportlayers-zeus
|
src/api/routes/betSeason.ts
|
import { Request, Response, Router } from "express";
import {
acceptSeasonInvite,
createSeasonInvite,
createUserBetSeason,
deleteBetSeason,
deleteInviteByKey,
deleteUserBetSeason,
denySeasonInvite,
getProvablyFairList,
getProvablyFairListWithoutWinner,
getUserBetSeasons,
getWinner,
listInvites,
listUsers,
patchUserBetSeason,
patchUserBetSeasonRole,
seasonStats,
seasonTopList,
} from "../../services/entity/BetSeasons";
import { User } from "@streamdota/shared-types";
import { checkUserFrameAPIKey } from "../../middleware/frameApi";
import { getBetSeasonRounds } from "../../services/entity/BetRound";
import { publish } from "../../services/twitchChat";
import { requireAuthorization } from "../../middleware/requireAuthorization";
import { requireBetSeasonAccess } from "../../middleware/requireBetSeasonAccess";
import spadille from "spadille";
import { v4 } from "uuid";
const route = Router();
export default (app: Router) => {
app.use("/betSeason", route);
route.get("/", requireAuthorization, async (req: Request, res: Response) => {
const seasons = await getUserBetSeasons((req.user as User).id);
return res.json(seasons).status(200);
});
route.post("/", requireAuthorization, async (req: Request, res: Response) => {
await createUserBetSeason((req.user as User).id, req.body);
return res.sendStatus(201);
});
route.get(
"/rounds/:seasonId",
requireAuthorization,
requireBetSeasonAccess("user"),
async (req: Request, res: Response) => {
const rounds = await getBetSeasonRounds(+req.params.seasonId);
return res.json(rounds).status(200);
}
);
route.get(
"/invites/:seasonId",
requireAuthorization,
requireBetSeasonAccess("owner"),
async (req: Request, res: Response) => {
const invites = await listInvites(+req.params.seasonId);
return res.json(invites).status(200);
}
);
route.get(
"/users/:seasonId",
requireAuthorization,
requireBetSeasonAccess("user"),
async (req: Request, res: Response) => {
const users = await listUsers(+req.params.seasonId);
return res.json(users).status(200);
}
);
route.get(
"/toplist/:seasonId",
checkUserFrameAPIKey,
requireAuthorization,
requireBetSeasonAccess("user"),
async (req: Request, res: Response) => {
const toplist = await seasonTopList(+req.params.seasonId);
return res.json(toplist).status(200);
}
);
route.post(
"/invite/create/:seasonId",
requireAuthorization,
requireBetSeasonAccess("owner"),
async (req: Request, res: Response) => {
const key = await createSeasonInvite(
+req.params.seasonId,
(req.user as User).id
);
return res.json({ key }).status(200);
}
);
route.post(
"/invite/accept/:inviteKey",
requireAuthorization,
async (req: Request, res: Response) => {
await acceptSeasonInvite(req.params.inviteKey, (req.user as User).id);
return res.sendStatus(204);
}
);
route.post(
"/invite/reject/:inviteKey",
requireAuthorization,
async (req: Request, res: Response) => {
await denySeasonInvite(req.params.inviteKey, (req.user as User).id);
return res.sendStatus(204);
}
);
route.delete(
"/invite/:seasonId/:inviteKey",
requireAuthorization,
requireBetSeasonAccess("owner"),
async (req: Request, res: Response) => {
await deleteInviteByKey(
req.params.inviteKey,
+req.params.seasonId,
(req.user as User).id
);
return res.sendStatus(204);
}
);
route.patch(
"/:seasonId",
requireAuthorization,
requireBetSeasonAccess("owner"),
async (req: Request, res: Response) => {
await patchUserBetSeason(+req.params.seasonId, req.body);
return res.sendStatus(204);
}
);
route.patch(
"/:seasonId/:userId",
requireAuthorization,
requireBetSeasonAccess("owner"),
async (req: Request, res: Response) => {
if ((req.user as User).id !== +req.params.userId) {
await patchUserBetSeasonRole(
+req.params.seasonId,
+req.params.userId,
req.body.userRole
);
}
return res.sendStatus(204);
}
);
route.delete(
"/:seasonId",
requireAuthorization,
requireBetSeasonAccess("owner"),
async (req: Request, res: Response) => {
await deleteBetSeason(+req.params.seasonId, +(req.user as User).id);
return res.sendStatus(204);
}
);
route.delete(
"/:seasonId/:userId",
requireAuthorization,
requireBetSeasonAccess("owner"),
async (req: Request, res: Response) => {
if ((req.user as User).id !== +req.params.userId) {
await deleteUserBetSeason(+req.params.seasonId, +req.params.userId);
}
return res.sendStatus(204);
}
);
route.get(
"/:seasonId/stats",
requireAuthorization,
requireBetSeasonAccess("owner"),
async (req: Request, res: Response) => {
const stats = await seasonStats(+req.params.seasonId);
return res.json(stats).status(200);
}
);
route.get(
"/:seasonId/provableWinner/:clientSeed",
requireAuthorization,
requireBetSeasonAccess("owner"),
async (req: Request, res: Response) => {
const list = await getProvablyFairList(+req.params.seasonId);
const serverSeed = v4();
const arbitrarySequence = await spadille.prng.generate({
secret: serverSeed,
payload: req.params.clientSeed,
minimum: 0,
maximum: list.length - 1,
amount: 1,
distinct: false,
});
const winnerEntry = arbitrarySequence[0];
const winner = list[winnerEntry];
setTimeout(async () => {
await publish(
"#" + (req.user as User).displayName.toLocaleLowerCase(),
`Congratulations ${winner}! Verify winner on fairplay.streamdota.com | Server seed: ${serverSeed} | Client seed: ${
req.params.clientSeed
} | Entries: ${list.length - 1} | Ticket: ${winnerEntry}`
);
}, (req.user as User).streamDelay * 1000);
return res
.json({
serverSeed: serverSeed,
count: list.length - 1,
ticket: winnerEntry,
winner,
})
.status(200);
}
);
route.get(
"/current/top3",
checkUserFrameAPIKey,
async (req: Request, res: Response) => {
const top3 = await getWinner((req.user as User).betSeasonId!);
return res.json(top3).status(200);
}
);
route.get(
"/current/randomWinner/:clientSeed",
checkUserFrameAPIKey,
async (req: Request, res: Response) => {
const list = await getProvablyFairListWithoutWinner(
(req.user as User).betSeasonId!
);
const serverSeed = v4();
const arbitrarySequence = await spadille.prng.generate({
secret: serverSeed,
payload: req.params.clientSeed,
minimum: 0,
maximum: list.length - 1,
amount: 1,
distinct: false,
});
const winnerEntry = arbitrarySequence[0];
const winner = list[winnerEntry];
setTimeout(async () => {
await publish(
"#" + (req.user as User).displayName.toLocaleLowerCase(),
`Congratulations ${winner}! Verify winner on fairplay.streamdota.com | Server seed: ${serverSeed} | Client seed: ${
req.params.clientSeed
} | Entries: ${list.length - 1} | Ticket: ${winnerEntry}`
);
}, (req.user as User).streamDelay * 1000);
return res
.json({
serverSeed: serverSeed,
count: list.length,
ticket: winnerEntry - 1,
winner,
})
.status(200);
}
);
};
|
michaelketzer/esportlayers-zeus
|
src/services/betting/state.ts
|
import {
createBet,
createBetRound,
getRoundId,
patchBetRound,
} from "../entity/BetRound";
import { getObj, setObj } from "../../loader/redis";
import { getUserByTrustedChannel, loadUserById } from "../entity/User";
import { User } from "@streamdota/shared-types";
import dayjs from "dayjs";
import { fetchChatterCount } from "../twitchApi";
import { getBettingCommands } from "./chatCommands";
import { publish } from "../twitchChat";
import { requireBetOverlay } from "../entity/BetOverlay";
import { sendMessage } from "../websocket";
export interface BetRoundData {
status: "stream_delay" | "betting" | "game_running" | "finished";
overlayVisibleUntil: number;
overlayVisible: boolean;
streamDelay: number;
votingStartingAt: number;
votingTimeRemaining: number;
votingPossibleUntil: number;
voteCreated: number;
totalVotesCount: number;
chatterCounts: number;
teamACount: number;
teamAVoters: string[];
teamBCount: number;
teamBVoters: string[];
allVoters: string[];
winner: null | string;
winnerAnnouncement: null | number;
announcedStart: boolean;
announcedVoteEnd: boolean;
announcedWinner: boolean;
}
const channeUserCache = new Map<string, User>();
export async function requireUser(channel: string): Promise<User> {
const lowerChannel = channel.toLowerCase();
if (!channeUserCache.has(lowerChannel)) {
const userFromChannel = await getUserByTrustedChannel(channel);
if(userFromChannel) {
const user = (await loadUserById(userFromChannel.id))!;
channeUserCache.set(lowerChannel, user);
} else {
console.log('Unknown channel', channel, 'removed from stack');+
await removeChannel(channel);
}
}
return channeUserCache.get(lowerChannel)!;
}
export function clearChannelUserChannel(userId: number): void {
const user = [...channeUserCache.entries()].find(
([, usr]) => usr.id === userId
);
if (user && user[0]) {
channeUserCache.delete(user[0]);
}
}
function activeVoteKeys(): string {
return `betting_active_channels`;
}
async function addChannel(channel: string): Promise<void> {
const channels = (await getObj<string[]>(activeVoteKeys())) || [];
await setObj(activeVoteKeys(), channels.concat(channel));
}
async function removeChannel(channel: string): Promise<void> {
const channels = (await getObj<string[]>(activeVoteKeys())) || [];
await setObj(
activeVoteKeys(),
channels.filter((c) => c !== channel)
);
}
export function roundKey(channel: string): string {
return `betting_round_state_${channel}`;
}
async function updateListener(channel: string, userId: number): Promise<void> {
const currentRound = await getObj<BetRoundData>(roundKey(channel));
sendMessage(userId, "betting_v2", currentRound);
}
async function startVote(channel: string, user: User): Promise<void> {
const currentRound = await getObj<BetRoundData>(roundKey(channel));
const {
startBet: startBetCommand,
bet: betCommand,
} = await getBettingCommands(channel);
if (startBetCommand) {
let message = startBetCommand.message.replace(
/\{BET_COMMAND\}/g,
betCommand?.command || ""
);
message = message.replace(/\{TEAM_A\}/g, user?.teamAName || "a");
message = message.replace(/\{TEAM_B\}/g, user?.teamBName || "b");
await publish(channel, message);
await createBetRound(user.id, user.betSeasonId);
await setObj(roundKey(channel), {
...currentRound,
status: "betting",
announcedStart: true,
});
await updateListener(channel, user.id);
}
}
async function finishVote(channel: string, user: User): Promise<void> {
const roundId = await getRoundId(user.id);
await patchBetRound(roundId, { status: "running" });
await publish(channel, "Die Votes sind geschlossen.");
const currentRound = await getObj<BetRoundData>(roundKey(channel));
await setObj(roundKey(channel), {
...currentRound,
status: "game_running",
announcedVoteEnd: true,
overlayVisible: false,
});
await updateListener(channel, user.id);
}
async function closeVote(channel: string, user: User): Promise<void> {
const currentRound = await getObj<BetRoundData>(roundKey(channel));
const { winner: winnerCommand } = await getBettingCommands(channel);
await publish(
channel,
winnerCommand.message.replace(/\{WINNER\}/g, currentRound!.winner!)
);
await setObj(roundKey(channel), null);
await removeChannel(channel);
await updateListener(channel, user.id);
}
export async function initializeBet(
channel: string,
userId: number
): Promise<void> {
const user = await loadUserById(userId);
const currentRound = await getObj<BetRoundData>(roundKey(channel));
if (
user &&
user.useBets &&
(!currentRound || currentRound.status === "finished")
) {
const overlay = await requireBetOverlay(userId);
const chatters = await fetchChatterCount(channel.substring(1));
const ts = dayjs().unix();
await setObj(roundKey(channel), {
status: "stream_delay",
overlayVisibleUntil: ts + overlay.timerDuration,
overlayVisible: true,
streamDelay: user.streamDelay,
votingStartingAt: ts + user.streamDelay,
votingTimeRemaining: ts + user.streamDelay,
votingPossibleUntil: ts + user.streamDelay + overlay.timerDuration,
voteCreated: ts,
totalVotesCount: 0,
chatterCounts: chatters,
teamACount: 0,
teamBCount: 0,
teamAVoters: [],
teamBVoters: [],
allVoters: [],
winner: null,
winnerAnnouncement: null,
announcedStart: false,
announcedVoteEnd: false,
announcedWinner: false,
});
await addChannel(channel);
await updateListener(channel, userId);
}
}
export async function registerBet(
channel: string,
userId: number,
votingUserId: number,
displayName: string,
userName: string,
message: string
): Promise<void> {
const currentRound = await getObj<BetRoundData>(roundKey(channel));
if (
currentRound &&
currentRound.status === "betting" &&
!currentRound?.allVoters.includes(userName)
) {
const { bet } = await getBettingCommands(channel);
const payload = message.substr(bet.command.length + 1).toLowerCase();
const user = await loadUserById(userId);
const betOnTeamA = payload.trim().toLowerCase() === user?.teamAName.toLowerCase();
const betOnTeamB = payload.trim().toLowerCase() === user?.teamBName.toLowerCase();
if (user && (betOnTeamA || betOnTeamB)) {
await createBet(
userId,
votingUserId,
displayName,
userName,
betOnTeamA ? user.teamAName : user.teamBName
);
await setObj(roundKey(channel), {
...currentRound,
allVoters: currentRound.allVoters.concat(userName),
...(betOnTeamA
? {
teamAVoters: currentRound.teamAVoters.concat(userName),
teamACount: currentRound.teamACount + 1,
totalVotesCount: currentRound.totalVotesCount + 1,
}
: {}),
...(betOnTeamB
? {
teamBVoters: currentRound.teamBVoters.concat(userName),
teamBCount: currentRound.teamBCount + 1,
totalVotesCount: currentRound.totalVotesCount + 1,
}
: {}),
});
await updateListener(channel, userId);
}
}
}
export async function resolveBet(
channel: string,
userId: number,
result: string
): Promise<void> {
const currentRound = await getObj<BetRoundData>(roundKey(channel));
if (currentRound && currentRound.status === "game_running") {
const user = await loadUserById(userId);
if (
user?.teamAName.toLowerCase() === result.toLowerCase() ||
user?.teamBName.toLowerCase() === result.toLowerCase()
) {
const ts = dayjs().unix();
if (user) {
await setObj(roundKey(channel), {
...currentRound,
winner:
user?.teamAName.toLowerCase() === result.toLowerCase()
? user?.teamAName
: user?.teamBName,
winnerAnnouncement: ts + user?.streamDelay,
});
const roundId = await getRoundId(user.id);
await patchBetRound(roundId, {
result:
user?.teamAName.toLowerCase() === result.toLowerCase()
? user?.teamAName
: user?.teamBName,
status: "finished",
});
await updateListener(channel, userId);
}
}
}
}
async function streamDelayChecker(
data: BetRoundData,
ts: number,
channel: string,
user: User
): Promise<void> {
if (data.overlayVisible && data.overlayVisibleUntil <= ts) {
data.overlayVisible = false;
await setObj(roundKey(channel), data);
await updateListener(channel, user.id);
}
if (data.votingStartingAt <= ts && !data.announcedStart) {
await startVote(channel, user);
}
}
async function bettingChecker(
data: BetRoundData,
ts: number,
channel: string,
user: User
): Promise<void> {
if (data.overlayVisible && data.overlayVisibleUntil <= ts) {
data.overlayVisible = false;
await setObj(roundKey(channel), data);
await updateListener(channel, user.id);
}
if (data.votingPossibleUntil <= ts && !data.announcedVoteEnd) {
await finishVote(channel, user);
} else {
await setObj(roundKey(channel), {
...data,
votingTimeRemaining: data.votingPossibleUntil - ts,
});
await updateListener(channel, user.id);
}
}
async function gameRunningChecker(
data: BetRoundData,
ts: number,
channel: string,
user: User
): Promise<void> {
if (data.overlayVisible && data.overlayVisibleUntil <= ts) {
data.overlayVisible = false;
await setObj(roundKey(channel), data);
await updateListener(channel, user.id);
}
if (data.winner && data.winnerAnnouncement! <= ts && !data.announcedWinner) {
await closeVote(channel, user);
}
}
const statusChecker = {
stream_delay: streamDelayChecker,
betting: bettingChecker,
game_running: gameRunningChecker,
};
export async function updateBetRounds(): Promise<void> {
const activeBettingChannel = (await getObj<string[]>(activeVoteKeys())) || [];
const ts = dayjs().unix();
for (const channel of activeBettingChannel) {
const round = await getObj<BetRoundData>(roundKey(channel));
const user = await requireUser(channel);
if (round && round.status !== "finished") {
await statusChecker[round.status](round, ts, channel, user);
}
}
}
export async function newBettingListener(
userId: number,
displayName: string
): Promise<void> {
await updateListener("#" + displayName.toLowerCase(), userId);
}
export async function resetRound(
channel: string,
userId: number
): Promise<void> {
await setObj(roundKey(channel), null);
await updateListener(channel, userId);
}
|
Kevin170113664/PPet
|
src/renderer/global.d.ts
|
<filename>src/renderer/global.d.ts
declare module '*.scss' {
const content: { [className: string]: string };
export default content;
}
declare const __static: string;
declare const loadlive2d: any;
declare const Live2D: any;
|
Kevin170113664/PPet
|
src/renderer/index.tsx
|
import * as Sentry from '@sentry/electron';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import BasicLayout from './layouts/BasicLayout';
import './index.scss';
Sentry.init({
dsn: 'https://57b49a715b324bbf928b32f92054c8d6@sentry.io/1872002'
});
window.addEventListener(
'contextmenu',
e => {
e.preventDefault();
},
false
);
ReactDOM.render(<BasicLayout />, document.getElementById('app'));
|
Kevin170113664/PPet
|
src/main/main.d.ts
|
declare module 'electron-positioner';
declare module 'electron-localshortcut';
namespace NodeJS {
interface Global {
defaultModelConfigPath: string;
}
}
|
andriy9335/react-native-awesome-module
|
src/index.tsx
|
<reponame>andriy9335/react-native-awesome-module
import { NativeModules } from 'react-native';
type TestPackageType = {
multiply(a: number, b: number): Promise<number>;
};
const { TestPackage } = NativeModules;
export default TestPackage as TestPackageType;
|
Saumiya-Ranjan/Speed-Climbing-Results-Streamer
|
results-stream-service/src/app.ts
|
import express from 'express';
import http from 'http';
import WebSocket from 'ws';
const app = express();
//initialize a simple http server
const server = http.createServer(app);
//initialize the WebSocket server instance
const wss = new WebSocket.Server({ server });
wss.on('connection', (ws: WebSocket) => {
//connection is up, let's add a simple simple event
ws.on('message', function incoming(data) {
console.log('received: %s', data);
//send all data to every client connected to the server
wss.clients.forEach(function each(client) {
if (client !== ws && client.readyState === WebSocket.OPEN) {
client.send(data);
}
});
});
//send immediatly a feedback to the incoming connection
ws.send('Hi there, I am a WebSocket server');
});
//start our server
server.listen(process.env.PORT || 5000, () => {
console.log(`Server started `);
});
|
miloshavlicek/pirate-guide
|
src/components/PageParts/Parties/PartiesSubList.tsx
|
import { IPirateParty } from "../../../data/PirateParties";
import PartiesListButton from "./PartiesListButton";
type Props = {
data?: IPirateParty[],
className?: string
}
export default function PartiesSubList(props: Props) {
const parties = props.data || [] as IPirateParty[];
return (
<div className={"row"}>
{
parties.map((party, i) => (
<div className={"col-md-4 p-2"} key={i}>
<PartiesListButton data={party}></PartiesListButton>
</div>
))
}
</div>
);
}
|
miloshavlicek/pirate-guide
|
src/pages/links/index.tsx
|
import { useTranslation } from "next-i18next";
import Head from "next/head";
import React from "react";
import Link from "next/link";
import Content from "../../components/uni/Content/Content";
import ContentBox from "../../components/uni/Content/ContentBox";
import ContentHeading from "../../components/uni/Content/ContentHeading";
import PartiesList from "../../components/PageParts/Parties/PartiesList";
import PartiesSubList from "../../components/PageParts/Parties/PartiesSubList";
import { PiratePartiesRepository } from "../../data/PirateParties";
import { StaticProps } from "../../tools/Helpers/TranslationHelper";
const repository = new PiratePartiesRepository();
export default function Links() {
const {t} = useTranslation();
const parties = repository.getAll();
const title = t("pages.links.title");
return (
<>
<Head>
<title>{t("app.title")}</title>
</Head>
<div className="bg-light">
<div className="notice-line">
<div className="container">
{t("notices.notPolitical")}
</div>
</div>
<Content>
<Head>
<title>{title + " | " + t("app.title")}</title>
</Head>
<nav aria-label="breadcrumb">
<ol className="breadcrumb">
<li className="breadcrumb-item">
<Link href={"/"}>
<a>{t("pages.home.title")}</a>
</Link>
</li>
<li className="breadcrumb-item active" aria-current="page">
{title}
</li>
</ol>
</nav>
<ContentHeading>
{t("pages.links.partiesByStates")}
</ContentHeading>
<ContentBox>
<PartiesList data={parties.filter(party => party.children?.length)} />
<hr/>
<PartiesSubList data={parties.filter(party => !party.children?.length)} />
</ContentBox>
</Content>
</div>
</>
)
}
export const getStaticProps = StaticProps.default();
|
miloshavlicek/pirate-guide
|
src/components/PageParts/Parties/PartiesListButton.tsx
|
<filename>src/components/PageParts/Parties/PartiesListButton.tsx
import { i18n, useTranslation } from "next-i18next";
import Link from "next/link";
import { IPirateParty } from "../../../data/PirateParties";
type Props = {
data?: IPirateParty,
className?: string
}
export default function PartiesListButton(props: Props) {
const {t} = useTranslation();
const party = props.data || {} as IPirateParty;
const isRegional = !party.tags?.find(tag => tag === "organizational");
return (
<Link href={"/parties/" + party.id}>
<a className={"btn btn-lg " + (party.primaryLanguage === i18n?.language ? "btn-warning" : (isRegional ? "btn-dark" : "btn-secondary")) + " btn-block " + props.className}>
{isRegional ? t("states." + party.id) : (party.title + (party.abbrev ? " (" + party.abbrev + ")" : ""))}
</a>
</Link>
);
}
|
miloshavlicek/pirate-guide
|
src/components/uni/Content/ContentBox.tsx
|
<filename>src/components/uni/Content/ContentBox.tsx
import { CSSProperties, ReactNode } from "react";
type Props = {
title?: string,
children?: ReactNode,
className?: string,
style?: CSSProperties,
noPadding?: boolean
}
export default function ContentBox(props: Props) {
let content = (
<>
{
props.title &&
<h2>{props.title}</h2>
}
{props.children}
</>
);
let className = "my-3 bg-white rounded shadow-sm " + (props.className ?? "");
if (!props.noPadding) {
className += " p-3";
}
return (
<div className={className} style={props.style}>
{content}
</div>
);
}
|
miloshavlicek/pirate-guide
|
src/components/PageParts/Parties/PartiesContent.tsx
|
import { faFacebookF } from "@fortawesome/free-brands-svg-icons/faFacebookF";
import { faGlobe } from "@fortawesome/free-solid-svg-icons/faGlobe";
import { faProjectDiagram } from "@fortawesome/free-solid-svg-icons/faProjectDiagram";
import { faUsers } from "@fortawesome/free-solid-svg-icons/faUsers";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useTranslation } from "next-i18next";
import Link from "next/link";
import { IPirateParty } from "../../../data/PirateParties";
import ContentBox from "../../uni/Content/ContentBox";
import LinkExternal from "../../uni/LinkExternal";
type Props = {
data?: IPirateParty,
className?: string
}
export default function PartiesContent(props: Props) {
const {t} = useTranslation();
const party = props.data || {} as IPirateParty;
return (
<ContentBox className={props.className}>
{
party.projects?.length &&
<h3 className={"mt-4"}>
<FontAwesomeIcon icon={faProjectDiagram} className={"mr-2"}/>
{t("pages.projects.title")}
</h3>
}
{
party.projects?.map((project, i) => {
let note = "";
let btnColor = "warning";
if (project.tags?.includes("unofficial")) {
note = "*";
btnColor = "secondary";
}
return (
<Link key={i} href={"/projects/" + project.id}>
<a className={"btn btn-" + btnColor + " m-1"}>
<FontAwesomeIcon icon={faProjectDiagram} className={"mr-2"}/>
{t(project.title)}{note}
</a>
</Link>
);
})
}
{
party.webSystems?.length &&
<h3 className={"mt-4"}>
<FontAwesomeIcon icon={faGlobe} className={"mr-2"}/>
{t("pages.parties.webSystems")}
</h3>
}
{
party.webSystems?.map((fbGroup, i) => {
return (
<LinkExternal key={i} data={fbGroup}
className={"btn btn-danger m-1"}/>
);
})
}
<h3 className={"mt-4"}>
{t("pages.parties.otherLinks")}
</h3>
{
party.fbPages?.filter(fbPage => {
return !fbPage.tags?.includes("official");
}).map((fbGroup, i) => {
return (
<LinkExternal key={i} data={fbGroup}
className={"btn btn-primary m-1"}
faIcon={faFacebookF}/>
);
})
}
{
party.fbGroups?.filter(fbGroup => {
return !fbGroup.tags?.includes("official");
}).map((fbGroup, i) => {
let note = "";
if (fbGroup.tags?.find(tag => tag === "unofficial")) {
note = "*";
}
return (
<LinkExternal key={i} data={fbGroup}
className={"btn btn-primary m-1"}
faIcon={faUsers}
title={fbGroup.title + note}/>
);
})
}
<p className={"mt-4"}>
* {t("pages.parties.unofficialInitiatives")}
</p>
</ContentBox>
);
}
|
miloshavlicek/pirate-guide
|
src/pages/parties/[id].tsx
|
<gh_stars>1-10
import { useTranslation } from "next-i18next";
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
import Content from "../../components/uni/Content/Content";
import ContentBox from "../../components/uni/Content/ContentBox";
import ContentHeading from "../../components/uni/Content/ContentHeading";
import PartiesContent from "../../components/PageParts/Parties/PartiesContent";
import PartiesLeftMenu from "../../components/PageParts/Parties/PartiesLeftMenu";
import { IPirateParty, PiratePartiesRepository } from "../../data/PirateParties";
import { StaticProps } from "../../tools/Helpers/TranslationHelper";
export default function Parties() {
const {t} = useTranslation();
const router = useRouter();
const {id} = router.query;
const repository = new PiratePartiesRepository();
const party = repository.getAllRecursively().find(party => party.id === id);
if (party === undefined) {
return (
<Content>
<ContentBox>
{t("msg.notFound")}
</ContentBox>
</Content>
)
} else {
const title = t(party.title);
return (
<Content>
<Head>
<title>{title + " | " + t("app.title")}</title>
</Head>
<nav aria-label="breadcrumb">
<ol className="breadcrumb">
<li className="breadcrumb-item">
<Link href={"/"}>
<a>{t("pages.home.title")}</a>
</Link>
</li>
<li className="breadcrumb-item">
<Link href={"/links"}>
<a>{t("pages.links.title")}</a>
</Link>
</li>
<li className="breadcrumb-item active" aria-current="page">
{title}
</li>
</ol>
</nav>
<ContentHeading>
{title}
</ContentHeading>
<div className={"row"}>
<PartiesLeftMenu data={party} className={"col-md-3"}></PartiesLeftMenu>
<PartiesContent data={party} className={"col-md-9"}></PartiesContent>
</div>
</Content>
)
}
}
export const getStaticProps = StaticProps.default();
function getPartiesIdsRecursively(parties: IPirateParty[]): any[] {
let out: any[] = [];
parties.forEach(party => {
out.push(
{
params: {
id: party.id
}
}
);
if (party.children) {
out = out.concat(out, getPartiesIdsRecursively(party.children));
}
});
return out;
}
export const getStaticPaths = async () => {
const repository = new PiratePartiesRepository();
const ids = getPartiesIdsRecursively(repository.getAll(false, false));
return {
paths: ids,
fallback: "blocking"
}
}
|
miloshavlicek/pirate-guide
|
src/pages/index.tsx
|
<gh_stars>1-10
import React from "react";
import { StaticProps } from "../tools/Helpers/TranslationHelper";
import Links from "./links";
export default function Home() {
return (
<Links/>
)
}
export const getStaticProps = StaticProps.default();
|
miloshavlicek/pirate-guide
|
src/components/WebParts/Header.tsx
|
import { i18n, useTranslation } from "next-i18next";
import Link from "next/link"
import { NextRouter, useRouter } from "next/router";
import React from "react";
import { MenuItemsRepository } from "../../data/MenuItems";
function onLangChange(lang: string, router: NextRouter) {
i18n?.changeLanguage(lang);
router.push(router.pathname, router.pathname, {locale: lang})
}
export default function Header() {
const {t} = useTranslation();
const router = useRouter();
const menuItems = (new MenuItemsRepository()).getAll();
return (
<header className="p-3 bg-dark text-white">
<div className="container">
<div className="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<ul className="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0 mr-auto">
{
menuItems.map(menuItem => (
<li key={menuItem.title}>
<Link href={menuItem.url || "#"}>
<a className="nav-link px-2 text-white">
{t(menuItem.title)}
</a>
</Link>
</li>
))
}
</ul>
<div>
<div className="d-inline-block mt-1">
<select className="form-control" value={i18n?.language}
onChange={(e) => onLangChange(e.target.value, router)}>
{["en", "cz"].map(lang => (
<option key={lang} value={lang}>
{lang.toUpperCase()}
</option>
))}
</select>
</div>
</div>
</div>
</div>
</header>
)
}
|
miloshavlicek/pirate-guide
|
src/pages/_document.tsx
|
<filename>src/pages/_document.tsx
import Document, { Head, Html, Main, NextScript } from "next/document"
class MyDocument extends Document {
render() {
return (
<Html prefix="og: https://ogp.me/ns#">
<Head>
<link rel="manifest" href="/manifest.json"/>
<link rel="icon" type="image/png" sizes="196x196" href="/img/pwa/pirates_square_196.png"/>
<link rel="apple-touch-icon" href="/img/pwa/g/apple-icon-180.png"/>
<meta name="mobile-web-app-capable" content="yes"/>
</Head>
<body>
<Main/>
<NextScript/>
</body>
</Html>
)
}
}
export default MyDocument
|
miloshavlicek/pirate-guide
|
src/data/PirateParties.ts
|
import { useTranslation } from "next-i18next";
import { IExternalLink } from "../model/IExternalLink";
import { deepCopy } from "../tools/Helpers/Tools";
import { CachedRepository } from "../tools/Repository/CachedRepository";
export interface IProject {
id: string;
title: string;
website?: IExternalLink;
fbGroups?: IExternalLink[];
fbPages?: IExternalLink[];
webSystems?: IExternalLink[];
tags?: string[];
}
export interface IPirateParty {
id: string;
title: string;
abbrev?: string;
region?: string;
fbGroups?: IExternalLink[];
fbPages?: IExternalLink[];
webSystems?: IExternalLink[];
children?: IPirateParty[];
parent?: IPirateParty;
projects?: IProject[];
links?: IExternalLink[];
primaryLanguage?: string;
tags?: string[];
}
const data: IPirateParty[] = [
{
id: "international",
title: "parties.international",
abbrev: "PPI",
tags: ["organizational"],
links: [
{
url: "https://pp-international.net/",
lang: "en",
tags: ["website"]
},
{
url: "https://en.wikipedia.org/wiki/Pirate_Parties_International",
lang: "en",
tags: ["wikipedia"]
},
{
url: "https://cs.wikipedia.org/wiki/Internacion%C3%A1la_pir%C3%A1tsk%C3%BDch_stran",
lang: "cz",
tags: ["wikipedia"]
}
],
children: [
{
id: "eu",
title: "parties.eu",
abbrev: "PPEU",
primaryLanguage: "en",
links: [
{
url: "https://european-pirateparty.eu/",
lang: "en",
tags: ["website"]
}
]
},
{
id: "at",
title: "parties.at",
links: [
{
url: "https://piratenpartei.at/",
lang: "at",
tags: ["website"]
}
]
},
{
id: "pl",
title: "parties.pl",
links: [
{
url: "https://polskapartiapiratow.pl/",
lang: "pl",
tags: ["website"]
}
]
},
{
id: "by",
title: "parties.by"
},
{
id: "ba",
title: "parties.ba"
},
{
id: "br",
title: "parties.br",
links: [
{
url: "https://partidopirata.org/",
lang: "br",
tags: ["website"]
}
]
},
{
id: "bg",
title: "parties.bg"
},
{
id: "cat",
title: "parties.cat"
},
{
id: "cl",
title: "parties.cl",
links: [
{
url: "https://en.wikipedia.org/wiki/Pirate_Party_of_Chile",
lang: "en",
tags: ["wikipedia"]
},
{
url: "https://www.partidopirata.cl/",
lang: "cl",
tags: ["website"]
}
]
},
{
id: "cz",
title: "parties.cz",
primaryLanguage: "cz",
links: [
{
url: "https://www.pirati.cz/",
lang: "cz",
tags: ["website"]
},
{
url: "https://www.twitter.com/PiratskaStrana",
lang: "cz",
tags: ["twitter"]
},
{
url: "https://www.instagram.com/pirati.cz/",
lang: "cz",
tags: ["instagram"]
},
{
url: "https://www.pirati.cz/feed.xml",
lang: "cz",
tags: ["rss/atom"]
}
],
fbGroups: [
{
title: "Piráti v médiích",
url: "https://www.facebook.com/groups/346867865761153",
tags: ["unofficial"]
},
{
title: "PIRÁTI HLÍDAJÍ PIRÁTY",
url: "https://www.facebook.com/groups/1362574270514956",
tags: ["unofficial"]
},
{
title: "Pirátská dobrovolná výměna informací",
url: "https://www.facebook.com/groups/548746252525598",
tags: ["unofficial"]
},
{
title: "Supertajnánekvotováskupinatopsecretvoe",
url: "https://www.facebook.com/groups/2017699364980792",
tags: ["unofficial"]
}
],
fbPages: [
{
title: "Česká pirátská strana",
url: "https://www.facebook.com/ceska.piratska.strana",
tags: ["official"]
},
],
webSystems: [
{
title: "Fórum Pirátské strany",
url: "https://forum.pirati.cz/"
},
{
title: "Pirátský profil",
url: "https://profil.pirati.cz/"
},
{
title: "Mrak (cloud)",
url: "https://mrak.pirati.cz/"
},
{
title: "Moodle (e-learning)",
url: "https://moodle.pirati.cz/"
},
{
title: "Zulip",
url: "https://zulip.pirati.cz/"
},
{
title: "Mastodon",
url: "https://mastodon.pirati.cz/"
},
{
title: "Wiki",
url: "https://wiki.pirati.cz/"
},
{
title: "Redmine",
url: "https://redmine.pirati.cz/"
},
{
title: "Pirátské listy",
url: "https://www.piratskelisty.cz/"
},
{
title: "Pirátský obchod (e-shop)",
url: "https://www.piratskyobchod.cz/"
},
{
title: "Registr smluv",
url: "https://smlouvy.pirati.cz/"
},
{
title: "Evidence lobystických kontaktů",
url: "https://smlouvy.pirati.cz/"
},
{
title: "Otevřené účetnictví",
url: "https://piroplaceni.pirati.cz/"
}
],
children: [
{
id: "cz-praha",
title: "KS Praha",
children: [
{
id: "cz-praha-1",
title: "MS Praha 1",
fbGroups: [
{
title: "Piráti Praha 1",
url: "https://www.facebook.com/groups/httpspraha1.pirati.cz/",
tags: ["official"]
}
]
},
{
id: "cz-praha-2",
title: "MS Praha 2"
},
{
id: "cz-praha-3",
title: "MS Praha 3"
},
{
id: "cz-praha-4",
title: "MS Praha 4"
},
{
id: "cz-praha-5",
title: "MS Praha 5"
},
{
id: "cz-praha-6",
title: "MS Praha 6"
},
{
id: "cz-praha-7",
title: "MS Praha 7"
},
{
id: "cz-praha-8",
title: "MS Praha 8"
},
{
id: "cz-praha-9",
title: "MS Praha 9"
},
{
id: "cz-praha-10",
title: "MS Praha 10"
},
{
id: "cz-praha-11",
title: "MS Praha 11"
},
{
id: "cz-praha-12",
title: "MS Praha 12"
},
{
id: "cz-praha-13",
title: "MS Praha 13"
},
{
id: "cz-praha-14",
title: "MS Praha 14"
},
{
id: "cz-praha-21",
title: "MS Praha 21"
},
{
id: "cz-praha-reporyje",
title: "MS Praha - Řeporyje"
}
],
fbGroups: [
{
title: "Piráti - Praha",
url: "https://www.facebook.com/groups/125479366717/",
tags: ["official"]
}
]
},
{
id: "cz-jc",
title: "KS Jihočeský kraj"
},
{
id: "cz-jm",
title: "KS Jihomoravský kraj"
},
{
id: "cz-kv",
title: "KS Karlovarský kraj"
},
{
id: "cz-hk",
title: "KS Královéhradecké kraj"
},
{
id: "cz-lib",
title: "KS Liberecký kraj"
},
{
id: "cz-ms",
title: "KS Moravskoslezský kraj"
},
{
id: "cz-ol",
title: "KS Olomoucký kraj"
},
{
id: "cz-par",
title: "KS Pardubický kraj"
},
{
id: "cz-plz",
title: "KS Plzeňský kraj"
},
{
id: "cz-sc",
title: "KS Středočeský kraj"
},
{
id: "cz-uk",
title: "KS Ústecký kraj"
},
{
id: "cz-vys",
title: "KS Vysočina",
children: [
{
id: "cz-vys-hab",
title: "MS Havlíčkův Brod",
abbrev: "VYS-HaB"
},
{
id: "cz-vys-jih",
title: "MS Jihlavsko",
abbrev: "VYS-Jih"
},
{
id: "cz-vys-pel",
title: "MS Pelhřimov",
abbrev: "VYS-Pel"
},
{
id: "cz-vys-te",
title: "MS Telčsko",
abbrev: "VYS-Te"
},
{
id: "cz-vys-trb",
title: "MS Třebíčsko",
abbrev: "VYS-Trb"
},
]
},
{
id: "cz-zk",
title: "KS Zlínský kraj"
}
],
projects: [
{
id: "cz-seniori",
title: "Senioři na palubě",
fbGroups: [
{
title: "Senioři na palubě",
url: "https://www.facebook.com/groups/seniorinapalube"
}
],
tags: ["official"]
},
{
id: "cz-rovne-sance",
title: "Rovné šance",
fbGroups: [
{
title: "Genderfuck Pirátské soirée aneb rovnost všem",
url: "https://www.facebook.com/groups/2454582831467775",
tags: ["official"]
}
],
tags: ["official"]
},
{
id: "cz-elearning",
title: "Pirátský elearning",
fbPages: [
{
title: "Pirátský e-learning",
url: "https://www.facebook.com/piratskyelearning/",
tags: ["official"]
}
],
tags: ["official"]
},
{
id: "p4l",
title: "Pirates for Liberty",
fbGroups: [
{
title: "Fórum Pirates for Liberty CZ",
url: "https://www.facebook.com/groups/260715082460013",
tags: ["official"]
}
],
tags: ["unofficial"]
},
{
id: "piratskatelevize",
title: "Pirátská televize",
tags: ["unofficial"],
website: {
url: "https://piratskatelevize.cz/"
}
}
]
},
{
id: "ee",
title: "parties.ee",
links: [
{
url: "https://en.wikipedia.org/wiki/Estonian_Pirate_Party",
lang: "en",
tags: ["wikipedia"]
},
{
url: "https://piraadipartei.ee/",
lang: "ee",
tags: ["website"]
}
]
},
{
id: "fr",
title: "parties.fr",
links: [
{
url: "https://en.wikipedia.org/wiki/Pirate_Party_(France)",
lang: "en",
tags: ["wikipedia"]
},
{
url: "https://partipirate.org/",
lang: "fr",
tags: ["website"]
}
]
},
{
id: "de",
title: "parties.de",
links: [
{
url: "https://en.wikipedia.org/wiki/Pirate_Party_Germany",
lang: "en",
tags: ["wikipedia"]
},
{
url: "https://www.piratenpartei.de/",
lang: "de",
tags: ["website"]
}
]
},
{
id: "gr",
title: "parties.de",
links: [
{
url: "https://en.wikipedia.org/wiki/Pirate_Party_of_Greece",
lang: "en",
tags: ["wikipedia"]
},
{
url: "https://www.pirateparty.gr/",
lang: "gr",
tags: ["website"]
},
]
},
{
id: "hu",
title: "parties.hu",
links: [
{
url: "https://en.wikipedia.org/wiki/Pirate_Party_of_Hungary",
lang: "en",
tags: ["wikipedia"]
}
]
},
{
id: "sk",
title: "parties.sk",
links: [
{
url: "https://www.slovenskipirati.sk/",
tags: ["website"]
}
]
},
{
id: "il",
title: "parties.il",
links: [
{
url: "https://piratim.org/",
tags: ["website"]
}
]
},
{
id: "it",
title: "parties.it",
links: [
{
url: "https://www.partito-pirata.it/",
tags: ["website"]
}
]
}
]
},
{
id: "au",
title: "parties.au",
links: [
{
url: "https://pirateparty.org.au/",
tags: ["website"]
}
]
},
{
id: "se",
title: "parties.se",
links: [
{
url: "https://piratpartiet.se/",
tags: ["website"]
}
]
},
{
id: "is",
title: "parties.is",
links: [
{
url: "https://piratar.is/",
tags: ["website"]
}
]
},
{
id: "ca",
title: "parties.ca",
links: [
{
url: "https://en.wikipedia.org/wiki/Pirate_Party_of_Canada",
tags: ["wikipedia"],
lang: "en"
}
]
},
{
id: "be",
title: "parties.be",
links: [
{
url: "https://pirateparty.be/",
tags: ["website"],
lang: "be"
},
{
url: "https://en.wikipedia.org/wiki/Pirate_Party_(Belgium)",
tags: ["wikipedia"],
lang: "en"
}
]
},
{
id: "uk",
title: "parties.uk",
links: [
{
url: "https://www.pirateparty.org.uk/",
tags: ["website"],
lang: "en"
},
{
url: "https://en.wikipedia.org/wiki/Pirate_Party_UK",
tags: ["wikipedia"],
lang: "en"
}
]
},
{
id: "pwb",
title: "parties.pwb",
links: [
{
url: "https://pirates-without-borders.ch/",
tags: ["website"],
lang: "en"
},
{
url: "https://www.facebook.com/pirateswithoutborders",
tags: ["fb:page"],
lang: "en"
}
],
tags: ["organizational"],
},
];
export class PiratePartiesRepository extends CachedRepository<IPirateParty> {
protected processItem = (item: IPirateParty) => {
const {t} = useTranslation();
const copy = deepCopy(item);
if (copy.title) {
copy.title = t(copy.title);
}
copy.links?.forEach(link => {
if (link?.title) {
link.title = t(link.title);
}
})
return copy;
}
protected fetchAll() {
return data;
}
}
|
miloshavlicek/pirate-guide
|
src/pages/projects/[id].tsx
|
import { faFacebookF } from "@fortawesome/free-brands-svg-icons/faFacebookF";
import { faGlobe } from "@fortawesome/free-solid-svg-icons/faGlobe";
import { faNewspaper } from "@fortawesome/free-solid-svg-icons/faNewspaper";
import { faUsers } from "@fortawesome/free-solid-svg-icons/faUsers";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useTranslation } from "next-i18next";
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
import Content from "../../components/uni/Content/Content";
import ContentBox from "../../components/uni/Content/ContentBox";
import ContentHeading from "../../components/uni/Content/ContentHeading";
import LinkExternal from "../../components/uni/LinkExternal";
import { IPirateParty, PiratePartiesRepository } from "../../data/PirateParties";
import { StaticProps } from "../../tools/Helpers/TranslationHelper";
export default function Parties() {
const {t} = useTranslation();
const router = useRouter();
const {id} = router.query;
const repository = new PiratePartiesRepository();
const party = repository.getAllRecursively().find(party => {
if(party.projects) {
return party.projects?.find(project => project.id === id);
}
});
const project = party?.projects?.find(project => project.id === id);
if (project === undefined) {
return (
<Content>
<ContentBox>
{t("msg.notFound")}
</ContentBox>
</Content>
)
} else {
const title = t(project.title);
return (
<Content>
<Head>
<title>{title + " | " + t("app.title")}</title>
</Head>
<nav aria-label="breadcrumb">
<ol className="breadcrumb">
<li className="breadcrumb-item">
<Link href={"/"}>
<a>{t("pages.home.title")}</a>
</Link>
</li>
<li className="breadcrumb-item">
<Link href={"/links"}>
<a>{t("pages.projects.title")}</a>
</Link>
</li>
<li className="breadcrumb-item active" aria-current="page">
{title}
</li>
</ol>
</nav>
<ContentHeading>
{title}
</ContentHeading>
<ContentBox>
{
project.website &&
<LinkExternal data={project.website}
title={"Website"}
className={"btn btn-dark"}
faIcon={faGlobe}/>
}
<h3 className={"mt-4"}>
<FontAwesomeIcon icon={faUsers} className={"mr-2"}/>
{t("pages.parties.fbGroups")}
</h3>
{
project.fbGroups?.map((fbGroup, i) => {
return (
<LinkExternal key={i} data={fbGroup}
className={"btn btn-primary m-1"}
faIcon={faFacebookF}/>
);
})
}
<h3 className={"mt-4"}>
<FontAwesomeIcon icon={faNewspaper} className={"mr-2"}/>
{t("pages.parties.fbPages")}
</h3>
{
project.fbPages?.map((fbGroup, i) => {
return (
<LinkExternal key={i} data={fbGroup}
className={"btn btn-secondary m-1"}
faIcon={faFacebookF}/>
);
})
}
<h3 className={"mt-4"}>
<FontAwesomeIcon icon={faGlobe} className={"mr-2"}/>
{t("pages.parties.webSystems")}
</h3>
{
project.webSystems?.map((fbGroup, i) => {
return (
<LinkExternal key={i} data={fbGroup}
className={"btn btn-danger m-1"}/>
);
})
}
</ContentBox>
</Content>
)
}
}
export const getStaticProps = StaticProps.default();
function getProjectsIdsRecursively(parties: IPirateParty[]): any[] {
let out: any[] = [];
parties.forEach(party => {
if (party.projects) {
out = out.concat(out, party.projects.map((project) => {
return {
params: {
id: project.id
}
};
}));
}
if (party.children) {
out = out.concat(out, getProjectsIdsRecursively(party.children));
}
});
return out;
}
export const getStaticPaths = async () => {
const repository = new PiratePartiesRepository();
const ids = getProjectsIdsRecursively(repository.getAll(false, false));
return {
paths: ids,
fallback: "blocking"
}
}
|
miloshavlicek/pirate-guide
|
src/components/PageParts/Parties/PartiesLeftMenu.tsx
|
import { faFacebookF } from "@fortawesome/free-brands-svg-icons/faFacebookF";
import { faInstagram } from "@fortawesome/free-brands-svg-icons/faInstagram";
import { faTwitter } from "@fortawesome/free-brands-svg-icons/faTwitter";
import { faWikipediaW } from "@fortawesome/free-brands-svg-icons/faWikipediaW";
import { faGlobe } from "@fortawesome/free-solid-svg-icons/faGlobe";
import { faRss } from "@fortawesome/free-solid-svg-icons/faRss";
import { faSitemap } from "@fortawesome/free-solid-svg-icons/faSitemap";
import { faUsers } from "@fortawesome/free-solid-svg-icons/faUsers";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { i18n, useTranslation } from "next-i18next";
import Link from "next/link";
import { IPirateParty } from "../../../data/PirateParties";
import ContentBox from "../../uni/Content/ContentBox";
import LinkExternal from "../../uni/LinkExternal";
type Props = {
data?: IPirateParty,
className?: string
}
export default function PartiesLeftMenu(props: Props) {
const {t} = useTranslation();
const party = props.data || {} as IPirateParty;
let website = party.links?.find(link => link.tags?.includes("website") && link.lang === i18n?.language);
if (!website) {
website = party.links?.find(link => link.tags?.includes("website"));
}
const wikiLink = party.links?.find(link => link.tags?.includes("wikipedia") && link.lang === i18n?.language);
const twitter = party.links?.find(link => link.tags?.includes("twitter"));
const instagram = party.links?.find(link => link.tags?.includes("instagram"));
const rss = party.links?.find(link => link.tags?.includes("rss/atom"));
return (
<ContentBox className={props.className}>
{
website &&
<LinkExternal data={website}
title={"Website"}
className={"btn btn-secondary btn-block"}
faIcon={faGlobe}/>
}
{
wikiLink &&
<LinkExternal data={wikiLink}
title={"Wikipedia"}
className={"btn btn-secondary btn-sm btn-block"}
faIcon={faWikipediaW}/>
}
<div className={"my-2 text-center"}>
{
party.fbPages?.filter(fbPage => {
return fbPage.tags?.includes("official");
}).map((fbPage, i) => {
return (
<LinkExternal key={i}
data={fbPage}
title={""}
className={"btn btn-primary mr-1"}
faIcon={faFacebookF}/>
);
})
}
{
twitter &&
<LinkExternal data={twitter}
title={""}
className={"btn btn-primary mr-1"}
faIcon={faTwitter}/>
}
{
instagram &&
<LinkExternal data={instagram}
title={""}
className={"btn btn-danger mr-1"}
faIcon={faInstagram}/>
}
{
rss &&
<LinkExternal data={rss}
title={""}
className={"btn btn-warning mr-1"}
faIcon={faRss}/>
}
</div>
{
party.fbGroups?.filter(fbGroup => {
return fbGroup.tags?.includes("official");
}).map((fbGroup, i) => {
return (
<LinkExternal key={i} data={fbGroup}
className={"btn btn-primary btn-block"}
faIcon={faUsers}/>
);
})
}
{
party.parent &&
<>
<h3 className={"mt-4"}>
<small>
{t("pages.parties.superParty")}
</small>
</h3>
<Link href={"/parties/" + party.parent.id}>
<a className={"btn btn-secondary btn-sm btn-block text-left"}>
{t(party.parent.title)}
</a>
</Link>
</>
}
{
party.children?.length &&
<h3 className={"mt-4"}>
<small>
<FontAwesomeIcon icon={faSitemap} className={"mr-2"}/>
{t("pages.parties.subParties")}
</small>
</h3>
}
{
party.children?.map((child, i) => {
return (
<Link key={i} href={"/parties/" + child.id}>
<a className={"btn btn-dark btn-block text-left"}>
{t(child.title)}
</a>
</Link>
);
})
}
</ContentBox>
);
}
|
miloshavlicek/pirate-guide
|
src/components/uni/LinkInternal.tsx
|
<gh_stars>1-10
import { IconProp } from "@fortawesome/fontawesome-svg-core";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import Link from "next/link"
import { ReactNode } from "react";
import { IExternalLink } from "../../model/IExternalLink";
import { deepCopy } from "../../tools/Helpers/Tools";
type Props = {
data?: IExternalLink,
title?: string,
url?: string,
className?: string,
faIcon?: IconProp,
rel?: string
target?: string,
children?: ReactNode,
}
export default function LinkInternal(props: Props) {
let data = props.data ? deepCopy(props.data) : {} as IExternalLink;
data.title = props.title ?? data.title;
data.url = props.url ?? data.url ?? "#";
data.faIcon = props.faIcon ?? data.faIcon;
const title = data.title ?? data.url;
const icon = data.faIcon ? (
<FontAwesomeIcon icon={data.faIcon} className={title.length ? "mr-2" : ""}/>
) : undefined;
const titleSubEl = data.titleSub ? <> <small>{data.titleSub}</small></> : undefined;
const children = <>{props.children ?? <>{data.title}{titleSubEl}</>}</>
return (
<Link href={data.url}>
<a target={props.target}
rel={props.rel}
className={props.className}>
{icon}{children}
</a>
</Link>
);
}
|
miloshavlicek/pirate-guide
|
src/components/PageParts/Parties/PartiesList.tsx
|
import { useTranslation } from "next-i18next";
import { IPirateParty } from "../../../data/PirateParties";
import PartiesListButton from "./PartiesListButton";
import PartiesSubList from "./PartiesSubList";
type Props = {
data?: IPirateParty[],
className?: string
}
export default function PartiesList(props: Props) {
const {t} = useTranslation();
const parties = props.data || [] as IPirateParty[];
return (
<>
{
parties.map((party, i) => (
<div key={i}>
<div className={"row text-center"}>
<div className={"col-md-4"}/>
<div className={"col-md-4 p-2"}>
<PartiesListButton data={party} key={i}/>
</div>
</div>
<PartiesSubList data={party.children}/>
</div>
)
)
}
</>
);
}
|
herostat88/aavegotchi
|
data/airdrops/snapshot2.tsx
|
<gh_stars>0
export const addresses = [
"0x00000000005dbcb0d0513fcda746382fe8a53468",
"0x002793348763d5433689e118112e353fda778b7a",
"0x006f5c906fad5d25c9a94b92d010114315177950",
"0x00a5a4c2bfdcf9311508f2d2ddf4d0439e05cf2b",
"0x00d672e53e8e9bcd4ee4bb2f05032b3c25e3c04c",
"0x00e554787bae96f93e1a5af370d434e3f9ff5a4f",
"0x00fdbb477d1cd363c333eac93fe7eb0397acd470",
"0x012230a6e52a46f6864dee4b07e24383bb6b925c",
"0x012477178d3987841ba373f750f745c054b59729",
"0x017252042524df387a7ed994d41d7bde44f4670a",
"0x01cbca310c9f65d8877bddf0a70f57e5de294fde",
"0x02206509a713e003bd099fd12a2edfef9af84665",
"0x0231ffe3d56064d3e480fbc47742d6bfb59a9101",
"0x0236c75860d07e8d5add17c88b9dac04472c2295",
"0x02632569d858370906ac6116b0ae25059fb34a82",
"0x027747771ce20e60d24344e2a62a1377960cced0",
"0x02aee0ce756fa0157294ff3ff48c1dd02adccf04",
"0x02f5d9c2b5376f8b9150cf148aa88a5fdd5dcc50",
"0x034961ef5fd3f25dbb91440ad3ce0a119e875847",
"0x0351147eee8e58f3aa8902629a3e9b86d8fef4a3",
"0x038f77ab71fc40949eea81aa65b471c6a3f1a02d",
"0x03d813abfba88e76407d09ef92e05f164ac1a985",
"0x03f2b3ff6c8dd252556a0e15b60f9d1618dddf3b",
"0x04629961e9199b19a33e2e2f1c7bb60853e01ee0",
"0x046e3ead1fa61209c874a2f3751ede2cdc8451eb",
"0x04b5c5d08ddef275535c5a95a62f803fc1cd3dba",
"0x04c55912af70c59cefbc350eb864071f24835fcf",
"0x04dff326d9de5e20117ebe836384a85db14d2a05",
"0x0524c91701fcc461c90b3120769b5f295f706a16",
"0x052dbf52c7343268d5fe56d226ddc0405d762018",
"0x0553de51e7fa7658f0517e573d79eebbb59852f2",
"0x056f2f34ae9f48c1622eab9cf12a0b156e34acc1",
"0x05addf2008ac6a698cd41e2176e72d9cbfd0a35d",
"0x05eaf3564c72506ac18981890f1b1e9873a43a4e",
"0x061b8335e1d2042975c4ed849943334bd07fb504",
"0x0628c084f4b72c1297e96c7005f309ae89f982a6",
"0x0628ff854c191d4b80d2f07b3f1a39d878cd2e3a",
"0x0690d7a3e7075f871b804dfde6e690ccfdebcddc",
"0x0696c61b485a7765607c7958b28c24186473e53d",
"0x069ba44bfe4584ecf7e5c2346e2cbdc916bf30ac",
"0x06b1bf28c962363f212878bdf87417ebd0316220",
"0x06ba28eca19b5b36087adc190e191cda679d3a39",
"0x06c93df4de7a1d6ff530c7c2c3bed65aa88258f1",
"0x070c8eba534900e54d74b215d1dc54d8b05514be",
"0x070f7d639bed7b25e3edfb1d9f85d7d742fa5e19",
"0x071d217637b6322a7faac6895a9eb00e529d3424",
"0x0725faf58e743002ff5869754b71032d3e88aa02",
"0x07494efb9fc623b74b31714192826c70eba7423f",
"0x07a009e9e98649bff954cf3032ceb3e21e020f49",
"0x07a55459518302545ba130194ae635fe90d16293",
"0x08810832b3c92bb103c5a31057b61932af439a3c",
"0x08e5e4df2f56be734ead5c80a3b2377616210a62",
"0x08ff3b6244588c3bde2fcb4e302adac452c7f153",
"0x0910fccd3e3a349944415bcef7585b48daecd617",
"0x096be94d79f3d056a0e4af61c1074a179378ce0c",
"0x09a1a849974d021a0f74366e5020884ff73e3abb",
"0x0a2492d1b9a80fe094a011d645666653f3d3fc09",
"0x0a35efacec3641dc52f73c4dd58cfb96077273d0",
"0x0a38c3a976b169574bd16412b654c1ee0db92e1b",
"0x0a573bc3489d3dc339643ce50767c19eeb3fed70",
"0x0a8ef379a729e9b009e5f09a7364c7ac6768e63c",
"0x0ac13e4ecd5de5bcb4abe8b0e8eabf63b105bec0",
"0x0ad387ab62bdf36dab3c9c239635e7cf09c61e88",
"0x0b1404a68234dd7efc633aee31be85ba56837fd4",
"0x0b22380b7c423470979ac3ed7d3c07696773dea1",
"0x0b31e9737fee75157a9aa775e35a43dec1dc2059",
"0x0b32b6a775ccf57ff75078a702249a65c8a581fe",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x0bad4ebff09ced8dfffc2d99ea04108e1afab8b2",
"0x0c2ec205cf0f50995dd84f0655b54848844bda74",
"<KEY>",
"0x0d567e8bfe01d9a0e8f1f696ba0deeb37f045211",
"0x0d6e94d085a597f316be1833649e05a45103e873",
"0x0db5e7924d87d2ec27876882e7af911a58050dd1",
"0x0df24aa65e9f014432b3b5f2f9fcf75e9fecab35",
"0x0df670ef3228416d1249ab7a9b32d683444a8565",
"0x0df8fa5adc6faf8cc0e9ee7534cae7c7a7d106e4",
"0x0e05fc644943aae89dd3fec282c3f86431a7d090",
"0x0e3347baed6e6070097c978247ead2f716c4b7a0",
"0x0e5716e48bdf2f3dfa3a355eaeb422b19fe8ac32",
"0x0e64cbca254788df4a8d29e3721d077d91d0d92a",
"0x0e68fd97c1f4d0ff45cb3a74c4ca6e19695d68e4",
"0x0e99fdb98268e17ccb534fcf8a3eb81096cda55b",
"0x0ea3e3c22f1586efc55bde21a11ee4d3473f86f0",
"0x0eeeff44e8f65db5cc841e3a3d591499b74f85e6",
"0x0efe5cff5d5e5241fc1f9456360e55cc4258c997",
"0x0f224849def5de048b4b33b692ff4ff4f4551319",
"0x0fac4d7cbd5ade3e7005cc39bd59ac0c6b3b3a31",
"0x0fbad79c4468a074ac0972bed4e6fbfc85fe73a4",
"0x10159187a197811fea1edb7200426b562bd6fa18",
"0x101addc07d63a6b35b199153252168ab9889dca1",
"0x1035fee7621a4a902d75094abd2e378e64b4b6ce",
"0x104b15a3eda9edb18d3f996bc5a3022c657b8b57",
"0x1051d008887b686c9085163063e2649f1f21e4fc",
"0x10b989914a478ed7de2d2c4cc4e835bbd3de229b",
"0x10d2ed17408a508bc1693d1fb7f3b9899a96cc98",
"0x10dbc99c90234e4447f0366e8368d688f622475a",
"0x116a45d9cd43c16d3835d09c735a69befd447866",
"0x118b427af645e5e696e6da748bd66ac8e4f5e9a8",
"0x11cf16447f9312b4ffd1c99c4390df04cc8e33ac",
"0x12668165569deffa1a556b1a5220f799e727f23d",
"<KEY>",
"0x1279a8132c775ede3e738cc2a753ffe47d009353",
"<KEY>",
"0x127d60193f08626e168099fc2277e31f5a89b1a7",
"0x128a5577dc4d91fe23bfe81e0d7216b366d61c97",
"<KEY>",
"<KEY>",
"<KEY>",
"0x1365716fe316193f5f393cde935effdfce8924cb",
"0x137c0f7d6b2558edf5b8f69eec0635dd43fad6af",
"0x13b262dbe74389fd68a7d224d7ca90c4d3779516",
"0x13d037122822fa0aa5569d01aae4ac3c4ded6ba4",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x15e99b8d02b0ca9ece6b3a87b1e4babd71d6ae9a",
"0x15f7320adb990020956d29edb6ba17f3d468001e",
"<KEY>",
"<KEY>",
"<KEY>",
"0x169efe5ffa1011fd90ee8438785e49066ed8ed31",
"0x16a1708187cf1717744aa1e8bdb47a93ce1d2e69",
"0x170c3d36b7b6fa957c8b454c416f66c4085971c7",
"0x172572132853e2e7775d830bd085a8dc87029921",
"0x172d7a92660006ebecb125c712fa0fe9dd53e106",
"0x1745296f22889abcfff04f041621d880d3417633",
"0x174b079bb5aeb7a7ffa2a6407b906a844738428d",
"0x1754352eacb753327fec2d4f48f0fb36b672c5e0",
"0x17610bc0056dd1374340aebdcaac4f9755c5f408",
"0x176b8c8dd7657a011fcac694364e69cf011980e9",
"0x1779b5aa4fb5e471f1356f7a81e67e716bb69512",
"<KEY>",
"0x17a3831b39cc557296d0c322f9c2d42c0b3a8f3f",
"0x17d23b16ec80dfee33cd9a844576329e3a09a10c",
"<KEY>",
"0x18ff82db18f7e99a03d93b9f12deec82a3d81498",
"0x197c8d4961b0022045df25e5e05234f4fa049bb1",
"<KEY>",
"0x19a88cfc0b097e6f9f2bfdd0cc18765e169ca05c",
"<KEY>",
"<KEY>",
"0x1a5f8687ae4290c21c867c8e09496c4a83f9e981",
"<KEY>",
"0x1a760e3a431c8b9c075ed1280c8835a1a0f1651b",
"<KEY>",
"0x1a86f6ca6caedeb6dd8efa9bde15c5b2387f0039",
"0x1a8e726a32146c3e8fa0127e4d7b8736df4f4a39",
"0x1aa52172e59e0837671adfe30a1f99a8929dfbf5",
"0x1ac84b879be6a71fd9933d397e5958e499f5ad62",
"<KEY>",
"0x1b2e6c79a0b9a1f19234d45d9a8db9ee57bc0b14",
"<KEY>",
"<KEY>",
"<KEY>",
"0x1c0a70f3359faa0476fb33b8b2a808d10a559a44",
"0x1c0dd193b6f63b187efff79d0d2214798383d2f3",
"0x1c0e68b94a8c8bd16812c8e020ff92d2ae502ed7",
"0x1c190aea1409ac9036ed45e829de2018002ac3d7",
"0x1c8915f70850873a03df2d6cdba71b226bcdfeb3",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x1e0ffca5c669377198c0c88e065b4434575be2fe",
"0x1e39cc29009ed4760c186d8771295c1e224882d4",
"0x1e9239b9b0d773d620f112a964b1053a63174ceb",
"0x1e9fb5428855064b5c38e3ae96cc9878c573ed53",
"0x1ecde92e6437babe983b272caf9fdc32285c4f68",
"0x203852c828085dfa7f9cedc640a9e2d49624b5ff",
"0x206596bf2560916b19baac190666c28d67c7aeec",
"0x20a507b369227275bd443d373316049fa93d45b3",
"0x20a7854a37d095cffc69c075bf133015fc5493cb",
"0x20e4445a5b04a2f759101f5d1159ddb096dfb62c",
"0x20ec02894d748c59c01b6bf08fe283d7bb75a5d2",
"0x20ee31efb8e96d346ceb065b993494d136368e96",
"0x20ff7e19c8ff23109eb1661df3b3c4f36ddadf1f",
"0x2123e6171de8f2693c326d32129c9c3c6b5ebf63",
"0x21ab1d61a9f9c0d84a722637099efe940ffa9192",
"0x222e859cb744eba5dcaf5224f52b69cb1bd72456",
"0x2235cd349113837ffc6d3e41ad8f64a84f3d20e5",
"0x2252a85e520fe2f29e0be62104d8551b32649c66",
"0x227bc0d96ea12a1418a5beb599254f6174dc9454",
"0x22cab0b36cc4ec24bfd5732d07828b45e7547f9e",
"0x22cab81e0fee2bad5b015dbbeb6a374a1b8738de",
"0x22f98eae7d6a8dbeb2dc5bd514b964ea3f76c329",
"<KEY>",
"<KEY>",
"0x23211b1382683dd33fb88fb79e5979c79bb5a300",
"0x23230789629cde13f28ed45f3540a5d008d59db3",
"0x234a14fddcc2e533156b5a636db9a071d54e9baf",
"0x237d8b36bccc39244b49ec8b28cdf5629f72429a",
"0x2389c6a9372a032c49d7d37631787fa56b82dbbf",
"0x23ae2440eea48b281688f1dca88ab7fe29b9f319",
"0x23be569ba550f9ee0573be6efda5f509dd53e595",
"0x24046f8fa6b91dadbd468ab5d5ad574a54e43793",
"0x24055d456255f02e5b6287efe2d4111900e69d39",
"0x2435e458ec72e67cbaed5aa7be3eea54623a19bd",
"0x244fe02fbcf4db4ad96063b161f00e444fc54011",
"0x245a1c2b7e4dadda60f9978ea1fea9760567b799",
"0x246d8ef4ac5a479e8229bcb9f32d03e574899573",
"<KEY>",
"0x24c0be8e1031140e5ab4e76bf0f9feadc2efdd6b",
"0x24e350231052f731f9ac54e4d3229d1dd0d54416",
"<KEY>",
"0x251eb912e76c3634f65ea50a1c7b0db463d24b5b",
"0x253be37968e4013d7d4f3656941c57ee2f4b4cb4",
"<KEY>",
"0x257b5a6b4e777b14b00c31f5e3874a5fa1c4145b",
"0x258c19d5e104d19e1f68c9ee22ad28b4c1a36fee",
"<KEY>",
"0x2599fab089c90d68bed81c948cd64edb5df583a8",
"<KEY>",
"<KEY>",
"<KEY>",
"0x261377cfb52e6fd3048b0ab991d991ee43ef2d4a",
"<KEY>",
"<KEY>",
"0x2629de54a2b7ed0164b896c273bec77a78819a9b",
"0x263634fef8060efb5995c5ee2863fd0830e4ad85",
"<KEY>",
"0x269e07eac18b3681f3447263c28a766457ff074b",
"0x26a0d17f741f5fba809e45a2ad1e68b19550fcbe",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x2781ae2716980c677ccc16c19a01ee8fdfacb519",
"<KEY>",
"0x2850c13d0e24793f5b6ef4766f30a3f745c0a8b9",
"<KEY>",
"<KEY>",
"0x288a2395f027f65684d836754ba43afa20ca09e6",
"0x289858351fead04e9b2d874f6036e4b98f719454",
"<KEY>",
"<KEY>",
"0x2961768cc229226e7d83c0141c133789487ba763",
"<KEY>",
"0x2994d42ff4547f5c88f97fe3c11e4c97f85a0283",
"0x29ea4dc5aa38d032da3ec19173612846513566ed",
"<KEY>",
"0x2a9c2d11a8e07a2bd7b60b1e8676ffefc0d9a611",
"0x2ac40e76e7fcf20b4c9332649e75a395a339cafd",
"0x2afb58a22e7d3c241ab7b9a1f68b9e8e74ec9d68",
"<KEY>",
"<KEY>",
"<KEY>",
"0x2be7e19f6f6cdd0fa6fe1fe5dd865ae151abf97b",
"<KEY>",
"0x2bfe6398fee545f1f422db3f65ec86e09385b900",
"<KEY>",
"<KEY>",
"0x2c5619ca37b6df2ef2c83f04d7d75e5ed68dfe79",
"0x2c5c5db1847a96d879b6244cce9320508bf0a61b",
"0x2c96108ab531c96989110c2a7506a4b0b68ae2a4",
"0x2c9aa312debedd36767a1972c013e4f0d63f523c",
"0x2d19ca3ca720a80d8d5ff4b28c674d8d76dd24e1",
"0x2d2114e34af7584df057869aa56755dd6507afbc",
"<KEY>",
"0x2d3491ba2757cfc9982c7d7e989bd4b8ab4e9042",
"<KEY>",
"<KEY>",
"<KEY>",
"0x2df5ec8d9d3be35a057bf177df07358b1a0ca789",
"<KEY>",
"0x2e69d3817817f3e5c72f1d4e38f10d1171a22d82",
"<KEY>",
"<KEY>",
"<KEY>",
"0x2ef6f5b5203b3dfec762fde8d6e09b9891034772",
"0x2f1fadc9aae4f2c0be2320ff701a787baf644432",
"0x2f3045ce8f70757e5cbad58215134aedaf2e4ca4",
"0x2f4205b1a32526461e7886c8afddd4fd6f6aed8f",
"0x2fe1cf162ea7ff94ee9f23a601e588248390e2de",
"<KEY>",
"<KEY>",
"0x303515703fd2da0bf1f8a4fea9daa15d312bea1c",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x3257f7d1169b46dba77f18be843e5c9fac8a885d",
"0x3275078e2876e86a4269ea6684b826450fb8460e",
"0x329c54289ff5d6b7b7dae13592c6b1eda1543ed4",
"0x3300c8faf55506615211714b3afa733377c44b54",
"<KEY>",
"0x333ffbdf76a0dce3c40ef58b2e5fc57893dcabc0",
"0x337c9d8848e664c79983e4b8870dfa26d4c26b40",
"0x33c01376c5f53a2b9d623b833f2f77f9b118a8c0",
"<KEY>",
"0x34006878c70c0c894aa961ffa385d7b09dce07c1",
"<KEY>",
"<KEY>",
"0x34e2cb7513a50b19f450a067ed5230a86c13a2e9",
"0x34e3138a54d5fa6a23f64418fda2e34d8ecd1135",
"0x34e31ddb2e1a2e06d8d75f5ea109ce001fc969b5",
"0x34ec9c1d89ce8afa701d079fd908fca95f49667a",
"<KEY>",
"<KEY>",
"<KEY>",
"0x35c6afae77e1772e6cceddba13eec653dd29190f",
"<KEY>",
"<KEY>",
"0x3656460e9bec3e98451df75ce8f6cc6e1dff9bb7",
"0x36613eab0ed4c9d0f5abf7f8cfea819f84b9610c",
"0x3667bb0e56d2035d28c68f18908dc10dbcedecb3",
"0x367e9c3ac0e28c1536d5503de72bfea24fa4ed8a",
"0x368c4e8933cf3577ccc394b4e05b4e03691493f1",
"0x369c651fb42d77d94935332703c4a95d2e0e2ae1",
"0x36cac74a5a3ef38cf66e672b1cd54099b218fd9e",
"<KEY>",
"0x3712644ddd668f786fab2b1624ba86f12f12d2ec",
"0x3714885d322ec50e4750094aac3f5f7e3fb8f32f",
"<KEY>",
"0x3742f0fd8fce40411c450e74d270d4d5faaf92fd",
"0x3761ace189a7aa32d18e0157a48884ecde650f0f",
"0x37e4bac8ab9433acca9b62dfed849600fda5eaf0",
"0x38182846ad8d765767138f34de79201f29c92644",
"0x3825a396dedd74a2714a7603f039ed109dfc77e4",
"<KEY>",
"<KEY>",
"0x38821837319890b2ff8bd8dc2d8e3d7c583859ed",
"0x388e07d4fc7f3e2c825e6cb1ff46447764798b24",
"0x38daea6f17e4308b0da9647db9ca6d84a3a7e195",
"0x38e481367e0c50f4166ad2a1c9fde0e3c662cfba",
"<KEY>",
"0x3929d8e8e6b983e36e612d2d39eb0ab49b496cf9",
"0x3945476e477de76d53b4833a46c806ef3d72b21e",
"0x3972c906cdd1ab81e536f74823ca226aa4ee0c11",
"0x3a05fed22136b55cd3e4e9e60cf559539e691c49",
"<KEY>",
"0x3a121c46a6c3aaf501ca2b7397f1bfe368924863",
"0x3a460471ac951110ceeb7519583d0f7d4b2261b5",
"<KEY>",
"<KEY>",
"<KEY>",
"0x3b8bc31c46af259fe3a69c39c2ab55de56676d36",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x3c803a58e42d5e78475b185dc9b055df16e86c6e",
"0x3c865bcad9c26a1e24f15a7881e2d09400f51812",
"0x3cd49c9ad5766fb4a19a42db15e516480dc58673",
"<KEY>",
"<KEY>",
"<KEY>",
"0x3da7d21f1a06c7ce19ee593f76148fae6e952ca3",
"0x3dfcca4d1c80a21626dc0140c7d7fa170c23ce4b",
"0x3e01cbe85caddb812a0483335f69815dafcb8eb7",
"<KEY>",
"0x3e376cb42215e1dfb04af1f2e4685f175f33a2f8",
"0x3e86eac93a2dbb4faeb8709d77d451aeda710ef9",
"0x3e9c2ee838072b370567efc2df27602d776b341c",
"0x3ead00d7e1b95c5e99f287f04c72f62f2cb67c80",
"0x3eaf7bd84eeff7445e9499956950d5cba285c973",
"0x3eb386c578e87d8276cb9a46cf4a6592c80a138d",
"<KEY>",
"<KEY>",
"0x3f225ffdefd4927f3254deff85e4ae2c26aa2674",
"0x404b7233782034330ed760d56979338789546567",
"0x407dbc332f834e51737e428fe22ce10fcdb4214f",
"0x4083fe56ed8e2784cd720ec6851a01e7e931076b",
"0x409ceb81bb143a400b02445ca273b37720b7665e",
"<KEY>",
"<KEY>",
"0x40e5423132d2f6b5dc110781e269df7a65674c75",
"0x40e952e47fe92cdef8751bc2ce7511d018665fe3",
"0x415817fe2945611ea8d9c698a2d8bec4c5a6b68f",
"0x4177a5c0e2369f6830a4c3825afc8fb3dd47790d",
"0x417aff82d2cd9fd39fe790af5798ae865fbe8c48",
"<KEY>",
"0x41d0fb81f19f67b15cf71f4a3997f08321a614f6",
"0x427222582af199752e22c973d1d194c82e02084f",
"0x4296b7bc7e3be776c247b064bddd10be7216f8a2",
"0x42afe93a50c9fba4bf55de264da7bfacdbd2ec70",
"<KEY>",
"0x4340ac786edf408a0c8e9a2505727cde8c17ac51",
"0x434e8971592e898316dc8b7a39d6f9be03ed5f66",
"<KEY>",
"<KEY>",
"0x43f6fab8bd5ea83ebb41ab37a8f1d5ef0dbb11a0",
"0x443eb1f18cf8fd345df376078c72e00b27e3f6a3",
"<KEY>",
"0x445fa81c0a52c66be4f7338b01954546c38ed7a4",
"0x446d62cd72abed64c21c8cc2ec05a102332073ce",
"0x44922f0f4fac214d78b1f0ca7b34706a1f8dac98",
"0x44927a09e9e0f905419c319593bafbd94d96373e",
"0x44ad2e818a9a5e169f47daa24e4eb8a03e28c58e",
"0x44f887a4ebd0c5fb3fb1c3d9f18148ed5f8c4e90",
"0x451047fd0056c602481477adb302f281c66f82ad",
"0x4536d05b106a913d290a80aab91058f063cf3a68",
"0x4572192ed1dee5fd0f8f07269be4ef3e3e270715",
"0x459b7c1f32e4529ecc03d5d8fabadb1b6632105d",
"0x45c7811c459a43d0c17ef18f33a2c8921ac4ecf8",
"0x45f0a603cd8680150c698d003bfb5a8a90da4593",
"0x46a72e158cbf902208a49622c2ded84e8412801e",
"0x46ba0af6bc60e6fabd9957744c057d031c720ace",
"0x46fab85ac9a997704ed36eb3c41bd97dafeda316",
"<KEY>",
"<KEY>",
"0x478fa4c971a077038b4fc5c172c3af5552224ccc",
"0x4793a4e932fa0d28e8dd4dd5b107f8059fc6e2cc",
"0x47ab904f34fbe517e8032de5e86ce8708369a72d",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x4860ca9ac44c08d9fed68fdc36d126b519e58e34",
"0x489e0a2582abdb4e97c70f4a0012676f6d977ce9",
"<KEY>",
"0x491895e540a3c46d4596482824183bf11d527868",
"0x4947b8804e2d484f97c1e11ce565509641986848",
"0x497d32a3f4e9a4aced0a485c905a167b0517fe0d",
"<KEY>",
"0x49dc5a7f4b322a86f4ea15765fb266b293b352ed",
"0x4a64050b67248c3ab318ea0600a00c47c763d860",
"0x4a86e7efce5f37583e6b7c4db88d37eff5812685",
"<KEY>",
"0x4ac2c547b842aa861b06fb1a3d04d1f778131fa5",
"0x4ada1b9d9fe28abd9585f58cfeed2169a39e1c6b",
"0x4ae4175dcf740e424e5e3de51e5f1fa71aeb8c81",
"<KEY>",
"<KEY>",
"0x4c2f62d6f34388a8d134907fea723e7ed902fe22",
"0x4c39185a078b5666c372538231cb793a0928807b",
"0x4c6a68b14b8d06d61935fe4f12ee3e1c7fb138d7",
"<KEY>",
"0x4caeb7626e1557aca383a25672ffee0a789d8c57",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x4e483558e4e59416eea246f643d78470a7d6d5a9",
"0x4e5a8601f5854b2a508dc98e17a38f7ae4355986",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x4f942119e6ab0a6e4368e795d1d64291a3ff0da4",
"<KEY>",
"<KEY>",
"0x4fc59ef4f4a1597f5e902915e9f62d97a6a51ac6",
"0x501ffc7ee44f7986c24fb5bf7c04c1ed6377ec87",
"0x503131b5853edb617a4dc4717d898ca270197764",
"<KEY>",
"0x50711245990a647df223a7231d858a141e0fe9da",
"0x50920ea3e46a862c59c9212e5a1370b2fd87ff28",
"<KEY>",
"0x50f461f471e7dce973e27f0e319ebe868135d764",
"0x50fc9006d67008b4e9c1e8b671bde19ad6d4b292",
"<KEY>",
"<KEY>",
"<KEY>",
"0x51208e5cc9215c6360210c48f81c8270637a5218",
"0x5173b8ea30cbcffa8e049b762f2d1a92c21b02c9",
"0x518a8463ffff4435431d889e507fa1a9e1c34502",
"<KEY>",
"0x5224f2ffd737c8561dda49a546d26662b1aad7b5",
"<KEY>",
"0x52905e2fea72e3cc1f97eba403d42311a2e5d3da",
"0x52af787439a82f36d6ef6b0da0f0e5ecce29ff90",
"0x52cc79276ee6f36ad9cb1a4504a6c6446b8a3699",
"<KEY>",
"0x52f1918cb4aeaf31595afa3418903f25fe8621f7",
"0x52fcda4f61108b4e918baba6b671e61c774eaead",
"0x536835937de4340f73d98ac94a6be3da98f51fe3",
"<KEY>",
"0x54021e58af1756dc70ce7034d7636de2d2f1fa74",
"0x541163adf0a2e830d9f940763e912807d1a359f5",
"0x547c0dbd2fc303c8e97475ec072a58de60ec134a",
"0x549e38b0aec4af720f2a655edfa07b8bc5294a70",
"0x5501b109a7cc3707a27d6438c6aa290e2b168ce4",
"<KEY>",
"<KEY>",
"<KEY>",
"0x55a1438b4b666c4359909ac902c41be09c3b821a",
"<KEY>",
"0x56348e42db10a34be4e2c1f6238e31bc3b6ba697",
"0x563695796efdf9cc8db7340fdb656e51ae7d3acd",
"0x563d132c12c4b778b7669e1432e812548bf023d0",
"<KEY>",
"<KEY>",
"0x56581d0fa0d2c42ead20fdcad2ef8aeb8171cd8e",
"0x56704a5ead0b06c8e05c2108da00d52461a4d222",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x5761ac2e1cb06cc3f8e1dd7e40b358bb35558def",
"0x577182e41158ba340fd4934ad1fc24b011934a64",
"0x579c5ce071691aec2ebfe45737d487860eb6f3f5",
"0x57b31dad7a6788513c1a6731bd08e1f6a6f49839",
"0x57c5983009ef69e814c53c4a7c85d7b33395a3dc",
"0x5812602b6427e3dae54df18188bd78e428ca9184",
"<KEY>",
"0x581de43b0273915f61d015e394d2c6af1f9ce8e6",
"0x582c3a7dc15f76f734c1e5dfc890b066476d9dfc",
"<KEY>",
"<KEY>",
"0x589056e31f173f8367852bc88e3d942e46c6e2b1",
"<KEY>",
"0x58e4123e785099b5710c1f245050f40adfca9b33",
"0x599fad0cf5463e75755288a873ff004b16c5ea31",
"<KEY>",
"0x59e5fe3a536d2fa69614e0a0692f5c6e3d6dcbfc",
"0x59e9f8f07f9d339c48c8521af341a1a2337a9e22",
"0x59eb7d68ed3a2441b1d75d679d628046dfdb34ea",
"0x5a2b0096e2ea786cc2e681112dfa6d8f5c9525cc",
"<KEY>",
"0x5aa59e166e4405c05abf85ad44a8ed84a1d51a06",
"0x5ae7ae79765973ca60ee9f9e29866b63952ae807",
"<KEY>",
"<KEY>",
"<KEY>",
"0x5b2d006f10c5a90a7282f999173235ea9ce79e1f",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x5c0dc6a61763b9be2be0984e36ab7f645c80359f",
"0x5c12d55fc2d12d52a96f3ae418ed7cb0d1b1e1dd",
"0x5c51cc8ed5757007367b5ab3e2b5eb325459a481",
"0x5c5a4ae893c4232a050b01a84e193e107dd80ca2",
"<KEY>",
"0x5c7ca6a93a46ae786d99d91ed423a91d6fa13879",
"0x5cd9f81d8e531cc0e303b78efcfda9e949ec4c1b",
"<KEY>",
"0x5d051f2e9f679321fd50ec13a20d01008d11a00e",
"0x5d0ce7f68f94b64b234063605e2cf9258d77edf3",
"<KEY>",
"0x5dd184ec47ec4588914ae99b318382aee0b12704",
"<KEY>",
"0x5e089d16933908a031ed7b8816a3fc80af49ba17",
"<KEY>",
"0x5e7c21defe711bcd5cea1b267d2e87f7913d510f",
"0x5e9958bbffbb0e01baa3fad81368b50b92eb4944",
"0x5ef24d956159c405a8a65b94078250b025a86211",
"<KEY>",
"0x5f0614db30b86542a40871a929be4ae10e45f728",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x602faee794e16604fbb17511b1ad179a728ce61b",
"<KEY>",
"0x605307da17ad96171e79afa7e1e1a7b21dda111f",
"<KEY>",
"<KEY>",
"<KEY>",
"0x60d38778adbbeeac88f741b833cbb9877228eea0",
"0x60ed33735c9c29ec2c26b8ec734e36d5b6fa1eab",
"0x6127cb39ac8e6066c469ace0edcc3506feaabf94",
"0x61477eaa5e33400acc353390ca001be0eb706eb4",
"<KEY>",
"0x6157730c4f8e2092f601460b836530e3252b3120",
"<KEY>",
"<KEY>",
"0x61d21716c9af33d522a98ec82befe3588f6a76ff",
"<KEY>",
"0x62229afc05347c3edd6f9f48f3de2485c62da931",
"<KEY>",
"0x624857d6d8cffdd770398beeb2b76e3c797ead26",
"<KEY>",
"0x6299dbe5be8ed5d5df9ff5a21b485c7da0cf3476",
"0x634526e3e514c4f88242df97f238efba81a25786",
"0x6367a367ee11ea09fb711f0e5ddf649c37863371",
"<KEY>",
"0x63c9a867d704df159bbbb88eeee1609196b1995e",
"<KEY>",
"<KEY>",
"<KEY>",
"0x64f6df320ed6799e9bc392afaea5614294e53919",
"0x6519e6117480d140cd7d33163ac30fd01812f34a",
"0x653879a93091b5a5074701416aefe4268387827f",
"0x6541e84af0b25f3e084e9ed17d8f255a12d125d3",
"0x656f305e8ab934afcf7fa871b52b84c06862eb84",
"<KEY>",
"0x65c956880665153684367e5ce7d61171a6da8152",
"0x65e43244d19c3e17058dfb6f5e5e921402ebd964",
"0x65f9deacd2eb34ea0e86be918f922ed5fcab75a0",
"<KEY>",
"<KEY>",
"0x665cc766349e2a9d28b23c5670024e175ab39e54",
"<KEY>",
"0x666666a0200c2b78eddd1ef279488c6a714f010d",
"<KEY>",
"0x668540812466219a4cf9ef22151bb7e513010f17",
"0x66d692bbecacae3026834750e603291fe4384161",
"0x67017bebe2a4b8645b28f83d5d472618b35a1230",
"0x67023130eaab2969e26e5a25e2abf901c01bcda0",
"<KEY>",
"0x67922a9561423548a9ccfd67ad80d6c637c26bfe",
"0x679a5f7626d27d140a273759c4ebc13b6719eaf9",
"<KEY>",
"0x6802b4028d41ca367137dc50ebd3f5eeedc8be55",
"0x68321c407aa92cf001c2e766cfba4259e9d9a1ad",
"<KEY>",
"<KEY>",
"0x68a6afece1f5acd172a2631f81249577754156ee",
"0x693d160b17860c560e0eee49bdc86c59685081a6",
"0x69569c6006e66813bf26faaae92cec8c2a7cdac1",
"<KEY>",
"0x69a2ea8beb212bab958ee0b5b1b0e363c1e4938f",
"<KEY>",
"<KEY>",
"0x69d5f8e1c2b8982a17f893f2658f3adb6a14929b",
"<KEY>",
"0x69e2e4d4e4cdf5aa3a24b090dae21a585e89a39d",
"<KEY>",
"0x6a538cef33eb4331a3e4216691cd7d16e3f0232b",
"<KEY>",
"0x6b0883c28a7558144350cfe6c522dad1e567cc99",
"<KEY>",
"<KEY>",
"<KEY>",
"0x6c21cc8e3ae29e998ed59b1b4f740ea72b359a8c",
"<KEY>",
"0x6c8e15ec8e35b6ffb246d60abca2ba81d4e247f4",
"0x6cf5ba860c43dbeca7193dd0fe9024cedc8e5315",
"<KEY>",
"0x6d45a0963adb535cd4d74d8235d8a744ce93fe5f",
"0x6d98d039a4b3437c8fb19ef2fadecb3626b207ad",
"<KEY>",
"0x6e59d37708a0a05109a9c91cc56ae58dc5cee8fc",
"0x6e67856ed5b20b83f29d933f34bdedbe559afb60",
"0x6eb13bf70edaade22b0c5a7f0de7138ce96d53db",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x6fce63859a859a0f30ed09b12f5010d790618ca4",
"<KEY>",
"<KEY>",
"0x6fe0e8bdac611e9df3334cdae26062ba621c434e",
"<KEY>",
"0x701a603f90d8d138b13d9b4ed3c4c9641e7f3606",
"0x705415b435751ecc1793a1071f8ac9c2d8bfee87",
"0x7054d57e6fd9c731ce0e9a1a9f012e23347ac8ff",
"0x7057038824ea4c3e709236cd27e93e1530419ba6",
"0x705ae5aef02b0a8ceaa712af547d39a051da5d4a",
"<KEY>",
"0x70a8c4e53a9078049ca1b2cee477436c8eb61b2d",
"<KEY>",
"0x70aff9c2a064b2b1614f30407c96e8876aca8b63",
"0x70b63254a89461f3797c2c6222234e6fd382baa0",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x71b0ed6b9b30ac3b8e5cd6eff90904d3b694bc5f",
"<KEY>",
"<KEY>",
"<KEY>",
"0x72c74e48bd7d4e28def498a5dfa737ff33cb5317",
"0x738fab62d1f74cd829efed06057a7de09206e6ab",
"0x73e56a6af00481656ee617b26f0953fb3153872b",
"0x7404becad09351583443720f8f520f689e93359e",
"0x740b74e09ab2ef3ae1785096c9586e9537ca1429",
"<KEY>",
"0x74d7e9eff4dda7571094631673f50e9fc2cd5471",
"0x74eb390c06a7cc1158a0895fb289e5037633e38b",
"<KEY>",
"0x75c10449c999b65ab7214d2702f08f5f1cd0e29c",
"0x75c32299da1395c5ba98c6e213f0deb1320a33cb",
"0x75d5ced39b418d5e25f4a05db87fcc8bceed7e66",
"0x75ddb7ab958135bbe2dab48d6286826f6aa5e3b4",
"<KEY>",
"<KEY>",
"<KEY>",
"0x765d9c485bebb431872ea51d000a20623c1e5b94",
"<KEY>",
"<KEY>",
"<KEY>",
"0x77427023e70cafd983dabaf3488d8d83ecb15b96",
"0x777e97a7e8a0f5831419696afba2d493588c22b4",
"<KEY>",
"0x780432eabda6f7db5742149d3915605f9049fe3f",
"0x780dc341b18d1e6ba11736de6fba58a85c666e83",
"0x783dca6f7b25e155123a5ea77ff2f7dd1deeef85",
"<KEY>",
"0x790c815d43c78e2223c215c91cde9a9f7510855b",
"<KEY>",
"0x7989e741e0859b8c46475424c1a4a95d7f91eea3",
"<KEY>",
"0x79e4119e022da86cebe7cd7e7d131b3b7d5d8dc8",
"0x79fbadc28c46663a121e9fee2a863b74277094d4",
"0x7a3c2b0eee3980b434903e6b9509fee9a2c7a434",
"<KEY>",
"0x7a6bcb1ea4c44cf1764e64dfb85a55487ad86b12",
"0x7a766f2af737f6712c4dd49f0a9ab35a8f8cab2c",
"<KEY>",
"<KEY>",
"0x7adac8d617d59d502cb109e5a809f0ec7cbb0751",
"<KEY>",
"<KEY>",
"0x7bcec44c7486143ee875103de66006047cae8df7",
"<KEY>",
"0x7c0db93859be23fcb507deb2c603ceeddd6b0cca",
"0x7c15c70ff4a3e2a07228459ee7cefa90bcdd5ae9",
"<KEY>",
"<KEY>",
"0x7c8263e38a6c0168015169a6b6f86eef1f271d71",
"<KEY>",
"<KEY>",
"0x7ce90a6d54e830ceb568f81b52865d5011aefe40",
"0x7cfed2a2d4a98680dac6aa55120f5af2ec562ebd",
"<KEY>",
"0x7d616916d228d1663d1e546e686a0c63bda95b09",
"0x7d7c9ac6c7e950b356dd3f801a79f55ed284a157",
"0x7d9f4cb1adc632e697d604304af4e1e92ecd181b",
"0x7db5d398d3e9b1d0b1d119e53af3e03164637ed5",
"0x7de3edc8fe47f8a2ac06e3d8d1ba35385946f162",
"0x7e20152c97f8868e5175ef85c8eef774028ef44f",
"<KEY>",
"0x7e86b2e9b9e6c0ee02b0200648d9fcf20557e3c5",
"0x7e9274854b0b53a9d141f1cde58df8496fb61b01",
"<KEY>",
"<KEY>",
"0x7f24f65868977ad7ef02a88f867fb43c7c4b77ef",
"0x7f2f3685afd60e33ab9e2d35bfa93d4aaa909806",
"0x7f4e8d00006ad90a3833b8d925712554a5af4524",
"<KEY>",
"<KEY>",
"0x7fab31275e37a4b1b69c06cf65fc09c235137641",
"<KEY>",
"<KEY>",
"<KEY>",
"0x7ff4976ba33f787817f608fa90da92386f5e4ae5",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x805b773debbe076bebe76906509ae31c902481e3",
"0x808dee16be78b3f9c6f9a5ff4f6a9f601dfd7ca0",
"0x80b78c03ecaf44c062d0444c7a68a6f957add9ee",
"0x80ded7bad77ae151a176655723b33e8735f35e2a",
"<KEY>",
"0x81312ad57ef129a6cc8c3ffc16816f7b512e0636",
"<KEY>",
"0x819dbff517e804eb55e092207443eaca4457362b",
"<KEY>",
"<KEY>",
"0x82131e86d080312e13605aada6538a94df5b41a5",
"<KEY>",
"<KEY>",
"0x8284ab17cbfece9be432f9697ad4febbf2ab67a0",
"<KEY>",
"<KEY>",
"0x83111e1888c1e49e8703e248edeaa34ef868a1de",
"<KEY>",
"0x83d880ec71546746d24e7fa28e1ea3964e236d82",
"<KEY>",
"<KEY>",
"0x84d1e52a5c2871d72ec2d190e14d19a065c98726",
"<KEY>",
"0x853ccc18e05996e991cc00cc1018099b7fc5ee5f",
"0x854865641338fc2e4273d149a08664b5e3237429",
"<KEY>",
"<KEY>",
"0x85d572495843d4d8cc1639e0e45abeb00eb79522",
"<KEY>",
"<KEY>",
"0x8649552c5c04af0e8004dc855b9c2789a25b8d85",
"<KEY>",
"0x86725086594ecc03de4c3e4171f8101a9402818e",
"0x8689ff71fc01e7fdd8ddb65a7b51c13ccf337eb5",
"<KEY>",
"0x86a9ebd5e233156243adf4c31491631b14ea9e71",
"0x86aecfc1e3973108ce14b9b741a99d3466127170",
"<KEY>",
"<KEY>",
"0x875425af9bea816f87cec7622b49f434fb6a8166",
"0x878aac6eeaf3e3207d11723b820d6eb1105fa892",
"<KEY>",
"<KEY>",
"0x87eb726e78c1c769e472f5785942afb2bf199067",
"0x88798416deb63ce03417cad6af8257358a264ac1",
"0x8886dca35291f05ed5d8e21f083998ea8dceb50f",
"0x88a1303994f0c906d8c0ee9c72fe17f627ed9f48",
"<KEY>",
"0x8928b26de9ecc59cacdba095c6ed6237f48ddbd2",
"<KEY>",
"<KEY>",
"0x8a3708558a1ab29de8b3389a6ade86433c220c39",
"0x8af4277c5e84158494e2ee4cdef463f87abdae4c",
"0x8af7e426af2ffcb939b9bb164a807dba76adc40d",
"<KEY>",
"0x8b9a3787dfa6d221990967c7aee4c6f7237649a4",
"0x8ba922eb891a734f17b14e7ff8800e6626912e5d",
"0x8c779811306cee2fafc908c557ccb4be9ff20a01",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x8dadff9eee13ccbcc35bb22e99416427d63ef8c9",
"<KEY>",
"0x8de7a62f51448573e855f34cf9a5204c173d0a79",
"0x8debc343a259253aa43be5e47eb58a9e668e3ce2",
"0x8ded09ffe3110d353f02dce34fb56e305e6ae4ac",
"0x8df6a2dadfac1009442430ca40f8479d206f7673",
"0x8e05bd9fa3059ec69c15bc1a6f4d94f0ac26ce00",
"<KEY>",
"0x8e59f1fe1c8d828dda49971ab96e6a003a7e2f81",
"0x8e63e4376dde62cb82f5a91c4bce4156457dedb1",
"0x8e894bf5ac281075a1cd1d08129d6691c2e27eda",
"<KEY>",
"0x8f022ff0d225a0f8c7343d4050f1163ba2029510",
"<KEY>",
"<KEY>",
"0x8f7d7e9adfa6da73273391c57bab0ef22651c7bb",
"<KEY>",
"<KEY>",
"<KEY>",
"0x8fc04dec888eacf5ff6e480a670d67f6364c7208",
"0x8fdeffaf8fa2b3754da2268e626ea1f3733ee214",
"0x8ff077d2a138c2f6bd5de99d91be50ce4322f312",
"0x8ff70537cea84dcf6e31f8bb28f0acc89a4030a2",
"0x901b676e27fa9ced94dcea48f73c97780b908311",
"0x9028421a2969fb49af5a6e1fc85c24a712485246",
"0x90422e1da3a90b0cd80bf9af5a59afb4e001d892",
"<KEY>",
"0x90a73ebd0025905e38d81cace9ac93076c16d22d",
"<KEY>",
"<KEY>",
"<KEY>",
"0x9175a64882d239cd35d88aef071e1657c6e03351",
"0x91b9a8e151a6dedc98a986e4a38d815e2664d385",
"<KEY>",
"0x92425aefe21835c8eb3670ab9ae1d597f988cd87",
"0x9293c35d6e1524609b7221a1c9a8d52dc81ba62c",
"<KEY>",
"<KEY>",
"0x92e34a7ebd4b3f2f705f839225cd4c82c649d07b",
"0x92f00599f215dfa41b2c9782e8d7bb02a1c373a6",
"0x92f3766b5213569939be41a2185396ed5f359806",
"0x92f4ea1693328fa9546c83508cf049d26fa6182c",
"<KEY>",
"<KEY>",
"0x931eb9d2e9b0e496aac1dcdf778399ad762e3739",
"0x9346c01def77c612b1c8e1ccf5ac6e15fe4c17e4",
"0x939e38d9f1eaf55f6154a0261f3f00f0ee13fd7d",
"0x940e0d784b16dc19d245924783948262f95381ed",
"<KEY>",
"<KEY>",
"0x94a5b840f6898e5178649a2b117b3ce3bb7aa873",
"<KEY>",
"<KEY>",
"0x952de65f7a361440b9a40d83b7995157bd5de3ff",
"<KEY>",
"0x956f1ce3ff2ea59a8b41df83ce9f85ed59d73f92",
"0x95a8cce18e2959ea8cbba9610a980c4200ce1fee",
"<KEY>",
"<KEY>",
"<KEY>",
"0x969de568df4cec02e682acf75d7ed9f048de3aba",
"<KEY>",
"0x96ff914b8d957f8030e7abe7a5895334e8f88b64",
"<KEY>",
"<KEY>",
"0x977dfd4a014ccacc41fc583771abe9d04d279c20",
"0x97d4324f3142fd8e6b0e71bbadc38e0b8a1f5a25",
"0x97f35e8bbec79192e1713c9bea47035ff00f3a4c",
"<KEY>",
"0x982ebcde433607266e8c22a8d348a1cce2eddc21",
"0x9840fc40a8348283ac967a53cf3f5a6f12aad8d8",
"<KEY>",
"<KEY>",
"<KEY>",
"0x985147809e9c0a677e9c9bed656c984be037d373",
"0x989b1a61b4796151f51852efa1f128a02c5e3a32",
"0x98d6dfc9c76f2abc660c0ca7570705c4ef785313",
"<KEY>",
"0x98e60dd382422a64232594b2eb71b7906dd98d49",
"<KEY>",
"<KEY>",
"0x99fee2e63cd37955426996e763a5dae15ffa15b6",
"0x9a49d5a3f60351760be1e03cdaa2fe353a3aa574",
"0x9a4e103431553ac368aab4aed7bb36e42cfbd900",
"0x9a8ab692a6d73242c74a727ac7587aeda778b131",
"0x9a8def1275e081c444d97710bba164c11a578c5a",
"<KEY>",
"<KEY>",
"0x9b3e9e3e4a174d59279fc7cd268e035992412384",
"<KEY>",
"0x9b42ce8d9c5ededd471a0bc5b59379103f79ec5c",
"<KEY>",
"<KEY>",
"<KEY>",
"0x9c3bacade6bbe81a6238110a28628512abf4ec4a",
"0x9d0234f8a921f67c5a20beee923627cc15d770ad",
"0x9d07a0dbd06fe2c861e48f20a3c6eea727d312f4",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x9e20fd71442e6bf7f59010addc86ddd1a1aed45b",
"0x9e251ff8d916aaa2c721dda5331375f99617e8ba",
"0x9e6ad02c5544aa38f82ee871585357083b8aaf67",
"<KEY>",
"0x9f75fd9add3da9af398cc87e9e834f8db74a5be5",
"0x9f7900f6ec6e725b35411428a60b90489f740d29",
"<KEY>",
"<KEY>",
"0x9fe9e5f532669509030e4fae68556b855efa5179",
"0x9ff84b91998df96a6587db8dde8d4e47518107d6",
"0xa0082e82f2d1a6f672196e149ce98b53f5ba3da0",
"<KEY>",
"0xa0112fc7d03a7f8e4f0ca19e7357a8f8ae74f411",
"0xa03d1648be58e6957c81c1c201236e189b6ee6af",
"<KEY>",
"0xa0b3b77008b436ec30af15901069a992efad3971",
"<KEY>",
"0xa0deb6ad8f5d508557d11e1f381bbd62299f5664",
"0xa0e9109d19f523a8869ed51421fe7e1fef71062e",
"0xa11ba54b0fd37e07079a4e6e43e2a5251236779a",
"<KEY>",
"<KEY>",
"<KEY>",
"0xa1586347c540c1b5cd83113872eeb7815a57dfe6",
"0xa1b53b6bbe8e7d8540be195ace3be6d43201c85c",
"0xa1d38da3ce3ebe5081e7ad8a0ac2ab5d08541de0",
"0xa23b45ff8f3eb25397296765498ab62208fec971",
"0xa30412d6cd5d48b65df7134f2e31949c843ba13f",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xa499df2bdae854093e5576c26c9e53e1b30d25e5",
"<KEY>",
"<KEY>",
"0xa4f0b6899ca568df1595a3d12054499e5e1c9faf",
"0xa52899a1a8195c3eef30e0b08658705250e154ae",
"0xa532f169cee0e551d4da641031ac78fd85461035",
"0xa55d366753ca6c04c50a3b8c73c2d60672d751cd",
"0xa55f8afe2cf8ca418f025ba6d3f9f658a878ced0",
"0xa56e389a9ee4fe1d00d0fa2c90b06425e6952d71",
"0xa578aecb7ea35559fba631d7034da9ebd35d1cef",
"<KEY>",
"0xa5a257d843369b7f360c76a83f718a18a0df7078",
"0xa5ba6ae9cdf56761be100a33de63363660ef744a",
"<KEY>",
"<KEY>",
"0xa65d0c27de101e1e604954951ca96c64dc0cb7b8",
"<KEY>",
"<KEY>",
"<KEY>",
"0xa6fd8ad8ee710ba9db9d6bd1e53e866b54fc1796",
"<KEY>",
"0xa70cb3ed3ea9db99e81a5730c789e70737550cb7",
"0xa72511883e1d69b63ec7c744dca756a7a698d0ae",
"<KEY>",
"0xa74e0784ff6259f1336e763fe7a871978873f8f3",
"<KEY>",
"<KEY>",
"0xa7f1c77998bae58614be010ad2a806639e280056",
"0xa7f41291785211ab3907e1b05dfcf35f64012df7",
"<KEY>",
"<KEY>",
"<KEY>",
"0xa958598d228dd5fe7d4d895e8fc2ba6153fe3e6f",
"0xa9d89a5caf6480496acc8f4096fe254f24329ef0",
"<KEY>",
"0xaab6c2ecf5c32de22923e7740981436dd5a75328",
"<KEY>",
"<KEY>",
"0xab2e11c99d8830d5d9b2494a565c974595e39eef",
"<KEY>",
"0xab63b0d7c6f2ae50229cf5596f1afc9935a1be53",
"0xab69aa255c368797decf41006a283b3eac85b31a",
"0xab6f255dac71103ea6d57b320eaf0eec901b05aa",
"<KEY>",
"0xab8131fe3c0cb081630502ed26c89c51103e37ce",
"0xab8a30f98d36e4e183ebc7ebd3f65f0f8475a9fd",
"<KEY>",
"0xaba3abe71987030782b3312f23ca0f199791a748",
"0xabf764211ec5662e6757c7ed93b8e5253cb826ff",
"<KEY>",
"<KEY>",
"0xacdd50dd84157a877be954f8df72804f4c3729a2",
"<KEY>",
"<KEY>",
"0xad6034c145530682ed7643478b6678e2e2bbaad6",
"0xad63dde7ca39ea3446fb6d29bb91e0cbf7a9a582",
"0xad91bae71e4569ec5ff09be170e223cc6b388ab0",
"0xadcf823be2f30f06dd489c99edc4f5de9aa8da98",
"0xadeb99da5761f20996609ca52e9ca7c4cb4b9115",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xaf0e126d11161fd002200e980103b78470e660e4",
"0xaf4a5d3f972195dcf3d1a3e703d213912fe49c28",
"0xaf8f691603f576142438ed78fb8a3316d36d303b",
"<KEY>",
"0xafd5ec1a5fe09e6597de92c34a423d7c35864023",
"0xafffed22178875640325903289f4756b2f5fffa5",
"<KEY>",
"0xb049df3c39b9726817c23efb6d58b75b83a19389",
"<KEY>",
"0xb0c4cc1aa998df91d2c27ce06641261707a8c9c3",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xb1e302b3a3b0de2173c1a1c2de19d2868b7c446d",
"<KEY>",
"0xb217e9529bf2208e76d9016b7411f335e30f0ad5",
"0xb21915a04371daaec4e27245f84fcf23799ed1c3",
"<KEY>",
"<KEY>",
"<KEY>",
"0xb29313c29ad316ac58280231048613f63193f33e",
"<KEY>",
"<KEY>",
"0xb2a1a7c670df98a600194b525014926a2b50a334",
"0xb2ead8bb7446cc130c3c515fae31c1865ed66aaf",
"<KEY>",
"0xb317931f32cca74b835bc0095cea0bebacbd79be",
"0xb33d01dd954888ae2fda24403e64b2e1dad84dff",
"0xb34b00807a563da4b7bbe7f6d6bc0e0cd650ca58",
"<KEY>",
"<KEY>",
"0xb47ebe89272c9e35b272885baecfa9173ed7a2d7",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xb5702c44c2c1a4ad529e00442b33defe89afdf7a",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xb76e4a9932538bbad705d2936d0db755389cacff",
"0xb7a14918d936776e6fa57597f3dfb8b61a5d25ca",
"0xb7d1fea82f881cac4720a78afda125b33a02185c",
"0xb8130d79468411de6d0bc4a87b85959ebb1e8c4f",
"0xb85737d0d9c81e4cfaa6453374d08bea87e1c705",
"<KEY>",
"0xb8a804da05abf0ee96d61f5e4bedb59e7f8fab2f",
"0xb8b95a513c2f754ae61087edfe0057c80513e649",
"<KEY>",
"<KEY>",
"<KEY>",
"0xb9e579f1c62a3ad26533e8bd3e7967348ac501c3",
"<KEY>",
"0xba2010e19fa7ca59982a70ff957e1f14c03e2aeb",
"0xba21325681ffd7d623993a2a564f6390654e2948",
"0xba2edb5ac7b3231281e4f76c013419fce94d86af",
"0xba363b223e2d2b1b2a9017bac58a0a2b8137fb9a",
"0xba90930afce3a234dc1e67119eed5e322039b283",
"<KEY>",
"0xbafa0473d874776a59c2542556c2022035eaf3ba",
"0xbb73548a0e6f839fb58e9d59969ba6aedecdf5f1",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xbd538a24bee43033adfd4eeee99003efa31c31bc",
"0xbd6f5bdc401ab1ca811e40755f4a2ddad75ce2cc",
"<KEY>",
"0xbd8aab70a86f74eba55d071576a71305b598235e",
"0xbdc8f5eea87cf7d897eda3efaf27e9d108b27296",
"0xbdf0ba6ebb474a667dae2c725ee12045af2c9ca1",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xbecf46ec3538a032867b3f553630acfd04d4f67e",
"<KEY>",
"<KEY>",
"0xbfcb6a91c12e0e8dba3ade803dfde67f94c8dffe",
"0xbfdc4a435003ca7443d92c18f669f3eee940ce09",
"<KEY>",
"0xc008073528abd491532131074fe82a349897b6dd",
"<KEY>",
"<KEY>",
"<KEY>",
"0xc092ada2817561e57dea25336939af9e693383f3",
"0xc0afef712a1341ca78da145b2afad346e8c3574f",
"0xc0c3125e6c69e0eae82ddd8a502785754bfa6b34",
"<KEY>",
"<KEY>",
"0xc1129c95d9f16a17f80efcbde4f1b536c484c1d6",
"0xc117e7247be4830d169da13427311f59bd25d669",
"<KEY>",
"0xc17c06397764a3d6d2b0286496f2ed5de314278c",
"0xc1849483ce99a9fa040b7609f3183ca0fab4ab0b",
"0xc194765f438294595eb4a620ca6d403f7c7e64c7",
"0xc1c3015adfd480f696cb37382493ca1ef99bb35e",
"<KEY>",
"<KEY>",
"0xc278592e0566075bd3e32b139c4ea768904f93fd",
"0xc31a6ad70f8c80075c1e915d37b165cc2c0bd900",
"0xc32ada37a22098c091a001c60e58a941cfa9a1fd",
"<KEY>",
"0xc415040996590a6eb82ebb2b323b3fae84268e5d",
"<KEY>",
"<KEY>",
"0xc4a6312a5d5af3c03d546fa287fa1f883b3db749",
"0xc4f1e3020e1b07b66afbbbee30f50383f46d7091",
"0xc54e1b4be5f608751f870a00402138271266268d",
"<KEY>",
"<KEY>",
"<KEY>",
"0xc5c8a24fbb0304d2490e64cb50c1966e644878fc",
"0xc6291442efe2634306b31f24c8238a702fec85a0",
"0xc637d110b89908617a8c5c153c3d737068165ce5",
"0xc657e440bb550519b5d58b56211a6c6ff1916d4f",
"<KEY>",
"0xc68bba423525576c7684e7ea25e7d5f079b1361e",
"0xc69e49f64bab2b1d2e7fe43e2511729fc9b8dbb3",
"<KEY>",
"<KEY>",
"0xc6f88c44ef441d90438c1d3af3787eeb2e69b2d2",
"0xc73bdce2169b916ce599486d6c26a32f52fce512",
"0xc75298ae9e6d0b51894ef79360e85f7debf94159",
"0xc79c88386c95130bf7c20a184cb8281ed639fab4",
"0xc7c955514a80ae7682199af0d499c61ed9aaeb44",
"<KEY>",
"0xc81f250f6d6bdab0432ef4c56ea170aaa4f2e07e",
"0xc839874f959d1232eb8d4af5b327e96e155e1386",
"0xc8cf6b03c2aa80de2579df02aa3bed1e716e1680",
"0xc8d2b535aa3225c430e98882c20af29240eef5c0",
"0xc8d42ec0ea8f543e01bd49199f6a1888ae11023b",
"0xc976895017c81ac926478c26c347bbed202d0508",
"0xc98e00e62321b73be34b845eba75e59050588355",
"0xc9e3ff1da87f942a54e91e83cef6dbe97af98a38",
"<KEY>",
"0xca4ad39f872e89ef23eabd5716363fc22513e147",
"0xca582b7ffe9b2050aab80e75cf1cebd8a5bd10eb",
"<KEY>",
"0xca99d578e6451fc19ac51bd41e3aeac83c7a6ec6",
"0xcac2ad03f7be45f316617a5f298a6d1a105109b7",
"0xcaf3cff40afe8f65901de241a7835c1b98688566",
"<KEY>",
"0xcb8a83d27eb6ad7a8353c91bad25c335c056e507",
"0xcba6c56f2ae7ada25a69a98252c064d4ea079d7f",
"<KEY>",
"<KEY>",
"0xcbf7d1c2012629e4689f6c2ca10c4e3a7ce1a75c",
"0xcc1e0a566dbd10869c071c811aba436357858f05",
"0xcc789e2342be0c15661be0b54ca82e9df4336886",
"0xcccf45930ae8d8d21cf1ee154251d1a2dfab9976",
"0xccf42e53c2f6f77fcc1fc2d3569d59ba611ab37f",
"0xcd36b622085c508404ddaaca943eb69ad8113ff7",
"0xcd531e3904fe9e393e97e6f316008da8e1516145",
"0xcd6c1eef36ced2ec98ce4291d9ed32ffb9230ab7",
"0xcd8eddd0a27047d53d65f23d483a8a169d54526b",
"<KEY>",
"0xcdd3f565928c03b4e3040b2cc2e2ee1671918e38",
"0xcded41aed0080ff9a36e23864ca8161385ef5107",
"0xce6cd4ef7907151089ec7ac49ab3ded3a9e0d4fa",
"0xce7d24f5346fe4b41deba8e8207045fa3cbeb80b",
"0xce9332f4d44e9efccc64f88c9bd23e288c0ae5a2",
"<KEY>",
"<KEY>",
"0xcec53a96d63dd33973deafeef93cbf89340bf142",
"0xcecd76f81769e8f3b1029b5ab9090280a62978f5",
"0xceec48581b3145a575508719f45da07dc57fa7ce",
"0xcf61a2535171e96de414d77b801c0cb85e40799d",
"<KEY>",
"<KEY>",
"0xd04c324d4a2fa54be2622518f1b2ff2d2b402e63",
"0xd07ee1049929e97680f7bb176721ea1e6114f42c",
"0xd08f30f359ebe45238af2b3f2c05a4027d2c9df6",
"0xd0a811885821afe56dd1a85749658526ef287c64",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xd171242706182d324fd3aa888212dec08772aa29",
"<KEY>",
"<KEY>",
"0xd1ac919d54107d30d8894a178761eae05d8645af",
"0xd1bcefed0f0e7fef0cf757ad0ceb0fd9ea5a6290",
"<KEY>",
"<KEY>",
"0xd20cc7de93c9f8d1877294bf62f812edce933be0",
"<KEY>",
"0xd24a5b3a49ec2ed0dace25f1debed07e340befc9",
"0xd30361069ff3c9818930e7f875c7ac440fd76fe8",
"0xd3753a133d7a4bf10e08673a00edbd2b740ac6e8",
"<KEY>",
"<KEY>",
"0xd41213c320d05c0b6882edf1021328939aa18be6",
"0xd46efae53c7a45f50d12819a24cf7a6945ee62c1",
"<KEY>",
"0xd4d8564baace86315f02e91d1afd54a5979719e3",
"<KEY>",
"0xd5157866f7bb8f490e13aba960f689178635ead2",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xd60ace527e48b1d235d78d71350eac3b3e7b6cb6",
"<KEY>",
"<KEY>",
"0xd68be4e9857be05ffbe92afea69633e68772a25e",
"0xd6e02c13a6cc133c9d019495414667ea7bee05cc",
"<KEY>",
"<KEY>",
"0xd75d2075864ff8d966cf7abe080e8e924db1dedd",
"<KEY>",
"<KEY>",
"<KEY>",
"0xd83e823a23b5efa6da4d59123ff9306993205807",
"<KEY>",
"0xd86ae3dd2e59d1fc75d29aa29299b6797a8ddcad",
"<KEY>",
"0xd8c548c8fe5d64980582cffafa1c48e092bbda81",
"0xd8f35ef085d202fa7cad0e0c61da737b60e1f855",
"<KEY>",
"0xd952fb344ddacc0c0e8c23cc686c10d5dda11a97",
"0xd95caec9c2d3d15406193a35a32a530e4c382c77",
"<KEY>",
"<KEY>",
"0xd9de304f531efea2596667d4fd65a7fb86fa6778",
"0xd9f0738e4b6c64c6e9cfbc13e63c62c6fdac09ad",
"0xd9f0efd7af7d729969c1e9dfd6d4de73a25fe1ae",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xdaa80b5ec81b35862f4230e8e774c4ee2177d81a",
"0xdac12b6ddbf055ee542f0ed460a32d1e9f361ca4",
"<KEY>",
"0xdaf35d6ae75f3c075aaba5e333e597660062dd74",
"0xdb0675ed4aa81a2b19cc0e16ceda98e073370968",
"0xdb52bd79f76a288e22d85bed606f27114fde3e02",
"<KEY>",
"<KEY>",
"0xdbd1ef4ab7aef97f0b2f7e58d41df5eecd059574",
"<KEY>",
"0xdc5a36d2fdd33e4db2f5896ff1972aaf5410f3e6",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xdcd050fad8eaef5dc11bd25e92014d21dcada74d",
"<KEY>",
"<KEY>",
"0xdd2b021b7e42348a3f950a08e69898420df2ace5",
"0xdd512e30beed51bdf6c8340e48fd2c6c8e2a8a17",
"0xdda652dabdd7c9a50cc1fe389b6ae93570539b82",
"0xdddff3048c1d89fa8fe1221b7bc35624622b9058",
"0xddf86597aff5c826643bced8ef0b84b10a2847ab",
"0xde01a8e2f3b5f24c4c907acab50b5bad5363be07",
"0xde1d2a4aa17ee6a529a042cb543beb26c8d9585d",
"0xde34393312c0c1e97e404d18a04580e9610e063c",
"0xde46215e67d35972f4c880d59969dd08a4c9fa28",
"0xdee7523da507b7e09b60fbffeaf9aabc1d17fce4",
"0xdee8f81017ebca8aaa096c3e78db2c417b7fcd45",
"0xdef65ede44485c15f979bb0646f0b1ace71568c1",
"0xdf0692e287a763e5c011cc96ee402994c6dd246e",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xe0354d9294bea2165a8a965587f3e34411ba45f0",
"0xe0430ce7c72a414cc1c58d9530fd175fc607e515",
"0xe04ae3fda841868a9d9210db3a2f0ebd931aa0a8",
"0xe0990fafe9cce37eedbdb7f5252596bc4fc55467",
"<KEY>",
"0xe110a70608f4327d1f149b8af68442b1acadb6aa",
"0xe1288ad3e152ff8fe4de6e724afb3a0474accd8a",
"0xe157d1c10368f6f265926a6b5f30f5e54273a8d1",
"0xe1690f5153ad0bbc683964aa81645c49b3cf6567",
"0xe19a76c6659e34f099441e84bffa638ad6a3ab25",
"0xe1a1d5c32888c5b140917b296e82cf3a448f37a6",
"<KEY>",
"0xe23da0be88c9b56c815c0525e5c1c687a99a8def",
"<KEY>",
"<KEY>",
"0xe3a6be1c662b7df24564d56b7d6f5a25937d9771",
"0xe3b6a53d9bc1efc5ad1d94dc4e92023df914c415",
"0xe3e39161d35e9a81edec667a5387bfae85752854",
"0xe4174066e7de8d09f9e661eb03d9d4a632e896b5",
"0xe41e8f294b074aaf6d7a3936e240c37e9850b9e5",
"<KEY>",
"0xe4464675b21c1e9f80b839a2bc4ed7a3c586f86e",
"0xe45c5704a77684b6e5208fb421334412a2750aca",
"0xe4957d0691f3aaeb414c693c1e8acde0bf4a22c3",
"0xe4a4ce1517101324bc27bcc803f84af6afe3509b",
"<KEY>",
"<KEY>",
"0xe5252fe49579cd081c8bf1b8e8de5040549e827b",
"0xe54bee8258a2fe65095516f199034a08c02e35fe",
"<KEY>",
"0xe5a7dafb02857df09e7485df861142bdcc3610a5",
"0xe5be77e6e9cfcae7f24dbf9a20f0fb24ef5b555c",
"0xe5f6dbc39334f3e79c149efb8c8c9c8dec474af1",
"0xe67d18889e2f834fea706789618a35b09f2bb833",
"0xe68a8971267753c5c0ddb8b4364ba23cc444c16f",
"0xe69c2f976bdf4eb965f4807c03eedf810fe7c97a",
"<KEY>",
"<KEY>",
"0xe703f231ab056ecb99c92a1232cc1020acfc72f8",
"0xe7304ba0f157f2ade94015934284b6704bc72911",
"<KEY>",
"<KEY>",
"0xe7b6be706a2042e0cd56eabc0d160d2496a0ec2c",
"0xe7dacfa93fee4c6d383afe7136baf23c6957f098",
"0xe805b7459fe13f42e91e9282b8b4af010c9391c5",
"0xe81119bcf92fa4e9234690df8ad2f35896988a71",
"<KEY>",
"0xe82c15d07ee5bc5274ccff897c91eb2ab1326d0d",
"0xe8416d1647806d079c6adfe76bd0257b04a7107f",
"0xe88632728ed377f556cb964e6f670f6017d497e4",
"0xe8924e80a9f95afcefaa25d1a52e0bbbec6f4a96",
"0xe8addf090e4f296fd73b11ec3e15c67399588034",
"0xe8ecff92eb246e6387036664b090ae7443109d48",
"0xe908ce29a8a8ee72a2ca6902ec6489f1697a06cf",
"0xe913a5fe3faa5f0fa0d420c87337c7cb99a0c6e5",
"0xe95345171041eafdbd129e050c433c99d62df96e",
"<KEY>",
"<KEY>",
"0xe9f9b423f5d11da814d8ee76e7cd354642350670",
"0xea94c9a3bcc2bf5a3c08e3de1ccc64c6b6049710",
"0xea9f5bdeb29362552c262a31d10c0d05a1badb53",
"0xead23573f25fd94e7ecbe53daa3a12fb539a6b3d",
"<KEY>",
"0xeb18350001a3f58f486da90535865e58db6b22ca",
"<KEY>",
"<KEY>",
"0xec058d8e83cd45040742d440c8ade8fa131c4e5b",
"0xec05b3a033fa3c0ab9ac7aff6ca5bc4135d917d3",
"0xecab3ed0d13c9172f54d433106ece2a8aa0e674a",
"0xed5960a454782c4c9c62aae6e22a8a50c185e50f",
"0xed89ea70a367e41bb4ff1a0a185bf0c07dec69de",
"0xed93252a46f5f2205172965f11d1a25ae6cdd8a8",
"0xeda29227543b2bc0d8e4a5220ef0a34868033a2d",
"0xedd22868069809f10ced07bf57d833488c3f6ed9",
"0xee269064cdd22dd6e3ed3cd91f670083df240d93",
"0xee5cda91e4ddcde24d44dafd74bed4ba068f8ac2",
"0xee63d9ca6ecaa334ba0c3311b3dbd5de0132ba4c",
"<KEY>",
"0xeed8403b6513c80bfcedeb8b616796e4b91d1a0b",
"0xef0e7a8fb3b6f4e025bdea6f560f91df6502dfdb",
"<KEY>",
"0xef3d7405ba4a98ccd6b0b120711cec137af0e5cd",
"0xefaddc33f890988e43f031336b779d98db21362a",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xf1fced5b0475a935b49b95786adbda2d40794d2d",
"<KEY>",
"0xf253f56f5b8118e9d28cc8dda7316761f4a85fc4",
"<KEY>",
"<KEY>",
"<KEY>",
"0xf2cb1caf152c6e36f1ff1a1c8eb88232221ccde0",
"0xf2f6f1ef2e9da1edebab153fdecd7e033da19ed2",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xf4f56fa0d045ae0e6ba8f82e2c32887fe0b152ea",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xf5fe364d18f4a5a53badce9a046ba74cfc97f6fb",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xf73f9f31e73bc0d5e0d62238c6ede77847131347",
"0xf7476db5b717ac661c027e684456115ab1e728c3",
"<KEY>",
"0xf7c28c5a07badfc2e6e3587ddd8d0d29a67a26d8",
"<KEY>",
"0xf7f83e73480afbc76754e52404a10c70ebb62eb4",
"0xf815a566e42b0d8ddd5d77f91409a7d9ceb10b92",
"0xf84835af6a324f73c9102a889513b56de36fb43a",
"0xf8856124ea157d6f26472e38224ee6744ad13af3",
"0xf8a5552f5af4d325aba476c190a04e633d7e23f4",
"0xf8a7d7b73eae24981c4d4995cf84409daddd5306",
"0xf8db38e425d94a9f493b027aa23519ed1eb00ba4",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xf956e001ae89f15005d046be9678860cb4e667ff",
"<KEY>",
"<KEY>",
"0xfa00d11080656f95e8687688b433aa034f6486e1",
"<KEY>",
"<KEY>",
"0xfa7b8596cc4ed9bffaeb72f225021feb3570e74e",
"0xfa84b39495743817b5899da31d69f734794ebb35",
"<KEY>",
"0xfaa795fece9f8c564e122f1ee216c24faba2373b",
"<KEY>",
"<KEY>",
"<KEY>",
"0xfb9624b6e6a01e2c517d8adb6e82d1946c32db1e",
"<KEY>",
"<KEY>",
"<KEY>",
"0xfc04e555d5c358b8e97f6e5a9d5dbd83bc633fab",
"0xfc59301f715eee53765a7040748f76772ceda4e9",
"0xfccd791f6e7c59ffe1be7015dc57cc5efa1e5148",
"0xfce0413bad4e59f55946669e678eccfe87777777",
"<KEY>",
"<KEY>",
"0xfd11e6a3af521b57688e325cd8a88421de6036ef",
"0xfd5b8e69939a3407b331b9a2957f2d874d94aec9",
"<KEY>",
"0xfde5f84662158292696a25c737bdf20facd1a963",
"0xfdf574af55c9e7b0323d32335b5b7e95ec4aa1ad",
"0xfdf66e2c931ddac8ec45551445d9e5f9253a4cda",
"0xfeac872a93df8939df3face650945fbf3ea705e9",
"0xfed25267df17bfab23a1f8a26802674769d28c7b",
"0xfee6be6b5cc8cb4ee8189850a69973e774e7614e",
"0xfeeb64a9bb1c5beb57d6e17726c3c8faaece5c2a",
"0xff4bbf02057c6dec217d3d022f7fdf0b057447b0",
"0xff67a86a01c7c90b0c3f3a26b65c25f432ec1751",
"0xff81b8d801a20203b702a9f9b79be123c912698b",
"0xffc02940b6f297bb3aaca6d790f65c1d28e891f7",
"0xffccbb0a0b0812d68ac77e39459769280816eaef",
"0xffcd4e54ada433f28acdd933c39bf80c5e2be5d9",
"0xffea5a2cfaf1aafbb87a1fe4eed5413da45c30a0",
];
|
herostat88/aavegotchi
|
data/airdrops/aragon.tsx
|
<filename>data/airdrops/aragon.tsx
export const addresses = [
"0xeda29227543b2bc0d8e4a5220ef0a34868033a2d",
"<KEY>",
"0xeda29227543b2bc0d8e4a5220ef0a34868033a2d",
"<KEY>",
"0x7a97484f57d98a62b0195d79b9600624744de59c",
"0x7a97484f57d98a62b0195d79b9600624744de59c",
"<KEY>",
"0x3742f0fd8fce40411c450e74d270d4d5faaf92fd",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xc117e7247be4830d169da13427311f59bd25d669",
"0xc117e7247be4830d169da13427311f59bd25d669",
"0x67c47b1af7d8b7352fde8d9b07b7e2ce0a22508c",
"<KEY>",
"0x280ded1b7e430bed0cbb0aace452fd2adef2b581",
"0x2e4041504e373d1e7be79e856a3dd2343088381b",
"0x2e4041504e373d1e7be79e856a3dd2343088381b",
"0x3742f0fd8fce40411c450e74d270d4d5faaf92fd",
"0x67c47b1af7d8b7352fde8d9b07b7e2ce0a22508c",
"0x427222582af199752e22c973d1d194c82e02084f",
"0x427222582af199752e22c973d1d194c82e02084f",
"0xb2c980a75f76c664b00b18647bbad08e3df0460d",
"0xbe67d6800fab847f99f81a8e25b0f8d3391785a2",
"<KEY>",
"0x956f1ce3ff2ea59a8b41df83ce9f85ed59d73f92",
"0x956f1ce3ff2ea59a8b41df83ce9f85ed59d73f92",
"0x280ded1b7e430bed0cbb0aace452fd2adef2b581",
"<KEY>",
"<KEY>",
"<KEY>",
"0xddf86597aff5c826643bced8ef0b84b10a2847ab",
"0x20ee31efb8e96d346ceb065b993494d136368e96",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x2629de54a2b7ed0164b896c273bec77a78819a9b",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x6fec474030a273a673dff02f83bb1ceb9de7b82c",
"0x610aec3851d7688c4c8aef3a6173f667e8beef73",
"0xddf86597aff5c826643bced8ef0b84b10a2847ab",
"<KEY>",
"0x6fec474030a273a673dff02f83bb1ceb9de7b82c",
"0x94ae11a67aBE03Dff9E8D5d191F896B1a24Fc53E",
"0x94ae11a67aBE03Dff9E8D5d191F896B1a24Fc53E",
"0xc8cf6b03c2aa80de2579df02aa3bed1e716e1680",
"0xc8cf6b03c2aa80de2579df02aa3bed1e716e1680",
"<KEY>",
"0x20ee31efb8e96d346ceb065b993494d136368e96",
"0x5c0dc6a61763b9be2be0984e36ab7f645c80359f",
"<KEY>",
"<KEY>",
"0xe1061ade0e3a5a772a396e22655e381b92fe7054",
"0xe1061ade0e3a5a772a396e22655e381b92fe7054",
"0x417aff82d2cd9fd39fe790af5798ae865fbe8c48",
"<KEY>",
"<KEY>",
"0x7bafe54726c93576f8624335feb8337a618575ab",
"0x2629de54a2b7ed0164b896c273bec77a78819a9b",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x417aff82d2cd9fd39fe790af5798ae865fbe8c48",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xaab6c2ecf5c32de22923e7740981436dd5a75328",
"<KEY>",
"0x09a1a849974d021a0f74366e5020884ff73e3abb",
"<KEY>",
"0x5c0dc6a61763b9be2be0984e36ab7f645c80359f",
"0x09a1a849974d021a0f74366e5020884ff73e3abb",
"<KEY>",
"0x1a12459b5d9d8f37038205079787f05495254545",
"0x1a12459b5d9d8f37038205079787f05495254545",
"0x731ebfea5653b8afac89158d883388794dd48331",
"<KEY>",
"0x7bafe54726c93576f8624335feb8337a618575ab",
"0x731ebfea5653b8afac89158d883388794dd48331",
"<KEY>",
"0x835Cf0294bEbBb6129e2cA2d99F98a159ecAB94e",
"0x03e0419a8903edd0d07def92bb70a67b85ac9e07",
"0x03e0419a8903edd0d07def92bb70a67b85ac9e07",
"<KEY>",
"<KEY>",
"0xf69ea6646cf682262e84cd7c67133eac59cef07b",
"0xf69ea6646cf682262e84cd7c67133eac59cef07b",
"0xd4d8564baace86315f02e91d1afd54a5979719e3",
"0x679a5f7626d27d140a273759c4ebc13b6719eaf9",
"0x679a5f7626d27d140a273759c4ebc13b6719eaf9",
"0xaab6c2ecf5c32de22923e7740981436dd5a75328",
"<KEY>",
"<KEY>",
"<KEY>",
"0xd4d8564baace86315f02e91d1afd54a5979719e3",
"0x835Cf0294bEbBb6129e2cA2d99F98a159ecAB94e",
"<KEY>",
"<KEY>",
"0x05addf2008ac6a698cd41e2176e72d9cbfd0a35d",
"<KEY>",
"<KEY>",
"<KEY>",
"0x05addf2008ac6a698cd41e2176e72d9cbfd0a35d",
"<KEY>",
"0x9b95a00035a08be9aff260410b5474aeb7531033",
"<KEY>",
"<KEY>",
"0xd419d53817e1daa7b2f72e51707774f3ff0a54a3",
"<KEY>",
"<KEY>",
"<KEY>",
"0x0f26d76e33f1e22517e2366daa8ad30bd6c1e277",
"<KEY>",
"0xd419d53817e1daa7b2f72e51707774f3ff0a54a3",
"0x0f26d76e33f1e22517e2366daa8ad30bd6c1e277",
"0x720e5d6f26a2780c0015580caccd28fe1e3d89cf",
"0x9b95a00035a08be9aff260410b5474aeb7531033",
"0x720e5d6f26a2780c0015580caccd28fe1e3d89cf",
"0xd24a5b3a49ec2ed0dace25f1debed07e340befc9",
"0xd24a5b3a49ec2ed0dace25f1debed07e340befc9",
"0x1a760e3a431c8b9c075ed1280c8835a1a0f1651b",
"0x34e2cb7513a50b19f450a067ed5230a86c13a2e9",
"<KEY>",
"<KEY>",
"<KEY>",
"0xad1b202c4402be93392f602148a581a290167038",
"0x22cab81e0fee2bad5b015dbbeb6a374a1b8738de",
"0x22cab81e0fee2bad5b015dbbeb6a374a1b8738de",
"<KEY>",
"0xad1b202c4402be93392f602148a581a290167038",
"<KEY>",
"0xb0c4cc1aa998df91d2c27ce06641261707a8c9c3",
"0xb0c4cc1aa998df91d2c27ce06641261707a8c9c3",
"0xa578aecb7ea35559fba631d7034da9ebd35d1cef",
"0xa578aecb7ea35559fba631d7034da9ebd35d1cef",
"<KEY>",
"<KEY>",
"0x071d217637b6322a7faac6895a9eb00e529d3424",
"<KEY>",
"0x9be96a6e861d2e5aff1fe0738bed664b6f0b543e",
"0x071d217637b6322a7faac6895a9eb00e529d3424",
"0x9be96a6e861d2e5aff1fe0738bed664b6f0b543e",
"<KEY>",
"<KEY>",
"0x7f2f3685afd60e33ab9e2d35bfa93d4aaa909806",
"0xc7ee509425388d7bef92418b881576a1654d2105",
"<KEY>",
"0x7f2f3685afd60e33ab9e2d35bfa93d4aaa909806",
"<KEY>",
"0xc7ee509425388d7bef92418b881576a1654d2105",
"0x7404becad09351583443720f8f520f689e93359e",
"<KEY>",
"0x67922a9561423548a9ccfd67ad80d6c637c26bfe",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xa7ed6eb424b199ebfdf2be42a65f2e36631768b5",
"0xa7ed6eb424b199ebfdf2be42a65f2e36631768b5",
"0x7404becad09351583443720f8f520f689e93359e",
"0x59480d300ad462d72988e47b42cfcef6db6e2251",
"0x59480d300ad462d72988e47b42cfcef6db6e2251",
"0x5c5a4ae893c4232a050b01a84e193e107dd80ca2",
"0x5c5a4ae893c4232a050b01a84e193e107dd80ca2",
"0x9c3bacade6bbe81a6238110a28628512abf4ec4a",
"0x9c3bacade6bbe81a6238110a28628512abf4ec4a",
"<KEY>",
"0x2c5c5db1847a96d879b6244cce9320508bf0a61b",
"0x34e2cb7513a50b19f450a067ed5230a86c13a2e9",
"0x2c5c5db1847a96d879b6244cce9320508bf0a61b",
"0x576495c17d4129701ebf9c4fef816ec82ac208e5",
"0x576495c17d4129701ebf9c4fef816ec82ac208e5",
"<KEY>",
"<KEY>",
"0xd952fb344ddacc0c0e8c23cc686c10d5dda11a97",
"0xd952fb344ddacc0c0e8c23cc686c10d5dda11a97",
"0x614a61a3b7f2fd8750acaad63b2a0cfe8b8524f1",
"<KEY>",
"0x547c0dbd2fc303c8e97475ec072a58de60ec134a",
"0x547c0dbd2fc303c8e97475ec072a58de60ec134a",
"<KEY>",
"0xcac546561f1a780f7964fc5704f05496f661e36f",
"0xcac546561f1a780f7964fc5704f05496f661e36f",
"<KEY>",
"0x0c5a369be6d584d6b054494a22d71b61ef1fe9af",
"0x1a760e3a431c8b9c075ed1280c8835a1a0f1651b",
"0x02206509a713e003bd099fd12a2edfef9af84665",
"0x3929d8e8e6b983e36e612d2d39eb0ab49b496cf9",
"0x3929d8e8e6b983e36e612d2d39eb0ab49b496cf9",
"0xce0b352177038599b1df4505f50ff731ff6421eb",
"0xce0b352177038599b1df4505f50ff731ff6421eb",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x9fe9e5f532669509030e4fae68556b855efa5179",
"0x02206509a713e003bd099fd12a2edfef9af84665",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x74eb390c06a7cc1158a0895fb289e5037633e38b",
"0x74eb390c06a7cc1158a0895fb289e5037633e38b",
"<KEY>",
"0x7b71afb18c297aee9fe0f0af06cff28e3227b13e",
"<KEY>",
"<KEY>",
"<KEY>",
"0xC6291442efE2634306b31f24C8238a702fEc85A0",
"0xC6291442efE2634306b31f24C8238a702fEc85A0",
"0x0c5a369be6d584d6b054494a22d71b61ef1fe9af",
"0x7b71afb18c297aee9fe0f0af06cff28e3227b13e",
"<KEY>",
"<KEY>",
"0x3945476e477de76d53b4833a46c806ef3d72b21e",
"0x3945476e477de76d53b4833a46c806ef3d72b21e",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x81397dbe05e0df839f16d9c52869f70a69f00bdf",
"0x8debc343a259253aa43be5e47eb58a9e668e3ce2",
"0x8debc343a259253aa43be5e47eb58a9e668e3ce2",
"0xe2dcc6b25c17238c63a0faaa992fe949dc5d9e9e",
"0xe2dcc6b25c17238c63a0faaa992fe949dc5d9e9e",
"0x81397dbe05e0df839f16d9c52869f70a69f00bdf",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xa6cd4976bb57b96ffedb8709417ef57bd4812ba7",
"<KEY>",
"0x4ac006ecc51ff15054a0cc21d715f80cfa8d4341",
"<KEY>",
"0xb3cbc7e4dc5044ae0d3feeac1873ffa213b9e24c",
"0x8af7e426af2ffcb939b9bb164a807dba76adc40d",
"0x8af7e426af2ffcb939b9bb164a807dba76adc40d",
"0xde708decb61d06ee30a95051dd203f43e0d44c70",
"<KEY>",
"0x4ac006ecc51ff15054a0cc21d715f80cfa8d4341",
"0x86aecfc1e3973108ce14b9b741a99d3466127170",
"<KEY>",
"<KEY>",
"0x3c585952a5D9156DA040b7561b296F4e56B5AcbC",
"0xde708decb61d06ee30a95051dd203f43e0d44c70",
"<KEY>",
"0x3c585952a5D9156DA040b7561b296F4e56B5AcbC",
"0x8df6a2dadfac1009442430ca40f8479d206f7673",
"0xb3cbc7e4dc5044ae0d3feeac1873ffa213b9e24c",
"0xb27f6df486ef5dee2e3a4dc4f257dd63e5a5e371",
"0x60d38778adbbeeac88f741b833cbb9877228eea0",
"0x60d38778adbbeeac88f741b833cbb9877228eea0",
"0x19221de454ca78e846f0aee7273f20c02b9065c4",
"0x19221de454ca78e846f0aee7273f20c02b9065c4",
"0x56348e42db10a34be4e2c1f6238e31bc3b6ba697",
"0x56348e42db10a34be4e2c1f6238e31bc3b6ba697",
"0x86aecfc1e3973108ce14b9b741a99d3466127170",
"0x7bcec44c7486143ee875103de66006047cae8df7",
"0x7bcec44c7486143ee875103de66006047cae8df7",
"0x3656460E9bEC3E98451Df75ce8F6cC6E1dff9BB7",
"0x3656460E9bEC3E98451Df75ce8F6cC6E1dff9BB7",
"0xc68bba423525576c7684e7ea25e7d5f079b1361e",
"0xc68bba423525576c7684e7ea25e7d5f079b1361e",
"0x1e9fb5428855064b5c38e3ae96cc9878c573ed53",
"0x1e9fb5428855064b5c38e3ae96cc9878c573ed53",
"0x7fCc3B4a05826c14afaFe6830F3511E9DDE48171",
"<KEY>",
"0x234a14fddcc2e533156b5a636db9a071d54e9baf",
"0x0236c75860d07e8d5add17c88b9dac04472c2295",
"0x6541e84af0b25f3e084e9ed17d8f255a12d125d3",
"0x0236c75860d07e8d5add17c88b9dac04472c2295",
"0x6541e84af0b25f3e084e9ed17d8f255a12d125d3",
"<KEY>",
"<KEY>",
"0x234a14fddcc2e533156b5a636db9a071d54e9baf",
"<KEY>",
"<KEY>",
"0x7adac8d617d59d502cb109e5a809f0ec7cbb0751",
"0x7adac8d617d59d502cb109e5a809f0ec7cbb0751",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xde9b9a2b33e136a6fda98005e85585f83e536da7",
"<KEY>",
"<KEY>",
"0xd9f0EFD7aF7D729969c1e9dfd6d4De73a25fE1aE",
"0x489e0a2582abdb4e97c70f4a0012676f6d977ce9",
"0x489e0a2582abdb4e97c70f4a0012676f6d977ce9",
"0xde9b9a2b33e136a6fda98005e85585f83e536da7",
"<KEY>",
"<KEY>",
"0xd9f0EFD7aF7D729969c1e9dfd6d4De73a25fE1aE",
"<KEY>",
"<KEY>",
"0x3ead00d7e1b95c5e99f287f04c72f62f2cb67c80",
"<KEY>",
"0x605307da17ad96171e79afa7e1e1a7b21dda111f",
"0x605307da17ad96171e79afa7e1e1a7b21dda111f",
"0x4B3261dFcb21685f98189d9Df857C7351370736d",
"0x0eeeff44e8f65db5cc841e3a3d591499b74f85e6",
"<KEY>",
"<KEY>",
"0x0eeeff44e8f65db5cc841e3a3d591499b74f85e6",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x10d2ed17408a508bc1693d1fb7f3b9899a96cc98",
"<KEY>",
"0x1b6f2ffb68aacf96e10d0915422300a867b5b97e",
"0x1b6f2ffb68aacf96e10d0915422300a867b5b97e",
"0xf026941540e63e3d5d614d1aaae5119da96cc95f",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xad6034c145530682ed7643478b6678e2e2bbaad6",
"0xad6034c145530682ed7643478b6678e2e2bbaad6",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x061b8335e1d2042975C4ED849943334BD07Fb504",
"0x061b8335e1d2042975C4ED849943334BD07Fb504",
"<KEY>",
"<KEY>",
"<KEY>",
"0x8aff9486401c2c9916cf8a105a1d66be8d2d6ed1",
"0x8aff9486401c2c9916cf8a105a1d66be8d2d6ed1",
"0x3e17fac953de2cd729b0ace7f6d4353387717e9e",
"0x3e17fac953de2cd729b0ace7f6d4353387717e9e",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xe8adaea0ba507a28d1309051beceb4db7fe377af",
"0xe8adaea0ba507a28d1309051beceb4db7fe377af",
"0x471ed4efbb90b654bc74373a27432b758b7a5d28",
"0x18d8646530dabe8f93b89282af161fae03896638",
"0x18d8646530dabe8f93b89282af161fae03896638",
"0x471ed4efbb90b654bc74373a27432b758b7a5d28",
"0x4c39185a078b5666c372538231cb793a0928807b",
"0x4c39185a078b5666c372538231cb793a0928807b",
"0x15d2c48f4552a6c9519cc89c49e661e1ed30b80b",
"0x1cc671a35d16d4d332c072e53a044cfa064a2e65",
"0x1cc671a35d16d4d332c072e53a044cfa064a2e65",
"<KEY>",
"0x32ccaf20c89e76cb3f0e35276532fc4e9976fd10",
"<KEY>",
"<KEY>",
"0x15d2c48f4552a6c9519cc89c49e661e1ed30b80b",
"<KEY>",
"<KEY>",
"<KEY>",
"0x602faee794e16604fbb17511b1ad179a728ce61b",
"0xbecf46ec3538a032867b3f553630acfd04d4f67e",
"0xbecf46ec3538a032867b3f553630acfd04d4f67e",
"0x602faee794e16604fbb17511b1ad179a728ce61b",
"0x8df6a2dadfac1009442430ca40f8479d206f7673",
"<KEY>",
"0x7fCc3B4a05826c14afaFe6830F3511E9DDE48171",
"0x2c2add1c863551a0644876be227604c8e458dd7e",
"0x2c2add1c863551a0644876be227604c8e458dd7e",
"<KEY>",
"0x3f7dd0b106b10d06bb4813715b4e24d9e626dd64",
"<KEY>",
"<KEY>",
"0x989b1a61b4796151f51852efa1f128a02c5e3a32",
"0x3f7dd0b106b10d06bb4813715b4e24d9e626dd64",
"0x989b1a61b4796151f51852efa1f128a02c5e3a32",
"0x1279a8132c775ede3e738cc2a753ffe47d009353",
"<KEY>",
"0x1279a8132c775ede3e738cc2a753ffe47d009353",
"0x57ac46a65916e3c6ef1578fd251582710a55e344",
"0x57ac46a65916e3c6ef1578fd251582710a55e344",
"0x9d3f10f5d553dda3f36e09ab0c3c757ba99e8894",
"0x8886dca35291f05ed5d8e21f083998ea8dceb50f",
"0xdf14100b76a5b5fd46fba22b7ac124919cffc92a",
"<KEY>",
"<KEY>",
"0xdf14100b76a5b5fd46fba22b7ac124919cffc92a",
"0xba363b223e2d2b1b2a9017bac58a0a2b8137fb9a",
"0x8886dca35291f05ed5d8e21f083998ea8dceb50f",
"0xba363b223e2d2b1b2a9017bac58a0a2b8137fb9a",
"0xceec48581b3145a575508719f45da07dc57fa7ce",
"0xc1c0e9750fab87ac871ea40d005063f3750fe143",
"0xc1c0e9750fab87ac871ea40d005063f3750fe143",
"0x3c803a58e42d5e78475b185dc9b055df16e86c6e",
"0x3c803a58e42d5e78475b185dc9b055df16e86c6e",
"0xc7f91d9f1a2609c89d600bacf38a21f09e77ddd8",
"0xc7f91d9f1a2609c89d600bacf38a21f09e77ddd8",
"0x59af3fe14cb38e6ff055599de90988411e340a65",
"0x59af3fe14cb38e6ff055599de90988411e340a65",
"0x8d389447d37cab4244e436c989003177333be9e1",
"0xe913a5fe3faa5f0fa0d420c87337c7cb99a0c6e5",
"0x8d389447d37cab4244e436c989003177333be9e1",
"0xe913a5fe3faa5f0fa0d420c87337c7cb99a0c6e5",
"<KEY>",
"<KEY>",
"<KEY>",
"0xf5793f0affadbf3421a775d4e101f169c8abdc8a",
"0xf5793f0affadbf3421a775d4e101f169c8abdc8a",
"<KEY>",
"<KEY>",
"0x8e59f1fe1c8d828dda49971ab96e6a003a7e2f81",
"<KEY>",
"<KEY>",
"0x8e59f1fe1c8d828dda49971ab96e6a003a7e2f81",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xc63f207f957c4e1de006ab147885e633f76c96b7",
"0xa0deb6ad8f5d508557d11e1f381bbd62299f5664",
"0x54021e58af1756dc70ce7034d7636de2d2f1fa74",
"0xc63f207f957c4e1de006ab147885e633f76c96b7",
"<KEY>",
"0x385184962d30a5f079990aa7d47ece7e5cfe8f28",
"0x54021e58af1756dc70ce7034d7636de2d2f1fa74",
"0xa0deb6ad8f5d508557d11e1f381bbd62299f5664",
"<KEY>",
"<KEY>",
"0x2bfe6398fee545f1f422db3f65ec86e09385b900",
"0x2bfe6398fee545f1f422db3f65ec86e09385b900",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x1afa39ff22fe36427942ed9eb3e588c61caf3beb",
"0x1afa39ff22fe36427942ed9eb3e588c61caf3beb",
"0x1d32af9776315963089e8a1c3bb13c7dcfdc7f3d",
"0x333FFBDF76A0dcE3c40EF58B2e5fC57893dCABC0",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xceec48581b3145a575508719f45da07dc57fa7ce",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xc8d46eb7881975f9ae15216feeba2ff58e55803c",
"0xc8d46eb7881975f9ae15216feeba2ff58e55803c",
"<KEY>",
"<KEY>",
"0x602faee794e16604fbb17511b1ad179a728ce61b",
"0x75d5ced39b418d5e25f4a05db87fcc8bceed7e66",
"0x4ada1b9d9fe28abd9585f58cfeed2169a39e1c6b",
"0x4ada1b9d9fe28abd9585f58cfeed2169a39e1c6b",
"<KEY>",
"0xa5a257d843369b7f360c76a83f718a18a0df7078",
"0x8e63e4376dde62cb82f5a91c4bce4156457dedb1",
"0x8e63e4376dde62cb82f5a91c4bce4156457dedb1",
"0xa5a257d843369b7f360c76a83f718a18a0df7078",
"0xa1586347c540c1b5cd83113872eeb7815a57dfe6",
"<KEY>",
"<KEY>",
"0x333FFBDF76A0dcE3c40EF58B2e5fC57893dCABC0",
"0x3c6d73475d8a64cec5b5170853ab38ccf51eb130",
"0x2ef6f5b5203b3dfec762fde8d6e09b9891034772",
"0x2ef6f5b5203b3dfec762fde8d6e09b9891034772",
"<KEY>",
"<KEY>",
"0x86d3af9ff0e89cc2382d8b171aff5ebce5ef4351",
"0x86d3af9ff0e89cc2382d8b171aff5ebce5ef4351",
"0xa1586347c540c1b5cd83113872eeb7815a57dfe6",
"<KEY>",
"0x42afe93a50c9fba4bf55de264da7bfacdbd2ec70",
"0x42afe93a50c9fba4bf55de264da7bfacdbd2ec70",
"0x73f0e17dd04d73a152c312a628554d46a408a73f",
"<KEY>",
"<KEY>",
"0x73f0e17dd04d73a152c312a628554d46a408a73f",
"<KEY>",
"0x1b09c16a1c16b4ae6780dd588a87c6ec4937ed13",
"0x1b09c16a1c16b4ae6780dd588a87c6ec4937ed13",
"0x75d5ced39b418d5e25f4a05db87fcc8bceed7e66",
"0x1c0e68b94a8c8bd16812c8e020ff92d2ae502ed7",
"0x1c0e68b94a8c8bd16812c8e020ff92d2ae502ed7",
"<KEY>",
"0x385184962d30a5f079990aa7d47ece7e5cfe8f28",
"<KEY>",
"<KEY>",
"<KEY>",
"0x40e5423132d2f6b5dc110781e269df7a65674c75",
"<KEY>",
"<KEY>",
"0x40e5423132d2f6b5dc110781e269df7a65674c75",
"0x969de568df4cec02e682acf75d7ed9f048de3aba",
"0x7c8263e38a6c0168015169a6b6f86eef1f271d71",
"<KEY>",
"0x7c8263e38a6c0168015169a6b6f86eef1f271d71",
"0x5501b109a7cc3707a27D6438C6aA290E2B168CE4",
"0x5501b109a7cc3707a27D6438C6aA290E2B168CE4",
"0xe5a71ec37b87b0283e4c7191e5e0d9f2369c2a65",
"0xe5a71ec37b87b0283e4c7191e5e0d9f2369c2a65",
"<KEY>",
"<KEY>",
"<KEY>",
"0xb9ecfe95cd599d63412abd84b1524e1184301db8",
"0x63c9a867d704df159bbbb88eeee1609196b1995e",
"0xb9ecfe95cd599d63412abd84b1524e1184301db8",
"0x63c9a867d704df159bbbb88eeee1609196b1995e",
"0x0e3347baed6e6070097c978247ead2f716c4b7a0",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xd29edf0877c42ded575136e3d2104f9f5ecb7e44",
"0xd29edf0877c42ded575136e3d2104f9f5ecb7e44",
"0x7d616916d228d1663d1e546e686a0c63bda95b09",
"0x7d616916d228d1663d1e546e686a0c63bda95b09",
"0x4c6f5b95777a4eac25aeef9e6c3c7cfa7d5283fa",
"0x4c6f5b95777a4eac25aeef9e6c3c7cfa7d5283fa",
"<KEY>",
"0xd20cc7de93c9f8d1877294bf62f812edce933be0",
"<KEY>",
"0xd20cc7de93c9f8d1877294bf62f812edce933be0",
"0xfeac872a93df8939df3face650945fbf3ea705e9",
"<KEY>",
"0xfeac872a93df8939df3face650945fbf3ea705e9",
"0x7ce90a6d54e830ceb568f81b52865d5011aefe40",
"0x7ce90a6d54e830ceb568f81b52865d5011aefe40",
"0x2d19ca3ca720a80d8d5ff4b28c674d8d76dd24e1",
"0x1aa52172e59e0837671adfe30a1f99a8929dfbf5",
"0x1aa52172e59e0837671adfe30a1f99a8929dfbf5",
"0x2d19ca3ca720a80d8d5ff4b28c674d8d76dd24e1",
"0x8ea8721f27efcaabb3901ed6756505ab873f15a7",
"0x8ea8721f27efcaabb3901ed6756505ab873f15a7",
"0xddaac482530e2d5c31c19727c6721e192d539666",
"0x127d60193f08626e168099fc2277e31f5a89b1a7",
"0x127d60193f08626e168099fc2277e31f5a89b1a7",
"<KEY>",
"<KEY>",
"<KEY>",
"0xe89065e2db751b0953f511f437edb4a977b64681",
"0xaaccc7cc0161a5db0e706d1bd81d8d77a564c570",
"0xaaccc7cc0161a5db0e706d1bd81d8d77a564c570",
"0xe7234b657b92c07ed15ff23abb57ad781da65c0f",
"0xddaac482530e2d5c31c19727c6721e192d539666",
"<KEY>",
"<KEY>",
"0x549e38b0aec4af720f2a655edfa07b8bc5294a70",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x5582358de7cc812101313f5e13de500005a31dea",
"<KEY>",
"<KEY>",
"0x75ddb7ab958135bbe2dab48d6286826f6aa5e3b4",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x549e38b0aec4af720f2a655edfa07b8bc5294a70",
"<KEY>",
"0x301a4125ae628984fa2b419ee8fb527a4873312e",
"<KEY>",
"0x83ee01ddf5d8ebf0c408d84c5a1710d4410c4525",
"<KEY>",
"0x83ee01ddf5d8ebf0c408d84c5a1710d4410c4525",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x6a9f813fb3e6a8f7013dabd1695bae1d49ae8481",
"0x6a9f813fb3e6a8f7013dabd1695bae1d49ae8481",
"0x52fcda4f61108b4e918baba6b671e61c774eaead",
"0x52fcda4f61108b4e918baba6b671e61c774eaead",
"<KEY>",
"<KEY>",
"0x1a672568018da2f29f1f1dbcf50476182ceb3ed0",
"0x1a672568018da2f29f1f1dbcf50476182ceb3ed0",
"0x57b31dad7a6788513c1a6731bd08e1f6a6f49839",
"0x57b31dad7a6788513c1a6731bd08e1f6a6f49839",
"0x1e9239b9b0d773d620f112a964b1053a63174ceb",
"0x1e9239b9b0d773d620f112a964b1053a63174ceb",
"0x301a4125ae628984fa2b419ee8fb527a4873312e",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x3ead00d7e1b95c5e99f287f04c72f62f2cb67c80",
"<KEY>",
"<KEY>",
"<KEY>",
"0xce10e6c0696f3359b260ab120eb1cfbaee64eb15",
"<KEY>",
"<KEY>",
"0xa30412D6cD5d48B65Df7134F2e31949c843ba13F",
"0xa30412D6cD5d48B65Df7134F2e31949c843ba13F",
"0x7a6bcb1ea4c44cf1764e64dfb85a55487ad86b12",
"<KEY>",
"<KEY>",
"0x7a6bcb1ea4c44cf1764e64dfb85a55487ad86b12",
"<KEY>",
"0x41718c52d77ca61baaf2775202873e969f232d58",
"0x41718c52d77ca61baaf2775202873e969f232d58",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x22cab0b36cc4ec24bfd5732d07828b45e7547f9e",
"<KEY>",
"0x75c32299da1395c5ba98c6e213f0deb1320a33cb",
"<KEY>",
"0x0a2492d1b9a80fe094a011d645666653f3d3fc09",
"0x22cab0b36cc4ec24bfd5732d07828b45e7547f9e",
"0x95ed1d0fbde355debd390967e28b30dcf8396eec",
"<KEY>",
"<KEY>",
"0x0a2492d1b9a80fe094a011d645666653f3d3fc09",
"0x95ed1d0fbde355debd390967e28b30dcf8396eec",
"0x22cab0b36cc4ec24bfd5732d07828b45e7547f9e",
"0xf4f56fa0d045ae0e6ba8f82e2c32887fe0b152ea",
"<KEY>",
"0xf0bc763e0a6af4784a36fa102220ff60ec651f9e",
"0xf0bc763e0a6af4784a36fa102220ff60ec651f9e",
"0xf4f56fa0d045ae0e6ba8f82e2c32887fe0b152ea",
"<KEY>",
"0xe19a76c6659e34f099441e84bffa638ad6a3ab25",
"0xe19a76c6659e34f099441e84bffa638ad6a3ab25",
"<KEY>",
"0xa74e0784ff6259f1336e763fe7a871978873f8f3",
"0xa74e0784ff6259f1336e763fe7a871978873f8f3",
"0x99f900f51808972921c0749efa3cb343847572a6",
"0x99f900f51808972921c0749efa3cb343847572a6",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xe7620ef6e16e42efae942790e76797ae1aeddebb",
"0xe7620ef6e16e42efae942790e76797ae1aeddebb",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xbb73548a0e6f839fb58e9d59969ba6aedecdf5f1",
"0xbb73548a0e6f839fb58e9d59969ba6aedecdf5f1",
"<KEY>",
"<KEY>",
"0x64df7af696e0977771a0e1e1b1a8dd22ded3cf4b",
"0x4e483558e4e59416eea246f643d78470a7d6d5a9",
"0x4e483558e4e59416eea246f643d78470a7d6d5a9",
"0x9327775e225a703125167eb423d246915bdc37e7",
"<KEY>",
"0x3e86eac93a2dbb4faeb8709d77d451aeda710ef9",
"0x3e86eac93a2dbb4faeb8709d77d451aeda710ef9",
"<KEY>",
"<KEY>",
"0x7df437c26813e2d976d2d88fc99e361f9e90ad3c",
"0x7df437c26813e2d976d2d88fc99e361f9e90ad3c",
"<KEY>",
"0x1cdebe3d073ce76615ed3f9fab9f4a886be62f27",
"0x77427023e70cafd983dabaf3488d8d83ecb15b96",
"0x77427023e70cafd983dabaf3488d8d83ecb15b96",
"<KEY>",
"0x3c6d73475d8a64cec5b5170853ab38ccf51eb130",
"0x243cebb2fccae390639f2b454e4886dcfae7deee",
"0x243cebb2fccae390639f2b454e4886dcfae7deee",
"0xb4d502361a3c6f823eeb9a99af09e110382206ee",
"0xb4d502361a3c6f823eeb9a99af09e110382206ee",
"0x1724e533732edde9e72c54820e8e95d54d3145e5",
"0x1724e533732edde9e72c54820e8e95d54d3145e5",
"0x3e9c2ee838072b370567efc2df27602d776b341c",
"0xc6edbbe55279871c1e6cffbfd844680906bb7430",
"0x3e9c2ee838072b370567efc2df27602d776b341c",
"0xc6edbbe55279871c1e6cffbfd844680906bb7430",
"0xdc6953c238c4ffff57d7c16ac32bc716f7074e3a",
"0xdc6953c238c4ffff57d7c16ac32bc716f7074e3a",
"<KEY>",
"<KEY>",
"0x3e9c2ee838072b370567efc2df27602d776b341c",
"0x0c709da766ee0efe8344ce676fff150399d7d874",
"0x0c709da766ee0efe8344ce676fff150399d7d874",
"0x500ff7d07908e7f8aee9b2669082b47ac6a04885",
"0x500ff7d07908e7f8aee9b2669082b47ac6a04885",
"0x085f66d0764c632ce8c1f2a41531909bef106c75",
"0x085f66d0764c632ce8c1f2a41531909bef106c75",
"<KEY>",
"0x6dba7f95386e4129f92b59482fa356bc74f29c5b",
"0xc659284cd530f1df076b38a469c4207d731a2710",
"<KEY>",
"0xd03c8ad4bebd854a36010b864520efa0e4c700ee",
"0xd03c8ad4bebd854a36010b864520efa0e4c700ee",
"0x8fdeffaf8fa2b3754da2268e626ea1f3733ee214",
"0x8fdeffaf8fa2b3754da2268e626ea1f3733ee214",
"0xbed7fc5a011cb6ac5a14fb86c1ba893b40acf1e5",
"0x787b4b7ffef8eddad54f311039acf4c36fec9593",
"0x787b4b7ffef8eddad54f311039acf4c36fec9593",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x936302682e1c61a4d7e54709888b93bb4a67a52a",
"0x44a82977f3b357edfee04231077f990d291735c3",
"0x44a82977f3b357edfee04231077f990d291735c3",
"0x23230789629cde13f28ed45f3540a5d008d59db3",
"<KEY>",
"0x6ca2fc6cf24cfe57f259f39eb1db52baa257c1e6",
"0xad2844acbe8cbde5ea1eba469db6332019e95bc0",
"0xe5a71ec37b87b0283e4c7191e5e0d9f2369c2a65",
"0xe5a71ec37b87b0283e4c7191e5e0d9f2369c2a65",
"0x9cf936fc3965afb2d9ac2a4123244c459a0ba1c3",
"0x8ba922eb891a734f17b14e7ff8800e6626912e5d",
"0x23230789629cde13f28ed45f3540a5d008d59db3",
"0xb53cf0a586973ab15c0a045990d06b4fa083dd5a",
"0xb53cf0a586973ab15c0a045990d06b4fa083dd5a",
"<KEY>",
"<KEY>",
"<KEY>",
"0x0b9439d58274578ee2e011a09f2e110134ce914e",
"0x6fee145963fccbc1adff7cd58dbd6bef7f0762d1",
"<KEY>",
"<KEY>",
"0x6fee145963fccbc1adff7cd58dbd6bef7f0762d1",
"<KEY>",
"<KEY>",
"0x6519e6117480d140cd7d33163ac30fd01812f34a",
"<KEY>",
"0x6519e6117480d140cd7d33163ac30fd01812f34a",
"0xe2c6a4a3a83399775ba104f16f94d2eae905d409",
"0x02aee0ce756fa0157294ff3ff48c1dd02adccf04",
"0x735dde08a1d36939da610ce5b7b9688db97234bf",
"0x735dde08a1d36939da610ce5b7b9688db97234bf",
"<KEY>",
"<KEY>",
"0xc637d110b89908617a8c5c153c3d737068165ce5",
"0xc637d110b89908617a8c5c153c3d737068165ce5",
"0xe88632728ed377f556cb964e6f670f6017d497e4",
"0xe88632728ed377f556cb964e6f670f6017d497e4",
"0xe2c6a4a3a83399775ba104f16f94d2eae905d409",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x977dfd4a014ccacc41fc583771abe9d04d279c20",
"<KEY>",
"<KEY>",
"0x75c32299da1395c5ba98c6e213f0deb1320a33cb",
"0xa6cd4976bb57b96ffedb8709417ef57bd4812ba7",
"<KEY>",
"0xad63dde7ca39ea3446fb6d29bb91e0cbf7a9a582",
"0xad63dde7ca39ea3446fb6d29bb91e0cbf7a9a582",
"0xdcd050fad8eaef5dc11bd25e92014d21dcada74d",
"0xf381896eb9280dcb2099523149d42f7b1ed43e9a",
"0xf381896eb9280dcb2099523149d42f7b1ed43e9a",
"0xdcd050fad8eaef5dc11bd25e92014d21dcada74d",
"0x9b1f13eddba3c852d6c38bb23441ef4962d18040",
"0x1c190aea1409ac9036ed45e829de2018002ac3d7",
"0x1c190aea1409ac9036ed45e829de2018002ac3d7",
"0x977dfd4a014ccacc41fc583771abe9d04d279c20",
"0xe1a1d5c32888c5b140917b296e82cf3a448f37a6",
"0xe1a1d5c32888c5b140917b296e82cf3a448f37a6",
"0x853ccc18e05996e991cc00cc1018099b7fc5ee5f",
"0x853ccc18e05996e991cc00cc1018099b7fc5ee5f",
"0x2c1ee1ec33c495989ca09ddd68df12cd17fa6f33",
"0x2c1ee1ec33c495989ca09ddd68df12cd17fa6f33",
"0x1745296F22889ABcFFF04f041621d880d3417633",
"0xdda652dabdd7c9a50cc1fe389b6ae93570539b82",
"0xdda652dabdd7c9a50cc1fe389b6ae93570539b82",
"0x92475a4897a0a8a9cbe1427551a98d83d0aeba2b",
"0x92475a4897a0a8a9cbe1427551a98d83d0aeba2b",
"<KEY>",
"<KEY>",
"0x780dc341b18d1e6ba11736de6fba58a85c666e83",
"0x780dc341b18d1e6ba11736de6fba58a85c666e83",
"<KEY>",
"0xae80dcf8109e2774d38884ece6c11191c7a1c583",
"0xae80dcf8109e2774d38884ece6c11191c7a1c583",
"0x23abad8c65a9a93abcc343892aaf3d6e88b5ccc9",
"0x23abad8c65a9a93abcc343892aaf3d6e88b5ccc9",
"0x1a5f8687ae4290c21c867c8e09496c4a83f9e981",
"0x1a5f8687ae4290c21c867c8e09496c4a83f9e981",
"0x9d6a114a649efa28ebe1f30e6b23d62bf46be6f4",
"0x9d6a114a649efa28ebe1f30e6b23d62bf46be6f4",
"0x0e3347baed6e6070097c978247ead2f716c4b7a0",
"0x0a8ef379a729e9b009e5f09a7364c7ac6768e63c",
"0x0a8ef379a729e9b009e5f09a7364c7ac6768e63c",
"<KEY>",
"<KEY>",
"0x0dd3e554c9ca47cb3a7b5935a9743de812dfc010",
"0x4d64152d23260f399af956c6a777740cfc263d1c",
"0x4d64152d23260f399af956c6a777740cfc263d1c",
"0xb1f56a37738c16d150c9aaa5441f056e65f4fbd6",
"0xb1f56a37738c16d150c9aaa5441f056e65f4fbd6",
"0x0dd3e554c9ca47cb3a7b5935a9743de812dfc010",
"0x1c1d8ee11b6538bc7be4dcba00fac7243cbea75c",
"0x0b31e9737fee75157a9aa775e35a43dec1dc2059",
"0x0b31e9737fee75157a9aa775e35a43dec1dc2059",
"<KEY>",
"<KEY>",
"<KEY>",
"0x780432eabda6f7db5742149d3915605f9049fe3f",
"0x780432eabda6f7db5742149d3915605f9049fe3f",
"<KEY>",
"0xc4e62b6b3698a6d9649b3626358e0a17e7da4a3d",
"0xc4e62b6b3698a6d9649b3626358e0a17e7da4a3d",
"<KEY>",
"<KEY>",
"<KEY>",
"0x8df6a2dadfac1009442430ca40f8479d206f7673",
"0x985147809e9c0a677e9c9bed656c984be037d373",
"0x985147809e9c0a677e9c9bed656c984be037d373",
"0xe82c15d07ee5bc5274ccff897c91eb2ab1326d0d",
"0xe82c15d07ee5bc5274ccff897c91eb2ab1326d0d",
"0xd31394b20e694d30dbb391e3bc51953907a1f7e2",
"0x9cf936fc3965afb2d9ac2a4123244c459a0ba1c3",
"0x82131e86d080312e13605aada6538a94df5b41a5",
"0xc1178d5bada448126a5054eaf4e7c2f3fca5e974",
"0xc1178d5bada448126a5054eaf4e7c2f3fca5e974",
"0xe6d8796db42080df3bf047961d9cfb274865066e",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x2d19ca3ca720a80d8d5ff4b28c674d8d76dd24e1",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xdbd1ef4ab7aef97f0b2f7e58d41df5eecd059574",
"0xdbd1ef4ab7aef97f0b2f7e58d41df5eecd059574",
"<KEY>",
"0x6c8e15ec8e35b6ffb246d60abca2ba81d4e247f4",
"0x6c8e15ec8e35b6ffb246d60abca2ba81d4e247f4",
"<KEY>",
"<KEY>",
"0x4306893ff11748254489465650e09ff4b555bba9",
"0x4306893ff11748254489465650e09ff4b555bba9",
"<KEY>",
"<KEY>",
"0xbba2379f5cc9a2f248c5cf18ad72379ae2478f42",
"0xad2844acbe8cbde5ea1eba469db6332019e95bc0",
"0x1540f6fa70c04e5a5dac6a134d9dd03abd301b1a",
"0x1540f6fa70c04e5a5dac6a134d9dd03abd301b1a",
"0x0b9439d58274578ee2e011a09f2e110134ce914e",
"<KEY>",
"0xf8971a5f642ea9b20d6a1fa5021089fe47fb0915",
"<KEY>",
"0xf8971a5f642ea9b20d6a1fa5021089fe47fb0915",
"0xecc41e2924eecaa9975e9e1c6d6d9c33588839df",
"0x6ceec3ce62c046c341704dcaf3969c89df083870",
"0x84db8f2e3c20e3a0745859e8abfeb73c8f9dbb1a",
"0x0a4815677bb775036fab8d2ca43357a8652f4ea7",
"0x2f4205b1a32526461e7886c8afddd4fd6f6aed8f",
"0x9cf936fc3965afb2d9ac2a4123244c459a0ba1c3",
"0x9cf936fc3965afb2d9ac2a4123244c459a0ba1c3",
"<KEY>",
"<KEY>",
"0x23799734239699e9c1090b5846e4ca0929245418",
"0x23799734239699e9c1090b5846e4ca0929245418",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x32ccaf20c89e76cb3f0e35276532fc4e9976fd10",
"0xce9332f4d44e9efccc64f88c9bd23e288c0ae5a2",
"0xce9332f4d44e9efccc64f88c9bd23e288c0ae5a2",
"0x099AD3e193E311e89aBda11bDd3c7aea88014221",
"0x099AD3e193E311e89aBda11bDd3c7aea88014221",
"0x7de3edc8fe47f8a2ac06e3d8d1ba35385946f162",
"0x7de3edc8fe47f8a2ac06e3d8d1ba35385946f162",
"<KEY>",
"<KEY>",
"0xafc81e811b2638be45ecff998dff43fa25634580",
"0xafc81e811b2638be45ecff998dff43fa25634580",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0x7ce90a6d54e830ceb568f81b52865d5011aefe40",
"<KEY>",
"<KEY>",
"0xfab9a3d37999e12252b47468d2ffd4be15936012",
"0xfab9a3d37999e12252b47468d2ffd4be15936012",
"<KEY>",
"0xe89065e2db751b0953f511f437edb4a977b64681",
"0xe89065e2db751b0953f511f437edb4a977b64681",
"0xd68be4e9857be05ffbe92afea69633e68772a25e",
"0xd68be4e9857be05ffbe92afea69633e68772a25e",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"0xa23b45ff8f3eb25397296765498ab62208fec971",
"0xa23b45ff8f3eb25397296765498ab62208fec971",
"0xba21325681ffd7d623993a2a564f6390654e2948",
"0xba21325681ffd7d623993a2a564f6390654e2948",
"<KEY>",
"0x969de568df4cec02e682acf75d7ed9f048de3aba",
"0x0a38c3a976b169574bd16412b654c1ee0db92e1b",
"0x0a38c3a976b169574bd16412b654c1ee0db92e1b",
"0xc70f6273f7edf28f28810ea0b8dec35eb00bca81",
"0xc70f6273f7edf28f28810ea0b8dec35eb00bca81",
"0xcaf3cff40afe8f65901de241a7835c1b98688566",
"<KEY>",
"0x969de568df4cec02e682acf75d7ed9f048de3aba",
"<KEY>",
"<KEY>",
"0xd07Ee1049929E97680F7Bb176721ea1E6114f42c",
"0xd07Ee1049929E97680F7Bb176721ea1E6114f42c",
"<KEY>",
"<KEY>",
"0xed46a40c088D11546Eb4811e565E88A03ae8a07c",
"0xed46a40c088D11546Eb4811e565E88A03ae8a07c",
"0x986F240a648D8F7b2ef80f24d7017c2E6C1d871d",
"0x986F240a648D8F7b2ef80f24d7017c2E6C1d871d",
"0x027Ffd3c119567e85998f4E6B9c3d83D5702660c",
"0x027Ffd3c119567e85998f4E6B9c3d83D5702660c",
];
|
breeze2/async-task-pool
|
src/index.ts
|
export type ITask<R = any> = (...args: any[]) => Promise<R>
export interface IAsyncTaskOptions {
args: any[]
resolve: (value?: unknown) => void
reject: (reason?: any) => void
}
export default class AsyncTaskThrottle<S extends ITask> {
public static create<T extends ITask>(task: T, size?: number, max?: number) {
const throttle = new AsyncTaskThrottle(task, size, max)
function asyncTask(...args: any[]) {
return new Promise((resolve, reject) => {
throttle.push({
args,
reject,
resolve,
})
})
}
return asyncTask as T
}
private _queue: IAsyncTaskOptions[] = []
private _queueLength: number
private _workerCount: number
private _task: S
private _workingCount: number
public constructor(task: S, workerCount?: number, queueLength?: number) {
this._task = task
this._workerCount = workerCount || 6
this._queueLength = queueLength || Infinity
this._workingCount = 0
}
public getWorkingCount() {
return this._workingCount
}
public create() {
const asyncTask = (...args: any[]) => {
return new Promise((resolve, reject) => {
this.push({
args,
reject,
resolve,
})
})
}
return asyncTask as S
}
public push(options: IAsyncTaskOptions) {
if (this._queue.length < this._queueLength) {
this._queue.push(options)
this.work()
} else {
options.reject(new Error('It is exceeding load.'))
}
}
private work() {
if (this._workingCount < this._workerCount) {
const options = this._queue.shift()
if (options) {
this._workingCount++
this._task(...options.args)
.then(value => {
options.resolve(value)
})
.catch(error => {
options.reject(error)
})
.then(() => {
this._workingCount--
this.work()
})
}
}
}
}
|
breeze2/async-task-pool
|
src/tests/index.ts
|
import { spawn, SpawnOptionsWithoutStdio } from 'child_process'
import AsyncTaskThrottle from '../index'
describe('AsyncTaskThrottle Testing', () => {
function execute(
command: string,
args?: string[],
options?: SpawnOptionsWithoutStdio
) {
return new Promise<string>((resolve, reject) => {
const proc = spawn(command, args, options)
let info = ''
let error = ''
proc.stdout.on('data', (data: string) => {
info += data
})
proc.stderr.on('data', (data: string) => {
error += data
})
proc.on('close', (code: number) => {
if (code !== 0 && error !== '') {
// console.error(command, args, error)
return reject(new Error(error))
}
// console.info(command, args, info)
return resolve(info)
})
})
}
function sleep(sec: number) {
return new Promise(resolve => setTimeout(resolve, sec * 1000))
}
it('node version x100', async () => {
const times = 100
const size = 6
const task = () => execute('node', ['--version'])
const throttleTask = AsyncTaskThrottle.create(task, size)
const list = Array(times)
.fill(0)
.map(() => throttleTask())
const results = await Promise.all(list)
expect(results.every(result => result === results[0])).toBe(true)
})
it('exceeding load', async () => {
const size = 6
const task = () => execute('node', ['--version'])
const throttleTask = AsyncTaskThrottle.create(task, size, -1)
try {
await throttleTask()
expect(1).toBe(0)
} catch (error) {
expect(error.message).toBe('It is exceeding load.')
}
})
it('check working count', async () => {
const times = 24
const size = 8
const task = () => sleep(1)
const throttle = new AsyncTaskThrottle(task, size)
const throttleTask = throttle.create()
const list = Array(times)
.fill(0)
.map(() => throttleTask())
const timeId = setInterval(() => {
const count = throttle.getWorkingCount()
if (count === 0) {
clearInterval(timeId)
} else {
expect(count).toBeLessThanOrEqual(size)
}
}, 400)
const results = await Promise.all(list)
expect(results.every(result => result === results[0])).toBe(true)
})
it('check resolve and reject', async () => {
let flag = true
let successCount = 0
let failCount = 0
const times = 24
const task = () =>
new Promise((resolve, reject) => {
if (flag) {
flag = false
return resolve()
} else {
flag = true
return reject()
}
})
const throttleTask = AsyncTaskThrottle.create(task)
for (let i = 0; i < times; i++) {
await throttleTask()
.then(() => successCount++)
.catch(() => failCount++)
}
expect(successCount).toBe(failCount)
})
})
|
charlzyx/mark
|
plugin/index.ts
|
<reponame>charlzyx/mark<filename>plugin/index.ts
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-console */
import fs from 'fs'
import path from 'path'
import type { Root, Element } from 'hast'
import type { Plugin, CompilerFunction } from 'unified'
import type { Plugin as VitePlugin } from 'vite'
const cacheCD = path.resolve(process.cwd(), './.cache', '.livingmark')
const writeCacheFile = (filename: string, content: string) => {
if (!fs.existsSync(cacheCD))
fs.mkdirSync(cacheCD, { recursive: true })
fs.writeFileSync(path.resolve(cacheCD, filename), content, 'utf-8')
}
type Node = Root|Root['children'][number]
export type Options = {
resolveRender: string
ref: any
highlighter: any
}
const rehypeVueify: Plugin = function(config: Options) {
const ref = config.ref
let democount = 0
let fileHeader = config?.resolveRender || `
const _resolveRender = ({ type, tagName }: any) => tagName || type;
const stringify = (s: string) => s
.replace(/__SCRIPT__/g, 'script')
.replace(/__TEMPLATE__/g, 'template')
.replace(/__LL__/g, '{{')
.replace(/__RR__/g, '}}')
`
const safe = (s: string) => {
return s
? `stringify(${JSON.stringify(s)
.replace(/script/g, '__SCRIPT__')
.replace(/template/g, '__TEMPLATE__')
.replace(/{{/g, '__LL__')
.replace(/}}/g, '__RR__')
})`
: s
}
const compiler: CompilerFunction<Node, string> = (node) => {
let code = safe((node as any).value)
// console.log('node.type', node.type, JSON.stringify(node, null, 2))
if (node.type === 'element') {
const child = node.children
const subCode = Array.isArray(child)
? `, [${child.map(n => compiler(n, {} as any)).join(',\n')}]`
: ''
const liteNode = { ...node, children: undefined }
code = `
h(_resolveRender(${JSON.stringify(liteNode, null, 2)}),
${JSON.stringify(node.properties, null, 2)}
${subCode})
`
if (node.tagName === 'pre') {
const maybeCode = node.children[0] as Element
if (maybeCode) {
const isCodePre = maybeCode.tagName === 'code'
const classList = (maybeCode?.properties?.className || []) as string[]
const langclass = classList.find(x => x.startsWith('language'))
const codeMeta = isCodePre ? maybeCode.data?.meta as string || '' : ''
const codeLang = langclass?.replace('language-', '') || 'bash'
const codeTxt = (maybeCode?.children?.[0] as any)?.value
// console.log(JSON.stringify(maybeCode, null, 2))
const isCodeAlive = codeMeta?.includes('live')
// TODO: 高亮
// const hilight = codeTxt
code = `h('pre', {}, [h('code', ${JSON.stringify(maybeCode.properties)}, [${safe(codeTxt)}])])`
if (isCodeAlive) {
const demoId = `demo${democount++}`
ref.current[demoId] = codeTxt
fileHeader = `import ${demoId} from '@livingmark/${demoId}.${codeLang}'; ${fileHeader}`
writeCacheFile(`${demoId}.${codeLang}`, codeTxt)
code = `h('div', { class: 'living-code' }, [
h('div', { class: 'livingcode' }, [ h(${demoId}, {}, []) ]),
${code},
])`
}
}
}
// if (node.tagName === 'code') {
// // console.log('---------------------')
// // console.log(JSON.stringify(node, null, 2))
// // console.log('---------------------')
// const classList = (node?.properties?.className || []) as string[]
// const langclass = classList.find(x => x.startsWith('language'))
// const lang = langclass?.replace('language-', '')
// const { meta = '' } = (node.data || {}) as any
// if (meta.includes('live')) {
// const demoId = `demo${democount++}`
// const sourceCode = (node.children[0] as any).value
// ref.current[demoId] = sourceCode
// fileHeader = `import ${demoId} from '@livingmark/${demoId}.${lang}'; ${fileHeader}`
// writeCacheFile(`${demoId}.${lang}`, sourceCode)
// code = `h('div', { class: 'livingmark-preview' }, [
// h('div', { class: 'livingcode' }, [ h(${demoId}, {}, []) ]),
// h('pre', { class: 'sourcecode' }, [ ${code} ]),
// ])`
// }
// }
}
if (node.type === 'root') {
const child = node.children
const subCode = Array.isArray(child)
? `[${child.map(n => compiler(n, {} as any)).join(',\n')}]`
: ''
const body = `h('div', { class: 'markdown' }, ${subCode});`
return `
<template>
<div class="markdown text-left" >
<vuemd />
</div>
</template>
<script lang="ts">
import { h } from 'vue';
${fileHeader}\n
export default {
components: {
vuemd: {
render() {
return ${body}
}
}
}
}
</script>
`
}
return code
}
Object.assign(this, { Compiler: compiler })
}
// const run = async() => {
// const file = await unified()
// .use(remarkParse)
// .use(remarkRehype)
// // .use(rehypeDocument)
// .use(rehypeFormat)
// .use(rehypeVueify)
// .use(rehypeStringify)
// .process(mdx)
// // console.log(file.value)
// }
// run()
export const VitePluginMark = () => {
const memo = {
processer: null as any,
demos: {} as any,
}
const loader = async() => {
const unified = await import('unified').then(mod => mod.unified)
const remarkParse = await import('remark-parse').then(mod => mod.default)
const remarkFrontmatter = await import('remark-frontmatter').then(mod => mod.default)
const remarkRehype = await import('remark-rehype').then(mod => mod.default)
const pipeline = unified()
.use(remarkParse)
.use(remarkFrontmatter)
.use(remarkRehype)
// .use(rehypeDocument)
// .use(rehypeFormat)
.use([[rehypeVueify, { ref: { current: memo.demos } }]])
return pipeline
}
loader().then((p) => {
memo.processer = p
})
const virtualModulePrefix = 'livingmark'
const resolvedVirtualModuleIdPrefix = `\0${virtualModulePrefix}`
return [{
name: 'vite:livingmark-transformer',
enforce: 'pre',
config() {
return {
resolve: {
alias: {
'@livingmark/': `${cacheCD}/`,
},
},
}
},
// async load(id) {
// if (/livingmark/.test(id)) {
// const key = id
// .replace(`${resolvedVirtualModuleIdPrefix}/`, '')
// .replace(/\..*$/, '')
// const code = memo.demos[key] || ''
// // const ret = await vitevueplugin.transform.bind(this)(code, id)
// // console.log({ id, vitevueplugin, demos: memo.demos, code, key, ret })
// return code
// }
// },
transform(raw: string, id: string) {
if (/\.md$/.test(id)) {
try {
const vfile = memo.processer.processSync(raw)
const code = vfile.value
// fs.writeFileSync(path.resolve(__dirname, './code.vue'), code, 'utf-8')
return code
// return markdownToVue(id, raw)
}
catch (e: any) {
this.error(e)
}
}
},
async handleHotUpdate(ctx) {
if (!/\.md$/.test(ctx.file))
return
const defaultRead = ctx.read
ctx.read = async function() {
const vfile = memo.processer.processSync(await defaultRead())
return vfile.value
// (ctx.file, await defaultRead())
}
},
} as VitePlugin,
{
name: 'vite:livingmark-vfilesystem',
enforce: 'pre',
// config() {
// return {
// alias: {
// '@livingmark': cacheCD,
// },
// }
// },
// resolveId(id) {
// if (/@livingmark/.test(id))
// return `\0${id}`
// },
// load(id) {
// if (/@livingmark/.test(id)) {
// const key = id
// .replace(`${resolvedVirtualModuleIdPrefix}/`, '')
// .replace(/\..*$/, '')
// console.log({ key, id, demos: memo.demos })
// const code = memo.demos[key] || ''
// return code
// }
// },
// transform(raw: string, id: string) {
// if (/^livingmark/.test(id)) {
// try {
// const code = vueplugin.transform()
// return code
// }
// catch (e: any) {
// this.error(e)
// }
// }
// },
} as VitePlugin,
]
}
|
Himenon/dependents-view
|
src/infra/index.ts
|
import * as LocalStorage from "./LocalStorage/Repository";
import * as Parser from "./Parser";
import * as QueryParams from "./QueryParams";
export { LocalStorage, Parser, QueryParams };
|
Himenon/dependents-view
|
src/container/DependencyTableList/Container.tsx
|
<reponame>Himenon/dependents-view
import { DependencyTableList } from "@app/component";
import { Store } from "./Store";
export const generateProps = (store: Store): DependencyTableList.Props | undefined => {
if (!store) {
return undefined;
}
const library = store.library;
return {
packageDetail: {
name: {
href: library.source.url,
children: library.package.name || "not selected",
},
version: {
children: library.package.version,
},
description: {
children: library.package.description,
},
repository: {
href: library.repo.url,
children: library.repo.fullName,
},
},
dependenciesTable: {
noDependenciesText: {
children: "no dependencies",
},
rows: library.dependencies.map(dep => {
return {
name: {
children: dep.package.name,
href: dep.source.url,
},
version: {
children: dep.package.version,
},
branch: {
children: dep.repo.branch,
},
repo: {
href: dep.repo.url,
children: dep.repo.name,
},
required: {
children: dep.required,
},
};
}),
},
devDependenciesTable: {
noDependenciesText: {
children: "no devDependencies",
},
rows: library.devDependencies.map(dep => {
return {
name: {
children: dep.package.name,
href: dep.source.url,
},
version: {
children: dep.package.version,
},
branch: {
children: dep.repo.branch,
},
repo: {
href: dep.repo.url,
children: dep.repo.name,
},
required: {
children: dep.required,
},
};
}),
},
};
};
|
Himenon/dependents-view
|
src/domain/App/State.ts
|
<filename>src/domain/App/State.ts
import { DependencySet, View } from "@app/interface";
export interface State {
originDataSet: DependencySet;
sideBarMenu: View.Menu;
pageMenu: View.Menu;
displayLibrary: View.Library | undefined;
searchParams: View.SearchParams;
pageParams: View.PageParams;
}
export const DEFAULT_STATE: State = {
originDataSet: {
meta: {
updatedAt: "",
},
libraries: [],
},
sideBarMenu: { items: [] },
pageMenu: { items: [] },
displayLibrary: undefined,
searchParams: {},
pageParams: {},
};
|
Himenon/dependents-view
|
src/component/SideNavigation/SideNavigation.tsx
|
<reponame>Himenon/dependents-view
import * as React from "react";
import { classNames } from "@app/style";
import { Link, LinkProps } from "@primer/components";
import * as DetailLink from "../DetailLink/DetailLink";
export interface SideNavigationProps {
heading: LinkProps;
searchInput: JSX.IntrinsicElements["input"];
detailLinks: DetailLink.Props[];
}
export const SideNavigation = ({ heading, searchInput, detailLinks }: SideNavigationProps) => {
return (
<aside className={classNames("bg-gray-light border p-3 position-fixed")} style={{ width: 360, height: "100%" }}>
<h5 className={classNames("text-gray mb-2 pb-1 border-bottom")}>
<Link {...heading} />
</h5>
<input className={classNames("input-block form-control")} {...searchInput} style={{ marginBottom: "0.5em" }} />
<nav className={classNames("SideNav overflow-y-scroll")} style={{ height: "80%" }}>
{detailLinks.map((detailLink, idx) => {
return <DetailLink.Component key={`side-nav-${idx}`} {...detailLink} />;
})}
</nav>
</aside>
);
};
export { SideNavigationProps as Props, SideNavigation as Component };
|
Himenon/dependents-view
|
src/domain/App/Action.ts
|
import * as React from "react";
import { State } from "./State";
export interface UpdateSearchParams {
type: "UPDATE_SEARCH_PARAMS";
searchParams: State["searchParams"];
}
export interface UpdatePageParams {
type: "UPDATE_PAGE_PARAMS";
pageParams: State["pageParams"];
}
export type ActionTypes = UpdateSearchParams | UpdatePageParams;
export type Dispatch = React.Dispatch<ActionTypes>;
|
Himenon/dependents-view
|
src/component/TopPage/TopPage.tsx
|
import * as React from "react";
import { BaseStyles } from "@primer/components";
import * as HeaderNavigation from "../HeaderNavigation/HeaderNavigation";
export interface TopPageProps {
headerNavigation: HeaderNavigation.Props;
}
export const TopPage = ({ headerNavigation }: TopPageProps) => {
return (
<BaseStyles>
<HeaderNavigation.Component {...headerNavigation} />
</BaseStyles>
);
};
export { TopPageProps as Props, TopPage as Component };
|
Himenon/dependents-view
|
src/component/DependencyTableList/DependencyTableList.tsx
|
import * as React from "react";
import * as DependencyTable from "../DependencyTable/DependencyTable";
import * as PackageDetail from "../PackageDetail/PackageDetail";
import { Box } from "@primer/components";
import { classNames } from "@app/style";
export interface DependencyTableListProps {
packageDetail: PackageDetail.Props;
dependenciesTable: DependencyTable.Props;
devDependenciesTable: DependencyTable.Props;
}
export const DependencyTableList = ({ packageDetail, dependenciesTable, devDependenciesTable }: DependencyTableListProps) => {
return (
<Box m={4}>
<PackageDetail.Component {...packageDetail} />
<Box key="dependencies" className={classNames("b-2")}>
<div className={classNames("Subhead Subhead--spacious")}>
<div className={classNames("Subhead-heading")}>dependencies</div>
</div>
<DependencyTable.Component {...dependenciesTable} />
</Box>
<Box key="devDependencies">
<div className={classNames("Subhead Subhead--spacious")}>
<div className={classNames("Subhead-heading")}>devDependencies</div>
</div>
<DependencyTable.Component {...devDependenciesTable} />
</Box>
</Box>
);
};
export { DependencyTableListProps as Props, DependencyTableList as Component };
|
Himenon/dependents-view
|
src/domain/Ranking/State.ts
|
import { RankingDataSet } from "@app/interface";
export interface State {
originDataSet: RankingDataSet;
displayDataSet: RankingDataSet;
}
export const DEFAULT_STATE: State = {
originDataSet: {
list: [],
},
displayDataSet: {
list: [],
},
};
|
Himenon/dependents-view
|
src/component/PackageDetail/PackageDetail.tsx
|
<filename>src/component/PackageDetail/PackageDetail.tsx<gh_stars>1-10
import * as React from "react";
import { classNames } from "@app/style";
import { Box, Heading, Link, LinkProps, Text, TextProps } from "@primer/components";
interface PackageDetailProps {
name: LinkProps;
version: TextProps;
description: TextProps;
repository: LinkProps;
}
const PackageDetail = ({ name, version, description, repository }: PackageDetailProps) => {
return (
<>
<Heading mb={2}>
<Link {...name} target="_blank" />
</Heading>
<Box key="dependencies" className={classNames("b-2")}>
<div className={classNames("Subhead Subhead--spacious")}>
<div className={classNames("Subhead-heading")}>package detail</div>
</div>
<Box className={classNames("markdown-body")}>
<dl>
<dt>Version</dt>
<dd>
<Text {...version} />
</dd>
<dt>Description</dt>
<dd>
<Text {...description} />
</dd>
<dt>Repository</dt>
<dd>
<Link {...repository} target="_blank" />
</dd>
</dl>
</Box>
</Box>
</>
);
};
export { PackageDetailProps as Props, PackageDetail as Component };
|
Himenon/dependents-view
|
src/domain/Ranking/Reducer.ts
|
<reponame>Himenon/dependents-view
import { ActionTypes } from "./Action";
import { DEFAULT_STATE, State } from "./State";
import { filterExactlyPackageName } from "./Filter";
export const reducer = (state: State, action: ActionTypes): State => {
switch (action.type) {
case "UPDATE_SEARCH_PARAMS": {
const displayDataSet = filterExactlyPackageName(action.searchParams.packageName, state.originDataSet);
return { ...state, displayDataSet };
}
default:
return state;
}
};
export type Reducer = [typeof reducer, State];
export const createReducer = (originDataSet: State["displayDataSet"]): Reducer => {
const state = { ...DEFAULT_STATE, originDataSet, displayDataSet: originDataSet };
return [reducer, state];
};
|
Himenon/dependents-view
|
src/container/TopPage/Container.tsx
|
import * as React from "react";
import { TopPage } from "@app/component";
const generateProps = (): TopPage.Props => {
return {
headerNavigation: {
links: [
{
to: "/",
children: "TOP",
},
{
to: "/packages",
children: "package list",
},
{
to: "/ranking",
children: "ranking",
},
],
},
};
};
export const Container = () => {
return <TopPage.Component {...generateProps()} />;
};
|
Himenon/dependents-view
|
src/container/SideNavigation/Container.tsx
|
import { Store } from "./Store";
import { SideNavigation } from "@app/component";
import { QueryParams } from "@app/infra";
export const generateProps = (store: Store): SideNavigation.Props => {
return {
heading: {
children: "Package List",
to: "/packages",
onClick: () => {
store.updatePageParams(undefined);
},
},
detailLinks: store.menu.items.map(lib => {
const params = QueryParams.generateBaseQueryParams();
const queryParams = "?" + QueryParams.appendQueryParams(params);
const to = "/packages/" + lib.package.name + queryParams;
return {
link: {
to,
children: lib.package.name,
replace: false,
onClick: () => {
store.updatePageParams(lib.package.name);
},
},
};
}),
searchInput: {
type: "text",
placeholder: "search package name",
"aria-label": "search package name",
onChange: event => {
store.updateSearchParams(event.currentTarget.value);
},
},
};
};
|
Himenon/dependents-view
|
src/container/DependencyTableList/Store.ts
|
<gh_stars>1-10
import * as Domain from "@app/domain";
export const generateStore = (domainStores: Domain.App.Stores) => {
const pageParams = domainStores.app.state.pageParams;
const library = domainStores.app.state.displayLibrary;
if (!library) {
return undefined;
}
// 1つに絞り込めた場合でもpageParamsのnameと異なる場合は非表示にする
if (pageParams.name !== library.package.name) {
return undefined;
}
return {
library,
};
};
export type Store = ReturnType<typeof generateStore>;
|
Himenon/dependents-view
|
scripts/makePackageRanking.ts
|
import * as Constants from "./Constants";
import { RankingDataSet, ExtractPackageJson, GitHubRepository } from "@app/interface";
import { PackageJson } from "type-fest";
import * as fs from "fs";
import * as path from "path";
export interface Store {
details: Array<{
packageJson: PackageJson;
repository: GitHubRepository;
}>;
}
export interface ResultItem {
package: PackageJson;
repository: GitHubRepository;
required: string;
usageType: "dep" | "dev-dep";
}
export interface Result {
[name: string]: Array<ResultItem>;
}
export const getJson = (filename: string) => {
return JSON.parse(fs.readFileSync(filename, { encoding: "utf-8" }));
};
const main = async () => {
const store: Store = {
details: [],
};
const result: Result = {};
const ranking: RankingDataSet = {
list: [],
};
console.log(ranking);
const allPackages: Set<string> = new Set();
const details: ExtractPackageJson = getJson(Constants.PKG_DETAILS);
details.repositories.map(async detail => {
const fullPath = path.join(Constants.SAVE_DIR, detail.source.filename);
const pkg: PackageJson = getJson(fullPath);
store.details.push({
packageJson: pkg,
repository: detail,
});
});
store.details.forEach(detail => {
const pkg = detail.packageJson;
const dep = pkg.dependencies || {};
const devDep = pkg.devDependencies || {};
Object.keys(dep).forEach(name => {
const item: ResultItem = {
package: pkg,
repository: detail.repository,
required: dep[name],
usageType: "dep",
};
if (name in result) {
result[name].push(item);
} else {
result[name] = [item];
}
allPackages.add(name);
});
Object.keys(devDep).forEach(name => {
const item: ResultItem = {
package: pkg,
repository: detail.repository,
required: devDep[name],
usageType: "dev-dep",
};
if (name in result) {
result[name].push(item);
} else {
result[name] = [item];
}
allPackages.add(name);
});
});
Object.entries(result).forEach(([name, items]) => {
ranking.list.push({
packageName: name,
usageLibraries: items.map(item => {
return {
packageName: item.package.name || "",
required: item.required,
usageType: item.usageType,
repo: {
name: item.repository.repo.fullName,
url: item.repository.repo.url,
},
source: {
url: item.repository.source.url,
path: item.repository.source.path,
},
};
}),
});
});
ranking.list = ranking.list
.sort((a, b) => {
return a.usageLibraries.length > b.usageLibraries.length ? -1 : 1;
})
.map((item, idx) => {
return { ...item, rank: idx + 1 };
});
fs.writeFileSync(Constants.RANKING_DATA, JSON.stringify(ranking, null, 2), { encoding: "utf-8" });
console.log(`Save: ${Constants.RANKING_DATA}`);
};
main().catch(console.error);
|
Himenon/dependents-view
|
src/domain/App/index.ts
|
<filename>src/domain/App/index.ts
import { DependencySet, View } from "@app/interface";
import { State } from "./State";
import { Reducer, createReducer } from "./Reducer";
import { Dispatch } from "./Action";
export interface Reducers {
app: (hooks: View.Hooks) => Reducer;
}
export interface Stores {
app: {
state: State;
dispatch: Dispatch;
};
}
export const createReducers = (dataSet: DependencySet, pageParams: State["pageParams"], searchParams?: State["searchParams"]): Reducers => {
return {
app: createReducer(dataSet, pageParams, searchParams),
};
};
|
Himenon/dependents-view
|
src/domain/Ranking/Action.ts
|
<filename>src/domain/Ranking/Action.ts
import * as React from "react";
export interface UpdateSearchParams {
type: "UPDATE_SEARCH_PARAMS";
searchParams: {
packageName?: string;
};
}
export type ActionTypes = UpdateSearchParams;
export type Dispatch = React.Dispatch<ActionTypes>;
|
Himenon/dependents-view
|
src/component/Page/Page.tsx
|
import * as React from "react";
import * as SideNavigation from "../SideNavigation/SideNavigation";
import * as LinkList from "../LinkList/LinkList";
import * as DependencyTableList from "../DependencyTableList/DependencyTableList";
import * as HeaderNavigation from "../HeaderNavigation/HeaderNavigation";
import { BaseStyles, Box } from "@primer/components";
import { classNames } from "@app/style";
interface PageProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
headerNavigation: HeaderNavigation.Props;
dependencyTableList?: DependencyTableList.Props;
linkList?: LinkList.Props;
sideNavigation: SideNavigation.Props;
}
const Page = ({ dependencyTableList, sideNavigation, linkList, headerNavigation, ...props }: PageProps) => {
return (
<BaseStyles>
<HeaderNavigation.Component {...headerNavigation} />
<Box className={classNames("border d-flex lex-wrap height-fit")}>
<SideNavigation.Component {...sideNavigation} />
<Box className={classNames("position-relative")} style={{ left: 360, width: "calc(100% - 360px)" }}>
<Box className={classNames("p-5 border flex-auto position-relative overflow-y-hidden")}>
{linkList && <LinkList.Component {...linkList} />}
{dependencyTableList && <DependencyTableList.Component {...dependencyTableList} />}
{!linkList && !dependencyTableList && "Not found."}
</Box>
</Box>
</Box>
</BaseStyles>
);
};
export { PageProps as Props, Page as Component };
|
Himenon/dependents-view
|
src/component/HeaderNavigation/HeaderNavigation.tsx
|
import * as React from "react";
import { classNames } from "@app/style";
import { Link, LinkProps } from "react-router-dom";
export interface HeaderNavigationProps {
links: LinkProps[];
}
export const HeaderNavigation = ({ links }: HeaderNavigationProps) => {
return (
<div className={classNames("Header")}>
{links.map((link, idx) => (
<div key={`${idx}.${link.to}`} className={classNames("Header-item")}>
<Link className={classNames("text-white")} {...link} />
</div>
))}
</div>
);
};
export { HeaderNavigationProps as Props, HeaderNavigation as Component };
|
Himenon/dependents-view
|
src/infra/QueryParams.ts
|
import * as querystring from "querystring";
import { View } from "@app/interface";
/**
* @returns key1=value1&key2=value2
*/
export const appendQueryParams = (query: View.PageQueryParams): string => {
const searchParams = new URLSearchParams(window.location.search);
const params = {};
searchParams.forEach((v, k) => {
params[k] = v;
});
Object.entries(query).forEach(([key, value]) => {
if (!value || value === "") {
delete params[key];
} else {
params[key] = value;
}
});
return querystring.stringify(params);
};
export const generateBaseQueryParams = (): View.PageQueryParams => {
const searchParams = new URLSearchParams(window.location.search);
return {
q: searchParams.get("q") || undefined,
hostname: undefined,
owner: undefined,
repo: undefined,
path: undefined,
};
};
|
Himenon/dependents-view
|
scripts/makeDependencyData.ts
|
<reponame>Himenon/dependents-view
import * as fs from "fs";
import * as path from "path";
import { PackageJson } from "type-fest";
import { ExtractPackageJson, GitHubRepository, OriginDependencyData, DependencySet } from "@app/interface";
import * as Constants from "./Constants";
export interface Detail {
packageJson: PackageJson;
repository: GitHubRepository;
}
export interface Store {
details: Detail[];
}
export const getDeps = (pkgJsonName: string, details: Detail[], type: "dependencies" | "devDependencies"): OriginDependencyData[] => {
return details
.filter(detail => {
// 自身は排除
if (pkgJsonName === detail.packageJson.name) {
return false;
}
const dep: PackageJson["dependencies"] = detail.packageJson[type];
if (dep) {
return Object.keys(dep).includes(pkgJsonName);
}
return false;
})
.map(detail => {
const dep: PackageJson["dependencies"] = detail.packageJson[type];
if (!dep) {
throw new Error("dependenciesがだめ");
}
return {
name: detail.packageJson.name || "",
required: dep[pkgJsonName] || "",
url: detail.repository.source.url,
};
});
};
export const getJson = (filename: string) => {
return JSON.parse(fs.readFileSync(filename, { encoding: "utf-8" }));
};
const main = async () => {
const store: Store = {
details: [],
};
const details: ExtractPackageJson = getJson(Constants.PKG_DETAILS);
details.repositories.map(async detail => {
const fullPath = path.join(Constants.SAVE_DIR, detail.source.filename);
const pkg: PackageJson = getJson(fullPath);
store.details.push({
packageJson: pkg,
repository: detail,
});
});
const dependencySet: DependencySet = {
meta: {
updatedAt: new Date().toISOString(),
},
libraries: [],
};
store.details.forEach(detail => {
const repo = detail.repository;
const pkgJson = detail.packageJson;
const pkgJsonName = pkgJson.name;
if (!pkgJsonName || pkgJsonName === "") {
return;
}
dependencySet.libraries.push({
package: {
name: pkgJsonName,
version: pkgJson.version || "",
description: pkgJson.description || "",
},
dependencies: getDeps(pkgJsonName, store.details, "dependencies"),
devDependencies: getDeps(pkgJsonName, store.details, "devDependencies"),
...repo,
});
});
fs.writeFileSync(Constants.DEPS_DATA, JSON.stringify(dependencySet, null, 2), { encoding: "utf-8" });
console.log(`Save: ${Constants.DEPS_DATA}`);
};
main().catch(console.error);
|
Himenon/dependents-view
|
src/container/index.ts
|
<gh_stars>1-10
import * as DepsTable from "./DependencyTableList";
export { DepsTable };
import * as Page from "./Page";
export { Page };
import * as RankingPage from "./RankingPage";
export { RankingPage };
import * as TopPage from "./TopPage";
export { TopPage };
import * as SideNavigation from "./SideNavigation";
export { SideNavigation };
|
Himenon/dependents-view
|
src/domain/App/Query.ts
|
import { State } from "./State";
import { filterIncludedPackageName, filterExactlyPackageName, filterRepoName } from "./Filter";
export const searchFromInput = (originDataSet: State["originDataSet"], searchParams: State["searchParams"]) => {
return filterRepoName(searchParams.repo, filterIncludedPackageName(searchParams.name, originDataSet));
};
export const searchFromPageLoad = (originDataSet: State["originDataSet"], searchParams: State["searchParams"]) => {
return filterRepoName(searchParams.repo, filterExactlyPackageName(searchParams.name, originDataSet));
};
|
Himenon/dependents-view
|
src/container/SideNavigation/Store.ts
|
import * as Domain from "@app/domain";
export const generateStore = (domainStores: Domain.App.Stores) => {
return {
menu: domainStores.app.state.sideBarMenu,
searchParams: domainStores.app.state.searchParams,
updatePageParams: (name: string | undefined) => {
domainStores.app.dispatch({ type: "UPDATE_PAGE_PARAMS", pageParams: { name } });
},
updateSearchParams: (name: string | undefined) => {
const searchParams = { name };
domainStores.app.dispatch({ type: "UPDATE_SEARCH_PARAMS", searchParams });
},
};
};
export type Store = ReturnType<typeof generateStore>;
|
Himenon/dependents-view
|
scripts/makeMockDependencyData.ts
|
import * as fs from "fs";
import * as path from "path";
import { DependencySet, RankingDataSet } from "@app/interface";
import * as Constants from "./Constants";
const main = async () => {
const dependencySet: DependencySet = {
meta: {
updatedAt: new Date().toISOString(),
},
libraries: [],
};
const rankingDataSet: RankingDataSet = {
list: [],
};
fs.mkdirSync(path.dirname(Constants.DEPS_DATA), { recursive: true });
fs.writeFileSync(Constants.DEPS_DATA, JSON.stringify(dependencySet, null, 2), { encoding: "utf-8" });
fs.writeFileSync(Constants.RANKING_DATA, JSON.stringify(rankingDataSet, null, 2), { encoding: "utf-8" });
};
main().catch(console.error);
|
Himenon/dependents-view
|
src/interface/view.d.ts
|
import { OriginLibrary, GitHubRepository, PackageJsonData, RepoData, SourceData } from "./common";
import { useHistory } from "react-router-dom";
export interface DetailDependencyData {
/** required version */
required: string;
/** From GitHubRepository */
source: SourceData;
repo: RepoData;
/** extends */
package: PackageJsonData;
}
export interface Library {
/** GitHubRepository */
repo: RepoData;
source: SourceData;
/** extends */
package: PackageJsonData;
dependencies: DetailDependencyData[];
devDependencies: DetailDependencyData[];
}
export type MenuItem = OriginLibrary;
export interface Menu {
items: MenuItem[];
}
export interface SearchParams {
/** package name */
name?: string;
/** hostname */
hostname?: string;
/** repository owner */
owner?: string;
/** repository name */
repo?: string;
/** repository file path */
path?: string;
}
export type PageParams = SearchParams;
export interface PageQueryParams extends SearchParams {
q?: string;
}
export interface Hooks {
history: ReturnType<typeof useHistory>;
}
|
Himenon/dependents-view
|
src/component/DependencyTable/DependencyTable.tsx
|
import * as React from "react";
import { classNames } from "@app/style";
import { Link, LinkProps, Text, TextProps } from "@primer/components";
export interface Row {
name: LinkProps; // package name
version: TextProps;
branch: TextProps; // check branch
repo: LinkProps; // check branch
required: TextProps; // using version
}
interface DependencyTableProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableElement>, HTMLTableElement> {
rows: Row[];
noDependenciesText: TextProps;
}
const DependencyTable = ({ rows, noDependenciesText, ...props }: DependencyTableProps) => {
if (rows.length === 0) {
return <Text {...noDependenciesText} />;
}
const TableHeader = (
<tr>
<th scope="col">Name</th>
<th scope="col">Required</th>
<th scope="col">Repository</th>
<th scope="col">Version</th>
<th scope="col">Branch</th>
</tr>
);
const TableData = rows.map((row, idx) => {
return (
<tr key={`dep-${idx}`}>
<td key="name">
<Link {...row.name} target="_blank" />
</td>
<td key="required">
<Text {...row.required} />
</td>
<td key="repo">
<Link {...row.repo} target="_blank" />
</td>
<td key="version">
<Text {...row.version} />
</td>
<td key="branch">
<Text {...row.branch} />
</td>
</tr>
);
});
return (
<div className={classNames("markdown-body")}>
<table {...props}>
<thead>{TableHeader}</thead>
<tbody>{TableData}</tbody>
</table>
</div>
);
};
export { DependencyTableProps as Props, DependencyTable as Component };
|
Himenon/dependents-view
|
src/component/RankingPage/RankingPage.tsx
|
<gh_stars>1-10
import * as React from "react";
import { BaseStyles, Box } from "@primer/components";
import { classNames } from "@app/style";
import { RankingDataSet } from "@app/interface";
import * as HeaderNavigation from "../HeaderNavigation/HeaderNavigation";
interface RankingPageProps {
headerNavigation: HeaderNavigation.Props;
dataSet: RankingDataSet;
searchInput: JSX.IntrinsicElements["input"];
}
const RankingPage = ({ headerNavigation, searchInput, dataSet }: RankingPageProps) => {
return (
<BaseStyles>
<HeaderNavigation.Component {...headerNavigation} />
<Box className={classNames("border d-flex lex-wrap height-fit markdown-body")}>
<Box className={classNames("position-relative")} style={{ marginLeft: 50, width: "calc(100% - 360px)" }}>
<Box style={{ marginBottom: "0.5em", marginTop: "0.5em" }}>
<h3>Search Package Name</h3>
<input className={classNames("input-block form-control")} {...searchInput} />
</Box>
<Box>
<h3>Package List</h3>
<table>
<thead>
<tr>
<td>Rank</td>
<td>PackageName</td>
<td>Detail</td>
</tr>
</thead>
<tbody>
{dataSet.list.map((item, idx) => {
return (
<tr key={`${item.packageName}-${idx}`}>
<td key="index">{item.rank}</td>
<td key="package-name">
<em>{item.packageName}</em>
</td>
<td key="detail">
<details className={classNames("details-reset mt-3")}>
<summary className={classNames("btn")}>
More {item.usageLibraries.length} using
<span className={classNames("dropdown-caret")} />
</summary>
<div className={classNames("border p-3 mt-2")}>
<table>
{item.usageLibraries.map((lib, idx2) => {
return (
<tr key={`${lib.packageName}-${idx2}`}>
<td>
<a href={lib.repo.url} target="_blank">
{lib.packageName}
</a>
</td>
<td>
<a href={lib.source.url} target="_blank">
{lib.required}
</a>
</td>
<td>{lib.usageType}</td>
</tr>
);
})}
</table>
</div>
</details>
</td>
</tr>
);
})}
</tbody>
</table>
</Box>
</Box>
</Box>
</BaseStyles>
);
};
export { RankingPageProps as Props, RankingPage as Component };
|
Himenon/dependents-view
|
src/component/LinkList/LinkList.tsx
|
<reponame>Himenon/dependents-view
import * as React from "react";
import { classNames } from "@app/style";
import { Box, Heading, HeadingProps } from "@primer/components";
import * as DetailLink from "../DetailLink/DetailLink";
export interface LinkListProps {
heading: HeadingProps;
links: DetailLink.Props[];
}
export const LinkList = ({ links, heading }: LinkListProps) => {
return (
<Box m={4}>
<Heading mb={2} {...heading} />
<div>
{links.map((link, idx) => {
return (
<div key={`link-list-${idx}`} className={classNames("col-4 float-left p-2")}>
<DetailLink.Component {...link} />
</div>
);
})}
</div>
</Box>
);
};
export { LinkListProps as Props, LinkList as Component };
|
Himenon/dependents-view
|
src/domain/App/Reducer.ts
|
import { View } from "@app/interface";
import { ActionTypes } from "./Action";
import { DEFAULT_STATE, State } from "./State";
import { generatePageMenu, convertLibrariesToDisplayLibrary, convertSearchParamToQueryParams } from "./Converter";
import { searchFromInput, searchFromPageLoad } from "./Query";
import { QueryParams } from "@app/infra";
import { uniqueMenuItem } from "./Filter";
export const reducer = (hooks: View.Hooks) => (state: State, action: ActionTypes): State => {
switch (action.type) {
case "UPDATE_SEARCH_PARAMS": {
const dataSet = searchFromInput(state.originDataSet, action.searchParams);
const pageMenu = generatePageMenu(dataSet);
const sideBarMenu = uniqueMenuItem(pageMenu);
const q = QueryParams.appendQueryParams({ q: convertSearchParamToQueryParams(action.searchParams) });
hooks.history.replace(`?${q}`);
return { ...state, sideBarMenu, pageMenu, searchParams: action.searchParams };
}
case "UPDATE_PAGE_PARAMS": {
const dataSet = searchFromPageLoad(state.originDataSet, action.pageParams);
const pageMenu = generatePageMenu(dataSet);
const displayLibrary = convertLibrariesToDisplayLibrary(action.pageParams, state.originDataSet.libraries);
return { ...state, pageMenu, displayLibrary, pageParams: action.pageParams };
}
default:
return state;
}
};
export type Reducer = [ReturnType<typeof reducer>, State];
export const createReducer = (
originDataSet: State["originDataSet"],
pageParams: State["pageParams"] = DEFAULT_STATE.pageParams,
searchParams: State["searchParams"] = DEFAULT_STATE.searchParams,
) => (hooks: View.Hooks): Reducer => {
// ページ用のクエリで検索
const dataSet = searchFromPageLoad(originDataSet, pageParams);
const pageMenu = generatePageMenu(dataSet);
// サイドメニュー用に検索
const dataSetForMenu = searchFromInput(originDataSet, searchParams);
const sideBarMenu = uniqueMenuItem(generatePageMenu(dataSetForMenu));
const displayLibrary = convertLibrariesToDisplayLibrary(pageParams, originDataSet.libraries);
const state: State = { ...DEFAULT_STATE, sideBarMenu, displayLibrary, originDataSet, pageParams, searchParams, pageMenu };
return [reducer(hooks), state];
};
|
Himenon/dependents-view
|
src/domain/Ranking/Filter.ts
|
import { RankingDataSet } from "@app/interface";
export const filterExactlyPackageName = (inputName: string | undefined, rankingDataSet: RankingDataSet): RankingDataSet => {
if (!inputName || inputName === "") {
return rankingDataSet;
}
const filterName = inputName.toUpperCase();
return {
list: rankingDataSet.list.filter(lib => lib.packageName.toUpperCase() === filterName),
};
};
|
Himenon/dependents-view
|
src/interface/common.d.ts
|
<gh_stars>1-10
export interface ExtractMeta {
hostname: string;
}
export interface GitHubRepository {
meta: ExtractMeta;
source: SourceData;
repo: RepoData;
}
export interface RepoData {
owner: string;
name: string;
fullName: string;
url: string;
branch: string;
}
export interface PackageJsonData {
name: string;
version: string;
description: string;
}
export interface SourceData {
filename: string;
path: string;
url: string;
}
export interface OriginDependencyData {
name: string;
required: string;
url: string;
}
export interface OriginLibrary {
/** GitHubRepository */
meta: ExtractMeta;
source: SourceData;
repo: RepoData;
/** extends */
package: PackageJsonData;
dependencies: OriginDependencyData[];
devDependencies: OriginDependencyData[];
}
|
Himenon/dependents-view
|
src/interface/index.d.ts
|
export * from "./common";
import { OriginLibrary, GitHubRepository, PackageJsonData, RepoData, SourceData } from "./common";
import * as View from "./view";
export { View };
export interface RankingPackageItem {
rank?: number;
packageName: string;
usageLibraries: Array<{
packageName: string;
required: string;
usageType: "dep" | "dev-dep";
repo: {
name: string;
url: string;
};
source: {
url: string;
path: string;
};
}>;
}
export interface RankingDataSet {
list: RankingPackageItem[];
}
export interface ExtractPackageJson {
createdAt: string;
repositories: GitHubRepository[];
}
export interface DependencySet {
meta: {
updatedAt: string;
};
libraries: OriginLibrary[];
}
|
Himenon/dependents-view
|
src/router/index.tsx
|
<filename>src/router/index.tsx
import React from "react";
import { Switch, Route, HashRouter as Router } from "react-router-dom";
import { RankingPage, Page, TopPage } from "@app/container";
export const AppRouter = () => {
return (
<Router hashType="noslash">
<Switch>
<Route key="/" path="/" exact={true} basename={process.env.PUBLIC_PATH}>
<TopPage.Container />
</Route>
<Route key="/packages/" path="/packages/:owner?/:name?" basename={process.env.PUBLIC_PATH}>
<Page.Container />
</Route>
<Route key="/ranking" path="/ranking" basename={process.env.PUBLIC_PATH}>
<RankingPage.Container />
</Route>
</Switch>
</Router>
);
};
|
Himenon/dependents-view
|
src/component/DetailLink/DetailLink.tsx
|
<filename>src/component/DetailLink/DetailLink.tsx
import * as React from "react";
import { classNames } from "@app/style";
import { Link, LinkProps } from "react-router-dom";
import { Text, TextProps } from "@primer/components";
export interface DetailLinkProps {
link: LinkProps;
detail?: TextProps;
}
export const DetailLink = ({ detail, link }: DetailLinkProps) => {
if (detail) {
const { children, ...props } = link;
return (
<Link className={classNames("SideNav-subItem")} {...props}>
<p>{children}</p>
<Text className={classNames("branch-name")} {...detail} />
</Link>
);
}
return <Link className={classNames("SideNav-subItem")} {...link} />;
};
export { DetailLinkProps as Props, DetailLink as Component };
|
Himenon/dependents-view
|
src/domain/index.ts
|
<gh_stars>1-10
import * as App from "./App";
export { App };
import * as Ranking from "./Ranking";
export { Ranking };
|
Himenon/dependents-view
|
src/domain/App/Validation.ts
|
<reponame>Himenon/dependents-view
import { View, OriginLibrary } from "@app/interface";
export const isViewLibrary = (displayLibrary: View.Library | OriginLibrary[] | undefined): displayLibrary is View.Library => {
if (!displayLibrary) {
return false;
}
if (Array.isArray(displayLibrary)) {
return false;
}
return true;
};
|
Himenon/dependents-view
|
src/container/Page/Container.tsx
|
<filename>src/container/Page/Container.tsx<gh_stars>1-10
import { DependencySet } from "@app/interface";
import { Parser } from "@app/infra";
import * as Domain from "@app/domain";
import * as React from "react";
import * as DependencyTableList from "../DependencyTableList";
import * as SidebarNavigation from "../SideNavigation";
import * as LinkList from "../LinkList";
import { generateStore, Store } from "./Store";
import { Page } from "@app/component";
import { useLocation, useParams, useHistory } from "react-router-dom";
const depsDataSet: DependencySet = require("@app/dataSet/deps.json");
const generateProps = (store: Store): Page.Props => {
return {
headerNavigation: {
links: [
{
to: "/",
children: "TOP",
},
{
to: "/packages",
children: "package list",
},
{
to: "/ranking",
children: "ranking",
},
],
},
dependencyTableList: DependencyTableList.generateProps(store.dependencyTableList),
sideNavigation: SidebarNavigation.generateProps(store.sideNavigation),
linkList: LinkList.generateProps(store.linkList),
};
};
const useQuery = () => {
return new URLSearchParams(useLocation().search);
};
export const Container = () => {
const query = useQuery();
const history = useHistory();
const { owner, name } = useParams();
const packageName = !!name ? [owner, name].join("/") : owner;
const repositoryOwner = query.get("owner") || undefined;
const hostname = query.get("hostname") || undefined;
const repo = query.get("repo") || undefined;
const path = query.get("path") || undefined;
const searchParams = Parser.parseStringSearchParams(query.get("q") || "");
const reducers = Domain.App.createReducers(depsDataSet, { name: packageName, hostname, owner: repositoryOwner, repo, path }, searchParams);
const createReducer = <T, S>([state, dispatch]: [T, S]): { state: T; dispatch: S } => ({ state, dispatch });
const domainStores: Domain.App.Stores = {
app: createReducer(React.useReducer(...reducers.app({ history }))),
};
const store = generateStore(domainStores);
return <Page.Component {...generateProps(store)} />;
};
|
Himenon/dependents-view
|
src/component/index.ts
|
import * as DependencyTable from "./DependencyTable/DependencyTable";
export { DependencyTable };
import * as Page from "./Page/Page";
export { Page };
import * as RankingPage from "./RankingPage/RankingPage";
export { RankingPage };
import * as TopPage from "./TopPage/TopPage";
export { TopPage };
import * as SideNavigation from "./SideNavigation/SideNavigation";
export { SideNavigation };
import * as LinkList from "./LinkList/LinkList";
export { LinkList };
import * as DependencyTableList from "./DependencyTableList/DependencyTableList";
export { DependencyTableList };
import * as PackageDetail from "./PackageDetail/PackageDetail";
export { PackageDetail };
|
Himenon/dependents-view
|
scripts/extractPackageJsonFromOrg.ts
|
import * as Octokit from "@octokit/rest";
import * as fs from "fs";
import * as path from "path";
import { ExtractPackageJson } from "@app/interface";
import * as Constants from "./Constants";
import * as url from "native-url";
const github = new Octokit({
baseUrl: Constants.GITHUB_BASE_URL,
// https://developer.github.com/v3/search/#rate-limit
auth: process.env.GITHUB_TOKEN,
});
export const getRepository = async (org: string) => {
// https://developer.github.com/v3/repos/
const list = await github.repos.listForOrg({
org,
per_page: 100,
});
const data: Octokit.ReposListForOrgResponseItem[] = list.data;
return data.filter(data => !data.archived && !Constants.EXCLUDE_REPOSITORY_FULL_NAMES.includes(data.full_name));
};
export const encodeBase64 = (base64string: string): string => {
return Buffer.from(base64string, "base64").toString();
};
export const searchPackageJson = async (repo: string) => {
console.log(`Search: ${repo}`);
const query = {
filename: "package.json",
repo: repo,
extension: "json",
};
const q: string = Object.entries(query)
.map(([k, v]) => `${k}:${v}`)
.join("+");
const list = await github.search.code({
q,
});
return list.data;
};
export const getPackageJsonData = async (owner: string, repo: string, filepath: string) => {
// https://developer.github.com/v3/repos/contents/
const content = await github.repos.getContents({
owner,
repo,
path: filepath,
});
return content.data;
};
const main = async () => {
const result: ExtractPackageJson = { createdAt: new Date().toISOString(), repositories: [] };
const promises = Constants.OWNERS.map(async owner => {
const repos = await getRepository(owner);
const promises2 = repos.map(async repo => {
const data = await searchPackageJson(repo.full_name);
const promises3 = data.items.map(async source => {
if (path.basename(source.path) !== "package.json") {
return;
}
const pkgJsonData = await getPackageJsonData(owner, repo.name, source.path);
if (Array.isArray(pkgJsonData)) {
throw new TypeError("配列なので受け付けません");
}
const basename = path.join(owner, repo.name, source.path);
const hostname = url.parse(repo.url).hostname;
if (!hostname) {
throw new Error("hostnameが見つかりません");
}
result.repositories.push({
meta: {
hostname,
},
source: {
filename: basename,
url: pkgJsonData.html_url,
path: pkgJsonData.path,
},
repo: {
owner: repo.owner.login,
name: repo.name,
url: repo.html_url,
fullName: repo.full_name,
branch: repo.default_branch,
},
});
const filename = path.join(Constants.SAVE_DIR, basename);
fs.mkdirSync(path.dirname(filename), { recursive: true });
const content = JSON.parse(encodeBase64(pkgJsonData.content || ""));
fs.writeFileSync(filename, JSON.stringify(content, null, 2), { encoding: "utf-8" });
});
return Promise.all(promises3);
});
return Promise.all(promises2);
});
await Promise.all(promises).then(() => {
console.log(`Save: ${Constants.PKG_DETAILS}`);
fs.writeFileSync(Constants.PKG_DETAILS, JSON.stringify(result, null, 2));
});
};
main().catch(console.error);
|
Himenon/dependents-view
|
src/container/LinkList/Container.tsx
|
<reponame>Himenon/dependents-view
import { Store } from "./Store";
import { LinkList } from "@app/component";
import { QueryParams } from "@app/infra";
import { View } from "@app/interface";
export const generateProps = (store: Store): LinkList.Props | undefined => {
if (!store) {
return undefined;
}
return {
heading: {
children: "Package List",
},
links: store.menu.items.map(lib => {
const params: View.PageQueryParams = QueryParams.generateBaseQueryParams();
if (store.canShowDetail) {
params["repo"] = lib.repo.name;
params["path"] = lib.source.path;
}
const queryParams = "?" + QueryParams.appendQueryParams(params);
const to = "/packages/" + lib.package.name + queryParams;
return {
link: {
to,
children: lib.package.name,
onClick: () => {
store.updatePageParams(
store.canShowDetail
? {
name: lib.package.name,
repo: lib.repo.name,
path: lib.source.path,
}
: {
name: lib.package.name,
},
);
},
},
detail: (store.canShowDetail || undefined) && {
children: lib.source.url,
},
};
}),
};
};
|
Himenon/dependents-view
|
src/domain/App/Filter.ts
|
import { DependencySet, View } from "@app/interface";
export const filterFileName = (inputFileName: string | undefined, dependencySet: DependencySet): DependencySet => {
if (!inputFileName) {
return dependencySet;
}
const filterFileName = inputFileName.toUpperCase();
return {
meta: dependencySet.meta,
libraries: dependencySet.libraries.filter(lib => lib.source.filename.toUpperCase().indexOf(filterFileName) > -1),
};
};
export const filterRepoName = (inputRepoName: string | undefined, dependencySet: DependencySet): DependencySet => {
if (!inputRepoName) {
return dependencySet;
}
const filterRepoName = inputRepoName.toUpperCase();
return {
meta: dependencySet.meta,
libraries: dependencySet.libraries.filter(lib => lib.repo.name.toUpperCase().indexOf(filterRepoName) > -1),
};
};
export const filterIncludedPackageName = (inputName: string | undefined, dependencySet: DependencySet): DependencySet => {
if (!inputName || inputName === "") {
return dependencySet;
}
const filterName = inputName.toUpperCase();
return {
meta: dependencySet.meta,
libraries: dependencySet.libraries.filter(lib => lib.package.name.toUpperCase().indexOf(filterName) > -1),
};
};
export const filterExactlyPackageName = (inputName: string | undefined, dependencySet: DependencySet): DependencySet => {
if (!inputName || inputName === "") {
return dependencySet;
}
const filterName = inputName.toUpperCase();
return {
meta: dependencySet.meta,
libraries: dependencySet.libraries.filter(lib => lib.package.name.toUpperCase() === filterName),
};
};
export const uniqueMenuItem = (menu: View.Menu): View.Menu => {
const items = menu.items.filter((elem, index, self) => self.findIndex(s => s.package.name === elem.package.name) === index);
return {
items,
};
};
|
Himenon/dependents-view
|
src/domain/Ranking/index.ts
|
<reponame>Himenon/dependents-view
import { State } from "./State";
import { Reducer, createReducer } from "./Reducer";
import { Dispatch } from "./Action";
export interface Reducers {
app: Reducer;
}
export interface Stores {
ranking: {
state: State;
dispatch: Dispatch;
};
}
export const createReducers = (dataSet: State["originDataSet"]): Reducers => {
return {
app: createReducer(dataSet),
};
};
|
Himenon/dependents-view
|
src/container/Page/Store.ts
|
import * as Domain from "@app/domain";
import * as DependencyTableList from "../DependencyTableList";
import * as SideNavigation from "../SideNavigation";
import * as LinkList from "../LinkList";
export const generateStore = (domainStores: Domain.App.Stores) => {
return {
dependencyTableList: DependencyTableList.generateStore(domainStores),
sideNavigation: SideNavigation.generateStore(domainStores),
linkList: LinkList.generateStore(domainStores),
};
};
export type Store = ReturnType<typeof generateStore>;
|
Himenon/dependents-view
|
src/container/RankingPage/Store.ts
|
<filename>src/container/RankingPage/Store.ts
import * as Domain from "@app/domain";
export const generateStore = (domainStores: Domain.Ranking.Stores) => {
return {
dataSet: domainStores.ranking.state.displayDataSet,
updateSearchParams: (name: string | undefined) => {
const searchParams = { packageName: name };
domainStores.ranking.dispatch({ type: "UPDATE_SEARCH_PARAMS", searchParams });
},
};
};
export type Store = ReturnType<typeof generateStore>;
|
Himenon/dependents-view
|
src/infra/Parser.ts
|
<gh_stars>1-10
import { View } from "@app/interface";
/**
* name=sample1:owner=owner1 をparseす
*/
export const parseStringSearchParams = (searchParams: string): View.SearchParams => {
const result: View.SearchParams = {};
const searchParamKeys = ["name", "host", "owner", "repo", "path"];
const keyValueStringList = searchParams.split("+");
keyValueStringList.forEach(keyValueString => {
const [key, value] = keyValueString.split(":");
if (searchParamKeys.includes(key)) {
result[key] = value;
}
});
return result;
};
|
Himenon/dependents-view
|
src/container/LinkList/Store.ts
|
<reponame>Himenon/dependents-view
import { View } from "@app/interface";
import * as Domain from "@app/domain";
export const generateStore = (domainStores: Domain.App.Stores) => {
const library = domainStores.app.state.displayLibrary;
if (library) {
return undefined;
}
return {
menu: domainStores.app.state.pageMenu,
updatePageParams: (pageParams: View.PageParams) => {
domainStores.app.dispatch({ type: "UPDATE_PAGE_PARAMS", pageParams });
},
canShowDetail: domainStores.app.state.pageMenu.items.length < 5,
};
};
export type Store = ReturnType<typeof generateStore>;
|
Himenon/dependents-view
|
src/container/RankingPage/Container.tsx
|
<gh_stars>1-10
import * as React from "react";
import * as Domain from "@app/domain";
import { RankingDataSet } from "@app/interface";
import { generateStore, Store } from "./Store";
import { RankingPage } from "@app/component";
const depsDataSet: RankingDataSet = require("@app/dataSet/ranking.json");
const generateProps = (store: Store): RankingPage.Props => {
return {
headerNavigation: {
links: [
{
to: "/",
children: "TOP",
},
{
to: "/packages",
children: "package list",
},
{
to: "/ranking",
children: "ranking",
},
],
},
searchInput: {
type: "text",
placeholder: "search package name",
"aria-label": "search package name",
onChange: event => {
store.updateSearchParams(event.currentTarget.value);
},
},
dataSet: store.dataSet,
};
};
export const Container = () => {
const reducers = Domain.Ranking.createReducers(depsDataSet);
const createReducer = <T, S>([state, dispatch]: [T, S]): { state: T; dispatch: S } => ({ state, dispatch });
const domainStores: Domain.Ranking.Stores = {
ranking: createReducer(React.useReducer(...reducers.app)),
};
const store = generateStore(domainStores);
return <RankingPage.Component {...generateProps(store)} />;
};
|
Himenon/dependents-view
|
src/domain/App/Converter.ts
|
<gh_stars>1-10
import { DependencySet, OriginLibrary, OriginDependencyData, View } from "@app/interface";
/**
* TODO ファイル移動
*/
export const generatePageMenu = (depsDataSet: DependencySet): View.Menu => {
return {
items: depsDataSet.libraries,
};
};
export const convertOriginDependencyDataToDetailDependencyData = (
deps: OriginDependencyData,
libraries: OriginLibrary[],
): View.DetailDependencyData => {
const d = libraries.find(lib => {
return lib.package.name === deps.name && new URL(deps.url).hostname === new URL(lib.repo.url).hostname;
});
if (!d) {
throw new Error("Not found");
}
return {
required: deps.required,
source: d.source,
repo: d.repo,
package: d.package,
};
};
export const convertLibrariesToDisplayLibrary = (pageParams: View.PageParams, originLibraries: OriginLibrary[]): View.Library | undefined => {
const libraries = originLibraries.filter(lib => {
return [
pageParams.name ? pageParams.name === lib.package.name : true,
pageParams.hostname ? pageParams.hostname === new URL(lib.repo.url).hostname : true,
pageParams.owner ? pageParams.owner === lib.repo.owner : true,
pageParams.repo ? pageParams.repo === lib.repo.name : true,
pageParams.path ? pageParams.path === lib.source.path : true,
].every(Boolean);
});
if (libraries.length !== 1) {
return undefined;
}
const mainLibrary = libraries[0];
const dependencies = mainLibrary.dependencies.map(deps => convertOriginDependencyDataToDetailDependencyData(deps, originLibraries));
const devDependencies = mainLibrary.devDependencies.map(deps => convertOriginDependencyDataToDetailDependencyData(deps, originLibraries));
return {
...mainLibrary,
dependencies,
devDependencies,
};
};
/**
* @returns key1:value1+key2:value2+key3:value3 || ""
*/
export const convertSearchParamToQueryParams = (searchParams: View.SearchParams): string => {
if (Object.values(searchParams).every(value => !value || value === "")) {
return "";
}
const value = Object.keys(searchParams)
.map(key => `${key}:${searchParams[key]}`)
.join("+");
return value;
};
|
Himenon/dependents-view
|
scripts/Constants.ts
|
import * as path from "path";
export const GITHUB_BASE_URL = undefined;
export const OWNERS = ["Himenon"];
export const SAVE_DIR = path.join(__dirname, "../src", "dataSet");
export const PKG_DETAILS = path.join(SAVE_DIR, "details.json");
export const DEPS_DATA = path.join(SAVE_DIR, "deps.json");
export const EXCLUDE_REPOSITORY_FULL_NAMES = [""];
export const RANKING_DATA = path.join(SAVE_DIR, "ranking.json");
|
Himenon/dependents-view
|
scripts/develop.ts
|
<filename>scripts/develop.ts
import * as webpack from "webpack";
import { generateConfig, generatePublicPath } from "./webpack.config";
import * as webpackDevServer from "webpack-dev-server";
import * as url from "native-url";
const main = async () => {
const isProduction = process.env.NODE_ENV === "production";
const publicPath = generatePublicPath(isProduction);
const { port } = url.parse(publicPath);
const config = generateConfig(isProduction);
const compiler = webpack(config);
const server = new webpackDevServer(compiler, {
hot: true,
open: true,
historyApiFallback: true,
publicPath: publicPath,
});
server.listen(parseInt(port || "9000", 10));
};
main().catch(e => {
if (e && e.message) {
console.error(e.message);
}
});
|
GridProtectionAlliance/PQDashboard
|
src/PQDashboard/Scripts/TSX/MeterEventsByLine.tsx
|
//******************************************************************************************************
// MeterEventsByLine.tsx - Gbtc
//
// Copyright © 2020, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
// file except in compliance with the License. You may obtain a copy of the License at:
//
// http://opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 03/31/2020 - <NAME>
// Generated original version of source code.
//
//******************************************************************************************************
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as _ from 'lodash';
import Table from './Table';
declare var meterName: string;
declare var date: string;
declare var xdaInstance: string;
declare var context: string;
declare var eventID: number;
declare var homePath: string;
interface EventData {
StartTime: string,
EventType: string,
AssetName: string,
KV: number,
FaultType: string,
Distance: number,
EventID: number,
UpdatedBy: string,
ModalRow: any,
OpenSEERow: any
}
class MeterEventByLine extends React.Component<{}, { Data: Array<EventData>, SortField: keyof(EventData), Ascending: boolean }, {}>{
constructor(props, context) {
super(props, context);
this.state = {
Data: [],
SortField: 'StartTime',
Ascending: true
}
}
componentDidMount() {
$.ajax({
type: "GET",
url: `${homePath}api/Events/DetailsByDate/${eventID}/${context}`,
contentType: "application/json; charset=utf-8",
dataType: 'json',
cache: true,
async: true
}).done((data: Array<EventData>) => {
var ordered = _.orderBy(data, [this.state.SortField], [(this.state.Ascending ? "asc" : "desc")]);
this.setState({ Data: ordered});
($(this.refs.dataTable) as any).puidatatable({
scrollable: true,
scrollHeight: '100%',
scrollWidth: '100%',
columns: [
{
field: 'StartTime', headerText: 'Start Time', headerStyle: 'width: 30%', bodyStyle: 'width: 30%; height: 20px', sortable: true, content:
(row) => `<a href="${xdaInstance}/Workbench/Event.cshtml?EventID=${row.EventID}" style="color: blue; background-color: ${(row.UpdatedBy ? 'yellow' : null)}" target='_blank' title=${(row.UpdatedBy ? 'This event has been edited.' : "")}>${row.StartTime}</a>`
},
{ field: 'EventType', headerText: 'Event Type', headerStyle: 'width: 20%', bodyStyle: 'width: 20%; height: 20px', sortable: true },
{ field: 'AssetName', headerText: 'Asset Name', headerStyle: 'width: 20%', bodyStyle: 'width: 20%; height: 20px', sortable: true },
{ field: 'KV', headerText: 'KV', headerStyle: 'width: 6%', bodyStyle: 'width: 6%; height: 20px', sortable: true },
{ field: 'FaultType', headerText: 'Phase', headerStyle: 'width: 6%', bodyStyle: 'width: 6%; height: 20px', sortable: true },
{ field: 'Distance', headerText: 'Distance', headerStyle: 'width: 10%', bodyStyle: 'width: 10%; height: 20px', sortable: true },
{ headerStyle: 'width: 60px', content: function (data) { return /*makeOpenSEEButton_html(data);*/ null } },
{ headerText: '', headerStyle: 'width: 50px', content: (row) => `<button style="height: 30px" onclick="openResultsModal('${JSON.stringify(row).replace(/"/g, '\\\'')}')"><span class="glyphicon glyphicon-option-horizontal" title=""></span><span id="${row.EventID}asterisk" style="color: green; position: sticky; bottom: 0">${(this.testForAllStuff(row) ? '*' : '')}</span></button>`
}
],
datasource: data
});
})
}
testForAllStuff(data) {
if (data.UpdatedBy !== null) return true;
if (data.Note > 0) return true;
if (data.pqiexists > 0) return true;
$.each(data.ServiceList.split(','), function (i, k) {
if (data[k] !== null)
return true;
});
return false;
}
openResultsModal(row) {
}
render() {
return (
<>
<div className="gridheader" style={{textAlign: 'center'}}>Events for {meterName} for {date}(<a href={`${xdaInstance}/Workbench/MeterEventsByLine.cshtml?EventID=${eventID}&context=${context}`} target="_blank">View in OpenXDA</a>)
</div >
<div style={{ height: 'calc(100% - 23px)', width: '100%' }}>
<Table<EventData>
cols={[
{ key: 'StartTime', label: 'Start Time', headerStyle: { width: '30%' }, rowStyle: { width: '30%' }, content: (item, key, style) => <a href={`${xdaInstance}/Workbench/Event.cshtml?EventID=${item.EventID}`} style={{ color: 'blue', backgroundColor: (item.UpdatedBy ? 'yellow' : null) }} target='_blank' title={(item.UpdatedBy ? 'This event has been edited.' : "")}>{item.StartTime}</a> },
{ key: 'EventType', label: 'Event Type', headerStyle: { width: '20%' }, rowStyle: { width: '20%' } },
{ key: 'AssetName', label: 'Asset', headerStyle: { width: '20%' }, rowStyle: { width: '20%' } },
{ key: 'KV', label: 'KV', headerStyle: { width: '10%' }, rowStyle: { width: '10%' } },
{ key: 'FaultType', label: 'Fault Type', headerStyle: { width: '10%' }, rowStyle: { width: '10%' } },
{ key: 'Distance', label: 'Distance', headerStyle: { width: '10%' }, rowStyle: { width: '10%' } },
{ key: "OpenSEERow", label: '', headerStyle: { width: 60 }, rowStyle: { width: 60 }, content: (item, key, style) => <button onClick={(evt) => { window.open(`${homePath}Main/OpenSEE?eventid=${item.EventID}&faultcurves=1`, item.EventID + "openSEE") }} title="Launch OpenSEE Waveform Viewer"><img src={`${homePath}Images/seeButton.png`} /></button> },
{ key: "ModalRow", label: '', headerStyle: { width: 50 }, rowStyle: { width: 50 }, content: (item, key, style) => <button style={{ height: 30, width: 30, padding: 0 }} onClick={(evt) => this.openResultsModal(item)}><span style={{ position: 'relative', top: -2, left: 2 }} className="glyphicon glyphicon-option-horizontal" title=""></span><span id={`${item.EventID}asterisk`} style={{ color: 'green', position: 'relative', bottom: -5, left: -4 }}>{(this.testForAllStuff(item) ? '*' : '')}</span></button> },
{ key: null, label: '', headerStyle: { width: 17, padding: 0 }, rowStyle: { width: 0, padding: 0 } },
]}
tableClass="table table-hover"
data={this.state.Data}
sortField={this.state.SortField}
ascending={this.state.Ascending}
onSort={(d) => {
if (d.col == this.state.SortField) {
var ordered = _.orderBy(this.state.Data, [d.col], [(!this.state.Ascending ? "asc" : "desc")]);
this.setState({ Data: ordered, Ascending: !this.state.Ascending });
}
else {
var ordered = _.orderBy(this.state.Data, [d.col], ["asc"]);
this.setState({ Data: ordered, SortField: d.col });
}
}}
onClick={(data) => { }}
theadStyle={{ fontSize: 'smaller', display: 'table', tableLayout: 'fixed', width: '100%' }}
tbodyStyle={{ display: 'block', overflowY: 'scroll', maxHeight: window.innerHeight - 300, width: '100%' }}
rowStyle={{ fontSize: 'smaller', display: 'table', tableLayout: 'fixed', width: '100%' }}
selected={(item) => false}
/>
{/*<div style={{ height: '100%', display: 'inline-block' }} ref="dataTable"></div>*/}
</div>
</>
)
}
}
ReactDOM.render(<MeterEventByLine />, document.getElementById('pageBody'));
|
jheckjr/recipe-box2
|
src/app/recipe-edit/recipe-edit.component.spec.ts
|
<filename>src/app/recipe-edit/recipe-edit.component.spec.ts<gh_stars>0
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { FormBuilder,
FormGroup,
FormArray,
Validators,
ReactiveFormsModule } from '@angular/forms';
import { RecipeEditComponent } from './recipe-edit.component';
import { Recipe, RecipeItemEvent, RecipeItemEventType } from '../models';
describe('RecipeEditComponent:', () => {
let component: RecipeEditComponent;
let fixture: ComponentFixture<RecipeEditComponent>;
let recipe: Recipe = {
name: 'Oatmeal',
ingredients: [
'1 pkt. oatmeal',
'2/3 cup milk'
]
};
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [RecipeEditComponent],
imports: [ReactiveFormsModule],
providers: [FormBuilder]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RecipeEditComponent);
component = fixture.componentInstance;
component.recipe = recipe;
spyOn(component.buttonClicked, 'emit');
fixture.detectChanges();
});
it('should initialize the component', () => {
expect(component).toBeTruthy();
expect(component.recipe).toEqual(recipe);
let formGroup = component.formGroup;
expect(formGroup).toBeDefined();
expect(formGroup.controls['name']).toBeDefined();
expect(formGroup.controls['ingredients']).toBeDefined();
let numInputs = fixture.debugElement.queryAll(By.css('input')).length;
expect(numInputs).toEqual(3);
});
it('should initialize and validate the form with the recipe contents', () => {
let formGroup = component.formGroup;
expect(formGroup.controls['name'].value).toContain(recipe.name);
expect((<FormArray>formGroup.controls['ingredients']).controls[0].value)
.toContain(recipe.ingredients[0]);
expect((<FormArray>formGroup.controls['ingredients']).controls[1].value)
.toContain(recipe.ingredients[1]);
expect(formGroup.controls['name'].valid).toBeTruthy();
expect((<FormArray>formGroup.controls['ingredients']).controls[0].valid)
.toBeTruthy();
expect((<FormArray>formGroup.controls['ingredients']).controls[1].valid)
.toBeTruthy();
});
it('should emit a save event when the save button is clicked', () => {
let saveEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Save,
recipe: recipe
};
let saveButton = fixture.debugElement.query(By.css('button.save-button')).nativeElement;
saveButton.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(component.buttonClicked.emit).toHaveBeenCalledWith(saveEvent);
});
it('should emit a cancel event when the cancel button is clicked', () => {
let cancelEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Cancel,
recipe: null
};
let cancelButton = fixture.debugElement.query(By.css('button.cancel-button')).nativeElement;
cancelButton.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(component.buttonClicked.emit).toHaveBeenCalledWith(cancelEvent);
});
it('should add an ingredient', () => {
let ingredientArray = <FormArray>component.formGroup.controls['ingredients'];
let numIngredients = ingredientArray.length;
let addIngredient = fixture.debugElement.query(By.css('a.add')).nativeElement;
addIngredient.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(ingredientArray.length).toEqual(numIngredients + 1);
expect(ingredientArray.controls[ingredientArray.length - 1].value)
.toEqual('');
});
it('should remove an ingredient', () => {
let ingredientArray = <FormArray>component.formGroup.controls['ingredients'];
let numIngredients = ingredientArray.length;
let removeIngredient = fixture.debugElement.queryAll(By.css('i.remove'))[0]
.nativeElement;
removeIngredient.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(ingredientArray.length).toEqual(numIngredients - 1);
expect(ingredientArray.controls[0].value)
.toContain(recipe.ingredients[1]);
});
it('should not remove an ingredient if only one left', () => {
let ingredientArray = <FormArray>component.formGroup.controls['ingredients'];
let removeIngredient = fixture.debugElement.queryAll(By.css('i.remove'))[0]
.nativeElement;
removeIngredient.dispatchEvent(new Event('click'));
fixture.detectChanges();
component.removeIngredient(0);
fixture.detectChanges();
expect(fixture.debugElement.queryAll(By.css('i.remove')).length).toEqual(0);
expect(ingredientArray.length).toEqual(1);
expect(ingredientArray.controls[0].value)
.toContain(recipe.ingredients[1]);
});
it('should not display error messages', () => {
expect(fixture.debugElement.queryAll(By.css('small')).length).toEqual(0);
});
});
describe('RecipeEditComponent null recipe input:', () => {
let component: RecipeEditComponent;
let fixture: ComponentFixture<RecipeEditComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [RecipeEditComponent],
imports: [ReactiveFormsModule],
providers: [FormBuilder]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RecipeEditComponent);
component = fixture.componentInstance;
component.recipe = null;
spyOn(component.buttonClicked, 'emit');
fixture.detectChanges();
});
it('should initialize the form with empty values if no recipe given', () => {
let formGroup = component.formGroup;
expect(formGroup.controls['name'].value).toEqual('');
expect((<FormArray>formGroup.controls['ingredients']).controls[0].value)
.toEqual('');
expect(formGroup.controls['name'].invalid).toBeTruthy();
expect((<FormArray>formGroup.controls['ingredients']).controls[0].invalid)
.toBeTruthy();
});
it('should disable the save button', () => {
let saveButton = fixture.debugElement.query(By.css('button.save-button')).nativeElement;
expect(saveButton.disabled).toBeTruthy();
});
it('should emit a cancel event when the cancel button is clicked', () => {
let cancelEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Cancel,
recipe: null
};
let cancelButton = fixture.debugElement.query(By.css('button.cancel-button')).nativeElement;
cancelButton.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(component.buttonClicked.emit).toHaveBeenCalledWith(cancelEvent);
});
it('should add an ingredient', () => {
let ingredientArray = <FormArray>component.formGroup.controls['ingredients'];
let numIngredients = ingredientArray.length;
let addIngredient = fixture.debugElement.query(By.css('a.add')).nativeElement;
addIngredient.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(ingredientArray.length).toEqual(numIngredients + 1);
expect(ingredientArray.controls[ingredientArray.length - 1].value)
.toEqual('');
});
it('should remove an ingredient', () => {
component.addIngredient();
fixture.detectChanges();
let ingredientArray = <FormArray>component.formGroup.controls['ingredients'];
let numIngredients = ingredientArray.length;
let removeIngredient = fixture.debugElement.queryAll(By.css('i.remove'))[0]
.nativeElement;
removeIngredient.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(ingredientArray.length).toEqual(numIngredients - 1);
expect(ingredientArray.controls[0].value)
.toEqual('');
});
it('should not remove an ingredient if only one left', () => {
let ingredientArray = <FormArray>component.formGroup.controls['ingredients'];
expect(fixture.debugElement.queryAll(By.css('i.remove')).length).toEqual(0);
expect(ingredientArray.length).toEqual(1);
expect(ingredientArray.controls[0].value)
.toEqual('');
});
it('should not display error messages before form has been touched', () => {
expect(fixture.debugElement.queryAll(By.css('small')).length).toEqual(0);
});
it('should display error messages if form invalid and touched', () => {
component.formGroup.controls['name'].markAsTouched();
(<FormArray>component.formGroup.controls['ingredients']).controls[0]
.markAsTouched();
fixture.detectChanges();
expect(fixture.debugElement.queryAll(By.css('small')).length).toEqual(2);
});
});
|
jheckjr/recipe-box2
|
src/app/reducers/recipe-reducer.spec.ts
|
import { UserControl,
addRecipe,
selectRecipe,
editRecipe,
deleteRecipe,
updateUserControl } from '../actions';
import { Recipe, sampleRecipe } from '../models';
import { RecipeReducer, RecipeState, RecipeEntities } from './recipe-reducer';
import * as LSHelper from '../local-storage-helper/local-storage-helper';
describe('Recipe Reducers:', () => {
let initialState: RecipeState;
let recipe: Recipe = {
name: 'Hot Chocolate',
ingredients: [
'1 pkt. hot chocolate mix',
'1 cup hot milk'
]
};
beforeEach(() => {
localStorage.clear();
initialState = {
names: [sampleRecipe.name],
currentRecipe: null,
recipes: Object.assign({}, {
[sampleRecipe.name]: sampleRecipe
}),
userControl: UserControl.View
};
});
it('should handle initial state', () => {
localStorage.clear();
expect(RecipeReducer(initialState, {})).toEqual(initialState);
});
it('should handle ADD_RECIPE', () => {
let numLocalStorage = localStorage.length;
let state = RecipeReducer(initialState, addRecipe(recipe));
expect(state.names).toContain(recipe.name);
expect(state.currentRecipe).toBeNull();
expect(state.recipes[recipe.name]).toEqual(recipe);
expect(state.userControl).toEqual(UserControl.View);
expect(localStorage.length).toEqual(numLocalStorage + 1);
});
it('should handle ADD_RECIPE with null recipe', () => {
let nullRecipe = null;
let numLocalStorage = localStorage.length;
let state = RecipeReducer(initialState, addRecipe(nullRecipe));
expect(state).toEqual(initialState);
expect(localStorage.length).toEqual(numLocalStorage);
});
it('should handle ADD_RECIPE with non-unique recipe name', () => {
let state = RecipeReducer(initialState, addRecipe(recipe));
let newState = RecipeReducer(state, addRecipe(recipe));
expect(newState).toEqual(state);
});
it('should handle SELECT_RECIPE', () => {
let state = RecipeReducer(initialState, addRecipe(recipe));
expect(state.currentRecipe).toBeNull();
state = RecipeReducer(state, selectRecipe(recipe.name));
expect(state.currentRecipe).toEqual(recipe.name);
});
it('should handle SELECT_RECIPE when recipe doesn\'t exist', () => {
let state = RecipeReducer(initialState, selectRecipe(recipe.name));
expect(state.currentRecipe).toBeNull();
});
it('should handle SELECT_RECIPE when recipe already selected', () => {
let state = RecipeReducer(initialState, addRecipe(recipe));
state = RecipeReducer(state, selectRecipe(recipe.name));
expect(state.currentRecipe).toEqual(recipe.name);
state = RecipeReducer(state, selectRecipe(recipe.name));
expect(state.currentRecipe).toBeNull();
});
it('should handle EDIT_RECIPE', () => {
let editedRecipe: Recipe = {
name: recipe.name,
ingredients: [
'1 pkt. oatmeal',
'2/3 cup water'
]
};
let state = RecipeReducer(initialState, addRecipe(recipe));
let numLocalStorage = localStorage.length;
state = RecipeReducer(state, editRecipe(editedRecipe));
expect(state.names).toContain(recipe.name);
expect(state.currentRecipe).toBeNull();
expect(state.recipes[editedRecipe.name]).toEqual(editedRecipe);
expect(state.userControl).toEqual(UserControl.View);
expect(localStorage.length).toEqual(numLocalStorage);
});
it('should handle EDIT_RECIPE when the name changes', () => {
let editedRecipe: Recipe = {
name: 'Cereal',
ingredients: [
'1 bowl cereal',
'1 cup milk'
]
};
let state = RecipeReducer(initialState, addRecipe(recipe));
let numLocalStorage = localStorage.length;
state = RecipeReducer(state, selectRecipe(recipe.name));
state = RecipeReducer(state, editRecipe(editedRecipe));
expect(state.names).toContain(editedRecipe.name);
expect(state.names).not.toContain(recipe.name);
expect(state.currentRecipe).toBeNull();
expect(state.recipes[editedRecipe.name]).toEqual(editedRecipe);
expect(state.recipes[recipe.name]).not.toBeDefined();
expect(state.userControl).toEqual(UserControl.View);
expect(localStorage.length).toEqual(numLocalStorage);
});
it('should handle DELETE_RECIPE', () => {
let state = RecipeReducer(initialState, addRecipe(recipe));
let numLocalStorage = localStorage.length;
state = RecipeReducer(state, deleteRecipe(recipe));
expect(state).toEqual(initialState);
expect(localStorage.length).toEqual(numLocalStorage - 1);
});
it('should handle DELETE_RECIPE when recipe doesn\'t exist', () => {
let secondRecipe: Recipe = {
name: 'Cereal',
ingredients: [
'1 bowl cereal',
'1 cup milk'
]
};
let state = RecipeReducer(initialState, addRecipe(recipe));
let secondState = RecipeReducer(state, deleteRecipe(secondRecipe));
expect(secondState).toEqual(state);
});
it('should handle UPDATE_USER_CONTROL for Add', () => {
let state = RecipeReducer(initialState, addRecipe(recipe));
state = RecipeReducer(state, selectRecipe(recipe.name));
state = RecipeReducer(state, updateUserControl(UserControl.Add));
expect(state.userControl).toEqual(UserControl.Add);
expect(state.currentRecipe).toBeNull();
});
it('should handle UPDATE_USER_CONTROL for View', () => {
let state = RecipeReducer(initialState, addRecipe(recipe));
state = RecipeReducer(state, selectRecipe(recipe.name));
state = RecipeReducer(state, updateUserControl(UserControl.View));
expect(state.userControl).toEqual(UserControl.View);
expect(state.currentRecipe).toEqual(recipe.name);
});
it('should handle UPDATE_USER_CONTROL for Edit', () => {
let state = RecipeReducer(initialState, addRecipe(recipe));
state = RecipeReducer(state, selectRecipe(recipe.name));
state = RecipeReducer(state, updateUserControl(UserControl.Edit));
expect(state.userControl).toEqual(UserControl.Edit);
expect(state.currentRecipe).toEqual(recipe.name);
});
});
|
jheckjr/recipe-box2
|
src/app/actions/recipe-actions.ts
|
<reponame>jheckjr/recipe-box2<filename>src/app/actions/recipe-actions.ts
import { Action, ActionCreator } from 'redux';
import { Recipe } from '../models';
import { UserControl } from './user-control';
/********** Add Recipe Action **********/
export const ADD_RECIPE = '[Recipe] Add';
export interface AddRecipeAction extends Action {
recipe: Recipe;
};
export const addRecipe: ActionCreator<AddRecipeAction> = (recipe) => ({
type: ADD_RECIPE,
recipe: recipe
});
/********** Select Recipe Action **********/
export const SELECT_RECIPE = '[Recipe] Select';
export interface SelectRecipeAction extends Action {
recipeName: string;
};
export const selectRecipe: ActionCreator<SelectRecipeAction> = (recipeName) => ({
type: SELECT_RECIPE,
recipeName: recipeName
});
/********** Edit Recipe Action **********/
export const EDIT_RECIPE = '[Recipe] Edit';
export interface EditRecipeAction extends Action {
recipe: Recipe;
};
export const editRecipe: ActionCreator<EditRecipeAction> = (recipe) => ({
type: EDIT_RECIPE,
recipe: recipe
});
/********** Delete Recipe Action **********/
export const DELETE_RECIPE = '[Recipe] Delete';
export interface DeleteRecipeAction extends Action {
recipe: Recipe;
};
export const deleteRecipe: ActionCreator<DeleteRecipeAction> = (recipe) => ({
type: DELETE_RECIPE,
recipe: recipe
});
/********** Update User Control Action **********/
export const UPDATE_USER_CONTROL = 'Update User Control';
export interface UpdateUserControlAction extends Action {
userControl: UserControl;
};
export const updateUserControl: ActionCreator<UpdateUserControlAction> =
(userControl) => ({
type: UPDATE_USER_CONTROL,
userControl: userControl
});
|
jheckjr/recipe-box2
|
src/app/recipe-item/recipe-item.component.spec.ts
|
<gh_stars>0
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
import { RecipeItemComponent } from './recipe-item.component';
import { RecipeEditComponent } from '../recipe-edit/recipe-edit.component';
import { Recipe, RecipeItemEvent, RecipeItemEventType } from '../models';
describe('RecipeItemComponent:', () => {
let component: RecipeItemComponent;
let fixture: ComponentFixture<RecipeItemComponent>;
let recipe: Recipe = {
name: 'Oatmeal',
ingredients: [
'1 pkt. oatmeal',
'2/3 cup milk'
]
};
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [RecipeItemComponent, RecipeEditComponent],
imports: [ReactiveFormsModule],
providers: [FormBuilder]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RecipeItemComponent);
component = fixture.componentInstance;
component.recipe = recipe;
component.selected = true;
component.userEdit = false;
spyOn(component.buttonClicked, 'emit');
spyOn(component.toggleSelected, 'emit');
fixture.detectChanges();
});
it('should initialize the component', () => {
expect(component).toBeTruthy();
expect(component.recipe).toEqual(recipe);
expect(component.selected).toBeTruthy();
expect(component.userEdit).toBeFalsy();
});
it('should initialize the text', () => {
let titleEl = fixture.debugElement.query(By.css('div.title')).nativeElement;
expect(titleEl.innerHTML).toContain(recipe.name);
let ingredientEls = fixture.debugElement.queryAll(By.css('div.item'));
expect(ingredientEls.length).toEqual(2);
expect(ingredientEls[0].nativeElement.innerHTML)
.toContain(recipe.ingredients[0]);
expect(ingredientEls[1].nativeElement.innerHTML)
.toContain(recipe.ingredients[1]);
});
it('should show non-editable content if userEdit false', () => {
let contentEl = fixture.debugElement.query(By.css('div.item-pad')).nativeElement;
expect(contentEl).toBeDefined();
expect(fixture.debugElement.query(By.css('app-recipe-edit'))).toBeNull();
});
it('should show editable content if userEdit true', () => {
component.userEdit = true;
fixture.detectChanges();
let contentEl = fixture.debugElement.query(By.css('div.item-pad'));
expect(contentEl).toBeNull();
expect(fixture.debugElement.query(By.css('app-recipe-edit'))).toBeDefined();
});
it('should not show content if selected false', () => {
component.selected = false;
fixture.detectChanges();
let contentEl = fixture.debugElement.query(By.css('div.item-pad'));
expect(contentEl).toBeNull();
expect(fixture.debugElement.query(By.css('app-recipe-edit'))).toBeNull();
});
it('should emit a delete event when the delete button is clicked', () => {
let deleteEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Delete,
recipe: recipe
};
let deleteButton = fixture.debugElement.query(By.css('button.delete')).nativeElement;
deleteButton.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(component.buttonClicked.emit).toHaveBeenCalledWith(deleteEvent);
});
it('should emit an edit event when the edit button is clicked', () => {
let editEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Edit,
recipe: null
};
let editButton = fixture.debugElement.query(By.css('button.edit')).nativeElement;
editButton.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(component.buttonClicked.emit).toHaveBeenCalledWith(editEvent);
});
it('should emit a toggle event when the title is clicked', () => {
let titleEl = fixture.debugElement.query(By.css('div.title')).nativeElement;
titleEl.dispatchEvent(new Event('click'));
fixture.detectChanges();
expect(component.toggleSelected.emit).toHaveBeenCalledWith(recipe.name);
});
it('should emit a save event after receiving a save event from edit', () => {
component.userEdit = true;
fixture.detectChanges();
let editComponent = fixture.debugElement.query(By.css('app-recipe-edit'))
.nativeElement;
editComponent.dispatchEvent(new Event('buttonClicked'));
fixture.detectChanges();
expect(component.buttonClicked.emit).toHaveBeenCalled();
});
it('should save an edited recipe', () => {
let saveEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Save,
recipe: {
name: 'Cereal',
ingredients: ['cereal', 'milk']
}
};
component.handleRecipeEdit(saveEvent);
fixture.detectChanges();
expect(component.buttonClicked.emit).toHaveBeenCalledWith(saveEvent);
expect(component.recipe).toEqual(saveEvent.recipe);
});
it('should not save an edited recipe if the edit was cancelled', () => {
let initialRecipe = component.recipe;
let cancelEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Cancel,
recipe: null
};
component.handleRecipeEdit(cancelEvent);
fixture.detectChanges();
expect(component.buttonClicked.emit).toHaveBeenCalledWith(cancelEvent);
expect(component.recipe).toEqual(initialRecipe);
});
});
|
jheckjr/recipe-box2
|
src/app/reducers/recipe-reducer.ts
|
<filename>src/app/reducers/recipe-reducer.ts<gh_stars>0
import { Action } from 'redux';
import { createSelector } from 'reselect';
import { Recipe } from '../models';
import { UserControl, ADD_RECIPE, AddRecipeAction,
SELECT_RECIPE, SelectRecipeAction,
EDIT_RECIPE, EditRecipeAction,
DELETE_RECIPE, DeleteRecipeAction,
UPDATE_USER_CONTROL, UpdateUserControlAction } from '../actions';
import * as LSHelper from '../local-storage-helper/local-storage-helper';
/********** Application state interfaces **********/
export interface RecipeEntities {
[name: string]: Recipe;
};
export interface RecipeState {
names: string[];
recipes: RecipeEntities;
currentRecipe?: string;
userControl: UserControl;
};
const initialState: RecipeState = {
names: LSHelper.getAllStoredRecipeNames(),
currentRecipe: null,
recipes: LSHelper.getAllStoredRecipes(),
userControl: UserControl.View
};
/********** Reducer functions **********/
export const RecipeReducer =
function(state: RecipeState = initialState, action: Action): RecipeState {
switch (action.type) {
case ADD_RECIPE: {
const recipe = (<AddRecipeAction>action).recipe;
// Don't add a recipe with a non-unique name
if (!recipe || state.names.indexOf(recipe.name) !== -1) {
return state;
}
// Add to Local Storage
LSHelper.storeRecipe(recipe);
return {
names: [...state.names, recipe.name],
currentRecipe: null,
recipes: Object.assign({}, state.recipes, {
[recipe.name]: recipe
}),
userControl: UserControl.View
};
}
case SELECT_RECIPE: {
let recipeName = (<SelectRecipeAction>action).recipeName;
if (recipeName != null && state.names.indexOf(recipeName) === -1) {
return state;
}
if (state.currentRecipe === recipeName) {
recipeName = null;
}
return {
names: state.names,
currentRecipe: recipeName,
recipes: state.recipes,
userControl: UserControl.View
};
}
case EDIT_RECIPE: {
const recipe = (<EditRecipeAction>action).recipe;
let names = state.names;
let otherRecipes = Object.assign({}, state.recipes);
// Delete recipe if name has changed
if (recipe.name !== state.currentRecipe) {
let idx = names.indexOf(state.currentRecipe);
names = [...names.slice(0, idx), ...names.slice(idx + 1), recipe.name];
delete otherRecipes[state.currentRecipe];
LSHelper.deleteStoredRecipe(state.currentRecipe);
}
LSHelper.storeRecipe(recipe);
return {
names: names,
currentRecipe: null,
recipes: Object.assign(otherRecipes, {
[recipe.name]: recipe
}),
userControl: UserControl.View
};
}
case DELETE_RECIPE: {
const recipe = (<DeleteRecipeAction>action).recipe;
let recipeIdx = state.names.indexOf(recipe.name);
if (recipeIdx === -1) {
return state;
}
let otherRecipes = Object.assign({}, state.recipes);
delete otherRecipes[recipe.name];
LSHelper.deleteStoredRecipe(recipe.name);
return {
names: [...state.names.slice(0, recipeIdx),
...state.names.slice(recipeIdx + 1)],
currentRecipe: null,
recipes: otherRecipes,
userControl: state.userControl
};
}
case UPDATE_USER_CONTROL: {
const userControl = (<UpdateUserControlAction>action).userControl;
let currentRecipe = state.currentRecipe;
if (userControl === UserControl.Add) {
currentRecipe = null;
}
return {
names: state.names,
currentRecipe: currentRecipe,
recipes: state.recipes,
userControl: userControl
};
}
default:
return state;
}
};
/********** Selectors **********/
export const getRecipeEntities = (state): RecipeEntities => state.recipes;
export const getAllRecipes = createSelector(
getRecipeEntities,
(entities: RecipeEntities) => Object.keys(entities)
.map((recipeName) => entities[recipeName])
);
export const getRecipeIndex = createSelector(
getRecipeEntities,
(state) => state.currentRecipe,
(entities: RecipeEntities, current: string) =>
Object.keys(entities).indexOf(current)
);
|
jheckjr/recipe-box2
|
src/app/models/index.ts
|
<reponame>jheckjr/recipe-box2
export * from './recipe.model';
export * from './recipe-item-event.model';
export * from './sample-recipe';
|
jheckjr/recipe-box2
|
src/app/recipe-list/recipe-list.component.spec.ts
|
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
import { createStore } from 'redux';
import { AppStore } from '../app-store';
import { RecipeState, RecipeReducer, getAllRecipes } from '../reducers/recipe-reducer';
import { addRecipe } from '../actions';
import { RecipeListComponent } from './recipe-list.component';
import { RecipeItemComponent } from '../recipe-item/recipe-item.component';
import { RecipeEditComponent } from '../recipe-edit/recipe-edit.component';
import { testRecipes } from './test/test-recipes';
import { Recipe, RecipeItemEvent, RecipeItemEventType } from '../models';
describe('RecipeListComponent:', () => {
let component: RecipeListComponent;
let fixture: ComponentFixture<RecipeListComponent>;
let store = createStore<RecipeState>(RecipeReducer);
function storeFactory() {
return store;
}
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
RecipeListComponent,
RecipeItemComponent,
RecipeEditComponent
],
imports: [ReactiveFormsModule],
providers: [FormBuilder,
{ provide: AppStore, useFactory: storeFactory }
]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RecipeListComponent);
testRecipes.forEach((recipe: Recipe) => {
store.dispatch(addRecipe(recipe));
});
component = fixture.componentInstance;
component.recipes = getAllRecipes(store.getState());
component.currentRecipe = component.recipes[0].name;
component.userEditing = false;
component.addRecipe = false;
spyOn(component, 'handleRecipeToggle').and.callThrough();
spyOn(component, 'handleRecipeEvent').and.callThrough();
fixture.detectChanges();
});
it('should initialize the component', () => {
expect(component).toBeTruthy();
expect(component.recipes).toEqual(getAllRecipes(store.getState()));
expect(component.currentRecipe).toEqual(component.recipes[0].name);
expect(component.userEditing).toBeFalsy();
});
it('should display a list of RecipeItemComponents', () => {
let recipeList = fixture.debugElement.queryAll(By.css('app-recipe-item'));
expect(recipeList.length).toEqual(component.recipes.length);
expect(fixture.debugElement.query(By.css('app-recipe-edit.add-recipe'))).toBeNull();
});
it('should have an add recipe button', () => {
let addButton = fixture.debugElement.query(By.css('button.add-button'))
.nativeElement;
expect(addButton).toBeDefined();
});
it('should display an edit recipe component when the add button is clicked', () => {
let addButton = fixture.debugElement.query(By.css('button.add-button'))
.nativeElement;
addButton.dispatchEvent(new Event('click'));
fixture.detectChanges();
let editComponent = fixture.debugElement.query(By.css('app-recipe-edit.add-recipe'))
.nativeElement;
expect(component.currentRecipe).toBeNull();
expect(component.userEditing).toBeFalsy();
expect(editComponent).toBeDefined();
});
it('should toggle the selected recipe', () => {
let itemComponent = fixture.debugElement.queryAll(By.css('app-recipe-item'))[0]
.nativeElement;
itemComponent.dispatchEvent(new Event('toggleSelected'));
fixture.detectChanges();
expect(component.handleRecipeToggle).toHaveBeenCalled();
component.handleRecipeToggle(component.currentRecipe);
fixture.detectChanges();
expect(component.currentRecipe).toBeNull();
component.handleRecipeToggle(component.recipes[0].name);
fixture.detectChanges();
expect(component.currentRecipe).toEqual(component.recipes[0].name);
});
it('should handle recipe events', () => {
let itemComponent = fixture.debugElement.queryAll(By.css('app-recipe-item'))[0]
.nativeElement;
itemComponent.dispatchEvent(new Event('buttonClicked'));
fixture.detectChanges();
expect(component.handleRecipeEvent).toHaveBeenCalled();
});
it('should handle edit events', () => {
let editEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Edit,
recipe: null
};
component.handleRecipeEvent(editEvent);
fixture.detectChanges();
expect(component.userEditing).toBeTruthy();
});
it('should handle cancel events', () => {
let cancelEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Cancel,
recipe: null
};
component.handleRecipeEvent(cancelEvent);
fixture.detectChanges();
expect(component.userEditing).toBeFalsy();
});
it('should handle delete events', () => {
let deleteEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Delete,
recipe: testRecipes[0]
};
let numRecipes = component.recipes.length;
component.handleRecipeEvent(deleteEvent);
fixture.detectChanges();
expect(component.recipes.length).toEqual(numRecipes - 1);
expect(component.recipes.indexOf(testRecipes[0])).toEqual(-1);
expect(component.currentRecipe).toBeNull();
});
it('should handle save events', () => {
component.addRecipe = true;
fixture.detectChanges();
let saveEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Save,
recipe: {
name: 'Coffee',
ingredients: ['1 cup water', '3 Tbs. ground coffee bean']
}
};
let numRecipes = component.recipes.length;
component.handleRecipeEvent(saveEvent);
fixture.detectChanges();
expect(component.recipes.length).toEqual(numRecipes + 1);
expect(component.recipes[numRecipes].name).toEqual(saveEvent.recipe.name);
expect(component.currentRecipe).toBeNull();
});
});
|
jheckjr/recipe-box2
|
src/app/recipe-item/recipe-item.component.ts
|
<gh_stars>0
import { Component, Input, EventEmitter, Output } from '@angular/core';
import { RecipeEditComponent } from '../recipe-edit/recipe-edit.component';
import { Recipe, RecipeItemEvent, RecipeItemEventType } from '../models';
@Component({
selector: 'app-recipe-item',
templateUrl: './recipe-item.component.html',
styleUrls: ['./recipe-item.component.css']
})
export class RecipeItemComponent {
@Input() recipe: Recipe;
@Input() selected: boolean;
@Input() userEdit: boolean;
@Output() buttonClicked: EventEmitter<RecipeItemEvent>;
@Output() toggleSelected: EventEmitter<string>;
constructor() {
this.buttonClicked = new EventEmitter<RecipeItemEvent>();
this.toggleSelected = new EventEmitter<string>();
}
editClicked(event: any) {
let editEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Edit,
recipe: null
};
this.buttonClicked.emit(editEvent);
event.preventDefault();
}
deleteClicked(event: any) {
let deleteEvent: RecipeItemEvent = {
eventType: RecipeItemEventType.Delete,
recipe: this.recipe
};
this.buttonClicked.emit(deleteEvent);
event.preventDefault();
}
toggleClicked(event: any) {
this.toggleSelected.emit(this.recipe.name);
event.preventDefault();
}
handleRecipeEdit(event: any) {
let recipeItemEvent = <RecipeItemEvent>event;
if (recipeItemEvent.eventType === RecipeItemEventType.Save) {
this.recipe = recipeItemEvent.recipe;
}
this.buttonClicked.emit(recipeItemEvent);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.