max_stars_repo_path
stringlengths
3
961
max_stars_repo_name
stringlengths
5
122
max_stars_count
int64
0
224k
id
stringlengths
1
8
content
stringlengths
2
1.07M
score
float64
-0.95
3.88
int_score
int64
0
4
lib/config/loader.js
liuwill/ketchup-server-scaffold
0
15996348
const fs = require('fs') const path = require('path') const loadJsonConfig = (configPath) => { if (!fs.existsSync(configPath)) { return {} } var content = fs.readFileSync(configPath, 'utf8') try { return JSON.parse(content) } catch (err) { return {} } } // 检查config目录下的环境配置json文件 const loadEnvConfig = (basePath) => { const subList = fs.readdirSync(basePath) const envConfig = {} for (let file of subList) { const currentPath = path.join(basePath, file) const fileStat = fs.statSync(currentPath) if (fileStat.isDirectory() || !file.endsWith('.json')) { continue } const envName = file.split('.')[0] envConfig[envName] = loadJsonConfig(currentPath) } return envConfig } module.exports = { loadEnvConfig, loadJsonConfig, }
1.296875
1
src/store/modules/exchange.js
Hooker41/Exchange-Trading-Order-Management-Tool
0
15996356
import { createAction, handleActions } from 'redux-actions'; import { Map, fromJS } from 'immutable'; import { pender } from 'redux-pender'; import * as ExchangeAPI from 'lib/api/exchange'; import config from 'config.json'; // action types const SET_SYMBOLS = 'SET_SYMBOLS'; const SET_CONNECTED_EXCHANGE = 'SET_CONNECTED_EXCHANGE'; const SET_EXCHANGE_LIST = 'SET_EXCHANGE_LIST'; const CONNECT_EXCHANGE = 'CONNECT_EXCHANGE'; const DISCONNECT_EXCHANGE = 'DISCONNECT_EXCHANGE'; const SET_ERROR = 'SET_ERROR'; const GET_TICKER = 'GET_TICKER'; // action creator export const setSymbols = createAction(SET_SYMBOLS); export const setConnectedExchange = createAction(SET_CONNECTED_EXCHANGE); export const setExchangeList = createAction(SET_EXCHANGE_LIST); export const connectExchange = createAction(CONNECT_EXCHANGE, ExchangeAPI.connectExchange); export const disconnectExchange = createAction(DISCONNECT_EXCHANGE, ExchangeAPI.disconnectExchange); export const setError = createAction(SET_ERROR); export const getTicker = createAction(GET_TICKER, ExchangeAPI.getTicker); // initial state const initialState = Map({ connectedExchanges: Map({}), exchangeList:[], symbols: Map({}), marketPrice: Map({ bid: 0, ask: 0, last: 0 }), error: Map({}), }); // reducer export default handleActions({ [SET_EXCHANGE_LIST]: (state, action) => { const { value } = action.payload; return state.set('exchangeList', value ); }, [SET_CONNECTED_EXCHANGE]: (state, action) => { const { name, value } = action.payload; return state.setIn(['connectedExchanges', name], value); }, [SET_ERROR]: (state, action) => { return state.set('error', fromJS(action.payload)); }, [SET_SYMBOLS]: (state, action) => { const { name, value } = action.payload; return state.setIn(['symbols', name], value); }, ...pender({ type: CONNECT_EXCHANGE, onSuccess: (state, action) => { const exchangeId = Object.keys(action.payload.data)[0]; const value = Object.values(action.payload.data)[0]; const symbols = Object.values(action.payload.data)[1]; console.log(symbols); const exchangeName = Object.keys(config.exchangeList).find(key => config.exchangeList[key] === exchangeId); return state.setIn(['connectedExchanges', exchangeName], value) .setIn(['symbols', exchangeName], symbols) .set('error', Map({})); }, onFailure: (state, action) => { return state.set('error', Map({connectExchange: "APIKey and Secret are incorrect!"})) } }), ...pender({ type: DISCONNECT_EXCHANGE, onSuccess: (state, action) => { const exchangeId = Object.keys(action.payload.data)[0]; const value = Object.values(action.payload.data)[0]; const exchangeName = Object.keys(config.exchangeList).find(key => config.exchangeList[key] === exchangeId); console.log('exchangeName', exchangeName); return state.setIn(['connectedExchanges', exchangeName], value) .setIn(['symbols', exchangeName], []); } }), ...pender({ type: GET_TICKER, onSuccess: (state, action) => { return state.set('marketPrice', fromJS(action.payload.data)); } }), }, initialState);
1.46875
1
src/index.js
budarin/redux-business-logic-middleare
1
15996364
const getBusinessLogicMiddleware = () => { const actionHandlers = new Map(); return { onAction: (actionId, handler) => { actionHandlers.set(actionId, handler); }, offAction: (actionId) => { actionHandlers.delete(actionId); }, middleware: ({ getState, dispatch }) => (next) => (action) => { const handler = actionHandlers.get(action.type); if (!handler || (handler && !action.meta.bl)) { return next(action); } return handler({ getState, dispatch }, action.payload); }, }; }; exports.getBusinessLogicMiddleware = getBusinessLogicMiddleware;
1.164063
1
src/controllers/user.controller.js
RicardoISMT/ClassyRentP3Backend
0
15996372
const Models = require("../models/index.model"); const sequelize = require("../config/database"); const controller = {}; sequelize.sync(); //registar um novo utilizador controller.registar = async (req, res) => { const user = await Models.User.create(req.body) res.json(user); } //entrar com um utilizador com uma conta existente controller.entrar = async (req, res) => { const {email,pass} = req.body const Email = await Models.User.findOne({ where: {email:email} }) //enviar um erro if(!Email){ return res.status(403).send({ erro: "Email inserido não é válido!" }) } const Validar = pass === Email.pass if(!Validar){ return res.status(403).send({ erro: "Palavra-passe inserido não é correta!" })} res.json(Email) } //eliminar o utilizador controller.eliminar = async (req, res) => { const {id}=req.params const user = await Models.User.destroy({ where: {id} }) if(user){ return res.status(200).json({ sucesso: "O utilizador foi eliminado com sucesso" }) }else{ return res.status(400).json({ erro: "O utilizador não se encontra registado!" })} res.json(user); } //atualizar a password controller.atualizar = async (req, res) => { const {id} = req.params const Data = await Models.User.findByPk(id) if(!Data){ return res.status(400).json({ erro: "Dados inseridos incorretos!" }) } const user = await Models.User.update(req.body,{ where: {id} }) if(user){ return res.status(200).json({ sucesso: "Palavra-passe atualizada com sucesso!" }) }else{ return res.status(400).json({ erro: "Atualização não executada" })} res.json(user); } module.exports = controller;
1.65625
2
lib/protocol/message_model.js
bindsang/ali-ons
146
15996380
'use strict'; module.exports = { BROADCASTING: 'BROADCASTING', CLUSTERING: 'CLUSTERING', };
0.140625
0
packages/javascript/vue2-element/boilerplate/src/apis/http/request.interceptors.js
vrn-deco/boilerplate
67
15996388
/* * @Author: benaozhi * @Date: 2020-07-19 19:37:31 * @Description: */ import store from '@/store' export const registerRequestInterceptors = (axiosInstance) => { // 这里注册你的请求拦截(成功操作) axiosInstance.interceptors.request.use(authorize, handleError) } /** * 请求拦截器 * 前置操作:添加 token 到 header * @param {*} requestConfig */ function authorize(requestConfig) { // 从 store 中获取 token const token = store.getters['auth/token'] // token 存在且请求头中没有 Authorization 字段时添加 if (token && !requestConfig.headers.Authorization) { requestConfig.headers.Authorization = `Bearer ${token}` } return requestConfig } /** * 默认的请求拦截错误 * @param {*} error */ function handleError(error) { const errorInfo = error.data.error ? error.data.error.message : error.data return Promise.reject(errorInfo) }
1.328125
1
JS-Fundamentals/Homeworks-And-Labs/Arrays-Exercise/02.CommonElements/commonElements.js
TanyaStefanova/SoftUni
0
15996396
function commonElements(firstArr, secondArr) { for (let i = 0; i < firstArr.length; i++) { for (let j = 0; j < secondArr.length; j++) { if (secondArr[j] === firstArr[i]) { console.log(firstArr[i]); } } } } commonElements(['S', 'o', 'f', 't', 'U', 'n', 'i', ' '], ['s', 'o', 'c', 'i', 'a', 'l']); // Another decision: // for (let el of firstArr) { // let isCommon = secondArr.includes(el); // if (isCommon) { // console.log(el); // } // }
2.171875
2
rest/src/main/webapp/js/app.js
IHTSDO/OTF-Mapping-Service
14
15996404
'use strict'; // Declare app level module var mapProjectApp = angular.module( 'mapProjectApp', [ 'ngRoute', 'ui.bootstrap', 'ui.tree', 'ngFileUpload', 'ui.tinymce', 'ngCookies', 'mapProjectAppControllers', 'adf', 'mapProjectApp.widgets.metadataList', 'mapProjectApp.widgets.mapProject', 'mapProjectApp.widgets.mapRecord', 'mapProjectApp.widgets.mapEntry', 'mapProjectApp.widgets.workAssigned', 'mapProjectApp.widgets.editedList', 'mapProjectApp.widgets.workAvailable', 'mapProjectApp.widgets.terminologyBrowser', 'mapProjectApp.widgets.compareRecords', 'mapProjectApp.widgets.projectDetails', 'mapProjectApp.widgets.projectRecords', 'mapProjectApp.widgets.recordConcept', 'mapProjectApp.widgets.recordSummary', 'mapProjectApp.widgets.recordAdmin', 'mapProjectApp.widgets.feedback', 'mapProjectApp.widgets.feedbackConversation', 'mapProjectApp.widgets.applicationAdmin', 'mapProjectApp.widgets.report', 'mapProjectApp.widgets.qaCheck', 'mapProjectApp.widgets.indexViewer', 'LocalStorageModule', 'angularjs-dropdown-multiselect' ]) .value('prefix', '').config(function(dashboardProvider) { dashboardProvider.structure('6-6', { rows : [ { columns : [ { styleClass : 'col-md-6' }, { styleClass : 'col-md-6' } ] } ] }).structure('4-8', { rows : [ { columns : [ { styleClass : 'col-md-4', widgets : [] }, { styleClass : 'col-md-8', widgets : [] } ] } ] }).structure('12/4-4-4', { rows : [ { columns : [ { styleClass : 'col-md-12' } ] }, { columns : [ { styleClass : 'col-md-4' }, { styleClass : 'col-md-4' }, { styleClass : 'col-md-4' } ] } ] }).structure('12/6-6', { rows : [ { columns : [ { styleClass : 'col-md-12' } ] }, { columns : [ { styleClass : 'col-md-6' }, { styleClass : 'col-md-6' } ] } ] }).structure('12/6-6/12', { rows : [ { columns : [ { styleClass : 'col-md-12' } ] }, { columns : [ { styleClass : 'col-md-6' }, { styleClass : 'col-md-6' } ] }, { columns : [ { styleClass : 'col-md-12' } ] } ] }); }); // Initialize app config (runs after route provider config) mapProjectApp.run([ '$http', 'appConfig', 'gpService', 'utilService', function($http, appConfig, gpService, utilService) { // Request properties from the server gpService.increment(); $http.get('security/properties').then( // success function(response) { gpService.decrement(); // Copy over to appConfig for ( var key in response.data) { appConfig[key] = response.data[key]; } // if appConfig not set or contains nonsensical values, throw error var errMsg = ''; if (!appConfig) { errMsg += 'Application configuration (appConfig.js) could not be found'; } // Iterate through app config variables and verify interpolation console.debug('Application configuration variables set:'); for ( var key in appConfig) { if (appConfig.hasOwnProperty(key)) { if (!key.includes('security')) { console.debug(' ' + key + ': ' + appConfig[key]); } if (appConfig[key].startsWith('${') && !key.startsWith('projectVersion')) { errMsg += 'Configuration property ' + key + ' not set in project or configuration file'; } } } if (errMsg.length > 0) { // Send an embedded 'data' object utilService.handleError('Configuration Error:\n' + errMsg); } }, // Error function(response) { gpService.decrement(); utilService.handleError(response.data); }); } ]); // set the main application window name // window.name = 'mappingToolWindow'; mapProjectApp.config([ '$rootScopeProvider', '$routeProvider', function($rootScopeProvider, $routeProvider) { $rootScopeProvider.digestTtl(15); // //////////////////////////// // DASHBOARDS // //////////////////////////// $routeProvider.when('/:role/dash', { templateUrl : 'partials/otf-dashboard.html', controller : 'dashboardCtrl' }); // //////////////////////////// // MAPPING SERVICES // //////////////////////////// $routeProvider.when('/project/records', { templateUrl : 'partials/otf-dashboard.html', controller : 'ProjectRecordsDashboardCtrl' }); $routeProvider.when('/project/details', { templateUrl : 'partials/otf-dashboard.html', controller : 'ProjectDetailsDashboardCtrl' }); $routeProvider.when('/record/conceptId/:conceptId', { templateUrl : 'partials/otf-dashboard.html', controller : 'RecordConceptDashboardCtrl' }); $routeProvider.when('/record/conceptId/:conceptId/autologin', { templateUrl : 'partials/otf-dashboard.html', controller : 'LoginCtrl' }); $routeProvider.when('/autologin', { templateUrl : 'partials/otf-dashboard.html', controller : 'LoginCtrl' }); $routeProvider.when('/conversation/recordId/:recordId', { templateUrl : 'partials/otf-dashboard.html', controller : 'FeedbackConversationsDashboardCtrl' }); $routeProvider.when('/record/recordId/:recordId', { templateUrl : 'partials/otf-dashboard.html', controller : 'MapRecordDashboardCtrl' }); $routeProvider.when('/record/conflicts/:recordId', { templateUrl : 'partials/otf-dashboard.html', controller : 'ResolveConflictsDashboardCtrl' }); $routeProvider.when('/record/review/:recordId', { templateUrl : 'partials/otf-dashboard.html', controller : 'ResolveConflictsDashboardCtrl' }); $routeProvider.when('/index/viewer', { templateUrl : 'partials/otf-dashboard.html', controller : 'IndexViewerDashboardCtrl' }); $routeProvider.when('/terminology/browser', { templateUrl : 'partials/otf-dashboard.html', controller : 'terminologyBrowserDashboardCtrl' }); // //////////////////////////// // HELP PAGES // //////////////////////////// $routeProvider.when('/help/:type', { templateUrl : function(params) { return 'partials/doc/' + params.type; } }); // ///////////////////////////// // HOME and ERROR ROUTES // ///////////////////////////// $routeProvider.when('/', { templateUrl : 'partials/login.html', controller : 'LoginCtrl' }); $routeProvider.otherwise({ redirectTo : 'partials/error.html' }); } ]); mapProjectApp.directive('ngDebounce', function($timeout) { return { restrict : 'A', require : 'ngModel', priority : 99, link : function(scope, elm, attr, ngModelCtrl) { if (attr.type === 'radio' || attr.type === 'checkbox') return; elm.unbind('input'); var debounce; elm.bind('input', function() { $timeout.cancel(debounce); debounce = $timeout(function() { scope.$apply(function() { ngModelCtrl.$setViewValue(elm.val()); }); }, attr.ngDebounce || 500); }); elm.bind('blur', function() { scope.$apply(function() { ngModelCtrl.$setViewValue(elm.val()); }); }); } } });
1.070313
1
src/i18n.js
almnes/nimiq-desktop-wallet
0
15996412
import i18n from 'i18next'; import Backend from 'i18next-xhr-backend'; import LanguageDetector from 'i18next-browser-languagedetector'; import { reactI18nextModule } from 'react-i18next'; i18n .use(Backend) .use(LanguageDetector) .use(reactI18nextModule) .init({ fallbackLng: { 'nl-NL': ['nl'], 'en-US': ['en'], 'fr-FR': ['fr'], default: ['en'], }, // have a common namespace used around the full app ns: ['translations'], defaultNS: 'translations', backend: { // path where resources get loaded from loadPath: 'locales/{{lng}}/{{ns}}.json' }, debug: true, interpolation: { escapeValue: false, // not needed for react!! }, react: { wait: true } }); export default i18n;
1.25
1
Desktop/train.js
Phangzs/AST
0
15996420
const spawn = require("child_process").spawn; console.log("Hello") const python = spawn("python",['../training_scripts/mnist.py']) python.stdout.on("data", function(data) { console.log(data.toString()) document.querySelector(".status").innerHTML=data.toString() }) python.stderr.on('data', function(data) { console.log(" * [ERROR] " + data.toString()) })
1.265625
1
src/pages/about.js
Boukhari-Elhoucine/portfolio
0
15996428
import React from "react" import SEO from "../components/seo" import Layout from "../components/layout" import About from "../components/About" function about() { return ( <Layout> <SEO title="about" /> <About /> </Layout> ) } export default about
0.816406
1
bin/ember-i18n-intl-migrator.js
jelhan/ember-i18n-to-intl-migrator
16
15996436
#!/usr/bin/env node 'use strict'; const chalk = require("chalk"); const path = require("path"); const argv = require('yargs').argv const translationTransform = require('../lib/translation-transform'); try { translationTransform(argv.type); console.log(chalk.yellow("Your new translations have been stored in /translations, but your old translation files have not been removed. Please review the result and delete the old translation files if satisfied.")); } catch (e) { console.error(chalk.red(e.stack)); process.exit(-1); }
1.054688
1
index.js
alphaleadership/911-call
0
15996444
const Discord = require("discord.js"); const Client = new Discord.Client(); const { prefix, token } = require("./config.json"); const fs = require("fs"); const low = require("lowdb"); const FileSync = require("lowdb/adapters/FileSync"); const dbdb = new FileSync("interventions.json") const db = low(dbdb) Client.commands = new Discord.Collection(); //status Client.on('ready', () => { console.log("call 911 chargé.") const statuses = [ () => `🌀・help | Utilisateurs : ${Client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)} `, () => `🌀・help | Version 1.0.0`, () => `🌀・help | call 911`, () => `🌀・help | Interventions : 1`, () => `🌀・help | Serveurs : ${Client.guilds.cache.size} `, ]; let i = 0; setInterval(() => { Client.user.setActivity(`${statuses[i]()}`, { type: "PLAYING", }); i = ++i % statuses.length; }, 1e4); }); Client.on("message", async (message) => { if(message.content == "/call-911-fr"){ message.delete() let idmember = message.author.id let intervention = db.get("Interventions").value() let newchannel = await message.guild.channels.create(`911-call-${message.author.username}`, {type: 'text', parent: message.guild.channels.cache.get("838041363143458816")}) db.get("Interventions").value(intervention[Math.floor(Math.random() * intervention.length)]) .catch(err => { let embederreur = new Discord.MessageEmbed() .setColor("#ff0005") .setDescription(":x: | Une erreur est survenue, relancez une intervention.") .setFooter("(c)call 911 | 2021.") message.channel.send(embederreur) }); } }); Client.on("message", (message) => { if(message.author.bot || message.channel.type == "dm") return; if(message.content.startsWith(prefix + "interventions")){ let embedinterventions = new Discord.MessageEmbed() .setColor("#ff0005") .setTitle("Voici toutes les interventions disponibles :") .addField("Incendie :", "1", true) .addField("prise d'otage :", "1", true) .setFooter("(c)call 911 | 2021.") message.channel.send(embedinterventions) } }) Client.login(token)
1.828125
2
src/routes/api/user/all-users.js
JasonHoltzen/casterfire-api-test
0
15996452
import connectDB from '$utils/db.js'; import User from '$models/User.js'; const convertDate = (date) => { let month = (date.getMonth() + 1).toString().padStart(2, 0); let day = date.getDate().toString().padStart(2, 0); let year = date.getFullYear().toString().padStart(2, 0); let hour = date.getHours().toString().padStart(2, 0); let minutes = date.getMinutes().toString().padStart(2, 0); return `${month}.${day}.${year} - ${hour}:${minutes}`; }; export async function get() { try { await connectDB(); const users = (await User.find({}).lean().clone()) || undefined; const playerList = await users.map((user) => { delete user._id; delete user.__v; delete user.email; delete user.password; let date = convertDate(new Date(user.date)); user.date = date; return user; }); return { status: 200, body: { playerList } }; } catch (err) { console.log(err); return err; } }
1.25
1
src/utils/getUserIfAbsent.js
dagsfylla/dagsfylla
4
15996460
import * as Service from '../containers/UserPage/service'; import getRef from './getRef'; export default function getUserIfAbsent(username) { let storageUser = localStorage.getItem('user'); if (!storageUser || JSON.parse(storageUser).username !== username) { return Service.getUserByUsername(username).then(user => { let ref = getRef(user); localStorage.setItem('user', JSON.stringify({ ref, username: user.data.username })); return ref; }); } else { return Promise.resolve(JSON.parse(storageUser).ref); } }
1.234375
1
models/blogpost.js
Commander-lol/bark
1
15996468
const uuid = require('uuid') module.exports = function(sequelize, DataTypes) { return sequelize.define('BlogPost', { id: { type: DataTypes.STRING, defaultValue: uuid.v4, primaryKey: true, }, title: DataTypes.STRING, slug: DataTypes.STRING, excerpt: DataTypes.TEXT, content: DataTypes.TEXT, author_id: { type: DataTypes.INTEGER, references: { model: 'User', key: 'id', }, }, draft: DataTypes.BOOLEAN, published_at: DataTypes.DATE, }, { underscored: true, classMethods: { associate: function(models) { this.belongsTo(models.User, { as: 'author' }) } }, }) };
1.171875
1
src/styles/components/IlustracionesValores.js
jesusrojasweb/orbittas-team
0
15996476
import styled from "styled-components" import { palpitar, floating, color, escalar } from "../animations" export const Palpitar = styled.path` ${palpitar()} ` export const Floating = styled.path` ${floating()} ` export const Aparecer = styled.circle` ${escalar()} ` export const Color = styled.path` ${color()} `
0.441406
0
Nodejs/Crawling.js
sungmun/KakaoChatBot
0
15996484
exports.questRes = function(text,callback){ const openApiURL = 'http://aiopen.etri.re.kr:8000/WiseQAnal'; const access_key = 'YOUR APi KEY'; setTimeout(latereply, 1500); console.log("1"); function latereply(){ callback('검색 시간이 너무 오래 걸려요 :('); console.log("2"); } var requestJson = { access_key: access_key, argument: { text: text } }; var request = require('request'); var options = { url: openApiURL, body: JSON.stringify(requestJson), headers: {'Content-Type':'application/json; charset=UTF-8'} }; request.post(options, function (err, response, body) { try{ var acccountObj = JSON.parse(body); var value = acccountObj.return_object.orgQInfo.orgQUnit.vTitles[0].vEntityInfo[0].strExplain; callback(value); }catch (e){ callback("ERROR"); } }); };
1.34375
1
patients.js
shiki10masaoka14/gatsby-blog
0
15996492
// pages/patient.js import React from "react" import { graphql } from "gatsby" import Layout from "./src/components/layout" import SEO from "./src/components/seo" const PatientsPage = ({ data }) => ( <Layout> <SEO title="consulting" /> {data.allMicrocmsArticles.edges.map(edge => { const articles = edge.node const category = edge.node.category[0].name console.log("◆categoryは" + category) if (category === "consulting") { return ( <React.Fragment key={articles.id}> <div> <h2>{articles.title}</h2> <img src={articles.pict.url} width={110} height={110} alt="pict画像" /> </div> <div> {articles.category.map(category => ( <React.Fragment key={category.id}> <span>カテゴリー:{category.name}</span> </React.Fragment> ))} </div> <hr /> </React.Fragment> ) } else { return } })} </Layout> ) export const query = graphql` { allMicrocmsBlog(sort: { fields: [createdAt], order: DESC }) { edges { node { id title category { id name } pict { url } body } } } } ` export default PatientsPage
1.421875
1
index.js
surmind/gulp-mask
2
15996500
'use strict'; var through = require('through2'); var PluginError = require('gulp-util').PluginError; var PLUGIN_NAME = 'gulp-mask'; module.exports = function (open, close, defaultOpened) { function tester(key) { if (typeof key === 'string') { return function (line) { return line.trim() === key; } } return function (line) { return key.test(line); } } if (!open) { throw new PluginError(PLUGIN_NAME, 'Mask key required'); } var shouldOpen = tester(open); var shouldClose = close && tester(close); return through.obj(function (file, enc, cb) { var opened = defaultOpened; if (file.isNull()) { return cb(); } if (file.isStream()) { throw new PluginError(PLUGIN_NAME, 'Streaming not supported'); } var lines = file.contents.toString('utf8').split("\n"); for (var i = 0; i < lines.length; i++) { if (!opened) { opened = shouldOpen(lines[i]); lines[i] = ""; continue; } if (shouldClose && shouldClose(lines[i])) { opened = false; lines[i] = ""; } } file.contents = new Buffer(lines.join("\n"), 'utf8'); this.push(file); cb(); }); };
1.171875
1
packages/zensroom/lib/modules/rooms/views.js
SachaG/Zensroom
25
15996508
/* Rooms views http://docs.vulcanjs.org/terms-parameters.html#Using-Views */ import Rooms from './collection.js'; Rooms.addView('roomsSearch', terms => ({ options: { sort: {sticky: -1, baseScore: -1} } }));
1.09375
1
src/profile.js
caoxy7/frontend
0
15996516
import React from 'react'; import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; import Modal from 'react-modal'; import {LargeUser, Following, Followers} from './components/user/user.js'; import {UserContents} from './components/content/content.js'; import { url } from './app.js'; import './css/profile.css'; // data: null export class Profile extends React.Component { constructor(props) { super(props); this.state = { user: null, authUser: null, editProfile: false // determine if editprofile pop up }; this.FetchData(); } FetchData() { const { username } = this.props.match.params fetch(url + '/users/'+username, { method: 'GET', }) .then((response) => (response.json())) .then((info) => { console.log(info); this.setState({ user: info, authUser: this.state.authUser, editProfile: this.state.editProfile }); }) .catch((error) => { console.log(error); }); const token = window.localStorage['token']; fetch(url + '/user', { method: 'GET', headers: { 'Authorization': token } }) .then((response) => (response.json())) .then((info) => { console.log(info); this.setState({ user: this.state.user, authUser: info, editProfile: this.state.editProfile }); }) .catch((error) => { console.log(error); }); } handleOpenModal() { const newState = this.state; newState.editProfile = true; this.setState(newState); } handleCloseModal() { const newState = this.state; newState.editProfile = false; this.setState(newState); } render() { if(this.state.user!=null && this.state.authUser!=null){ let EditProfileButton; if(this.state.user.username === this.state.authUser.username){ EditProfileButton = <button onClick={() => {this.handleOpenModal()}}>Edit Profile</button> } else{ EditProfileButton = <br></br> } return ( <Router> <div className='RightPart'> <div>User Profile</div> {EditProfileButton} <LargeUser data={this.state.user} /> <br></br> <Modal isOpen={this.state.editProfile} ariaHideApp={false}> <EditProfile data={this.state.user} /> <button onClick={() => {this.handleCloseModal()}}>Close</button> </Modal> <Switch> <Route exact path="/:username/"> <UserContents data={this.state.user.username} /> </Route> <Route exact path="/:username/following"> <Following data={this.state.user.username} /> </Route> <Route exact path="/:username/followers"> <Followers data={this.state.user.username} /> </Route> </Switch> </div> </Router> ); } else { return ( <div> loading </div> ) } } } // data: user class EditProfile extends React.Component { constructor(props) { super(props); this.state = { image: null, avatar: url+'/'+this.props.data.avatar, bio: this.props.data.bio }; } handleSubmit() { const token = window.localStorage['token']; console.log(token); fetch(url + '/user/info/bio', { method: 'PUT', headers: { 'Authorization': token }, body: JSON.stringify({ bio: this.state.bio }) }) .then((response) => (response.json())) .then((info) => { console.log(info); }) .catch((error) => { console.log(error); }); if(this.state.image != null){ const data = new FormData() data.append('avatar', this.state.image); fetch(url + '/user/info/avatar', { method: 'PUT', headers: { 'Authorization': window.localStorage['token'] }, body: data }) .then((response) => (response.json())) .then((info) => { console.log(info); }) .catch((error) => { console.log(error); }); } } handleBioChange(event) { this.setState({ image: this.state.image, avatar: this.state.avatar, bio: event.target.value }); } handleAvatarChange(event) { const newImage = event.target.files[0]; const newAvatar = URL.createObjectURL(event.target.files[0]); this.setState({ image: newImage, avatar: newAvatar, bio: this.state.bio }); event.target.value = null; } render() { return ( <div className='EditProfile'> <div>Edit Profile</div> <form onSubmit={(event) => { this.handleSubmit() }}> <label> <img src={this.state.avatar} alt=''/> <div> change avatar <input type="file" onChange={(event) => this.handleAvatarChange(event)} /> </div> <div> bio <input type="text" value={this.state.bio} onChange={(event) => this.handleBioChange(event)} /> </div> </label> <input type="submit" value="submit"/> </form> </div> ) } }
1.59375
2
insertGivenContent.js
yorick2/Speedy-Slide-Creator
0
15996524
/** * @param object formObject * @param object templatesLayouts * @return bool */ function shouldRunInsertGivenContentBoolean(formObject,templatesLayouts) { if (!isContentTextGiven(formObject)) { return false; } if(!templatesHaveRquiredPlaceholders(templatesLayouts)){ return false; } return true; } /** * @param object formObject * @return bool */ function isContentTextGiven(formObject) { if (!('content-text' in formObject)) { showAlertMessage('Error getting form field'); return false; } if(formObject['content-text'].length == 0) { showAlertMessage('Please add some content text'); return false; } return true; } /** * @param object templates object */ function templatesHaveRquiredPlaceholders(templatesLayouts) { if(!hasTemplateGotTitlePlaceHolder(templatesLayouts['title'])){ showAlertMessage('Title template dose not have a "Title text placeholder". Please try again.'); return false; } if(!hasTemplateGotBodyTextPlaceHolder(templatesLayouts['body'])){ showAlertMessage('Body template dose not have a "Body text placeholder". Please try again.'); return false; } if(!hasTemplateGotTitlePlaceHolder(templatesLayouts['mixed'])){ showAlertMessage('Mixed template dose not have a "Title text placeholder". Please try again.'); return false; } if(!hasTemplateGotBodyTextPlaceHolder(templatesLayouts['mixed'])){ showAlertMessage('Mixed template dose not have a "Body text placeholder". Please try again.'); return false; } return true; } /** * @param string content * @return array */ function splitContentStringIntoParagraphArray(content) { return content.split(/\r?\n\s*\r?\n/); } // function stripHTML(){ // var re = /(<([^>]+)>)/gi; // for (i=0; i < arguments.length; i++) // arguments[i].value=arguments[i].value.replace(re, "") // } function showSuccessMessage() { showAlertMessage('Slides added to the end of presentation successfully'); } /** * @param object formObject */ function insertGivenContent(formObject) { var templateLayouts = getTemplatesObject(formObject); if(!shouldRunInsertGivenContentBoolean(formObject,templateLayouts)){ return false; } var contentArray = splitContentStringIntoParagraphArray(formObject['content-text']); for(var i=0; i<contentArray.length ;i++){ createSlide(templateLayouts,getContentObject(contentArray[i])); } showSuccessMessage(); }
1.132813
1
node_modules/webvr-polyfill/webpack.config.js
BVRClub/bvrclub.github.io
8
15996532
const fs = require('fs'); const path = require('path'); const webpack = require('webpack'); const licensePath = path.join(__dirname, 'build', 'license.js'); const license = fs.readFileSync(licensePath, 'utf8'); module.exports = { entry: { 'webvr-polyfill': './src/main.js', 'webvr-polyfill.min': './src/main.js', }, output: { path: path.join(__dirname, 'build'), filename: '[name].js', sourceMapFilename: '[name].js.map', }, resolve: { extensions: ['.js', '.json'], }, devtool: 'source-map', devServer: { publicPath: '/build', contentBase: [ path.resolve(__dirname, 'build'), path.resolve(__dirname, 'examples'), ], host: '0.0.0.0', disableHostCheck: true }, plugins: [ new webpack.optimize.UglifyJsPlugin({ include: /\.min\.js$/, }), new webpack.BannerPlugin({ banner: license, raw: true }), ], };
1.046875
1
packages/aora/bin/aora.js
AoraJS/aora
59
15996540
#!/usr/bin/env node const cli = require('../dist/cli.js'); cli.main();
0.421875
0
build/config.js
ZizouAR/WeReakt---Backend
0
15996548
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LOG_DIR = exports.TOKEN_INFO = exports.USER_DETAILS = exports.UPLOAD_SIZE_LIMIT = exports.CORS_URL = exports.db = exports.port = exports.environment = void 0; // Mapper for environment variables exports.environment = process.env.NODE_ENV; exports.port = process.env.PORT; exports.db = { uri: process.env.DB_URI || '', name: process.env.DB_NAME || '', host: process.env.DB_HOST || '', port: process.env.DB_PORT || '', user: process.env.DB_USER || '', password: <PASSWORD>.DB_<PASSWORD>_<PASSWORD> || '', }; exports.CORS_URL = process.env.CORS_URL; exports.UPLOAD_SIZE_LIMIT = process.env.UPLOAD_SIZE_LIMIT; exports.USER_DETAILS = process.env.USER_DETAILS; exports.TOKEN_INFO = { accessTokenValidityDays: parseInt(process.env.ACCESS_TOKEN_VALIDITY_DAYS || '0'), refreshTokenValidityDays: parseInt(process.env.ACCESS_TOKEN_VALIDITY_DAYS || '0'), issuer: process.env.TOKEN_ISSUER || '', audience: process.env.TOKEN_AUDIENCE || '', }; exports.LOG_DIR = process.env.LOG_DIR; //# sourceMappingURL=config.js.map
0.765625
1
doc/html/dir_cfafba98a580ce4b62f8a6fa96d7cbb0.js
hepingood/syn6288
22
15996556
var dir_cfafba98a580ce4b62f8a6fa96d7cbb0 = [ [ "driver_syn6288_advance.c", "driver__syn6288__advance_8c.html", "driver__syn6288__advance_8c" ], [ "driver_syn6288_advance.h", "driver__syn6288__advance_8h.html", "driver__syn6288__advance_8h" ], [ "driver_syn6288_basic.c", "driver__syn6288__basic_8c.html", "driver__syn6288__basic_8c" ], [ "driver_syn6288_basic.h", "driver__syn6288__basic_8h.html", "driver__syn6288__basic_8h" ] ];
-0.318359
0
src/generated/users_grpc_pb.js
ovr/tinkoff-invest-grpc-node
1
15996564
// GENERATED CODE -- DO NOT EDIT! 'use strict'; var grpc = require('@grpc/grpc-js'); var users_pb = require('./users_pb.js'); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); var common_pb = require('./common_pb.js'); function serialize_tinkoff_public_invest_api_contract_v1_GetAccountsRequest(arg) { if (!(arg instanceof users_pb.GetAccountsRequest)) { throw new Error('Expected argument of type tinkoff.public.invest.api.contract.v1.GetAccountsRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_tinkoff_public_invest_api_contract_v1_GetAccountsRequest(buffer_arg) { return users_pb.GetAccountsRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_tinkoff_public_invest_api_contract_v1_GetAccountsResponse(arg) { if (!(arg instanceof users_pb.GetAccountsResponse)) { throw new Error('Expected argument of type tinkoff.public.invest.api.contract.v1.GetAccountsResponse'); } return Buffer.from(arg.serializeBinary()); } function deserialize_tinkoff_public_invest_api_contract_v1_GetAccountsResponse(buffer_arg) { return users_pb.GetAccountsResponse.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_tinkoff_public_invest_api_contract_v1_GetInfoRequest(arg) { if (!(arg instanceof users_pb.GetInfoRequest)) { throw new Error('Expected argument of type tinkoff.public.invest.api.contract.v1.GetInfoRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_tinkoff_public_invest_api_contract_v1_GetInfoRequest(buffer_arg) { return users_pb.GetInfoRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_tinkoff_public_invest_api_contract_v1_GetInfoResponse(arg) { if (!(arg instanceof users_pb.GetInfoResponse)) { throw new Error('Expected argument of type tinkoff.public.invest.api.contract.v1.GetInfoResponse'); } return Buffer.from(arg.serializeBinary()); } function deserialize_tinkoff_public_invest_api_contract_v1_GetInfoResponse(buffer_arg) { return users_pb.GetInfoResponse.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_tinkoff_public_invest_api_contract_v1_GetMarginAttributesRequest(arg) { if (!(arg instanceof users_pb.GetMarginAttributesRequest)) { throw new Error('Expected argument of type tinkoff.public.invest.api.contract.v1.GetMarginAttributesRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_tinkoff_public_invest_api_contract_v1_GetMarginAttributesRequest(buffer_arg) { return users_pb.GetMarginAttributesRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_tinkoff_public_invest_api_contract_v1_GetMarginAttributesResponse(arg) { if (!(arg instanceof users_pb.GetMarginAttributesResponse)) { throw new Error('Expected argument of type tinkoff.public.invest.api.contract.v1.GetMarginAttributesResponse'); } return Buffer.from(arg.serializeBinary()); } function deserialize_tinkoff_public_invest_api_contract_v1_GetMarginAttributesResponse(buffer_arg) { return users_pb.GetMarginAttributesResponse.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_tinkoff_public_invest_api_contract_v1_GetUserTariffRequest(arg) { if (!(arg instanceof users_pb.GetUserTariffRequest)) { throw new Error('Expected argument of type tinkoff.public.invest.api.contract.v1.GetUserTariffRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_tinkoff_public_invest_api_contract_v1_GetUserTariffRequest(buffer_arg) { return users_pb.GetUserTariffRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_tinkoff_public_invest_api_contract_v1_GetUserTariffResponse(arg) { if (!(arg instanceof users_pb.GetUserTariffResponse)) { throw new Error('Expected argument of type tinkoff.public.invest.api.contract.v1.GetUserTariffResponse'); } return Buffer.from(arg.serializeBinary()); } function deserialize_tinkoff_public_invest_api_contract_v1_GetUserTariffResponse(buffer_arg) { return users_pb.GetUserTariffResponse.deserializeBinary(new Uint8Array(buffer_arg)); } var UsersServiceService = exports.UsersServiceService = { // Метод получения счетов пользователя. getAccounts: { path: '/tinkoff.public.invest.api.contract.v1.UsersService/GetAccounts', requestStream: false, responseStream: false, requestType: users_pb.GetAccountsRequest, responseType: users_pb.GetAccountsResponse, requestSerialize: serialize_tinkoff_public_invest_api_contract_v1_GetAccountsRequest, requestDeserialize: deserialize_tinkoff_public_invest_api_contract_v1_GetAccountsRequest, responseSerialize: serialize_tinkoff_public_invest_api_contract_v1_GetAccountsResponse, responseDeserialize: deserialize_tinkoff_public_invest_api_contract_v1_GetAccountsResponse, }, // Расчёт маржинальных показателей по счёту. getMarginAttributes: { path: '/tinkoff.public.invest.api.contract.v1.UsersService/GetMarginAttributes', requestStream: false, responseStream: false, requestType: users_pb.GetMarginAttributesRequest, responseType: users_pb.GetMarginAttributesResponse, requestSerialize: serialize_tinkoff_public_invest_api_contract_v1_GetMarginAttributesRequest, requestDeserialize: deserialize_tinkoff_public_invest_api_contract_v1_GetMarginAttributesRequest, responseSerialize: serialize_tinkoff_public_invest_api_contract_v1_GetMarginAttributesResponse, responseDeserialize: deserialize_tinkoff_public_invest_api_contract_v1_GetMarginAttributesResponse, }, // Запрос тарифа пользователя. getUserTariff: { path: '/tinkoff.public.invest.api.contract.v1.UsersService/GetUserTariff', requestStream: false, responseStream: false, requestType: users_pb.GetUserTariffRequest, responseType: users_pb.GetUserTariffResponse, requestSerialize: serialize_tinkoff_public_invest_api_contract_v1_GetUserTariffRequest, requestDeserialize: deserialize_tinkoff_public_invest_api_contract_v1_GetUserTariffRequest, responseSerialize: serialize_tinkoff_public_invest_api_contract_v1_GetUserTariffResponse, responseDeserialize: deserialize_tinkoff_public_invest_api_contract_v1_GetUserTariffResponse, }, // Метод получения информации о пользователе. getInfo: { path: '/tinkoff.public.invest.api.contract.v1.UsersService/GetInfo', requestStream: false, responseStream: false, requestType: users_pb.GetInfoRequest, responseType: users_pb.GetInfoResponse, requestSerialize: serialize_tinkoff_public_invest_api_contract_v1_GetInfoRequest, requestDeserialize: deserialize_tinkoff_public_invest_api_contract_v1_GetInfoRequest, responseSerialize: serialize_tinkoff_public_invest_api_contract_v1_GetInfoResponse, responseDeserialize: deserialize_tinkoff_public_invest_api_contract_v1_GetInfoResponse, }, }; exports.UsersServiceClient = grpc.makeGenericClientConstructor(UsersServiceService); // Сервис предназначен для получения: </br> **1**. // списка счетов пользователя; </br> **2**. маржинальных показателе по счёту.
1.101563
1
Develop/script.js
clydebaron2000/BCShw5
1
15996572
'use strict'; var eventData = [{ title: "First Event", color: "gold", startDay: "05-08-2020", startHour: 3, startMinute: 0, endDay: "05-08-2020", endHour: 5, endMinute: 30, details: "" }, { title: "Second Event", color: "orange", startDay: "05-08-2020", startHour: 2, startMinute: 30, endDay: "05-08-2020", endHour: 3, endMinute: 0, details: "" } ] var height, maxheight = 45, minHeight = 25; if ($(this).height() > 500) height = maxheight; else height = minHeight; var startDayInWeek = 0; var endDayInWeek = 7; const STARTTIME = 0; const ENDTIME = 24; var smallestInterval = 15; var smallestIntervalPerHour = 60 / smallestInterval; function dayPlanner(startDate = startDayInWeek) { startDayInWeek = startDate; endDayInWeek = startDate + 1; } function threeDayPlanner(startDate = startDayInWeek) { startDayInWeek = startDate; endDayInWeek = startDate + 3; } function weekPlanner(startDate = startDayInWeek) { startDayInWeek = startDate; endDayInWeek = startDate + 7; } $(document).ready(function() { console.log(startDayInWeek + " " + endDayInWeek) const duration = ENDTIME - STARTTIME; const OFFSET = (moment().utcOffset() / 60); const TIMEZONE = "GMT" + ((OFFSET > 0) ? "+" : "") + ((OFFSET < 0) ? "-" : "") + ((Math.abs(OFFSET) < 9) ? "0" : "") + Math.abs(OFFSET); const HEADER_ADJUSTMENT = 5.0391; const FORMATTING = 'DD-MM-YYYY hh:mm'; const AMPM = " A"; var schedule = $(".schedule"); var weekDates = $(".header"); weekDates.append($("<div class='timezone' style='grid-area:timezone'>").text(TIMEZONE)); var weekdays = $("<div class='week' id='weekLabels' style='grid-template-columns: repeat(" + (endDayInWeek - startDayInWeek) + ", 1fr)'>"); for (var i = startDayInWeek; i < endDayInWeek; i++) { var dayLabel = $("<div class='dayLabel'>"); dayLabel.append($("<h>").text(moment().add(i, 'day').format('dddd'))); dayLabel.append($("<h class='dateNumber'>").text(moment().add(i, 'day').format('D'))); dayLabel.append($("<div class='task'>")) weekdays.append(dayLabel); } //task max height: 5.5x tasks weekDates.append(weekdays) var col = $("<div class='head col' style='grid-template-rows: repeat(" + (duration) + ", " + height + "px)'>"); for (var i = STARTTIME; i < duration; i++) { col.append($("<div class='times'>").text((i) + ":00")); } schedule.append(col); var body = $("<div class='body'>"); var line = $("<div class='col' style='z-index:-2;grid-template-rows: repeat(" + (duration) + ", " + height + "px)'>"); for (var i = STARTTIME; i < duration; i++) { line.append($("<div class='spacer'>")); } body.append(line); body.append($("<div class='week' id='overlay' style='grid-template-columns: repeat(" + (endDayInWeek - startDayInWeek) + ", 1fr)'>")); body.append(body); schedule.append(body); var interval = setInterval(function() { }, 1000); var rowHeight = height; function dailyEventToDiv(event) { var status = (false) ? "future" : "past"; var div = $("<div class='" + status + "'>"); div.text(event.title); const start = event.startHour * smallestIntervalPerHour + event.startMinute / (60 / smallestIntervalPerHour) + 1; const end = event.endHour * smallestIntervalPerHour + event.endMinute / (60 / smallestIntervalPerHour) + 1 div.attr("style", "background-color:" + event.color + ";grid-area:" + start.toString() + "/1/" + end.toString() + "/1"); return div; } function displayOverlayGrid() { // https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-area // https://jqueryui.com/draggable/#snap-to // https://github.com/rotaready/moment-range#within var overlay = $("#overlay"); overlay.empty(); for (var i = startDayInWeek; i < endDayInWeek; i++) { var day = $("<div class='col day' id='" + moment().add(i, 'day').format("DD-MM-YYYY") + "' style='padding-right:7px;grid-template-rows: repeat(" + smallestIntervalPerHour * (duration) + "," + (rowHeight) / (smallestIntervalPerHour) + "px)'>"); var dailyListOfEvents = eventData.filter(function(event) { return event.startDay === moment().add(i, 'day').format("DD-MM-YYYY") || event.endDay === moment().add(i, 'day').format("DD-MM-YYYY"); }); for (event of dailyListOfEvents) { day.append(dailyEventToDiv(event)); } overlay.append(day); } $("#weekLabels")[0].style.width = $("#overlay")[0].getBoundingClientRect().width + "px"; $(".timezone")[0].style.width = ($(".head")[0].getBoundingClientRect().width - HEADER_ADJUSTMENT) + "px"; } displayOverlayGrid(); var windowWidth = $(window).width(); var windowHeight = $(window).height(); $(window).on("resize", function() { if ($(this).width() !== windowWidth || $(this).height() !== windowHeight) { windowWidth = $(this).width(); windowHeight = $(this).height(); //do things if (windowHeight > 500) height = maxheight; else height = minHeight; console.log(height); displayOverlayGrid(); } }); function calculateDistance(elem, mouseX, mouseY) { return [(mouseX - (elem.position().left)), (mouseY - (elem.position().top))]; } $("*", document).click(function(e) { var mX = e.pageX; var mY = e.pageY; // if (e.target.getAttribute("class") !== "col day") return; // console.log($("#" + e.target.getAttribute('id'))); // var [dx, dy] = calculateDistance(, mX, mY); var offset = $(this).offset(); e.stopPropagation(); $("#type").text(this.getAttribute('id')); $("#x").text(mX); $("#y").text(mY); $("#dx").text(mX - offset.left); $("#dy").text(mY - offset.top); }); });
1.59375
2
actions/account-notifications.js
oriolhub/ghubber
42
15996580
// @flow import { getNotifications } from 'github-flow-js'; import { ACCOUNT_NOTIFICATIONS_SYNC_START, ACCOUNT_NOTIFICATIONS_SYNC_PROGRESS, ACCOUNT_NOTIFICATIONS_SYNC_FINISH, // ACCOUNT_NOTIFICATIONS_LIMIT } from 'constants'; import Realm from 'utils/realm'; import { paginateBySlice } from 'utils/paginate'; export function trySyncNotifications(): ThunkAction { return (dispatch: Dispatch) => { dispatch(syncNotifications()); }; } export function syncNotifications(): ThunkAction { return async (dispatch: Dispatch, getState: GetState) => { const state = getState(); if (state.accountNotifications && state.accountNotifications.sync) { return; } dispatch({ type: ACCOUNT_NOTIFICATIONS_SYNC_START }); await paginateBySlice( (page: number) => { return getNotifications({ all: true, per_page: ACCOUNT_NOTIFICATIONS_LIMIT, page }); }, ACCOUNT_NOTIFICATIONS_LIMIT, function (result, page) { dispatch({ type: ACCOUNT_NOTIFICATIONS_SYNC_PROGRESS, payload: page }); Realm.write( () => { result.forEach( (notification) => { console.log('persist notification', notification); Realm.create('Notification', { id: notification.id, unread: notification.unread, reason: notification.reason, subject: notification.subject, repository: notification.repository, updated_at: notification.updated_at, }, true); } ); } ); } ); dispatch({ type: ACCOUNT_NOTIFICATIONS_SYNC_FINISH }); }; }
1.328125
1
Assets/Scripts/dist~/Scripts/tsc/src/watch.js
puerts-tsc/startup
0
15996588
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); const fs = __importStar(require("fs")); const ts = __importStar(require("typescript")); const path = __importStar(require("path")); const mkdirp = __importStar(require("mkdirp")); const util_1 = require("./lib/util"); const debugger_1 = require("./lib/debugger"); const cs = puertsRequire('csharp'); const watcher = new class Watcher { cache = []; press(filename) { //打印出事件和相关文件 let file = `${(0, util_1.getTsProjectPath)()}/Examples/src/${filename}`.replace(/\\/g, '/'); let compilerOptions = (0, util_1.getCompilerOptions)(); let oldDir = compilerOptions.outDir; compilerOptions.outDir = path.resolve(compilerOptions.outDir, 'Examples/src', path.dirname(filename)); //delete compilerOptions.outDir; let outFile = filename.replace(/\.ts$/g, '.js'); watch(global.$needCompile = [file], global.$compilerOptions = compilerOptions); let src = path.resolve(compilerOptions.outDir, outFile); //`${ getTsProjectPath() }/Scripts/dist~/Examples/src/${ filename.replace(/\.ts/g, // '.js') }`.replace(/\\/g, '/'); fs.writeFileSync(src.replace('/dist~/', '/bundle/') + '.txt', fs.readFileSync(src)); fs.writeFileSync(src.replace('/dist~/', '/bundle/') + '.map.txt', fs.readFileSync(src + '.map')); //fs.renameSync(src, src.replace(/\.js/g, '.cjs')) //fs.renameSync(src + '.map', src.replace(/\.js/g, '.cjs')) //$this.files.push(path); } constructor() { // setTimeout(() => { // watch([ `${ getTsProjectPath() }/Examples/src/QuickStart.ts` ], getCompilerOptions()); // }, 16); } begin() { let $this = this; let JsMain = cs.Runtime.JsMain; let log = cs.UnityEngine.Debug.Log; let root = `${(0, util_1.getTsProjectPath)()}/Examples/src`; log('puerts hot reload: ' + root); let list = JsMain.getTsFiles(root); let files = JSON.parse(list); files.forEach(name => { console.log(name); if ($this.cache.indexOf(name) == -1) { $this.cache.push(name); $this.press(name); } }); fs.watch(root, { persistent: true, recursive: true, }, function (event, filename) { console.log(event, filename); if (filename.match(/\.ts$/g)) { let index = $this.cache.indexOf(filename); if (index == -1) { if (fs.existsSync(root + '/' + filename)) { $this.cache.push(filename); $this.press(filename); } } else if (!fs.existsSync(root + '/' + filename)) { $this.cache.slice(index, 1); } } }); } debuggers = {}; addDebugger(debuggerPort) { this.debuggers[debuggerPort] = new debugger_1.Debugger({ checkOnStartup: true, trace: true, }); this.debuggers[debuggerPort].open('127.0.0.1', debuggerPort); } removeDebugger(debuggerPort) { if (this.debuggers[debuggerPort]) { this.debuggers[debuggerPort].close(); delete this.debuggers[debuggerPort]; } } emitFileChanged(filepath) { Object.keys(this.debuggers).forEach(key => { try { console.log(`文件更新[${key}]: ${filepath}`); this.debuggers[key].update(filepath); } catch (e) { console.error(e.stack); } }); } }; watcher.begin(); function watch(rootFileNames, options) { const files = {}; // initialize the list of files rootFileNames.forEach(fileName => { files[fileName] = { version: 0 }; }); // Create the language service host to allow the LS to communicate with the host const servicesHost = { getScriptFileNames: () => rootFileNames, getScriptVersion: fileName => files[fileName] && files[fileName].version.toString(), getScriptSnapshot: fileName => { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); }, getCurrentDirectory: () => process.cwd(), getCompilationSettings: () => options, getDefaultLibFileName: options => ts.getDefaultLibFilePath(options), fileExists: ts.sys.fileExists, readFile: ts.sys.readFile, readDirectory: ts.sys.readDirectory, directoryExists: ts.sys.directoryExists, getDirectories: ts.sys.getDirectories, }; // Create the language service files const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()); // Now let's watch the files rootFileNames.forEach(fileName => { // First time around, emit all files emitFile(fileName); // Add a watch on the file to handle next change fs.watchFile(fileName, { persistent: true, interval: 150 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }); }); function emitFile(fileName) { let output = services.getEmitOutput(fileName); if (!output.emitSkipped) { console.log('compiled ts:', fileName); } else { logErrors(fileName); } output.outputFiles.forEach(o => { mkdirp.sync(path.dirname(o.name)); fs.writeFileSync(o.name, o.text, 'utf8'); watcher.emitFileChanged(o.name); }); } function logErrors(fileName) { let allDiagnostics = services .getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat(services.getSemanticDiagnostics(fileName)); allDiagnostics.forEach(diagnostic => { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); if (diagnostic.file) { let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { console.log(` Error: ${message}`); } }); } } // Start the watcher exports.default = watcher; //# sourceMappingURL=watch.js.map
1.359375
1
pages/meetings/september-28-2021.js
stakervali/grincc-next
0
15996596
import React from 'react'; import UserIcon from "../../assets/icons/userIcon"; import RhombusItem from "../../assets/icons/rhombusItem"; import ReactMarkdown from "react-markdown"; import Markdown from "react-markdown"; import RightArrow from "../../assets/icons/rightArrow"; import remarkGfm from "remark-gfm"; import DownRightArrow from "../../assets/icons/downRightArrow"; function September282021(props) { return ( <section className="my-container "> <h1 className="header-1" >Council Meeting Notes September 28, 2021</h1> <p className="py-8">Community Council (CC) meeting held @ 10 UTC in grincoin#general channel on Keybase. Meeting lasted 40 min. Notes are truncated, and conversations sorted based on topic and not always chronological. Quotes are edited for brevity and clarity, and not always exact. </p> <h1 className="header-2" >Community Attendence</h1> <ul> <li><UserIcon /> anynomous</li> <li><UserIcon /> jankie1800</li> <li><UserIcon /> cekickafa</li> <li><UserIcon /> defistaker</li> <li><UserIcon /> future3000</li> </ul> <h1 className="text-2xl text-gray-800 pt-12 pb-4" >Short Summary</h1> <ul> <li><RhombusItem /> Previous contributors of grin project will be listed.</li> <li><RhombusItem /> Developers from other mimblewimble protocol projects will be contacted for atomic swap code review.</li> <li><RhombusItem /> @mcmmike contacted NHash and reserved G1 mini miners in the upcoming batch. Purchase of miners expected to be completed in following months. </li> </ul> <h1 className="text-2xl text-gray-800 pt-12 pb-4" >Agenda Points & Actions </h1> <p>Last meeting's notes <a href="/meetings/september-14-2021" className="text-primary text-sm" > here</a> </p> <ul> <li> <a href="#point_0" className="text-primary">Opening <DownRightArrow/> </a> </li> <li> <a href="#point_1" className="text-primary">2. Atomic Swap PR: status and next steps <DownRightArrow/> </a> </li> <li> <a href="#point_2" className="text-primary"> 3. Implementation of multiple named wallets in the grin-wallet system by sheldonth.<DownRightArrow/> </a></li> <li><a href="#point_3" className="text-primary"> 4. Miners: next steps.<DownRightArrow/> </a> </li> </ul> <div className="px-8" > <h1 id="point_0" className="text-xl mt-10 mb-4 px"> Opening </h1> <ReactMarkdown > {`__anynomous__ : Before we start with the agenda today, let me just repeat this announcement, in case anyone lived under a rock in the passed week and missed it😉: Announcements Community council received funds of 33 BTC: https://forum.grin.mw/t/grin-community-council-cc-received-funds-of-33-btc-lets-get-to-work/9247 __jankie1800__ : exciting news! I am happy to hear OC and Community council have progressed on this initiative __anynomous__ : Yes, we are ready to accept any reasonable applications for funding of any Grin related projects or events :grin: __jankie1800__ : my understanding is we need devs to implement and check the work. Something I hope to report back to the community on soon as I have been working dev-outreach. __anynomous__ : Exactly.`} </ReactMarkdown> <h1 id="point_2" className="text-xl mt-10 mb-4 px">1. Atomic Swap PR: status and next steps </h1> <ReactMarkdown className="meeting-text" remarkPlugins={[remarkGfm]} > {` __anynomous__ : As for agenda point 1. The Atomic Swap implementation is ready to be pulled, but it requires some extensive reviewing. For the moment we most need developers and people with a background in cryptography to check the implementation. __@phyro__ and __@tromp__ come to mind, but they already have a lot on their plate. So on the long run, we really need some extra hands/eyes. __jankie1800__ : gene has committed to staying on with the community for the time being, that will be very helpful for whomever is brought on to implement __anynomous__ : That is great news, that will speed things up. __cekickafa__ : thats really cool. __jankie1800__ : bit of a time is of the essence thing also. Strike while the iron is hot metaphor __anynomous__ : Maybe we should start a training program for cryptography, so we get some more people in the community who could help out. __jankie1800__ : best training is using the tools developed imo ;) __anynomous__ : true, in practice coding and cryptography go hand in hand. __future3000__ : We could try reaching out to other MW projects who have implemented Atomic swaps,eg Beam and ask for comments ( MWC coin claim to have to have it implemented as well, but no telling how secure theirs is). Beam's lead dev would be an ideal person to review it. __anynomous__ : __@future3000__ that is a great idea. Beam and Grin devs have worked together a lot in the passed and if Beam already solved an issue, or Grin, we should simply share the knowledge. __anynomous__ : This also gives me an idea, maybe we should start to actively map the present and past people who have been involved in Grin, so we have hotline to people who might actually be willing to start contributing again in the project, but who are not anymore active. __cekickafa__ : How can Grin stays behind of mwc and other implementations. thats strange and awkward really. if its the money ,Grin had the funds too. __anynomous__ : True, it is indeed a bit weird. There is actually a large network of old contributers and people who care for Grin, it is just that they are not "put to work". __cekickafa__ : thats a problem of us..we better criticize ourselves. where did we stall? __anynomous__ : Indeed. I think the difference is also we have few people on permanent payroll, that is a handicap since it means good people jump to other projects. __cekickafa__ : and this problem continues... __future3000__ : > How can Grin stays behind of mwc and other implementations. thats strange and awkward really. if its the money ,Grin had the funds too. I think part of the issue is that we don't have a lead developer, so have lacked direction. __anynomous__ : Indeed. There is no one person calling the shots, and if one or a few people do call the shots (e.g. Original Council anyone ;)), well people complain about it :sweat_smile: For now that is not something we can tackle, also we should not forget the merits of having a distributed governance model with many involved. __cekickafa__ : OC done their best ,but obstacles..idk community shrank.ecosystem extremely shrank,thnx to asics now it rails __anynomous__ : Yes, in the end what we want to move to (or at least I would like that), is that we have the two councils, as well as working groups of people who do whatever they are best at. Meaning developers develop, artists make wallpapers and great art, others simply share their input. __cekickafa__ : if maybe better reconsider and start from here https://github.com/mimblewimble/grin-pm/issues/385 __anynomous__ : The same goes for the network, we need to make this a dedicated group, people who know and grow the network of developers and cryptographers. And yes, that means we can get to work and bring others to work on that great wishlist: :point_up_2: For now, I think we can pause this topic to be discussed more later. As far as todo's are concerned, we can start the outreach to developers, as well as list all past developers to get a better overview of the potential network of Grinners. `}</ReactMarkdown> <h1 id="point_3" className="text-xl mt-10 mb-4 px">3. Miners: next steps. </h1> <ReactMarkdown className="meeting-text" remarkPlugins={[remarkGfm]} >{` __cekickafa__ : that become a very long story:) __anynomous__ : Yes, long story 😅 So as update, although we have funding now, unfortunately the last batch of miners was just sold out. __@mcmmike__ reached out to NHash and they promised to reserve the miners in the upcoming batch. So hopefully in the coming months we will get that shipment of miners. __cekickafa__ : hope so 😀 __anynomous__ : Anyhow, it is a pity that we miss out on 1-2 months of mining, on the other hand. The new batch might be better or have those cool pictures they showed on Twitter. Apart from that there is not much to discuss about the miners. Hopefully we will have some good news any time soon. I would also like to remind you, that if you are willing to host G1 miners for the community, you can reply to this topic: https://forum.grin.mw/t/community-council-miners-we-need-your-opinion/9133 __cekickafa__ : g1 or g1 mini? i can host g1 mini but not sure g1 :) anynmomous : Most likely it will be all G1 mini's, between 42-48 miners. around 12 can be hosted by the council, which means there will be another 30 to put with community members as well as combined in a mining facility with cheap electricity. I also would like to get some To Do's from this meeting. In general I think we need to better map the people in the community, what they like to work on, especially developers and cryptographers. I would like to volunteer to be part of the group who searches and lists old Grinners that might be 'reactivated' to start Grinning again. Also we can map community members with others interests who might want to form sub-groups that can meet a few times a year or more often, depending on how much time they are willing to spend. __cekickafa__ : perfect! __anynomous__ : Exactly, we are in in a great position to expand, build, systemize and further decentralise everything that is happening in this great project. It is time for the next step, working groups. `} </ReactMarkdown> </div> </section> ); } export default September282021;
1.070313
1
packages/deco-primitives/deco-matrix/index.js
gadge/spare
1
15996604
import { DecoConfig } from '@spare/deco-config' import { DUAL_PRESET_COLLECTION } from '@spare/preset-deco' import { CONFIG } from './resources/config' import { _decoMatrix } from './src/_decoMatrix' export { _decoMatrix } /*** * * @param {Object} p * * @param {boolean} [p.discrete] * @param {string} [p.delim=', '] * * @param {boolean|number} [p.bracket=true] * * @param {Function} [p.read] * * @param {Object|Object[]} [p.presets=[FRESH, OCEAN]] * @param {number} [p.direct=ROWWISE] * * @param {number} [p.top] * @param {number} [p.bottom] * @param {number} [p.left] * @param {number} [p.right] * * @param {boolean} [p.ansi] * @param {boolean} [p.full] * @param {number} [p.level=0] * * @returns {Function} */ export const Deco = (p = {}) => _decoMatrix .bind(DecoConfig.parse(p, CONFIG, DUAL_PRESET_COLLECTION)) /*** * * @param {*[][]} matrix * @param {Object} p * * @param {boolean} [p.discrete] * @param {string} [p.delim=', '] * * @param {boolean|number} [p.bracket=true] * * @param {Function} [p.read] * * @param {Object|Object[]} [p.presets=[FRESH, OCEAN]] * @param {number} [p.direct=ROWWISE] * * @param {number} [p.top] * @param {number} [p.bottom] * @param {number} [p.left] * @param {number} [p.right] * * @param {boolean} [p.ansi] * @param {boolean} [p.full] * @param {number} [p.level=0] * * @returns {string} */ export const deco = (matrix, p = {}) => _decoMatrix .call(DecoConfig.parse(p, CONFIG, DUAL_PRESET_COLLECTION), matrix)
1.070313
1
src/containers/FlightDirector/TaskTemplates/taskConfig.js
Unit1229/thorium-code
0
15996612
import React, {useState} from "react"; import {Input, Button} from "helpers/reactstrap"; import {Mutation, withApollo} from "react-apollo"; import gql from "graphql-tag.macro"; import ValueInput from "../../../components/views/Tasks/core/ValueInput"; import EventPicker from "containers/FlightDirector/MissionConfig/EventPicker"; import EventName from "containers/FlightDirector/MissionConfig/EventName"; import uuid from "uuid"; import MacroConfig from "../../../components/views/Macros/macroConfig"; import {FaBan} from "react-icons/fa"; const TaskConfig = ({ id, name, values, definition, macros, preMacros, reportTypes = [], client, }) => { const updateReportTypes = (which, checked, action) => { const newReportTypes = checked ? reportTypes.concat(which) : reportTypes.filter(c => c !== which); action({ variables: { id, reportTypes: newReportTypes.filter((a, i, arr) => arr.indexOf(a) === i), }, }); }; return ( <div> <label>Definition</label> <Input type="text" readOnly value={definition.name} /> <label>Name</label> <Mutation mutation={gql` mutation RenameTaskTemplate($id: ID!, $name: String!) { renameTaskTemplate(id: $id, name: $name) } `} > {action => ( <Input type="text" defaultValue={name} onBlur={e => action({variables: {id, name: e.target.value}})} /> )} </Mutation> <label>Report Type</label> <Mutation mutation={gql` mutation SetTaskTemplateReportTypes( $id: ID! $reportTypes: [String]! ) { setTaskTemplateReportTypes(id: $id, reportTypes: $reportTypes) } `} > {action => ( <div style={{display: "flex"}}> <label> Damage{" "} <input type="checkbox" checked={reportTypes.indexOf("default") > -1} onChange={e => updateReportTypes("default", e.target.checked, action) } /> </label> <label> R&D{" "} <input type="checkbox" checked={reportTypes.indexOf("rnd") > -1} onChange={e => updateReportTypes("rnd", e.target.checked, action) } /> </label> <label> Engineering{" "} <input type="checkbox" checked={reportTypes.indexOf("engineering") > -1} onChange={e => updateReportTypes("engineering", e.target.checked, action) } /> </label> </div> )} </Mutation> <label>Values</label> <Mutation mutation={gql` mutation SetTaskTemplateValues($id: ID!, $values: JSON!) { setTaskTemplateValues(id: $id, values: $values) } `} > {action => Object.keys(definition.valuesInput).map(v => ( <ValueInput key={v} label={v} type={definition.valuesInput[v]} value={values[v]} definitionValue={definition.valuesValue[v]} onBlur={value => action({ variables: { id, values: { ...values, [v]: value, }, }, }) } /> )) } </Mutation> <Mutation mutation={gql` mutation SetTaskMacro($id: ID!, $macros: [TimelineItemInput]!) { setTaskTemplateMacros(id: $id, macros: $macros) } `} > {action => ( <ConfigureMacro action={action} id={id} macros={macros} client={client} /> )} </Mutation> <Mutation mutation={gql` mutation SetTaskMacro($id: ID!, $macros: [TimelineItemInput]!) { setTaskTemplatePreMacros(id: $id, macros: $macros) } `} > {action => ( <ConfigureMacro pre action={action} id={id} macros={preMacros} client={client} /> )} </Mutation> </div> ); }; export const ConfigureMacro = ({ action, id, macros, client, pre, label = `Will be triggered when task is ${pre ? "created" : "complete"}`, }) => { const [configureMacro, setConfigureMacro] = useState(null); const update = ({id: macroId, ...rest}) => { setConfigureMacro(macro => { return {...macro, ...rest}; }); }; if (configureMacro) { return ( <div className="macro-config"> <div style={{flex: 1}}> <label>Macro Config</label> <MacroConfig action={configureMacro} updateAction={update} client={client} /> </div> <Button size="sm" block color="success" onClick={() => { action({ variables: { id, macros: macros.map(m => m.id === configureMacro.id ? {...m, ...configureMacro} : m, ), }, }); setConfigureMacro(null); }} style={{marginBottom: "20px"}} > Done Configuring Macro </Button> </div> ); } return ( <div> <label> {pre ? "Pre" : ""}Macros <small>{label}</small> </label> <EventPicker className={"btn btn-sm btn-success"} handleChange={e => { const {value: event} = e.target; action({ variables: { id, macros: macros .map(({__typename, ...rest}) => rest) .concat({ event, args: "{}", delay: 0, id: uuid.v4(), }), }, }); }} /> {macros.map(m => ( <div key={m.id} style={{ display: "flex", justifyContent: "space-between", }} > <span> <EventName id={m.event} label={m.event} /> </span>{" "} <Button size="sm" color="warning" onClick={() => setConfigureMacro(m)} > Configure Macro </Button>{" "} <FaBan className="text-danger" onClick={() => action({ variables: { id, macros: macros .map(({__typename, ...rest}) => rest) .filter(mm => mm.id !== m.id), }, }) } /> </div> ))} </div> ); }; export default withApollo(TaskConfig);
1.578125
2
lib/security.js
inria-muse/fathom
3
15996620
/* Fathom - Browser-based Network Measurement Platform Copyright (C) 2011-2016 Inria Paris-Roquencourt International Computer Science Institute (ICSI) See LICENSE for license and terms of usage. */ /** * @fileoverfiew All Fathom security mechanisms are implemented in this module. * @author <NAME> <<EMAIL>> */ const { Unknown } = require('sdk/platform/xpcom'); const {Cc, Ci, Cu} = require("chrome"); const os = require("sdk/system").platform; const data = require("sdk/self").data; const ss = require("sdk/simple-storage"); const _ = require('underscore'); const ipaddr = require('ipaddr.js'); const {error, FathomException} = require("./error"); var dnsservice = Cc["@mozilla.org/network/dns-service;1"] .createInstance(Ci.nsIDNSService); const flags = Ci.nsIDNSService.RESOLVE_DISABLE_IPV6 | Ci.nsIDNSService.RESOLVE_CANONICAL_NAME; /** * Start the API component. */ var start = exports.start = function(reason) { ss.storage['security'] = { 'parse_manifest' : 0, 'parse_manifest_error' : 0, 'check_dst' : 0, 'check_dst_denied' : 0, 'check_server' : 0, 'check_server_denied' : 0 } }; /** * Stop the API component. */ var stop = exports.stop = function() {}; // FIXME: re-implement with the addon localization framework const strings = { "manifest_socket": "Low level network communications", "manifest_socket_udp" : "Low level network communications (UDP unicast)", "manifest_socket_multicast" : "Low level network communications (UDP multicast)", "manifest_socket_broadcast" : "Low level network communications (UDP broadcast)", "manifest_socket_tcp" : "Low level network communications (TCP)", "manifest_socket_method": "Socket method '%s'", "manifest_socket_udp_method" : "UDP socket method '%s'", "manifest_socket_broadcast_method" : "UDP broadcast socket method '%s'", "manifest_socket_multicast_method" : "UDP multicast socket method '%s'", "manifest_socket_tcp_method" : "TCP socket method '%s'", "manifest_proto" : "High level application protocols (HTTP, DNS, mDNS, UPnP)", "manifest_proto_http" : "HTTP protocol", "manifest_proto_dns" : "DNS protocol for name resolution", "manifest_proto_mdns" : "mDNS protocol for device discovery", "manifest_proto_upnp" : "UPnP procotocol for device discovery", "manifest_proto_http_method" : "HTTP protocol method '%s'", "manifest_proto_dns_method" : "DNS protocol method '%s'", "manifest_proto_mdns_method" : "mDNS protocol method '%s'", "manifest_proto_upnp_method" : "UPnP protocol method '%s'", "manifest_tools" : "Networking tools", "manifest_tools_method" : "Network tool '%s'", "manifest_tools_iperf" : "Network throughput measurement tool", "manifest_tools_ping" : "Network delay measurement tool", "manifest_tools_remoteapi" : "Fathom remote communications", "manifest_system": "System configuration and tools", "manifest_system_method" : "System method '%s'", "manifest_dst_mdns" : "Devices discovered using mDNS", "manifest_dst_upnp" : "Devices discovered using UPnP", "manifest_dst_fathom" : "Other devices running Fathom", "manifest_dst_localnet" : "Devices in the local network", "manifest_dst_ip" : "Network host '%s [%s]'", "manifest_dst_ip_proto" : "Network host '%s [%s]' using %s protocol", "manifest_dst_ip_port" : "Network host '%s [%s]' on port %d", "manifest_dst_ip_proto_port" : "Network host '%s [%s]' on port %d using %s protocol" }; // simple helper to format description strings var loc = function(name) { var res = strings[name]; if (arguments.length <= 1) return res; var args = Array.prototype.slice.call(arguments); let offset = 1; res = res.replace(/%(s|d)/g, function (v, n) { let rv = args[offset]; offset++; return rv; }); return res; }; // List of available modules const valid_apis = ['socket','proto','system','tools','baseline']; // List of valid protocols const valid_protos = ['*','tcp','udp','multicast','broadcast','ws','http','xmlhttpreq','mdns','upnp','dns','fathom']; /* Simple Fathom destination URI parser and validation class. */ var URI = function(str) { this.proto = '*'; // default to any proto this.port = '*'; // default to any port this.host = undefined; // IP address this.hostname = undefined; // hostname if given var tmp = str.split('://'); if (tmp.length==2) { this.proto = tmp[0]; str = tmp[1]; } if (this.proto === 'http') { // http defaults this.proto = 'tcp'; this.port = 80; } if (this.proto === 'jsonrpc') { // jsonrpc defaults this.proto = 'udp'; } if (!_.contains(valid_protos,this.proto)) throw new FathomException("invalid proto: " + str); tmp = str.split(':'); if (tmp.length==2 && tmp[1]!=='*') { try { this.port = parseInt(tmp[1]); } catch (e) { throw new FathomException("invalid port: " + tmp[1]); } } if (this.port !== '*' && !(this.port>=0 && this.port <=65565)) throw new FathomException("invalid port: " + str); this.hostname = tmp[0]; if (!this.hostname) throw new FathomException("missing host: " + str); if (this.hostname.indexOf('{') !== 0 && !ipaddr.isValid(this.hostname)) { // NOTE: we are doing sync resolve here but should be ok // as we are not blocking the page context but just the addon .. // FIXME: hmm is that true in fact ? var r = dnsservice.resolve(this.hostname, flags); if (r.hasMore()) { this.host = dnsservice.resolve(this.hostname, flags).getNextAddrAsString(); } else { throw new FathomException("could not resolve host IP: " + this.hostname); } } else { // requested ip or one of the destination groups this.host = this.hostname; } // add a description to the URI (for sec dialog etc) this.descname = 'manifest_dst'; this.desc = undefined; // translated description of this URI switch (this.host) { case '{mdns}': this.descname += '_mdns'; this.desc = loc(this.descname); break; case '{upnp}': this.descname += '_upnp'; this.desc = loc(this.descname); break; case '{fathom}': this.descname += '_mdns'; this.desc = loc(this.descname); break; case '{localnet}': this.descname += '_localnet'; this.desc = loc(this.descname); break; default: if (this.port === '*' && this.proto === '*') { this.descname += '_ip'; this.desc = loc(this.descname, this.hostname, this.host); } else if (this.port === '*' && this.proto !== '*') { this.descname += '_ip_proto'; this.desc = loc(this.descname, this.hostname, this.host, this.proto); } else if (this.port !== '*' && this.proto === '*') { this.descname += '_ip_port'; this.desc = loc(this.descname, this.hostname, this.host, this.port); } else if (this.port !== '*' && this.proto !== '*') { this.descname += '_ip_proto_port'; this.desc = loc(this.descname, this.hostname, this.host, this.port, this.proto); } break; } }; /** * Parse the manifest to an manifest object and remove any invalid * entries. */ var parseManifest = function(manifest) { manifest.isaddon = manifest.isaddon || false; if (!manifest.isaddon) ss.storage['security']['parse_manifest'] += 1; // validated and parsed manifest var res = { description : manifest.description, // script description (optional) apidesc : [], // parsed api descriptions (for UIs) destinations : [], // parsed uris (for UIs) api : {}, // module [->submodule]-> method-> true allowdst : {}, // proto-> ip-> port-> true isaddon : manifest.isaddon, // add-on internal page location: manifest.location, // requesting page location neighbors : {}, // proto -> dict of discovered neighbors }; if (manifest.api) { try { _.each(manifest.api, function(api) { api = api.trim(); var parts = api.split('.'); var apimodule = parts[0]; if (!_.contains(valid_apis,apimodule)) throw "no such api : " + apimodule; if (!res.api[apimodule]) res.api[apimodule] = {}; if (parts.length==2 && parts[1] === '*') { // e.g. system.* res.api[apimodule]['*'] = true; res.apidesc.push({ orig : api, name : "manifest_"+apimodule, desc : loc("manifest_"+apimodule), }); } else if (parts.length==2) { // e.g. system.doPing res.api[apimodule][parts[1]] = true; var name = "manifest_"+apimodule+"_method"; res.apidesc.push({ orig : api, name : name, desc : loc(name, parts[1]), }); } else if (parts.length==3 && parts[2] === '*') { // e.g. proto.dns.* res.api[apimodule][parts[1]] = { '*' : true}; var name = "manifest_"+apimodule+"_"+parts[1]; res.apidesc.push({ orig : api, name : name, desc : loc(name), }); } else if (parts.length==3) { // e.g. proto.dns.lookup if (!res.api[apimodule][parts[1]]) res.api[apimodule][parts[1]] = {} res.api[apimodule][parts[1]][parts[2]] = true; var name = "manifest_"+apimodule+"_"+parts[1]+"_method"; res.apidesc.push({ orig : api, name : name, desc : loc(name, parts[2]), }); } else { throw "Invalid api definition: " + api; } }); } catch (e) { res = error("invalidmanifest",e); if (!manifest.isaddon) ss.storage['security']['parse_manifest_error'] += 1; } } // no api access required ?! if (!res.error && !manifest.isaddon && manifest.destinations) { try { _.each(manifest.destinations, function(dst) { var uri = new URI(dst); if (!res.allowdst[uri.proto]) res.allowdst[uri.proto] = {}; if (!res.allowdst[uri.proto][uri.host]) res.allowdst[uri.proto][uri.host] = {}; if (!res.allowdst[uri.proto][uri.hostname]) res.allowdst[uri.proto][uri.hostname] = {}; // for sec checks res.allowdst[uri.proto][uri.host][uri.port] = true; res.allowdst[uri.proto][uri.hostname][uri.port] = true; // parsed format for UIs res.destinations.push(uri); }); } catch (e) { res = error("invalidmanifest",e.message); if (!manifest.isaddon) ss.storage['security']['parse_manifest_error'] += 1; } } console.info(res); return res; }; exports.parseManifest = parseManifest; /** * Check if the destination (proto://ip:port) is allowed in the manifest * accepted by the user. */ var checkDstPermission = function(dstobj, manifest) { console.info("security destination check",manifest,dstobj); if (!dstobj.host) { console.error("security invalid dstobj in checkDstPermission",dstobj); return false; } if (!_.contains(valid_protos, dstobj.proto)) { console.error("security invalid dstobj.proto in checkDstPermission",dstobj); return false; } if (!manifest.isaddon) ss.storage['security']['check_dst'] += 1; if (!ipaddr.isValid(dstobj.host)) { // see if we have resolved this already (match by name) var predefdst = _.find(manifest.destinations, function(d) { return d.hostname === dstobj.hostname; }); if (!predefdst) { // Most APIs require IP address, do the resolution here // NOTE: this is synchronous .. try { var r = dnsservice.resolve(dstobj.host, flags); if (r.hasMore()) { dstobj.host = dnsservice.resolve(dstobj.host, flags).getNextAddrAsString(); } else { console.error("could not resolve host IP: " + dstobj.host); return false; } } catch (e) { console.error("could not resolve host IP: " + dstobj.host, e); return false; } } else { dstobj.host = predefdst.host; } } if (!manifest.isaddon) { // find the host from discovered neighbors var neighp = _.find(_.keys(manifest.neighbors), function(p) { return (manifest.neighbors[p].hasOwnProperty(dstobj.host) && manifest.neighbors[p][dstobj.host]==true); }); if (neighp) { console.info(dstobj.host + " found with " + neighp); if (manifest.allowdst[dstobj.proto] && manifest.allowdst[dstobj.proto]['{'+neighp+'}']) { if (manifest.allowdst[dstobj.proto]['{'+neighp+'}']['*'] || manifest.allowdst[dstobj.proto]['{'+neighp+'}'][dstobj.port]) { console.info("security allow contact neighbor " + dstobj.host); return true; } } if (manifest.allowdst['*'] && manifest.allowdst['*']['{'+neighp+'}']) { if (manifest.allowdst['*']['{'+neighp+'}']['*'] || manifest.allowdst['*']['{'+neighp+'}'][dstobj.port]) { console.info("security allow contact neighbor " + dstobj.host); return true; } } // check with 'localnet' which includes any neigh discovery protocol neighp = 'localnet'; if (manifest.allowdst[dstobj.proto] && manifest.allowdst[dstobj.proto]['{'+neighp+'}']) { if (manifest.allowdst[dstobj.proto]['{'+neighp+'}']['*'] || manifest.allowdst[dstobj.proto]['{'+neighp+'}'][dstobj.port]) { console.info("security allow contact neighbor " + dstobj.host); return true; } } if (manifest.allowdst['*'] && manifest.allowdst['*']['{'+neighp+'}']) { if (manifest.allowdst['*']['{'+neighp+'}']['*'] || manifest.allowdst['*']['{'+neighp+'}'][dstobj.port]) { console.info("security allow contact neighbor " + dstobj.host); return true; } } } else { // requesting particular proto + host, check 2 cases for port if (manifest.allowdst[dstobj.proto] && manifest.allowdst[dstobj.proto][dstobj.host]) { if (manifest.allowdst[dstobj.proto][dstobj.host]['*'] || manifest.allowdst[dstobj.proto][dstobj.host][dstobj.port]) { console.info("security allow contact listed host " + dstobj.host); return true; } } // requesting any proto + host, check 2 cases for port if (manifest.allowdst["*"] && manifest.allowdst["*"][dstobj.host]) { if (manifest.allowdst['*'][dstobj.host]['*'] || manifest.allowdst['*'][dstobj.host][dstobj.port]) { console.info("security allow contact listed host " + dstobj.host); return true; } } } // does not match if we get here console.info("security not allowed " + dstobj.host); ss.storage['security']['check_dst_denied'] += 1; return false; } // else addon page - allow everything return true; }; exports.checkDstPermission = checkDstPermission; /** * CORS style access control where we check a manifest file on * the server (proto://ip:port) to allow the webpage (manifest.location.origin) * to connect to the server using fathom APIs. */ var checkDstServerPermission = function(dstobj, manifest) { console.info("security server manifest check",dstobj); if (!manifest.isaddon) ss.storage['security']['check_server'] += 1; var ok = true; // TODO: check if we have a recently cached copy of the server manifest // Else fetch the manifest // Compare the manifest.location.origin to the list of allowed origins // in the manifest if (!manifest.isaddon && !ok) ss.storage['security']['check_server_denied'] += 1; return ok; }; exports.checkDstServerPermission = checkDstServerPermission;
1.640625
2
src/levels/castle_inside/areas/3/1/model.inc.js
Bloxxel64/sm64js
172
15996628
// 0x07059200 - 0x07059218 import { gdSPDefLights1, gsDPSetTextureImage, gsDPLoadSync, gsDPLoadBlock, gsSPLight, gsSPVertex, gsSP2Triangles, gsSP1Triangle, gsSPEndDisplayList, gsDPPipeSync, gsDPSetCombineMode, gsSPClearGeometryMode, gsDPSetTile, gsSPTexture, gsDPTileSync, gsDPSetTileSize, gsSPDisplayList, gsSPSetGeometryMode, G_IM_FMT_RGBA, G_IM_SIZ_16b, CALC_DXT, G_TX_LOADTILE, G_IM_SIZ_16b_BYTES, G_CC_MODULATERGB, G_SHADING_SMOOTH, G_TX_WRAP, G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_RENDERTILE, G_ON, G_TEXTURE_IMAGE_FRAC, G_OFF, G_CC_SHADE } from "../../../../../include/gbi" import { inside_09003000, inside_09004000, inside_09005000, inside_09007000, inside_09009000, inside_0900B000 } from "../../../../../textures/inside" const inside_castle_seg7_lights_07059200 = gdSPDefLights1( 0x33, 0x33, 0x33, 0x88, 0x88, 0x88, 0x28, 0x28, 0x28 ); // 0x07059218 - 0x07059230 const inside_castle_seg7_lights_07059218 = gdSPDefLights1( 0x39, 0x39, 0x39, 0x99, 0x99, 0x99, 0x28, 0x28, 0x28 ); // 0x07059230 - 0x07059248 const inside_castle_seg7_lights_07059230 = gdSPDefLights1( 0x3f, 0x3f, 0x3f, 0xaa, 0xaa, 0xaa, 0x28, 0x28, 0x28 ); // 0x07059248 - 0x07059260 const inside_castle_seg7_lights_07059248 = gdSPDefLights1( 0x46, 0x46, 0x46, 0xbb, 0xbb, 0xbb, 0x28, 0x28, 0x28 ); // 0x07059260 - 0x07059278 const inside_castle_seg7_lights_07059260 = gdSPDefLights1( 0x4c, 0x4c, 0x4c, 0xcc, 0xcc, 0xcc, 0x28, 0x28, 0x28 ); // 0x07059278 - 0x07059290 const inside_castle_seg7_lights_07059278 = gdSPDefLights1( 0x52, 0x52, 0x52, 0xdd, 0xdd, 0xdd, 0x28, 0x28, 0x28 ); // 0x07059290 - 0x070592A8 const inside_castle_seg7_lights_07059290 = gdSPDefLights1( 0x59, 0x59, 0x59, 0xee, 0xee, 0xee, 0x28, 0x28, 0x28 ); // 0x070592A8 - 0x070592C0 const inside_castle_seg7_lights_070592A8 = gdSPDefLights1( 0x5f, 0x5f, 0x5f, 0xff, 0xff, 0xff, 0x28, 0x28, 0x28 ); // 0x070592C0 - 0x07059340 const inside_castle_seg7_vertex_070592C0 = [ [[ -3173, -1279, 1485], 0, [ -6928, -4120], [0x00, 0x7f, 0x00, 0xff]], [[ -3020, -1279, 1434], 0, [ -6162, -4376], [0x00, 0x7f, 0x00, 0xff]], [[ -3173, -1279, 1434], 0, [ -6928, -4376], [0x00, 0x7f, 0x00, 0xff]], [[ -3020, -1279, 1485], 0, [ -6162, -4120], [0x00, 0x7f, 0x00, 0xff]], [[ -2815, -1279, 1997], 0, [ -5140, -1564], [0x00, 0x7f, 0x00, 0xff]], [[ -2815, -1279, 1485], 0, [ -5140, -4120], [0x00, 0x7f, 0x00, 0xff]], [[ -3378, -1279, 1485], 0, [ -7950, -4120], [0x00, 0x7f, 0x00, 0xff]], [[ -3364, -1279, 2123], 0, [ -7878, -932], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x07059340 - 0x07059380 const inside_castle_seg7_vertex_07059340 = [ [[ -2713, -1279, 2202], 0, [ -4628, -542], [0x00, 0x7f, 0x00, 0xff]], [[ -3364, -1279, 2123], 0, [ -7878, -932], [0x00, 0x7f, 0x00, 0xff]], [[ -3168, -1279, 2533], 0, [ -6902, 1106], [0x00, 0x7f, 0x00, 0xff]], [[ -2815, -1279, 1997], 0, [ -5140, -1564], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x07059380 - 0x070593C0 const inside_castle_seg7_vertex_07059380 = [ [[ -2508, -1279, 2406], 0, [ -3606, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -3168, -1279, 2533], 0, [ -6902, 1106], [0x00, 0x7f, 0x00, 0xff]], [[ -2839, -1279, 2862], 0, [ -5258, 2750], [0x00, 0x7f, 0x00, 0xff]], [[ -2713, -1279, 2202], 0, [ -4628, -542], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x070593C0 - 0x07059400 const inside_castle_seg7_vertex_070593C0 = [ [[ -2303, -1279, 2509], 0, [ -2584, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -2508, -1279, 2406], 0, [ -3606, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -2839, -1279, 2862], 0, [ -5258, 2750], [0x00, 0x7f, 0x00, 0xff]], [[ -2430, -1279, 3058], 0, [ -3218, 3726], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x07059400 - 0x07059440 const inside_castle_seg7_vertex_07059400 = [ [[ -2098, -1279, 2509], 0, [ -1562, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -2430, -1279, 3058], 0, [ -3218, 3726], [0x00, 0x7f, 0x00, 0xff]], [[ -1972, -1279, 3058], 0, [ -930, 3726], [0x00, 0x7f, 0x00, 0xff]], [[ -2303, -1279, 2509], 0, [ -2584, 990], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x07059440 - 0x07059480 const inside_castle_seg7_vertex_07059440 = [ [[ -1893, -1279, 2406], 0, [ -542, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -2098, -1279, 2509], 0, [ -1562, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -1972, -1279, 3058], 0, [ -930, 3726], [0x00, 0x7f, 0x00, 0xff]], [[ -1562, -1279, 2862], 0, [ 1108, 2750], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x07059480 - 0x070594C0 const inside_castle_seg7_vertex_07059480 = [ [[ -1791, -1279, 2304], 0, [ 0, 0], [0x00, 0x7f, 0x00, 0xff]], [[ -1562, -1279, 2862], 0, [ 1108, 2750], [0x00, 0x7f, 0x00, 0xff]], [[ -1381, -1279, 2714], 0, [ 2012, 2010], [0x00, 0x7f, 0x00, 0xff]], [[ -1893, -1279, 2406], 0, [ -542, 480], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x070594C0 - 0x070595C0 const inside_castle_seg7_vertex_070594C0 = [ [[ -101, -460, 1178], 0, [ 5078, -3354], [0x00, 0x87, 0xdc, 0xff]], [[ -562, -306, 666], 0, [ 7634, -1054], [0x00, 0x87, 0xdc, 0xff]], [[ -101, -306, 666], 0, [ 7634, -3354], [0x00, 0x87, 0xdc, 0xff]], [[ -562, -460, 1178], 0, [ 5078, -1054], [0x00, 0x87, 0xdc, 0xff]], [[ -562, -306, 666], 0, [ 7634, -1054], [0x00, 0x81, 0x00, 0xff]], [[ -101, -306, 256], 0, [ 9678, -3354], [0x00, 0x81, 0x00, 0xff]], [[ -101, -306, 666], 0, [ 7634, -3354], [0x00, 0x81, 0x00, 0xff]], [[ -562, -306, 256], 0, [ 9678, -1054], [0x00, 0x81, 0x00, 0xff]], [[ -101, -767, 256], 0, [ 1756, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -562, -767, 666], 0, [ -540, -1158], [0x00, 0x7f, 0x00, 0xff]], [[ -101, -767, 666], 0, [ 1756, -1158], [0x00, 0x7f, 0x00, 0xff]], [[ -562, -767, 256], 0, [ -540, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -562, -1074, 1178], 0, [ -540, 1748], [0x00, 0x6c, 0x41, 0xff]], [[ -101, -767, 666], 0, [ 1756, -1158], [0x00, 0x6c, 0x41, 0xff]], [[ -562, -767, 666], 0, [ -540, -1158], [0x00, 0x6c, 0x41, 0xff]], [[ -101, -1074, 1178], 0, [ 1756, 1748], [0x00, 0x6c, 0x41, 0xff]], ]; // 0x070595C0 - 0x070596C0 const inside_castle_seg7_vertex_070595C0 = [ [[ -1433, -357, 1178], 0, [ 5078, 3288], [0x00, 0x81, 0x00, 0xff]], [[ -818, -357, 973], 0, [ 6100, 224], [0x00, 0x81, 0x00, 0xff]], [[ -613, -357, 1178], 0, [ 5078, -798], [0x00, 0x81, 0x00, 0xff]], [[ -1279, -1279, 2816], 0, [ 2522, 2520], [0x00, 0x7f, 0x00, 0xff]], [[ -460, -1279, 2816], 0, [ 6610, 2522], [0x00, 0x7f, 0x00, 0xff]], [[ -460, -1279, 1587], 0, [ 6610, -3608], [0x00, 0x7f, 0x00, 0xff]], [[ -1893, -1279, 2202], 0, [ -542, -542], [0x00, 0x7f, 0x00, 0xff]], [[ -1893, -1279, 1587], 0, [ -542, -3608], [0x00, 0x7f, 0x00, 0xff]], [[ -255, -767, 256], 0, [ 990, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -409, -767, 205], 0, [ 224, -3340], [0x00, 0x7f, 0x00, 0xff]], [[ -409, -767, 256], 0, [ 224, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -255, -767, 205], 0, [ 990, -3340], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -357, 973], 0, [ 6100, 2266], [0x00, 0x81, 0x00, 0xff]], [[ -1893, -357, 1178], 0, [ 5078, 5588], [0x00, 0x81, 0x00, 0xff]], [[ 256, -357, 2816], 0, [ -3096, -5142], [0x00, 0x81, 0x00, 0xff]], [[ -1893, -357, 2816], 0, [ -3096, 5588], [0x00, 0x81, 0x00, 0xff]], ]; // 0x070596C0 - 0x070596F0 const inside_castle_seg7_vertex_070596C0 = [ [[ -1893, -357, 1178], 0, [ 5078, 5588], [0x00, 0x81, 0x00, 0xff]], [[ 256, -357, 1178], 0, [ 5078, -5142], [0x00, 0x81, 0x00, 0xff]], [[ 256, -357, 2816], 0, [ -3096, -5142], [0x00, 0x81, 0x00, 0xff]], ]; // 0x070596F0 - 0x070597E0 const inside_castle_seg7_vertex_070596F0 = [ [[ -716, -972, 243], 0, [ -7704, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -972, 243], 0, [ -7704, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -997, 243], 0, [ -7846, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -1049, 358], 0, [ -9086, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -1049, 358], 0, [ -9086, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -1074, 358], 0, [ -9228, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -1074, 358], 0, [ -9228, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -1023, 320], 0, [ -8626, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -1023, 320], 0, [ -8626, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -1049, 320], 0, [ -8768, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -1049, 320], 0, [ -8768, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -997, 282], 0, [ -8166, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -1023, 282], 0, [ -8306, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -1023, 282], 0, [ -8306, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -997, 282], 0, [ -8166, -3098], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x070597E0 - 0x070598D0 const inside_castle_seg7_vertex_070597E0 = [ [[ -716, -869, 90], 0, [ -5862, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -869, 90], 0, [ -5862, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -895, 90], 0, [ -6004, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -972, 243], 0, [ -7704, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -997, 243], 0, [ -7846, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -997, 243], 0, [ -7846, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -946, 205], 0, [ -7244, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -946, 205], 0, [ -7244, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -972, 205], 0, [ -7386, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -972, 205], 0, [ -7386, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -921, 166], 0, [ -6784, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -946, 166], 0, [ -6924, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -946, 166], 0, [ -6924, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -921, 166], 0, [ -6784, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -895, 90], 0, [ -6004, 3032], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x070598D0 - 0x070599C0 const inside_castle_seg7_vertex_070598D0 = [ [[ -716, -793, -25], 0, [ -4480, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -793, -25], 0, [ -4480, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -818, -25], 0, [ -4622, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -895, 128], 0, [ -6322, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -921, 128], 0, [ -6464, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -921, 128], 0, [ -6464, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -895, 128], 0, [ -6322, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -844, 51], 0, [ -5402, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -844, 51], 0, [ -5402, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -869, 51], 0, [ -5544, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -869, 51], 0, [ -5544, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -818, 13], 0, [ -4940, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -844, 13], 0, [ -5082, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -844, 13], 0, [ -5082, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -818, 13], 0, [ -4940, -3098], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x070599C0 - 0x07059AB0 const inside_castle_seg7_vertex_070599C0 = [ [[ -716, -665, -217], 0, [ -2178, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -665, -217], 0, [ -2178, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -690, -217], 0, [ -2318, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -793, -25], 0, [ -4480, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -818, -25], 0, [ -4622, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -818, -25], 0, [ -4622, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -767, -63], 0, [ -4020, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -793, -63], 0, [ -4162, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -793, -63], 0, [ -4162, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -767, -63], 0, [ -4020, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -690, -178], 0, [ -2638, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -690, -178], 0, [ -2638, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -716, -178], 0, [ -2780, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -716, -178], 0, [ -2780, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -690, -217], 0, [ -2318, 3032], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x07059AB0 - 0x07059BA0 const inside_castle_seg7_vertex_07059AB0 = [ [[ -716, -613, -293], 0, [ -1256, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -639, -293], 0, [ -1398, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -639, -293], 0, [ -1398, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -716, -140], 0, [ -3098, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -716, -140], 0, [ -3098, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -741, -140], 0, [ -3240, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -741, -140], 0, [ -3240, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -741, -101], 0, [ -3558, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -767, -101], 0, [ -3700, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -767, -101], 0, [ -3700, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -741, -101], 0, [ -3558, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -639, -255], 0, [ -1716, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -665, -255], 0, [ -1858, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -665, -255], 0, [ -1858, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -639, -255], 0, [ -1716, -3098], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x07059BA0 - 0x07059C90 const inside_castle_seg7_vertex_07059BA0 = [ [[ -716, -537, -409], 0, [ 124, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -537, -409], 0, [ 124, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -562, -409], 0, [ -18, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -613, -293], 0, [ -1256, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -613, -293], 0, [ -1256, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -639, -293], 0, [ -1398, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -588, -332], 0, [ -796, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -588, -332], 0, [ -796, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -613, -332], 0, [ -938, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -613, -332], 0, [ -938, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -562, -370], 0, [ -334, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -588, -370], 0, [ -476, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -588, -370], 0, [ -476, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -562, -370], 0, [ -334, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -562, -409], 0, [ -18, 3032], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x07059C90 - 0x07059D80 const inside_castle_seg7_vertex_07059C90 = [ [[ -716, -409, -601], 0, [ 2426, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -434, -601], 0, [ 2286, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -434, -601], 0, [ 2286, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -511, -447], 0, [ 584, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -511, -447], 0, [ 584, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -537, -447], 0, [ 442, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -537, -447], 0, [ 442, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -485, -485], 0, [ 1046, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -485, -485], 0, [ 1046, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -511, -485], 0, [ 904, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -511, -485], 0, [ 904, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -460, -524], 0, [ 1506, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -485, -524], 0, [ 1364, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -485, -524], 0, [ 1364, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -460, -524], 0, [ 1506, -3098], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x07059D80 - 0x07059DF0 const inside_castle_seg7_vertex_07059D80 = [ [[ -716, -434, -562], 0, [ 1966, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -460, -562], 0, [ 1824, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -460, -562], 0, [ 1824, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -716, -409, -601], 0, [ 2426, 3032], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -409, -601], 0, [ 2426, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -434, -601], 0, [ 2286, -3098], [0x00, 0x00, 0x7f, 0xff]], [[ -1330, -434, -562], 0, [ 1966, -3098], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x07059DF0 - 0x07059EE0 const inside_castle_seg7_vertex_07059DF0 = [ [[ -1330, -972, 243], 0, [ -7704, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -972, 205], 0, [ -7386, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -972, 205], 0, [ -7386, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -1049, 358], 0, [ -9086, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -1049, 320], 0, [ -8768, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -1049, 320], 0, [ -8768, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -1049, 358], 0, [ -9086, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -1023, 320], 0, [ -8626, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -1023, 320], 0, [ -8626, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -1023, 282], 0, [ -8306, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -1023, 282], 0, [ -8306, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -997, 282], 0, [ -8166, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -997, 282], 0, [ -8166, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -997, 243], 0, [ -7846, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -997, 243], 0, [ -7846, -3098], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x07059EE0 - 0x07059FD0 const inside_castle_seg7_vertex_07059EE0 = [ [[ -1330, -869, 90], 0, [ -5862, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -869, 51], 0, [ -5544, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -869, 51], 0, [ -5544, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -972, 243], 0, [ -7704, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -972, 243], 0, [ -7704, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -972, 205], 0, [ -7386, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -946, 205], 0, [ -7244, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -946, 205], 0, [ -7244, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -946, 166], 0, [ -6924, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -946, 166], 0, [ -6924, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -921, 166], 0, [ -6784, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -921, 166], 0, [ -6784, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -921, 128], 0, [ -6464, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -921, 128], 0, [ -6464, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -869, 90], 0, [ -5862, 3032], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x07059FD0 - 0x0705A0C0 const inside_castle_seg7_vertex_07059FD0 = [ [[ -1330, -793, -25], 0, [ -4480, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -793, -63], 0, [ -4162, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -793, -63], 0, [ -4162, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -895, 128], 0, [ -6322, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -895, 90], 0, [ -6004, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -895, 90], 0, [ -6004, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -895, 128], 0, [ -6322, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -844, 51], 0, [ -5402, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -844, 13], 0, [ -5082, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -844, 13], 0, [ -5082, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -844, 51], 0, [ -5402, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -818, 13], 0, [ -4940, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -818, -25], 0, [ -4622, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -818, -25], 0, [ -4622, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -818, 13], 0, [ -4940, 3032], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705A0C0 - 0x0705A1B0 const inside_castle_seg7_vertex_0705A0C0 = [ [[ -1330, -665, -217], 0, [ -2178, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -665, -255], 0, [ -1858, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -665, -255], 0, [ -1858, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -793, -25], 0, [ -4480, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -793, -25], 0, [ -4480, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -793, -63], 0, [ -4162, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -767, -63], 0, [ -4020, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -767, -63], 0, [ -4020, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -767, -101], 0, [ -3700, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -767, -101], 0, [ -3700, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -690, -178], 0, [ -2638, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -690, -217], 0, [ -2318, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -690, -217], 0, [ -2318, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -690, -178], 0, [ -2638, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -665, -217], 0, [ -2178, 3032], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705A1B0 - 0x0705A2A0 const inside_castle_seg7_vertex_0705A1B0 = [ [[ -1330, -613, -293], 0, [ -1256, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -613, -332], 0, [ -938, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -613, -332], 0, [ -938, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -716, -140], 0, [ -3098, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -716, -178], 0, [ -2780, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -716, -178], 0, [ -2780, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -716, -140], 0, [ -3098, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -741, -101], 0, [ -3558, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -741, -140], 0, [ -3240, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -741, -140], 0, [ -3240, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -741, -101], 0, [ -3558, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -639, -255], 0, [ -1716, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -639, -293], 0, [ -1398, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -639, -293], 0, [ -1398, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -639, -255], 0, [ -1716, 3032], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705A2A0 - 0x0705A390 const inside_castle_seg7_vertex_0705A2A0 = [ [[ -1330, -537, -409], 0, [ 124, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -537, -447], 0, [ 442, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -537, -447], 0, [ 442, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -613, -293], 0, [ -1256, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -613, -293], 0, [ -1256, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -613, -332], 0, [ -938, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -588, -332], 0, [ -796, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -588, -370], 0, [ -476, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -588, -370], 0, [ -476, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -588, -332], 0, [ -796, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -562, -370], 0, [ -334, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -562, -409], 0, [ -18, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -562, -409], 0, [ -18, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -562, -370], 0, [ -334, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -537, -409], 0, [ 124, 3032], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705A390 - 0x0705A490 const inside_castle_seg7_vertex_0705A390 = [ [[ -1330, -434, -562], 0, [ 1966, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -434, -601], 0, [ 2286, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -434, -601], 0, [ 2286, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -511, -447], 0, [ 584, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -511, -485], 0, [ 904, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -511, -485], 0, [ 904, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -511, -447], 0, [ 584, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -485, -485], 0, [ 1046, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -485, -485], 0, [ 1046, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -485, -524], 0, [ 1364, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -485, -524], 0, [ 1364, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -460, -562], 0, [ 1824, 3032], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -460, -524], 0, [ 1506, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -460, -524], 0, [ 1506, 2946], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -460, -562], 0, [ 1824, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -434, -562], 0, [ 1966, 3032], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705A490 - 0x0705A590 const inside_castle_seg7_vertex_0705A490 = [ [[ -665, -1074, 1587], 0, [ 478, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -460, -1074, 1792], 0, [ 1500, 2010], [0x00, 0x7f, 0x00, 0xff]], [[ -613, -1074, 1178], 0, [ 734, -1054], [0x00, 0x7f, 0x00, 0xff]], [[ 51, -1074, 2714], 0, [ 4056, 6608], [0x00, 0x7f, 0x00, 0xff]], [[ 256, -1074, 2432], 0, [ 5078, 5204], [0x00, 0x7f, 0x00, 0xff]], [[ 256, -1074, 1562], 0, [ 5078, 862], [0x00, 0x7f, 0x00, 0xff]], [[ 51, -1074, 1280], 0, [ 4056, -544], [0x00, 0x7f, 0x00, 0xff]], [[ -460, -1074, 2816], 0, [ 1500, 7120], [0x00, 0x7f, 0x00, 0xff]], [[ 51, -1074, 2816], 0, [ 4056, 7120], [0x00, 0x7f, 0x00, 0xff]], [[ 51, -1074, 1178], 0, [ 4056, -1054], [0x00, 0x7f, 0x00, 0xff]], [[ 256, -1074, 2150], 0, [ 5078, 3798], [0x00, 0x7f, 0x00, 0xff]], [[ 307, -1074, 2150], 0, [ 5334, 3798], [0x00, 0x7f, 0x00, 0xff]], [[ 307, -1074, 1843], 0, [ 5334, 2266], [0x00, 0x7f, 0x00, 0xff]], [[ 256, -1074, 1843], 0, [ 5078, 2266], [0x00, 0x7f, 0x00, 0xff]], [[ -818, -1074, 973], 0, [ -286, -2076], [0x00, 0x7f, 0x00, 0xff]], [[ -1433, -1074, 1178], 0, [ -3352, -1054], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705A590 - 0x0705A670 const inside_castle_seg7_vertex_0705A590 = [ [[ -1893, -1074, 1587], 0, [ -5650, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -665, -1074, 1587], 0, [ 478, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -1433, -1074, 1178], 0, [ -3352, -1054], [0x00, 0x7f, 0x00, 0xff]], [[ -818, -1074, 973], 0, [ -286, -2076], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1074, 973], 0, [ -2330, -2076], [0x00, 0x7f, 0x00, 0xff]], [[ -1893, -1074, 1178], 0, [ -5650, -1054], [0x00, 0x7f, 0x00, 0xff]], [[ -1177, -1074, 973], 0, [ -2074, -2076], [0x00, 0x7f, 0x00, 0xff]], [[ -869, -1074, 973], 0, [ -540, -2076], [0x00, 0x7f, 0x00, 0xff]], [[ -869, -1074, 922], 0, [ -540, -2332], [0x00, 0x7f, 0x00, 0xff]], [[ -1177, -1074, 922], 0, [ -2074, -2332], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -1074, 358], 0, [ 3034, 2522], [0x00, 0x7f, 0x00, 0xff]], [[ -1330, -1074, 870], 0, [ 3034, 0], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -1074, 870], 0, [ 0, 0], [0x00, 0x7f, 0x00, 0xff]], [[ -716, -1074, 358], 0, [ 0, 2522], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705A670 - 0x0705A6B0 const inside_castle_seg7_vertex_0705A670 = [ [[ -1177, -1074, 922], 0, [ 2268, -288], [0x00, 0x7f, 0x00, 0xff]], [[ -869, -1074, 922], 0, [ 734, -288], [0x00, 0x7f, 0x00, 0xff]], [[ -869, -1074, 870], 0, [ 734, 0], [0x00, 0x7f, 0x00, 0xff]], [[ -1177, -1074, 870], 0, [ 2268, 0], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705A6B0 - 0x0705A7B0 const inside_castle_seg7_vertex_0705A6B0 = [ [[ -101, -460, 1178], 0, [ 10698, -1054], [0x00, 0x00, 0x7f, 0xff]], [[ -101, -1074, 1178], 0, [ 10698, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -50, -1074, 1178], 0, [ 11210, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -562, -767, 256], 0, [ 0, 4564], [0x00, 0x00, 0x7f, 0xff]], [[ -409, -511, 256], 0, [ 1502, 2010], [0x00, 0x00, 0x7f, 0xff]], [[ -562, -306, 256], 0, [ 0, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -409, -767, 256], 0, [ 1502, 4564], [0x00, 0x00, 0x7f, 0xff]], [[ -255, -511, 256], 0, [ 3034, 2010], [0x00, 0x00, 0x7f, 0xff]], [[ -101, -306, 256], 0, [ 4566, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -101, -767, 256], 0, [ 4566, 4564], [0x00, 0x00, 0x7f, 0xff]], [[ -255, -767, 256], 0, [ 3034, 4564], [0x00, 0x00, 0x7f, 0xff]], [[ -562, -460, 1178], 0, [ 6100, -1054], [0x00, 0x00, 0x7f, 0xff]], [[ -50, -357, 1178], 0, [ 11210, -2076], [0x00, 0x00, 0x7f, 0xff]], [[ -1177, -1177, 1766], 0, [ 4056, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1177, 1818], 0, [ 3544, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -1177, -1177, 1818], 0, [ 4056, 990], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705A7B0 - 0x0705A8A0 const inside_castle_seg7_vertex_0705A7B0 = [ [[ -562, -460, 1178], 0, [ 6100, -1054], [0x00, 0x00, 0x7f, 0xff]], [[ -50, -357, 1178], 0, [ 11210, -2076], [0x00, 0x00, 0x7f, 0xff]], [[ -613, -357, 1178], 0, [ 5588, -2076], [0x00, 0x00, 0x7f, 0xff]], [[ -613, -1074, 1178], 0, [ 5590, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -562, -1074, 1178], 0, [ 6100, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -1586, -1177, 1766], 0, [ 0, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -1586, -1177, 1818], 0, [ 0, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1177, 1766], 0, [ 478, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1177, 1818], 0, [ 478, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1177, 1766], 0, [ 3544, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1177, 1818], 0, [ 3544, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -1177, -1177, 1766], 0, [ 4056, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -50, -1279, 2816], 0, [ -5140, 5076], [0x00, 0x00, 0x81, 0xff]], [[ -1177, -1279, 2816], 0, [ 6100, 5076], [0x00, 0x00, 0x81, 0xff]], [[ -1177, -357, 2816], 0, [ 6100, -4120], [0x00, 0x00, 0x81, 0xff]], ]; // 0x0705A8A0 - 0x0705A990 const inside_castle_seg7_vertex_0705A8A0 = [ [[ -665, -1074, 1587], 0, [ 5078, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1177, -1279, 1587], 0, [ 0, 2010], [0x00, 0x00, 0x7f, 0xff]], [[ -665, -1279, 1587], 0, [ 5078, 2010], [0x00, 0x00, 0x7f, 0xff]], [[ -1177, -1074, 1587], 0, [ 0, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1586, -1074, 1587], 0, [ -4118, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1893, -1074, 1587], 0, [ -7184, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1893, -1279, 1587], 0, [ -7184, 2010], [0x00, 0x00, 0x7f, 0xff]], [[ -1586, -1279, 1587], 0, [ -4118, 2010], [0x00, 0x00, 0x7f, 0xff]], [[ -1893, -1279, 2099], 0, [ -3096, 6098], [0x7f, 0x00, 0x00, 0xff]], [[ -1893, -357, 1280], 0, [ 5078, -3098], [0x7f, 0x00, 0x00, 0xff]], [[ -1893, -357, 2099], 0, [ -3096, -3098], [0x7f, 0x00, 0x00, 0xff]], [[ -1893, -1279, 1280], 0, [ 5078, 6098], [0x7f, 0x00, 0x00, 0xff]], [[ 51, -1074, 2714], 0, [ 8144, 5076], [0x9a, 0x00, 0xb6, 0xff]], [[ 51, -357, 2714], 0, [ 8144, -2076], [0x9a, 0x00, 0xb6, 0xff]], [[ 256, -357, 2432], 0, [ 5334, -2076], [0x9a, 0x00, 0xb6, 0xff]], ]; // 0x0705A990 - 0x0705AA70 const inside_castle_seg7_vertex_0705A990 = [ [[ -50, -1279, 2816], 0, [ -5140, 5076], [0x00, 0x00, 0x81, 0xff]], [[ -1177, -357, 2816], 0, [ 6100, -4120], [0x00, 0x00, 0x81, 0xff]], [[ -50, -357, 2816], 0, [ -5140, -4120], [0x00, 0x00, 0x81, 0xff]], [[ 256, -1074, 1715], 0, [ -1818, 5076], [0x81, 0x00, 0x00, 0xff]], [[ 256, -1074, 1843], 0, [ -542, 5076], [0x81, 0x00, 0x00, 0xff]], [[ 256, -818, 1843], 0, [ -542, 2522], [0x81, 0x00, 0x00, 0xff]], [[ 256, -357, 1715], 0, [ -1818, -2076], [0x81, 0x00, 0x00, 0xff]], [[ 256, -818, 2150], 0, [ 2522, 2522], [0x81, 0x00, 0x00, 0xff]], [[ 256, -357, 2278], 0, [ 3800, -2076], [0x81, 0x00, 0x00, 0xff]], [[ 256, -1074, 2278], 0, [ 3800, 5076], [0x81, 0x00, 0x00, 0xff]], [[ 256, -1074, 2150], 0, [ 2522, 5076], [0x81, 0x00, 0x00, 0xff]], [[ 51, -1074, 2714], 0, [ 8144, 5076], [0x9a, 0x00, 0xb6, 0xff]], [[ 256, -357, 2432], 0, [ 5334, -2076], [0x9a, 0x00, 0xb6, 0xff]], [[ 256, -1074, 2432], 0, [ 5334, 5076], [0x9a, 0x00, 0xb6, 0xff]], ]; // 0x0705AA70 - 0x0705AB60 const inside_castle_seg7_vertex_0705AA70 = [ [[ 307, -1074, 2150], 0, [ 480, 990], [0x00, 0x00, 0x81, 0xff]], [[ 256, -818, 2150], 0, [ 990, -1564], [0x00, 0x00, 0x81, 0xff]], [[ 307, -818, 2150], 0, [ 480, -1564], [0x00, 0x00, 0x81, 0xff]], [[ 256, -1074, 1562], 0, [ -3352, 5076], [0x9a, 0x00, 0x4a, 0xff]], [[ 51, -357, 1280], 0, [ -6162, -2076], [0x9a, 0x00, 0x4a, 0xff]], [[ 51, -1074, 1280], 0, [ -6162, 5076], [0x9a, 0x00, 0x4a, 0xff]], [[ 256, -357, 1562], 0, [ -3352, -2076], [0x9a, 0x00, 0x4a, 0xff]], [[ 256, -818, 1843], 0, [ 990, -1564], [0x00, 0x81, 0x00, 0xff]], [[ 307, -818, 1843], 0, [ 480, -1564], [0x00, 0x81, 0x00, 0xff]], [[ 307, -818, 2150], 0, [ 480, -1564], [0x00, 0x81, 0x00, 0xff]], [[ 256, -818, 2150], 0, [ 990, -1564], [0x00, 0x81, 0x00, 0xff]], [[ 256, -1074, 1843], 0, [ 990, 990], [0x00, 0x00, 0x7f, 0xff]], [[ 307, -1074, 1843], 0, [ 480, 990], [0x00, 0x00, 0x7f, 0xff]], [[ 307, -818, 1843], 0, [ 480, -1564], [0x00, 0x00, 0x7f, 0xff]], [[ 256, -818, 1843], 0, [ 990, -1564], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x0705AB60 - 0x0705AC50 const inside_castle_seg7_vertex_0705AB60 = [ [[ -869, -818, 922], 0, [ 480, -1564], [0x81, 0x00, 0x00, 0xff]], [[ -869, -1074, 922], 0, [ 478, 990], [0x81, 0x00, 0x00, 0xff]], [[ -869, -1074, 973], 0, [ 990, 990], [0x81, 0x00, 0x00, 0xff]], [[ 307, -1074, 2150], 0, [ 480, 990], [0x00, 0x00, 0x81, 0xff]], [[ 256, -1074, 2150], 0, [ 990, 990], [0x00, 0x00, 0x81, 0xff]], [[ 256, -818, 2150], 0, [ 990, -1564], [0x00, 0x00, 0x81, 0xff]], [[ -869, -818, 973], 0, [ 3034, 2520], [0x00, 0x00, 0x7f, 0xff]], [[ -818, -357, 973], 0, [ 3544, -2076], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -357, 973], 0, [ -542, -2076], [0x00, 0x00, 0x7f, 0xff]], [[ -1177, -1074, 973], 0, [ 0, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -1177, -818, 973], 0, [ 0, 2520], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1074, 973], 0, [ -540, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -818, -1074, 973], 0, [ 3546, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -869, -1074, 973], 0, [ 3034, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -869, -818, 973], 0, [ 990, -1564], [0x81, 0x00, 0x00, 0xff]], ]; // 0x0705AC50 - 0x0705AD40 const inside_castle_seg7_vertex_0705AC50 = [ [[ -409, -511, 256], 0, [ 990, -1566], [0x00, 0x81, 0x00, 0xff]], [[ -255, -511, 205], 0, [ 480, -1566], [0x00, 0x81, 0x00, 0xff]], [[ -255, -511, 256], 0, [ 990, -1566], [0x00, 0x81, 0x00, 0xff]], [[ -1177, -818, 973], 0, [ 990, -1564], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -1074, 922], 0, [ 478, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -818, 922], 0, [ 480, -1564], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -1074, 973], 0, [ 990, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -818, 922], 0, [ 480, -1564], [0x00, 0x81, 0x00, 0xff]], [[ -869, -818, 973], 0, [ 990, -1564], [0x00, 0x81, 0x00, 0xff]], [[ -1177, -818, 973], 0, [ 990, -1564], [0x00, 0x81, 0x00, 0xff]], [[ -869, -818, 922], 0, [ 480, -1564], [0x00, 0x81, 0x00, 0xff]], [[ -255, -511, 256], 0, [ 990, -1566], [0x81, 0x00, 0x00, 0xff]], [[ -255, -511, 205], 0, [ 480, -1566], [0x81, 0x00, 0x00, 0xff]], [[ -255, -767, 205], 0, [ 478, 990], [0x81, 0x00, 0x00, 0xff]], [[ -255, -767, 256], 0, [ 990, 990], [0x81, 0x00, 0x00, 0xff]], ]; // 0x0705AD40 - 0x0705AE30 const inside_castle_seg7_vertex_0705AD40 = [ [[ -101, -306, 256], 0, [ -8206, -6676], [0x81, 0x00, 0x00, 0xff]], [[ -101, -767, 666], 0, [ -4118, -2076], [0x81, 0x00, 0x00, 0xff]], [[ -101, -306, 666], 0, [ -4118, -6676], [0x81, 0x00, 0x00, 0xff]], [[ -409, -511, 256], 0, [ 990, -1566], [0x00, 0x81, 0x00, 0xff]], [[ -409, -511, 205], 0, [ 480, -1566], [0x00, 0x81, 0x00, 0xff]], [[ -255, -511, 205], 0, [ 480, -1566], [0x00, 0x81, 0x00, 0xff]], [[ -409, -767, 256], 0, [ 990, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -409, -767, 205], 0, [ 478, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -409, -511, 205], 0, [ 480, -1566], [0x7f, 0x00, 0x00, 0xff]], [[ -409, -511, 256], 0, [ 990, -1566], [0x7f, 0x00, 0x00, 0xff]], [[ -562, -767, 666], 0, [ -4118, -2076], [0x7f, 0x00, 0x00, 0xff]], [[ -562, -306, 256], 0, [ -8206, -6676], [0x7f, 0x00, 0x00, 0xff]], [[ -562, -306, 666], 0, [ -4118, -6676], [0x7f, 0x00, 0x00, 0xff]], [[ -562, -460, 1178], 0, [ 990, -5142], [0x7f, 0x00, 0x00, 0xff]], [[ -562, -1074, 1178], 0, [ 990, 990], [0x7f, 0x00, 0x00, 0xff]], ]; // 0x0705AE30 - 0x0705AF30 const inside_castle_seg7_vertex_0705AE30 = [ [[ -101, -767, 666], 0, [ -4118, -2076], [0x81, 0x00, 0x00, 0xff]], [[ -101, -1074, 1178], 0, [ 990, 990], [0x81, 0x00, 0x00, 0xff]], [[ -101, -460, 1178], 0, [ 990, -5142], [0x81, 0x00, 0x00, 0xff]], [[ -101, -306, 666], 0, [ -4118, -6676], [0x81, 0x00, 0x00, 0xff]], [[ -101, -306, 256], 0, [ -8206, -6676], [0x81, 0x00, 0x00, 0xff]], [[ -101, -767, 256], 0, [ -8206, -2076], [0x81, 0x00, 0x00, 0xff]], [[ -562, -767, 666], 0, [ -4118, -2076], [0x7f, 0x00, 0x00, 0xff]], [[ -562, -767, 256], 0, [ -8206, -2076], [0x7f, 0x00, 0x00, 0xff]], [[ -562, -306, 256], 0, [ -8206, -6676], [0x7f, 0x00, 0x00, 0xff]], [[ -1381, -357, 2714], 0, [ -2074, -2076], [0x59, 0x00, 0xa7, 0xff]], [[ -1381, -665, 2714], 0, [ -2074, 990], [0x59, 0x00, 0xa7, 0xff]], [[ -1454, -562, 2641], 0, [ -1052, 0], [0x59, 0x00, 0xa7, 0xff]], [[ -1791, -357, 2304], 0, [ 3706, -2076], [0x59, 0x00, 0xa7, 0xff]], [[ -1586, -1279, 1818], 0, [ 0, 990], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1177, 1818], 0, [ 478, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1586, -1177, 1818], 0, [ 0, 0], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x0705AF30 - 0x0705B020 const inside_castle_seg7_vertex_0705AF30 = [ [[ -1791, -357, 2304], 0, [ 3706, -2076], [0x59, 0x00, 0xa7, 0xff]], [[ -1454, -562, 2641], 0, [ -1052, 0], [0x59, 0x00, 0xa7, 0xff]], [[ -1719, -562, 2376], 0, [ 2684, 0], [0x59, 0x00, 0xa7, 0xff]], [[ -1791, -665, 2304], 0, [ 3706, 990], [0x59, 0x00, 0xa7, 0xff]], [[ -1586, -946, 1536], 0, [ 0, -2332], [0x00, 0x00, 0x81, 0xff]], [[ -1535, -1074, 1536], 0, [ 480, -1054], [0x00, 0x00, 0x81, 0xff]], [[ -1586, -1074, 1536], 0, [ 0, -1054], [0x00, 0x00, 0x81, 0xff]], [[ -1535, -946, 1536], 0, [ 480, -2332], [0x00, 0x00, 0x81, 0xff]], [[ -1586, -1177, 1766], 0, [ 0, 0], [0x00, 0x59, 0x5a, 0xff]], [[ -1535, -997, 1587], 0, [ 480, -1820], [0x00, 0x59, 0x5a, 0xff]], [[ -1586, -997, 1587], 0, [ 0, -1820], [0x00, 0x59, 0x5a, 0xff]], [[ -1535, -1177, 1766], 0, [ 478, 0], [0x00, 0x59, 0x5a, 0xff]], [[ -1228, -1279, 1818], 0, [ 3544, 990], [0x00, 0x00, 0x7f, 0xff]], [[ -1177, -1177, 1818], 0, [ 4056, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1177, 1818], 0, [ 3544, 0], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x0705B020 - 0x0705B100 const inside_castle_seg7_vertex_0705B020 = [ [[ -1586, -1279, 1818], 0, [ 0, 990], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1279, 1818], 0, [ 478, 990], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1177, 1818], 0, [ 478, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -946, 1536], 0, [ 3544, -2332], [0x00, 0x00, 0x81, 0xff]], [[ -1177, -1074, 1536], 0, [ 4056, -1054], [0x00, 0x00, 0x81, 0xff]], [[ -1228, -1074, 1536], 0, [ 3544, -1054], [0x00, 0x00, 0x81, 0xff]], [[ -1177, -946, 1536], 0, [ 4056, -2332], [0x00, 0x00, 0x81, 0xff]], [[ -1228, -1177, 1766], 0, [ 3544, 0], [0x00, 0x59, 0x5a, 0xff]], [[ -1177, -1177, 1766], 0, [ 4056, 0], [0x00, 0x59, 0x5a, 0xff]], [[ -1177, -997, 1587], 0, [ 4056, -1820], [0x00, 0x59, 0x5a, 0xff]], [[ -1228, -997, 1587], 0, [ 3544, -1820], [0x00, 0x59, 0x5a, 0xff]], [[ -1228, -1279, 1818], 0, [ 3544, 990], [0x00, 0x00, 0x7f, 0xff]], [[ -1177, -1279, 1818], 0, [ 4056, 990], [0x00, 0x00, 0x7f, 0xff]], [[ -1177, -1177, 1818], 0, [ 4056, 0], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x0705B100 - 0x0705B200 const inside_castle_seg7_vertex_0705B100 = [ [[ -1791, -1074, 1178], 0, [ -6162, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -1433, -1074, 1178], 0, [ -2584, 5076], [0x00, 0x00, 0x7f, 0xff]], [[ -1433, -357, 1178], 0, [ -2586, -2076], [0x00, 0x00, 0x7f, 0xff]], [[ -1791, -357, 1178], 0, [ -6162, -2076], [0x00, 0x00, 0x7f, 0xff]], [[ -1433, -357, 1178], 0, [ -2586, -2076], [0x59, 0x00, 0x59, 0xff]], [[ -1433, -1074, 1178], 0, [ -2584, 5076], [0x59, 0x00, 0x59, 0xff]], [[ -1228, -1074, 973], 0, [ -540, 5076], [0x59, 0x00, 0x59, 0xff]], [[ -1228, -357, 973], 0, [ -542, -2076], [0x59, 0x00, 0x59, 0xff]], [[ -818, -357, 973], 0, [ 3544, -2076], [0xa7, 0x00, 0x59, 0xff]], [[ -613, -1074, 1178], 0, [ 5590, 5076], [0xa7, 0x00, 0x59, 0xff]], [[ -613, -357, 1178], 0, [ 5588, -2076], [0xa7, 0x00, 0x59, 0xff]], [[ -818, -1074, 973], 0, [ 3546, 5076], [0xa7, 0x00, 0x59, 0xff]], [[ -460, -1074, 1792], 0, [ -2074, 0], [0x81, 0x00, 0x00, 0xff]], [[ -460, -1279, 2816], 0, [ 8144, 2010], [0x81, 0x00, 0x00, 0xff]], [[ -460, -1074, 2816], 0, [ 8144, 0], [0x81, 0x00, 0x00, 0xff]], [[ -460, -1279, 1792], 0, [ -2074, 2010], [0x81, 0x00, 0x00, 0xff]], ]; // 0x0705B200 - 0x0705B300 const inside_castle_seg7_vertex_0705B200 = [ [[ -1535, -946, 1587], 0, [ 480, -2332], [0x00, 0x00, 0x7f, 0xff]], [[ -1586, -946, 1587], 0, [ 0, -2332], [0x00, 0x00, 0x7f, 0xff]], [[ -1586, -997, 1587], 0, [ 0, -1820], [0x00, 0x00, 0x7f, 0xff]], [[ -665, -1074, 1587], 0, [ 0, 0], [0xa7, 0x00, 0x59, 0xff]], [[ -665, -1279, 1587], 0, [ 0, 2010], [0xa7, 0x00, 0x59, 0xff]], [[ -460, -1279, 1792], 0, [ 2858, 2010], [0xa7, 0x00, 0x59, 0xff]], [[ -460, -1074, 1792], 0, [ 2858, 0], [0xa7, 0x00, 0x59, 0xff]], [[ -1535, -946, 1536], 0, [ 0, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -1586, -946, 1587], 0, [ 478, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -946, 1587], 0, [ 478, 480], [0x00, 0x7f, 0x00, 0xff]], [[ -1586, -946, 1536], 0, [ 0, 990], [0x00, 0x7f, 0x00, 0xff]], [[ -1177, -946, 1536], 0, [ 0, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -946, 1536], 0, [ 0, -2588], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -946, 1587], 0, [ 478, -2588], [0x00, 0x7f, 0x00, 0xff]], [[ -1177, -946, 1587], 0, [ 478, -3098], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -997, 1587], 0, [ 480, -1820], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x0705B300 - 0x0705B3E0 const inside_castle_seg7_vertex_0705B300 = [ [[ -1177, -946, 1587], 0, [ 4056, -2332], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -946, 1587], 0, [ 3544, -2332], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -997, 1587], 0, [ 3544, -1820], [0x00, 0x00, 0x7f, 0xff]], [[ -1177, -997, 1587], 0, [ 4056, -1820], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -997, 1587], 0, [ -286, -798], [0x81, 0x00, 0x00, 0xff]], [[ -1228, -946, 1536], 0, [ -796, -1310], [0x81, 0x00, 0x00, 0xff]], [[ -1228, -1279, 1818], 0, [ 2012, 2010], [0x81, 0x00, 0x00, 0xff]], [[ -1228, -946, 1587], 0, [ -286, -1310], [0x81, 0x00, 0x00, 0xff]], [[ -1228, -1279, 1536], 0, [ -796, 2010], [0x81, 0x00, 0x00, 0xff]], [[ -1228, -1177, 1766], 0, [ 1502, 990], [0x81, 0x00, 0x00, 0xff]], [[ -1228, -1177, 1818], 0, [ 2012, 990], [0x81, 0x00, 0x00, 0xff]], [[ -1535, -946, 1536], 0, [ -796, -1310], [0x7f, 0x00, 0x00, 0xff]], [[ -1535, -946, 1587], 0, [ -286, -1310], [0x7f, 0x00, 0x00, 0xff]], [[ -1535, -997, 1587], 0, [ -286, -798], [0x7f, 0x00, 0x00, 0xff]], ]; // 0x0705B3E0 - 0x0705B4E0 const inside_castle_seg7_vertex_0705B3E0 = [ [[ -1586, -946, 1536], 0, [ -796, -1310], [0x81, 0x00, 0x00, 0xff]], [[ -1586, -1279, 1536], 0, [ -796, 2010], [0x81, 0x00, 0x00, 0xff]], [[ -1586, -1279, 1818], 0, [ 2012, 2010], [0x81, 0x00, 0x00, 0xff]], [[ -1586, -997, 1587], 0, [ -286, -798], [0x81, 0x00, 0x00, 0xff]], [[ -1586, -946, 1587], 0, [ -286, -1310], [0x81, 0x00, 0x00, 0xff]], [[ -1586, -1177, 1818], 0, [ 2012, 990], [0x81, 0x00, 0x00, 0xff]], [[ -1586, -1177, 1766], 0, [ 1502, 990], [0x81, 0x00, 0x00, 0xff]], [[ -1535, -1177, 1766], 0, [ 1502, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -1535, -1177, 1818], 0, [ 2012, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -1535, -1279, 1818], 0, [ 2012, 2010], [0x7f, 0x00, 0x00, 0xff]], [[ -1535, -946, 1536], 0, [ -796, -1310], [0x7f, 0x00, 0x00, 0xff]], [[ -1535, -1279, 1536], 0, [ -796, 2010], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -1177, 1766], 0, [ 1502, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -1279, 1818], 0, [ 2012, 2010], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -946, 1536], 0, [ -796, -1310], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -1279, 1536], 0, [ -796, 2010], [0x7f, 0x00, 0x00, 0xff]], ]; // 0x0705B4E0 - 0x0705B5C0 const inside_castle_seg7_vertex_0705B4E0 = [ [[ -1177, -1177, 1766], 0, [ 1502, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -1177, 1818], 0, [ 2012, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -1279, 1818], 0, [ 2012, 2010], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -946, 1536], 0, [ -796, -1310], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -946, 1587], 0, [ -286, -1310], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -997, 1587], 0, [ -286, -798], [0x7f, 0x00, 0x00, 0xff]], [[ -1228, 307, -716], 0, [ 4056, -3610], [0x50, 0xb0, 0xc7, 0xff]], [[ -1330, -562, 358], 0, [ 5078, 5076], [0x50, 0xb0, 0xc7, 0xff]], [[ -1330, 205, -716], 0, [ 5078, -2588], [0x50, 0xb0, 0xc7, 0xff]], [[ -1228, -460, 358], 0, [ 4056, 4054], [0x50, 0xb0, 0xc7, 0xff]], [[ -818, 307, -716], 0, [ 0, -3610], [0x00, 0x99, 0xb7, 0xff]], [[ -1228, -460, 358], 0, [ 4056, 4054], [0x00, 0x99, 0xb7, 0xff]], [[ -1228, 307, -716], 0, [ 4056, -3610], [0x00, 0x99, 0xb7, 0xff]], [[ -818, -460, 358], 0, [ 0, 4054], [0x00, 0x99, 0xb7, 0xff]], ]; // 0x0705B5C0 - 0x0705B6C0 const inside_castle_seg7_vertex_0705B5C0 = [ [[ -716, 205, -716], 0, [ -1052, -2588], [0xb0, 0xb0, 0xc7, 0xff]], [[ -818, -460, 358], 0, [ 0, 4054], [0xb0, 0xb0, 0xc7, 0xff]], [[ -818, 307, -716], 0, [ 0, -3610], [0xb0, 0xb0, 0xc7, 0xff]], [[ -716, -562, 358], 0, [ -1052, 5076], [0xb0, 0xb0, 0xc7, 0xff]], [[ -1330, -562, 358], 0, [ -1052, -2076], [0x7f, 0x00, 0x00, 0xff]], [[ -1330, -1074, 870], 0, [ 4056, 3032], [0x7f, 0x00, 0x00, 0xff]], [[ -1330, -1074, 358], 0, [ -1052, 3032], [0x7f, 0x00, 0x00, 0xff]], [[ -1330, -562, 870], 0, [ 4056, -2076], [0x7f, 0x00, 0x00, 0xff]], [[ -1228, -460, 358], 0, [ -1052, -3098], [0x59, 0xa7, 0x00, 0xff]], [[ -1330, -562, 870], 0, [ 4056, -2076], [0x59, 0xa7, 0x00, 0xff]], [[ -1330, -562, 358], 0, [ -1052, -2076], [0x59, 0xa7, 0x00, 0xff]], [[ -1228, -460, 870], 0, [ 4056, -3098], [0x59, 0xa7, 0x00, 0xff]], [[ -818, -460, 358], 0, [ 0, 0], [0x00, 0x81, 0x00, 0xff]], [[ -1228, -460, 870], 0, [ 4056, 5076], [0x00, 0x81, 0x00, 0xff]], [[ -1228, -460, 358], 0, [ 4056, 0], [0x00, 0x81, 0x00, 0xff]], [[ -818, -460, 870], 0, [ 0, 5076], [0x00, 0x81, 0x00, 0xff]], ]; // 0x0705B6C0 - 0x0705B7B0 const inside_castle_seg7_vertex_0705B6C0 = [ [[ -869, -818, 870], 0, [ -542, 3542], [0x00, 0x00, 0x81, 0xff]], [[ -1177, -818, 870], 0, [ 2524, 3542], [0x00, 0x00, 0x81, 0xff]], [[ -1228, -460, 870], 0, [ 3034, 0], [0x00, 0x00, 0x81, 0xff]], [[ -716, -1074, 358], 0, [ -1052, 3032], [0x81, 0x00, 0x00, 0xff]], [[ -716, -1074, 870], 0, [ 4056, 3032], [0x81, 0x00, 0x00, 0xff]], [[ -716, -562, 358], 0, [ -1052, -2076], [0x81, 0x00, 0x00, 0xff]], [[ -716, -562, 870], 0, [ 4056, -2076], [0x81, 0x00, 0x00, 0xff]], [[ -716, -562, 358], 0, [ -1052, -2076], [0xa7, 0xa7, 0x00, 0xff]], [[ -716, -562, 870], 0, [ 4056, -2076], [0xa7, 0xa7, 0x00, 0xff]], [[ -818, -460, 870], 0, [ 4056, -3098], [0xa7, 0xa7, 0x00, 0xff]], [[ -818, -460, 358], 0, [ -1052, -3098], [0xa7, 0xa7, 0x00, 0xff]], [[ -716, -1074, 870], 0, [ -2074, 6098], [0x00, 0x00, 0x81, 0xff]], [[ -818, -460, 870], 0, [ -1052, 0], [0x00, 0x00, 0x81, 0xff]], [[ -869, -1074, 870], 0, [ -542, 6098], [0x00, 0x00, 0x81, 0xff]], [[ -716, -562, 870], 0, [ -2074, 990], [0x00, 0x00, 0x81, 0xff]], ]; // 0x0705B7B0 - 0x0705B8B0 const inside_castle_seg7_vertex_0705B7B0 = [ [[ -1177, -818, 922], 0, [ 478, -1564], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -1074, 922], 0, [ 478, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -1074, 870], 0, [ 990, 990], [0x7f, 0x00, 0x00, 0xff]], [[ -1330, -1074, 870], 0, [ 4056, 6098], [0x00, 0x00, 0x81, 0xff]], [[ -1330, -562, 870], 0, [ 4056, 990], [0x00, 0x00, 0x81, 0xff]], [[ -1228, -460, 870], 0, [ 3034, 0], [0x00, 0x00, 0x81, 0xff]], [[ -1177, -818, 870], 0, [ 2524, 3542], [0x00, 0x00, 0x81, 0xff]], [[ -1177, -1074, 870], 0, [ 2524, 6098], [0x00, 0x00, 0x81, 0xff]], [[ -869, -818, 870], 0, [ 990, -1564], [0x81, 0x00, 0x00, 0xff]], [[ -869, -1074, 922], 0, [ 478, 990], [0x81, 0x00, 0x00, 0xff]], [[ -869, -818, 922], 0, [ 478, -1564], [0x81, 0x00, 0x00, 0xff]], [[ -869, -1074, 870], 0, [ 990, 990], [0x81, 0x00, 0x00, 0xff]], [[ -1177, -818, 870], 0, [ 990, -1564], [0x7f, 0x00, 0x00, 0xff]], [[ -1177, -818, 870], 0, [ 990, -1564], [0x00, 0x81, 0x00, 0xff]], [[ -869, -818, 870], 0, [ 990, -1564], [0x00, 0x81, 0x00, 0xff]], [[ -869, -818, 922], 0, [ 478, -1564], [0x00, 0x81, 0x00, 0xff]], ]; // 0x0705B8B0 - 0x0705B960 const inside_castle_seg7_vertex_0705B8B0 = [ [[ -1177, -818, 870], 0, [ 990, -1564], [0x00, 0x81, 0x00, 0xff]], [[ -869, -818, 922], 0, [ 478, -1564], [0x00, 0x81, 0x00, 0xff]], [[ -1177, -818, 922], 0, [ 478, -1564], [0x00, 0x81, 0x00, 0xff]], [[ -716, -456, -613], 0, [ 4568, 954], [0x81, 0x00, 0x00, 0xff]], [[ -716, -562, 358], 0, [ -5140, 2010], [0x81, 0x00, 0x00, 0xff]], [[ -716, 132, -613], 0, [ 4568, -4924], [0x81, 0x00, 0x00, 0xff]], [[ -716, -1074, 358], 0, [ -5140, 7120], [0x81, 0x00, 0x00, 0xff]], [[ -1330, 132, -613], 0, [ 4568, -4924], [0x7f, 0x00, 0x00, 0xff]], [[ -1330, -562, 358], 0, [ -5140, 2010], [0x7f, 0x00, 0x00, 0xff]], [[ -1330, -456, -613], 0, [ 4568, 954], [0x7f, 0x00, 0x00, 0xff]], [[ -1330, -1074, 358], 0, [ -5140, 7120], [0x7f, 0x00, 0x00, 0xff]], ]; // 0x0705B960 - 0x0705BA50 const inside_castle_seg7_vertex_0705B960 = [ [[ -1535, -1100, 1613], 0, [ 0, 240], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1100, 1613], 0, [ 990, 240], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1100, 1587], 0, [ 0, 112], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1074, 1587], 0, [ 990, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1074, 1587], 0, [ 0, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1100, 1587], 0, [ 0, 112], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1100, 1587], 0, [ 990, 112], [0x00, 0x00, 0x7f, 0xff]], [[ -50, -357, 1229], 0, [ 224, 0], [0xa6, 0x00, 0x58, 0xff]], [[ 0, -1074, 1280], 0, [ 734, 2012], [0xa6, 0x00, 0x58, 0xff]], [[ 0, -357, 1280], 0, [ 734, 0], [0xa6, 0x00, 0x58, 0xff]], [[ 0, -357, 1280], 0, [ 734, 0], [0x00, 0x00, 0x7f, 0xff]], [[ 51, -1074, 1280], 0, [ 990, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ 51, -357, 1280], 0, [ 990, 0], [0x00, 0x00, 0x7f, 0xff]], [[ 0, -1074, 1280], 0, [ 734, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -50, -1074, 1229], 0, [ 224, 2012], [0xa6, 0x00, 0x58, 0xff]], ]; // 0x0705BA50 - 0x0705BB30 const inside_castle_seg7_vertex_0705BA50 = [ [[ -50, -357, 1178], 0, [ 0, 0], [0x81, 0x00, 0x00, 0xff]], [[ -50, -1074, 1229], 0, [ 224, 2012], [0x81, 0x00, 0x00, 0xff]], [[ -50, -357, 1229], 0, [ 224, 0], [0x81, 0x00, 0x00, 0xff]], [[ -50, -1074, 1178], 0, [ 0, 2012], [0x81, 0x00, 0x00, 0xff]], [[ -1535, -1177, 1664], 0, [ 0, 928], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1151, 1664], 0, [ 990, 780], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1151, 1664], 0, [ 0, 780], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1100, 1587], 0, [ 0, 112], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1100, 1613], 0, [ 990, 240], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1100, 1587], 0, [ 990, 112], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1125, 1613], 0, [ 0, 384], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1125, 1613], 0, [ 990, 384], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1100, 1613], 0, [ 990, 240], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1100, 1613], 0, [ 0, 240], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x0705BB30 - 0x0705BC20 const inside_castle_seg7_vertex_0705BB30 = [ [[ -1535, -1125, 1638], 0, [ 0, 512], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1125, 1638], 0, [ 990, 512], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1125, 1613], 0, [ 0, 384], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1125, 1613], 0, [ 990, 384], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1151, 1638], 0, [ 0, 656], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1125, 1638], 0, [ 990, 512], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1125, 1638], 0, [ 0, 512], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1151, 1638], 0, [ 990, 656], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1151, 1638], 0, [ 0, 656], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1151, 1664], 0, [ 990, 780], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1151, 1638], 0, [ 990, 656], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1151, 1664], 0, [ 0, 780], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1177, 1664], 0, [ 0, 928], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1177, 1664], 0, [ 990, 928], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1151, 1664], 0, [ 990, 780], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x0705BC20 - 0x0705BD10 const inside_castle_seg7_vertex_0705BC20 = [ [[ -1535, -1253, 1741], 0, [ 0, 1740], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1228, 1741], 0, [ 990, 1596], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1228, 1741], 0, [ 0, 1596], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1177, 1690], 0, [ 0, 1052], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1177, 1664], 0, [ 990, 928], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1177, 1664], 0, [ 0, 928], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1177, 1690], 0, [ 990, 1052], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1202, 1690], 0, [ 0, 1200], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1177, 1690], 0, [ 990, 1052], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1177, 1690], 0, [ 0, 1052], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1202, 1690], 0, [ 990, 1200], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1202, 1715], 0, [ 0, 1324], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1202, 1715], 0, [ 990, 1324], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1202, 1690], 0, [ 0, 1200], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1202, 1690], 0, [ 990, 1200], [0x00, 0x7f, 0x00, 0xff]], ]; // 0x0705BD10 - 0x0705BDF0 const inside_castle_seg7_vertex_0705BD10 = [ [[ -1535, -1228, 1715], 0, [ 0, 1468], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1202, 1715], 0, [ 990, 1324], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1202, 1715], 0, [ 0, 1324], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1228, 1715], 0, [ 990, 1468], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1228, 1741], 0, [ 0, 1596], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1228, 1715], 0, [ 990, 1468], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1228, 1715], 0, [ 0, 1468], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1228, 1741], 0, [ 990, 1596], [0x00, 0x7f, 0x00, 0xff]], [[ -1791, -357, 2304], 0, [ 0, 0], [0x7f, 0x00, 0x00, 0xff]], [[ -1791, -1279, 2304], 0, [ 0, 2012], [0x7f, 0x00, 0x00, 0xff]], [[ -1791, -1279, 2202], 0, [ 376, 2012], [0x7f, 0x00, 0x00, 0xff]], [[ -1535, -1253, 1741], 0, [ 0, 1740], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1253, 1741], 0, [ 990, 1740], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1228, 1741], 0, [ 990, 1596], [0x00, 0x00, 0x7f, 0xff]], ]; // 0x0705BDF0 - 0x0705BEE0 const inside_castle_seg7_vertex_0705BDF0 = [ [[ -1535, -1253, 1766], 0, [ 0, 1868], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1253, 1766], 0, [ 990, 1868], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1253, 1741], 0, [ 0, 1740], [0x00, 0x7f, 0x00, 0xff]], [[ -1228, -1253, 1741], 0, [ 990, 1740], [0x00, 0x7f, 0x00, 0xff]], [[ -1535, -1279, 1766], 0, [ 0, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1253, 1766], 0, [ 990, 1868], [0x00, 0x00, 0x7f, 0xff]], [[ -1535, -1253, 1766], 0, [ 0, 1868], [0x00, 0x00, 0x7f, 0xff]], [[ -1228, -1279, 1766], 0, [ 990, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -1791, -357, 2202], 0, [ 376, 0], [0x5a, 0x00, 0xa7, 0xff]], [[ -1893, -1279, 2099], 0, [ 990, 2012], [0x5a, 0x00, 0xa7, 0xff]], [[ -1893, -357, 2099], 0, [ 990, 0], [0x5a, 0x00, 0xa7, 0xff]], [[ -1791, -1279, 2202], 0, [ 376, 2012], [0x5a, 0x00, 0xa7, 0xff]], [[ -1791, -357, 2304], 0, [ 0, 0], [0x7f, 0x00, 0x00, 0xff]], [[ -1791, -1279, 2202], 0, [ 376, 2012], [0x7f, 0x00, 0x00, 0xff]], [[ -1791, -357, 2202], 0, [ 376, 0], [0x7f, 0x00, 0x00, 0xff]], ]; // 0x0705BEE0 - 0x0705BFD0 const inside_castle_seg7_vertex_0705BEE0 = [ [[ 256, -357, 2278], 0, [ 990, 0], [0xa6, 0x00, 0xa8, 0xff]], [[ 205, -1074, 2330], 0, [ 650, 2012], [0xa6, 0x00, 0xa8, 0xff]], [[ 205, -357, 2330], 0, [ 650, 0], [0xa6, 0x00, 0xa8, 0xff]], [[ -1177, -357, 2816], 0, [ 0, 0], [0x59, 0x00, 0xa7, 0xff]], [[ -1279, -1279, 2714], 0, [ 582, 2012], [0x59, 0x00, 0xa7, 0xff]], [[ -1279, -357, 2714], 0, [ 582, 0], [0x59, 0x00, 0xa7, 0xff]], [[ -1279, -357, 2714], 0, [ 582, 0], [0x00, 0x00, 0x81, 0xff]], [[ -1279, -1279, 2714], 0, [ 582, 2012], [0x00, 0x00, 0x81, 0xff]], [[ -1381, -1279, 2714], 0, [ 990, 2012], [0x00, 0x00, 0x81, 0xff]], [[ -1381, -357, 2714], 0, [ 990, 0], [0x00, 0x00, 0x81, 0xff]], [[ -1177, -1279, 2816], 0, [ 0, 2012], [0x59, 0x00, 0xa7, 0xff]], [[ 205, -357, 2381], 0, [ 308, 0], [0xa7, 0x00, 0x59, 0xff]], [[ 256, -1074, 2432], 0, [ 0, 2012], [0xa7, 0x00, 0x59, 0xff]], [[ 256, -357, 2432], 0, [ 0, 0], [0xa7, 0x00, 0x59, 0xff]], [[ 205, -1074, 2381], 0, [ 308, 2012], [0xa7, 0x00, 0x59, 0xff]], ]; // 0x0705BFD0 - 0x0705C0C0 const inside_castle_seg7_vertex_0705BFD0 = [ [[ 205, -357, 2330], 0, [ 650, 0], [0x81, 0x00, 0x00, 0xff]], [[ 205, -1074, 2381], 0, [ 308, 2012], [0x81, 0x00, 0x00, 0xff]], [[ 205, -357, 2381], 0, [ 308, 0], [0x81, 0x00, 0x00, 0xff]], [[ 205, -1074, 2330], 0, [ 650, 2012], [0x81, 0x00, 0x00, 0xff]], [[ 256, -357, 2278], 0, [ 990, 0], [0xa6, 0x00, 0xa8, 0xff]], [[ 256, -1074, 2278], 0, [ 990, 2012], [0xa6, 0x00, 0xa8, 0xff]], [[ 205, -1074, 2330], 0, [ 650, 2012], [0xa6, 0x00, 0xa8, 0xff]], [[ 205, -357, 1613], 0, [ 308, 0], [0x81, 0x00, 0x00, 0xff]], [[ 205, -1074, 1664], 0, [ 650, 2012], [0x81, 0x00, 0x00, 0xff]], [[ 205, -357, 1664], 0, [ 650, 0], [0x81, 0x00, 0x00, 0xff]], [[ 205, -357, 1664], 0, [ 650, 0], [0xa7, 0x00, 0x59, 0xff]], [[ 256, -1074, 1715], 0, [ 990, 2012], [0xa7, 0x00, 0x59, 0xff]], [[ 256, -357, 1715], 0, [ 990, 0], [0xa7, 0x00, 0x59, 0xff]], [[ 205, -1074, 1664], 0, [ 650, 2012], [0xa7, 0x00, 0x59, 0xff]], [[ 205, -1074, 1613], 0, [ 308, 2012], [0x81, 0x00, 0x00, 0xff]], ]; // 0x0705C0C0 - 0x0705C1B0 const inside_castle_seg7_vertex_0705C0C0 = [ [[ 256, -357, 1562], 0, [ 0, 0], [0xa7, 0x00, 0xa7, 0xff]], [[ 205, -1074, 1613], 0, [ 308, 2012], [0xa7, 0x00, 0xa7, 0xff]], [[ 205, -357, 1613], 0, [ 308, 0], [0xa7, 0x00, 0xa7, 0xff]], [[ 256, -1074, 1562], 0, [ 0, 2012], [0xa7, 0x00, 0xa7, 0xff]], [[ -1791, -357, 1229], 0, [ 734, 0], [0x7f, 0x00, 0x00, 0xff]], [[ -1791, -1074, 1178], 0, [ 990, 2012], [0x7f, 0x00, 0x00, 0xff]], [[ -1791, -357, 1178], 0, [ 990, 0], [0x7f, 0x00, 0x00, 0xff]], [[ 0, -357, 2714], 0, [ 224, 0], [0xa6, 0x00, 0xa8, 0xff]], [[ -50, -1074, 2765], 0, [ 734, 2012], [0xa6, 0x00, 0xa8, 0xff]], [[ -50, -357, 2765], 0, [ 734, 0], [0xa6, 0x00, 0xa8, 0xff]], [[ -1842, -357, 1280], 0, [ 224, 0], [0x59, 0x00, 0x59, 0xff]], [[ -1791, -1074, 1229], 0, [ 734, 2012], [0x59, 0x00, 0x59, 0xff]], [[ -1791, -357, 1229], 0, [ 734, 0], [0x59, 0x00, 0x59, 0xff]], [[ -1842, -1074, 1280], 0, [ 224, 2012], [0x59, 0x00, 0x59, 0xff]], [[ -1791, -1074, 1229], 0, [ 734, 2012], [0x7f, 0x00, 0x00, 0xff]], ]; // 0x0705C1B0 - 0x0705C2A0 const inside_castle_seg7_vertex_0705C1B0 = [ [[ -1893, -357, 1280], 0, [ 0, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1842, -1074, 1280], 0, [ 224, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -1842, -357, 1280], 0, [ 224, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -1893, -1074, 1280], 0, [ 0, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ 51, -357, 2714], 0, [ 0, 0], [0x00, 0x00, 0x81, 0xff]], [[ 51, -1074, 2714], 0, [ 0, 2012], [0x00, 0x00, 0x81, 0xff]], [[ 0, -1074, 2714], 0, [ 224, 2012], [0x00, 0x00, 0x81, 0xff]], [[ 0, -357, 2714], 0, [ 224, 0], [0x00, 0x00, 0x81, 0xff]], [[ 0, -357, 2714], 0, [ 224, 0], [0xa6, 0x00, 0xa8, 0xff]], [[ 0, -1074, 2714], 0, [ 224, 2012], [0xa6, 0x00, 0xa8, 0xff]], [[ -50, -1074, 2765], 0, [ 734, 2012], [0xa6, 0x00, 0xa8, 0xff]], [[ -50, -357, 2765], 0, [ 734, 0], [0x81, 0x00, 0x00, 0xff]], [[ -50, -1074, 2765], 0, [ 734, 2012], [0x81, 0x00, 0x00, 0xff]], [[ -50, -1074, 2816], 0, [ 990, 2012], [0x81, 0x00, 0x00, 0xff]], [[ -50, -357, 2816], 0, [ 990, 0], [0x81, 0x00, 0x00, 0xff]], ]; // 0x0705C2A0 - 0x0705C390 const inside_castle_seg7_vertex_0705C2A0 = [ [[ -3020, -1023, 1485], 0, [ 618, 1280], [0x00, 0x00, 0x7f, 0xff]], [[ -3020, -1279, 1485], 0, [ 618, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -2815, -1279, 1485], 0, [ 990, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -3173, -1023, 1434], 0, [ 340, 1280], [0x00, 0x81, 0x00, 0xff]], [[ -3020, -1023, 1434], 0, [ 618, 1280], [0x00, 0x81, 0x00, 0xff]], [[ -3020, -1023, 1485], 0, [ 618, 1280], [0x00, 0x81, 0x00, 0xff]], [[ -3173, -1023, 1485], 0, [ 340, 1280], [0x00, 0x81, 0x00, 0xff]], [[ -3020, -1023, 1434], 0, [ 618, 1280], [0x81, 0x00, 0x00, 0xff]], [[ -3020, -1279, 1434], 0, [ 618, 2012], [0x81, 0x00, 0x00, 0xff]], [[ -3020, -1279, 1485], 0, [ 618, 2012], [0x81, 0x00, 0x00, 0xff]], [[ -3020, -1023, 1485], 0, [ 618, 1280], [0x81, 0x00, 0x00, 0xff]], [[ -3173, -1023, 1485], 0, [ 340, 1280], [0x7f, 0x00, 0x00, 0xff]], [[ -3173, -1279, 1434], 0, [ 340, 2012], [0x7f, 0x00, 0x00, 0xff]], [[ -3173, -1023, 1434], 0, [ 340, 1280], [0x7f, 0x00, 0x00, 0xff]], [[ -3173, -1279, 1485], 0, [ 340, 2012], [0x7f, 0x00, 0x00, 0xff]], ]; // 0x0705C390 - 0x0705C490 const inside_castle_seg7_vertex_0705C390 = [ [[ -1381, -1279, 2714], 0, [ 2372, 2012], [0xb0, 0x00, 0x9e, 0xff]], [[ -1562, -1279, 2862], 0, [ 1862, 2012], [0xb0, 0x00, 0x9e, 0xff]], [[ -1562, -665, 2862], 0, [ 1862, 260], [0xb0, 0x00, 0x9e, 0xff]], [[ -3020, -1023, 1485], 0, [ 618, 1280], [0x00, 0x00, 0x7f, 0xff]], [[ -2815, -1279, 1485], 0, [ 990, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -2815, -665, 1485], 0, [ 990, 260], [0x00, 0x00, 0x7f, 0xff]], [[ -2917, -562, 1485], 0, [ 804, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -3173, -1023, 1485], 0, [ 340, 1280], [0x00, 0x00, 0x7f, 0xff]], [[ -3276, -562, 1485], 0, [ 154, 0], [0x00, 0x00, 0x7f, 0xff]], [[ -3378, -665, 1485], 0, [ 0, 260], [0x00, 0x00, 0x7f, 0xff]], [[ -3378, -1279, 1485], 0, [ 0, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -3173, -1279, 1485], 0, [ 340, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -1381, -665, 2714], 0, [ 2372, 260], [0xb0, 0x00, 0x9e, 0xff]], [[ -1562, -1279, 2862], 0, [ 1862, 2012], [0xca, 0x00, 0x8e, 0xff]], [[ -1972, -665, 3058], 0, [ 810, 260], [0xca, 0x00, 0x8e, 0xff]], [[ -1562, -665, 2862], 0, [ 1862, 260], [0xca, 0x00, 0x8e, 0xff]], ]; // 0x0705C490 - 0x0705C590 const inside_castle_seg7_vertex_0705C490 = [ [[ -1562, -1279, 2862], 0, [ 1862, 2012], [0xca, 0x00, 0x8e, 0xff]], [[ -1972, -1279, 3058], 0, [ 810, 2012], [0xca, 0x00, 0x8e, 0xff]], [[ -1972, -665, 3058], 0, [ 810, 260], [0xca, 0x00, 0x8e, 0xff]], [[ -1562, -665, 2862], 0, [ 1862, 260], [0xd9, 0xa8, 0xae, 0xff]], [[ -1972, -665, 3058], 0, [ 810, 260], [0xd9, 0xa8, 0xae, 0xff]], [[ -1995, -562, 2958], 0, [ 842, 0], [0xd9, 0xa8, 0xae, 0xff]], [[ -1562, -665, 2862], 0, [ 1862, 260], [0xd9, 0xa7, 0xaf, 0xff]], [[ -1995, -562, 2958], 0, [ 842, 0], [0xd9, 0xa7, 0xaf, 0xff]], [[ -1623, -562, 2779], 0, [ 1900, 0], [0xd9, 0xa7, 0xaf, 0xff]], [[ -1381, -665, 2714], 0, [ 2372, 260], [0xc8, 0xa7, 0xbb, 0xff]], [[ -1562, -665, 2862], 0, [ 1862, 260], [0xc8, 0xa7, 0xbb, 0xff]], [[ -1623, -562, 2779], 0, [ 1900, 0], [0xc8, 0xa7, 0xbb, 0xff]], [[ -1454, -562, 2641], 0, [ 2420, 0], [0xc8, 0xa7, 0xbb, 0xff]], [[ -1454, -562, 2641], 0, [ 972, 344], [0x00, 0x81, 0x00, 0xff]], [[ -1623, -562, 2779], 0, [ 810, 348], [0x00, 0x81, 0x00, 0xff]], [[ -1833, -562, 2489], 0, [ 830, 608], [0x00, 0x81, 0x00, 0xff]], ]; // 0x0705C590 - 0x0705C680 const inside_castle_seg7_vertex_0705C590 = [ [[ -1454, -562, 2641], 0, [ 972, 344], [0x00, 0x81, 0x00, 0xff]], [[ -1833, -562, 2489], 0, [ 830, 608], [0x00, 0x81, 0x00, 0xff]], [[ -1719, -562, 2376], 0, [ 950, 612], [0x00, 0x81, 0x00, 0xff]], [[ -1623, -562, 2779], 0, [ 810, 348], [0x00, 0x81, 0x00, 0xff]], [[ -1995, -562, 2958], 0, [ 514, 432], [0x00, 0x81, 0x00, 0xff]], [[ -2075, -562, 2609], 0, [ 636, 660], [0x00, 0x81, 0x00, 0xff]], [[ -1719, -562, 2376], 0, [ 1028, 0], [0x3f, 0xa7, 0x40, 0xff]], [[ -1833, -562, 2489], 0, [ 792, 0], [0x3f, 0xa7, 0x40, 0xff]], [[ -1791, -665, 2304], 0, [ 1054, 260], [0x3f, 0xa7, 0x40, 0xff]], [[ -1833, -562, 2489], 0, [ 792, 0], [0x40, 0xa8, 0x40, 0xff]], [[ -1893, -665, 2406], 0, [ 808, 260], [0x40, 0xa8, 0x40, 0xff]], [[ -1791, -665, 2304], 0, [ 1054, 260], [0x40, 0xa8, 0x40, 0xff]], [[ -1833, -562, 2489], 0, [ 792, 0], [0x28, 0xa8, 0x51, 0xff]], [[ -2075, -562, 2609], 0, [ 386, 0], [0x28, 0xa8, 0x51, 0xff]], [[ -1893, -665, 2406], 0, [ 808, 260], [0x28, 0xa8, 0x51, 0xff]], ]; // 0x0705C680 - 0x0705C770 const inside_castle_seg7_vertex_0705C680 = [ [[ -1791, -665, 2304], 0, [ 1054, 260], [0x59, 0x00, 0x59, 0xff]], [[ -1893, -665, 2406], 0, [ 808, 260], [0x59, 0x00, 0x59, 0xff]], [[ -1893, -1279, 2406], 0, [ 808, 2012], [0x59, 0x00, 0x59, 0xff]], [[ -2075, -562, 2609], 0, [ 386, 0], [0x28, 0xa8, 0x51, 0xff]], [[ -2098, -665, 2509], 0, [ 410, 260], [0x28, 0xa8, 0x51, 0xff]], [[ -1893, -665, 2406], 0, [ 808, 260], [0x28, 0xa8, 0x51, 0xff]], [[ -1893, -665, 2406], 0, [ 808, 260], [0x39, 0x00, 0x71, 0xff]], [[ -2098, -665, 2509], 0, [ 410, 260], [0x39, 0x00, 0x71, 0xff]], [[ -1893, -1279, 2406], 0, [ 808, 2012], [0x39, 0x00, 0x71, 0xff]], [[ -1791, -1279, 2304], 0, [ 1054, 2012], [0x59, 0x00, 0x59, 0xff]], [[ -2098, -1279, 2509], 0, [ 410, 2012], [0x39, 0x00, 0x71, 0xff]], [[ -1995, -562, 2958], 0, [ 514, 432], [0x00, 0x81, 0x00, 0xff]], [[ -2407, -562, 2958], 0, [ 282, 632], [0x00, 0x81, 0x00, 0xff]], [[ -2326, -562, 2609], 0, [ 496, 780], [0x00, 0x81, 0x00, 0xff]], [[ -2075, -562, 2609], 0, [ 636, 660], [0x00, 0x81, 0x00, 0xff]], ]; // 0x0705C770 - 0x0705C870 const inside_castle_seg7_vertex_0705C770 = [ [[ -2075, -562, 2609], 0, [ 386, 0], [0x00, 0xa8, 0x5b, 0xff]], [[ -2326, -562, 2609], 0, [ -6, 0], [0x00, 0xa8, 0x5b, 0xff]], [[ -2303, -665, 2509], 0, [ 42, 260], [0x00, 0xa8, 0x5b, 0xff]], [[ -2098, -665, 2509], 0, [ 410, 260], [0x00, 0xa8, 0x5b, 0xff]], [[ -2098, -665, 2509], 0, [ 410, 260], [0x00, 0x00, 0x7f, 0xff]], [[ -2303, -665, 2509], 0, [ 42, 260], [0x00, 0x00, 0x7f, 0xff]], [[ -2303, -1279, 2509], 0, [ 42, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -2098, -1279, 2509], 0, [ 410, 2012], [0x00, 0x00, 0x7f, 0xff]], [[ -1972, -1279, 3058], 0, [ 16140, 2012], [0x00, 0x00, 0x81, 0xff]], [[ -2430, -1279, 3058], 0, [ 15018, 2012], [0x00, 0x00, 0x81, 0xff]], [[ -2430, -665, 3058], 0, [ 15018, 260], [0x00, 0x00, 0x81, 0xff]], [[ -1972, -665, 3058], 0, [ 16140, 260], [0x00, 0x00, 0x81, 0xff]], [[ -2430, -1279, 3058], 0, [ 15018, 2012], [0x36, 0x00, 0x8e, 0xff]], [[ -2839, -1279, 2862], 0, [ 13848, 2012], [0x36, 0x00, 0x8e, 0xff]], [[ -2839, -665, 2862], 0, [ 13848, 260], [0x36, 0x00, 0x8e, 0xff]], [[ -2430, -665, 3058], 0, [ 15018, 260], [0x36, 0x00, 0x8e, 0xff]], ]; // 0x0705C870 - 0x0705C950 const inside_castle_seg7_vertex_0705C870 = [ [[ -1972, -665, 3058], 0, [ 16140, 260], [0x00, 0xa8, 0xa5, 0xff]], [[ -2430, -665, 3058], 0, [ 15018, 260], [0x00, 0xa8, 0xa5, 0xff]], [[ -2407, -562, 2958], 0, [ 15050, 0], [0x00, 0xa8, 0xa5, 0xff]], [[ -2430, -665, 3058], 0, [ 15018, 260], [0x27, 0xa8, 0xae, 0xff]], [[ -2839, -665, 2862], 0, [ 13848, 260], [0x27, 0xa8, 0xae, 0xff]], [[ -2407, -562, 2958], 0, [ 15050, 0], [0x27, 0xa8, 0xae, 0xff]], [[ -1995, -562, 2958], 0, [ 16172, 0], [0x00, 0xa8, 0xa5, 0xff]], [[ -2839, -665, 2862], 0, [ 13848, 260], [0x27, 0xa8, 0xaf, 0xff]], [[ -2779, -562, 2779], 0, [ 13858, 0], [0x27, 0xa8, 0xaf, 0xff]], [[ -2407, -562, 2958], 0, [ 15050, 0], [0x27, 0xa8, 0xaf, 0xff]], [[ -2407, -562, 2958], 0, [ 282, 632], [0x00, 0x81, 0x00, 0xff]], [[ -2779, -562, 2779], 0, [ 158, 908], [0x00, 0x81, 0x00, 0xff]], [[ -2568, -562, 2489], 0, [ 416, 964], [0x00, 0x81, 0x00, 0xff]], [[ -2326, -562, 2609], 0, [ 496, 780], [0x00, 0x81, 0x00, 0xff]], ]; // 0x0705C950 - 0x0705CA30 const inside_castle_seg7_vertex_0705C950 = [ [[ -2839, -1279, 2862], 0, [ 13848, 2012], [0x59, 0x00, 0xa7, 0xff]], [[ -3168, -1279, 2533], 0, [ 12632, 2012], [0x59, 0x00, 0xa7, 0xff]], [[ -3168, -665, 2533], 0, [ 12632, 260], [0x59, 0x00, 0xa7, 0xff]], [[ -2839, -665, 2862], 0, [ 13848, 260], [0x59, 0x00, 0xa7, 0xff]], [[ -2839, -665, 2862], 0, [ 13848, 260], [0x3f, 0xa7, 0xc1, 0xff]], [[ -3168, -665, 2533], 0, [ 12632, 260], [0x3f, 0xa7, 0xc1, 0xff]], [[ -3085, -562, 2472], 0, [ 12588, 0], [0x3f, 0xa7, 0xc1, 0xff]], [[ -2839, -665, 2862], 0, [ 13848, 260], [0x40, 0xa8, 0xc1, 0xff]], [[ -3085, -562, 2472], 0, [ 12588, 0], [0x40, 0xa8, 0xc1, 0xff]], [[ -2779, -562, 2779], 0, [ 13858, 0], [0x40, 0xa8, 0xc1, 0xff]], [[ -2779, -562, 2779], 0, [ 158, 908], [0x00, 0x81, 0x00, 0xff]], [[ -2795, -562, 2262], 0, [ 398, 1192], [0x00, 0x81, 0x00, 0xff]], [[ -2568, -562, 2489], 0, [ 416, 964], [0x00, 0x81, 0x00, 0xff]], [[ -3085, -562, 2472], 0, [ 134, 1220], [0x00, 0x81, 0x00, 0xff]], ]; // 0x0705CA30 - 0x0705CB30 const inside_castle_seg7_vertex_0705CA30 = [ [[ -2326, -562, 2609], 0, [ 7148, 0], [0xd8, 0xa8, 0x51, 0xff]], [[ -2568, -562, 2489], 0, [ 6698, 0], [0xd8, 0xa8, 0x51, 0xff]], [[ -2508, -665, 2406], 0, [ 6754, 260], [0xd8, 0xa8, 0x51, 0xff]], [[ -2303, -665, 2509], 0, [ 7196, 260], [0xd8, 0xa8, 0x51, 0xff]], [[ -2568, -562, 2489], 0, [ 6698, 0], [0xc0, 0xa8, 0x40, 0xff]], [[ -2795, -562, 2262], 0, [ 6082, 0], [0xc0, 0xa8, 0x40, 0xff]], [[ -2713, -665, 2202], 0, [ 6088, 260], [0xc0, 0xa8, 0x40, 0xff]], [[ -2568, -562, 2489], 0, [ 6698, 0], [0xc1, 0xa8, 0x40, 0xff]], [[ -2713, -665, 2202], 0, [ 6088, 260], [0xc1, 0xa8, 0x40, 0xff]], [[ -2508, -665, 2406], 0, [ 6754, 260], [0xc1, 0xa8, 0x40, 0xff]], [[ -2508, -665, 2406], 0, [ 6754, 260], [0xa7, 0x00, 0x5a, 0xff]], [[ -2713, -1279, 2202], 0, [ 6088, 2012], [0xa7, 0x00, 0x5a, 0xff]], [[ -2508, -1279, 2406], 0, [ 6754, 2012], [0xa7, 0x00, 0x5a, 0xff]], [[ -2303, -665, 2509], 0, [ 7196, 260], [0xc7, 0x00, 0x71, 0xff]], [[ -2508, -665, 2406], 0, [ 6754, 260], [0xc7, 0x00, 0x71, 0xff]], [[ -2508, -1279, 2406], 0, [ 6754, 2012], [0xc7, 0x00, 0x71, 0xff]], ]; // 0x0705CB30 - 0x0705CC30 const inside_castle_seg7_vertex_0705CB30 = [ [[ -2508, -665, 2406], 0, [ 6754, 260], [0xa7, 0x00, 0x5a, 0xff]], [[ -2713, -665, 2202], 0, [ 6088, 260], [0xa7, 0x00, 0x5a, 0xff]], [[ -2713, -1279, 2202], 0, [ 6088, 2012], [0xa7, 0x00, 0x5a, 0xff]], [[ -2303, -665, 2509], 0, [ 7196, 260], [0xc7, 0x00, 0x71, 0xff]], [[ -2508, -1279, 2406], 0, [ 6754, 2012], [0xc7, 0x00, 0x71, 0xff]], [[ -2303, -1279, 2509], 0, [ 7196, 2012], [0xc7, 0x00, 0x71, 0xff]], [[ -2795, -562, 2262], 0, [ 6082, 0], [0xaf, 0xa8, 0x28, 0xff]], [[ -2915, -562, 2020], 0, [ 5544, 0], [0xaf, 0xa8, 0x28, 0xff]], [[ -2713, -665, 2202], 0, [ 6088, 260], [0xaf, 0xa8, 0x28, 0xff]], [[ -3168, -1279, 2533], 0, [ 12632, 2012], [0x72, 0x00, 0xca, 0xff]], [[ -3364, -1279, 2123], 0, [ 11538, 2012], [0x72, 0x00, 0xca, 0xff]], [[ -3364, -665, 2123], 0, [ 11538, 260], [0x72, 0x00, 0xca, 0xff]], [[ -3168, -665, 2533], 0, [ 12632, 260], [0x72, 0x00, 0xca, 0xff]], [[ -3168, -665, 2533], 0, [ 12632, 260], [0x52, 0xa8, 0xd9, 0xff]], [[ -3364, -665, 2123], 0, [ 11538, 260], [0x52, 0xa8, 0xd9, 0xff]], [[ -3264, -562, 2100], 0, [ 11486, 0], [0x52, 0xa8, 0xd9, 0xff]], ]; // 0x0705CC30 - 0x0705CD30 const inside_castle_seg7_vertex_0705CC30 = [ [[ -3168, -665, 2533], 0, [ 12632, 260], [0x51, 0xa7, 0xd9, 0xff]], [[ -3264, -562, 2100], 0, [ 11486, 0], [0x51, 0xa7, 0xd9, 0xff]], [[ -3085, -562, 2472], 0, [ 12588, 0], [0x51, 0xa7, 0xd9, 0xff]], [[ -3085, -562, 2472], 0, [ 134, 1220], [0x00, 0x81, 0x00, 0xff]], [[ -2915, -562, 2020], 0, [ 448, 1380], [0x00, 0x81, 0x00, 0xff]], [[ -2795, -562, 2262], 0, [ 398, 1192], [0x00, 0x81, 0x00, 0xff]], [[ -3264, -562, 2100], 0, [ 212, 1508], [0x00, 0x81, 0x00, 0xff]], [[ -3276, -562, 1485], 0, [ 504, 1844], [0x00, 0x81, 0x00, 0xff]], [[ -2917, -562, 1485], 0, [ 706, 1668], [0x00, 0x81, 0x00, 0xff]], [[ -2915, -562, 2020], 0, [ 5544, 0], [0xaf, 0xa8, 0x28, 0xff]], [[ -2815, -665, 1997], 0, [ 5534, 260], [0xaf, 0xa8, 0x28, 0xff]], [[ -2713, -665, 2202], 0, [ 6088, 260], [0xaf, 0xa8, 0x28, 0xff]], [[ -2713, -665, 2202], 0, [ 6088, 260], [0x8f, 0x00, 0x38, 0xff]], [[ -2815, -665, 1997], 0, [ 5534, 260], [0x8f, 0x00, 0x38, 0xff]], [[ -2815, -1279, 1997], 0, [ 5534, 2012], [0x8f, 0x00, 0x38, 0xff]], [[ -2713, -1279, 2202], 0, [ 6088, 2012], [0x8f, 0x00, 0x38, 0xff]], ]; // 0x0705CD30 - 0x0705CE30 const inside_castle_seg7_vertex_0705CD30 = [ [[ -3364, -1279, 2123], 0, [ 11538, 2012], [0x7e, 0x00, 0xfe, 0xff]], [[ -3378, -1279, 1485], 0, [ 10196, 2012], [0x7e, 0x00, 0xfe, 0xff]], [[ -3378, -665, 1485], 0, [ 10196, 260], [0x7e, 0x00, 0xfe, 0xff]], [[ -3364, -665, 2123], 0, [ 11538, 260], [0x7e, 0x00, 0xfe, 0xff]], [[ -3364, -665, 2123], 0, [ 11538, 260], [0x5a, 0xa8, 0xff, 0xff]], [[ -3378, -665, 1485], 0, [ 10196, 260], [0x5a, 0xa8, 0xff, 0xff]], [[ -3264, -562, 2100], 0, [ 11486, 0], [0x5a, 0xa8, 0xff, 0xff]], [[ -3378, -665, 1485], 0, [ 10196, 260], [0x5a, 0xa7, 0xff, 0xff]], [[ -3276, -562, 1485], 0, [ 10086, 0], [0x5a, 0xa7, 0xff, 0xff]], [[ -3264, -562, 2100], 0, [ 11486, 0], [0x5a, 0xa7, 0xff, 0xff]], [[ -3264, -562, 2100], 0, [ 212, 1508], [0x00, 0x81, 0x00, 0xff]], [[ -2917, -562, 1485], 0, [ 706, 1668], [0x00, 0x81, 0x00, 0xff]], [[ -2915, -562, 2020], 0, [ 448, 1380], [0x00, 0x81, 0x00, 0xff]], [[ -2915, -562, 2020], 0, [ 5544, 0], [0xa6, 0xa7, 0x00, 0xff]], [[ -2917, -562, 1485], 0, [ 4606, 0], [0xa6, 0xa7, 0x00, 0xff]], [[ -2815, -665, 1485], 0, [ 4496, 260], [0xa6, 0xa7, 0x00, 0xff]], ]; // 0x0705CE30 - 0x0705CEA0 const inside_castle_seg7_vertex_0705CE30 = [ [[ -2915, -562, 2020], 0, [ 5544, 0], [0xa5, 0xa8, 0x00, 0xff]], [[ -2815, -665, 1485], 0, [ 4496, 260], [0xa5, 0xa8, 0x00, 0xff]], [[ -2815, -665, 1997], 0, [ 5534, 260], [0xa5, 0xa8, 0x00, 0xff]], [[ -2815, -665, 1997], 0, [ 5534, 260], [0x81, 0x00, 0x00, 0xff]], [[ -2815, -665, 1485], 0, [ 4496, 260], [0x81, 0x00, 0x00, 0xff]], [[ -2815, -1279, 1485], 0, [ 4496, 2012], [0x81, 0x00, 0x00, 0xff]], [[ -2815, -1279, 1997], 0, [ 5534, 2012], [0x81, 0x00, 0x00, 0xff]], ]; // 0x0705CEA0 - 0x0705D098 const inside_castle_seg7_dl_0705CEA0 = [ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_0900B000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPLight(inside_castle_seg7_lights_07059200.l, 1), gsSPLight(inside_castle_seg7_lights_07059200.a, 2), gsSPVertex(inside_castle_seg7_vertex_070592C0, 8, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0), gsSPLight(inside_castle_seg7_lights_07059218.l, 1), gsSPLight(inside_castle_seg7_lights_07059218.a, 2), gsSPVertex(inside_castle_seg7_vertex_07059340, 4, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSPLight(inside_castle_seg7_lights_07059230.l, 1), gsSPLight(inside_castle_seg7_lights_07059230.a, 2), gsSPVertex(inside_castle_seg7_vertex_07059380, 4, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSPLight(inside_castle_seg7_lights_07059248.l, 1), gsSPLight(inside_castle_seg7_lights_07059248.a, 2), gsSPVertex(inside_castle_seg7_vertex_070593C0, 4, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSPLight(inside_castle_seg7_lights_07059260.l, 1), gsSPLight(inside_castle_seg7_lights_07059260.a, 2), gsSPVertex(inside_castle_seg7_vertex_07059400, 4, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSPLight(inside_castle_seg7_lights_07059278.l, 1), gsSPLight(inside_castle_seg7_lights_07059278.a, 2), gsSPVertex(inside_castle_seg7_vertex_07059440, 4, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSPLight(inside_castle_seg7_lights_07059290.l, 1), gsSPLight(inside_castle_seg7_lights_07059290.a, 2), gsSPVertex(inside_castle_seg7_vertex_07059480, 4, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSPLight(inside_castle_seg7_lights_070592A8.l, 1), gsSPLight(inside_castle_seg7_lights_070592A8.a, 2), gsSPVertex(inside_castle_seg7_vertex_070594C0, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 7, 5, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 8, 11, 9, 0x0), gsSP2Triangles(12, 13, 14, 0x0, 12, 15, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_070595C0, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 3, 5, 0x0, 6, 5, 7, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 8, 11, 9, 0x0), gsSP2Triangles( 0, 12, 1, 0x0, 13, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_070596C0, 3, 0), gsSP1Triangle( 0, 1, 2, 0x0), gsSPEndDisplayList(), ].flat(); // 0x0705D098 - 0x0705D480 const inside_castle_seg7_dl_0705D098 = [ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_09005000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPLight(inside_castle_seg7_lights_07059248.l, 1), gsSPLight(inside_castle_seg7_lights_07059248.a, 2), gsSPVertex(inside_castle_seg7_vertex_070596F0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 14, 12, 0x0), gsSPVertex(inside_castle_seg7_vertex_070597E0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 6, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), gsSP1Triangle( 0, 2, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_070598D0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 14, 12, 0x0), gsSPVertex(inside_castle_seg7_vertex_070599C0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 6, 9, 7, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 12, 13, 0x0), gsSP1Triangle( 0, 2, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_07059AB0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 10, 8, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 14, 12, 0x0), gsSPVertex(inside_castle_seg7_vertex_07059BA0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 6, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), gsSP1Triangle( 0, 2, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_07059C90, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 14, 12, 0x0), gsSPVertex(inside_castle_seg7_vertex_07059D80, 7, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP1Triangle( 0, 6, 1, 0x0), gsSPLight(inside_castle_seg7_lights_070592A8.l, 1), gsSPLight(inside_castle_seg7_lights_070592A8.a, 2), gsSPVertex(inside_castle_seg7_vertex_07059DF0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_07059EE0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 6, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 12, 13, 0x0), gsSP1Triangle( 0, 14, 1, 0x0), gsSPVertex(inside_castle_seg7_vertex_07059FD0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 10, 8, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 14, 12, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705A0C0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 6, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), gsSP1Triangle( 0, 14, 1, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705A1B0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 10, 8, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 14, 12, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705A2A0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 6, 9, 7, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), gsSP1Triangle( 0, 14, 1, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705A390, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), gsSP2Triangles(11, 14, 12, 0x0, 0, 15, 1, 0x0), gsSPEndDisplayList(), ].flat(); // 0x0705D480 - 0x0705D550 const inside_castle_seg7_dl_0705D480 = [ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_09004000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPVertex(inside_castle_seg7_vertex_0705A490, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 6, 0x0, 1, 7, 8, 0x0), gsSP2Triangles( 1, 8, 9, 0x0, 10, 11, 12, 0x0), gsSP2Triangles(10, 12, 13, 0x0, 1, 9, 2, 0x0), gsSP2Triangles( 0, 2, 14, 0x0, 0, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705A590, 14, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 2, 0x0), gsSP2Triangles( 0, 2, 5, 0x0, 6, 7, 8, 0x0), gsSP2Triangles( 6, 8, 9, 0x0, 10, 11, 12, 0x0), gsSP1Triangle(10, 12, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705A670, 4, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSPEndDisplayList(), ].flat(); // 0x0705D550 - 0x0705DAD0 const inside_castle_seg7_dl_0705D550 = [ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_09003000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPVertex(inside_castle_seg7_vertex_0705A6B0, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 4, 3, 0x0, 5, 4, 7, 0x0), gsSP2Triangles( 5, 7, 8, 0x0, 8, 7, 9, 0x0), gsSP2Triangles( 9, 7, 10, 0x0, 11, 0, 12, 0x0), gsSP2Triangles( 0, 2, 12, 0x0, 13, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705A7B0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 0, 2, 0x0), gsSP2Triangles( 3, 4, 0, 0x0, 5, 6, 7, 0x0), gsSP2Triangles( 7, 6, 8, 0x0, 9, 10, 11, 0x0), gsSP1Triangle(12, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705A8A0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 8, 11, 9, 0x0), gsSP1Triangle(12, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705A990, 14, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 6, 0x0, 5, 7, 8, 0x0), gsSP2Triangles( 5, 8, 6, 0x0, 7, 9, 8, 0x0), gsSP2Triangles( 7, 10, 9, 0x0, 11, 12, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705AA70, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705AB60, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 8, 9, 10, 0x0), gsSP2Triangles( 8, 11, 9, 0x0, 8, 10, 6, 0x0), gsSP2Triangles( 6, 12, 7, 0x0, 6, 13, 12, 0x0), gsSP1Triangle( 0, 2, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705AC50, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 10, 8, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705AD40, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 6, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 13, 10, 12, 0x0), gsSP1Triangle(13, 14, 10, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705AE30, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSP2Triangles( 0, 4, 5, 0x0, 6, 7, 8, 0x0), gsSP2Triangles( 9, 10, 11, 0x0, 12, 9, 11, 0x0), gsSP1Triangle(13, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705AF30, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 0, 2, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 7, 5, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 8, 11, 9, 0x0), gsSP1Triangle(12, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B020, 14, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B100, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 8, 11, 9, 0x0), gsSP2Triangles(12, 13, 14, 0x0, 12, 15, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B200, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 10, 8, 0x0, 11, 12, 13, 0x0), gsSP2Triangles(11, 13, 14, 0x0, 0, 2, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B300, 14, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 7, 5, 0x0), gsSP2Triangles( 5, 8, 6, 0x0, 6, 9, 4, 0x0), gsSP2Triangles( 6, 10, 9, 0x0, 11, 12, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B3E0, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 0, 0x0), gsSP2Triangles( 3, 0, 2, 0x0, 2, 5, 6, 0x0), gsSP2Triangles( 2, 6, 3, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 9, 11, 10, 0x0), gsSP2Triangles(12, 13, 14, 0x0, 13, 15, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B4E0, 14, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 6, 9, 7, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B5C0, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 7, 5, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 8, 11, 9, 0x0), gsSP2Triangles(12, 13, 14, 0x0, 12, 15, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B6C0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 4, 6, 5, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 0, 12, 0x0), gsSP2Triangles(11, 13, 0, 0x0, 11, 12, 14, 0x0), gsSP1Triangle( 0, 2, 12, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B7B0, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 3, 5, 0x0, 6, 7, 3, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 8, 11, 9, 0x0), gsSP2Triangles( 0, 2, 12, 0x0, 13, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705B8B0, 11, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP1Triangle( 8, 10, 9, 0x0), gsSPEndDisplayList(), ].flat(); // 0x0705DAD0 - 0x0705DD60 const inside_castle_seg7_dl_0705DAD0 = [ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_09007000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPVertex(inside_castle_seg7_vertex_0705B960, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), gsSP1Triangle( 7, 14, 8, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705BA50, 14, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 12, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705BB30, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 2, 1, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 7, 5, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 11, 9, 8, 0x0), gsSP1Triangle(12, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705BC20, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 10, 8, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(13, 12, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705BD10, 14, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 7, 5, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 11, 12, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705BDF0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 2, 1, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 7, 5, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 8, 11, 9, 0x0), gsSP1Triangle(12, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705BEE0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 6, 8, 9, 0x0), gsSP2Triangles( 3, 10, 4, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 14, 12, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705BFD0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), gsSP1Triangle( 7, 14, 8, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705C0C0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), gsSP1Triangle( 4, 14, 5, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705C1B0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 13, 14, 0x0), gsSPEndDisplayList(), ].flat(); // 0x0705DD60 - 0x0705E088 const inside_castle_seg7_dl_0705DD60 = [ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_09009000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPVertex(inside_castle_seg7_vertex_0705C2A0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 14, 12, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705C390, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 6, 0x0, 7, 3, 6, 0x0), gsSP2Triangles( 7, 6, 8, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 9, 10, 0x0, 11, 7, 10, 0x0), gsSP2Triangles( 0, 2, 12, 0x0, 13, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705C490, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 9, 10, 11, 0x0), gsSP2Triangles( 9, 11, 12, 0x0, 13, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705C590, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 5, 1, 0x0, 6, 7, 8, 0x0), gsSP2Triangles( 9, 10, 11, 0x0, 12, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705C680, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 0, 2, 9, 0x0), gsSP2Triangles( 7, 10, 8, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 13, 14, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705C770, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 8, 10, 11, 0x0), gsSP2Triangles(12, 13, 14, 0x0, 12, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705C870, 14, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 0, 2, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 12, 13, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705C950, 14, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705CA30, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 13, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705CB30, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 8, 0x0, 9, 10, 11, 0x0), gsSP2Triangles( 9, 11, 12, 0x0, 13, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705CC30, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 6, 7, 8, 0x0), gsSP2Triangles( 9, 10, 11, 0x0, 12, 13, 14, 0x0), gsSP1Triangle(12, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705CD30, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 7, 8, 9, 0x0), gsSP2Triangles(10, 11, 12, 0x0, 13, 14, 15, 0x0), gsSPVertex(inside_castle_seg7_vertex_0705CE30, 7, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP1Triangle( 3, 5, 6, 0x0), gsSPEndDisplayList(), ].flat(); // 0x0705E088 - 0x0705E138 export const inside_castle_seg7_dl_0705E088 = [ gsDPPipeSync(), gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB), gsSPClearGeometryMode(G_SHADING_SMOOTH), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPDisplayList(inside_castle_seg7_dl_0705CEA0), gsSPDisplayList(inside_castle_seg7_dl_0705D098), gsSPDisplayList(inside_castle_seg7_dl_0705D480), gsSPDisplayList(inside_castle_seg7_dl_0705D550), gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 6, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPDisplayList(inside_castle_seg7_dl_0705DAD0), gsSPDisplayList(inside_castle_seg7_dl_0705DD60), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), gsSPSetGeometryMode(G_SHADING_SMOOTH), gsSPEndDisplayList(), ].flat(); // 1621726940 - 2021-05-22 16:42:23 -0700
0.851563
1
.eslintrc.js
Korrigans/meteor-k-check
0
15996636
const ALERT = 2, COMPLEXITY = 10, IGNORE = 0, MAX_NESTED_BLOCKS = 4, MAX_NESTED_CALLBACKS = 10, MAX_PARAMS = 3, MAX_PATH_LENGTH = 3, MAX_STATEMENT_LENGTH = 80, MAX_STATEMENTS = 10, MIN_DEPTH = 3, TAB_SPACE = 2, WARN = 1; module.exports = { parser: 'babel-eslint', env: { es6: true, browser: true, node: true, mongo: true, meteor: true, jquery: true, jasmine: true }, plugins: [ 'html', 'json', 'react', 'meteor', 'mongodb', 'lodash3', 'jasmine' ], ecmaFeatures: { arrowFunctions: true, binaryLiterals: true, blockBindings: true, classes: true, defaultParams: true, destructuring: true, forOf: true, generators: true, modules: true, objectLiteralComputedProperties: true, objectLiteralDuplicateProperties: false, objectLiteralShorthandMethods: true, objectLiteralShorthandProperties: true, octalLiterals: true, regexUFlag: true, regexYFlag: true, restParams: true, spread: true, superInFunctions: true, templateStrings: true, unicodeCodePointEscapes: true, globalReturn: false, jsx: true, experimentalObjectRestSpread: true }, rules: { /* Possible Errors */ // disallow trailing commas in object literals 'comma-dangle': [ALERT, 'never'], // disallow assignment in conditional expressions 'no-cond-assign': [ALERT, 'always'], // disallow use of console 'no-console': WARN, // disallow use of constant expressions in conditions 'no-constant-condition': ALERT, // disallow control characters in regular expressions 'no-control-regex': ALERT, // disallow use of debugger 'no-debugger': WARN, // disallow duplicate arguments in functions 'no-dupe-args': ALERT, // disallow duplicate keys when creating object literals 'no-dupe-keys': ALERT, // disallow a duplicate case label. 'no-duplicate-case': ALERT, // disallow the use of empty character classes in regular expressions 'no-empty-character-class': ALERT, // disallow empty statements 'no-empty': ALERT, // disallow assigning to the exception in a catch block 'no-ex-assign': ALERT, // disallow double-negation boolean casts in a boolean context 'no-extra-boolean-cast': ALERT, // disallow unnecessary parentheses 'no-extra-parens': ALERT, // disallow unnecessary semicolons 'no-extra-semi': ALERT, // disallow overwriting functions written as function declarations 'no-func-assign': IGNORE, // disallow function or variable declarations in nested blocks 'no-inner-declarations': ALERT, // disallow invalid regular expression strings in the RegExp constructor 'no-invalid-regexp': ALERT, // disallow irregular whitespace outside of strings and comments 'no-irregular-whitespace': ALERT, // disallow negation of the left operand of an in expression 'no-negated-in-lhs': ALERT, // disallow the use of object properties of the global object (Math and JSON) as functions 'no-obj-calls': ALERT, // disallow multiple spaces in a regular expression literal 'no-regex-spaces': ALERT, // disallow sparse arrays 'no-sparse-arrays': ALERT, // Avoid code that looks like two expressions but is actually one 'no-unexpected-multiline': ALERT, // disallow unreachable statements after a return, throw, continue, or break statement 'no-unreachable': ALERT, // disallow comparisons with the value NaN 'use-isnan': ALERT, // ensure JSDoc comments are valid 'valid-jsdoc': ALERT, // ensure that the results of typeof are compared against a valid string 'valid-typeof': ALERT, /* Strict Mode */ // babel/meteor inserts `use strict;` for us strict: [ALERT, 'never'], /* Best Practices */ // Enforces getter/setter pairs in objects 'accessor-pairs': ALERT, // treat var statements as if they were block scoped 'block-scoped-var': ALERT, // specify the maximum cyclomatic complexity allowed in a program complexity: [WARN, COMPLEXITY], // require return statements to either always or never specify values 'consistent-return': ALERT, // specify curly brace conventions for all control statements curly: ALERT, // require default case in switch statements 'default-case': ALERT, // encourages use of dot notation whenever possible 'dot-location': [ALERT, 'property'], // enforces consistent newlines before or after dots 'dot-notation': [ALERT, { allowKeywords: true }], // require the use of === and !== eqeqeq: ALERT, // make sure for-in loops have an if statement 'guard-for-in': ALERT, // disallow the use of alert, confirm, and prompt 'no-alert': WARN, // disallow use of arguments.caller or arguments.callee 'no-caller': ALERT, // disallow lexical declarations in case clauses 'no-case-declarations': ALERT, // disallow division operators explicitly at beginning of regular expression 'no-div-regex': ALERT, // disallow else after a return in an if 'no-else-return': ALERT, // disallow use of labels for anything other then loops and switches 'no-empty-label': ALERT, // disallow use of empty destructuring patterns 'no-empty-pattern': ALERT, // disallow comparisons to null without a type-checking operator 'no-eq-null': ALERT, // disallow use of eval() 'no-eval': ALERT, // disallow adding to native types 'no-extend-native': ALERT, // disallow unnecessary function binding 'no-extra-bind': ALERT, // disallow fallthrough of case statements 'no-fallthrough': ALERT, // disallow the use of leading or trailing decimal points in numeric literals 'no-floating-decimal': ALERT, // disallow the type conversions with shorter notations 'no-implicit-coercion': ALERT, // disallow use of eval()-like methods 'no-implied-eval': ALERT, // disallow this keywords outside of classes or class-like objects 'no-invalid-this': ALERT, // disallow usage of __iterator__ property 'no-iterator': ALERT, // disallow use of labeled statements 'no-labels': ALERT, // disallow unnecessary nested blocks 'no-lone-blocks': ALERT, // disallow creation of functions within loops 'no-loop-func': ALERT, // disallow the use of magic numbers 'no-magic-numbers': ALERT, // disallow use of multiple spaces 'no-multi-spaces': ALERT, // disallow use of multiline strings 'no-multi-str': ALERT, // disallow reassignments of native objects 'no-native-reassign': ALERT, // disallow use of new operator for Function object 'no-new-func': ALERT, // disallows creating new instances of String,Number, and Boolean 'no-new-wrappers': ALERT, // disallow use of the new operator when not part of an assignment or comparison 'no-new': ALERT, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251"; 'no-octal-escape': ALERT, // disallow use of octal literals 'no-octal': ALERT, // disallow reassignment of function parameters 'no-param-reassign': [ALERT, { props: false }], // disallow use of process.env 'no-process-env': WARN, // disallow usage of __proto__ property 'no-proto': ALERT, // disallow declaring the same variable more than once 'no-redeclare': [ALERT, { builtinGlobals: true }], // disallow use of assignment in return statement 'no-return-assign': ALERT, // disallow use of javascript: urls. 'no-script-url': ALERT, // disallow comparisons where both sides are exactly the same 'no-self-compare': ALERT, // disallow use of the comma operator 'no-sequences': ALERT, // restrict what can be thrown as an exception 'no-throw-literal': ALERT, // disallow usage of expressions in statement position 'no-unused-expressions': ALERT, // disallow unnecessary .call() and .apply() 'no-useless-call': ALERT, // disallow unnecessary concatenation of literals or template literals 'no-useless-concat': ALERT, // disallow use of the void operator 'no-void': ALERT, // disallow usage of configurable warning terms in comments - e.g. todo or fixme 'no-warning-comments': [WARN, { terms: ['todo', 'fixme', 'xxx'], location: 'start' }], // disallow use of the with statement 'no-with': ALERT, // require use of the second argument for parseInt() radix: ALERT, // require declaration of all vars at the top of their containing scope 'vars-on-top': ALERT, // require immediate function invocation to be wrapped in parentheses 'wrap-iife': [ALERT, 'any'], // require or disallow Yoda conditions yoda: ALERT, /* Variables */ // enforce or disallow variable initializations at definition 'init-declarations': [WARN, 'always'], // disallow the catch clause parameter name being the same as a variable in the outer scope 'no-catch-shadow': ALERT, // disallow deletion of variables 'no-delete-var': ALERT, // disallow labels that share a name with a variable 'no-label-var': ALERT, // disallow shadowing of names such as arguments 'no-shadow-restricted-names': ALERT, // disallow declaration of variables already declared in the outer scope 'no-shadow': ALERT, // disallow use of undefined when initializing variables 'no-undef-init': ALERT, // disallow use of undeclared variables unless mentioned in a /*global */ block 'no-undef': ALERT, // disallow use of undefined variable 'no-undefined': IGNORE, // disallow declaration of variables that are not used in the code 'no-unused-vars': ALERT, // disallow use of variables before they are defined 'no-use-before-define': ALERT, /* Node.js and CommonJS */ // enforce return after a callback 'callback-return': ALERT, // enforce require() on top-level module scope 'global-require': ALERT, // enforce error handling in callbacks 'handle-callback-err': ALERT, // disallow mixing regular variable and require declarations 'no-mixed-requires': ALERT, // disallow use of new operator with the require function 'no-new-require': ALERT, // disallow string concatenation with __dirname and __filename 'no-path-concat': ALERT, // disallow process.exit() 'no-process-exit': ALERT, // restrict usage of specified node modules 'no-restricted-modules': IGNORE, // disallow use of synchronous methods 'no-sync': ALERT, /* Stylistic Issues */ // enforce spacing inside array brackets 'array-bracket-spacing': [ALERT, 'never'], // disallow or enforce spaces inside of single line blocks 'block-spacing': [ALERT, 'always'], // enforce one true brace style 'brace-style': [ALERT, 'stroustrup', { allowSingleLine: true }], // require camel case names camelcase: [ALERT, { properties: 'always' }], // enforce spacing before and after comma 'comma-spacing': [ALERT, { before: false, after: true }], // enforce one true comma style 'comma-style': [ALERT, 'last'], // require or disallow padding inside computed properties 'computed-property-spacing': [ALERT, 'never'], // enforce consistent naming when capturing the current execution context 'consistent-this': [ALERT, 'self'], // enforce newline at the end of file, with no multiple empty lines 'eol-last': ALERT, // require function expressions to have a name 'func-names': WARN, // enforce use of function declarations or expressions 'func-style': IGNORE, // this option enforces minimum and maximum identifier lengths (variable names, property names etc.) 'id-length': IGNORE, // require identifiers to match the provided regular expression 'id-match': IGNORE, // specify tab or space width for your code indent: [ALERT, 2], // specify whether double or single quotes should be used in JSX attributes 'jsx-quotes': [ALERT, 'prefer-single'], // enforce spacing between keys and values in object literal properties 'key-spacing': [ALERT, { beforeColon: false, afterColon: true }], // disallow mixed LF and CRLF as linebreaks 'linebreak-style': [ALERT, 'unix'], // enforce empty lines around comments 'lines-around-comment': [ALERT, { beforeBlockComment: true, allowBlockStart: true, allowObjectStart: true, allowArrayStart: true }], // specify the maximum depth that blocks can be nested 'max-depth': [WARN, MAX_NESTED_BLOCKS], // specify the maximum length of a line in your program 'max-len': [WARN, MAX_STATEMENT_LENGTH, TAB_SPACE, { ignoreComments: true, ignoreUrls: true }], // specify the maximum depth callbacks can be nested 'max-nested-callbacks': [WARN, MAX_NESTED_CALLBACKS], // limits the number of parameters that can be used in the function declaration. 'max-params': [WARN, MAX_PARAMS], // specify the maximum number of statement allowed in a function 'max-statements': [IGNORE, MAX_STATEMENTS], // require a capital letter for constructors 'new-cap': [ALERT, { newIsCap: true, capIsNew: false }], // disallow the omission of parentheses when invoking a constructor with no arguments 'new-parens': ALERT, // require or disallow an empty newline after variable declarations 'newline-after-var': ALERT, // disallow use of the Array constructor 'no-array-constructor': ALERT, // disallow use of bitwise operators 'no-bitwise': ALERT, // disallow use of the continue statement 'no-continue': ALERT, // disallow comments inline after code 'no-inline-comments': ALERT, // disallow if as the only statement in an else block 'no-lonely-if': ALERT, // disallow mixed spaces and tabs for indentation 'no-mixed-spaces-and-tabs': [ALERT, 'smart-tabs'], // disallow multiple empty lines 'no-multiple-empty-lines': [ALERT, { max: 2, maxEOF: 1 }], // disallow negated conditions 'no-negated-condition': ALERT, // disallow nested ternary expressions 'no-nested-ternary': ALERT, // disallow the use of the Object constructor 'no-new-object': ALERT, // disallow use of unary operators, ++ and -- 'no-plusplus': [ALERT, { allowForLoopAfterthoughts: true }], // disallow use of certain syntax in code 'no-restricted-syntax': [ALERT, 'ClassDeclaration'], // disallow space between function identifier and application 'no-spaced-func': ALERT, // disallow the use of ternary operators 'no-ternary': IGNORE, // disallow trailing whitespace at the end of lines 'no-trailing-spaces': ALERT, // disallow dangling underscores in identifiers 'no-underscore-dangle': IGNORE, // disallow the use of ternary operators when a simpler alternative exists 'no-unneeded-ternary': ALERT, // require or disallow padding inside curly braces 'object-curly-spacing': [ALERT, 'always'], // require or disallow one variable declaration per function 'one-var': [WARN, 'always'], // require assignment operator shorthand where possible or prohibit it entirely 'operator-assignment': [ALERT, 'always'], // enforce operators to be placed before or after line breaks 'operator-linebreak': [ALERT, 'before'], // enforce padding within blocks 'padded-blocks': [ALERT, 'never'], // require quotes around object literal property names 'quote-props': [ALERT, 'as-needed', { keywords: true }], // specify whether backticks, double or single quotes should be used quotes: [ALERT, 'single', 'avoid-escape'], // Require JSDoc comment 'require-jsdoc': [WARN, { require: { FunctionDeclaration: true, MethodDefinition: true, ClassDeclaration: true } }], // enforce spacing before and after semicolons 'semi-spacing': [ALERT, { before: false, after: true }], // require or disallow use of semicolons instead of ASI semi: [ALERT, 'always'], // sort variables within the same declaration block 'sort-vars': [IGNORE, { ignoreCase: true }], // require a space after certain keywords 'space-after-keywords': [ALERT, 'always'], // require or disallow a space before blocks 'space-before-blocks': [ALERT, 'always'], // require or disallow a space before function opening parenthesis 'space-before-function-paren': [ALERT, 'never'], // require a space before certain keywords 'space-before-keywords': [ALERT, 'always'], // require or disallow spaces inside parentheses 'space-in-parens': [ALERT, 'never'], // require spaces around operators 'space-infix-ops': ALERT, // require a space after return, throw, and case 'space-return-throw-case': ALERT, // require or disallow spaces before/after unary operators 'space-unary-ops': [ALERT, { words: true, nonwords: false }], // require or disallow a space immediately following the // or /* in a comment 'spaced-comment': [ALERT, 'always'], // require regex literals to be wrapped in parentheses 'wrap-regex': IGNORE, /* ECMAScript 6 */ // require braces in arrow function body 'arrow-body-style': [ALERT, 'as-needed'], // require parens in arrow function arguments 'arrow-parens': [ALERT, 'as-needed'], // require space before/after arrow functions arrow 'arrow-spacing': [ALERT, { before: true, after: true }], // verify calls of super() in constructors 'constructor-super': ALERT, // enforce spacing around the * in generator functions 'generator-star-spacing': [ALERT, { before: false, after: true }], // disallow arrow functions where a condition is expected 'no-arrow-condition': ALERT, // disallow modifying variables of class declarations 'no-class-assign': ALERT, // disallow modifying variables that are declared using const 'no-const-assign': ALERT, // disallow duplicate name in class members 'no-dupe-class-members': ALERT, // disallow use of this/super before calling super() in constructors. 'no-this-before-super': ALERT, // require let or const instead of var 'no-var': ALERT, // require method and property shorthand syntax for object literals 'object-shorthand': ALERT, // suggest using arrow functions as callbacks 'prefer-arrow-callback': IGNORE, // suggest using const declaration for variables that are never modified after declared 'prefer-const': WARN, // suggest using Reflect methods where applicable 'prefer-reflect': IGNORE, // suggest using the spread operator instead of .apply(). 'prefer-spread': ALERT, // suggest using template literals instead of strings concatenation 'prefer-template': ALERT, // disallow generator functions that do not have yield 'require-yield': ALERT, /* Plugins */ /* - Meteor */ // Definitions for global Meteor variables based on environment 'meteor/globals': ALERT, // Meteor Core API 'meteor/core': ALERT, // Prevent misusage of Publish and Subscribe 'meteor/pubsub': ALERT, // Prevent misusage of methods 'meteor/methods': ALERT, // Core API for check and Match 'meteor/check': ALERT, // Core API for connections 'meteor/connections': ALERT, // Core API for collections 'meteor/collections': ALERT, // Core API for Session 'meteor/session': ALERT, // Enforce check on all arguments passed to methods and publish functions 'meteor/audit-argument-checks': IGNORE, // Prevent usage of Session 'meteor/no-session': ALERT, // Prevent deprecated template lifecycle callback assignments 'meteor/no-blaze-lifecycle-assignment': ALERT, // Prevent usage of Meteor.setTimeout with zero delay 'meteor/no-zero-timeout': ALERT, // Force consistent event handler parameters in event maps 'meteor/blaze-consistent-eventmap-params': ALERT, /* - React */ // Prevent missing displayName in a React component definition 'react/display-name': WARN, // Forbid certain propTypes 'react/forbid-prop-types': WARN, // Enforce boolean attributes notation in JSX 'react/jsx-boolean-value': WARN, // Validate closing bracket location in JSX 'react/jsx-closing-bracket-location': WARN, // Enforce or disallow spaces inside of curly braces in JSX attributes 'react/jsx-curly-spacing': WARN, // Enforce event handler naming conventions in JSX 'react/jsx-handler-names': WARN, // Validate props indentation in JSX 'react/jsx-indent-props': WARN, // Validate JSX has key prop when in array or iterator 'react/jsx-key': WARN, // Limit maximum of props on a single line in JSX 'react/jsx-max-props-per-line': WARN, // Prevent usage of .bind() and arrow functions in JSX props 'react/jsx-no-bind': WARN, // Prevent duplicate props in JSX 'react/jsx-no-duplicate-props': WARN, // Prevent usage of unwrapped JSX strings 'react/jsx-no-literals': WARN, // Disallow undeclared variables in JSX 'react/jsx-no-undef': WARN, // Enforce PascalCase for user-defined JSX components 'react/jsx-pascal-case': WARN, // Enforce quote style for JSX attributes // 'react/jsx-quotes': WARN, // DEPRECIED // Enforce propTypes declarations alphabetical sorting 'react/jsx-sort-prop-types': WARN, // Enforce props alphabetical sorting 'react/jsx-sort-props': WARN, // Prevent React to be incorrectly marked as unused 'react/jsx-uses-react': WARN, // Prevent variables used in JSX to be incorrectly marked as unused 'react/jsx-uses-vars': WARN, // Prevent usage of dangerous JSX properties 'react/no-danger': WARN, // Prevent usage of setState in componentDidMount 'react/no-did-mount-set-state': WARN, // Prevent usage of setState in componentDidUpdate 'react/no-did-update-set-state': WARN, // Prevent direct mutation of this.state 'react/no-direct-mutation-state': WARN, // Prevent multiple component definition per file 'react/no-multi-comp': WARN, // Prevent usage of setState 'react/no-set-state': WARN, // Prevent usage of unknown DOM property 'react/no-unknown-property': WARN, // Prefer es6 class instead of createClass for React Components 'react/prefer-es6-class': WARN, // Prevent missing props validation in a React component definition 'react/prop-types': WARN, // Prevent missing React when using JSX 'react/react-in-jsx-scope': WARN, // Restrict file extensions that may be required 'react/require-extension': WARN, // Prevent extra closing tags for components without children 'react/self-closing-comp': WARN, // Enforce component methods order 'react/sort-comp': WARN, // Prevent missing parentheses around multilines JSX 'react/wrap-multilines': WARN, /* - Jasmine */ // Disallow use of focused tests 'jasmine/no-focused-tests': ALERT, // Disallow use of disabled tests 'jasmine/no-disabled-tests': WARN, // Disallow the use of duplicate spec names 'jasmine/no-spec-dupes': [WARN, 'branch'], // Disallow the use of duplicate suite names 'jasmine/no-suite-dupes': [WARN, 'branch'], // Enforce that a suitess callback does not contain any arguments 'jasmine/no-suite-callback-args': ALERT, // Enforce expectation 'jasmine/missing-expect': [WARN, 'expect()'], // Enforce valid expect() usage 'jasmine/valid-expect': WARN, /* - Lodash */ // Prefer property shorthand syntax 'lodash3/prop-shorthand': WARN, // Prefer matches property shorthand syntax 'lodash3/matches-shorthand': [WARN, MAX_PATH_LENGTH], // Prefer matches shorthand syntax 'lodash3/matches-prop-shorthand': WARN, // Preferred aliases 'lodash3/prefer-chain': WARN, // Prefer chain over nested lodash calls 'lodash3/preferred-alias': WARN, // Prevent chaining syntax for single method, e.g. _(x).map().value() 'lodash3/no-single-chain': WARN, // Prefer _.reject over filter with !(expression) or x.prop1 !== value 'lodash3/prefer-reject': [WARN, MAX_PATH_LENGTH], // Prefer _.filter over _.forEach with an if statement inside. 'lodash3/prefer-filter': [WARN, MAX_PATH_LENGTH], // Prefer passing thisArg over binding. 'lodash3/no-unnecessary-bind': WARN, // Prevent chaining without evaluation via value() or non-chainable methods like max(). 'lodash3/unwrap': WARN, // Prefer _.compact over _.filter for only truthy values. 'lodash3/prefer-compact': WARN, // Do not use .value() on chains that have already ended (e.g. with max() or reduce()) 'lodash3/no-double-unwrap': WARN, // Prefer _.map over _.forEach with a push inside. 'lodash3/prefer-map': WARN, // Prefer using array and string methods in the chain and not the initial value, e.g. _(str).split( )... 'lodash3/prefer-wrapper-method': WARN, // Prefer using _.invoke over _.map with a method call inside. 'lodash3/prefer-invoke': WARN, // Prefer using _.prototype.thru in the chain and not call functions in the initial value, e.g. _(x).thru(f).map(g)... 'lodash3/prefer-thru': WARN, // Prefer using Lodash chains (e.g. _.map) over native and mixed chains. 'lodash3/prefer-lodash-chain': WARN, // Prefer using Lodash collection methods (e.g. _.map) over native array methods. 'lodash3/prefer-lodash-method': WARN, // Prefer using _.is* methods over typeof and instanceof checks when applicable. 'lodash3/prefer-lodash-typecheck': WARN, // Do not use .commit() on chains that should end with .value() 'lodash3/no-commit': WARN, // Prefer using _.get or _.has over expression chains like a && a.b && a.b.c. 'lodash3/prefer-get': [WARN, MIN_DEPTH], // Always return a value in iteratees of lodash collection methods that arent forEach. 'lodash3/collection-return': WARN, // Prefer _.matches over conditions like a.foo === 1 && a.bar === 2 && a.baz === 3. 'lodash3/prefer-matches': WARN, // Prefer _.times over _.map without using the iteratees arguments. 'lodash3/prefer-times': WARN, /* - MongoDB */ // Check insertOne/insertMany calls to ensure their arguments are well formed. 'mongodb/check-insert-calls': ALERT, // Check find/findOne calls to ensure their arguments are well formed 'mongodb/check-query-calls': ALERT, // Check update calls to ensure their arguments are well formed. 'mongodb/check-update-calls': ALERT, // Check remove calls to ensure their arguments are well formed. 'mongodb/check-remove-calls': ALERT, // Check collection calls and warn in case of deprecated methods usage. 'mongodb/check-deprecated-calls': ALERT, // Check update queries to ensure no raw replace is done 'mongodb/no-replace': WARN, // Check $rename update operator usage. 'mongodb/check-rename-updates': ALERT, // Check $unset update operator usage. 'mongodb/check-unset-updates': ALERT, // Check $currentDate update operator usage. 'mongodb/check-current-date-updates': ALERT, // Check update queries to ensure numeric operators like $mul and $inc contain numeric values. 'mongodb/check-numeric-updates': ALERT, // Check $min and $max update operators usage. 'mongodb/check-minmax-updates': ALERT, // Check $set and $setOnInsert update operators usage. 'mongodb/check-set-updates': ALERT, // Check $push update operator usage and its modifiers. 'mongodb/check-push-updates': ALERT, // Check $pull update operator usage. 'mongodb/check-pull-updates': ALERT, // Check $pop update operator usage. 'mongodb/check-pop-updates': ALERT, // Check $addToSet update operator usage and common misuses. 'mongodb/check-addtoset-updates': ALERT, // Check deprecated update operator usage. 'mongodb/check-deprecated-updates': ALERT }, settings: { mongodb: { callPatterns: { query: [ '(\\.|^)db\\.collection\\([^\\)]+\\)\\.(find|findOne|)$' ], update: [ '(\\.|^)db\\.collection\\([^\\)]+\\)\\.(findOneAndUpdate' + '|updateOne|updateMany)$' ], insert: [ '(\\.|^)db\\.collection\\([^\\)]+\\)\\.(insertOne|insertMany)$' ], remove: [ '(\\.|^)db\\.collection\\([^\\)]+\\)\\.(findOneAndDelete' + '|deleteOne|deleteMany)$' ], deprecated: [ '(\\.|^)db\\.collection\\([^\\)]+\\)\\.(remove|update|' + 'findAndModify|ensureIndex|findAndRemove|insert|dropAllIndexes)$' ] } }, meteor: { // all universal collections collections: [] } }, globals: { // main package K: true, Patterns: true, errorPrefix: true, buildCheckError: true, primitiveMap: true, // tests beautifyPattern: true, beautifyValue: true, matches: true, fails: true, primitiveValues: true, integrateArray: true, integrateCustomFunctions: true, integrateExactValues: true, integrateMatchAny: true, integrateMatchInteger: true, integrateMatchOneOf: true, integrateMatchWhere: true, integrateObject: true, integratePrimitiveTypes: true, matchAny: true, matchInteger: true } };
1.242188
1
browser.js
sindresorhus/has-generator
6
15996644
/* eslint-disable no-new, no-new-func */ 'use strict'; try { new Function('return function * () {}'); module.exports = true; } catch (err) { module.exports = false; }
0.738281
1
lib/rest.js
kiba-zhao/egg-http-simple
0
15996652
/** * @fileOverview rest接口类 * @name rest.js * @author kiba.x.zhao <<EMAIL>> * @license MIT */ 'use strict'; const { get, isFunction } = require('lodash'); const APP_KEY = Symbol('APP'); const OPTS_KEY = Symbol('OPTS'); const METHODS = { post: 'POST', put: 'PUT', patch: 'PATCH', del: 'DELETE', }; class RestApi { constructor(app, opts) { this[APP_KEY] = app; this[OPTS_KEY] = opts; } /** * 列出匹配条件的所有资源 * @param {Object} condition 匹配条件 * @param {Object} opts 可选项 */ async find(condition, opts) { const { app, url, query, options } = prepare(this, condition, opts); const res = await app.curl(`${url}?${query}`, options); return res.data; } /** * 获取一个匹配的资源 * @param {Object} condition 匹配条件 * @param {Object} opts 可选项 */ async findOne(condition, opts) { const { id, ..._condition } = condition; const { app, url, query, options } = prepare(this, _condition, opts); const res = await app.curl(`${url}/${id}?${query}`, options); return res.data; } /** * 新建一个资源 * @param {Object} entity 资源内容 * @param {Object} opts 可选项 */ async createOne(entity, opts) { const { app, url, options } = prepareEntity(this, entity, undefined, opts); const res = await app.curl(url, { ...options, method: METHODS.post }); return res.data; } /** * 更新一个匹配资源的内容 * @param {Object} entity 更新资源内容 * @param {Object} condition 匹配条件 * @param {Object} opts 可选项 */ async replaceOne(entity, condition, opts) { const { id, ..._condition } = condition; const { app, url, query, options } = prepareEntity(this, entity, _condition, opts); const res = await app.curl(`${url}/${id}?${query}`, { ...options, method: METHODS.put }); return res.data; } /** * 更新一个匹配资源的部分内容 * @param {Object} entity 更新资源内容 * @param {Object} condition 匹配条件 * @param {Object} opts 可选项 */ async updateOne(entity, condition, opts) { const { id, ..._condition } = condition; const { app, url, query, options } = prepareEntity(this, entity, _condition, opts); const res = await app.curl(`${url}/${id}?${query}`, { ...options, method: METHODS.patch }); return res.data; } /** * 销毁一个匹配的资源 * @param {Object} condition 匹配条件 * @param {Object} opts 可选项 */ async deleteOne(condition, opts) { const { id, ..._condition } = condition; const { app, url, query, options } = prepare(this, _condition, opts); const res = await app.curl(`${url}/${id}?${query}`, { ...options, method: METHODS.del }); return res.data; } /** * 销毁匹配的所有资源 * @param {Object} condition 匹配条件 * @param {Object} opts 可选项 */ async deleteAll(condition, opts) { const { app, url, query, options } = prepare(this, condition, opts); const res = await app.curl(`${url}?${query}`, { ...options, method: METHODS.del }); return res.data; } } module.exports = RestApi; function prepare(target, condition, opts) { const app = target[APP_KEY]; const { url, inject, ...options } = target[OPTS_KEY]; const search = new URLSearchParams(condition); const headers = options.headers || {}; if (inject) { for (const key in inject) { headers[key] = get(opts, inject[key]); } } return { app, url, query: search.toString(), options: { ...options, headers, trasform: undefined } }; } function prepareEntity(target, entity, condition, opts) { const { options, ...others } = prepare(target, condition, opts); const { trasform } = target[OPTS_KEY]; let bodyOpts = null; if (isFunction(trasform)) { bodyOpts = trasform(entity); } else { bodyOpts = { data: entity }; } return { options: { ...options, ...bodyOpts }, ...others }; }
1.546875
2
src/utils/utils.js
supercede/naija-fotos
0
15996660
import { NotFoundError, ApplicationError } from '../helpers/errors'; import Collection from '../models/collection.model'; import Photo from '../models/photo.model'; export default { /** * @description check if an item exist in a collection * * @param {mongoose.Model} Model - Model to be queried * @param {string} id - id of item to be modified */ checkIfExists: async (Model, id) => { const modelName = await Model.collection.collectionName.slice(0, -1); const item = await Model.findById(id); if (!item) { throw new NotFoundError(`${modelName} not found`); } }, /** * @description check if user can add/remove photo to/from a collection * * @param {string} collectionId * @param {string} photoId * @param {string} userId * */ verify: async (collectionId, photoId, userId) => { const collection = await Collection.findById(collectionId); if (!collection) { throw new NotFoundError('Collection not found'); } if (collection.user.id !== userId) { throw new ApplicationError( 403, 'You are not permitted to perform this operation', ); } const photo = await Photo.findById(photoId); if (!photo) { throw new NotFoundError('Photo not found'); } return { photo, collection }; }, /** * @description update a field total in a collection * * @param {mongoose.Model} Model - Model to be queried * @param {string} id - id of item to be updated * @param {string} val - value to increase or decrease field by * @param {field} field - field to be updated in item * */ updateCount: async (Model, id, val, field) => { const doc = await Model.findOneAndUpdate( { _id: id }, { $inc: { [`${field}`]: val } }, { new: true, runValidators: true, }, ).select('name imageURL description user upvoteCount'); return doc; }, };
1.726563
2
www/docs/classfemto_1_1hardware_1_1EXT.js
bl-ackrain/FemtoIDE
18
15996668
var classfemto_1_1hardware_1_1EXT = [ [ "pullDown", "classfemto_1_1hardware_1_1EXT.html#a2b90dfe9a4c7085b61b03a4b9ee28bb3", null ], [ "pullNone", "classfemto_1_1hardware_1_1EXT.html#ab823a2ce59b78fb4403266dddf50b07d", null ], [ "pullUp", "classfemto_1_1hardware_1_1EXT.html#af96683259e9b5b4f3d589fbe6b470f2d", null ], [ "read", "classfemto_1_1hardware_1_1EXT.html#a836d40f485891f6e500c71381267c247", null ], [ "repeater", "classfemto_1_1hardware_1_1EXT.html#a80337069ae0dab540df0b407f3a9af06", null ], [ "setInput", "classfemto_1_1hardware_1_1EXT.html#a170443597bde15e94c7831d2597b4b84", null ], [ "setOutput", "classfemto_1_1hardware_1_1EXT.html#af465d400dace5399e078ddec26a6a8f6", null ], [ "setSpecial", "classfemto_1_1hardware_1_1EXT.html#aed3cbcd8f31c8aa387d19ecbaf1a18cf", null ], [ "special", "classfemto_1_1hardware_1_1EXT.html#aff5d001a7bb98c9768f8a21cda74970c", null ], [ "write", "classfemto_1_1hardware_1_1EXT.html#ab2c270580eaa5229c8f214c4017d335f", null ] ];
0.386719
0
src/js/args.js
gtirloni/fluid-lint-all
0
15996676
"use strict"; var fluid = require("infusion"); var minimist = require("minimist"); fluid.registerNamespace("fluid.lintAll"); /** * @typedef {Object} ParsedArgs - The parsed and annotated set of arguments. * @property {Array<String>} [checks] * @property {String | Error } [configFile] * @property {Boolean} [showHelp] * @property {Boolean} [showMergedConfig] * * Invalid content (such as a missing `configFile` value) is replaced with an `Error`. If invalid fields are passed, * they are replaced with an `Error`. */ /** * * Use `minimist` to parse the arguments and then check for invalid inputs. * * @param {Array<String>} processArgs - The complete set of arguments, generally `process.argv`. * @return {ParsedArgs} - An object representing the parsed arguments. * */ fluid.lintAll.parseArgs = function (processArgs) { var minimistOptions = minimist(processArgs.slice(2), { boolean: ["showMergedConfig", "showHelp", "showCheckedFiles"], string: ["checks", "configFile"], alias: { "showHelp": ["h", "help"] } }); // Minimist only handles parsing and not validation, so we lightly validate the input here. var supportedArgKeys = ["checks", "configFile", "showMergedConfig", "showHelp", "showCheckedFiles", "help", "h"]; var argsOptions = fluid.filterKeys(minimistOptions, supportedArgKeys); if (argsOptions.checks) { argsOptions.checks = argsOptions.checks.trim().replace(/^"(.+)"$/, "$1").split(/ *, */); } if (minimistOptions.configFile === "") { argsOptions.configFile = new Error("Missing filename."); } var badArgs = fluid.filterKeys(minimistOptions, supportedArgKeys, true); fluid.each(badArgs, function (badArgumentValue, badArgumentKey) { if (badArgumentKey !== "_") { argsOptions[badArgumentKey] = new Error("Invalid argument '" + badArgumentKey + "'."); } }); return argsOptions; };
1.53125
2
src/apps/content-editor/src/app/views/Dashboard/components/InboundTraffic/index.js
giseleblair/manager-ui
20
15996684
export { InboundTraffic } from "./InboundTraffic";
-0.134766
0
src/components/routing/Routing.js
freshreact/freshreact
0
15996692
import React, { Component } from 'react'; import { NavLink, BrowserRouter, Route, Switch, Redirect } from 'react-router-dom'; import "./Routing.css"; import RoutingComponent from './routing-components/RoutingComponent'; function RoutingHome(props) { return ( <div className="routing-home-container" style={{backgroundColor: props.color }}> <div className="routing-individual-component"> <p className="route-header">Welcome to {props.route} component!</p> <p className="route-color">The background color is:<br></br>{props.color}</p> </div> </div> ); } class Routing extends Component{ state = { // Default background color home: { background: '#FF7197' }, routeOne: { background: '#7EFFD0' }, routeTwo: { background: '#7FD2FF' }, routeThree: { background: '#A592FF' } }; // Bring window view to top on change componentDidMount() { window.scrollTo(0, 0) } render(){ return( <BrowserRouter> <center> <div className="routing-container"> <ul className="routing-options"> <li> <NavLink activeClassName='is-active' className="route-option" to="/routing"> <div className="route-op" style={{backgroundColor: this.state.home.background }}>Home</div> </NavLink> </li> <li> <NavLink activeClassName='is-active' className="route-option" to="/routing/route1"> <div className="route-op" style={{backgroundColor: this.state.routeOne.background }}>Route 1</div> </NavLink> </li> <li> <NavLink activeClassName='is-active' className="route-option" to="/routing/route2"> <div className="route-op" style={{backgroundColor: this.state.routeTwo.background }}>Route 2</div> </NavLink> </li> <li> <NavLink activeClassName='is-active' className="route-option" to="/routing/route3"> <div className="route-op" style={{backgroundColor: this.state.routeThree.background }}>Route 3</div> </NavLink> </li> </ul> <br></br> <Switch> <Route exact path="/routing" component={() => <RoutingHome route="Home" color={this.state.home.background}/>} /> <Route path="/routing/route1" component={() => <RoutingComponent route="Route 1" color={this.state.routeOne.background}/>} /> <Route path="/routing/route2" component={() => <RoutingComponent route="Route 2" color={this.state.routeTwo.background}/>}/> <Route path="/routing/route3" component={() => <RoutingComponent route="Route 3" color={this.state.routeThree.background}/>}/> <Redirect to="/portfolio" /> </Switch> </div> </center> </BrowserRouter> ); } } export default Routing;
1.414063
1
common/src/scripts/extension-version.js
amitsingh-007/bypass-links
18
15996700
const manifest = require("../../../extension/public/manifest.json"); module.exports = { extVersion: manifest.version, };
0.601563
1
gulpTasks/dist.js
giraone/pms-sample-jee-01-ajs1
0
15996708
// Contains the task for distribution of PmsSampleApp // Will fill a "dist" folder with all the files needed to let PmsSampleApp run // When "dev" the "dist" folder is just a copy of the "build" folder (this is default) // When "release" the "dist" folder contains minified files only // All tasks operate on the build folder only 'use strict'; // Add all dev tasks require('./dev'); var gulp = require('gulp'), del = require('del'), buildConfig = require('../gulp.config'), path = require('path'), runSequence = require('run-sequence'), uglify = require('gulp-uglify'), inject = require('gulp-inject'), minifyCss = require('gulp-minify-css'), concat = require('gulp-concat'), minifyHtml = require('gulp-minify-html'), ngAnnotate = require('gulp-ng-annotate'), templateCache = require('gulp-ng-template'), eventStream = require('event-stream'), rewriteCss = require('gulp-rewrite-css'), merge2 = require('merge2'), utils = require('./utils.js'); gulp.task('dist:clean', function (done) { del([ buildConfig.targets.distFolder, buildConfig.targets.tempFolder ]) .then(function () { done(); }); }); gulp.task('dist:copy-sources', function () { return gulp.src(path.join(buildConfig.targets.buildFolder, '**', '*')) .pipe(gulp.dest(buildConfig.targets.distFolder)); }); gulp.task('dist:uglify:js', function () { return gulp.src([].concat( utils.getMappedSourceFiles(buildConfig.source.files.vendor.js, buildConfig.targets.buildFolder), utils.getMappedSourceFiles(buildConfig.source.files.app.js, buildConfig.targets.buildFolder), path.join(buildConfig.targets.tempFolder, buildConfig.targets.minified.templateCache) ) ) .pipe(ngAnnotate()) .pipe(concat(buildConfig.targets.minified.js)) .pipe(uglify()) .pipe(gulp.dest(buildConfig.targets.distFolder)); }); gulp.task('dist:uglify:css', function () { return merge2( gulp.src(utils.getMappedSourceFiles(buildConfig.source.files.vendor.css, buildConfig.targets.buildFolder)) .pipe(rewriteCss({ destination: 'build/vendor/', adaptPath: function (context) { return path.join(buildConfig.targets.assetsFolder, path.relative(context.destinationDir, context.sourceDir), context.targetFile); } })), gulp.src(utils.getMappedSourceFiles(buildConfig.source.files.app.css, buildConfig.targets.buildFolder)) ) .pipe(concat(buildConfig.targets.minified.css)) .pipe(minifyCss()) .pipe(gulp.dest(buildConfig.targets.distFolder)); }); gulp.task('dist:copy-assets', function () { // Needed due to negative globbing var onlyFiles = function (es) { return es.map(function (file, cb) { if (file.stat.isFile()) { return cb(null, file); } else { return cb(); } }); }; return utils.getAssets(buildConfig.targets.buildFolder, true, true) .pipe(onlyFiles(eventStream)) .pipe(gulp.dest(path.join(buildConfig.targets.distFolder, buildConfig.targets.assetsFolder))); }); gulp.task('dist:templateCache', function () { return gulp.src(utils.getMappedSourceFiles(buildConfig.source.files.app.html, buildConfig.targets.buildFolder), { base: buildConfig.targets.buildFolder }) .pipe(minifyHtml({ empty: true, comments: true, spare: true, quotes: true })) .pipe(templateCache({ standalone: false, moduleName: buildConfig.angularModuleName, filePath: buildConfig.targets.minified.templateCache })) .pipe(gulp.dest(buildConfig.targets.tempFolder)); }); gulp.task('dist:inject', function () { var injectables = gulp.src([ path.join(buildConfig.targets.distFolder, buildConfig.targets.minified.js), path.join(buildConfig.targets.distFolder, buildConfig.targets.minified.css) ], { read: false, base: buildConfig.targets.distFolder }); return gulp.src(path.join(buildConfig.targets.buildFolder, buildConfig.source.index)) .pipe(inject(injectables, { ignorePath: buildConfig.targets.distFolder, addRootSlash: false })) .pipe(gulp.dest(buildConfig.targets.distFolder)); }); // Copies only the sources from build to dist, so a "dev" package for cordova and nwjs can be created gulp.task('dist:default', function (done) { runSequence( 'dev:default', 'dist:clean', 'dist:copy-sources', done ); }); // This task will minify the source files before copying it to dist folder gulp.task('dist:release', function (done) { runSequence( 'dev:default', 'dist:clean', [ 'dist:templateCache', 'dist:copy-assets' ], [ 'dist:uglify:js', 'dist:uglify:css' ], 'dist:inject', done ); });
1.046875
1
src/components/footer.js
benoitguigal/lincassable-website
0
15996716
import React from "react"; import AdemeImg from "../images/partners/ademe.png"; import CiteoImg from "../images/partners/citeo.png"; import MetropoleImg from "../images/partners/amp.png"; import RothschildImg from "../images/partners/rothschild.png"; const Footer = () => ( <footer class="px-16 py-10 bg-green-bottle"> <div class="flex flex-col md:flex-row justify-between"> <div class="text-left"> <h5>Contact</h5> <a class="underline" href="mailto:<EMAIL>"> <EMAIL> </a> <div>40 boulevard Voltaire</div> <div>13001 Marseille</div> </div> <div class="mt-5 md:mt-0 max-w-md flex flex-col items-start md:items-end"> <div class="text-left md:text-right"> Inscrivez-vous à la newsletter pour suivre le développement du projet </div> <div> <form action="https://7fd77de6.sibforms.com/serve/MUIEAPDdndtjSNNua5fxnlRa7SKmAo20nw978W_6GQCBVS_mzPM6RFmjG9gJg_PZMweM4BE8WW7SikPZIySAEQtRsFNWPSAYrp3eDyT79AMnBgWqce0jJynznh1M34wWmTpu8lRJ05jj8ONEbxs9cKyhl0rPUASDHBZnQrCypKaYkN5eEJi8TkcHdVRPWVrz7aGh4vK--pZYxjQ4"> <button type="submit" class="px-2 py-1 border-2 mt-4 max-w-xs text-left md:text-right flex" > INSCRIPTION </button> </form> </div> </div> </div> <hr /> {/* <h4 class="text-center">Soutiens</h4> */} <div class="flex flex-row justify-center space-x-20 items-center w-full mt-10"> <img src={AdemeImg} class="h-16 w-auto" alt="Ademe" /> <img src={CiteoImg} class="h-8 w-auto" alt="CITEO" /> <img src={MetropoleImg} class="h-16 w-auto" alt="CITEO" /> <img src={RothschildImg} class="h-16 w-auto" alt="CITEO" /> </div> </footer> ); export default Footer;
1.171875
1
src/js/components/MaskedInput/utils.js
alansouzati/grommet-controls
0
15996724
import { conformToMask } from 'text-mask-core'; const strCaretTrap = '[]'; const processCaretTraps = (mask) => { const indexes = []; let indexOfCaretTrap; while(indexOfCaretTrap = mask.indexOf(strCaretTrap), indexOfCaretTrap !== -1) { // eslint-disable-line indexes.push(indexOfCaretTrap); mask.splice(indexOfCaretTrap, 1); } return mask; }; // eslint-disable-next-line import/prefer-default-export export const transformMaskedValue = (value, providedMask, props = {}) => { if (!providedMask) { return value; } let { pipe } = props; let safeValue; if (value === undefined || value === null) { safeValue = ''; } else { safeValue = value.toString(); } let mask; if (typeof providedMask === 'object' && providedMask.pipe !== undefined && providedMask.mask !== undefined) { // eslint-disable-next-line no-param-reassign providedMask = providedMask.mask; ({ pipe } = providedMask); } if (typeof providedMask === 'function') { mask = providedMask(safeValue, { ...props, pipe }); // disable masking if `mask` is `false` if (mask === false) { return safeValue; } // The processed mask is what we're interested in mask = processCaretTraps(mask); // If the `providedMask` is not a function, we just use it as-is. } else { mask = providedMask; } let conformedValue = value; const { guide, placeholderChar, placeholder, currentCaretPosition, showMask, keepCharPositions, } = props; const conformToMaskConfig = { previousPlaceholder: placeholder, guide, placeholderChar, pipe, currentCaretPosition, keepCharPositions, }; const conformed = conformToMask(safeValue, mask, conformToMaskConfig); if (conformed) { ({ conformedValue } = conformed); } if (typeof pipe === 'function') { const pipeResults = pipe(conformedValue, { rawValue: safeValue, ...conformToMaskConfig }); if (typeof pipeResults === 'string') { conformedValue = pipeResults; } } if (conformedValue === placeholder) { conformedValue = showMask ? placeholder : ''; } return conformedValue; };
1.632813
2
src/utils/is-template-legacy.js
dianatamas/oc
0
15996732
module.exports = template => template === 'jade' || template === 'handlebars';
0.213867
0
src/components/Loader/styles.js
JhurgenMrz/cv-react
0
15996740
import styled, { keyframes} from 'styled-components' const rotate = keyframes` 0%{ transform: rotate(0deg) } 100%{ transform: rotate(360deg) } ` const animate = keyframes` 0%,100%{ stroke-dashoffset: 440 } 50%{ stroke-dashoffset: 0 } 50.1%{ stroke-dashoffset: 880 } ` export const Svg = styled.svg` position: relative; width: 150px; height: 150px; animation: ${rotate} 2s linear infinite circle{ width: 100%; height: 100%; fill: none; stroke-width: 10; /* stroke: #00a1ff; */ stroke: #fff; stroke-linecap: round; transform: translate(5px, 5px); stroke-dasharray: 440; stroke-dashoffset: 440; animation: ${animate} 4s linear infinite; } `
0.941406
1
web_finca_bertona/src/routes/cart.js
barcioni/grupo_13_FincaBertona2021
0
15996748
const express = require ("express"); const router = express.Router(); const cartController = require ("../controllers/cartController"); router.get("/", cartController.index); router.post("/add", cartController.create); router.put("/update/:id", cartController.update) router.delete("/eliminar/:id", cartController.delete) module.exports = router;
0.984375
1
src/components/home.js
Diama1/Recipe-Box-Frontend
0
15996756
import React, { Component, Fragment, useEffect } from 'react'; import { connect } from 'react-redux'; import { getAllRecipes, addRecipes, deleteRecipe } from '../redux/actions/recipe.action'; export class Recipes extends Component { state = { currentRecipeIng: [], currentRecipeName: '', currentRecipeDirection: [], currentRecipeId: null, loading: false, name: '', ingredient: '', direction: '', showModal: false } componentWillMount() { this.props.getAllRecipes(); } componentWillReceiveProps({ recipeReducer }) { if (recipeReducer.list.length !== 0 ) { this.setState({ currentRecipeId: recipeReducer.list[0].id, currentRecipeIng: recipeReducer.list[0].ingredient, currentRecipeName: recipeReducer.list[0].name, currentRecipeDirection: recipeReducer.list[0].direction}) } } handleOnChange = (event) => { event.preventDefault(); this.setState({ [event.target.name]: event.target.value }) } handleSubmit = (e) => { e.preventDefault(); const { name, ingredient, direction } = this.state; this.props.addRecipes(name, ingredient, direction); }; render() { const { recipeReducer, deleteRecipe } = this.props; const { name, ingredient, direction } = this.state; return ( <div className="container "> <div className="page-header"> <h1> Recipe Box </h1> </div> <div className="col-md-12"> { recipeReducer.list.map( recipe => ( <li key={recipe.id} onClick={() => this.setState({ currentRecipeId: recipe.id, currentRecipeIng: recipeReducer.list.filter( item => item.name===recipe.name )[0].ingredient, currentRecipeName: recipe.name, currentRecipeDirection: recipeReducer.list.filter( item => item.name === recipe.name)[0].direction }) }> {recipe.name}</li> ))} </div> <div className="col-sm-12"> <header> <span>{this.state.currentRecipeName} </span> <i className="fas fa-trash-alt" onClick={e => deleteRecipe(this.state.currentRecipeId)}></i> <i className="fas fa-edit"></i> </header> <div className="col-lg-12 body"> <h5>Ingredients</h5> <ul> { this.state.currentRecipeIng && this.state.currentRecipeIng.map( ingredient => ( <li key= {ingredient}>{ingredient}</li> )) } </ul> <h5>Direction</h5> <ol> { this.state.currentRecipeDirection && this.state.currentRecipeDirection.map( ingredient => ( <li key= {ingredient}>{ingredient}</li> )) } </ol> </div> <footer> <i className="far fa-plus-square" data-toggle="modal" data-target="#addRecipe"></i> <div className="modal fade" role="dialog" id="addRecipe"> <div className="modal-dialog"> <div className="modal-content"> <div className="modal-header"> <h3 className="modal-title">Add New Recipe</h3> <button type="button" className="close" data-dismiss="modal">&times;</button> </div> <div className="modal-body"> <form onSubmit={this.handleSubmit}> <div className="form-group"> <input type="text" name="name" className="form-control" placeholder="Recipe Name" onChange={this.handleOnChange} required /> </div> <div className="form-group"> <textarea name="ingredient" className="form-control" placeholder="Add ingredients separate them with -" onChange={this.handleOnChange} required > </ textarea> <textarea name="direction" className="form-control mt-3" placeholder="Add direction separate them with - " onChange={this.handleOnChange} required> </textarea> </div> <div className="modal-footer"> <button type="submit" className="btn btn-success">Add</button> </div> </form> </div> </div> </div> </div> </footer> </div> </div> ) } } const mapStateToProps = ({ recipeReducer }) => ({ recipeReducer, }); export default connect( mapStateToProps, { getAllRecipes, addRecipes, deleteRecipe }, )(Recipes)
1.78125
2
packages/mall-cook-template/src/utils/globalJump.js
han-neil/mall-cook
1
15996764
/* * @Description: 通用跳转 * @Autor: WangYuan * @Date: 2022-01-24 09:07:45 * @LastEditors: WangYuan * @LastEditTime: 2022-03-28 11:33:31 */ import store from '@/store' export default function jump (target) { if (!target) return let { name, data, type, id } = target switch (type) { case 'home': // 首页 name = 'home' break case 'fixed': // 固定页面 name = id break case 'custom': // 自定义页面是否已配置首页或Tab页,如果已配置则对应跳转 let target = findTab(id) name = target ? target.jump.type : type break } // 储存当前跳转信息 uni.setStorageSync('jump', { name, data, type, id }) switch (name) { case 'home': uni.switchTab({ url: '/pages/index/tabbar/home' }) break case 'tab-frist': uni.switchTab({ url: '/pages/index/tabbar/tab-frist' }) break case 'tab-second': uni.switchTab({ url: '/pages/index/tabbar/tab-second' }) break case 'tab-third': uni.switchTab({ url: '/pages/index/tabbar/tab-third' }) break case 'car': let car = findTab('car') if (car) { uni.switchTab({ url: car.jump.path }) } break case 'my': let my = findTab('my') if (my) { uni.switchTab({ url: my.jump.path }) } break case 'detail': uni.navigateTo({ url: `/pages/index/goods/detail?id=${data.id}` }) break case 'search': uni.navigateTo({ url: `/pages/index/goods/search` }) break case 'list': uni.navigateTo({ url: `/pages/index/goods/list` }) break case 'login': uni.navigateTo({ url: `/pages/index/user/login` }) break case 'custom': uni.navigateTo({ url: `/pages/index/custom/custom?pageId=${id}` }) break } } function findTab (name) { return store.getters.project.config.navigation.list.find( item => item.jump.id == name ) }
1.453125
1
components/jobs/Job.js
maen97/CareerPortalTest
0
15996772
import { useRouter } from "next/router"; import styles from "./Job.module.scss"; import JobsList from "./JobsList"; import JobDetails from "./JobDetails"; import { useEffect, useState } from "react"; import axios from "axios"; import Loader from "../layout/Loader"; const Job = () => { const [jobsList, setJobsList] = useState([]); const [jobDetails, setJobDetails] = useState([]); const router = useRouter(); const { query: { id }, } = router; const fetchData = async () => { try { const { data: { results: job }, } = await axios( `https://devapi-indexer.elevatustesting.xyz/api/v1/jobs/uri?uri=${ id ? id : "test-job-pwq" }&language_profile_uuid=ee5d991c-cdc6-4e83-b0b3-96f147208549`, { headers: { "Content-Type": "application/json", Accept: "application/json", "Accept-Company": "069e122d-0718-4136-bb4f-c9d3c05539a4", }, } ); setJobDetails(job); const { data: { results: { jobs }, }, } = await axios( `https://devapi-indexer.elevatustesting.xyz/api/v1/jobs?language_profile_uuid=ee5d991c-cdc6-4e83-b0b3-96f147208549&limit=30&page=0`, { headers: { Accept: "application/json", "Content-Type": "application/json", "Accept-Language": "en", "Accept-Company": "069e122d-0718-4136-bb4f-c9d3c05539a4", }, } ); setJobsList(jobs); } catch (err) { console.log(err); } }; useEffect(() => { fetchData(); }, [id]); return ( <section className={styles.job}> <div className={styles.innerRow}> {!jobsList.length && !jobDetails.length ? ( <Loader /> ) : ( <> <JobsList data={jobsList} style={styles.list} getData={() => null} /> <JobDetails data={jobDetails} style={styles.job} /> </> )} </div> </section> ); }; export default Job;
1.429688
1
bin/__tests__/logVerboseHeader.test.js
adobe/reactor-releaser
4
15996780
/*************************************************************************************** * (c) 2019 Adobe. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. ****************************************************************************************/ const logVerboseHeader = require('../logVerboseHeader'); describe('logVerboseHeader', () => { beforeEach(() => { spyOn(console, 'log'); }); it('logs a verbose header', () => { logVerboseHeader('Processing'); expect(console.log).toHaveBeenCalledWith( '\n----------\nProcessing\n----------' ); }); });
1.484375
1
resources/views/projekti/INFINITY_SCROOL/app.js
geralt1992/Learning_Vanilla_JavaScript
0
15996788
const URL = 'http://api.adorable.io/avatars/'; const container = document.getElementById('container'); function getRanNum(){ return Math.floor(Math.random() * 100); } function loadImages(numImages = 10) { let i = 0; while(i < numImages){ const img = document.createElement('img'); img.src = `${URL}${getRanNum()}}`; container.innerHTML = img; i++; } } loadImages() window.addEventListener('scroll' , () => { if(window.scrollY + window.innerHeight >= document.documentElement.scrollHeight) { loadImages(); } })
1.867188
2
socrates/lib/eventstore/SoCraTesWriteModel.js
UrsMetz/Agora
0
15996796
/*eslint no-underscore-dangle: 0*/ 'use strict'; function SoCraTesWriteModel(eventStore) { this._eventStore = eventStore; } SoCraTesWriteModel.prototype.eventStore = function () { // persistence needs an id: this._eventStore.setId(); return this._eventStore; }; module.exports = SoCraTesWriteModel;
1.15625
1
src/components/crud/events/collectionOnUpdate.js
web2solutions/voodux-react-class-demo
1
15996804
export async function collectionOnUpdate (eventObj) { // this points to React component scope // console.error('............. collectionOnUpdate') const { data, primaryKey, document, foundation, error } = eventObj if (error) { throw new Error(`Error updating user: ${error}`) } // console.log(this.state.users) const newData = this.state.users.map((user) => { if (user.__id === primaryKey) { return data } else { return user } }) // manage state by setting users avoiding race conditions // setOrders([...newData]) this.setState(prevState => ({ users: [...newData] })) }
1.609375
2
tests/dummy/app/models/single_group/one_value.js
WorkshopDigital/ember-charts
351
15996812
export default [{ label: "Label 1", value: 20 }];
-0.181641
0
analisis.js
Hernan1ro/Practial-Javascript-course
0
15996820
const salariosColombia = colombia.map((persona) => persona.salary); const salariosSorted = salariosColombia.sort((a, b) => a - b); const spliceStart = salariosSorted.length * 0.9; const spliceEnd = salariosSorted.length - spliceStart; const salariosTop10 = salariosSorted.splice(spliceStart, spliceEnd); function calcularMediana(lista = [100, 200, 300, 400, 500, 600, 700, 800]) { function average(lista = [1, 2, 3, 4]) { let sumaLista = 0; let promedio = 0; sumaLista = lista.reduce((acum, elemt) => acum + elemt); promedio = sumaLista / lista.length; return promedio; } let media; function esPar(num) { media = parseInt(lista.length / 2); if (num % 2 === 0) { const numero1 = lista[media - 1]; const numero2 = lista[media]; console.log(numero1, numero2); const mediana = average([numero1, numero2]); console.log(mediana); } else { console.log(lista[media]); } } esPar(lista.length); } function calcularMedianaSalarios(salarios) { calcularMediana(salarios); } calcularMedianaSalarios(salariosSorted); calcularMedianaSalarios(salariosTop10);
2.515625
3
src/Carrusel.js
KikoSopra/challengeLitElements
0
15996828
import { LitElement, html, css } from "lit"; import { getMediaList } from "./services/service.js"; export class Carrusel extends LitElement { static get properties() { return { title: { type: String }, currentPosition: { type: Number }, movieList: { type: Array }, }; } constructor() { super(); this.title = "Carrusel"; this.currentPosition = 0; this.movieList = this.getMovieData(); } firstUpdated() { this.addShow(); setInterval(() => { this.addShow(); }, 5000); } addShow() { const slides = this.renderRoot.querySelectorAll(".content"); const currentSlide = slides[this.currentPosition]; currentSlide.classList.add("show"); if (this.currentPosition < slides.length - 1) { this.currentPosition++; } else { this.currentPosition = 0; } setTimeout(() => { currentSlide.classList.remove("show"); }, 5000); } async getMovieData() { const resp = await getMediaList("movie"); this.items = this.movieList.concat(resp["results"].slice(0, 2)); if (!resp) { return; } return resp; } static get styles() { return css` .content { height: 100%; width: 100%; background-image: url("assets/Lam0.jpg"); background-size: cover; position: absolute; z-index: 2; opacity: 0; } .content2 { background-image: url("assets/Lam1.jpg"); } .content.show { opacity: 1; } .wrapper { width: 100%; height: 700px; position: relative; } `; } render() { return html` <div class="wrapper"> ${this.items.map( ({ title, backdrop_path, vote_average, release_date }) => html` <div class="content"> <detalle-vc titulo="title" fecha="release_date" imagen="backdrop_path" > </detalle-vc> </div> ` )} </div> `; } } customElements.define("carrusel-vc", Carrusel);
1.75
2
global.js
WirelessSwitcher/Studies
2
15996836
/* Creation date: 10/12/2021 Author: <NAME>. This shall contain the server functions and global variables. Last update: 05/08/2021 Comment: added header and document's */ const express = require("express"); const app = express(); app.listen(3000, () => { console.log("Application started and Listening on port 3000"); }); // serve your css as static app.use(express.static(__dirname)); app.get("/", (req, res) => { res.sendFile(__dirname + "/index.html"); }); var player1 = new player('player1', 0, 0, 100, 200, '#0000FFFF'); document.onkeydown = function(e){ let pressedKey = detectKey(e.key); if(pressedKey == " "){ moveBall(); loadBall(); } else if(pressedKey != "none"){ //movePlayer(); loadPlayer("move", pressedKey, ); } else { console.log("Press a valid key: a, w, s, d or space."); } }; function loadPlayer(action, code, posX, posY){ var playerPosX; var playerPosY; //var playerDimensions = calcPlayerSize(); if(action == "init"){ playerPosX = projectArea.width/2; playerPosY = projectArea.height/2; } else{ console.log("Move player...") let currentPos = movePlayer(code, playerPosX, playerPosY); playerPosX = currentPos[0]; playerPosY = currentPos[1]; } console.log( "X: " + playerPosX + "\n" + "Y: " + playerPosY + "\n" + "projectArea.width: " + projectArea.width + "\n" + "projectArea.height: " + projectArea.height ); const player1 = new player( "player1", playerPosX, playerPosY, 10, 30, "#FF0000FF" ); drawPlayer(player1); } function detectKey(code){ let key; switch(code){ case "a": key = "left"; break; case "d": key = "right"; break; case "s": key = "down"; break; case "w": key = "up"; break; case " ": key = "throw"; break; default: key = "none"; break; } return key; } function movePlayer(code, posX, posY){ console.log("calculating new position..."); switch(code){ case "left": posX = posX - 1; break; case "right": posX = posX + 1; break; case "down": posY = posY - 1; break; case "up": posY = posY + 1; break; default: break; } return [posX, posY]; } function moveBall(){ console.log("Move ball"); } function loadBall(){ console.log("Load ball"); }
1.65625
2
assemblyline_ui/static/js/submit.js
keNEticHEx/assemblyline-ui
0
15996844
/* global angular */ 'use strict'; /** * Main App Module */ let uuid = null; function generateUUID(file) { let relativePath = file.relativePath || file.webkitRelativePath || file.fileName || file.name; if (uuid === null) { let d = new Date().getTime(); uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { let r = (d + Math.random() * 16) % 16 | 0; d = Math.floor(d / 16); return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16); }); } return uuid + "_" + file.size + '_' + relativePath.replace(/[^0-9a-zA-Z_-]/img, ''); } function SubmitBaseCtrl($scope, $http, $timeout) { //DEBUG MODE $scope.debug = false; $scope.showParams = function () { console.log("Scope", $scope) }; $scope.submission_url = ""; $scope.receiveClassification = function (classification) { $scope.params.classification = classification; }; $scope.submit_url = function(url){ let urlParseRE = /^(((([^:\/#?]+:)?(?:(\/\/)((?:(([^:@\/#?]+)(?::([^:@\/#?]+))?)@)?(([^:\/#?\]\[]+|\[[^\/\]@#?]+])(?::([0-9]+))?))?)?)?((\/?(?:[^\/?#]+\/+)*)([^?#]*)))?(\?[^#]+)?)(#.*)?/; let matches = urlParseRE.exec(url); if (matches[15] === undefined || matches[15] === ''){ matches[15] = "file"; } let data = { name: matches[15], url: url, ui_params: $scope.params }; $scope.loading = true; $http({ method: 'POST', url: "/api/v4/submit/", data: data }) .success(function (data) { window.location = "/submission_detail.html?new&sid=" + data.api_response.sid; }) .error(function (data, status, headers, config) { if (status === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); return; } if (data === "") { return; } $scope.loading = false; let message = ""; if (data.api_error_message) { message = data.api_error_message; } else { message = config.url + " (" + status + ")"; } swal({ title: "Submission failed!", text: message, type: "error", showCancelButton: false, confirmButtonColor: "#D0D0D0", confirmButtonText: "Close", closeOnConfirm: true }); }); }; $scope.prepare_transfer = function (url) { let type = "file(s)"; if (url !== undefined){ type = "url"; } if ($scope.user.c12n_enforcing) { swal({ title: $scope.params.classification, text: "\n\nAre you sure this is the right classification for your " + type + "?\n\n", type: "warning", showCancelButton: true, confirmButtonColor: "#d9534f", confirmButtonText: "Yes, submit this!", closeOnConfirm: true }, function () { $timeout(function () { $scope.check_external(url); }, 250) }); } else { $scope.check_external(url); } }; $scope.check_external = function (url) { let type = "file(s)"; if (url !== undefined){ type = "url"; } let raise_warning = false; for (let i = 0; i < $scope.params.services.length; i++) { for (let x = 0; x < $scope.params.services[i].services.length; x++) { if ($scope.params.services[i].services[x].is_external && $scope.params.services[i].services[x].selected) { raise_warning = true; break; } } } if (raise_warning) { swal({ title: "External Submission!", text: "\n\nYou are about to submit your " + type + " to a service outside of our infrastructure.\n\nThis may take several minutes...\n\n", type: "warning", showCancelButton: true, confirmButtonColor: "#d9534f", confirmButtonText: "Deselect external services", cancelButtonText: "Continue", closeOnConfirm: true, closeOnCancel: true }, function () { for (let i = 0; i < $scope.params.services.length; i++) { for (let x = 0; x < $scope.params.services[i].services.length; x++) { if ($scope.params.services[i].services[x].is_external && $scope.params.services[i].services[x].selected) { $scope.params.services[i].selected = false; $scope.params.services[i].services[x].selected = false; } } } if (type === "url"){ $scope.submit_url(url); } else{ $scope.start_transfer(); } }, function () { if (type === "url"){ $scope.submit_url(url); } else{ $scope.start_transfer(); } }); } else { if (type === "url"){ $scope.submit_url(url); } else{ $scope.start_transfer(); } } }; //Error handling $scope.error = ''; $scope.success = ''; $scope.loading = false; $scope.user = null; $scope.obj = {}; $scope.started = false; //File transfer letiables/Functions $scope.transfer_started = false; $scope.start_transfer = function () { $scope.transfer_started = true; $scope.obj.flow.on('complete', function () { if ($scope.obj.flow.files.length === 0){ return; } for (let x = 0; x < $scope.obj.flow.files.length; x++) { if ($scope.obj.flow.files[x].error) { return; } } if (!$scope.started){ $scope.started = true; $http({ method: 'POST', url: "/api/v4/ui/start/" + uuid + "/", data: $scope.params }) .success(function (data) { window.location = "/submission_detail.html?new&sid=" + data.api_response.sid; }) .error(function (data, status, headers, config) { if (status === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); return; } if (data === "") { return; } let message = ""; if (data.api_error_message) { message = data.api_error_message; } else { message = config.url + " (" + status + ")"; } swal({ title: "Submission failed!", text: message, type: "error", showCancelButton: false, confirmButtonColor: "#D0D0D0", confirmButtonText: "Close", closeOnConfirm: true }); $scope.reset_transfer(); uuid = null; }); } }); $scope.obj.flow.upload(); }; $scope.reset_transfer = function () { $scope.transfer_started = false; $scope.started = false; $scope.obj.flow.cancel(); $scope.obj.flow.off('complete'); }; //Sliding menu $scope.params = null; $scope.params_bck = null; $scope.serviceSelectionReset = function ($event) { $event.stopImmediatePropagation(); for (let i = 0; i < $scope.params.services.length; i++) { $scope.params.services[i].selected = $scope.params_bck.services[i].selected; for (let x = 0; x < $scope.params.services[i].services.length; x++) { $scope.params.services[i].services[x].selected = $scope.params_bck.services[i].services[x].selected; } } }; $scope.serviceSelectionNone = function ($event) { $event.stopImmediatePropagation(); for (let i = 0; i < $scope.params.services.length; i++) { $scope.params.services[i].selected = false; for (let x = 0; x < $scope.params.services[i].services.length; x++) { $scope.params.services[i].services[x].selected = false; } } }; $scope.serviceSelectionAll = function ($event) { $event.stopImmediatePropagation(); for (let i = 0; i < $scope.params.services.length; i++) { $scope.params.services[i].selected = true; for (let x = 0; x < $scope.params.services[i].services.length; x++) { $scope.params.services[i].services[x].selected = true; } } }; $scope.toggleCBService = function (group_name) { for (let i = 0; i < $scope.params.services.length; i++) { if ($scope.params.services[i].name === group_name) { $scope.params.services[i].selected = true; for (let x = 0; x < $scope.params.services[i].services.length; x++) { if (!$scope.params.services[i].services[x].selected) { $scope.params.services[i].selected = false; break; } } break; } } }; $scope.toggleCBGroup = function (group_name, selected) { for (let i = 0; i < $scope.params.services.length; i++) { if ($scope.params.services[i].name === group_name) { for (let x = 0; x < $scope.params.services[i].services.length; x++) { $scope.params.services[i].services[x].selected = selected; } break; } } }; //Load params from datastore $scope.start = function () { $scope.loading = true; $http({ method: 'GET', url: "/api/v4/user/settings/" + $scope.user.uname + "/" }) .success(function (data) { $scope.loading = false; let temp_param = jQuery.extend(true, {}, data.api_response); let temp_param_bck = jQuery.extend(true, {}, data.api_response); $scope.params = temp_param; $scope.params_bck = temp_param_bck; }) .error(function (data, status, headers, config) { if (status === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); return; } if (data === "") { return; } $scope.loading = false; if (data.api_error_message) { $scope.error = data.api_error_message; } else { $scope.error = config.url + " (" + status + ")"; } }); }; } function flowFactory(flowFactoryProvider) { flowFactoryProvider.defaults = { target: '/api/v4/ui/flowjs/', permanentErrors: [412, 404, 500], maxChunkRetries: 1, chunkRetryInterval: 2000, simultaneousUploads: 4, generateUniqueIdentifier: generateUUID }; flowFactoryProvider.on('fileError', function (event) { try{ let data = JSON.parse(arguments[1]); if (data.hasOwnProperty("api_status_code")){ if (data.api_status_code === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); } } } catch (ex){} }); } let app = angular.module('app', ['search', 'flow', 'utils', 'ui.bootstrap']); app.config(flowFactory); app.controller('ALController', SubmitBaseCtrl);
1.710938
2
spec/PlayerSpec.js
trotyl/Weapon-Evolution
0
15996852
describe('Player', function () { var player, another, weapon; beforeEach(function () { weapon = new Weapon('倚天剑', 0, 'medium'); player = new Player('张三', 100, 10, 'normal'); another = new Player('李四', 50, 20, 'soldier', weapon); }); it('should begin with the right attritubes', function () { expect(player.name).toEqual('张三'); expect(player.life).toEqual(100); expect(player.attack).toEqual(10); }); it('should get hurt when be attacked', function () { player.doDefence(another); expect(player.life).toEqual(80); player.doDefence(another); expect(player.life).toEqual(60); }); it('should get 3x damage if got strike', function () { spyOn(weapon, 'getExtraDamage').and.returnValue(new ExtraDamage('strike')); player.doDefence(another); expect(player.life).toEqual(40); }); it('should be dead when have no life left', function () { player.doDefence(another); player.doDefence(another); player.doDefence(another); player.doDefence(another); player.doDefence(another); expect(player.status).toEqual('dead'); }); it('should be hurt each round if got poisoned', function () { player.extras.push(new ExtraDamage('toxin', 2)); player.doAttack(another, 1); expect(player.life).toEqual(98); player.doAttack(another, 2); expect(player.life).toEqual(96); player.doAttack(another, 3); expect(player.life).toEqual(94); player.doAttack(another, 4); expect(player.life).toEqual(92); }); it('should be hurt each round if got fired', function () { player.extras.push(new ExtraDamage('flame', 2)); player.doAttack(another, 1); expect(player.life).toEqual(98); }); it('should not attack each 2 round if got frozen', function () { player.extras.push(new ExtraDamage('frozen')); expect(player.doAttack(another, 1)).toEqual([]); expect(player.doAttack(another, 2)).toEqual([]); expect(player.doAttack(another, 3)).toEqual(['张三冻得直哆嗦, 没有击中李四']); expect(player.doAttack(another, 4)).toEqual([]); }); it('should not attack for 2 round got faint', function () { player.extras.push(new ExtraDamage('faint')); expect(player.doAttack(another)).toEqual(['张三晕倒了, 无法攻击, 眩晕还剩:1轮']); expect(player.doAttack(another)).toEqual(['张三晕倒了, 无法攻击, 眩晕还剩:0轮']); expect(player.doAttack(another)).toEqual([]); }); it('should only got 1 type of extra damage', function () { player.extras.push(new ExtraDamage('toxin', 5)); spyOn(weapon, 'getExtraDamage').and.returnValue(new ExtraDamage('flame', 2)); player.doDefence(another); expect(player.extras.length).toEqual(1); }); it('could get more than one same type of extra damage', function () { player.extras.push(new ExtraDamage('toxin', 5)); spyOn(weapon, 'getExtraDamage').and.returnValue(new ExtraDamage('toxin', 2)); player.doDefence(another); expect(player.extras.length).toEqual(2); }); it('\'s extra damage should not be affect by strike', function () { player.extras.push(new ExtraDamage('toxin', 5)); spyOn(weapon, 'getExtraDamage').and.returnValue(new ExtraDamage('strike')); player.doDefence(another); expect(player.extras.length).toEqual(1); expect(player.extras[0].type).toEqual('toxin'); }); });
1.882813
2
src/stores/documents.js
brandonroberts/sdk-for-svelte
61
15996860
import { SDK as Appwrite } from "../appwrite"; import { writable, get } from "svelte/store"; export class DocumentsStore { constructor() { const { subscribe, set, update } = writable(new Map()); this.subscribe = subscribe; this.set = set; this.update = update; } clear() { this.set(new Map()); } /** * Get Documents in a Collection * @param {string} id Collection Id * @param {boolean} cache Use cached response * @param {{ filters: string[], limit: number, offset: number, orderField: string, orderType: string, orderCast: string, search: string }} query Query paramters * @returns {Promise<{documents: any[], sum: number}>} */ async fetchDocuments(id, cache, query) { if (cache) { const docs = Array.from(get(this).entries()) .filter(entry => entry[0].startsWith(id)) .map(entry => entry[1]); if (docs?.length) { return { documents: docs, sum: docs.length, }; } } const response = await Appwrite.sdk.database.listDocuments( id, query.filters, query.limit, query.offset, query.orderField, query.orderType, query.orderCast, query.search ); if (cache) { this.update(docs => { for (const document of response.documents) { docs.set(`${id}:${document.$id}`, document); } return docs; }); } return response; } /** * @param {string} collection Collection ID * @param {string} id Document ID * @param {boolean} cache Use cache * @returns {Promise<any>} */ async fetchDocument(collection, id, cache) { const key = `${collection}:${id}`; if (cache) { const docs = get(this); if (docs.has(key)) return docs.get(key); } const response = await Appwrite.sdk.database.getDocument(collection, id); if (cache) { this.update(docs => { docs.set(key, response); return docs; }); } return response; } }
1.5
2
App/Lib/Controller/Home/IndexController.js
wpfpizicai/knowledge
0
15996868
/** * controller * @return */ module.exports = Controller("Home/BaseController", function(){ "use strict"; var courses = [{name:"创造力提升",id:"creativedad",detail:"",source:"UNAM",time:"永久开放",img:"1.jpg"},{name:"跨领域医疗信息学",id:"creativedad",detail:"",source:"Minnesota",time:"永久开放",img:"2.png"},{name:"微观经济学",id:"creativedad",detail:"",source:"Illinois",time:"Dec 22nd",img:"3.jpg"},{name:"遗传学与进化概论",id:"creativedad",detail:"",source:"Duke",time:"Jan 1st",img:"4.jpg"},{name:"探索性数据分析",id:"creativedad",detail:"",source:"约翰霍普金斯大学",time:"3月 2日",img:"5.jpg"},{name:"统计推断",id:"creativedad",detail:"",source:"斯坦福大学",time:"永久开放",img:"6.jpg"}]; var c_data = { navLinks : navLinks, section : 'home' }; // D('User').join({ // table : 'user_course', // join : 'left', // on : ['id' ,'userid'] // }).where({uc.courseid : 2}).select().then(function(data){ // console.log(data) // }) // D('User').field('name,title').join('INNER JOIN think_user_course on think_user.id=think_user_course.userid INNER JOIN think_course on think_user_course.courseid=think_course.id and think_course.title="微观经济学"').select().then(function(data){ // console.log(data); // }); return { indexAction: function(){ var self = this; return self.redirect('/gdpx'); this.assign(extend({ courses:courses, title : "首页", userInfo : self.userInfo },c_data)) this.display(); } }; });
1.023438
1
test/integration/routes.test.js
edstros/httpnode
0
15996876
var expect = require('chai').expect; var http = require('http'); var path = require('path'); describe('Routes', function () { this.timeout(30000); //longer to ensure there is enough time to var port = Math.floor(Math.random() * 50000 + 10000); var url = 'http://localhost:' + port; before(function () { require(path.join(process.cwd(), '/lib/server'))(port); }); it('should respond to the /weather route', function (done) { http.get(url + '/weather', function (res) { expect(res.statusCode).to.equal(200); res .on('data', function (chunk) { body += chunk; }) done(); }); }); it('should respond to the /starwarsmovies route', function (done) { http.get(url + '/starwarsmovies', function (res) { expect(res.statusCode).to.equal(200); res .on('data', function (chunk) { body += chunk; }) done(); }); }); it('should not respond to the /nonexistent route', function (done) { http.get(url + '/nonexistent', function (res) { expect(res.statusCode).to.equal(404); res .on('data', function (chunk) { body += chunk; }) done(); }); }); }); //this is how any route integration test would work
1.625
2
src/WorkOffSharp.js
omtanke/react-material-icons
0
15996884
function SvgWorkOffSharp(props) { return ( <svg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 24 24' width='1em' className='svg-icon' {...props}> <path d='M0 0h24v24H0V0z' fill='none' /> <path d='M10 4h4v2h-3.6L22 17.6V6h-6V4c0-1.1-.9-2-2-2h-4c-.98 0-1.79.71-1.96 1.64L10 5.6V4zM3.4 1.84L1.99 3.25 4.74 6H2.01L2 21h17.74l2 2 1.41-1.41z' /> </svg> ); } export default SvgWorkOffSharp;
0.824219
1
tests/dummy/app/router.js
ming-codes/ember-cli-d3
49
15996892
import Ember from 'ember'; import config from './config/environment'; var Router = Ember.Router.extend({ location: config.locationType }); Router.map(function() { this.route('home', { path: '/' }); this.route('guides'); this.route('gallery', function () { this.route('bars', function () { this.route('grouped'); this.route('stacked'); this.route('waterfall'); }); this.route('lines'); this.route('area'); this.route('stacked'); //this.route('histogram'); //this.route('scatter-plot'); this.route('sunburst'); this.route('albers-usa'); }); }); export default Router;
0.960938
1
ts-built/components/projects/project-list.js
amsstudio/hopfab
0
15996900
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = require("react"); const http_1 = require("@hopfab/http"); const project_list_item_1 = require("./project-list-item"); const down_right_arrow_icon_1 = require("../icons/down-right-arrow-icon"); const ProjectList = ({ initialProjects, initialCurrentPage, totalPages, selectedCategory, }) => { const [projects, setProjects] = react_1.useState(initialProjects); const [currentPage, setCurrentPage] = react_1.useState(initialCurrentPage); const [isLoading, setIsLoading] = react_1.useState(false); /* On regroupe les projets 2 par 2 pour le rendu colonne décalé */ const NUM_COLUMNS = 2; const numLines = react_1.useMemo(() => Math.ceil(projects.length / NUM_COLUMNS), [ projects, ]); const lines = react_1.useMemo(() => Array.from({ length: numLines }), [numLines]); const fetchData = react_1.useCallback(() => __awaiter(void 0, void 0, void 0, function* () { setIsLoading(true); try { const result = yield http_1.get(`/realisations${selectedCategory ? `-${selectedCategory}` : ""}-${currentPage}.json`); if (result === {}) return; setProjects(oldProjects => [ ...oldProjects, ...result.map(d => d.project), ]); } catch (error) { // TODO: handle error } setIsLoading(false); }), [currentPage]); return (<div className="grid grid-cols-1 gap-18"> {lines.map((_, lineIndex) => (<div key={lineIndex} className="grid grid-cols-1 md:grid-cols-2 gap-x-12 md:gap-x-14 lg:gap-x-18 xl:gap-x-22 2xl:gap-x-24 gap-y-18"> {projects .slice(lineIndex * NUM_COLUMNS, (lineIndex + 1) * NUM_COLUMNS) .map((projet, rowIndex) => (<project_list_item_1.default key={projet.id} projet={projet} className={`${rowIndex === 0 ? "" : "md:mt-26 lg:mt-30 xl:mt-34"}`}/>))} </div>))} {totalPages > currentPage && (<div className="flex justify-end"> {!isLoading && (<button type="button" onClick={() => { setCurrentPage(currentPage + 1); fetchData(); }} className="group flex items-center text-4xl md:text-6.1xl font-bold focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-brown-50 focus-visible:ring-brown-700"> <span className="mt-1.5 border-b-6 transition duration-200 ease-in-out transform border-transparent group-hover:border-gris-800"> Voir plus </span> <down_right_arrow_icon_1.default className="w-6 h-6 md:w-11 md:h-11 ml-4 mt-2"/> </button>)} {isLoading && (<div className="text-4xl md:text-6.1xl font-bold"> Chargement ... </div>)} </div>)} </div>); }; exports.default = ProjectList;
1.6875
2
packages/frontend/src/main/lib/viewer/comments/commentsHelper.js
specklesystems/Server
19
15996908
/** * Time used for throttling viewer/window resize/etc. updates that trigger comment bubble/thread absolute repositioning */ export const VIEWER_UPDATE_THROTTLE_TIME = 50 /** * @type {import('@/main/lib/common/text-editor/documentHelper').SmartTextEditorSchemaOptions} */ export const SMART_EDITOR_SCHEMA = { multiLine: false }
0.6875
1
public/javascripts/kor.events.js
ukanga/build
73
15996916
/* * kor.events - criteria-based events microframework. * <NAME> (<EMAIL>) - 2011-06-30 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl). Do what * you want, but please do let me know what you think. */ ;(function() { // internal data structures var byVerb = {}, bySubject = {}, byEvent = {}, uuid = 0; // base object and methods var korevents = {}; korevents['listen'] = function(options) { // pull out everything we need multiple times up front var subject = options['subject'], verb = options['verb'], args = options['args']; // construct our own event representation, in case var id = uuid++, eventSignature = { 's': subject, 'v': verb, 'p': options['priority'], 'a': args, 'i': id, 'c': options['callback'] }; var targetRegistry; if (isUndefined(subject)) // no subject; just add to the global registry targetRegistry = byVerb; else // add to the subject-specific registry targetRegistry = deepGet(true, bySubject, getSubjectKey(subject)); var targetRegistryByVerb = targetRegistry[verb]; if (isUndefined(targetRegistryByVerb)) targetRegistryByVerb = targetRegistry[verb] = { 'all': {}, 'arg': {} }; // go through args; add to global/verb args registry if (!isUndefined(args)) for (var arg in args) deepGet(true, targetRegistryByVerb, 'arg', arg)[id] = eventSignature; // add to global verb events registry targetRegistryByVerb['all'][id] = eventSignature; // keep track of the event so that we can pull it up later byEvent[id] = eventSignature; // give them a ticket number return id; }; var fire = korevents['fire'] = function(options) { if (isUndefined(options)) throw new Error('need to provide options to fire on!'); var subject = options['subject'], verb = options['verb'], args = options['args']; // basic validation if (verb == null) // or undef throw new Error('need to provide a verb at minimum!'); // keep track of valid arg matches per registration var matches = {}; // first, grab the global subscribers to this verb var globalRegistry = deepGet(byVerb, verb) || { 'all': {}, 'arg': {} }; var subscribers = getValues(globalRegistry['all']); // next, look at subject subscribers to the verb if necessary if (!isUndefined(subject)) { var subjectKey = getSubjectKey(subject); var subjectRegistry = deepGet(bySubject, subjectKey, verb); if (!isUndefined(subjectRegistry)) getValues(subjectRegistry['all'], subscribers); } // make sure we have anything to talk about at all if (subscribers.length === 0) return true; // now filter down the possible set to the matched set if necessary if (!isUndefined(args)) { for (var arg in args) { var argValue = args[arg], argSubscribers = getValues(globalRegistry['arg'][arg]); if (!isUndefined(subject)) getValues(subjectRegistry['arg'][arg], argSubscribers); for (var i = 0; i < argSubscribers.length; i++) { var subscriber = argSubscribers[i]; if (argValue === subscriber['a'][arg]) matches[subscriber['i']] = (matches[subscriber['i']] || 0) + 1; } } } // sort by priority subscribers.sort(function(a, b) { var aPri = a['p'] || keyCount(a['a']), bPri = b['p'] || keyCount(b['a']); var result = bPri - aPri; if (result !== 0) return result; return a['i'] - b['i']; }); // call on those that matched the filter for (var i = 0; i < subscribers.length; i++) { var subscriber = subscribers[i]; if ((matches[subscriber['i']] || 0) < keyCount(subscriber['a'])) continue; if (subscriber['c'](options) === false) return false; } return true; }; korevents['derez'] = function(subject) { var result = fire({ 'subject': subject, 'verb': 'derez' }); delete bySubject[getSubjectKey(subject)]; return result; }; korevents['unlisten'] = function(eventId) { var eventSignature = byEvent[eventId]; if (isUndefined(eventSignature)) throw new Error('No event found by this id!'); var targetRegistry; if (isUndefined(eventSignature['s'])) targetRegistry = byVerb[eventSignature['v']]; else targetRegistry = bySubject[getSubjectKey(eventSignature['s'])][eventSignature['v']]; delete targetRegistry['all'][eventId]; for (var arg in eventSignature['args']) delete targetRegistry['arg'][arg][id]; delete byEvent[eventId]; return eventSignature; }; korevents['unlistenAll'] = function() { byVerb = {}; bySubject = {}; byEvent = {}; }; // utility var isUndefined = function(obj) { return obj === void 0; }; // gets the values of a hash as an array. can take // an array to put the values into. var getValues = function(obj, arr) { var result = arr || []; if (obj != null) // or undef for (var key in obj) result.push(obj[key]); return result; }; // counts the number of keys an obj has var keyCount = function(obj) { if (obj == null) // or undef return 0; var result = 0; for (var key in obj) result++; return result; }; // goes to a deep location in an object. pass in true // as the first arg to force creation of undefined // objects on the way to your destination. var deepGet = function(/* [create], obj, keys* */) { var idx = 0; var create = false; if (arguments[0] === true) { idx++; create = true; } var obj = arguments[idx++]; for (; idx < arguments.length; idx++) { var key = arguments[idx]; if (isUndefined(obj[key])) if (!create) return undefined; else obj[key] = {}; obj = obj[key]; } return obj; }; // creates a subject key if it does not exist; returns // the key whether created or not. var getSubjectKey = function(subject) { var result, keKey = korevents['key'] || '_kor_events_key'; if (!isUndefined(subject['jquery'])) { if (isUndefined(result = subject.data(keKey))) subject.data(keKey, result = uuid++); } else { if (isUndefined(result = subject[keKey])) result = subject[keKey] = uuid++; } return result; }; // setup! var root = this; if ((typeof module !== 'undefined') && module['exports']) { // export to commonjs/node module if we see one, for unit tests // (kind of silly to add an events system to nodejs, no?) module['exports'] = korevents; } else { // otherwise, install ourselves in kor.events in the root namespace var kor = root['kor']; if (isUndefined(kor)) kor = root['kor'] = {}; kor['events'] = korevents; } })();
1.484375
1
src/getCookieByName/getCookieByName.js
NorvikIT/utm-aska
8
15996924
/** * Get cookie value by name * @param name * @returns {any} */ import Cookies from 'js-cookie' export default function getCookieByName(name) { return Cookies.get(name) }
1
1
packages/create-react-wptheme-utils/wpThemeClient.js
devloco/creare-react-wptheme
327
15996932
/** * Copyright (c) 2018-present, https://github.com/devloco * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var wpThemeClient = { hash: null, socket: null, start: function(wsHostProtocol, wsHostname, wsPort) { var hostProtocol = null; switch (wsHostProtocol) { case "ws": case "wss": hostProtocol = wsHostProtocol; break; default: console.log(`WPTHEME CLIENT: configHostProtocol is not "ws" or "wss": ` + new String(wsHostProtocol)); console.error("This is a bug. Please report to: https://github.com/devloco/create-react-wptheme/issues"); return; } if (wsHostname !== "__from-window__") { if (typeof wsHostname !== "string" && wsHostname.length <= 0) { console.log("WPTHEME CLIENT: hostname is not '__from-window__' or a non-empty string: ", wsHostname); return; } } var parsedConfigPort = null; if (wsPort !== "__from-window__") { parsedConfigPort = parseInt(wsPort, 10); if (typeof parsedConfigPort !== "number") { console.log("WPTHEME CLIENT: port is not '__from-window__' or a number: ", wsPort); return; } } var hostName = wsHostname === "__from-window__" ? window.location.hostname : wsHostname; var portNum = wsPort === "__from-window__" ? window.location.port : parsedConfigPort; var hostURL = hostProtocol + "://" + hostName + ":" + portNum; var newlyReloaded = true; wpThemeClient.socket = new WebSocket(hostURL); wpThemeClient.socket.onmessage = function(response) { if (response && typeof response.data === "string") { try { var msg = JSON.parse(response.data); if (msg) { var msgHash = msg && msg.stats && msg.stats.hash; if (msg.type === "content-changed") { if (msg.stats.errors && msg.stats.errors.length > 0) { msg.type = "errors"; } if (msg.stats.warnings && msg.stats.warnings.length > 0) { msg.type = "warnings"; } } switch (msg.type) { case "content-changed": if (!newlyReloaded || (wpThemeClient.hash === null || (typeof msgHash === "string" && msgHash.length > 0 && msgHash !== wpThemeClient.hash))) { // Webpack successfully creates a new compile if there are only warnings (unlike errors which do not compile at all). window.location.reload(); } break; case "errors": try { wpThemeErrorOverlay.handleErrors(msg.stats.errors); } catch (err) { console.log("'errors' try block error:", err); console.log("Compile ERRORS", msg); } break; case "hash-check": if (wpThemeClient.hash === null) { wpThemeClient.hash = msgHash; setTimeout(() => { // In 500ms, let's double-check we have the latest hash... a build on the server may have gotten missed. if (wpThemeClient.socket && wpThemeClient.socket.send) { var msgJson = JSON.stringify({ type: "hash-check" }); wpThemeClient.socket.send(msgJson); } }, 500); } else if (!newlyReloaded && typeof wpThemeClient.hash === "string" && wpThemeClient.hash !== msgHash) { window.location.reload(); } break; case "warnings": try { wpThemeErrorOverlay.handleWarnings(msg.stats.warnings); if (!newlyReloaded) { // Webpack successfully creates a new compile if there are only warnings (unlike errors which do not compile at all). window.location.reload(); } } catch (err) { console.log("'warnings' try block error:", err); console.log("Compile WARNINGS", err, msg); } break; } } } catch (err) { if (console && typeof console.error === "function") { console.error(err); console.log("Raw websocket message:", response); } } newlyReloaded = false; wpThemeClient.hash = typeof msgHash === "string" && msgHash.length > 0 ? msgHash : null; } }; wpThemeClient.socket.onclose = function() { if (console && typeof console.info === "function") { switch (wpThemeClient.socket.readyState) { case wpThemeClient.socket.CLOSED: case wpThemeClient.socket.CLOSING: setTimeout(() => { console.info("It's possible the browser refresh server has disconnected.\nYou can manually refresh the page if necessary."); }, 1000); break; } } }; wpThemeClient.socket.onopen = function() { if (console && typeof console.clear === "function") { //console.clear(); console.info("The browser refresh server is connected."); } }; } };
1.476563
1
gatsby-node.js
infrascript/website
0
15996940
const path = require('path') // graphql function doesn't throw an error so we have to check to check for the result.errors to throw manually const wrapper = (promise) => promise.then((result) => { if (result.errors) { throw result.errors } return result }) exports.createPages = async ({graphql, actions}) => { const {createPage} = actions const result = await wrapper( graphql(` { prismic { allFeatures { edges { node { feature_title feature_preview_description feature_preview_thumbnail feature_category feature_post_date _meta { uid } } } } allPosts { edges { node { post_title post_hero_image post_hero_annotation post_date post_category post_body post_preview_description post_author _meta { uid } } } } } } `), ) const featuresList = result.data.prismic.allFeatures.edges const postsList = result.data.prismic.allPosts.edges const featureTemplate = require.resolve('./src/templates/feature.jsx') const postTemplate = require.resolve('./src/templates/post.jsx') featuresList.forEach((edge) => { // The uid you assigned in Prismic is the slug! createPage({ type: 'Feature', match: '/features/:uid', path: `/features/${edge.node._meta.uid}`, component: featureTemplate, context: { // Pass the unique ID (uid) through context so the template can filter by it uid: edge.node._meta.uid, }, }) }) postsList.forEach((edge) => { createPage({ type: 'Feature', match: '/blog/:uid', path: `/blog/${edge.node._meta.uid}`, component: postTemplate, context: { uid: edge.node._meta.uid, }, }) }) }
1.46875
1
src/components/Home/index.js
aust-burner/idea-db
0
15996948
import React, { useState, useEffect } from 'react'; import IdeaList from '../IdeaList'; import IdeaAdd from '../IdeaAdd'; import { v4 as uuidv4 } from 'uuid'; import { withFirebase } from '../Firebase'; import { withAuthorization } from '../Session'; const HomePage = (props) => { let firebase = props.firebase const ideasRef = firebase.ideas () const [state, setState] = useState({ideas: []}) useEffect(() => { ideasRef.on('value', (snapshot) => { const snapshotValue = snapshot.val() if (snapshotValue) { const ideas = Object.values(snapshot.val()) setState ({ideas: ideas}) console.log(ideas) } }) }, []) let upVote = (id) => { console.log('upVote', id) state.ideas.forEach((idea) => { if(id === idea.id) { idea.voteCount +=1} }) console.log(state.ideas) setState ({ideas: state.ideas}) ideasRef.child(id).child('voteCount').transaction((voteCount) => { return voteCount +1 }) } let downVote = (id) => { console.log('downvote', id) state.ideas.forEach((idea) => { if(id === idea.id) { idea.voteCount -=1} }) console.log(state.ideas) setState ({ideas: state.ideas}) } let addIdea = (title, description) => { console.log('Add Idea', title, description) const idea = {title: title, description: description, id: uuidv4(), voteCount: 0} ideasRef.child(idea.id).set(idea) setState({ideas: [...state.ideas, idea]}) } return( <div className="Home-page-wrapper"> <div> <h1>Welcome to IOTD</h1> </div> <IdeaList ideas={state.ideas} upVote={upVote} downVote={downVote} /> <div> IOTD </div> <div className='add-idea-wrapper'> <h2>What are you thinking today?</h2> <div> <IdeaAdd addIdea={addIdea}/> </div> </div> </div> ) } const condition = authUser => !!authUser; export default withFirebase(withAuthorization(condition)(HomePage));
1.953125
2
src/views/Cockpit/Cockpit.js
johnstewart0820/react_front_pfron
0
15996956
import React, { useState, useEffect } from 'react'; import useStyles from './style'; import { Alert } from 'components'; import { Button, Grid, Card, CircularProgress, IconButton } from '@material-ui/core'; import { Breadcrumb } from 'components'; import { DeleteModal } from './components'; import EditOutlinedIcon from '@material-ui/icons/EditOutlined'; import DeleteOutlineOutlinedIcon from '@material-ui/icons/DeleteOutlineOutlined'; import FindInPageOutlinedIcon from '@material-ui/icons/FindInPageOutlined'; import dashboard from '../../apis/dashboard'; const Cockpit = props => { const { history } = props; const classes = useStyles(); const breadcrumbs = [{ active: false, label: 'Kokpit' }]; const [candidateList, setCandidateList] = useState([]); const [participantList, setParticipantList] = useState([]); const [openModal, setOpenModal] = useState(false); const [selectedItem, setSelectedItem] = useState(-1); const [hasAlert, setHasAlert] = useState(false); const [isSuccess, setIsSuccess] = useState(false); const [message, setMessage] = useState(''); const [progressStatus, setProgressStatus] = useState(false); useEffect(() => { getList(); }, []); const getList = () => { dashboard.getList() .then(response => { if (response.code === 401) { history.push('/login'); } else { setCandidateList(response.data.candidates); setParticipantList(response.data.participants); } }) } const handleSelectedItem = (id) => { setSelectedItem(id); setOpenModal(true); } const handleView = (id) => { } const handleCloseModal = () => { setOpenModal(false); } const checkAmbassador = () => { let role = localStorage.getItem('role'); return role === '3'; } const handleDelete = () => { setProgressStatus(true); dashboard .delete(selectedItem) .then(response => { if (response.code === 401) { history.push('/login'); } else { if (response.code === 200) { setHasAlert(true); setMessage(response.message); setIsSuccess(response.code === 200); getList(); } setProgressStatus(false); } }) } return ( <> <div className={classes.public}> <div className={classes.controlBlock}> <Breadcrumb list={breadcrumbs} /> </div> <Alert hasAlert={hasAlert} setHasAlert={setHasAlert} isSuccess={isSuccess} message={message} /> <Grid container spacing={3} className={classes.formBlock}> <Grid item xs={12}> <Card className={classes.form}> <Grid container spacing={3}> <Grid item md={2} sm={1} xs={0} className={classes.margin_block}></Grid> <Grid item md={8} sm={10} xs={12}> <Grid container spacing={3}> <Grid item md={1} sm={0} xs={0} className={classes.title_block}></Grid> <Grid item md={10} sm={12} xs={12}> <div className={classes.title}> Wypracowanie i pilotażowe wdrożenie modelu kompleksowej rehabilitacji umożliwiającej podjęcie lub powrót do pracy </div> </Grid> <Grid item md={1} sm={0} xs={0} className={classes.title_block}></Grid> </Grid> <Grid container spacing={3}> <Grid item md={checkAmbassador() ? 12 : 6} xs={12}> <Button variant="outlined" aria-label="Pokaż listę kandydatów" color="secondary" id="main" className={classes.btnFull} onClick={() => history.push(`/candidates`)}> Kandydaci </Button> </Grid> { !checkAmbassador() ? <> <Grid item md={6} xs={12}> <Button variant="outlined" aria-label="Pokaż listę uczestników" color="secondary" className={classes.btnFull} onClick={() => history.push(`/participants`)}> Uczestnicy </Button> </Grid> <Grid item md={6} xs={12}> <Button variant="outlined" color="secondary" aria-label="Pokaż ośrodki rehabilitacyjne" className={classes.btnFull} onClick={() => history.push(`/ork_list`)}> Ośrodki </Button> </Grid> <Grid item md={6} xs={12}> <Button variant="outlined" color="secondary" aria-label="Pokaż finanse" className={classes.btnFull} onClick={() => history.push('/payments')}> Finanse </Button> </Grid> </> : <></> } </Grid> </Grid> <Grid md={2} sm={1} xs={0} className={classes.margin_block}></Grid> </Grid> </Card> </Grid> <Grid item md={checkAmbassador() ? 12 : 5} xs={12}> <Card className={classes.table}> <div className={classes.table_header}> Ostatnio dodani kandydaci </div> <div className={classes.table_content}> <div className={classes.table_body}> { candidateList.map((item, index) => ( <Grid container spacing={0} className={classes.table_item}> <Grid item xs={6}> {item.name + ' ' + item.surname} </Grid> <Grid item xs={6}> <Grid container justify="flex-end"> <IconButton aria-label={`Edytuj kandydata ${item.name + ' ' + item.surname}`} component="span" className={classes.iconButton} onClick={() => history.push(`/candidates/edit/${item.id}`)}> <EditOutlinedIcon className={classes.icon} /> </IconButton> <IconButton aria-label={`Pokaż profil kandydata ${item.name + ' ' + item.surname}`} variant="outlined" component="span" className={classes.iconButton} onClick={() => history.push(`/candidates/profile/${item.id}`)}> <FindInPageOutlinedIcon className={classes.icon} /> </IconButton> <IconButton aria-label={`Usuń kandydata ${item.name + ' ' + item.surname}`} variant="outlined" component="span" className={classes.iconButton} onClick={() => handleSelectedItem(item.id)}> <DeleteOutlineOutlinedIcon className={classes.icon} /> </IconButton> </Grid> </Grid> </Grid> )) } </div> <div className={classes.table_footer}> <Button variant="outlined" aria-label="Pokaż listę kandydatów" color="secondary" className={classes.btnOutline} onClick={() => history.push(`/candidates`)}> Zobacz wszystkich </Button> </div> </div> </Card> </Grid> { !checkAmbassador() ? <Grid item md={7} xs={12}> <Card className={classes.table}> <div className={classes.table_header}> Ostatnio zakwalifikowani uczestnicy </div> <div className={classes.table_content}> <div className={classes.table_body}> { participantList.map((item, index) => ( <Grid container spacing={0} className={classes.table_item}> <Grid item xs={4}> {item.name + ' ' + item.surname} </Grid> <Grid item xs={4}> {item.rehabitation_center_name} </Grid> <Grid item xs={4}> <Grid container justify="flex-end"> <IconButton aria-label={`Edytuj uczestnik ${item.name + ' ' + item.surname}`} component="span" className={classes.iconButton} onClick={() => history.push(`/participants/edit/${item.id_candidate}`)}> <EditOutlinedIcon className={classes.icon} /> </IconButton> <IconButton variant="outlined" aria-label={`Pokaż profil uczestnik ${item.name + ' ' + item.surname}`} component="span" className={classes.iconButton} onClick={() => history.push(`/participants/profile/${item.id_candidate}`)}> <FindInPageOutlinedIcon className={classes.icon} /> </IconButton> <IconButton variant="outlined" aria-label={`Usuń uczestnik ${item.name + ' ' + item.surname}`} component="span" className={classes.iconButton} onClick={() => handleSelectedItem(item.id_candidate)}> <DeleteOutlineOutlinedIcon className={classes.icon} /> </IconButton> </Grid> </Grid> </Grid> )) } </div> <div className={classes.table_footer}> <Button variant="outlined" aria-label="Pokaż listę uczestników" color="secondary" className={classes.btnOutline} onClick={() => history.push(`/participants`)}> Zobacz wszystkich </Button> </div> </div> </Card> </Grid> : <></> } </Grid> </div> { progressStatus ? <> <div className={classes.progressContainer}> <CircularProgress className={classes.progress} /> </div> </> : <></> } <DeleteModal openModal={openModal} handleClose={handleCloseModal} handleDelete={handleDelete} selectedIndex={selectedItem} /> </> ); }; export default Cockpit;
1.671875
2
installer.js
dgjung0220/adb_viewer
5
15996964
var createInstaller = require('electron-installer-squirrel-windows'); createInstaller({ name : 'cpuViewer', path: './dist/cpuViewer-win32-x64', out: './dist/installer', authors: '<NAME>', exe: 'cpuViewer.exe', appDirectory: './dist/cpuViewer-win32-x64', overwrite: true, setup_icon: 'favicon.ico' }, function done (e) { console.log('Build success !!'); });
0.910156
1
packages/hap-toolkit/__tests__/server.js
hapjs-platform/hap-toolkit
16
15996972
/* * Copyright (c) 2021, the hapjs-platform Project Contributors * SPDX-License-Identifier: Apache-2.0 */ describe('server', () => { const { launchServer, stopServer, stopAll } = require('../lib') const request = require('supertest') let server beforeAll(() => { return launchServer({ port: 8082, // TODO createADBDebugger 导致 server.close 不能完全关闭 disableADB: true, watch: false }).then(data => { server = data.server }) }, 5000) it('launch server', () => { return request(server) .get('/') .then(response => { expect(response.status).toBe(200) expect(response.text).toMatch('<title>调试器</title>') }) }) it('qr-code', () => { return request(server) .get('/qrcode') .then(response => { expect(response.status).toBe(200) expect(response.type).toBe('image/png') // TODO 将 ip 和端口写入响应页面,在前端渲染,以便于在此测试二维码内容 // file signature expect(response.body.readUInt32BE(0)).toBe(0x89504e47) }) }) it('inspector', () => { return request(server) .get('/inspector/inspector.html') .then(response => { expect(response.status).toBe(200) expect(response.type).toBe('text/html') expect(response.text).toMatch(/Copyright \d{4} The Chromium Authors./) }) }) it('app_data can use', () => { return request(server) .get('/inspector/auxiliary_tool/client/index.html') .then(response => { expect(response.status).toBe(200) expect(response.type).toBe('text/html') expect(response.text).toMatch('<title>auxiliary_tool</title>') }) }) it('app preview', () => { return request(server) .get('/preview') .then(response => { // 报错改为404! 因为 launchServer() 连 cwd 都未设置 // 但我们可以确定路由已经挂载 expect(response.status).toBe(404) expect(response.type).toBe('text/html') expect(response.text).toMatch('/preview-static/common.css') }) }) it('start debug', () => { return request(server) .post('/poststdbg') .send({ application: 'org.hapjs.mockup', devicePort: '37679', linkMode: 1, sn: undefined, ws: '10.13.24.46:37679/inspector' }) .then(() => { // TODO // 1, check response // 2, close chrome }) }) it('socket.io serve client', () => { const getJs = request(server) .get('/socket.io/socket.io.js') .then(response => { expect(response.status).toBe(200) expect(response.type).toBe('application/javascript') }) const getMap = request(server) .get('/socket.io/socket.io.js.map') .then(response => { expect(response.status).toBe(200) expect(response.type).toBe('application/json') }) return Promise.all([getJs, getMap]) }) it('stop all', () => { return stopAll().then(data => { expect(data.stopServerError).toBeUndefined() expect(data.stopWatchError).toBe('no watching') expect(data.error).toBeTruthy() }) }) it('stop server', () => { return stopServer().then(data => { expect(data.stopServerError.toString()).toMatch('Server is not running') }) }) // TODO // /poststdbg, /postwsid, /bundle })
1.414063
1
src/components/infomational/notifications/index.js
enw860/sharkquila_ui_toolkits
0
15996980
import Notifications from "./Notifications.vue"; import Button from "../button"; import DisplayText from "../displayText"; import Link from "../link"; import Skeleton from "../skeleton"; import { pluginFactory } from "../../../utils/plugins"; export default pluginFactory({ components: [ Notifications ], plugins: [ Button, DisplayText, Link, Skeleton ] })
0.589844
1
source/browser_apps/sar_site/src/Data/PersonDao.js
brian-nelson/satellite-audio-recording
1
15996988
import BaseDao from "./BaseDao.js" export default class PersonDao extends BaseDao { getPerson(personId) { return this.read(`/people/${personId}`); } getSelf() { return this.read(`/people/self`); } getSelfAccess() { return this.read(`/access/self`); } saveProfile(profile) { return this.write(`/people/self`, profile); } getParticipantsWithAccess(projectId) { return this.read(`/projects/${projectId}/ui/people`); } getParticipantWithAccess(projectId, personId) { return this.read(`/projects/${projectId}/ui/people/${personId}`); } getAvailablePeople(projectId) { return this.read(`/projects/${projectId}/people/available`); } saveParticipantAccess(projectId, projectAccess) { return this.write(`/projects/${projectId}/people`, projectAccess); } }
1.054688
1
index.js
tcoats/vue-hyperscript-terse
4
15996996
const classIdSplit = /([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/ const notClassId = /^\.|#/ module.exports = (h) => (element, data, children) => { // null means div if (element == null) return h('div', data, children) // support h(Component) syntax if (typeof(element) != 'string') return h(element, data, children) // support h('div', [ ]) syntax (optional params) if (data == null || typeof(data) != 'object' || Array.isArray(data)) { children = data data = {} } // parse parts and assign to classes and id const parts = element.split(classIdSplit) for (let part of parts) { const type = part.charAt(0) const value = part.substring(1, part.length) if (type === '.') { if (!data.class) data.class = {} data.class[value] = true } else if (type === '#' && !data.hasOwnProperty('id')) { if (!data.attrs) data.attrs = {} data.attrs.id = value } } // default to div const tag = notClassId.test(parts[1]) ? 'div' : parts[1] return h(tag, data, children) }
1.601563
2
src/rules/position.test.js
kcjpop/postcss-atomic
11
15997004
const { newSheet, run } = require('../testHelpers') describe('@position', () => { it('should generate all rules', async () => { let src = newSheet`@position;` let expected = newSheet` .static { position: static; } .fixed { position: fixed; } .absolute { position: absolute; } .relative { position: relative; } .sticky { position: sticky; } .inset-0 { top: 0; right: 0; bottom: 0; left: 0; } .inset-auto { top: auto; right: auto; bottom: auto; left: auto; } .inset-y-0 { top: 0; bottom: 0; } .inset-x-0 { right: 0; left: 0; } .inset-y-auto { top: auto; bottom: auto; } .inset-x-auto { left: auto; right: auto; } .top-0 { top: 0; } .right-0 { right: 0; } .bottom-0 { bottom: 0; } .left-0 { left: 0; } .top-auto { top: auto; } .bottom-auto { bottom: auto; } .left-auto { left: auto; } .right-auto { right: auto; }` await run(src, expected) }) })
1
1
packages/true/dist/commands/true.js
BOSS-code/cash
8,915
15997012
'use strict'; var interfacer = require('./../util/interfacer'); var _true = { exec: function exec() { // Always return 0 return 0; } }; module.exports = function (vorpal) { if (vorpal === undefined) { return _true; } vorpal.api.true = _true; vorpal.command('true').action(function (args, callback) { return interfacer.call(this, { command: _true, callback: callback }); }); };
1.046875
1
src/application.js
kazet15/volunteer-computing-backend
0
15997020
'use strict'; import Koa from 'koa'; import Router from 'koa-router'; const application = new Koa(); const router = new Router(); router.get('/', (ctx, next) => { ctx.body = {version: 0.1}; return next(); }); application.use(router.routes()); export default application;
0.753906
1
stories/Examples/PreferenceSelector/PreferenceSelector.style.js
proeliis/react-pie-menu
29
15997028
import { background } from 'react-pie-menu'; import { css } from 'styled-components'; export const container = css` border: 20px solid #ecd3ee; `; export const center = css` background: #eee3ef; &:not(:empty):hover { cursor: pointer; } > svg { position: relative; top: calc(50% - 15px); left: calc(50% - 15px); } `; export const slice = css` color: grey; ${background('white')}; &[filled=true] { color: black; } &[active=true], &[_highlight=true] { color: black; ${background('#eee3ef')} cursor: pointer; } `;
0.933594
1
test/test-license-xyz.js
verbose/verb-repo-data
7
15997036
'use strict'; require('mocha'); var path = require('path'); var assert = require('assert'); var gitty = require('gitty'); var verb = require('verb'); var del = require('delete'); var data = require('..'); var repo, app, cache; var project = path.resolve(__dirname, 'fixtures/project-license-xyz'); var cwd = process.cwd(); describe('verb-data (xyz license repository)', function() { before(function(cb) { process.chdir(project); repo = gitty(process.cwd()); repo.initSync(); repo.addSync(['.']); repo.commitSync('first commit'); cb(); }); after(function(cb) { process.chdir(cwd); del(project + '/.git', cb); }); beforeEach(function() { app = verb(); cache = app.store.data; app.store.data = {}; app.store.save(); app.use(data); }); afterEach(function() { app.store.set(cache); }); describe('data', function() { it('should add package.json data to the instance', function() { assert.equal(app.cache.data.name, 'test-project'); }); it('should update license on `cache.data`', function() { assert.equal(app.cache.data.license, 'XYZ'); assert.equal(app.cache.data.licenseStatement, 'Released under the [XYZ License](LICENSE).'); }); }); });
1.4375
1
build/build.js
tulburg/website
0
15997044
'use strict' var path = require('path') var opn = require('opn') var config = require('../config') var webpack = require('webpack') var webpackConfig = require('../webpack.config.js') var compiler = webpack(webpackConfig); var express = require('express') var port = process.env.PORT || config.dev.port var autoOpenBrowser = !!config.dev.autoOpenBrowser if (!process.env.NODE_ENV) { process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) } var app = express() var devMiddleware = require('webpack-dev-middleware')(compiler, { publicPath: webpackConfig.output.pubicPath, quiet: true }) var hotMiddleware = require('webpack-hot-middleware')(compiler, { hot: true, heartbeat: 2000, path: '/__webpack_hmr' }) compiler.plugin('compilation', function (compilation) { compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { hotMiddleware.publish({ action: 'reload' }) if(cb) cb() }) }) app.use(devMiddleware) app.use(hotMiddleware) app.get('*', (req, res) => res.sendFile(path.resolve(__dirname, '../dist/index.html')) ) var uri = (process.env.HOST + ':' || 'http://localhost:') + port; var _resolve var readyPromise = new Promise(resolve => { _resolve = resolve }) console.log('> Starting dev server...') devMiddleware.waitUntilValid(() => { console.log('> Listening at ' + uri + '\n') if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { // opn(uri) } _resolve() }) var server = app.listen(port)
1.320313
1
src/routes.js
chenghehao/One-vue
102
15997052
import Home from './pages/home.vue'; import Reader from './pages/readings.vue'; import Music from './pages/musics.vue'; import Movie from './pages/movies.vue'; import EssayDetail from './pages/details/essay.vue'; import SerialDetail from './pages/details/serial.vue'; import QuestionDetail from './pages/details/question.vue'; import MusicDetail from './pages/details/music.vue'; import MovieDetail from './pages/details/movie.vue'; export default [ { path: '/home/', component: Home }, { path: '/reading/', component: Reader, }, { path: '/reading/essay/:id', component: EssayDetail }, { path: '/reading/serial/:id', component: SerialDetail }, { path: '/reading/question/:id', component: QuestionDetail }, { path: '/music/', component: Music }, { path: '/music/:id', component: MusicDetail }, { path: '/movie/', component: Movie }, { path: '/movie/:id', component: MovieDetail } ]
0.757813
1
app.js
amankumar6/Track-your-goals
0
15997060
const express = require('express'); const session = require('express-session'); const mongoose = require('mongoose'); const MongoStore = require('connect-mongo')(session); const path = require('path'); const cookieParser = require('cookie-parser'); const bodyParser = require('body-parser'); const passport = require('passport'); const promisify = require('es6-promisify'); const flash = require('connect-flash'); const expressValidator = require('express-validator'); const routes = require('./routes/index'); const helpers = require('./helpers'); const Sentry = require('@sentry/node'); const Tracing = require('@sentry/tracing'); const errorHandlers = require('./handlers/errorHandlers'); require('moment-timezone'); require('./handlers/passport'); // creating express app const app = express(); Sentry.init({ dsn: process.env.DSN, integrations: [ new Sentry.Integrations.Http({ tracing: true }), new Tracing.Integrations.Express({ app }), ], tracesSampleRate: 1.0, }); // engine setup // folder were all pug files are stored app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'pug'); // sentry is for error monoitoring app.use(Sentry.Handlers.requestHandler()); app.use(Sentry.Handlers.tracingHandler()); // serves up static files from the public folder. Anything in public/ will just be served up as the file it is app.use(express.static(path.join(__dirname, 'public'))); // takes the raw requests and turns them into usable properties on req.body app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); // exposes a bunch of methods for validating data. app.use(expressValidator()); // populates req.cookies with any cookies that came along with the request app.use(cookieParser()); // sessions allow us to store data on visitors from request to request this keeps users logged in and allows us to send flash messages app.use( session({ secret: process.env.SECRET, key: process.env.KEY, resave: false, saveUninitialized: false, store: new MongoStore({ mongooseConnection: mongoose.connection }), }) ); // Passport JS is used to handle logins app.use(passport.initialize()); app.use(passport.session()); // flash middleware let's us use req.flash('error', 'Shit!'), which will then pass that message to the next page the user requests app.use(flash()); // pass variables to our templates + all requests app.use((req, res, next) => { res.locals.h = helpers; res.locals.flashes = req.flash(); res.locals.user = req.user || null; res.locals.currentPath = req.path; next(); }); // promisify some callback based APIs app.use((req, res, next) => { req.login = promisify(req.login, req); next(); }); // after all that above middleware, we finally handle our own routes! app.use('/', routes); // error monoitoring app.use(Sentry.Handlers.errorHandler()); // if above routes didn't work, we 404 them and forward to error handler app.use(errorHandlers.notFound); // Ooe of our error handlers will see if these errors are just validation errors app.use(errorHandlers.flashValidationErrors); // otherwise this was a really bad error we didn't expect! if (app.get('env') === 'development') { app.use(errorHandlers.developmentErrors); } // production error handler app.use(errorHandlers.productionErrors); // done! exporting it so we can start the site in start.js module.exports = app;
1.367188
1
packages/typography/baskerville.js
giuseppeg/styled-system
19
15997068
module.exports = require('./dist/themes/baskerville')
-0.067871
0
resources/assets/js/views/reductions.js
ArkaitzUlibarri/gestioninterna
0
15997076
/** * Registro los componentes necesarios. */ Vue.component('reduction-template', require('../components/Reduction.vue')); const app = new Vue({ el: '#reduction', data: { url: url, contract: contract, editIndex: -1, newReduction: { id: -1, contract_id: -1, start_date: '', end_date: '', week_hours: 0 }, array: [], }, computed: { formFilled(){ if(this.newReduction.week_hours != 0 && this.newReduction.start_date != ''){ return true; } else{ return false; } }, }, created() { Event.$on('Delete', (index, item) => { if(confirm("You are going to delete this entry,are you sure?")){ this.delete(index); this.array.splice(index, 1); } }); Event.$on('Edit', (index, item) => { this.newReduction = { id: item.id, contract_id: item.contract_id, start_date: item.start_date, end_date: item.end_date, week_hours: item.week_hours }; this.editIndex = index; }); }, mounted() { this.newReduction.contract_id = this.contract.id; this.setDateLimits(); this.fetchData(); }, methods: { hoursValidation(){ var hourfield = document.getElementById("hourfield").value; if(this.newReduction.week_hours >= this.contract.week_hours) { toastr.error("Reduction hours are greater than contract hours"); this.newReduction.week_hours = 0; } }, setDateLimits(){ document.getElementById("startdatefield").setAttribute("min", this.contract.start_date); document.getElementById("enddatefield").setAttribute("min", this.contract.start_date); if(this.contract.estimated_end_date != null){ document.getElementById("startdatefield").setAttribute("max", this.contract.estimated_end_date); document.getElementById("enddatefield").setAttribute("max", this.contract.estimated_end_date); } }, initialize(){ this.newReduction = { id: -1, contract_id: this.contract.id, start_date: '', end_date: '', week_hours: 0, }; this.editIndex = -1; }, fetchData(){ let vm = this; vm.array = []; vm.initialize(); axios.get(vm.url + '/api/reductions', { params: { id: vm.contract.id, } }) .then(function (response) { vm.array = response.data; }) .catch(function (error) { vm.showErrors(error.response.data) }); }, delete(index){ let vm = this; axios.delete(vm.url + '/api/reductions/' + vm.array[index].id) .then(function (response) { toastr.success(response.data); }) .catch(function (error) { vm.showErrors(error.response.data) }); }, save(){ let vm = this; //CHANGE:ARRAY_MERGE if(vm.newReduction.id != -1) { axios.patch(vm.url + '/api/reductions/' + vm.newReduction.id, { contract_start_date: vm.contract.start_date, contract_estimated_end_date: vm.contract.estimated_end_date, id: vm.newReduction.id, contract_id: vm.newReduction.contract_id, start_date: vm.newReduction.start_date, end_date: vm.newReduction.end_date, week_hours: vm.newReduction.week_hours, }) .then(function (response) { toastr.success(response.data); let properties = Object.keys(vm.newReduction); for (let i = properties.length - 1; i >= 0; i--) { vm.array[vm.editIndex][properties[i]] = vm.newReduction[properties[i]]; } vm.initialize(); }) .catch(function (error) { vm.showErrors(error.response.data) }); return; } else{ axios.post(vm.url + '/api/reductions',{ contract_start_date: vm.contract.start_date, contract_estimated_end_date: vm.contract.estimated_end_date, id: vm.newReduction.id, contract_id: vm.newReduction.contract_id, start_date: vm.newReduction.start_date, end_date: vm.newReduction.end_date, week_hours: vm.newReduction.week_hours, }) .then(function (response) { toastr.success("Saved"); vm.newReduction.id = response.data; vm.array.push(vm.newReduction); vm.initialize(); }) .catch(function (error) { vm.showErrors(error.response.data) }); } }, /** * Visualizo mensajes de error */ showErrors(errors) { if(Array.isArray(errors)) { errors.forEach( (error) => { toastr.error(error); }) } else { toastr.error(errors); } } } });
1.554688
2
resources/js/scripts/PrintLabels.js
thewhitewolf2411/bamboo_projec
0
15997084
//Tray Label $('.printtraylabel').on('click', function(){ var trayid = $(this).data('value'); $.ajax({ url: "/portal/trays/tray/printlabel", type:"POST", data:{ trayid:trayid, }, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, success:function(response){ $(document).ready(function(){ $('#tradein-iframe').attr('src', '/' + response + '.pdf'); $('#label-trade-in-modal').modal('show'); }); }, }); }); //Trolley Label $('.printtrolleylabel').on('click', function(){ var trolleyid = $(this).data('value'); $.ajax({ url: "/portal/trolleys/trolley/printlabel", type:"POST", data:{ trolleyid:trolleyid, }, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, success:function(response){ $(document).ready(function(){ $('#tradein-iframe').attr('src', '/' + response + '.pdf'); $('#label-trade-in-modal').modal('show'); }); }, }); }); $('.printbinlabel').on('click', function(){ var binid = $(this).data('value'); $.ajax({ url: "/portal/quarantine-bins/printlabel", type:"POST", data:{ binid:binid, }, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, success:function(response){ $(document).ready(function(){ $('#tradein-iframe').attr('src', '/' + response + '.pdf'); $('#label-trade-in-modal').modal('show'); }); }, }); }); $('.printbaylabel').on('click', function(){ var bayid = $(this).data('value'); $.ajax({ url: "/portal/warehouse-management/bay-overview/printbay", type:"POST", data:{ bayid:bayid, }, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, success:function(response){ $(document).ready(function(){ $('#tradein-iframe').attr('src', '/' + response + '.pdf'); $('#label-trade-in-modal').modal('show'); }); }, }); });
0.949219
1
assets/scripts/store/slices/settings.js
burrelle/streetmix
4
15997092
import { createSlice } from '@reduxjs/toolkit' import { NEW_STREET_DEFAULT } from '../../streets/constants' import { changeLocale } from './locale' const settingsSlice = createSlice({ name: 'settings', initialState: { lastStreetId: null, lastStreetNamespacedId: null, lastStreetCreatorId: null, newStreetPreference: NEW_STREET_DEFAULT, saveAsImageTransparentSky: false, saveAsImageSegmentNamesAndWidths: false, saveAsImageStreetName: false, saveAsImageWatermark: true, locale: null, units: null }, reducers: { updateSettings (state, action) { return { ...state, ...action.payload } }, setUserUnits (state, action) { const units = action.payload state.units = units } }, extraReducers: { [changeLocale.fulfilled]: (state, action) => { state.locale = action.payload.locale } } }) export const { updateSettings, setUserUnits } = settingsSlice.actions export default settingsSlice.reducer
1.234375
1
2-content/15-Sandbox/javascript101-master/algorithm/base/1.js
impastasyndrome/Lambda-Resource-Static-Assets
0
15997100
//求最大公约数 function gcd(p, q) { if (q == 0) return p; var r = p % q; return gcd(q, r); } var q = gcd(21, 15); console.log(q);
1.796875
2
src/client/Client.js
iWeeti/discorded
0
15997108
const EventEmitter = require('events'); const Store = require('../util/Store'); const User = require("../models/User"), Message = require("../models/Message"), TextChannel = require("../models/TextChannel"), Guild = require("../models/Guild"); const p = require('phin').promisified; module.exports = class Client extends EventEmitter { /** * Represents a discord user/bot * @todo hmm * @param {function} getPrefix This is used to get the prefix for the built in command handler. It passes the client and the message as arguments. * @param {string} token The token used for authentication. * @param {object} options Other options */ constructor(getPrefix, token, options) { super(); this.baseURL = "https://discordapp.com/api"; /** * Base url for discord api. */ this.guilds = new Store(); /** * All the {@link User} s the bot is in. */ this.users = new Store(); /** * All the {@link User} s the bot can see. */ this.channels = new Store(); /** * All the {@link TextChannel}s the bot can see. */ this.commands = new Store(); /** * The {@link Command}s that are loaded. */ this.ws = { socket: null, connected: false, gateway: { url: null, obtainedAt: null, heartbeat: { interval: null, last: null, recieved: false, seq: null, } } }; /** * The websocket connection. */ this.token = token; /** * The bot token used for authentication. * *BE VERY CAREFUL WITH THIS, DON'T SHARE IT* */ this.readyAt = 0; /** * The time when the bot was ready. */ this.user = null; /** * The {@link User} of the bot. */ this.sessionId = null; /** * The session id. */ this.getPrefix = getPrefix; /** * Function that is used to get the prefix for commands. */ if (options && options.allowBots == true) { this.allowBots = true; console.warn("Now allowed to respond to other bots. This can end up in a message loop."); } else { this.allowBots = false; } if (options && options.selfReply == true) { this.selfReply = true; console.warn("Now allowed to respond to myself. This can end up in a message loop."); } else { this.selfReply = false; } if (options && options.connect == false) { return this; } else { return this.connect(); } } /** * Connects to discord if not connected already. */ connect() { const attemptLogin = require('../gateway/websocket'); if (this.ws.connected) throw new Error(`Client is already connected to the gateway`); attemptLogin(this); } /** * Returns an user with the id. * @param {snowflake} id User id */ async getUser(id) { try { const b = await p({ url: `${this.baseURL}/users/${id}`, method: 'GET', headers: { 'Authorization': `Bot ${this.token}`, 'Content-Type': 'application/json' } }); return new User(JSON.parse(b.body), this); } catch (err) { throw new Error(err); } } /** * Loads a command to the built in command handler. * @param {Command} command Command */ loadCommand(command) { this.commands.set(command.name, command); } /** * Loads many commands on once. * @param {Array<Command>} commands List of Commands */ loadCommands(commands) { if (!commands instanceof Array) { throw new Error("The commands to load must be in a list."); } for (const command of commands) { this.loadCommand(command); } } /** * Unloads a command from the built in command handler. * @param {string} name Command name */ unloadCommand(name) { this.commands.delete(name); } /** * Sends a message to a channel. * @param {snowflake} channelID A channel id. * @param {Object} payload Object to send. * @returns {Message} The message that was sent. */ async sendMessage(channelID, payload) { const channel = this.channels.get(channelID); try { const b = await p({ url: `${this.baseURL}/channels/${channelID}/messages`, method: "POST", headers: { "Authorization": `Bot ${this.token}`, 'Content-Type': 'application/json' }, data: payload }); return new Message(JSON.parse(b.body), { guild: channel.guild, channel: channel }, this); } catch (err) { throw new Error(err); } } /** * Deletes a message from a channel. * @param {snowflake} channelID Channel id * @param {snowflake} messageID Message id */ async deleteMessage(channelID, messageID) { try { const b = await p({ url: `${this.baseURL}/channels/${channelID}/messages/${messageID}`, method: 'DELETE', headers: { 'Authorization': `Bot ${this.token}`, 'Content-Type': 'application/json' }, data: payload }); return JSON.parse(b.body); } catch (err) { throw new Error(err); } } /** * Edits a message on a text channel * @param {snowflake} channelID Channel id * @param {snowflake} messageID Message id * @param {Object} payload Object to edit to. * @returns {Message} The message that was edited. */ async editMessage(channelID, messageID, payload) { const channel = this.channels.get(channelID); try { const b = await p({ url: `${this.baseURL}/channels/${channelID}/messages/${messageID}`, method: "PATCH", headers: { "Authorization": `Bot ${this.token}`, 'Content-Type': 'application/json' }, data: payload }); return new Message(JSON.parse(b.body), { guild: channel.guild, channel: channel }); } catch (err) { throw new Error(err); } } /** * Runs the commands and does the checks. * @param {Content} ctx The context to invoke. */ async processCommands(ctx) { if (ctx.author.id === this.user.id && !this.selfReply) return; const prefixes = this.getPrefix(this, ctx.message); let prefix = null; if (typeof (prefixes) == 'string') { if (ctx.message.content.startsWith(prefixes)) prefix = prefixes; } else if (prefixes instanceof Array) { for (let pre of prefixes) { if (ctx.message.content.startsWith(pre)) { prefix = pre; break; }; } } if (prefix === null) return; if (ctx.author.bot && !this.allowBots) return; const command = this.commands.get(ctx.message.content.slice(prefix.length).split(" ")[0]); if (!command) return; if (command.checks) { for (const check of command.checks) { if (!check(ctx)) { return this.emit("checkError", ctx); } } } if (command.nsfw && !ctx.channel.nsfw) { return this.emit("notNSFW", ctx); } ctx.command = command; ctx.argString = ctx.message.content.slice(prefix.length + command.name.length); ctx.args = ctx.argString.split(" "); this.emit('command', ctx); try { console.log("Processing command for " + ctx.author.toString()) command.run(this, ctx); } catch (err) { this.emit("commandError", err); } } }
1.828125
2
src/index.js
ksvladimir/streakapi
0
15997116
/* @flow */ import https from 'https'; import querystring from 'querystring'; import aeu from './auto-encode-uri'; class ConnHelper { _authKey: string; constructor(authKey: string) { this._authKey = authKey; } _getRequestOptions(method: string, path: string, headers: Object={}, encoding: ?string='utf8'): Object { // By default we request the V1 of the API let prefix = '/api/v1/'; // If the requested resource is a Task or a Meeting, then use the V2 of the API if (path.match(/tasks|meetings|webhooks/)) prefix = '/api/v2/'; return { method, headers, encoding, host: 'mailfoogae.appspot.com', path: prefix + path, auth: this._authKey }; } _parseResponse(response: https.IncomingMessage): Promise<any> { return new Promise((resolve, reject) => { const strs: string[] = []; response.on('data', (chunk: string) => { strs.push(chunk); }); response.on('end', () => { try { const str = strs.join(''); if (response.statusCode === 200) { resolve(JSON.parse(str)); } else { let json; let errorMessage = `Response code ${response.statusCode}`; try { json = JSON.parse(str); if (json && json.error) { errorMessage = json.error; } } catch (err) { // Ignore parse error } reject(Object.assign((new Error(errorMessage): Object), { str, json, statusCode: response.statusCode, headers: response.headers })); } } catch (err) { reject(err); } }); response.on('error', reject); }); } _plainResponse(response: https.IncomingMessage): Promise<Buffer> { return new Promise((resolve, reject) => { const chunks: Buffer[] = []; response.on('data', (chunk: Buffer) => { chunks.push(chunk); }); response.on('end', () => { try { const buf = Buffer.concat(chunks); if (response.statusCode === 200) { resolve(buf); } else { const errorMessage = `Response code ${response.statusCode}`; reject(Object.assign((new Error(errorMessage): Object), { buf, statusCode: response.statusCode, headers: response.headers })); } } catch (err) { reject(err); } }); response.on('error', reject); }); } get(path: string): Promise<Object> { return new Promise((resolve, reject) => { const opts = this._getRequestOptions('GET', path); const request = https.request(opts, res => { resolve(this._parseResponse(res)); }); request.on('error', reject); request.end(); }); } getNoParse(path: string): Promise<Buffer> { return new Promise((resolve, reject) => { const opts = this._getRequestOptions('GET', path, undefined, null); const request = https.request(opts, res => { resolve(this._plainResponse(res)); }); request.on('error', reject); request.end(); }); } put(path: string, data: Object): Promise<Object> { return new Promise((resolve, reject) => { const dstr = querystring.stringify(data); const opts = this._getRequestOptions('PUT', path + '?' + dstr); const request = https.request(opts, res => { resolve(this._parseResponse(res)); }); request.on('error', reject); request.end(); }); } delete(path: string): Promise<any> { return new Promise((resolve, reject) => { const opts = this._getRequestOptions('DELETE', path); const request = https.request(opts, res => { resolve(this._parseResponse(res)); }); request.on('error', reject); request.end(); }); } post(path: string, data: any): Promise<Object> { return new Promise((resolve, reject) => { const send = querystring.stringify({json:JSON.stringify(data)}); const opts = this._getRequestOptions('POST', path, { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': send.length }); const request = https.request(opts, res => { resolve(this._parseResponse(res)); }); request.write(send); request.on('error', reject); request.end(); }); } } class Me { _s: Streak; _c: ConnHelper; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; } get() { return this._c.get('users/me'); } } class Pipelines { _s: Streak; _c: ConnHelper; Stages: PipelineStages; Fields: PipelineFields; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; this.Stages = new PipelineStages(s, c); this.Fields = new PipelineFields(s, c); } getAll() { return this._c.get('pipelines'); } getOne(key: string) { return this._c.get(aeu `pipelines/${key}`); } getBoxes(key: string) { return this._c.get(aeu `pipelines/${key}/boxes`); } getBoxesInStage (key: string, stageKey: string) { return this._c.get(aeu `pipelines/${key}/boxes?stageKey=${stageKey}`); } create(data: Object) { return this._c.put('pipelines', data); } delete(key: string) { return this._c.delete(aeu `pipelines/${key}`); } update(data: Object) { return this._c.post(aeu `pipelines/${data.key}`, data); } getFeed(key: string, detailLevel: ?string) { let qs = ''; if (detailLevel) { qs += '?' + querystring.stringify({detailLevel}); } return this._c.get(aeu `pipelines/${key}/newsfeed` + qs); } getFeedAll(detailLevel: ?string) { let qs = ''; if (detailLevel) { qs += '?' + querystring.stringify({detailLevel}); } return this._c.get(aeu `newsfeed` + qs); } } class PipelineStages { _s: Streak; _c: ConnHelper; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; } getAll(pipeKey: string) { return this._c.get(aeu `pipelines/${pipeKey}/stages`); } getOne(pipeKey: string, key: string) { return this._c.get(aeu `pipelines/${pipeKey}/stages/${key}`); } create(pipeKey: string, data: Object) { return this._c.put(aeu `pipelines/${pipeKey}/stages`, data); } delete(pipeKey: string, key: string) { return this._c.delete(aeu `pipelines/${pipeKey}/stages/${key}`); } update(pipeKey: string, data: Object) { return this._c.post(aeu `pipelines/${pipeKey}/stages/${data.key}`, data); } } class PipelineFields { _s: Streak; _c: ConnHelper; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; } getAll(pipeKey: string) { return this._c.get(aeu `pipelines/${pipeKey}/fields`); } getOne(pipeKey: string, key: string) { return this._c.get(aeu `pipelines/${pipeKey}/fields/${key}`); } create(pipeKey: string, data: Object) { return this._c.put(aeu `pipelines/${pipeKey}/fields`, data); } delete(pipeKey: string, key: string) { return this._c.delete(aeu `pipelines/${pipeKey}/fields/${key}`); } update(pipeKey: string, data: Object) { return this._c.post(aeu `pipelines/${pipeKey}/fields/${data.key}`, data); } } class Boxes { _s: Streak; _c: ConnHelper; Fields: BoxFields; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; this.Fields = new BoxFields(s, c); } getAll() { return this._c.get('boxes'); } getForPipeline(key: string) { return this._s.Pipelines.getBoxes(key); } getOne(key: string) { return this._c.get(aeu `boxes/${key}`); } create(pipeKey, data) { return this._c.put(aeu `pipelines/${pipeKey}/boxes`, data); } delete(key: string) { return this._c.delete(aeu `boxes/${key}`); } update(data: Object) { return this._c.post(aeu `boxes/${data.key}`, data); } getFields(key: string) { return this._c.get(aeu `boxes/${key}/fields`); } getReminders(key: string) { return this._c.get(aeu `boxes/${key}/reminders`); } getComments(key: string) { return this._c.get(aeu `boxes/${key}/comments`); } // deprecated method createComment(key: string, data) { return this._c.put(aeu `boxes/${key}/comments`, data); } postComment(key: string, message: string) { return this._c.put(aeu `boxes/${key}/comments`, {message}); } getMeetings(key: string) { return this._c.get(aeu `boxes/${key}/meetings`).then(data => data.results); } getFiles(key: string) { return this._c.get(aeu `boxes/${key}/files`); } getThreads(key: string) { return this._c.get(aeu `boxes/${key}/threads`); } getFeed(key: string, detailLevel: ?string) { let qs = ''; if (detailLevel) { qs += '?' + querystring.stringify({detailLevel}); } return this._c.get(aeu `boxes/${key}/newsfeed` + qs); } getTasks(key: string) { return this._c.get(aeu `boxes/${key}/tasks`); } } class BoxFields { _s: Streak; _c: ConnHelper; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; } getForBox(key: string) { return this._s.Boxes.getFields(key); } getOne(boxKey: string, key: string) { return this._c.get(aeu `boxes/${boxKey}/fields/${key}`); } update(boxKey: string, data: Object) { return this._c.post(aeu `boxes/${boxKey}/fields/${data.key}`, data); } } class Files { _s: Streak; _c: ConnHelper; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; } getForBox(key: string) { return this._s.Boxes.getFiles(key); } getOne(key: string) { return this._c.get(aeu `files/${key}`); } getContents(key: string) { return this._c.getNoParse(aeu `files/${key}/contents`); } } class Threads { _s: Streak; _c: ConnHelper; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; } getForBox(boxKey: string) { return this._s.Boxes.getThreads(boxKey); } getOne(threadKey: string) { return this._c.get(aeu `threads/${threadKey}`); } } class Tasks { _s: Streak; _c: ConnHelper; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; } getForBox(boxKey: string) { return this._s.Boxes.getTasks(boxKey); } getOne(key: string) { return this._c.get(aeu `tasks/${key}`); } create(boxKey: string, data: Object) { return this._c.post(aeu `boxes/${boxKey}/tasks`, data); } update(key: string, data: Object) { return this._c.post(aeu `tasks/${key}`, data); } delete(key: string) { return this._c.delete(aeu `tasks/${key}`); } } class Webhooks { _s: Streak; _c: ConnHelper; constructor(s: Streak, c: ConnHelper) { this._s = s; this._c = c; } getForPipeline(pipelineKey: string) { return this._c.get(aeu `pipelines/${pipelineKey}/webhooks`).then(data => data.results); } getForTeam(teamKey: string) { return this._c.get(aeu `teams/${teamKey}/webhooks`).then(data => data.results); } getOne(key: string) { return this._c.get(aeu `webhooks/${key}`); } createForPipeline(pipelineKey: string, data: Object) { return this._c.post(aeu `webhooks?pipelineKey=${pipelineKey}`, data); } createForTeam(teamKey: string, data: Object) { return this._c.post(aeu `webhooks?teamKey=${teamKey}`, data); } update(key: string, data: Object) { return this._c.post(aeu `webhooks/${key}`, data); } delete(key: string) { return this._c.delete(aeu `webhooks/${key}`); } } export class Streak { _c: ConnHelper; Me: Me; Pipelines: Pipelines; Boxes: Boxes; Files: Files; Threads: Threads; Tasks: Tasks; Webhooks: Webhooks; constructor(authKey: string) { this._c = new ConnHelper(authKey); this.Me = new Me(this, this._c); this.Pipelines = new Pipelines(this, this._c); this.Boxes = new Boxes(this, this._c); this.Files = new Files(this, this._c); this.Threads = new Threads(this, this._c); this.Tasks = new Tasks(this, this._c); this.Webhooks = new Webhooks(this, this._c); } search(query: string): Promise<Object> { return this._c.get(aeu `search?query=${query}`); } }
1.820313
2
frontend/src/pages/Logon/index.js
viniciusrodrigues1a/omnistack-11
1
15997124
import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; import { FiLogIn } from 'react-icons/fi'; import { signInRequest } from '../../store/modules/auth/actions'; import { FormSection, Form } from './styles'; import Container from '../../components/Container'; import { Input } from '../../components/Form'; import Button from '../../components/Button'; import AuthRedirect from '../../components/AuthRedirect'; import heroesImg from '../../assets/images/heroes.png'; import logoImg from '../../assets/images/logo.svg'; export default function Logon() { const dispatch = useDispatch(); const [id, setID] = useState(''); async function handleLogin(e) { e.preventDefault(); dispatch(signInRequest(id)); } return ( <Container> <FormSection> <img src={logoImg} alt="Be The Hero" /> <Form onSubmit={handleLogin}> <h1>Faça seu logon</h1> <Input placeholder="Sua ID" value={id} onChange={e => setID(e.target.value)} /> <Button type="submit">Entrar</Button> <AuthRedirect.Link to="/register"> <FiLogIn size={16} color="#e02041" /> Não tenho cadastro </AuthRedirect.Link> </Form> </FormSection> <img src={heroesImg} alt="Heroes" /> </Container> ); }
1.546875
2
src/Components/Helpers/SectionSeparator/SectionSeparator.js
felixveysseyre/felixveysseyre.github.io
0
15997132
import PropTypes from 'prop-types'; import React, {Component} from 'react'; import './SectionSeparator.less'; export default class SectionSeparator extends Component { /* Generic */ constructor(props) { super(props); /* Attributes */ } render() { /* Element */ const element = ( <div className="SectionSeparator"> {this.props.children} </div> ); /* Return */ return element; } /* Specific */ }; SectionSeparator.propTypes = { children: PropTypes.node, }; SectionSeparator.defaultProps = { children: null, };
1.226563
1
src/utils/usedId.js
wymsumimg/remoteAssistance
0
15997140
export const companyIdObject = { telecomId:'<KEY>' };
0.314453
0