Dataset Viewer
Auto-converted to Parquet
text
string
size
int64
token_count
int64
module.exports = { options: {}, issues: [], summary: { sessions: [], subjects: [], tasks: [], modalities: [], totalFiles: [], size: 0, }, }
172
61
require('dotenv').config(); const { TruffleProvider } = require('@harmony-js/core'); const operator_private_key = process.env.OPERATOR_PRIVATE_KEY; const operator_meemonic = process.env.OPERATOR_MNEMONIC; const testnet_url = process.env.TESTNET_0_URL; //Mainnet const mainnet_mnemonic = process.env.MAINNET_MNEMONIC; const mainnet_private_key = process.env.MAINNET_PRIVATE_KEY; const mainnet_url = process.env.MAINNET_0_URL; //GAS - Currently using same GAS accross all environments gasLimit = process.env.GAS_LIMIT; gasPrice = process.env.GAS_PRICE; module.exports = { // contracts_build_directory: '/build/contracts', networks: { testnet: { network_id: '2', // Any network (default: none) provider: () => { const truffleProvider = new TruffleProvider( testnet_url, { memonic: operator_meemonic }, { shardID: 0, chainId: 2 }, { gasLimit: gasLimit, gasPrice: gasPrice } ); const newAcc = truffleProvider.addByPrivateKey(operator_private_key); truffleProvider.setSigner(newAcc); return truffleProvider; } }, mainnet0: { network_id: '1', // Any network (default: none) provider: () => { const truffleProvider = new TruffleProvider( mainnet_url, { memonic: mainnet_mnemonic }, { shardID: 0, chainId: 1 }, { gasLimit: gasLimit, gasPrice: gasPrice } ); const newAcc = truffleProvider.addByPrivateKey(mainnet_private_key); truffleProvider.setSigner(newAcc); return truffleProvider; } } }, // Set default mocha options here, use special reporters etc. mocha: { // timeout: 100000 useColors: true }, // Configure your compilers compilers: { solc: { version: '0.5.8' } } };
1,823
608
import _ from 'lodash'; import React, {Component} from 'react'; import ReactDOM from 'react-dom'; import YTSearch from 'youtube-api-search'; import SearchBar from './components/search_bar'; import VideoList from './components/video_list'; import VideoDetail from './components/video_detail'; class App extends Component { constructor(props) { super(props); this.state = { videos: [], selectedVideo: null }; this.videoSearch('surfboards'); } videoSearch(term) { YTSearch({key: __API_KEY__, term: term}, (videos) => { this.setState({ videos: videos, selectedVideo: videos[0] }); }); } render() { const videoSearch = _.debounce((term) => {this.videoSearch(term)}, 300); return ( <div> <SearchBar onSearchTermChange={videoSearch}/> <VideoDetail video={this.state.selectedVideo}/> <VideoList onVideoSelect={selectedVideo => this.setState({selectedVideo}) } videos={this.state.videos} /> </div> ); } } ReactDOM.render(<App />, document.querySelector('.container'));
1,110
335
(function () { /* Imports */ var Meteor = Package.meteor.Meteor; var global = Package.meteor.global; var meteorEnv = Package.meteor.meteorEnv; (function(){ /////////////////////////////////////////////////////////////////////// // // // packages/raix_ui-dropped-event/packages/raix_ui-dropped-event.js // // // /////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////// }).call(this); /* Exports */ Package._define("raix:ui-dropped-event"); })();
744
161
const express = require('express'); const router = express.Router(); const fs = require('fs'); const theatreHelpers = require('../helpers/theatreHelpers'); const passport = require('passport'); const date = require('date-and-time'); const isTheatre = require('../middleware/auth').isTheatre; router.get('/login', (req, res) => { if (req.isAuthenticated() && req.user.theatre) { res.redirect('/theatre'); } else { if (req.session.messages) { res.render('theatre/login', { title: 'Theatre | Login', messages: req.session.messages, theatreStyle: true }); req.session.messages = false; } else { res.render('theatre/login', { title: 'Theatre | Login', theatreStyle: true }); } } }); router.post('/login', passport.authenticate('theatre-login', { successRedirect: '/theatre', failureRedirect: '/theatre/login', failureFlash: true })); router.get('/auth/google', passport.authenticate('theatre-google-auth', { scope: ['profile', 'email'] })); router.get('/auth/google/callback', passport.authenticate('theatre-google-auth', { failureRedirect: '/theatre/popup', failureFlash: true }), (req, res) => { res.redirect('/theatre/popup'); }); router.get('/popup', (req, res) => { if (!req.isAuthenticated()) { req.session.messages = { error: 'Invalid Account' }; } res.render('auth-popup-callback'); }); router.get('/logout', (req, res) => { req.logout(); res.json({ status: true }); }); router.get('/', isTheatre, async function (req, res, next) { const totalShows = await theatreHelpers.getNumberOfShows(req.user._id); const totalScreens = await theatreHelpers.getNumberOfScreens(req.user._id); const totalBookings = await theatreHelpers.getNumberOfBookings(req.user._id); const paidBookings = await theatreHelpers.getNumberOfPayedBookings(req.user._id); const unpaidBookings = await theatreHelpers.getNumberOfUnpayedBookings(req.user._id); const currentMonthBookings = await theatreHelpers.getTheatreBookings(req.user._id, date.format(new Date(), 'YYYY'), date.format(new Date(), 'MM'), date.format(new Date(), 'DD')); const pastMonthBookings = await theatreHelpers.getTheatreBookings(req.user._id, date.format(new Date(), 'YYYY'), date.format(new Date(new Date().getFullYear(), new Date().getMonth(), 0), 'MM'), date.format(new Date(new Date().getFullYear(), new Date().getMonth(), 0), 'DD')); res.render('theatre/dashboard', { title: 'Theatre | Dashboard', theatre: req.user, totalShows, totalScreens, totalBookings, paidBookings, unpaidBookings, currentMonthBookings, pastMonthBookings }); }); router.post('/update-owner-picture/:id', isTheatre, (req, res) => { if (req.files.ownerPicture) { theatreHelpers.updateOwnerPicture(req.params.id, true).then((response) => { let image = req.files.ownerPicture; image.mv(`./public/images/theatre/${response.theatre._id}.jpg`, (err, done) => { if (err) { console.log(err); } else { console.log(done); } }); req.flash('info', response.alertMessage); res.redirect('/theatre'); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre'); }); } }); router.get('/remove-owner-picture/:id', isTheatre, (req, res) => { theatreHelpers.updateOwnerPicture(req.params.id, false).then((response) => { req.flash('info', response.alertMessage); fs.unlinkSync(`./public/images/theatre/${response.theatre._id}.jpg`); res.redirect('/theatre'); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre'); });; }); router.post('/update-theatre-details', isTheatre, (req, res) => { theatreHelpers.updateTheatreDetails(req.body, req.user._id).then((response) => { res.json(response); }).catch((error) => { res.redirect(error); }); }); router.post('/update-location', (req, res) => { theatreHelpers.updateLocation(req.body, req.user._id).then((response) => { res.json(response); }).catch((error) => { res.json(error); }); }); router.post('/change-password', isTheatre, (req, res) => { theatreHelpers.changePassword(req.body, req.user._id).then((response) => { res.json(response); }).catch((error) => { res.json(error); }); }); router.get('/screens', isTheatre, (req, res) => { theatreHelpers.getAllScreens(req.user._id).then((screens) => { res.render('theatre/screens', { title: 'Theatre | Screens', theatre: req.user, screens }); }); }); router.get('/add-screens', isTheatre, (req, res) => { res.render('theatre/add-screens', { title: 'Admin | Add Screens', theatre: req.user }); }); router.post('/add-screens', isTheatre, (req, res) => { theatreHelpers.addScreens(req.body, req.user._id).then((response) => { req.flash('info', response.alertMessage); res.redirect('/theatre/screens'); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/screens'); }); }); router.get('/edit-screen/:id', isTheatre, (req, res) => { theatreHelpers.getScreen(req.params.id).then((screen) => { res.render('theatre/edit-screen', { title: 'Admin | Edit Screen', theatre: req.user, screen }); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/screens'); }); }); router.post('/edit-screen', isTheatre, (req, res) => { theatreHelpers.editScreen(req.body).then((response) => { req.flash('info', response.alertMessage); res.redirect('/theatre/screens'); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/screens'); }); }); router.post('/delete-screen', isTheatre, (req, res) => { theatreHelpers.deleteScreen(req.body.id).then((response) => { res.json(response); }).catch((error) => { res.json(error); }); }); router.get('/movie-management', isTheatre, (req, res) => { theatreHelpers.getAllMovies().then((movies) => { res.render('theatre/movie-management', { title: 'Theatre | Movie Management', theatre: req.user, movies, errMessage: req.session.errMessage, alertMessage: req.session.alertMessage }); req.session.errMessage = false; req.session.alertMessage = false; }); }); router.get('/add-movies', isTheatre, (req, res) => { res.render('theatre/add-movies', { title: 'Theatre | Add Movies', theatre: req.user }); }); router.post('/add-movies', isTheatre, (req, res) => { theatreHelpers.addMovies(req.body, req.user._id).then((response) => { let image = req.files.moviePoster; image.mv(`./public/images/movies/posters/${response.data._id}.jpg`, (err, done) => { if (err) { console.log(err); } else { console.log(done); } }); req.flash('info', response.alertMessage); res.redirect('/theatre/movie-management'); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/movie-management'); }); }); router.get('/edit-movie/:id', isTheatre, (req, res) => { theatreHelpers.getMovie(req.params.id).then((movie) => { res.render('theatre/edit-movie', { title: 'Theatre | Edit Movie', theatre: req.user, movie }); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/movie-management'); }); }); router.post('/edit-movie', isTheatre, (req, res) => { theatreHelpers.editMovie(req.body).then((response) => { req.flash('info', response.alertMessage); res.redirect('/theatre/movie-management'); if (req.files.moviePoster) { let image = req.files.moviePoster; image.mv(`./public/images/movies/posters/${response.movieId}.jpg`, (err, done) => { if (err) { console.log(err); } else { console.log(done); } }); } }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/movie-management'); }); }); router.post('/delete-movie', isTheatre, (req, res) => { theatreHelpers.deleteMovie(req.body.id, req.user._id).then((response) => { fs.unlinkSync(`./public/images/movies/posters/${req.body.id}.jpg`); res.json(response); }).catch((error) => { res.json(error); }); }); router.get('/upcoming-movies', isTheatre, (req, res) => { theatreHelpers.getAllUpcomingMovies(req.user._id).then((movies) => { res.render('theatre/upcoming-movies', { title: 'Theatre | Upcoming Movies', theatre: req.user, movies }); }); }); router.get('/add-upcoming-movies', isTheatre, (req, res) => { res.render('theatre/add-upcoming-movies', { title: 'Theatre | Add Movies', theatre: req.user }); }); router.post('/add-upcoming-movies', isTheatre, (req, res) => { theatreHelpers.addUpcomingMovies(req.body, req.user._id).then((response) => { let image = req.files.moviePoster; image.mv(`./public/images/movies/upcoming-movies/posters/${response.data._id}.jpg`, (err, done) => { if (err) { console.log(err); } else { console.log(done); } }); req.flash('info', response.alertMessage); res.redirect('/theatre/upcoming-movies'); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/upcoming-movies'); }); }); router.get('/edit-upcoming-movie/:id', isTheatre, (req, res) => { theatreHelpers.getUpcomingMovie(req.params.id).then((movie) => { res.render('theatre/edit-upcoming-movie', { title: 'Theatre | Edit Upcoming Movie', theatre: req.user, movie }); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/upcoming-movies'); }); }); router.post('/edit-upcoming-movie', isTheatre, (req, res) => { theatreHelpers.editUpcomingMovie(req.body).then((response) => { req.flash('info', response.alertMessage); res.redirect('/theatre/upcoming-movies'); if (req.files.moviePoster) { let image = req.files.moviePoster; image.mv(`./public/images/movies/upcoming-movies/posters/${response.movieId}.jpg`, (err, done) => { if (err) { console.log(err); } else { console.log(done); } }); } }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/upcoming-movies'); }); }); router.post('/delete-upcoming-movie', isTheatre, (req, res) => { theatreHelpers.deleteUpcomingMovie(req.body.id).then((response) => { fs.unlinkSync(`./public/images/movies/upcoming-movies/posters/${req.body.id}.jpg`); res.json(response); }).catch((error) => { res.json(error); }); }); router.get('/view-schedule/:id', isTheatre, (req, res) => { theatreHelpers.getScreen(req.params.id).then(async (screen) => { const shows = await theatreHelpers.getAllShows(req.params.id); res.render('theatre/view-schedule', { title: 'Theatre | View Schedule', theatre: req.user, screen, shows }); }).catch((error) => { req.flash('error', error.errMessage); res.redirect('/theatre/screens'); }); }); router.get('/add-shows/:id', isTheatre, (req, res) => { theatreHelpers.getAllMovies().then((movies) => { res.render('theatre/add-shows', { title: 'Theatre | Add Shows', theatre: req.user, screenId: req.params.id, movies }); }); }); router.post('/add-shows', isTheatre, (req, res) => { theatreHelpers.addShows(req.body).then((response) => { req.flash('info', response.alertMessage); res.redirect(`/theatre/view-schedule/${response.screenId}`); }).catch((error) => { req.flash('error', error.errMessage); res.redirect(`/theatre/view-schedule/${error.screenId}`); }); }); router.get('/edit-show', isTheatre, (req, res) => { theatreHelpers.getAllMovies().then(async (movies) => { const show = await theatreHelpers.getShow(req.query); res.render('theatre/edit-show', { title: 'Theatre | Edit Show', theatre: req.user, show, movies }); }).catch((error) => { req.flash('error', error.errMessage); res.redirect(`/theatre/view-schedule/${req.query.screenId}`); }); }); router.post('/edit-show', isTheatre, (req, res) => { theatreHelpers.editShow(req.body).then((response) => { req.flash('info', response.alertMessage); res.redirect(`/theatre/view-schedule/${req.body.screenId}`) }).catch((error) => { req.flash('error', error.errMessage); res.redirect(`/theatre/view-schedule/${req.body.screenId}`) }); }); router.post('/delete-show', isTheatre, (req, res) => { theatreHelpers.deleteShow(req.body).then((response) => { res.json(response); }).catch((error) => { res.json(error); }); }); router.post('/get-time-slots', (req, res) => { theatreHelpers.getTimeSlots(req.body).then((slots) => { res.json(slots); }); }); router.get('/users-activity', isTheatre, (req, res) => { theatreHelpers.getUsers(req.user._id).then((users) => { res.render('theatre/users-activity', { title: 'Theatre | Users Activity', theatre: req.user, users }); }); }); router.get('/profile', isTheatre, (req, res) => { res.render('theatre/profile', { title: 'Theatre | Profile', theatre: req.user }); }); module.exports = router;
13,373
4,524
function scholarship(arg1, arg2, arg3) { let income = Number(arg1); let averageGrade = Number(arg2); let minIncome = Number(arg3); let socialScholarship = 0; let excellentScholarship = 0; if (averageGrade >= 5.50) { excellentScholarship = averageGrade * 25; } if ((averageGrade >= 4.50 && averageGrade < 5.50) && income <= minIncome) { socialScholarship = minIncome * 0.35; } if (socialScholarship > excellentScholarship) { console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`); } else if (excellentScholarship > socialScholarship) { console.log(`You get a scholarship for excellent results ${Math.floor(excellentScholarship)} BGN`); } else { console.log(`You cannot get a scholarship!`); } } scholarship(300.00, 5.65, 420.00, );
865
309
/* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved. * This program are made available under the terms of the Apache License, Version 2.0 * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ import {SuperMap} from '../SuperMap'; import {ShapeFactory} from './feature/ShapeFactory'; import {Sector} from './feature/Sector'; import {Graph} from './Graph'; /** * @class SuperMap.Feature.Theme.Pie * @classdesc 饼图。 * @category Visualization Theme * @param {SuperMap.Feature.Vector} data - 用户数据。 * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。 * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。 * @param {SuperMap.Feature.Theme.Point.setting} setting - 图表配置对象。 * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。 * @extends SuperMap.Feature.Theme.Graph * @example * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性: * // start: 值域值下限(包含); * // end: 值域值上限(不包含); * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Sector.style> 。 * // sectorStyleByCodomain 数组形如: * [ * { * start:0, * end:250, * style:{ * fillColor:"#00CD00" * } * }, * { * start:250, * end:500, * style:{ * fillColor:"#00EE00" * } * }, * { * start:500, * end:750, * style:{ * fillColor:"#00FF7F" * } * }, * { * start:750, * end:1500, * style:{ * fillColor:"#00FF00" * } * } * ] * @extends {SuperMap.Feature.Theme.Graph} */ export class Pie extends Graph { constructor(data, layer, fields, setting, lonlat) { super(data, layer, fields, setting, lonlat); this.CLASS_NAME = "SuperMap.Feature.Theme.Pie"; } /** * @function SuperMap.Feature.Theme.Pie.prototype.destroy * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。 */ destroy() { super.destroy(); } /** * @function SuperMap.Feature.Theme.Pie.prototype.assembleShapes * @description 装配图形(扩展接口)。 */ assembleShapes() { // 图表配置对象 var sets = this.setting; // 一个默认 style 组 var defaultStyleGroup = [ {fillColor: "#ff9277"}, {fillColor: "#dddd00"}, {fillColor: "#ffc877"}, {fillColor: "#bbe3ff"}, {fillColor: "#d5ffbb"}, {fillColor: "#bbbbff"}, {fillColor: "#ddb000"}, {fillColor: "#b0dd00"}, {fillColor: "#e2bbff"}, {fillColor: "#ffbbe3"}, {fillColor: "#ff7777"}, {fillColor: "#ff9900"}, {fillColor: "#83dd00"}, {fillColor: "#77e3ff"}, {fillColor: "#778fff"}, {fillColor: "#c877ff"}, {fillColor: "#ff77ab"}, {fillColor: "#ff6600"}, {fillColor: "#aa8800"}, {fillColor: "#77c7ff"}, {fillColor: "#ad77ff"}, {fillColor: "#ff77ff"}, {fillColor: "#dd0083"}, {fillColor: "#777700"}, {fillColor: "#00aa00"}, {fillColor: "#0088aa"}, {fillColor: "#8400dd"}, {fillColor: "#aa0088"}, {fillColor: "#dd0000"}, {fillColor: "#772e00"} ]; // 重要步骤:初始化参数 if (!this.initBaseParameter()) { return; } // 背景框,默认不启用 if (sets.useBackground) { this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets)); } // 数据值数组 var fv = this.dataValues; if (fv.length < 1) { return; } // 没有数据 // 值域范围 var codomain = this.DVBCodomain; // 值域范围检测 for (let i = 0; i < fv.length; i++) { if (fv[i] < codomain[0] || fv[i] > codomain[1]) { return; } } // 值的绝对值总和 var valueSum = 0; for (let i = 0; i < fv.length; i++) { valueSum += Math.abs(fv[i]); } // 重要步骤:定义图表 Pie 数据视图框中单位值的含义,单位值:每度代表的数值 this.DVBUnitValue = 360 / valueSum; var uv = this.DVBUnitValue; var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心 var startAngle = 0; // 扇形起始边角度 var endAngle = 0; // 扇形终止边角度 var startAngleTmp = startAngle; // 扇形临时起始边角度 // 扇形(自适应)半径 var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2; for (var i = 0; i < fv.length; i++) { var fvi = Math.abs(fv[i]); //计算终止角 if (i === 0) { endAngle = startAngle + fvi * uv; } else if (i === fvi.length - 1) { endAngle = startAngleTmp; } else { endAngle = startAngle + fvi * uv; } //矫正误差计算 if ((endAngle - startAngle) >= 360) { endAngle = 359.9999999; } // 扇形参数对象 var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle); // 扇形样式 if (typeof(sets.sectorStyleByFields) === "undefined") { // 使用默认 style 组 var colorIndex = i % defaultStyleGroup.length; sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex); } else { sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]); } // 扇形 hover 样式 sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle); // 扇形 hover 与 click 设置 if (typeof(sets.sectorHoverAble) !== "undefined") { sectorSP.hoverable = sets.sectorHoverAble; } if (typeof(sets.sectorClickAble) !== "undefined") { sectorSP.clickable = sets.sectorClickAble; } // 图形携带的数据信息 sectorSP.refDataID = this.data.id; sectorSP.dataInfo = { field: this.fields[i], value: fv[i] }; // 创建扇形并把此扇形添加到图表图形数组 this.shapes.push(this.shapeFactory.createShape(sectorSP)); // 把上一次的结束角度作为下一次的起始角度 startAngle = endAngle; } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形 // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数) this.shapesConvertToRelativeCoordinate(); } } /** * @typedef {Object} SuperMap.Feature.Theme.Pie.setting * @property {number} width - 专题要素(图表)宽度。 * @property {number} height - 专题要素(图表)高度。 * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。 * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。 * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。 * @property {Array.<number>} [dataViewBoxParameter=[0, 0, 0, 0]] - 数据视图框 dataViewBox 参数, * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。 * @property {Array.<number>} decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。 * @property {boolean} [useBackground=false] - 是否使用图表背景框。 * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。 * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。 * @property {SuperMap.Feature.ShapeParameters.Sector.style} sectorStyle - 饼图中扇形的基础 style,此参数控制饼图扇形基础样式,优先级低于 sectorStyleByFields 和 sectorStyleByCodomain。 * @property {Array.<SuperMap.Feature.ShapeParameters.Sector.style>} sectorStyleByFields - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为饼图扇形赋 style,此参数按字段控制饼图扇形样式,优先级低于 sectorStyleByCodomain,高于 sectorStyle。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"], * sectorStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的饼图扇形使用 style1,字段 POP_1995 对应的饼图扇形使用 style2 ,字段 POP_1999 对应的饼图扇形使用 style3。 * @property {Array.<Object>} sectorStyleByCodomain - 按饼图扇形代表的数据值所在值域范围控制饼图扇形样式,优先级高于 sectorStyle 和 sectorStyleByFields。 * @property {Object} [sectorHoverStyle] 饼图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。 * @property {boolean} [sectorHoverAble=true] 是否允许饼图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。 * @property {boolean} [sectorClickAble=true] 是否允许饼图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。 */ SuperMap.Feature.Theme.Pie = Pie;
8,669
4,010
import { get } from '@wp-g2/create-styles'; import { colorize, getComputedColor, is, noop } from '@wp-g2/utils'; import { space } from '../mixins/space'; import { config } from './config'; import { generateColorAdminColors } from './utils'; const baseTheme = Object.freeze(Object.assign({}, config)); export function createTheme(callback = noop) { if (!is.function(callback)) return {}; const props = { get, theme: baseTheme, color: colorize, space, }; const customConfig = callback(props); if (!is.plainObject(customConfig)) return {}; let colorAdminColors = {}; if (customConfig.colorAdmin) { const colorAdminValue = getComputedColor(customConfig.colorAdmin); colorAdminColors = generateColorAdminColors(colorAdminValue); } return { ...customConfig, ...colorAdminColors, }; }
813
271
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[9],{ /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/productItem.vue?vue&type=script&lang=js&": /*!**********************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/productItem.vue?vue&type=script&lang=js& ***! \**********************************************************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var vue_router__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-router */ "./node_modules/vue-router/dist/vue-router.esm.js"); /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // // // // // // // // // // // // // // // // // // // // // // // // // //import { mapGetters } from "vuex"; /* harmony default export */ __webpack_exports__["default"] = ({ name: 'productItem', props: ['prod', 'item', 'displayList'], data: function data() { return { "short": this.prod.description.substring(0, 20), image: "/assets/products/medium/" + this.prod.image }; }, methods: _objectSpread({ loadProdDetails: function loadProdDetails(id) { this.$router.push("/product-details/" + id); this.prodDetails(id); } }, Object(vuex__WEBPACK_IMPORTED_MODULE_1__["mapActions"])(['prodDetails'])) /* methods: { ...mapActions(['updateCart']), addItem() { const order = { item: Object.assign({}, this.item), quantity: 1, isAdd: true }; this.updateCart(order); } }, filters: { shortDescription(value) { if (value && value.length > 100) { return value.substring(0, 100) + '...'; } else { return value; } } } */ }); /***/ }), /***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css&": /*!*****************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css& ***! \*****************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, "\ndiv.card[data-v-74f7cea7] {\n height: 100%;\n}\n.card-text[data-v-74f7cea7] {\n font-size: 0.875rem;\n}\n.remain[data-v-74f7cea7] {\n color: #d17581;\n}\n.grow[data-v-74f7cea7] {\n transition: all .2s ease-in-out;\n}\n.grow[data-v-74f7cea7]:hover {\n transform: scale(1.1);\n}\n.list-group-item[data-v-74f7cea7] {\n float: none;\n width: 100%;\n background-color: #fff;\n margin-bottom: 30px;\n flex: 0 0 100%;\n max-width: 100%;\n padding: 0 1rem;\n border: 0;\n.thumbnail {\n display: inline-block;\n width: 100%;\n}\n.img-event {\n width: 20%;\n float: left;\n padding: 0 !important;\n margin: 0;\n height: auto;\n}\n.thumbnail-image {\n position: static;\n}\n.card-body {\n float: left;\n width: 80%;\n margin: 0;\n}\n@media (max-width: 767.98px) {\n.img-event {\n width: 30%;\n float: left;\n padding: 0 !important;\n margin: 0;\n}\n.card-body {\n float: left;\n width: 70%;\n margin: 0;\n}\n}\n}\n.item.list-group-item[data-v-74f7cea7]:before, .item.list-group-item[data-v-74f7cea7]:after\n{\n display: table;\n content: \" \";\n}\n.item.list-group-item[data-v-74f7cea7]:after {\n clear: both;\n}\n", ""]); // exports /***/ }), /***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css&": /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/style-loader!./node_modules/css-loader??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css& ***! \*********************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--6-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--6-2!../../../node_modules/vue-loader/lib??vue-loader-options!./productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css&"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/productItem.vue?vue&type=template&id=74f7cea7&scoped=true&": /*!**************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/productItem.vue?vue&type=template&id=74f7cea7&scoped=true& ***! \**************************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { staticClass: "col-sm-6 col-md-4 item", class: { "list-group-item": false } }, [ _c("div", { staticClass: "thumbnail card" }, [ _c("div", { staticClass: "img-event intrinsic" }, [ _c("img", { staticClass: "grow thumbnail-image card-img-top intrinsic-item p-3", attrs: { src: _vm.image, alt: "" } }) ]), _vm._v(" "), _c("div", { staticClass: "card-body" }, [ _c("h6", { staticClass: "card-subtitle mb-2 remain" }, [ _vm._v("40 left in stock") ]), _vm._v(" "), _c( "h6", { staticClass: "card-subtitle mb-2 remain", staticStyle: { color: "green" } }, [_vm._v(_vm._s(_vm.short) + " ...")] ), _vm._v(" "), _c("p", { staticClass: "card-text truncate" }, [ _vm._v(_vm._s(_vm.prod.p_name)) ]), _vm._v(" "), _c("div", { staticClass: "row" }, [ _c("p", { staticClass: "col-6 lead" }, [ _vm._v("$" + _vm._s(_vm.prod.price)) ]), _vm._v(" "), _c("p", { staticClass: "col-6" }, [ _c( "button", { staticClass: "btn btn-success pull-right", staticStyle: { "font-size": "10px" }, attrs: { disabled: false }, on: { click: function($event) { return _vm.loadProdDetails(_vm.prod.id) } } }, [_vm._v(" View Product \n ")] ) ]) ]) ]) ]) ] ) } var staticRenderFns = [] render._withStripped = true /***/ }), /***/ "./resources/js/components/productItem.vue": /*!*************************************************!*\ !*** ./resources/js/components/productItem.vue ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _productItem_vue_vue_type_template_id_74f7cea7_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./productItem.vue?vue&type=template&id=74f7cea7&scoped=true& */ "./resources/js/components/productItem.vue?vue&type=template&id=74f7cea7&scoped=true&"); /* harmony import */ var _productItem_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./productItem.vue?vue&type=script&lang=js& */ "./resources/js/components/productItem.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport *//* harmony import */ var _productItem_vue_vue_type_style_index_0_id_74f7cea7_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css& */ "./resources/js/components/productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); /* normalize component */ var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( _productItem_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], _productItem_vue_vue_type_template_id_74f7cea7_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], _productItem_vue_vue_type_template_id_74f7cea7_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, "74f7cea7", null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/components/productItem.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), /***/ "./resources/js/components/productItem.vue?vue&type=script&lang=js&": /*!**************************************************************************!*\ !*** ./resources/js/components/productItem.vue?vue&type=script&lang=js& ***! \**************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./productItem.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/productItem.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), /***/ "./resources/js/components/productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css&": /*!**********************************************************************************************************!*\ !*** ./resources/js/components/productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css& ***! \**********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_style_index_0_id_74f7cea7_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader!../../../node_modules/css-loader??ref--6-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--6-2!../../../node_modules/vue-loader/lib??vue-loader-options!./productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/productItem.vue?vue&type=style&index=0&id=74f7cea7&scoped=true&lang=css&"); /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_style_index_0_id_74f7cea7_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_style_index_0_id_74f7cea7_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_style_index_0_id_74f7cea7_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_style_index_0_id_74f7cea7_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }), /***/ "./resources/js/components/productItem.vue?vue&type=template&id=74f7cea7&scoped=true&": /*!********************************************************************************************!*\ !*** ./resources/js/components/productItem.vue?vue&type=template&id=74f7cea7&scoped=true& ***! \********************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_template_id_74f7cea7_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./productItem.vue?vue&type=template&id=74f7cea7&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/productItem.vue?vue&type=template&id=74f7cea7&scoped=true&"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_template_id_74f7cea7_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_productItem_vue_vue_type_template_id_74f7cea7_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); /***/ }) }]);
20,612
6,869
import React from 'react' export default () => ( <svg width="80px" height="80px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="lds-fidget-spinner" > <g transform="rotate(6 50 50)"> <g transform="translate(50 50)"> <g ng-attr-transform="scale({{config.r}})" transform="scale(0.9)"> <g transform="translate(-50 -58)"> <path ng-attr-fill="{{config.c2}}" d="M27.1,79.4c-1.1,0.6-2.4,1-3.7,1c-2.6,0-5.1-1.4-6.4-3.7c-2-3.5-0.8-8,2.7-10.1c1.1-0.6,2.4-1,3.7-1c2.6,0,5.1,1.4,6.4,3.7 C31.8,72.9,30.6,77.4,27.1,79.4z" fill="#fc636b" /> <path ng-attr-fill="{{config.c3}}" d="M72.9,79.4c1.1,0.6,2.4,1,3.7,1c2.6,0,5.1-1.4,6.4-3.7c2-3.5,0.8-8-2.7-10.1c-1.1-0.6-2.4-1-3.7-1c-2.6,0-5.1,1.4-6.4,3.7 C68.2,72.9,69.4,77.4,72.9,79.4z" fill="#6a67ce" /> <circle ng-attr-fill="{{config.c4}}" cx="50" cy="27" r="7.4" fill="#ffb900" /> <path ng-attr-fill="{{config.c1}}" d="M86.5,57.5c-3.1-1.9-6.4-2.8-9.8-2.8c-0.5,0-0.9,0-1.4,0c-0.4,0-0.8,0-1.1,0c-2.1,0-4.2-0.4-6.2-1.2 c-0.8-3.6-2.8-6.9-5.4-9.3c0.4-2.5,1.3-4.8,2.7-6.9c2-2.9,3.2-6.5,3.2-10.4c0-10.2-8.2-18.4-18.4-18.4c-0.3,0-0.6,0-0.9,0 C39.7,9,32,16.8,31.6,26.2c-0.2,4.1,1,7.9,3.2,11c1.4,2.1,2.3,4.5,2.7,6.9c-2.6,2.5-4.6,5.7-5.4,9.3c-1.9,0.7-4,1.1-6.1,1.1 c-0.4,0-0.8,0-1.2,0c-0.5,0-0.9-0.1-1.4-0.1c-3.1,0-6.3,0.8-9.2,2.5c-9.1,5.2-12,17-6.3,25.9c3.5,5.4,9.5,8.4,15.6,8.4 c2.9,0,5.8-0.7,8.5-2.1c3.6-1.9,6.3-4.9,8-8.3c1.1-2.3,2.7-4.2,4.6-5.8c1.7,0.5,3.5,0.8,5.4,0.8c1.9,0,3.7-0.3,5.4-0.8 c1.9,1.6,3.5,3.5,4.6,5.7c1.5,3.2,4,6,7.4,8c2.9,1.7,6.1,2.5,9.2,2.5c6.6,0,13.1-3.6,16.4-10C97.3,73.1,94.4,62.5,86.5,57.5z M29.6,83.7c-1.9,1.1-4,1.6-6.1,1.6c-4.2,0-8.4-2.2-10.6-6.1c-3.4-5.9-1.4-13.4,4.5-16.8c1.9-1.1,4-1.6,6.1-1.6 c4.2,0,8.4,2.2,10.6,6.1C37.5,72.8,35.4,80.3,29.6,83.7z M50,39.3c-6.8,0-12.3-5.5-12.3-12.3S43.2,14.7,50,14.7 c6.8,0,12.3,5.5,12.3,12.3S56.8,39.3,50,39.3z M87.2,79.2c-2.3,3.9-6.4,6.1-10.6,6.1c-2.1,0-4.2-0.5-6.1-1.6 c-5.9-3.4-7.9-10.9-4.5-16.8c2.3-3.9,6.4-6.1,10.6-6.1c2.1,0,4.2,0.5,6.1,1.6C88.6,65.8,90.6,73.3,87.2,79.2z" fill="#3be8b0" /> </g> </g> </g> <animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite" /> </g> </svg> )
2,677
1,847
/** * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 * Copyright (C) 2020 Oliver Nightingale * @license MIT */ !function(){var e=function(t){var r=new e.Builder;return r.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),r.searchPipeline.add(e.stemmer),t.call(r,r),r.build()};e.version="2.3.9",e.utils={},e.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),e.utils.asString=function(e){return void 0===e||null===e?"":e.toString()},e.utils.clone=function(e){if(null===e||void 0===e)return e;for(var t=Object.create(null),r=Object.keys(e),i=0;i<r.length;i++){var n=r[i],s=e[n];if(Array.isArray(s))t[n]=s.slice();else{if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s)throw new TypeError("clone is not deep and does not support nested objects");t[n]=s}}return t},e.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},e.FieldRef.joiner="/",e.FieldRef.fromString=function(t){var r=t.indexOf(e.FieldRef.joiner);if(r===-1)throw"malformed field ref string";var i=t.slice(0,r),n=t.slice(r+1);return new e.FieldRef(n,i,t)},e.FieldRef.prototype.toString=function(){return void 0==this._stringValue&&(this._stringValue=this.fieldName+e.FieldRef.joiner+this.docRef),this._stringValue},e.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},e.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},e.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},e.Set.prototype.contains=function(e){return!!this.elements[e]},e.Set.prototype.intersect=function(t){var r,i,n,s=[];if(t===e.Set.complete)return this;if(t===e.Set.empty)return t;this.length<t.length?(r=this,i=t):(r=t,i=this),n=Object.keys(r.elements);for(var o=0;o<n.length;o++){var a=n[o];a in i.elements&&s.push(a)}return new e.Set(s)},e.Set.prototype.union=function(t){return t===e.Set.complete?e.Set.complete:t===e.Set.empty?this:new e.Set(Object.keys(this.elements).concat(Object.keys(t.elements)))},e.idf=function(e,t){var r=0;for(var i in e)"_index"!=i&&(r+=Object.keys(e[i]).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},e.Token=function(e,t){this.str=e||"",this.metadata=t||{}},e.Token.prototype.toString=function(){return this.str},e.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},e.Token.prototype.clone=function(t){return t=t||function(e){return e},new e.Token(t(this.str,this.metadata),this.metadata)},e.tokenizer=function(t,r){if(null==t||void 0==t)return[];if(Array.isArray(t))return t.map(function(t){return new e.Token(e.utils.asString(t).toLowerCase(),e.utils.clone(r))});for(var i=t.toString().toLowerCase(),n=i.length,s=[],o=0,a=0;o<=n;o++){var u=i.charAt(o),l=o-a;if(u.match(e.tokenizer.separator)||o==n){if(l>0){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r<t;r++){for(var i=this._stack[r],n=[],s=0;s<e.length;s++){var o=i(e[s],s,e);if(null!==o&&void 0!==o&&""!==o)if(Array.isArray(o))for(var a=0;a<o.length;a++)n.push(o[a]);else n.push(o)}e=n}return e},e.Pipeline.prototype.runString=function(t,r){var i=new e.Token(t,r);return this.run([i]).map(function(e){return e.toString()})},e.Pipeline.prototype.reset=function(){this._stack=[]},e.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return e.Pipeline.warnIfFunctionNotRegistered(t),t.label})},e.Vector=function(e){this._magnitude=0,this.elements=e||[]},e.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,r=this.elements.length/2,i=r-t,n=Math.floor(i/2),s=this.elements[2*n];i>1&&(s<e&&(t=n),s>e&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:s<e?2*(n+1):void 0},e.Vector.prototype.insert=function(e,t){this.upsert(e,t,function(){throw"duplicate index"})},e.Vector.prototype.upsert=function(e,t,r){this._magnitude=0;var i=this.positionForIndex(e);this.elements[i]==e?this.elements[i+1]=r(this.elements[i+1],t):this.elements.splice(i,0,e,t)},e.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,r=1;r<t;r+=2){var i=this.elements[r];e+=i*i}return this._magnitude=Math.sqrt(e)},e.Vector.prototype.dot=function(e){for(var t=0,r=this.elements,i=e.elements,n=r.length,s=i.length,o=0,a=0,u=0,l=0;u<n&&l<s;)o=r[u],a=i[l],o<a?u+=2:o>a?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t<this.elements.length;t+=2,r++)e[r]=this.elements[t];return e},e.Vector.prototype.toJSON=function(){return this.elements},e.stemmer=function(){var e={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},t={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},r="[^aeiou]",i="[aeiouy]",n=r+"[^aeiouy]*",s=i+"[aeiou]*",o="^("+n+")?"+s+n,a="^("+n+")?"+s+n+"("+s+")?$",u="^("+n+")?"+s+n+s+n,l="^("+n+")?"+i,c=new RegExp(o),h=new RegExp(u),d=new RegExp(a),f=new RegExp(l),p=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,m=/^(.+?)eed$/,v=/^(.+?)(ed|ing)$/,g=/.$/,x=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),Q=new RegExp("^"+n+i+"[^aeiouwxy]$"),k=/^(.+?[^aeiou])y$/,S=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,L=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,b=/^(.+?)(s|t)(ion)$/,P=/^(.+?)e$/,T=/ll$/,O=new RegExp("^"+n+i+"[^aeiouwxy]$"),I=function(r){var i,n,s,o,a,u,l;if(r.length<3)return r;if(s=r.substr(0,1),"y"==s&&(r=s.toUpperCase()+r.substr(1)),o=p,a=y,o.test(r)?r=r.replace(o,"$1$2"):a.test(r)&&(r=r.replace(a,"$1$2")),o=m,a=v,o.test(r)){var I=o.exec(r);o=c,o.test(I[1])&&(o=g,r=r.replace(o,""))}else if(a.test(r)){var I=a.exec(r);i=I[1],a=f,a.test(i)&&(r=i,a=x,u=w,l=Q,a.test(r)?r+="e":u.test(r)?(o=g,r=r.replace(o,"")):l.test(r)&&(r+="e"))}if(o=k,o.test(r)){var I=o.exec(r);i=I[1],r=i+"i"}if(o=S,o.test(r)){var I=o.exec(r);i=I[1],n=I[2],o=c,o.test(i)&&(r=i+e[n])}if(o=E,o.test(r)){var I=o.exec(r);i=I[1],n=I[2],o=c,o.test(i)&&(r=i+t[n])}if(o=L,a=b,o.test(r)){var I=o.exec(r);i=I[1],o=h,o.test(i)&&(r=i)}else if(a.test(r)){var I=a.exec(r);i=I[1]+I[2],a=h,a.test(i)&&(r=i)}if(o=P,o.test(r)){var I=o.exec(r);i=I[1],o=h,a=d,u=O,(o.test(i)||a.test(i)&&!u.test(i))&&(r=i)}return o=T,a=h,o.test(r)&&a.test(r)&&(o=g,r=r.replace(o,"")),"y"==s&&(r=s.toLowerCase()+r.substr(1)),r};return function(e){return e.update(I)}}(),e.Pipeline.registerFunction(e.stemmer,"stemmer"),e.generateStopWordFilter=function(e){var t=e.reduce(function(e,t){return e[t]=t,e},{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},e.stopWordFilter=e.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),e.Pipeline.registerFunction(e.stopWordFilter,"stopWordFilter"),e.trimmer=function(e){return e.update(function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")})},e.Pipeline.registerFunction(e.trimmer,"trimmer"),e.TokenSet=function(){this["final"]=!1,this.edges={},this.id=e.TokenSet._nextId,e.TokenSet._nextId+=1},e.TokenSet._nextId=1,e.TokenSet.fromArray=function(t){for(var r=new e.TokenSet.Builder,i=0,n=t.length;i<n;i++)r.insert(t[i]);return r.finish(),r.root},e.TokenSet.fromClause=function(t){return"editDistance"in t?e.TokenSet.fromFuzzyString(t.term,t.editDistance):e.TokenSet.fromString(t.term)},e.TokenSet.fromFuzzyString=function(t,r){for(var i=new e.TokenSet,n=[{node:i,editsRemaining:r,str:t}];n.length;){var s=n.pop();if(s.str.length>0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n<s;n++){var o=t[n],a=n==s-1;if("*"==o)r.edges[o]=r,r["final"]=a;else{var u=new e.TokenSet;u["final"]=a,r.edges[o]=u,r=u}}return i},e.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var r=t.pop(),i=Object.keys(r.node.edges),n=i.length;r.node["final"]&&(r.prefix.charAt(0),e.push(r.prefix));for(var s=0;s<n;s++){var o=i[s];t.push({prefix:r.prefix.concat(o),node:r.node.edges[o]})}}return e},e.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this["final"]?"1":"0",t=Object.keys(this.edges).sort(),r=t.length,i=0;i<r;i++){var n=t[i],s=this.edges[n];e=e+n+s.id}return e},e.TokenSet.prototype.intersect=function(t){for(var r=new e.TokenSet,i=void 0,n=[{qNode:t,output:r,node:this}];n.length;){i=n.pop();for(var s=Object.keys(i.qNode.edges),o=s.length,a=Object.keys(i.node.edges),u=a.length,l=0;l<o;l++)for(var c=s[l],h=0;h<u;h++){var d=a[h];if(d==c||"*"==c){var f=i.node.edges[d],p=i.qNode.edges[c],y=f["final"]&&p["final"],m=void 0;d in i.output.edges?(m=i.output.edges[d],m["final"]=m["final"]||y):(m=new e.TokenSet,m["final"]=y,i.output.edges[d]=m),n.push({qNode:p,output:m,node:f})}}}return r},e.TokenSet.Builder=function(){this.previousWord="",this.root=new e.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},e.TokenSet.Builder.prototype.insert=function(t){var r,i=0;if(t<this.previousWord)throw new Error("Out of order word insertion");for(var n=0;n<t.length&&n<this.previousWord.length&&t[n]==this.previousWord[n];n++)i++;this.minimize(i),r=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(var n=i;n<t.length;n++){var s=new e.TokenSet,o=t[n];r.edges[o]=s,this.uncheckedNodes.push({parent:r,"char":o,child:s}),r=s}r["final"]=!0,this.previousWord=t},e.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},e.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u<this.fields.length;u++)n[this.fields[u]]=new e.Vector;t.call(r,r);for(var u=0;u<r.clauses.length;u++){var l=r.clauses[u],c=null,h=e.Set.empty;c=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var d=0;d<c.length;d++){var f=c[d];l.term=f;var p=e.TokenSet.fromClause(l),y=this.tokenSet.intersect(p).toArray();if(0===y.length&&l.presence===e.Query.presence.REQUIRED){for(var m=0;m<l.fields.length;m++){var v=l.fields[m];o[v]=e.Set.empty}break}for(var g=0;g<y.length;g++)for(var x=y[g],w=this.invertedIndex[x],Q=w._index,m=0;m<l.fields.length;m++){var v=l.fields[m],k=w[v],S=Object.keys(k),E=x+"/"+v,L=new e.Set(S);if(l.presence==e.Query.presence.REQUIRED&&(h=h.union(L),void 0===o[v]&&(o[v]=e.Set.complete)),l.presence!=e.Query.presence.PROHIBITED){if(n[v].upsert(Q,l.boost,function(e,t){return e+t}),!s[E]){for(var b=0;b<S.length;b++){var P,T=S[b],O=new e.FieldRef(T,v),I=k[T];void 0===(P=i[O])?i[O]=new e.MatchData(x,v,I):P.add(x,v,I)}s[E]=!0}}else void 0===a[v]&&(a[v]=e.Set.empty),a[v]=a[v].union(L)}}if(l.presence===e.Query.presence.REQUIRED)for(var m=0;m<l.fields.length;m++){var v=l.fields[m];o[v]=o[v].intersect(h)}}for(var R=e.Set.complete,F=e.Set.empty,u=0;u<this.fields.length;u++){var v=this.fields[u];o[v]&&(R=R.intersect(o[v])),a[v]&&(F=F.union(a[v]))}var C=Object.keys(i),N=[],_=Object.create(null);if(r.isNegated()){C=Object.keys(this.fieldVectors);for(var u=0;u<C.length;u++){var O=C[u],j=e.FieldRef.fromString(O);i[O]=new e.MatchData}}for(var u=0;u<C.length;u++){var j=e.FieldRef.fromString(C[u]),D=j.docRef;if(R.contains(D)&&!F.contains(D)){var A,B=this.fieldVectors[j],V=n[j.fieldName].similarity(B);if(void 0!==(A=_[D]))A.score+=V,A.matchData.combine(i[j]);else{var z={ref:D,score:V,matchData:i[j]};_[D]=z,N.push(z)}}}return N.sort(function(e,t){return t.score-e.score})},e.Index.prototype.toJSON=function(){var t=Object.keys(this.invertedIndex).sort().map(function(e){return[e,this.invertedIndex[e]]},this),r=Object.keys(this.fieldVectors).map(function(e){return[e,this.fieldVectors[e].toJSON()]},this);return{version:e.version,fields:this.fields,fieldVectors:r,invertedIndex:t,pipeline:this.pipeline.toJSON()}},e.Index.load=function(t){var r={},i={},n=t.fieldVectors,s=Object.create(null),o=t.invertedIndex,a=new e.TokenSet.Builder,u=e.Pipeline.load(t.pipeline);t.version!=e.version&&e.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+e.version+"' does not match serialized index '"+t.version+"'");for(var l=0;l<n.length;l++){var c=n[l],h=c[0],d=c[1];i[h]=new e.Vector(d)}for(var l=0;l<o.length;l++){var c=o[l],f=c[0],p=c[1];a.insert(f),s[f]=p}return a.finish(),r.fields=t.fields,r.fieldVectors=i,r.invertedIndex=s,r.tokenSet=a.root,r.pipeline=u,new e.Index(r)},e.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=e.tokenizer,this.pipeline=new e.Pipeline,this.searchPipeline=new e.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},e.Builder.prototype.ref=function(e){this._ref=e},e.Builder.prototype.field=function(e,t){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},e.Builder.prototype.b=function(e){e<0?this._b=0:e>1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s<n.length;s++){var o=n[s],a=this._fields[o].extractor,u=a?a(t):t[o],l=this.tokenizer(u,{fields:[o]}),c=this.pipeline.run(l),h=new e.FieldRef(i,o),d=Object.create(null);this.fieldTermFrequencies[h]=d,this.fieldLengths[h]=0,this.fieldLengths[h]+=c.length;for(var f=0;f<c.length;f++){var p=c[f];if(void 0==d[p]&&(d[p]=0),d[p]+=1,void 0==this.invertedIndex[p]){var y=Object.create(null);y._index=this.termIndex,this.termIndex+=1;for(var m=0;m<n.length;m++)y[n[m]]=Object.create(null);this.invertedIndex[p]=y}void 0==this.invertedIndex[p][o][i]&&(this.invertedIndex[p][o][i]=Object.create(null));for(var v=0;v<this.metadataWhitelist.length;v++){var g=this.metadataWhitelist[v],x=p.metadata[g];void 0==this.invertedIndex[p][o][i][g]&&(this.invertedIndex[p][o][i][g]=[]),this.invertedIndex[p][o][i][g].push(x)}}}},e.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),r=t.length,i={},n={},s=0;s<r;s++){var o=e.FieldRef.fromString(t[s]),a=o.fieldName;n[a]||(n[a]=0),n[a]+=1,i[a]||(i[a]=0),i[a]+=this.fieldLengths[o]}for(var u=Object.keys(this._fields),s=0;s<u.length;s++){var l=u[s];i[l]=i[l]/n[l]}this.averageFieldLength=i},e.Builder.prototype.createFieldVectors=function(){for(var t={},r=Object.keys(this.fieldTermFrequencies),i=r.length,n=Object.create(null),s=0;s<i;s++){for(var o=e.FieldRef.fromString(r[s]),a=o.fieldName,u=this.fieldLengths[o],l=new e.Vector,c=this.fieldTermFrequencies[o],h=Object.keys(c),d=h.length,f=this._fields[a].boost||1,p=this._documents[o.docRef].boost||1,y=0;y<d;y++){var m,v,g,x=h[y],w=c[x],Q=this.invertedIndex[x]._index;void 0===n[x]?(m=e.idf(this.invertedIndex[x],this.documentCount),n[x]=m):m=n[x],v=m*((this._k1+1)*w)/(this._k1*(1-this._b+this._b*(u/this.averageFieldLength[a]))+w),v*=f,v*=p,g=Math.round(1e3*v)/1e3,l.insert(Q,g)}t[o]=l}this.fieldVectors=t},e.Builder.prototype.createTokenSet=function(){this.tokenSet=e.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},e.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new e.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},e.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},e.MatchData=function(e,t,r){for(var i=Object.create(null),n=Object.keys(r||{}),s=0;s<n.length;s++){var o=n[s];i[o]=r[o].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=i)},e.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),r=0;r<t.length;r++){var i=t[r],n=Object.keys(e.metadata[i]);void 0==this.metadata[i]&&(this.metadata[i]=Object.create(null));for(var s=0;s<n.length;s++){var o=n[s],a=Object.keys(e.metadata[i][o]);void 0==this.metadata[i][o]&&(this.metadata[i][o]=Object.create(null));for(var u=0;u<a.length;u++){var l=a[u];void 0==this.metadata[i][o][l]?this.metadata[i][o][l]=e.metadata[i][o][l]:this.metadata[i][o][l]=this.metadata[i][o][l].concat(e.metadata[i][o][l])}}}},e.MatchData.prototype.add=function(e,t,r){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=r);if(!(t in this.metadata[e]))return void(this.metadata[e][t]=r);for(var i=Object.keys(r),n=0;n<i.length;n++){var s=i[n];s in this.metadata[e][t]?this.metadata[e][t][s]=this.metadata[e][t][s].concat(r[s]):this.metadata[e][t][s]=r[s]}},e.Query=function(e){this.clauses=[],this.allFields=e},e.Query.wildcard=new String("*"),e.Query.wildcard.NONE=0,e.Query.wildcard.LEADING=1,e.Query.wildcard.TRAILING=2,e.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},e.Query.prototype.clause=function(t){return"fields"in t||(t.fields=this.allFields),"boost"in t||(t.boost=1),"usePipeline"in t||(t.usePipeline=!0),"wildcard"in t||(t.wildcard=e.Query.wildcard.NONE),t.wildcard&e.Query.wildcard.LEADING&&t.term.charAt(0)!=e.Query.wildcard&&(t.term="*"+t.term),t.wildcard&e.Query.wildcard.TRAILING&&t.term.slice(-1)!=e.Query.wildcard&&(t.term=""+t.term+"*"),"presence"in t||(t.presence=e.Query.presence.OPTIONAL),this.clauses.push(t),this},e.Query.prototype.isNegated=function(){for(var t=0;t<this.clauses.length;t++)if(this.clauses[t].presence!=e.Query.presence.PROHIBITED)return!1;return!0},e.Query.prototype.term=function(t,r){if(Array.isArray(t))return t.forEach(function(t){this.term(t,e.utils.clone(r))},this),this;var i=r||{};return i.term=t.toString(),this.clause(i),this},e.QueryParseError=function(e,t,r){this.name="QueryParseError",this.message=e,this.start=t,this.end=r},e.QueryParseError.prototype=new Error,e.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},e.QueryLexer.prototype.run=function(){for(var t=e.QueryLexer.lexText;t;)t=t(this)},e.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],e.push(this.str.slice(t,r)),t=r+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},e.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},e.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},e.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos<this.length},e.QueryLexer.EOS="EOS",e.QueryLexer.FIELD="FIELD",e.QueryLexer.TERM="TERM",e.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",e.QueryLexer.BOOST="BOOST",e.QueryLexer.PRESENCE="PRESENCE",e.QueryLexer.lexField=function(t){return t.backup(),t.emit(e.QueryLexer.FIELD),t.ignore(),e.QueryLexer.lexText},e.QueryLexer.lexTerm=function(t){if(t.width()>1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}();
29,510
12,713
import React from 'react'; import styled from '@emotion/styled'; import Tile from '../Tile'; import { getAvatarById } from '../../shared/avatars'; import { StyledText, transparent } from '../../design/shared-styles'; import { useSelector } from 'react-redux'; const TileUserProfile = () => { const isConnected = useSelector((state) => state.chat.isConnected); const user = useSelector((state) => state.chat.user); const avatar = getAvatarById(user.avatarId); return ( <Tile appearance={transparent}> <AvatarWrapper> <Avatar image={avatar.image} isConnected={isConnected} role="img" aria-label={avatar.name} /> </AvatarWrapper> <Username>{user.username}</Username> <Brand>Mediaan Masterclass 2020</Brand> </Tile> ); }; export default TileUserProfile; const AvatarWrapper = styled.div` display: flex; margin-bottom: ${({ theme }) => theme.spacing.md}; `; const Avatar = styled.div` position: relative; width: 100px; height: 100px; margin: 0 auto; border-radius: 50%; background-image: ${({ image }) => `url('${image}')`}; background-size: cover; background-position: center; &:after { content: ''; z-index: 1; position: absolute; top: 0; right: -10px; display: block; width: 30px; height: 30px; border: 7px solid ${({ theme }) => theme.color.background}; border-radius: 50%; background-color: ${({ isConnected, theme }) => (isConnected ? theme.color.lima : theme.color.rose)}; } `; const Username = styled(StyledText)` margin-bottom: ${({ theme }) => theme.spacing.sm}; text-align: center; color: ${({ theme }) => theme.color.white}; `; const Brand = styled.p` font-size: 0.8rem; line-height: 1.2rem; text-align: center; color: ${({ theme }) => theme.color.sapphire}; `;
1,809
644
import { useStaticQuery, graphql } from "gatsby" export default assetUrl => { const { allContentfulAsset } = useStaticQuery(graphql` query { allContentfulAsset { nodes { file { url } fluid(maxWidth: 785) { ...GatsbyContentfulFluid_withWebp } } } } `) return allContentfulAsset.nodes.find(n => n.file.url === assetUrl).fluid }
483
136
import React, { Component } from "react"; import { requireNativeComponent, View, UIManager, findNodeHandle, DeviceEventEmitter } from "react-native"; import PropTypes from "prop-types"; class SketchView extends Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.subscriptions = []; } onChange(event) { console.log("save event: ", event.nativeEvent); if (event.nativeEvent.type === "onSaveSketch") { if (!this.props.onSaveSketch) { return; } this.props.onSaveSketch({ localFilePath: event.nativeEvent.event.localFilePath, imageWidth: event.nativeEvent.event.imageWidth, imageHeight: event.nativeEvent.event.imageHeight }); } } componentDidMount() { if (this.props.onSaveSketch) { let sub = DeviceEventEmitter.addListener( "onSaveSketch", this.props.onSaveSketch ); this.subscriptions.push(sub); } } componentWillUnmount() { this.subscriptions.forEach(sub => sub.remove()); this.subscriptions = []; } render() { return <RNSketchView {...this.props} onChange={this.onChange} />; } clearSketch() { UIManager.dispatchViewManagerCommand( findNodeHandle(this), UIManager.RNSketchView.Commands.clearSketch, [] ); } saveSketch() { UIManager.dispatchViewManagerCommand( findNodeHandle(this), UIManager.RNSketchView.Commands.saveSketch, [] ); } changeTool(toolId) { UIManager.dispatchViewManagerCommand( findNodeHandle(this), UIManager.RNSketchView.Commands.changeTool, [toolId] ); } } SketchView.constants = { toolType: { pen: { id: 0, name: "Pen" }, eraser: { id: 1, name: "Eraser" } } }; SketchView.propTypes = { ...View.propTypes, // include the default view properties selectedTool: PropTypes.number, localSourceImagePath: PropTypes.string }; let RNSketchView = requireNativeComponent("RNSketchView", SketchView, { nativeOnly: { onChange: true } }); export default SketchView;
2,133
712
export const AMOUNT = 10; export const TYPES = ['multiple', 'boolean']; export const DIFFICULTIES = ['easy', 'medium', 'hard']; export const ANSWER_VALUE = 100;
161
60
const authenticationMiddleware = require("./authn"); const corsMiddleware = require("./cors"); module.exports = { azureAuth: authenticationMiddleware, cors: corsMiddleware }
183
50
/* eslint-disable no-console */ 'use strict'; // const install = require('./install') const runCmd = require('./runCmd'); const getBabelCommonConfig = require('./getBabelCommonConfig'); const merge2 = require('merge2'); const { execSync } = require('child_process'); const through2 = require('through2'); const transformLess = require('./transformLess'); const webpack = require('webpack'); const babel = require('gulp-babel'); const argv = require('minimist')(process.argv.slice(2)); const { Octokit } = require('@octokit/rest'); const packageJson = require(`${process.cwd()}/package.json`); // const getNpm = require('./getNpm') // const selfPackage = require('../package.json') const chalk = require('chalk'); const getNpmArgs = require('./utils/get-npm-args'); const getChangelog = require('./utils/getChangelog'); const path = require('path'); // const watch = require('gulp-watch') const gulp = require('gulp'); const fs = require('fs'); const rimraf = require('rimraf'); const replaceLib = require('./replaceLib'); const stripCode = require('gulp-strip-code'); const compareVersions = require('compare-versions'); const cwd = process.cwd(); const libDir = path.join(cwd, 'lib'); const esDir = path.join(cwd, 'es'); function dist(done) { rimraf.sync(path.join(cwd, 'dist')); process.env.RUN_ENV = 'PRODUCTION'; const webpackConfig = require(path.join(cwd, 'webpack.build.conf.js')); webpack(webpackConfig, (err, stats) => { if (err) { console.error(err.stack || err); if (err.details) { console.error(err.details); } return; } const info = stats.toJson(); if (stats.hasErrors()) { console.error(info.errors); } if (stats.hasWarnings()) { console.warn(info.warnings); } const buildInfo = stats.toString({ colors: true, children: true, chunks: false, modules: false, chunkModules: false, hash: false, version: false, }); console.log(buildInfo); done(0); }); } function babelify(js, modules) { const babelConfig = getBabelCommonConfig(modules); babelConfig.babelrc = false; delete babelConfig.cacheDirectory; if (modules === false) { babelConfig.plugins.push(replaceLib); } let stream = js.pipe(babel(babelConfig)).pipe( through2.obj(function z(file, encoding, next) { this.push(file.clone()); if (file.path.match(/\/style\/index\.(js|jsx)$/)) { const content = file.contents.toString(encoding); file.contents = Buffer.from( content.replace(/\/style\/?'/g, "/style/css'").replace(/\.less/g, '.css'), ); file.path = file.path.replace(/index\.(js|jsx)$/, 'css.js'); this.push(file); next(); } else { next(); } }), ); if (modules === false) { stream = stream.pipe( stripCode({ start_comment: '@remove-on-es-build-begin', end_comment: '@remove-on-es-build-end', }), ); } return stream.pipe(gulp.dest(modules === false ? esDir : libDir)); } function compile(modules) { rimraf.sync(modules !== false ? libDir : esDir); const less = gulp .src(['components/**/*.less']) .pipe( through2.obj(function(file, encoding, next) { this.push(file.clone()); if ( file.path.match(/\/style\/index\.less$/) || file.path.match(/\/style\/v2-compatible-reset\.less$/) ) { transformLess(file.path) .then(css => { file.contents = Buffer.from(css); file.path = file.path.replace(/\.less$/, '.css'); this.push(file); next(); }) .catch(e => { console.error(e); }); } else { next(); } }), ) .pipe(gulp.dest(modules === false ? esDir : libDir)); const assets = gulp .src(['components/**/*.@(png|svg)']) .pipe(gulp.dest(modules === false ? esDir : libDir)); const source = ['components/**/*.js', 'components/**/*.jsx', '!components/*/__tests__/*']; const jsFilesStream = babelify(gulp.src(source), modules); return merge2([less, jsFilesStream, assets]); } function tag() { console.log('tagging'); const { version } = packageJson; execSync(`git config --global user.email ${process.env.GITHUB_USER_EMAIL}`); execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`); execSync(`git tag ${version}`); execSync( `git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`, ); execSync( `git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git master:master`, ); console.log('tagged'); } function githubRelease(done) { const changlogFiles = [ path.join(cwd, 'CHANGELOG.en-US.md'), path.join(cwd, 'CHANGELOG.zh-CN.md'), ]; console.log('creating release on GitHub'); if (!process.env.GITHUB_TOKEN) { console.log('no GitHub token found, skip'); return; } if (!changlogFiles.every(file => fs.existsSync(file))) { console.log('no changelog found, skip'); return; } const github = new Octokit({ auth: process.env.GITHUB_TOKEN, }); const date = new Date(); const { version } = packageJson; const enChangelog = getChangelog(changlogFiles[0], version); const cnChangelog = getChangelog(changlogFiles[1], version); const changelog = [ `\`${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}\``, enChangelog, '\n', '---', '\n', cnChangelog, ].join('\n'); const [_, owner, repo] = execSync('git remote get-url origin') // eslint-disable-line .toString() .match(/github.com[:/](.+)\/(.+)\.git/); github.repos .createRelease({ owner, repo, tag_name: version, name: version, body: changelog, }) .then(() => { done(); }); } gulp.task( 'tag', gulp.series(done => { tag(); githubRelease(done); }), ); gulp.task( 'check-git', gulp.series(done => { runCmd('git', ['status', '--porcelain'], (code, result) => { if (/^\?\?/m.test(result)) { return done(`There are untracked files in the working tree.\n${result} `); } if (/^([ADRM]| [ADRM])/m.test(result)) { return done(`There are uncommitted changes in the working tree.\n${result} `); } return done(); }); }), ); function publish(tagString, done) { let args = ['publish', '--with-antd-tools']; if (tagString) { args = args.concat(['--tag', tagString]); } const publishNpm = process.env.PUBLISH_NPM_CLI || 'npm'; runCmd(publishNpm, args, code => { tag(); githubRelease(() => { done(code); }); }); } function pub(done) { dist(code => { if (code) { done(code); return; } const notOk = !packageJson.version.match(/^\d+\.\d+\.\d+$/); let tagString; if (argv['npm-tag']) { tagString = argv['npm-tag']; } if (!tagString && notOk) { tagString = 'next'; } if (packageJson.scripts['pre-publish']) { runCmd('npm', ['run', 'pre-publish'], code2 => { if (code2) { done(code2); return; } publish(tagString, done); }); } else { publish(tagString, done); } }); } gulp.task( 'compile-with-es', gulp.series(done => { compile(false).on('finish', function() { done(); }); }), ); gulp.task( 'compile', gulp.series('compile-with-es', done => { compile().on('finish', function() { done(); }); }), ); gulp.task( 'dist', gulp.series('compile', done => { dist(done); }), ); gulp.task( 'pub', gulp.series('check-git', 'compile', done => { // if (!process.env.GITHUB_TOKEN) { // console.log('no GitHub token found, skip'); // } else { // pub(done); // } pub(done); }), ); gulp.task( 'pub-with-ci', gulp.series(done => { if (!process.env.NPM_TOKEN) { console.log('no NPM token found, skip'); } else { const github = new Octokit({ auth: process.env.GITHUB_TOKEN, }); const [_, owner, repo] = execSync('git remote get-url origin') // eslint-disable-line .toString() .match(/github.com[:/](.+)\/(.+)\.git/); const getLatestRelease = github.repos.getLatestRelease({ owner, repo, }); const listCommits = github.repos.listCommits({ owner, repo, per_page: 1, }); Promise.all([getLatestRelease, listCommits]).then(([latestRelease, commits]) => { const preVersion = latestRelease.data.tag_name; const { version } = packageJson; const [_, newVersion] = commits.data[0].commit.message.trim().match(/bump (.+)/) || []; // eslint-disable-line if ( compareVersions(version, preVersion) === 1 && newVersion && newVersion.trim() === version ) { // eslint-disable-next-line no-unused-vars runCmd('npm', ['run', 'pub'], code => { done(); }); } else { console.log('donot need publish' + version); } }); } }), ); gulp.task( 'guard', gulp.series(done => { function reportError() { console.log(chalk.bgRed('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')); console.log(chalk.bgRed('!! `npm publish` is forbidden for this package. !!')); console.log(chalk.bgRed('!! Use `npm run pub` instead. !!')); console.log(chalk.bgRed('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')); } const npmArgs = getNpmArgs(); if (npmArgs) { for (let arg = npmArgs.shift(); arg; arg = npmArgs.shift()) { if (/^pu(b(l(i(sh?)?)?)?)?$/.test(arg) && npmArgs.indexOf('--with-antd-tools') < 0) { reportError(); done(1); return; } } } done(); }), );
9,966
3,408
import fs from 'fs-extra' import path from 'path' import {coreUtils, config, Handlebars, User} from '../../../../cli' var route = function route(req, res) { var resHtml = '' var page = path.join(__dirname + '/../../../views/users/profile.html') if (coreUtils.file.exist(page)) { resHtml = fs.readFileSync(page, 'utf8') } var template = Handlebars.compile(resHtml, {noEscape: true}) var userEditable = JSON.parse(JSON.stringify(res.user)) delete userEditable.password delete userEditable.role delete userEditable.id delete userEditable.actif var tmp = template({ csrfToken: res.locals.csrfToken, config: config, userEditable: userEditable, express: { req: req, res: res }, info: req.flash('info'), error: req.flash('error'), isProfile: true, user: res.user, manager: { config: JSON.stringify(config) } }) return res.send(tmp) } export default route
948
321
import React from "react"; import { Wave } from "react-animated-text"; import { Link } from "react-scroll"; import TravisCI from "../../pages/images/TravisCI-Mascot-2.png"; import "./style.css"; const style = { removeUnderline: { textDecoration: "none", }, }; function NavBar() { return ( <header className="row align-items-center py-3"> <div className="col-sm-12 col-md-6"> <a className="d-flex justify-content-center" href="https://travis-ci.com/github/lfernandez79/reactPortfolio" style={style.removeUnderline}> <img id="radius" src={TravisCI} style={{ width: "5%", height: "5%" }} alt="TravisCI" /> <span> &nbsp; CI/CD! </span> </a> </div> <nav className="col-sm-12 col-md-6"> <ul className="nav d-flex justify-content-around"> <li className="nav-item"> <Link to="About" duration={500} smooth className="nav-link" href="/"><Wave text="About" effect="stretch" effectChange={2.0} /></Link> </li> <li className="nav-item"> <Link to="Projtcs" duration={500} smooth className="nav-link" href="/"><Wave text="Portfolio" effect="stretch" effectChange={2.0} /></Link> </li> <li className="nav-item"> <Link to="Contact" duration={500} smooth className="nav-link" href="/"><Wave text="Contact" effect="stretch" effectChange={2.0} /></Link> </li> </ul> </nav> </header> ); } export default NavBar;
1,514
502
var seeProcessorFn = require('../processors/transfer-see'); describe('transfer-see', function() { var seeProcessor; beforeEach(function() { seeProcessor = seeProcessorFn(); }); var transferSee = function(docs) { seeProcessor.$process(docs); }; it('should put @see info in the description', function() { var doc = { description: '', see: ['greetings.HelloWorld'] }; transferSee([doc]); expect(doc.description).toBe('See {@link greetings.HelloWorld}'); }); it('should append @see info to the description', function() { var doc = { description: 'Hello, World', see: ['greetings.HelloWorld'] }; transferSee([doc]); expect(doc.description).toBe('Hello, World<br />See {@link greetings.HelloWorld}'); }); it('should handle multiple @see tags', function() { var doc = { description: '', see: ['greetings.HelloWorld', 'greetings.HolaMundo'] }; transferSee([doc]); expect(doc.description).toBe('See {@link greetings.HelloWorld}<br />' + 'See {@link greetings.HolaMundo}'); }); it('should handle information after @see tag', function() { var doc = { description: '', see: ['greetings.HelloWorld\n\nHello, World'] }; transferSee([doc]); expect(doc.description).toBe('See {@link greetings.HelloWorld}<br />Hello, World'); }); });
1,380
435
(this["webpackJsonpinventory-management-system"]=this["webpackJsonpinventory-management-system"]||[]).push([[3],{402:function(t,e,n){"use strict";n.r(e),n.d(e,"getCLS",(function(){return p})),n.d(e,"getFCP",(function(){return g})),n.d(e,"getFID",(function(){return F})),n.d(e,"getLCP",(function(){return k})),n.d(e,"getTTFB",(function(){return C}));var i,a,r,o,c=function(t,e){return{name:t,value:void 0===e?-1:e,delta:0,entries:[],id:"v1-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},u=function(t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((function(t){return t.getEntries().map(e)}));return n.observe({type:t,buffered:!0}),n}}catch(t){}},s=function(t,e){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(t(i),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},f=function(t){addEventListener("pageshow",(function(e){e.persisted&&t(e)}),!0)},m="function"==typeof WeakSet?new WeakSet:new Set,d=function(t,e,n){var i;return function(){e.value>=0&&(n||m.has(e)||"hidden"===document.visibilityState)&&(e.delta=e.value-(i||0),(e.delta||void 0===i)&&(i=e.value,t(e)))}},p=function(t,e){var n,i=c("CLS",0),a=function(t){t.hadRecentInput||(i.value+=t.value,i.entries.push(t),n())},r=u("layout-shift",a);r&&(n=d(t,i,e),s((function(){r.takeRecords().map(a),n()})),f((function(){i=c("CLS",0),n=d(t,i,e)})))},v=-1,l=function(){return"hidden"===document.visibilityState?0:1/0},h=function(){s((function(t){var e=t.timeStamp;v=e}),!0)},y=function(){return v<0&&(v=l(),h(),f((function(){setTimeout((function(){v=l(),h()}),0)}))),{get timeStamp(){return v}}},g=function(t,e){var n,i=y(),a=c("FCP"),r=u("paint",(function(t){"first-contentful-paint"===t.name&&(r&&r.disconnect(),t.startTime<i.timeStamp&&(a.value=t.startTime,a.entries.push(t),m.add(a),n()))}));r&&(n=d(t,a,e),f((function(i){a=c("FCP"),n=d(t,a,e),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,m.add(a),n()}))}))})))},S={passive:!0,capture:!0},w=new Date,E=function(t,e){i||(i=e,a=t,r=new Date,b(removeEventListener),L())},L=function(){if(a>=0&&a<r-w){var t={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+a};o.forEach((function(e){e(t)})),o=[]}},T=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var n=function(){E(t,e),a()},i=function(){a()},a=function(){removeEventListener("pointerup",n,S),removeEventListener("pointercancel",i,S)};addEventListener("pointerup",n,S),addEventListener("pointercancel",i,S)}(e,t):E(e,t)}},b=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,T,S)}))},F=function(t,e){var n,r=y(),p=c("FID"),v=function(t){t.startTime<r.timeStamp&&(p.value=t.processingStart-t.startTime,p.entries.push(t),m.add(p),n())},l=u("first-input",v);n=d(t,p,e),l&&s((function(){l.takeRecords().map(v),l.disconnect()}),!0),l&&f((function(){var r;p=c("FID"),n=d(t,p,e),o=[],a=-1,i=null,b(addEventListener),r=v,o.push(r),L()}))},k=function(t,e){var n,i=y(),a=c("LCP"),r=function(t){var e=t.startTime;e<i.timeStamp&&(a.value=e,a.entries.push(t)),n()},o=u("largest-contentful-paint",r);if(o){n=d(t,a,e);var p=function(){m.has(a)||(o.takeRecords().map(r),o.disconnect(),m.add(a),n())};["keydown","click"].forEach((function(t){addEventListener(t,p,{once:!0,capture:!0})})),s(p,!0),f((function(i){a=c("LCP"),n=d(t,a,e),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,m.add(a),n()}))}))}))}},C=function(t){var e,n=c("TTFB");e=function(){try{var e=performance.getEntriesByType("navigation")[0]||function(){var t=performance.timing,e={entryType:"navigation",startTime:0};for(var n in t)"navigationStart"!==n&&"toJSON"!==n&&(e[n]=Math.max(t[n]-t.navigationStart,0));return e}();n.value=n.delta=e.responseStart,n.entries=[e],t(n)}catch(t){}},"complete"===document.readyState?setTimeout(e,0):addEventListener("pageshow",e)}}}]); //# sourceMappingURL=3.1f9f47dc.chunk.js.map
4,261
1,791
/* eslint-disable linebreak-style */ // ====================================================================== // Some Assembly Required // Advent of Code 2015 Day 07 -- Eric Wastl -- https://adventofcode.com // // Javascript implementation by Dr. Dean Earl Wright III // ====================================================================== // ====================================================================== // a o c _ 0 7 . j s // // Solve the Advent of Code 2015 day 07 problem // ====================================================================== // ---------------------------------------------------------------------- // import // ---------------------------------------------------------------------- const yargs = require('yargs'); const fs = require('fs'); const process = require('process'); const gates = require('./gates'); // ---------------------------------------------------------------------- // parseCommndLine // ---------------------------------------------------------------------- function parseCommandLine() { // Parse the command line options" // 1. Create the command line parser const { argv } = yargs .command('aoc_07', 'Some Assembly Required - Day 07 of Advent of Code 2015', { }) .option('verbose', { alias: 'v', default: false, describe: 'Print status messages to stdout', type: 'boolean', }) .option('part', { alias: 'p', default: 1, describe: 'Puzzle Part (1 or 2)', type: 'number', }) .option('limit', { alias: 'l', default: 0, describe: 'Maximum limit (e.g., time, size, recursion) before stopping', type: 'number', }) .option('filepath', { alias: 'f', default: 'input.txt', describe: 'Location of puzzle input', type: 'string', }) .example('$0 -p 1 input.txt', 'Solve part one of the puzzle') .help() .alias('help', 'h'); // 2. Get the options and arguments return argv; } // ---------------------------------------------------------------------- // partOne // ---------------------------------------------------------------------- function partOne(args, inputLines) { // Process part one of the puzzle // 1. Create the puzzle solver const solver = new gates.Gates({ part2: false, text: inputLines }); // 2. Determine the solution for part two const solution = solver.partOne({ verbose: args.verbose, limit: args.limit }); if (solution == null) { console.log('There is no solution for part one'); // eslint-disable-line no-console } else { console.log('The solution for part one is', solution); // eslint-disable-line no-console } // 3. Return result return solution != null; } // ---------------------------------------------------------------------- // partTwo // ---------------------------------------------------------------------- function partTwo(args, inputLines) { // Process part two of the puzzle // 1. Create the puzzle solver const solver = new gates.Gates({ part2: true, text: inputLines }); // 2. Determine the solution for part two const solution = solver.partTwo({ verbose: args.verbose, limit: args.limit }); if (solution == null) { console.log('There is no solution for part two'); // eslint-disable-line no-console } else { console.log('The solution for part two is', solution); // eslint-disable-line no-console } // 3. Return result return solution != null; } // ---------------------------------------------------------------------- // from_text // ---------------------------------------------------------------------- function fromText(text) { // Break the text into trimed, non-comment lines" // 1. We start with no lines const lines = []; // 2. Loop for lines in the text text.split(/\r?\n/).forEach((line) => { // 3. But ignore blank and non-claim lines const cleaned = line.trimEnd(); if (cleaned.length > 0 && !cleaned.startsWith('!')) { // 4. Add the line lines.push(cleaned); } }); // 5. Return a list of clean lines return lines; } // ---------------------------------------------------------------------- // from_file // ---------------------------------------------------------------------- function fromFile(filepath) { // Read the file try { const data = fs.readFileSync(filepath, 'utf8'); return fromText(data); } catch (e) { console.log('Error', e.stack); // eslint-disable-line no-console return ''; } } // ---------------------------------------------------------------------- // main // ---------------------------------------------------------------------- function main() { // Read the Advent of Code problem and solve it let result = null; // 1. Get the command line options const argv = parseCommandLine(); // 2. Read the puzzle file const inputText = fromFile(argv.filepath); // 3. Process the appropiate part of the puzzle if (argv.part === 1) { result = partOne(argv, inputText); } else { result = partTwo(argv, inputText); } // 5. Set return code (0 if solution found, 2 if not) if (result != null) { process.exit(0); } process.exit(2); } // ---------------------------------------------------------------------- // module initialization // ---------------------------------------------------------------------- if (typeof require !== 'undefined' && require.main === module) { main(); } // ---------------------------------------------------------------------- // export // ---------------------------------------------------------------------- module.exports.fromText = fromText; // ====================================================================== // end a o c _ 0 7 . j s end // ======================================================================
6,434
1,585
/* eslint-disable no-unused-vars */ /* eslint-disable no-undef */ const assert = require("assert"); const should = require("should"); const rewire = require("rewire"); const buildPackageModule = rewire("../app/jobs/buildPackage"); const filterRemoteTags = buildPackageModule.__get__("filterRemoteTags"); describe("app/jobs/buildPackage.js", function() { describe("filterRemoteTags()", function() { it("simple", function() { let names = filterRemoteTags([ { tag: "1.0.2", commit: "0000010" }, { tag: "patch", commit: "0000009" }, { tag: "1.0.0", commit: "0000008" }, { tag: "0.8.0-preview", commit: "0000006" } ]); names.should.deepEqual([ { commit: "0000010", tag: "1.0.2" }, { commit: "0000008", tag: "1.0.0" }, { commit: "0000006", tag: "0.8.0-preview" } ]); }); it("duplication 1", function() { let names = filterRemoteTags([ { tag: "1.0.2", commit: "0000010" }, { tag: "v1.0.2", commit: "0000009" } ]); names.should.deepEqual([ { commit: "0000010", tag: "1.0.2" } ]); }); it("duplication 2", function() { let names = filterRemoteTags([ { tag: "v1.0.2", commit: "0000010" }, { tag: "1.0.2", commit: "0000009" } ]); names.should.deepEqual([ { commit: "0000010", tag: "v1.0.2" } ]); }); it("ignore pattern", function() { let names = filterRemoteTags( [ { tag: "1.0.2-master", commit: "10" }, { tag: "1.0.2", commit: "09" }, { tag: "1.0.1-master", commit: "08" }, { tag: "1.0.1", commit: "07" } ], "-master$" ); names.should.deepEqual([ { tag: "1.0.2", commit: "09" }, { tag: "1.0.1", commit: "07" } ]); }); }); });
1,975
756
import React, { Fragment, useState } from 'react' import PropTypes from 'prop-types' // ES6 import { extent, max } from 'd3-array' import { scaleBand, scaleLinear, scaleTime } from 'd3-scale' import { line, curveCardinal } from 'd3-shape' import { timeMonth, timeDay } from 'd3-time' import { formatDate, formatNumber } from '~utilities/visualization' import Tooltip from './tooltip' import chartStyles from './charts.module.scss' import styles from './bar-chart.module.scss' import colors from '~scss/colors.module.scss' const BarChart = ({ data, lineData, refLineData, annotations, handleAnnotationClick, fill, lineColor, marginBottom, marginLeft, marginRight, marginTop, showTicks, width, height, yMax, yTicks, lastXTick, renderTooltipContents, perCapLabel, }) => { const [tooltip, setTooltip] = useState(null) // Used for tooltip optimization const [timeoutRef, setTimeoutRef] = useState(null) // Used when placing annotations const getValueForDate = date => { const dateData = data.find(d => d.date.getTime() === date.getTime()) return dateData && dateData.value } const totalXMargin = marginLeft + marginRight const totalYMargin = marginTop + marginBottom // The x range is over the area in which the chart should be displaying. // We don't use an X transform to place it in the correct spot, we use range // instead const xScale = scaleBand() .domain(data.map(d => d.date)) .range([marginLeft, width - marginRight]) .padding(0.1) const dateDomain = extent(data, d => d.date) // Should probably refactor to use a single x-axis scale // but the bars make use of the band. const xScaleTime = scaleTime() .domain(dateDomain) .range([marginLeft, width - marginRight]) const yMaxEffective = yMax || max([...data, ...(refLineData || [])], d => d.value) const yScale = scaleLinear() .domain([0, yMaxEffective]) .nice() .range([height - totalYMargin, 0]) const msInOneMonth = 2628000000 const monthlyTickInterval = Math.ceil( Math.abs((dateDomain[1] - dateDomain[0]) / (msInOneMonth * 6)), ) const xTickAmount = timeMonth.every(monthlyTickInterval) const yTicksThreshold = 4 const yTicksEffective = yTicks || yMaxEffective < yTicksThreshold ? yMaxEffective : yTicksThreshold const lastTime = xScaleTime.ticks(timeDay.every(1)).pop() let lineFn = null if (lineData) { lineFn = line() .defined(d => !Number.isNaN(d.value) && d.value !== null) .curve(curveCardinal) .x(d => xScaleTime(d.date)) .y(d => yScale(d.value)) } const hover = (event, d) => { // Ensure that tooltip doesn't flash when transitioning between bars if (timeoutRef) { clearTimeout(timeoutRef) } const isTouchEvent = !event.clientX const eventX = isTouchEvent ? event.touches[0].clientX : event.clientX const eventY = isTouchEvent ? event.touches[0].clientY : event.clientY setTooltip({ top: isTouchEvent ? eventY - 130 : eventY + 10, left: isTouchEvent ? eventX - 80 : eventX + 5, d, }) } const mouseOut = () => { if (timeoutRef) { clearTimeout(timeoutRef) } setTimeoutRef(setTimeout(() => setTooltip(null), 200)) } return ( <> <svg className={chartStyles.chart} viewBox={`0 0 ${width} ${height}`} aria-hidden > {/* y ticks */} <g transform={`translate(${marginLeft} ${marginTop})`}> {yScale.ticks(yTicksEffective).map( (tick, i) => i < showTicks && ( <g key={tick}> {/* Do not remove nested svg. See https://github.com/COVID19Tracking/website/pull/645#discussion_r411676987 */} <svg y={yScale(tick) + 6} x="-10" className={chartStyles.yTickLabel} > <text className={chartStyles.label}> {formatNumber(tick)} {tick > 0 && perCapLabel /* this only displays if passed */} </text> </svg> <line className={chartStyles.gridLine} x1={0} x2={width - totalXMargin} y1={yScale(tick)} y2={yScale(tick)} /> </g> ), )} </g> {/* x ticks (dates) */} <g transform={`translate(0, ${height - marginBottom})`}> {xScaleTime.ticks(xTickAmount).map(d => ( <Fragment key={`x-${d}`}> <text className={`${chartStyles.label} ${chartStyles.xTickLabel}`} key={d} x={xScaleTime(d)} y="20" >{`${formatDate(d)}`}</text> <line className={chartStyles.label} stroke={colors.colorSlate500} x1={xScaleTime(d)} y1="0" x2={xScaleTime(d)} y2="5" /> </Fragment> ))} {lastXTick && ( <> <text className={`${chartStyles.label} ${chartStyles.xTickLabel}`} x={xScaleTime(lastTime)} y="20" >{`${formatDate(lastTime)}`}</text> <line className={chartStyles.label} stroke={colors.colorSlate500} x1={xScaleTime(lastTime)} y1="0" x2={xScaleTime(lastTime)} y2="5" /> </> )} </g> <mask id="dataMask"> <rect x="0" y="0" width={width - marginRight} height={height - totalYMargin} fill="white" /> </mask> {/* data */} <g transform={`translate(0 ${marginTop})`} mask="url(#dataMask)"> {/* bars (data) */} {data.map(d => ( <rect key={d.date + d.value} x={xScale(d.date)} y={yScale(d.value)} height={yScale(0) - yScale(d.value)} width={xScale.bandwidth()} fillOpacity={lineData ? 1 : 0.8} fill={fill} className={renderTooltipContents && styles.interactiveBar} onMouseOver={event => hover(event, d)} onFocus={event => hover(event, d)} onMouseOut={mouseOut} onBlur={mouseOut} /> ))} {/* line */} {lineData && ( <path d={lineFn(lineData)} stroke={lineColor} strokeWidth="3" fill="none" /> )} {/* reference line */} {refLineData && ( <path d={lineFn(refLineData)} stroke="black" strokeWidth="2" strokeDasharray="4" fill="none" /> )} </g> {/* annotations */} {annotations && ( <g transform={`translate(0 ${marginTop})`}> {annotations .filter( annotation => xScaleTime(annotation.date) >= xScaleTime(dateDomain[0]) && xScaleTime(annotation.date) <= xScaleTime(dateDomain[1]), ) .map(d => ( <svg key={d} width="20" height="24" x={xScaleTime(d.date) - 11} y={ yScale( getValueForDate(d.date) > 10 ? getValueForDate(d.date) : 10, ) - 26 } viewBox="0 0 20 24" fill="none" xmlns="http://www.w3.org/2000/svg" onClick={handleAnnotationClick} style={{ cursor: 'pointer' }} className={styles.annotationBubbleSvg} pointerEvents="bounding-box" > <mask id="path-1-inside-1" fill="white"> <path fillRule="evenodd" clipRule="evenodd" d="M3 0C1.34315 0 0 1.34314 0 3V16.9412C0 18.5981 1.34315 19.9412 3 19.9412H6.17188L10.2426 24L14.3134 19.9412H17C18.6569 19.9412 20 18.5981 20 16.9412V3C20 1.34315 18.6569 0 17 0H3Z" /> </mask> <rect x="0" y="0" height="32" width="20" className={styles.annotationBubbleSvgFill} mask="url(#path-1-inside-1)" /> <path d="M6.17188 19.9412L6.87794 19.2331L6.58523 18.9412H6.17188V19.9412ZM10.2426 24L9.53658 24.7081L10.2426 25.4121L10.9487 24.7081L10.2426 24ZM14.3134 19.9412V18.9412H13.9001L13.6073 19.2331L14.3134 19.9412ZM1 3C1 1.89543 1.89543 1 3 1V-1C0.790863 -1 -1 0.790856 -1 3H1ZM1 16.9412V3H-1V16.9412H1ZM3 18.9412C1.89543 18.9412 1 18.0458 1 16.9412H-1C-1 19.1503 0.790861 20.9412 3 20.9412V18.9412ZM6.17188 18.9412H3V20.9412H6.17188V18.9412ZM10.9487 23.2919L6.87794 19.2331L5.46581 20.6493L9.53658 24.7081L10.9487 23.2919ZM13.6073 19.2331L9.53658 23.2919L10.9487 24.7081L15.0195 20.6493L13.6073 19.2331ZM17 18.9412H14.3134V20.9412H17V18.9412ZM19 16.9412C19 18.0458 18.1046 18.9412 17 18.9412V20.9412C19.2091 20.9412 21 19.1503 21 16.9412H19ZM19 3V16.9412H21V3H19ZM17 1C18.1046 1 19 1.89543 19 3H21C21 0.790861 19.2091 -1 17 -1V1ZM3 1H17V-1H3V1Z" fill="black" mask="url(#path-1-inside-1)" /> <text fill="black" x="9.5" y="15" textAnchor="middle" style={{ fontSize: 13, fontWeight: 700 }} > {d.annotationSymbol} </text> </svg> ))} </g> )} </svg> {renderTooltipContents && tooltip && ( <Tooltip {...tooltip}>{renderTooltipContents(tooltip.d)} </Tooltip> )} </> ) } BarChart.defaultProps = { lineData: null, lineColor: 'black', refLineData: null, annotations: [], handleAnnotationClick: null, marginBottom: 0, marginLeft: 0, marginRight: 0, marginTop: 0, width: 300, height: 300, yMax: null, yTicks: null, showTicks: 4, renderTooltipContents: null, perCapLabel: null, } BarChart.propTypes = { data: PropTypes.arrayOf( PropTypes.shape({ date: PropTypes.instanceOf(Date).isRequired, /* value isn't required: state's may have started reporting a value _after_ the start date. (i.e. hospitalization values that have only been reported for the past 5 days) */ }), ).isRequired, lineData: PropTypes.arrayOf( PropTypes.shape({ date: PropTypes.instanceOf(Date).isRequired, /* value isn't required: state's may have started reporting a value _after_ the start date. (i.e. hospitalization values that have only been reported for the past 5 days) */ }), ), refLineData: PropTypes.arrayOf( PropTypes.shape({ date: PropTypes.instanceOf(Date).isRequired, value: PropTypes.number.isRequired, }), ), annotations: PropTypes.arrayOf( PropTypes.shape({ annotationSymbol: PropTypes.string.isRequired, date: PropTypes.instanceOf(Date).isRequired, value: PropTypes.number, }), ), handleAnnotationClick: PropTypes.func, // also requires chart Annotations to be present at #chart-annotations fill: PropTypes.string.isRequired, lineColor: PropTypes.string, width: PropTypes.number, height: PropTypes.number, marginBottom: PropTypes.number, marginLeft: PropTypes.number, marginRight: PropTypes.number, marginTop: PropTypes.number, showTicks: PropTypes.number, yMax: PropTypes.number, yTicks: PropTypes.number, renderTooltipContents: PropTypes.func, perCapLabel: PropTypes.string, } export default BarChart
12,358
4,430
function type(obj, type) { return Object.prototype.toString.call(obj).slice(8, -1).toLocaleLowerCase() === type; } export const assert = [ 'String', 'Object', 'Function', 'Array' ].reduce((init, key) => { init['is' + key] = function(target) { return type(target, key.toLocaleLowerCase()); }; return init; }, {});
337
123
'use strict'; const names = ['bag', 'banana', 'bathroom', 'boots', 'breakfast', 'bubblegum', 'chair', 'cthulhu', 'dog-duck', 'dragon', 'pen', 'pet-sweep', 'scissors', 'shark', 'sweep', 'tauntaun', 'unicorn', 'usb', 'water-can', 'wine-glass']; const leftImage = document.getElementById(`left`); const centerImage = document.getElementById(`center`); const rightImage = document.getElementById(`right`); let allProducts = []; const container = document.getElementById(`image_container`); const viewed = []; const labels = []; const pics = [leftImage, centerImage, rightImage]; const list = document.getElementById(`productlist`); let totalClicks = 0; let views = []; let votes = []; function Product(name) { this.name = name; this.path = `img/` + name + `.jpg`; this.votes = 0; this.views = 0; allProducts.push(this); } function makeRandom() { return Math.floor(Math.random() * names.length); } function displayPics(){ while(viewed.length < 6){ const rando = makeRandom(); while(!viewed.includes(rando)){ viewed.push(rando); } } // console.log(rando); // TODO: In a sentence or two, explain why the previous line of code threw an error when we changed the variable declaration from `var to `let`. // PUT YOUR RESPONSE IN THIS COMMENT : 'let' declaration works only in the same block (LOCALY) so if we use it outside its scope it will throw an error but the 'var' declaration its a global scope works even if we use it outside the block console.log(viewed); for (let i = 0; i < 3; i++){ const temp = viewed.shift(); pics[i].src = allProducts[temp].path; pics[i].id = allProducts[temp].name; allProducts[temp].views += 1; } } function handleClick(event) { if (event.target.id === `image_container`) { return alert('Be sure to click directly on an image!!'); } totalClicks += 1; if(totalClicks > 24) { container.removeEventListener(`click`, handleClick); container.style.display = `none`; showList(); makeChart(); } for(let i = 0; i < names.length; i++){ if(event.target.id === allProducts[i].name) { allProducts[i].votes += 1; console.log(event.target.id + ` has ` + allProducts[i].votes + ` votes in ` + allProducts[i].views + ` views`); } } localStorage.busmall = JSON.stringify(allProducts); localStorage.busmallProducts = JSON.stringify(allProducts); displayPics(); } function showList() { for(let i = 0; i < allProducts.length; i++) { const liEl = document.createElement('li'); liEl.textContent = allProducts[i].name + ` has ` + allProducts[i].votes + ` votes in ` + allProducts[i].views + ` views`; list.appendChild(liEl); } } function makeChartData(){ allProducts.forEach(function(product){ labels.push(product.name); votes.push(product.votes); views.push(product.views); }); } function makeChart(){ makeChartData(); const ctx = document.getElementById('chartypants').getContext('2d'); new Chart(ctx, { //eslint-disable-line type: 'bar', data: { labels: labels, datasets: [{ label: 'total votes', backgroundColor: 'gold', borderColor: '#214', data: votes, }] }, options: { responsive: false, scales: { yAxes: [{ ticks: { max: 20, min: 0, stepSize: 1 } }] } } }); Chart.defaults.global.defaultFontColor = '#eee'; //eslint-disable-line } container.addEventListener('click', handleClick); document.getElementById('bus').addEventListener('click', function(){ localStorage.removeItem('busmall'); console.log('Local storage was cleared!'); }); if(localStorage.busmall){ console.log('Local storage data exists'); allProducts = JSON.parse(localStorage.busmall); } else { console.log('There is no local storage data; initialize app by creating instances'); for(let i = 0; i < names.length; i++) { new Product(names[i]); } } displayPics();
4,125
1,340
import { isArray, addObject, findBy } from '@/utils/array'; const parseCache = {}; const OP_MAP = { '=': 'In', '==': 'In', '!=': 'NotIn', '<': 'Lt', '>': 'Gt', }; // Parse a labelSelector string export function parse(labelSelector) { // matchLabels: // comma-separated list, all rules ANDed together // spaces may be encoded as + // // Equals: foo = bar // Not Equals: bar != baz // Key Exists: optional.prefix/just-some-key // Key Doesn't: !optional.prefix/just-some-key // In Set: environment in (production,qa) // Not in Set: environment notin (production,qa) // Convert into matchExpressions, which newer resources support // and express the same things // // Object of: // key: optional.prefix/some-key // operator: In, NotIn, Exists, or DoesNotExist // values: [array, of, values, even, if, only, one] labelSelector = labelSelector.replace(/\+/g, ' '); if ( parseCache[labelSelector] ) { return parseCache[labelSelector]; } let match; const out = []; const parens = []; // Substitute out all the parenthetical lists because they might have commas in them match = labelSelector.match(/\([^)]+\)/g); if ( match && match.length ) { for ( const str of match ) { const val = str.replace(/^\s*\(\s*/, '').replace(/\s*\)\s*$/, '').split(/\s*,\s*/); parens.push(val); labelSelector = labelSelector.replace(str, ` @${ parens.length - 1 } `); } } const parts = labelSelector.split(/\s*,\s*/).filter(x => !!x); for ( let rule of parts ) { rule = rule.trim(); match = rule.match(/^(.*?)\s+((not\s*)?in)\s+@(\d+)*$/i); if ( match ) { out.push({ key: match[1].trim(), operator: match[2].toLowerCase().replace(/\s/g, '') === 'notin' ? 'NotIn' : 'In', values: parens[match[4].trim()], }); continue; } match = rule.match(/^([^!=]*)\s*(\!=|=|==|>|<)\s*([^!=]*)$/); if ( match ) { out.push({ key: match[1].trim(), operator: OP_MAP[match[2]], values: [match[3].trim()], }); continue; } if ( rule.startsWith('!') ) { out.push({ key: rule.substr(1).trim(), operator: 'DoesNotExist' }); continue; } out.push({ key: rule.trim(), operator: 'Exists' }); } parseCache[labelSelector] = out; return out; } // Convert a Selector object to matchExpressions export function convertSelectorObj(obj) { return convert(obj.matchLabels || {}, obj.matchExpressions || []); } // Convert matchLabels to matchExpressions // Optionally combining with an existing set of matchExpressions export function convert(matchLabelsObj, matchExpressions) { const keys = Object.keys(matchLabelsObj || {}); const out = matchExpressions || []; for ( const key of keys ) { const value = matchLabelsObj[key]; const existing = findBy(out, { key, operator: 'In' }); if ( existing ) { addObject(existing.values, value); } else { out.push({ key, operator: 'In', values: [value], }); } } return out; } // Convert matchExpressions to matchLabels when possible, // returning the simplest combination of them. export function simplify(matchExpressionsInput) { const matchLabels = {}; const matchExpressions = []; // Look for keys with more than one "In" expression and disqualify them from simplifying const impossible = []; const seen = {}; for ( const expr of matchExpressionsInput ) { if ( expr.operator !== 'In' ) { continue; } if ( seen[expr.key] ) { addObject(impossible, expr.key); } else { seen[expr.key] = true; } } for ( const expr of matchExpressionsInput ) { if ( expr.operator === 'In' && expr.values.length === 1 && !impossible.includes(expr.key) ) { matchLabels[expr.key] = expr.values[0]; } else { matchExpressions.push(Object.assign({}, expr)); } } return { matchLabels, matchExpressions }; } export function matches(obj, selector) { let rules = []; if ( typeof selector === 'string' ) { // labelSelector string rules = parse(selector); } else if ( isArray(selector) ) { // Already matchExpression rules = selector; } else if ( typeof selector === 'object' && selector ) { // matchLabels object rules = convert(selector); } else { return false; } const labels = obj?.metadata?.labels || {}; for ( const rule of rules ) { const value = labels[rule.key]; const asInt = parseInt(value, 10); const exists = typeof labels[rule.key] !== 'undefined'; switch ( rule.operator ) { case 'Exists': if ( !exists ) { return false; } break; case 'DoesNotExist': if ( exists ) { return false; } break; case 'In': if ( !value || !rule.values.length || !rule.values.includes(value) ) { return false; } break; case 'NotIn': if ( rule.values.includes(value) ) { return false; } break; case 'Lt': if ( isNaN(asInt) || asInt >= Math.min.apply(null, rule.values) ) { return false; } break; case 'Gt': if ( isNaN(asInt) || asInt <= Math.max.apply(null, rule.values) ) { return false; } break; } } return true; } export function matching(ary, selector) { return ary.filter(obj => matches(obj, selector)); }
5,506
1,811
/*! * Copyright (c) 2015-2017 Cisco Systems, Inc. See LICENSE file. */ import {registerInternalPlugin} from '@webex/webex-core'; import Search from './search'; import config from './config'; import {has} from 'lodash'; import '@webex/internal-plugin-encryption'; registerInternalPlugin('search', Search, { config, payloadTransformer: { predicates: [ { name: 'encryptSearchQuery', direction: 'outbound', test(ctx, options) { if (!has(options, 'body.query')) { return Promise.resolve(false); } if (!has(options, 'body.searchEncryptionKeyUrl')) { return Promise.resolve(false); } return ctx.spark.internal.device.isSpecificService('argonaut', options.service || options.url); }, extract(options) { return Promise.resolve(options.body); } }, { name: 'transformObjectArray', direction: 'inbound', test(ctx, response) { return Promise.resolve(has(response, 'body.activities.items[0].objectType')) .then((res) => res && ctx.spark.internal.device.isSpecificService('argonaut', response.options.service || response.options.uri)); }, extract(response) { return Promise.resolve(response.body.activities.items); } } ], transforms: [ { name: 'encryptSearchQuery', direction: 'outbound', fn(ctx, object) { return ctx.spark.internal.encryption.encryptText(object.searchEncryptionKeyUrl, object.query) .then((q) => { object.query = q; }); } } ] } }); export {default} from './search';
1,727
499
import React, { useEffect, useRef, useState } from 'react'; import { Row, Col } from 'react-bootstrap'; import Card from '@material-ui/core/Card'; import IconButton from '@material-ui/core/IconButton'; import PlayArrowIcon from '@material-ui/icons/PlayArrow'; import PauseIcon from '@material-ui/icons/Pause'; import { MDBProgress } from 'mdbreact'; import Slider from '@material-ui/core/Slider'; import VolumeUp from '@material-ui/icons/VolumeUp'; import Divider from '@material-ui/core/Divider'; import { makeStyles } from '@material-ui/core/styles'; import AudioUtil from '../../../utils/audio'; const useStyles = makeStyles((theme) => ({ slider: { padding: '3px', }, light: { backgroundColor: 'rgba(255, 255, 255, 0.1) !important', }, })); const useInterval = (callback, delay) => { const savedCallback = useRef(); useEffect(() => { savedCallback.current = callback; }, [callback]); useEffect(() => { const tick = () => savedCallback.current(); if (delay !== null) { const id = setInterval(tick, delay); return () => clearInterval(id); } }, [delay]); }; const Audio = () => { // const [disabled, setDisabled] = useState(true); const classes = useStyles(); const [song, setSong] = useState({}); const [value, setValue] = useState(0); const [timer, setTimer] = useState(null); const [audio, setAudio] = useState(null); const [volume, setVolume] = useState(5); const [current, setCurrent] = useState(null); const [playing, setPlaying] = useState(false); const [timeDisplay, setTimeDisplay] = useState('00:00'); useEffect(() => { const url = 'https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_5MG.mp3'; AudioUtil.loadSong(url).then((audiobuffer) => { if (audio) { audio.context.decodeAudioData( audiobuffer, (buffer) => { if (current !== null) { current.disconnect(); } const _current = audio.context.createBufferSource(); _current.buffer = buffer; setCurrent(_current); }, console.error ); } }); }, [audio]); useEffect(() => { if (current && audio) { current.connect(audio.analyser); audio.analyser.connect(audio.gainNode); audio.gainNode.connect(audio.context.destination); audio.node.connect(audio.context.destination); audio.gainNode.gain.value = volume / 10.0; if (song.when && song.offset) { current.start(song.when, song.offset); } else { current.start(0); } if (audio.context.state === 'suspended') { audio.context.resume(); } let offset = (new Date() - audio.created) / 1000; if (offset > audio.context.currentTime) { offset = audio.context.currentTime; } setSong({ offset, duration: current.buffer.duration }); setPlaying(true); } }, [current]); useInterval(() => { if ( audio && audio.context && audio.context.state !== 'suspended' && current ) { const time = audio.context.currentTime - song.offset; const seconds = parseInt(time || 0); const progress = 100.0 * (seconds / song.duration); setValue(progress); if (progress <= 100) { const min = Math.floor(seconds / 60); const sec = seconds - min * 60; setTimeDisplay( `${min < 10 ? `0${min}` : min}:${sec < 10 ? `0${sec}` : sec}` ); } else { // Finished playing. setValue(0); setTimeDisplay('00:00'); setPlaying(false); clearInterval(timer); current.start(0); } } }, 1000); const play = () => { if (!audio) { const _audio = AudioUtil.init(); setAudio(_audio); } else { audio.context.resume(); setPlaying(true); } }; const pause = () => { if (audio) { audio.context.suspend(); setPlaying(false); clearInterval(timer); } }; const updateVolume = (_, newVolume) => { if (audio) { audio.gainNode.gain.value = newVolume / 10; } setVolume(newVolume); }; return ( <Card style={{ width: '550px', background: 'rgba(0,0,0,0.8)' }} id="audio"> <Row> <Col md="auto" className="pr-0"> {playing ? ( <IconButton onClick={pause} color="primary"> <PauseIcon /> </IconButton> ) : ( <IconButton onClick={play} color="primary"> <PlayArrowIcon /> </IconButton> )} </Col> <Divider orientation="vertical" flexItem light className={classes.light} /> <Col md="7" className="align-self-center"> <Row> <Col md="10" className="pr-0" className="align-self-center"> <MDBProgress value={value} /> </Col> <Col md="auto" className="pl-0 ml-auto" style={{ color: '#3f51b5' }} > {timeDisplay} </Col> </Row> </Col> <Divider orientation="vertical" flexItem light className={classes.light} /> <Col md="3" className="align-self-center"> <Row> <Col md="auto" className="align-self-center pr-0"> <VolumeUp color="primary" /> </Col> <Col className="align-self-center"> <Slider color="primary" className={classes.slider} value={volume} onChange={updateVolume} min={0} max={10} /> </Col> </Row> </Col> </Row> </Card> ); }; export default Audio;
5,891
1,837
function loop(){ // Rotate the propeller, the sea and the sky //airplane.propeller.rotation.x += 0.3; sky.mesh.rotation.z += .05; // update the plane on each frame updatePlane(); airplane.pilot.updateHairs(); sea.moveWaves(); // render the scene renderer.render(scene, camera); // call the loop function again requestAnimationFrame(loop); } function updatePlane(){ // let's move the airplane between -100 and 100 on the horizontal axis, // and between 25 and 175 on the vertical axis, // depending on the mouse position which ranges between -1 and 1 on both axes; // to achieve that we use a normalize function (see below) var targetX = normalize(mousePos.x, -1, 1, -20, 20); var targetY = normalize(mousePos.y, -1, 1, 80, 120); // update the airplane's position //airplane.mesh.position.y = targetY; airplane.mesh.position.y += (targetY-airplane.mesh.position.y)*0.1; airplane.mesh.position.x = targetX; airplane.mesh.rotation.z = (targetY-airplane.mesh.position.y)*0.0128; airplane.mesh.rotation.x = (airplane.mesh.position.y-targetY)*0.064; airplane.propeller.rotation.x += 0.3; } function normalize(v,vmin,vmax,tmin, tmax){ var nv = Math.max(Math.min(v,vmax), vmin); var dv = vmax-vmin; var pc = (nv-vmin)/dv; var dt = tmax-tmin; var tv = tmin + (pc*dt); return tv; }
1,346
537
function getGEOJSONArray(geojson, positions, clau) { var array1 = [] var z = 0; $.each(geojson.features, function (key, val) { z = z + 1; if (z <= positions) { $.each(val.properties, function (i, j) { if (i == clau) { array1.push(j); } }) } }); return array1; } function addCommasFormated(nStr) { try{ nStr += ''; nStr = nStr.replace(".", ","); x = nStr.split(','); x1 = x[0]; x2 = x.length > 1 ? ',' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + '.' + '$2'); } return x1 + x2; }catch(err){ return nStr; } } function ckeckAQArrays(array1, array2) { var common = $.grep(array1, function (element) { return $.inArray(element, array2) !== -1; }); return common.length; } function normalizeNameColumns(row_CSV) { var normalized = []; $.each(row_CSV, function (i, val) { normalized.push(treuAccentsiEspais(val)); }); return normalized; } function getTypeColumns(row_CSV) { var normalized = []; $.each(row_CSV, function (i, val) { normalized.push(typeof (quiSoconVinc(val))); }); return normalized; } function treuAccentsiEspais(str) { try { str = removeAccents(str); str = str.replace(/[^0-9a-zA-Z ]/g, ""); str = str.replace(/\s/g, "-"); } catch (Err) {} return str; } function removeAccents(str) { var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž'; var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz"; str = str.split(''); var strLen = str.length; var i, x; for (i = 0; i < strLen; i++) { if ((x = accents.indexOf(str[i])) != -1) { str[i] = accentsOut[x]; } } return str.join(''); } function randomColor() { return '#' + Math.floor(Math.random() * 16777215).toString(16); } function getRamdomColorFromArray() { var colors = [ '#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF', '#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF', '#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE', '#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD', '#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5', '#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B', '#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842', '#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031' ]; return colors[Math.floor(Math.random() * colors.length)]; } function getColumFromGEOJSON(keyField, GeoJSON) { var items = []; $.each(GeoJSON.features, function (key, val) { if (typeof val.properties[keyField] != 'undefined') { items.push(val.properties[keyField]); } }); return items; } function getColumFromGEOJSONFilter(keyField, GeoJSON, keyFilter, valueFilter) { var items = []; $.each(GeoJSON.features, function (key, val) { if (typeof val.properties[keyField] != 'undefined' && val.properties[keyField] != null && val.properties[keyField] != 'null' && !isNaN(val.properties[keyField])) { if (val.properties[keyFilter] < valueFilter) { items.push(val.properties[keyField]); } } }); return items; } function getColumFromCSV(numColum, forceNumber, dataCSV) { var arrayColum = []; $.each(dataCSV, function (i, feature) { if (i > 0) { var value = feature[numColum]; if (value && value != 'undefined') { if (forceNumber) { arrayColum.push(quiSoconVinc(value)); } else { arrayColum.push(value); } } } }); return arrayColum; } function getUniqueValuesfromFilter(numKeyColum, forceNumberKeyColum, dataCSV) { var estatsKeyColum = new geostats(getColumFromCSV(numKeyColum, forceNumberKeyColum, dataCSV)); var itemKeyColum = estatsKeyColum.getClassUniqueValues(); return itemKeyColum; } function insertUniqueValuesfromFilter(numKeyColum, forceNumberKeyColum, dataCSV, HTML_ID) { try { var estatsKeyColum = new geostats(getColumFromCSV(numKeyColum, forceNumberKeyColum, dataCSV)); insertValueToSelectHTML(estatsKeyColum, HTML_ID); return true; } catch (err) { return false; } } function insertValuesFromQuery(numQueryColum, textQuery, numTextColum, HTML_ID, dataCSV) { try { var arrayColum = []; $.each(dataCSV, function (i, feature) { if (i > 0) { if (feature) var value = feature[numQueryColum]; if (value == textQuery) { arrayColum.push(feature[numTextColum]); } } }); var estatsKeyColum = new geostats(arrayColum); insertValueToSelectHTML(estatsKeyColum, HTML_ID); return true; } catch (err) { return false; } } function insertValueToSelectHTML(itemKeyColumGeostats, HTML_ID) { try { $(HTML_ID).html(''); var itemKeyColum = itemKeyColumGeostats.getClassUniqueValues(); $.each(itemKeyColum, function (key, value) { $(HTML_ID) .append($('<option>', { value: value }) .text(value)); }); } catch (err) { console.log(err); } } function getValuesFromQuery(numQueryColum, textQuery, dataCSV) { var arrayColum = []; $.each(dataCSV, function (i, feature) { if (i > 0) { if (feature) var value = feature[numQueryColum]; if (value == textQuery) { arrayColum.push(feature); } } }); return arrayColum; } function updateLegend(legend, textTitol, HTML_ID) { $(HTML_ID).html(legend); $('.geostats-legend-title').html(textTitol); } function getGenerateStyle(recordset, numRangs, arrayColors, factorH) { var _numRangs = recordset.estadistica.getClassJenks(numRangs); if (numRangs < initNumRangs) { _numRangs = recordset.estadistica.getClassUniqueValues(numRangs); } if (recordset.estadistica.ranges.length > arrayColors.length) { arrayColorCurrent = getColorArrayfromSelectedBrewer(recordset.estadistica.ranges.length + 1, initNumRangs); recordset.estadistica.setColors(arrayColorCurrent); } else { recordset.estadistica.setColors(arrayColors); } var expColor = ["match", ["get", "abp"]]; var expHeight = ["match", ["get", "abp"]]; recordset.results.forEach(function (row) { var value = parseInt((row["sum"])); var color = recordset.estadistica.colors[recordset.estadistica.getRangeNum(value)]; if (!color) { color = "rgba(0,0,0,0)"; } expColor.push(row["abp"], color); expHeight.push(row["abp"], parseInt(value * factorH)); }); expColor.push("rgba(0,0,0,0)"); expHeight.push(0); return { "color": expColor, "height": expHeight, 'legend': recordset.estadistica.getHtmlLegend(), 'titol': recordset.titol, 'legend_color': recordset.estadistica.colors, 'legend_rangs': recordset.estadistica.bounds, 'sum':addCommasFormated(recordset.estadistica.sum()) }; } function getArrayValuesFromUniqueKeyFilterByABP(arrayUniqueKey, arrayFromSearchQuery, numKeyColum, numSumColum, textNumColum, forceNumber, textTitle, numKeyColumABP, nomABP) { var array = []; var arrayValues = []; var title = textTitle; var text = ""; for (var i = 0; i < arrayUniqueKey.length; i++) { var ini = 0; for (var j = 0; j < arrayFromSearchQuery.length; j++) { if (arrayUniqueKey[i] == arrayFromSearchQuery[j][numKeyColum] && arrayFromSearchQuery[j][numKeyColumABP] == nomABP) { var _al = parseInt(arrayFromSearchQuery[j][numSumColum]); var text = arrayFromSearchQuery[j][textNumColum] if (isNaN(_al)) { _al = 0 } ini = ini + parseInt(_al); // text=arrayFromSearchQuery[j][textNumColum] } } array.push([arrayUniqueKey[i], ini, capitalizeFirstLetter(text)]); array.sort(sortFunction); } return { "titol": title, "filter": nomABP, "results": array }; } function getArrayValuesFromUniqueKey(arrayUniqueKey, arrayFromSearchQuery, numKeyColum, numSumColum, textNumColum, forceNumber, textTitle) { var array = []; var arrayValues = []; var title = textTitle; var text = ""; for (var i = 0; i < arrayUniqueKey.length; i++) { var ini = 0; for (var j = 0; j < arrayFromSearchQuery.length; j++) { if (arrayUniqueKey[i] == arrayFromSearchQuery[j][numKeyColum]) { var _al = parseInt(arrayFromSearchQuery[j][numSumColum]); var text = arrayFromSearchQuery[j][textNumColum] if (isNaN(_al)) { _al = 0 } ini = ini + parseInt(_al); // text=arrayFromSearchQuery[j][textNumColum] } } array.push([arrayUniqueKey[i], ini, capitalizeFirstLetter(text)]); array.sort(sortFunction); } return { "titol": title, "results": array }; } function sortFunction(a, b) { if (a[0] === b[0]) { return 0; } else { return (a[0] < b[0]) ? -1 : 1; } } function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } function getSumValuesFromUniqueKey(arrayUniqueKey, arrayFromSearchQuery, numKeyColum, numSumColum, textNumColum, forceNumber, textTitle) { var array = []; var arrayValues = []; var _GEOSTATS; var title = textTitle; var text = ""; for (var i = 0; i < arrayUniqueKey.length; i++) { var ini = 0; for (var j = 0; j < arrayFromSearchQuery.length; j++) { if (arrayUniqueKey[i] == arrayFromSearchQuery[j][numKeyColum]) { var _al = parseInt(arrayFromSearchQuery[j][numSumColum]); if (isNaN(_al)) { _al = 0 } ini = ini + parseInt(_al); // text=arrayFromSearchQuery[j][textNumColum] } } array.push({ "abp": arrayUniqueKey[i], "sum": ini }) arrayValues.push(ini); } _GEOSTATS = new geostats(arrayValues); var newEstats = new geostats(arrayValues); var _controlUniques = newEstats.getClassUniqueValues().length; if (_controlUniques >= initNumRangs) { _numRangs = initNumRangs; } else { _numRangs = _controlUniques; } return { "estadistica": _GEOSTATS, "titol": title, "results": array, "numRangs": _numRangs }; } function getTitlefromCSV(numColum, dataCSV) { return dataCSV[0][numColum]; } function calculateStatsCVS(numColum, forceNumber, dataCSV) { var _GEOSTATS; var title = dataCSV[0][numColum]; _GEOSTATS = new geostats(getColumFromCSV(numColum, forceNumber, dataCSV)); return { "estadistica": _GEOSTATS, "titol": title }; } function quiSoconVinc(valor) { if (!isNaN(parseFloat(valor)) && 'string' == typeof (valor)) { valor = valor.replace(",", "."); valor = parseFloat(valor); } else if ('number' == typeof (valor)) {} else if (valor == 'undefined') { valor = 0; } else {} return valor; } function calculateStatsGeoJSON(keyField, newGeoJSON) { var _GEOSTATS; if ('number' == keyType) { _GEOSTATS = new geostats(getColumFromGEOJSON(keyField, newGeoJSON)); } return _GEOSTATS; }
12,431
4,482
module.exports={A:{A:{"2":"E A B gB","8":"K D G"},B:{"2":"1 C c J M H I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 F N K D G E A B C c J M H I O P Q R S T U V W X Y Z a b d e f g h i j k l m n o L q r s t u v w x y z AB CB DB","129":"eB EB cB WB"},D:{"1":"T","8":"0 1 2 3 4 5 6 7 8 9 F N K D G E A B C c J M H I O P Q R S U V W X Y Z a b d e f g h i j k l m n o L q r s t u v w x y z AB CB DB QB hB KB IB LB MB NB OB"},E:{"1":"A B C VB p XB","260":"F N K D G E PB HB RB SB TB UB"},F:{"2":"E","4":"B C YB ZB aB bB p FB dB BB","8":"0 4 J M H I O P Q R S T U V W X Y Z a b d e f g h i j k l m n o L q r s t u v w x y z"},G:{"1":"G JB iB jB kB lB mB nB oB pB qB rB","8":"HB fB GB"},H:{"8":"sB"},I:{"8":"3 EB F tB uB vB wB GB xB yB"},J:{"1":"A","8":"D"},K:{"8":"A B C L p FB BB"},L:{"8":"IB"},M:{"1":"2"},N:{"2":"A B"},O:{"4":"zB"},P:{"8":"F 0B 1B 2B 3B"},Q:{"8":"4B"},R:{"8":"5B"}},B:2,C:"MathML"};
882
503
/*! * OS.js - JavaScript Cloud/Web Panel Platform * * Copyright (c) 2011-2017, Anders Evenrud <[email protected]> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Anders Evenrud <[email protected]> * @licence Simplified BSD License */ /*eslint valid-jsdoc: "off"*/ (function(Application, Window, Utils, API, Panel, GUI) { 'use strict'; var panelItems = []; var items = []; var max = 0; var panel; ///////////////////////////////////////////////////////////////////////////// // HELPERS ///////////////////////////////////////////////////////////////////////////// function openOptions(wm, idx) { // FIXME try { wm.panels[0]._items[idx].openSettings(); } catch ( e ) {} } function checkSelection(win, idx) { var hasOptions = true; try { var it = items[panel.items[idx].name]; hasOptions = it.HasOptions === true; } catch ( e ) {} win._find('PanelButtonOptions').set('disabled', idx < 0 || !hasOptions); win._find('PanelButtonRemove').set('disabled', idx < 0); win._find('PanelButtonUp').set('disabled', idx <= 0); win._find('PanelButtonDown').set('disabled', idx < 0 || idx >= max); } function renderItems(win, setSelected) { var list = []; panelItems.forEach(function(i, idx) { var name = i.name; if ( items[name] ) { list.push({ value: idx, columns: [{ icon: API.getIcon(items[name].Icon), label: Utils.format('{0} ({1})', items[name].Name, items[name].Description) }] }); } }); max = panelItems.length - 1; var view = win._find('PanelItems'); view.clear(); view.add(list); if ( typeof setSelected !== 'undefined' ) { view.set('selected', setSelected); checkSelection(win, setSelected); } else { checkSelection(win, -1); } } function movePanelItem(win, index, pos) { var value = panelItems[index]; var newIndex = index + pos; panelItems.splice(index, 1); panelItems.splice(newIndex, 0, value); renderItems(win, newIndex); } function createDialog(win, scheme, cb) { if ( scheme ) { var app = win._app; var nwin = new OSjs.Applications.ApplicationSettings.SettingsItemDialog(app, app.__metadata, scheme, cb); nwin._on('inited', function(scheme) { nwin._find('List').clear().add(Object.keys(items).map(function(i, idx) { return { value: i, columns: [{ icon: API.getIcon(items[i].Icon), label: Utils.format('{0} ({1})', items[i].Name, items[i].Description) }] }; })); nwin._setTitle('Panel Items', true); }); win._addChild(nwin, true, true); } } function createColorDialog(win, color, cb) { win._toggleDisabled(true); API.createDialog('Color', { color: color }, function(ev, button, result) { win._toggleDisabled(false); if ( button === 'ok' && result ) { cb(result.hex); } }, win); } ///////////////////////////////////////////////////////////////////////////// // MODULE ///////////////////////////////////////////////////////////////////////////// var module = { group: 'personal', name: 'Panel', label: 'LBL_PANELS', icon: 'apps/gnome-panel.png', watch: ['CoreWM'], init: function() { }, update: function(win, scheme, settings, wm) { panel = settings.panels[0]; var opacity = 85; if ( typeof panel.options.opacity === 'number' ) { opacity = panel.options.opacity; } win._find('PanelPosition').set('value', panel.options.position); win._find('PanelAutoHide').set('value', panel.options.autohide); win._find('PanelOntop').set('value', panel.options.ontop); win._find('PanelBackgroundColor').set('value', panel.options.background || '#101010'); win._find('PanelForegroundColor').set('value', panel.options.foreground || '#ffffff'); win._find('PanelOpacity').set('value', opacity); items = OSjs.Core.getPackageManager().getPackage('CoreWM').panelItems; panelItems = panel.items || []; renderItems(win); }, render: function(win, scheme, root, settings, wm) { win._find('PanelPosition').add([ {value: 'top', label: API._('LBL_TOP')}, {value: 'bottom', label: API._('LBL_BOTTOM')} ]); win._find('PanelBackgroundColor').on('open', function(ev) { createColorDialog(win, ev.detail, function(result) { win._find('PanelBackgroundColor').set('value', result); }); }); win._find('PanelForegroundColor').on('open', function(ev) { createColorDialog(win, ev.detail, function(result) { win._find('PanelForegroundColor').set('value', result); }); }); win._find('PanelItems').on('select', function(ev) { if ( ev && ev.detail && ev.detail.entries && ev.detail.entries.length ) { checkSelection(win, ev.detail.entries[0].index); } }); win._find('PanelButtonAdd').on('click', function() { win._toggleDisabled(true); createDialog(win, scheme, function(ev, result) { win._toggleDisabled(false); if ( result ) { panelItems.push({name: result.data}); renderItems(win); } }); }); win._find('PanelButtonRemove').on('click', function() { var selected = win._find('PanelItems').get('selected'); if ( selected.length ) { panelItems.splice(selected[0].index, 1); renderItems(win); } }); win._find('PanelButtonUp').on('click', function() { var selected = win._find('PanelItems').get('selected'); if ( selected.length ) { movePanelItem(win, selected[0].index, -1); } }); win._find('PanelButtonDown').on('click', function() { var selected = win._find('PanelItems').get('selected'); if ( selected.length ) { movePanelItem(win, selected[0].index, 1); } }); win._find('PanelButtonReset').on('click', function() { var defaults = wm.getDefaultSetting('panels'); panelItems = defaults[0].items; renderItems(win); }); win._find('PanelButtonOptions').on('click', function() { var selected = win._find('PanelItems').get('selected'); if ( selected.length ) { openOptions(wm, selected[0].index); } }); }, save: function(win, scheme, settings, wm) { settings.panels = settings.panels || [{}]; settings.panels[0].options = settings.panels[0].options || {}; settings.panels[0].options.position = win._find('PanelPosition').get('value'); settings.panels[0].options.autohide = win._find('PanelAutoHide').get('value'); settings.panels[0].options.ontop = win._find('PanelOntop').get('value'); settings.panels[0].options.background = win._find('PanelBackgroundColor').get('value') || '#101010'; settings.panels[0].options.foreground = win._find('PanelForegroundColor').get('value') || '#ffffff'; settings.panels[0].options.opacity = win._find('PanelOpacity').get('value'); settings.panels[0].items = panelItems; } }; ///////////////////////////////////////////////////////////////////////////// // EXPORTS ///////////////////////////////////////////////////////////////////////////// OSjs.Applications = OSjs.Applications || {}; OSjs.Applications.ApplicationSettings = OSjs.Applications.ApplicationSettings || {}; OSjs.Applications.ApplicationSettings.Modules = OSjs.Applications.ApplicationSettings.Modules || {}; OSjs.Applications.ApplicationSettings.Modules.Panel = module; })(OSjs.Core.Application, OSjs.Core.Window, OSjs.Utils, OSjs.API, OSjs.Panel, OSjs.GUI);
9,200
2,860
import {HTMLElement} from './html-element.js'; /** * @implements globalThis.HTMLDirectoryElement */ export class HTMLDirectoryElement extends HTMLElement { constructor(ownerDocument, localName = 'dir') { super(ownerDocument, localName); } }
252
74
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
18