hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28c11f2c44a42bc2a89d715e10995dfe2bec93f6 | 221 | js | JavaScript | src/bot/client.js | Tattl-Bot/Tattl-Bot | c4fc4f93b24c08f87fe8b951726ad290861b951b | [
"MIT"
] | null | null | null | src/bot/client.js | Tattl-Bot/Tattl-Bot | c4fc4f93b24c08f87fe8b951726ad290861b951b | [
"MIT"
] | null | null | null | src/bot/client.js | Tattl-Bot/Tattl-Bot | c4fc4f93b24c08f87fe8b951726ad290861b951b | [
"MIT"
] | null | null | null | const Discord = require("discord.js");
const client = new Discord.Client();
if (process.env.NODE_ENV !== "production") {
require("dotenv").config();
}
client.login(process.env.TOKEN);
module.exports = {
client,
};
| 17 | 44 | 0.674208 |
28c1dba9e27666351dd37b6082554ba76ef3bcfd | 1,834 | js | JavaScript | webpack.dev.js | rheehot/anony | ebae5794667a59c3ea2ed0646015e9f6df02e3c1 | [
"MIT"
] | null | null | null | webpack.dev.js | rheehot/anony | ebae5794667a59c3ea2ed0646015e9f6df02e3c1 | [
"MIT"
] | null | null | null | webpack.dev.js | rheehot/anony | ebae5794667a59c3ea2ed0646015e9f6df02e3c1 | [
"MIT"
] | null | null | null | const webpack = require('webpack')
const path = require('path')
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
module.exports = merge(common, {
mode: 'development',
entry: {
dev: 'react-hot-loader/patch',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: [
'react-hot-loader/babel',
'@babel/plugin-syntax-dynamic-import',
],
},
},
},
],
},
devServer: {
/* devServer 는 변경사항 발생시 메모리에 bundle.js 를 배포하고 해당 파일?을 바라보며 서비스된다 */
hot: true,
inline: true,
// publicPath: __dirname + '/public/', // 이건 무슨 설정인지 몰라서 일단 주석처리 해놓음
historyApiFallback: {
rewrites: [{ from: /./, to: '/index.dev.html' }],
},
host: '0.0.0.0',
port: 8000,
contentBase: path.join(__dirname, 'public'),
disableHostCheck: true, // 외부에서 접속 허용
// proxy: {
// '/api/*': 'http://localhost:8080',
// '/index.html': 'http://localhost:8080',
// '/': 'http://localhost:8080',
// },
open: true,
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
new webpack.HotModuleReplacementPlugin(),
// new BundleAnalyzerPlugin({
// analyzerMode: 'static',
// reportFilename: 'docs/size_dev.html',
// defaultSizes: 'parsed',
// openAnalyzer: false,
// generateStatsFile: false,
// statsFilename: 'docs/stats_dev.json',
// }),
],
resolve: {
alias: {
'react-dom': '@hot-loader/react-dom',
},
},
})
| 25.830986 | 72 | 0.546347 |
28c24e967e431223414cbbbaee5dd6df24d287ab | 3,438 | js | JavaScript | core/utils/maths.test.js | jsakas/Subtractor | 1d0f12367a6fa111268b2a8fd1ea1a3d66cb43a9 | [
"MIT"
] | 6 | 2017-09-17T05:32:05.000Z | 2021-03-02T23:44:16.000Z | core/utils/maths.test.js | jsakas/Subtractor | 1d0f12367a6fa111268b2a8fd1ea1a3d66cb43a9 | [
"MIT"
] | 49 | 2017-09-17T05:30:44.000Z | 2022-02-17T22:26:28.000Z | core/utils/maths.test.js | jsakas/Subtractor | 1d0f12367a6fa111268b2a8fd1ea1a3d66cb43a9 | [
"MIT"
] | 1 | 2017-09-15T23:59:37.000Z | 2017-09-15T23:59:37.000Z | import {
getFrequencySpread,
percentToPoint,
pointToPercent,
getDetuneSpread,
shiftNote
} from './maths';
describe('shiftNote', () => {
test('shifts notes by octave and semi', () => {
expect(shiftNote(30)).toEqual(30);
expect(shiftNote(30, 1)).toEqual(42);
expect(shiftNote(30, -1)).toEqual(18);
expect(shiftNote(30, 1, -5)).toEqual(37);
expect(shiftNote(30, -1, 5)).toEqual(23);
});
});
describe('getDetuneSpread', () => {
test('returns detune by default', () => {
expect(getDetuneSpread(1, 100)).toEqual([100]);
});
test('returns a proper spread for 2 voices', () => {
expect(getDetuneSpread(2, 100)).toEqual([100, -100]);
});
test('returns a proper spread for 3 voices', () => {
expect(getDetuneSpread(3, 100)).toEqual([100, 0, -100]);
});
});
describe('getFrequencySpread', () => {
test('returns frequency by default', () => {
expect(getFrequencySpread(1000)).toEqual([1000]);
});
test('returns a proper spread for poly 3, detune 0', () => {
const a = getFrequencySpread(1000, 3);
expect(a).toEqual([1000, 1000, 1000]);
});
test('returns a proper spread for poly 3', () => {
const a = getFrequencySpread(1000, 3, 10);
expect(a[1]).toEqual(1000);
expect(a[0] < a[1]).toBe(true);
expect(a[1] < a[2]).toBe(true);
});
});
describe('percentToPoint', () => {
test('returns 127 for 1 in range [-127, 127]', () => {
expect(percentToPoint(-127, 127, 1)).toBe(127);
});
test('returns 0 for .5 in range [-127, 127]', () => {
expect(percentToPoint(-127, 127, .5)).toBe(0);
});
test('returns -127 for 0 in range [-127, 127]', () => {
expect(percentToPoint(-127, 127, 0)).toBe(-127);
});
test('returns 127 for 1 in range [0, 127]', () => {
expect(percentToPoint(0, 127, 1)).toBe(127);
});
test('returns 63.5 for .5 in range [0, 127]', () => {
expect(percentToPoint(0, 127, .5)).toBe(63.5);
});
test('returns 0 for 0 in range [0, 127]', () => {
expect(percentToPoint(0, 127, 0)).toBe(0);
});
test('returns 10 for 0 in range [10, 110]', () => {
expect(percentToPoint(10, 100, 0)).toBe(10);
});
test('returns 110 for 1 in range [10, 110]', () => {
expect(percentToPoint(10, 110, 1)).toBe(110);
});
test('returns 60 for .5 in range [10, 110]', () => {
expect(percentToPoint(10, 110, .5)).toBe(60);
});
});
describe('pointToPercent', () => {
test('returns 100 for 127 in range [-127, 127]', () => {
expect(pointToPercent(-127, 127, 127)).toBe(1);
});
test('returns .5 for 0 in range [-127, 127]', () => {
expect(pointToPercent(-127, 127, 0)).toBe(.5);
});
test('returns 0 for -127 in range [-127, 127]', () => {
expect(pointToPercent(-127, -127, -127)).toBe(0);
});
test('returns 100 for 127 in range [0, 127]', () => {
expect(pointToPercent(0, 127, 127)).toBe(1);
});
test('returns .5 for 63.5 in range [0, 127]', () => {
expect(pointToPercent(0, 127, 63.5)).toBe(.5);
});
test('returns 0 for 0 in range [0, 127]', () => {
expect(pointToPercent(0, 127, 0)).toBe(0);
});
test('returns 0 for 10 in range [10, 110]', () => {
expect(pointToPercent(10, 100, 10)).toBe(0);
});
test('returns 1 for 110 in range [10, 110]', () => {
expect(pointToPercent(10, 110, 110)).toBe(1);
});
test('returns .5 for 60 in range [10, 110]', () => {
expect(pointToPercent(10, 110, 60)).toBe(.5);
});
});
| 27.070866 | 62 | 0.57039 |
28c3775170188d6034d9c3385320bc3d46251775 | 1,660 | js | JavaScript | test/plugins/index.js | philschatz/cnx-designer | b1115b845f6a9d50d472fc419280a1488f33cc17 | [
"MIT"
] | null | null | null | test/plugins/index.js | philschatz/cnx-designer | b1115b845f6a9d50d472fc419280a1488f33cc17 | [
"MIT"
] | null | null | null | test/plugins/index.js | philschatz/cnx-designer | b1115b845f6a9d50d472fc419280a1488f33cc17 | [
"MIT"
] | null | null | null | import { Editor } from 'slate'
import '../util/h'
import dropKeys from '../util/dropKeys'
import fixtures from '../util/fixtures'
import { CONTENT_PLUGINS, GLOSSARY_PLUGINS } from '../util/plugins'
const testPlugin = plugins => ({
default: change,
input,
output,
checkSelection=true,
}) => {
const editor = new Editor({
value: input,
plugins,
})
editor.command(change)
if (output) {
dropKeys(editor.value.document)
.should.equal(dropKeys(output.document))
}
if (output && checkSelection) {
dropKeys(editor.value.selection)
.should.equal(dropKeys(output.selection))
}
}
describe('Plugins', () => {
fixtures(__dirname, 'admonition', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'code', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'classes', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'definition', testPlugin(GLOSSARY_PLUGINS))
fixtures(__dirname, 'exercise', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'figure', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'footnote', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'list', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'preformat', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'quotation', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'section', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'term', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'text', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'title', testPlugin(CONTENT_PLUGINS))
fixtures(__dirname, 'xref', testPlugin(CONTENT_PLUGINS))
})
| 34.583333 | 67 | 0.699398 |
28c44bac7760636d02702f6eba00d499dd71a0a0 | 920 | js | JavaScript | src/i18n/zh-CN.js | QycloudFe/vue-datepicker | 3cadb28e254f219e1e8e6fe260aaa7cb557e5ecd | [
"MIT"
] | null | null | null | src/i18n/zh-CN.js | QycloudFe/vue-datepicker | 3cadb28e254f219e1e8e6fe260aaa7cb557e5ecd | [
"MIT"
] | null | null | null | src/i18n/zh-CN.js | QycloudFe/vue-datepicker | 3cadb28e254f219e1e8e6fe260aaa7cb557e5ecd | [
"MIT"
] | null | null | null | /**
* datetime-picker 提示信息本地化-zh-CN
* @date: 2017-07-31
* @author: zhangyingwu<1316727932@qq.com>
*/
module.exports = {
'datetime_picker': {
'today': '转至今日',
'clear': '清除选择',
'close': '关闭选择器',
'selectMonth': '选择月份',
'prevMonth': '上一个月',
'nextMonth': '下一个月',
'selectYear': '选择年份',
'prevYear': '上一年',
'nextYear': '下一年',
'selectDecade': '选择十年',
'prevDecade': '上一个十年',
'nextDecade': '下一个十年',
'prevCentury': '上一个世纪',
'nextCentury': '下一个世纪',
'pickHour': '选择小时',
'incrementHour': '增加小时',
'decrementHour': '减小小时',
'pickMinute': '选择分钟',
'incrementMinute': '增加分钟',
'decrementMinute': '减小分钟',
'pickSecond': '选择秒',
'incrementSecond': '增加秒',
'decrementSecond': '减小秒',
'togglePeriod': '切换时期',
'selectTime': '选择时间'
}
}; | 24.210526 | 42 | 0.496739 |
28c517cfd8b83107595776ed87e8e1ad87f8ce5c | 3,183 | js | JavaScript | jsanalysis/com.nice/yidun_hook.js | 1amdi/js_analysis | 9cb0c7d932ac4441256b757ae886468aad82429d | [
"MIT"
] | 2 | 2020-01-16T06:56:39.000Z | 2020-12-01T01:20:19.000Z | jsanalysis/com.nice/yidun_hook.js | 1amdi/js_analysis | 9cb0c7d932ac4441256b757ae886468aad82429d | [
"MIT"
] | 2 | 2020-01-10T03:02:45.000Z | 2021-09-02T19:33:16.000Z | jsanalysis/com.nice/yidun_hook.js | 1amdi/js_analysis | 9cb0c7d932ac4441256b757ae886468aad82429d | [
"MIT"
] | 5 | 2019-11-15T07:16:48.000Z | 2020-12-04T05:10:51.000Z | verifyIntelliCaptcha= function(e) {//3955
var t = this;
this.$setData({
status: "checking"
});
_ = function(e) {
if (null == e || void 0 == e)
return null;
if (0 == e.length)
return "";
var t = 3;
try {
for (var n = [], i = 0; i < e.length; ) {
if (!(i + t <= e.length)) {
n.push(m(e, i, e.length - i));
break
}
n.push(m(e, i, t)),
i += t
}
return n.join("")
} catch (r) {
throw new Error("1010")
}
};
sample=function(e, t) {
var n = e.length;
if (n <= t)
return e;
for (var i = [], r = 0, o = 0; o < n; o++)
o >= r * (n - 1) / (t - 1) && (i.push(e[o]),
r += 1);
return i
};
B = function(e) {
var t = "14731382d816714fC59E47De5dA0C871D3F";
if (null == t || void 0 == t)
throw new Error("1008");
null != e && void 0 != e || (e = "");
var n = e + E(e)
, i = j(n)
, r = j(t)
, o = Y(i, r);
return _(o)
};
T =function n(e, t) {
function n(e, t) {
return e.charCodeAt(Math.floor(t % e.length))
}
function i(e, t) {
return t.split("").map(function(t, i) {
return t.charCodeAt(0) ^ n(e, i)
})
}
return t = i(e, t),
_(t)
};
var test = function(n) {
k.all([new k(function(i, r) {
var o = t.$store.state.token
, l = t.$el.getBoundingClientRect()
, u = l.left
, s = l.top
, f = b.now()
, j = T(o, [Math.round(e.clientX - u), Math.round(e.clientY - s), f - (t.beginTime || f)] + "")
, c = t.traceData.map(function(e) {
return T(o, e)
});
t.$store.dispatch(a, {
token: o,
acToken: n,
type: p.INTELLISENSE,
width: t.getWidth(),
data: JSON.stringify({
d: "",
m: B(sample(c, h).join(":")),
p: B(j),
ext: B(T(o, "1," + c.length))
})
}, function(e, t) {
return e ? void r(e) : void i(t)
})
}
), new k(function(e, t) {
window.setTimeout(e, 300)
}
)]).then(function(e) {
var n = i(e, 1);
n[0];
t.$setData({
status: "success"
})
})["catch"](function() {
return t.loadClassicCaptcha()
})
};
this.$store.state.captchaAnticheat.getToken({
timeout: 500
}).then(n)["catch"](n)
}
//this这种变量的属性怎么弄,还有window不知道什么时候它的属性就发生了变化
// var n = window.gdxidpyhxde fingerprint 不知道什么时候赋值的 3476 | 29.472222 | 115 | 0.348099 |
28c53804fb90316934e7c48582d5f472a4c49310 | 15,857 | js | JavaScript | src/main/webapp/app/services/visualizations/table.service-old.js | DX26-io/data-studio-gateway | dd0e61c2c18adcac7cd4c5b4db723fdd70a48b11 | [
"Apache-2.0"
] | 31 | 2019-05-20T20:13:52.000Z | 2021-09-22T09:05:38.000Z | src/main/webapp/app/services/visualizations/table.service-old.js | DX26-io/data-studio-gateway | dd0e61c2c18adcac7cd4c5b4db723fdd70a48b11 | [
"Apache-2.0"
] | 252 | 2019-03-18T19:25:35.000Z | 2022-03-31T20:57:39.000Z | src/main/webapp/app/services/visualizations/table.service-old.js | DX26-io/data-studio-gateway | dd0e61c2c18adcac7cd4c5b4db723fdd70a48b11 | [
"Apache-2.0"
] | 25 | 2019-06-28T11:48:40.000Z | 2021-08-10T22:20:59.000Z | (function () {
'use strict';
angular
.module('flairbiApp')
.factory('GenerateTable', GenerateTable);
GenerateTable.$inject = ['VisualizationUtils', '$rootScope', 'D3Utils'];
function GenerateTable(VisualizationUtils, $rootScope, D3Utils) {
return {
build: function (record, element, panel) {
function getProperties(VisualizationUtils, record) {
var result = {};
var features = VisualizationUtils.getDimensionsAndMeasures(record.fields),
dimensions = features.dimensions,
measures = features.measures,
eachMeasure,
eachDimension,
allMeasures = [],
allDimensions = [];
result['dimensions'] = D3Utils.getNames(dimensions);
result['measures'] = D3Utils.getNames(measures);
result['maxDim'] = dimensions.length;
result['maxMes'] = measures.length;
for (var i = 0; i < result.maxDim; i++) {
eachDimension = {};
eachDimension['dimension'] = result['dimensions'][i];
eachDimension['displayName'] = VisualizationUtils.getFieldPropertyValue(dimensions[i], 'Display name');
eachDimension['cellColor'] = VisualizationUtils.getFieldPropertyValue(dimensions[i], 'Cell colour');
eachDimension['fontStyle'] = VisualizationUtils.getFieldPropertyValue(dimensions[i], 'Font style');
eachDimension['fontWeight'] = VisualizationUtils.getFieldPropertyValue(dimensions[i], 'Font weight');
eachDimension['fontSize'] = parseInt(VisualizationUtils.getFieldPropertyValue(dimensions[i], 'Font size'));
eachDimension['textColor'] = VisualizationUtils.getFieldPropertyValue(dimensions[i], 'Text colour');
eachDimension['textColorExpression'] = VisualizationUtils.getFieldPropertyValue(dimensions[i], 'Text colour expression');
eachDimension['textAlignment'] = VisualizationUtils.getFieldPropertyValue(dimensions[i], 'Alignment').toLowerCase();
allDimensions.push(eachDimension);
}
result['dimensionProp'] = allDimensions;
for (var i = 0; i < result.maxMes; i++) {
eachMeasure = {};
eachMeasure['measure'] = result['measures'][i];
eachMeasure['displayName'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Display name');
eachMeasure['cellColor'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Cell colour');
eachMeasure['cellColorExpression'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Cell colour expression');
eachMeasure['fontStyle'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Font style');
eachMeasure['fontWeight'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Font weight');
eachMeasure['fontSize'] = parseInt(VisualizationUtils.getFieldPropertyValue(measures[i], 'Font size'));
eachMeasure['numberFormat'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Number format');
eachMeasure['textColor'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Text colour');
eachMeasure['textAlignment'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Text alignment').toLowerCase();
eachMeasure['textColorExpression'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Text colour expression');
eachMeasure['iconName'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Icon name');
eachMeasure['iconPosition'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Icon position');
eachMeasure['iconExpression'] = VisualizationUtils.getFieldPropertyValue(measures[i], 'Icon Expression');
allMeasures.push(eachMeasure);
}
result['measureProp'] = allMeasures;
return result;
}
var Helper = (function () {
var DEFAULT_COLOR = "#bdbdbd";
function Helper(config) {
this.config = config;
this.dimensions = config.dimensions;
this.measures = config.measures;
this.maxDim = config.maxDim;
this.maxMes = config.maxMes;
this.dimensionProp = config.dimensionProp;
this.measureProp = config.measureProp;
}
Helper.prototype.getDisplayName = function (index, isDimension) {
if (isDimension) {
return this.dimensionProp[index]['displayName'];
}
return this.measureProp[index]['displayName'];
}
Helper.prototype.getCellColor = function (index, isDimension) {
if (isDimension) {
return this.dimensionProp[index]['cellColor'];
}
return this.measureProp[index]['cellColor'];
}
Helper.prototype.getCellColorExpression = function (index) {
return this.measureProp[index]['cellColorExpression'];
}
Helper.prototype.getFontStyle = function (index, isDimension) {
if (isDimension) {
return this.dimensionProp[index]['fontStyle'];
}
return this.measureProp[index]['fontStyle'];
}
Helper.prototype.getFontWeight = function (index, isDimension) {
if (isDimension) {
return this.dimensionProp[index]['fontWeight'];
}
return this.measureProp[index]['fontWeight'];
}
Helper.prototype.getFontSize = function (index, isDimension) {
if (isDimension) {
return this.dimensionProp[index]['fontSize'] + "px";
}
return this.measureProp[index]['fontSize'] + "px";
}
Helper.prototype.getTextColor = function (index, isDimension) {
if (isDimension) {
return this.dimensionProp[index]['textColor'];
}
return this.measureProp[index]['textColor'];
}
Helper.prototype.getTextAlignment = function (index, isDimension) {
if (isDimension) {
return this.dimensionProp[index]['textAlignment'];
}
return this.measureProp[index]['textAlignment'];
}
// TODO: this part needs to be implemented
Helper.prototype.getTextColorExpression = function (index) {
if (isDimension) {
return this.dimensionProp[index]['textColorExpression'];
}
return this.measureProp[index]['textColorExpression'];
}
Helper.prototype.getIcon = function (index) {
if (this.getIconName(index) !== "") {
return '<span style="display:block; text-align:' + this.getIconPosition(index) + ';"><i class="' + this.getIconName(index) + '" aria-hidden="true"></i></span>';
}
return "";
}
Helper.prototype.getIconName = function (index) {
return this.measureProp[index]['iconName'];
}
Helper.prototype.getIconPosition = function (index) {
return this.measureProp[index]['iconPosition'];
}
Helper.prototype.getIconExpression = function (index) {
return this.measureProp[index]['iconExpression'];
}
Helper.prototype.getValueNumberFormat = function (index) {
var si = this.measureProp[index]['numberFormat'],
nf = D3Utils.getNumberFormatter(si);
return nf;
}
return Helper;
})();
var Table = (function () {
function Table(container, record, properties) {
this.container = container;
this.id = record.id;
this.originalData = record.data;
this.helper = new Helper(properties);
$('#table-' + this.id).remove();
var div = d3.select(container).append('div')
.attr('id', 'table-' + this.id)
.attr('class', 'table-c');
}
Table.prototype.renderChart = function () {
var data = this.originalData;
var me = this;
var width = this.container.clientWidth;
var height = this.container.clientHeight;
$('#table-' + this.id).css('width', width)
.css('height', height).css('overflow-y', 'hidden').css('overflow-x', 'auto');
var table = $('<table id="viz_table" class="display nowrap" style="width:100%"></table>').addClass('table table-condensed table-hover');
var thead = "<thead><tr>",
tbody = "<tbody>";
this.helper.dimensions.forEach(function (item, index) {
var title = me.helper.getDisplayName(index, true),
style = {
'text-align': me.helper.getTextAlignment(index, true),
'background-color': '#f1f1f1',
'font-weight': 'bold'
};
style = JSON.stringify(style);
style = style.replace(/","/g, ';').replace(/["{}]/g, '');
if (title != "") {
thead += "<th style=\"" + style + "\">" + title + "</th>";
} else {
thead += "<th style=\"" + style + "\">" + item + "</th>";
}
});
this.helper.measures.forEach(function (item, index) {
var title = me.helper.getDisplayName(index),
style = {
'text-align': me.helper.getTextAlignment(index),
'background-color': '#f1f1f1',
'font-weight': 'bold'
};
style = JSON.stringify(style);
style = style.replace(/","/g, ';').replace(/["{}]/g, '');
if (title != "") {
thead += "<th style=\"" + style + "\">" + title + "</th>";
} else {
thead += "<th style=\"" + style + "\">" + item + "</th>";
}
});
thead += "</tr></thead>";
table.append(thead);
data.forEach(function (d) {
tbody += "<tr>";
me.helper.dimensions.forEach(function (item, index) {
var style = {
'text-align': me.helper.getTextAlignment(index, true),
'background-color': me.helper.getCellColor(index, true),
'font-style': me.helper.getFontStyle(index, true),
'font-weight': me.helper.getFontWeight(index, true),
'font-size': me.helper.getFontSize(index, true),
'color': me.helper.getTextColor(index, true)
};
style = JSON.stringify(style);
style = style.replace(/","/g, ';').replace(/["{}]/g, '');
tbody += "<td style=\"" + style + "\">" + d[item] + "</td>";
});
me.helper.measures.forEach(function (item, index) {
var style = {
'text-align': me.helper.getTextAlignment(index),
'background-color': me.helper.getCellColor(index),
'font-style': me.helper.getFontStyle(index),
'font-weight': me.helper.getFontWeight(index),
'font-size': me.helper.getFontSize(index),
'color': me.helper.getTextColor(index)
};
style = JSON.stringify(style);
style = style.replace(/","/g, ';').replace(/["{}]/g, '');
tbody += "<td style=\"" + style + "\">" + me.helper.getIcon(index) + D3Utils.getFormattedValue(d[item], me.helper.getValueNumberFormat(index)) + "</td>";
});
tbody += "</tr>";
});
tbody += "</tbody>";
table.append(tbody);
$('#table-' + this.id).append(table);
$('#table-' + this.id).find('#viz_table').dataTable({
scrollY: height - 80,
scrollX: true,
scrollCollapse: true,
ordering: true,
info: true,
searching: false,
dom: '<"table-header">rt<"table-footer"lp>',
fnDrawCallback: function (oSettings) {
if (oSettings._iDisplayLength > oSettings.fnRecordsDisplay()) {
$(oSettings.nTableWrapper).find('.dataTables_paginate').hide();
$(oSettings.nTableWrapper).find('.dataTables_info').hide();
}
}
});
}
return Table;
})();
var table = new Table(element[0], record, getProperties(VisualizationUtils, record));
table.renderChart();
}
}
}
})(); | 50.987138 | 188 | 0.444094 |
28c5c5b51559e204127a1f909c4795b77b04f183 | 7,347 | js | JavaScript | src/modules/shop/editors/service.js | viraweb123/vw-dashboard | 67de8d2c0143defdf5236285d4027c2dc226ea29 | [
"MIT"
] | 2 | 2020-01-27T06:52:33.000Z | 2020-01-27T09:09:03.000Z | src/modules/shop/editors/service.js | viraweb123/vw-dashboard | 67de8d2c0143defdf5236285d4027c2dc226ea29 | [
"MIT"
] | 42 | 2020-03-24T10:50:16.000Z | 2022-02-27T11:51:45.000Z | src/modules/shop/editors/service.js | viraweb123/vw-dashboard | 67de8d2c0143defdf5236285d4027c2dc226ea29 | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2015-2025 Phoinex Scholars Co. http://dpq.co.ir
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import templatUrl from './service.html';
/**
@ngdoc Editors
@name /shop/services/:serviceId
@description
Controller of a service
*/
export default {
templateUrl: templatUrl,
controllerAs: 'ctrl',
access: 'hasAnyRole("tenant.owner", "shop.zoneOwner", "shop.agencyOwner", "shop.staff")',
controller: function(
$scope, $state, $mbTranslate, $location, $mbDialog, $q,
/* wb-core */ $mbResource,
/* seen-shop */ $shop, ShopService, ShopCategory, ServiceMetafield) {
'ngInject';
this.loading = false;
this.updating = false;
this.edit = false;
this.loadingMetas = false;
this.loadingCategories = false;
var ctrl = this;
/**
* @name loadService
* @memberOf AmdShopServiceCtrl
* @description Load the selected service
*/
function loadService() {
if (ctrl.loading) {
return;
}
ctrl.loading = true;
$shop.getService($state.params.serviceId, {
graphql: '{id,title,description,price,off,avatar,categories{id,name,description,thumbnail}, metafields{id,key,value,unit,namespace}}'
})//
.then(function(p) {
loadMetafields(p.metafields);
loadCategories(p.categories);
delete p.metafields;
delete p.categories;
$scope.service = new ShopService(p);
}, function() {
alert($mbTranslate.instant('Faild to load the service.'));
})//
.finally(function() {
ctrl.loading = false;
});
}
/**
* @name remove
* @memberOf AmdShopServiceCtrl
* @description remove the selected service from the server
*/
function remove() {
confirm($mbTranslate.instant('Item will be deleted. There is no undo action.'))//
.then(function() {
return $scope.service.delete()//
.then(function() {
$location.path('/services/');
}, function() {
alert($mbTranslate.instant('Fail to delete the service.'));
});
});
}
/**
* @name update
* @memberOf AmdShopServiceCtrl
* @description Update the selected service
*/
function update() {
if (ctrl.loading) {
return ctrl.loading;
}
ctrl.loading = $scope.service.update()//
.then(function(newService) {
$scope.service = newService;
}, function() {
alert($mbTranslate.instant('Failed to update service.'));
})//
.finally(function() {
ctrl.loading = false;
});
return ctrl.loading;
}
/**
* @name loadMetas
* @memberOf AmdShopProductCtrl
* @description Load the metadatas of the service
*/
function loadMetafields(list) {
var metaFields = [];
_.forEach(list, function(item) {
metaFields.push(new ServiceMetafield(item));
});
$scope.metafeilds = metaFields;
}
/*
* Load categories the service belongs to.
*/
function loadCategories(list) {
var categories = [];
_.forEach(list, function(item) {
categories.push(new ShopCategory(item));
});
$scope.categories = categories;
}
/**
* @name removeMetaField
* @memberOf AmdShopProductCtrl
* @description Remove a metadata from the metadatas of the service
* @param {type}
* metaData
*/
function removeMetafield(metaData) {
confirm($mbTranslate.instant('Item will be deleted. There is no undo action.'))//
.then(function() {
return $scope.service.deleteMetafield(metaData)//
.then(function() {
loadMetafields();
toast($mbTranslate.instant('Item is deleted successfully.'));
}, function() {
alert($mbTranslate.instant('Failed to delete item.'));
});
});
}
function addMetafield(metadata) {
var mydata = metadata ? metadata : {};
$mbDialog
.show({
templateUrl: 'views/dialogs/metafield-new.html',
config: {
data: mydata
}
// Create content
})
.then(function(meta) {
return $scope.service.putMetafield(meta)//
.then(function() {
loadMetafields();
}, function() {
alert($mbTranslate.instant('Failed to add new item.'));
});
});
}
function updateMetafield(metadata) {
$mbDialog
.show({
templateUrl: 'views/dialogs/metafield-update.html',
config: {
data: metadata
}
// Create content
})
.then(function(meta) {
return $scope.service.putMetafield(meta)//
.then(function() {
loadMetafields();
}, function() {
alert($mbTranslate.instant('Failed to update item.'));
});
});
}
function inlineUpdateMetafield(metadata) {
return $scope.service.putMetafield(metadata)//
.then(function() {
loadMetafields();
}, function() {
alert($mbTranslate.instant('Failed to update item.'));
});
}
/*
* Assign some categories to the service.
*/
function selectCategories($event) {
$mbResource
.get(AMD_SHOP_CATEGORY_SP, {
// TODO: maso, 2020: add initial resources,
targetEvent: $event
})
.then(addCategories);
}
/*
* @param {type} cats
* @returns {undefined}
* @description Push the service's categories to the server
*/
function addCategories(cats) {
$scope.updatingCategories = true;
var jobs = [];
_.forEach(cats, function(item) {
jobs.push($scope.service.putCategory(item)
.then(function() {
$scope.categories.push(item);
}));
});
return $q.all(jobs)
.finally(function() {
$scope.updatingCategories = false;
});
}
this.removeCategories = function() {
$scope.updatingCategories = true;
var jobs = [];
_.forEach(arguments, function(item) {
jobs.push($scope.service.deleteCategory(item)
.then(function() {
_.remove($scope.categories, function(currentObject) {
return currentObject.id === item.id;
});
}));
});
return $q.all(jobs)
.finally(function() {
$scope.updatingCategories = false;
});
};
/*
* تمام امکاناتی که در لایه نمایش ارائه میشود در اینجا نام گذاری شده است.
*/
$scope.remove = remove;
$scope.update = update;
$scope.removeMetafield = removeMetafield;
$scope.addMetafield = addMetafield;
$scope.updateMetafield = updateMetafield;
$scope.inlineUpdateMetafield = inlineUpdateMetafield;
$scope.selectCategories = selectCategories;
loadService();
}
}
| 27.110701 | 137 | 0.646522 |
28c616b38fa59e01173634304afa9cb895ec8fa1 | 8,945 | js | JavaScript | config/update/actual.js | mtNATS/CinemaPress | 34bca9c79598c11c7bb41eea5010a5a2c4c6a7ad | [
"MIT"
] | null | null | null | config/update/actual.js | mtNATS/CinemaPress | 34bca9c79598c11c7bb41eea5010a5a2c4c6a7ad | [
"MIT"
] | null | null | null | config/update/actual.js | mtNATS/CinemaPress | 34bca9c79598c11c7bb41eea5010a5a2c4c6a7ad | [
"MIT"
] | null | null | null | 'use strict';
/**
* Node dependencies.
*/
var path = require('path');
var fs = require('fs');
/**
* Global env.
*/
var domain = '';
try {
var p = tryParseJSON(
fs.readFileSync(
path.join(path.dirname(__filename), '..', '..', 'process.json'),
'utf8'
)
);
var e = p.apps[0].env;
if (e && e['CP_RT']) {
domain = '_' + e['CP_RT'].replace('rt_', '') + '_';
}
for (var prop in e) {
if (e.hasOwnProperty(prop)) {
process.env[prop] = e[prop];
}
}
} catch (err) {
console.log('NOT FILE PROCESS DATA');
process.exit();
}
/**
* Module dependencies.
*/
var CP_save = require(path.join(
path.dirname(__filename),
'..',
'..',
'lib',
'CP_save.min.js'
));
var CP_get = require(path.join(
path.dirname(__filename),
'..',
'..',
'lib',
'CP_get.min.js'
));
/**
* Node dependencies.
*/
var async = require('async');
/**
* Valid JSON.
*
* @param {String} jsonString
*/
function tryParseJSON(jsonString) {
try {
var o = JSON.parse(jsonString);
if (o && typeof o === 'object') {
return o;
}
} catch (e) {}
return {};
}
var indexed = 0;
async.series(
[
function(callback) {
var i = 1;
async.forever(
function(next) {
CP_get.movies(
{ from: process.env.CP_RT, certainly: true, full: true },
500,
'',
i,
false,
function(err, movies) {
i++;
if (err) {
console.error(err);
return next('STOP');
}
if (movies && movies.length) {
async.eachOfLimit(
movies,
1,
function(movie, key, callback) {
CP_get.movies(
{
query_id: movie.query_id,
from: process.env.CP_XMLPIPE2
},
1,
'',
1,
false,
function(err, ms) {
if (err) {
console.error(err);
return callback();
}
if (ms && ms.length) {
var m = ms[0];
if (m.year) {
delete movie.year;
}
if (m.actor) {
delete movie.actor;
}
if (m.genre) {
delete movie.genre;
}
if (m.country) {
delete movie.country;
}
if (m.director) {
delete movie.director;
}
if (m.premiere) {
delete movie.premiere;
}
if (m.kp_rating) {
delete movie.kp_rating;
}
if (m.kp_vote) {
delete movie.kp_vote;
}
if (m.imdb_rating) {
delete movie.imdb_rating;
}
if (m.imdb_vote) {
delete movie.imdb_vote;
}
if (m.all_movies) {
delete movie.all_movies;
}
var old = movie.all_movies;
movie.id = movie.kp_id;
if (
!movie.description ||
movie.description === m.description
) {
var custom = movie.custom
? JSON.parse(movie.custom)
: {};
//custom.unique = false;
//movie.custom = JSON.stringify(custom);
}
if (
/("unique":true|"unique":"true")/i.test(
movie.custom
)
) {
indexed++;
}
CP_save.save(movie, 'rt', function(err, result) {
if (old && old !== domain) {
console.log(
result,
old.replace(/(^_|_$)/gi, '') +
' -> ' +
domain.replace(/(^_|_$)/gi, '')
);
} else {
console.log(result);
}
return callback(err);
});
} else {
return callback();
}
}
);
},
function(err) {
if (err) console.error(err);
return next();
}
);
} else {
return next('STOP');
}
}
);
},
function() {
console.log('INDEXED: ', indexed);
return callback();
}
);
},
function(callback) {
var i = 1;
async.forever(
function(next) {
CP_get.contents(
{ from: process.env.CP_RT, certainly: true },
500,
i,
false,
function(err, contents) {
i++;
if (err) {
console.error(err);
return next('STOP');
}
if (contents && contents.length) {
async.eachOfLimit(
contents,
1,
function(content, key, callback) {
var old = content.all_contents;
delete content.all_contents;
CP_save.save(content, 'content', function(err, result) {
if (old && old !== domain) {
console.log(
result,
old.replace(/(^_|_$)/gi, '') +
' -> ' +
domain.replace(/(^_|_$)/gi, '')
);
} else {
console.log(result);
}
return callback(err);
});
},
function(err) {
if (err) console.error(err);
return next();
}
);
} else {
return next('STOP');
}
}
);
},
function() {
return callback();
}
);
},
function(callback) {
var i = 1;
async.forever(
function(next) {
CP_get.comments(
{ from: process.env.CP_RT, certainly: true },
500,
'',
i,
function(err, comments) {
i++;
if (err) {
console.error(err);
return next('STOP');
}
if (comments && comments.length) {
async.eachOfLimit(
comments,
1,
function(comment, key, callback) {
var old = comment.all_comments;
delete comment.all_comments;
CP_save.save(comment, 'comment', function(err, result) {
if (old && old !== domain) {
console.log(
result,
old.replace(/(^_|_$)/gi, '') +
' -> ' +
domain.replace(/(^_|_$)/gi, '')
);
} else {
console.log(result);
}
return callback(err);
});
},
function(err) {
if (err) console.error(err);
return next();
}
);
} else {
return next('STOP');
}
}
);
},
function() {
return callback();
}
);
}
],
function() {
return process.exit();
}
);
| 28.306962 | 76 | 0.311124 |
28c624814dade4c997c5bf618944e359ffa16daa | 1,250 | js | JavaScript | src/components/NavigationFooter/index.js | Orlandohub/haha-studio | 689757eb8d6e4e6848cfbbb6a9586fee565ab0e5 | [
"MIT"
] | null | null | null | src/components/NavigationFooter/index.js | Orlandohub/haha-studio | 689757eb8d6e4e6848cfbbb6a9586fee565ab0e5 | [
"MIT"
] | 85 | 2018-10-18T10:59:25.000Z | 2019-05-09T16:10:03.000Z | src/components/NavigationFooter/index.js | Orlandohub/haha-studio | 689757eb8d6e4e6848cfbbb6a9586fee565ab0e5 | [
"MIT"
] | null | null | null | import React from 'react'
import PropTypes from 'prop-types'
import { css } from 'emotion'
// import footerArrow from '../../images/03_D_footer_arrow_project_page.png'
import * as styles from './styles'
import Link from 'gatsby-link'
import { genericHashLink } from 'react-router-hash-link'
const MyHashLink = props => genericHashLink(props, Link)
const NavFooter = props => {
const { linkLeft, linkRight, linkText, text } = props
return (
<div className={css(styles.footerWrapper)}>
<MyHashLink className={css(styles.arrows)} to={linkLeft}>
<span className={css(styles.arrows)}>←</span>
</MyHashLink>
<span className={css(styles.spanCenter)}>
<p className={css(styles.paragraph)}>
<MyHashLink to={linkText} className={css(styles.linkText)}>
{text}
</MyHashLink>
</p>
</span>
<MyHashLink className={css(styles.arrows)} to={linkRight}>
<span className={css(styles.arrows)}>→</span>
</MyHashLink>
</div>
)
}
NavFooter.propTypes = {
linkLeft: PropTypes.string.isRequired,
linkRight: PropTypes.string.isRequired,
linkText: PropTypes.string.isRequired,
text: PropTypes.string.isRequired,
}
export default NavFooter
| 29.761905 | 76 | 0.672 |
28c62dbc967255412319877cc72531d0d84372c5 | 1,820 | js | JavaScript | config/env/all.js | foysalit/hive-customer | b64741328a0e4c5b73d3a267826f7c6bffe3ad5e | [
"MIT"
] | null | null | null | config/env/all.js | foysalit/hive-customer | b64741328a0e4c5b73d3a267826f7c6bffe3ad5e | [
"MIT"
] | null | null | null | config/env/all.js | foysalit/hive-customer | b64741328a0e4c5b73d3a267826f7c6bffe3ad5e | [
"MIT"
] | null | null | null | 'use strict';
module.exports = {
app: {
title: 'Customer Management',
description: 'Hive Customer Management app built on the mean stack',
keywords: 'MongoDB, Express, AngularJS, Node.js'
},
port: process.env.PORT || 3000,
templateEngine: 'swig',
sessionSecret: 'MEAN',
sessionCollection: 'sessions',
assets: {
lib: {
css: [
'public/lib/bootstrap/dist/css/bootstrap.css',
'http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css',
'public/lib/angular-ui-select/dist/select.min.css',
//'public/lib/bootstrap/dist/css/bootstrap-theme.css',
],
js: [
'public/lib/angular/angular.js',
'public/lib/angular-resource/angular-resource.js',
'public/lib/angular-cookies/angular-cookies.js',
'public/lib/angular-animate/angular-animate.js',
'public/lib/angular-touch/angular-touch.js',
'public/lib/angular-sanitize/angular-sanitize.js',
'public/lib/angular-ui-router/release/angular-ui-router.js',
'public/lib/angular-ui-utils/ui-utils.js',
'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
'public/lib/angular-ui-select/dist/select.min.js',
//'https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.5/socket.io.min.js',
'public/lib/angular-socket-io/socket.min.js',
'public/lib/angular-smart-table/dist/smart-table.min.js',
'public/lib/lodash/lodash.min.js',
'http://maps.googleapis.com/maps/api/js?libraries=places,geometry&sensor=false&language=en&v=3.17',
'public/lib/angular-google-maps/dist/angular-google-maps.min.js'
]
},
css: [
'public/modules/**/css/*.css'
],
js: [
'public/config.js',
'public/application.js',
'public/modules/*/*.js',
'public/modules/*/*[!tests]*/*.js'
],
tests: [
'public/lib/angular-mocks/angular-mocks.js',
'public/modules/*/tests/*.js'
]
}
}; | 33.703704 | 103 | 0.675275 |
28c66ef8d4945dd23545d9c8049bdfd418e95f61 | 4,768 | js | JavaScript | src/main.js | rsaihe/reactor | 144942f5f197eed0293075517829e8ff496dd324 | [
"MIT"
] | 9 | 2019-06-14T18:25:18.000Z | 2022-01-27T19:48:27.000Z | src/main.js | rsaihe/reactor | 144942f5f197eed0293075517829e8ff496dd324 | [
"MIT"
] | 1 | 2020-09-24T18:25:25.000Z | 2020-09-25T21:19:18.000Z | src/main.js | rsaihe/reactor | 144942f5f197eed0293075517829e8ff496dd324 | [
"MIT"
] | 1 | 2019-08-14T13:16:37.000Z | 2019-08-14T13:16:37.000Z | "use strict";
// Grid dimensions.
const HORIZONTAL_MARGIN = 6;
const VERTICAL_MARGIN = 5;
const TILE_SIZE = 30;
// Fuel parameters.
const FUEL_ABSORB_CHANCE = 0.04;
const FUEL_MAX_NEUTRONS = 3;
const FUEL_MIN_NEUTRONS = 1;
const SPONTANEOUS_CHANCE = 0.002;
// Shielding parameters.
const SHIELDING_ABSORB_CHANCE = 0.12;
// Reflector parameters.
const REFLECTOR_ABSORB_CHANCE = 0.1;
const REFLECTION_CHANCE = 0.65;
// Control rod parameters.
const CONTROL_ROD_ABSORB_CHANCE = 0.3;
// Neutron parameters.
const NEUTRON_SIZE = 5;
const NEUTRON_SPEED = 5;
const NEUTRON_THERMAL_SPEED = 4;
// DOM elements.
const tileName = document.getElementById("name");
const tileDescription = document.getElementById("description");
// Draw state.
let selectedTile;
// Simulation state.
let controlRods = false;
let neutrons = [];
let tiles;
function setup() {
// Position the canvas.
const div = document.getElementById("sketch");
const canvas = createCanvas(div.offsetWidth, div.offsetHeight);
canvas.parent(div);
// Update DOM elements.
updateTile(Tile.FUEL);
// Set drawing mode.
ellipseMode(RADIUS);
// Initialize tile grid.
const cols = Math.floor(width / TILE_SIZE) - HORIZONTAL_MARGIN * 2;
const rows = Math.floor(height / TILE_SIZE) - VERTICAL_MARGIN * 2;
tiles = new Grid(cols, rows);
}
function draw() {
background("#111");
// Display tile grid.
tiles.display();
// Update neutrons.
for (const n of neutrons) {
n.update(tiles.width, tiles.height);
n.display(tiles.offsetX, tiles.offsetY);
// Interact with tiles.
const { col, row } = nearestTile(n.pos.x, n.pos.y);
const tile = tiles.get(col, row);
if (tile && typeof tile.interact === 'function') {
tile.interact(n, col, row, neutrons);
}
}
// Generate spontaneous neutrons.
spontaneousNeutrons();
// Remove dead neutrons.
for (let i = neutrons.length - 1; i >= 0; --i) {
if (neutrons[i].dead) {
neutrons.splice(i, 1);
}
}
// Draw when mouse is pressed.
if (mouseIsPressed) {
mouseDraw();
}
}
function keyPressed() {
// Select tile type to draw.
switch (key) {
case "1":
updateTile(Tile.EMPTY);
break;
case "2":
updateTile(Tile.FUEL);
break;
case "3":
updateTile(Tile.MODERATOR);
break;
case "4":
updateTile(Tile.SHIELDING);
break;
case "5":
updateTile(Tile.HORIZONTAL_REFLECTOR);
break;
case "6":
updateTile(Tile.VERTICAL_REFLECTOR);
break;
case "7":
updateTile(Tile.CONTROL_ROD);
break;
case " ":
// Clear neutrons and grid.
neutrons = [];
tiles.clear();
break;
case "q":
// Toggle control rods.
controlRods = !controlRods;
tiles.redraw();
break;
case "z":
// Clear neutrons.
neutrons = [];
break;
}
}
function mouseDraw() {
// Adjust for tile offset.
const x = mouseX - tiles.offsetX;
const y = mouseY - tiles.offsetY;
// Don't draw outside the grid.
if (x < 0 || y < 0 || x > tiles.width || y > tiles.height) {
return;
}
// Update the tile grid.
const { col, row } = nearestTile(x, y);
tiles.set(col, row, selectedTile);
tiles.redraw();
}
// Find the nearest tile to a particular coordinate relative to the tile grid.
function nearestTile(x, y) {
return {
col: Math.floor(x / TILE_SIZE),
row: Math.floor(y / TILE_SIZE),
};
}
// Get random coordinates within a given tile.
function randomInsideTile(col, row) {
return {
x: (col + Math.random()) * TILE_SIZE,
y: (row + Math.random()) * TILE_SIZE,
};
}
// Randomly generate spontaneous neutrons from fuel cells.
function spontaneousNeutrons() {
for (let row = 0; row < tiles.rows; ++row) {
for (let col = 0; col < tiles.cols; ++col) {
const tile = tiles.get(col, row);
if (tile === Tile.FUEL && Math.random() < SPONTANEOUS_CHANCE) {
// Generate neutrons at random coordinates inside the tile.
const { x, y } = randomInsideTile(col, row);
neutrons.push(new Neutron(x, y));
}
}
}
}
// Update the currently selected tile.
function updateTile(tile) {
// Update selected tile.
selectedTile = tile;
// Update HTML.
const { name, description } = tile;
tileName.innerHTML = name;
tileDescription.innerHTML = description;
}
| 24.963351 | 78 | 0.582634 |
28c6811f85d47f52b96673504cc31081206326e6 | 2,702 | js | JavaScript | lib/courier/usps.js | nanthan/delivery-tracker | 4fae3b3af31c6d6391acfadce2ffa913920f161e | [
"MIT"
] | null | null | null | lib/courier/usps.js | nanthan/delivery-tracker | 4fae3b3af31c6d6391acfadce2ffa913920f161e | [
"MIT"
] | 31 | 2020-10-28T03:32:22.000Z | 2021-07-27T22:22:42.000Z | lib/courier/usps.js | nanmcpe/delivery-tracker | 4fae3b3af31c6d6391acfadce2ffa913920f161e | [
"MIT"
] | null | null | null | 'use strict'
var request = require('request')
var cheerio = require('cheerio')
var moment = require('moment')
var tracker = require('../')
var trackingInfo = function (number) {
return {
method: 'GET',
url: 'https://tools.usps.com/go/TrackConfirmAction.action?tLabels=' + number
}
}
var parser = {
trace: function (body) {
var $ = cheerio.load(body)
var courier = {
code: tracker.COURIER.USPS.CODE,
name: tracker.COURIER.USPS.NAME
}
var result = {
courier: courier,
number: $('input[name=label]').val(),
status: tracker.STATUS.PENDING
}
var toText = function (txt) {
if (!txt) {
return ''
}
return $(txt.indexOf('<span>') !== -1 ? txt : '<span>' + txt + '</span>').text().trim()
}
var checkpoints = []
var $history = $('#trackingHistory_1').find('.panel-actions-content')
$('.mobileOnly').remove()
// html -> txt
var rawTxt = $history.html()
if (!rawTxt) {
return false
}
rawTxt = rawTxt.replace(/\s+/g, ' ')
// txt -> history list
var rawList = rawTxt.split('<hr>')
for (var i = 0; i < rawList.length; i++) {
var list = rawList[i].split('<br>')
if (list.length <= 3) {
continue
}
var time = $(list[0]).text().trim()
var statusMessage = toText(list[1])
var location = toText(list[2])
var message = [statusMessage]
if ((list[3] || '').trim().length > 0) {
message.push(toText(list[3]))
}
var checkpoint = {
courier: courier,
location: location,
message: message.join(' - '),
status: tracker.STATUS.IN_TRANSIT,
// November 17, 2017, 3:08 pm
time: moment(time, 'MMMM DD, YYYY, hh:mm a').format('YYYY-MM-DDTHH:mm')
}
checkpoint.message.indexOf('Shipping Label Created') !== -1 && (checkpoint.status = tracker.STATUS.INFO_RECEIVED)
checkpoint.message.indexOf('Delivered') !== -1 && (checkpoint.status = tracker.STATUS.DELIVERED)
checkpoints.push(checkpoint)
}
result.checkpoints = checkpoints
result.status = tracker.normalizeStatus(result.checkpoints)
return result
}
}
module.exports = function (opts) {
return {
trackingInfo: trackingInfo,
trace: function (number, cb) {
var tracking = trackingInfo(number)
request.get({
url: tracking.url
}, function (err, res, body) {
if (err) {
return cb(err)
}
try {
var result = parser.trace(body)
cb(result ? null : tracker.error(tracker.ERROR.INVALID_NUMBER), result)
} catch (e) {
cb(e.message)
}
})
}
}
}
| 25.490566 | 119 | 0.565137 |
28c71f0caba9c93a15f6a3f901004cb08a2c47e8 | 740 | js | JavaScript | app/components/headButton/index.js | andyashall/HNReact | 9139da427295200d266132a9fa1126adc8a1c73a | [
"MIT"
] | null | null | null | app/components/headButton/index.js | andyashall/HNReact | 9139da427295200d266132a9fa1126adc8a1c73a | [
"MIT"
] | null | null | null | app/components/headButton/index.js | andyashall/HNReact | 9139da427295200d266132a9fa1126adc8a1c73a | [
"MIT"
] | null | null | null | import React, { Component } from 'react'
import { Link } from 'react-router-dom'
const style = {
option: {
display: 'inline-block',
color: '#333',
padding: '10px 0',
marginRight: '20px'
},
optionHov: {
display: 'inline-block',
color: 'rgba(65,65,65,.65)',
padding: '10px 0',
marginRight: '20px'
}
}
export default class HeadButton extends Component {
constructor(props) {
super(props)
this.state = {hov: false}
}
render() {
return (
<Link to={this.props.link}>
<div style={this.state.hov ? style.optionHov : style.option} onMouseEnter={()=>{this.setState({hov:true})}} onMouseLeave={()=>{this.setState({hov:false})}}>{this.props.text}</div>
</Link>
)
}
} | 23.870968 | 187 | 0.598649 |
28c7546d7731ff50413b9025510b763c45fa2451 | 551 | js | JavaScript | src/net/http/modules/systemJournal.js | lxy0621/ZR_HTXT | 2993b7640150afd0c5d0dc213d8ed2945288d396 | [
"MIT"
] | null | null | null | src/net/http/modules/systemJournal.js | lxy0621/ZR_HTXT | 2993b7640150afd0c5d0dc213d8ed2945288d396 | [
"MIT"
] | null | null | null | src/net/http/modules/systemJournal.js | lxy0621/ZR_HTXT | 2993b7640150afd0c5d0dc213d8ed2945288d396 | [
"MIT"
] | null | null | null | /* jshint esversion: 6 */
import axios from '../axios';
//中台系统日志
export const ZTJournal = (data) => {
return axios({
url: '/log/pagingAdminLog',
method: 'post',
data
});
};
//小程序日志
export const XCXJournal = (data) => {
return axios({
url: '/log/pagingMiniLog',
method: 'post',
data
});
};
//POS日志
export const POSJournal = (data) => {
return axios({
url: '/log/pagingPosLog',
method: 'post',
data
});
};
//员工操作日志
// export const ZTJournal = (data) => {}; | 19 | 41 | 0.522686 |
28c757d05665a0616ebf9f5db297142b8b72b980 | 134 | js | JavaScript | app/components/AreaBooking/TopAreaWrapper.js | City-of-Helsinki/reservation-screen-ui | 59e5b4064049e1e294dbd01fa7565c9491f7fed8 | [
"MIT"
] | null | null | null | app/components/AreaBooking/TopAreaWrapper.js | City-of-Helsinki/reservation-screen-ui | 59e5b4064049e1e294dbd01fa7565c9491f7fed8 | [
"MIT"
] | 15 | 2019-02-15T08:26:14.000Z | 2020-03-31T08:38:05.000Z | app/components/AreaBooking/TopAreaWrapper.js | City-of-Helsinki/reservation-screen-ui | 59e5b4064049e1e294dbd01fa7565c9491f7fed8 | [
"MIT"
] | null | null | null | import styled from 'styled-components';
/* stylelint-disable */
const TopAreaWrapper = styled.div``;
export default TopAreaWrapper;
| 19.142857 | 39 | 0.768657 |
28c75f6bccb9f93241614d7588c46d59b737b9bf | 58 | js | JavaScript | astroem/zee.js/shell-pre.js | briehanlombaard/js9 | f386f5a5adbf88e77482008af6a4c50c0dd91b76 | [
"MIT"
] | null | null | null | astroem/zee.js/shell-pre.js | briehanlombaard/js9 | f386f5a5adbf88e77482008af6a4c50c0dd91b76 | [
"MIT"
] | null | null | null | astroem/zee.js/shell-pre.js | briehanlombaard/js9 | f386f5a5adbf88e77482008af6a4c50c0dd91b76 | [
"MIT"
] | null | null | null |
// zee.js: zlib compiled to js
var Zee = (function() {
| 9.666667 | 30 | 0.603448 |
28c7fd346454ce9728aca0c8d8d177f42781546d | 175,810 | js | JavaScript | resources/svg/localhost-Dateien/browser-sync-client.js | maroluke/portfolio21 | e414a81c5d0f0617f9b15f8254725bcb47cd5ac1 | [
"MIT"
] | 1 | 2021-07-29T19:08:59.000Z | 2021-07-29T19:08:59.000Z | resources/svg/localhost-Dateien/browser-sync-client.js | maroluke/portfolio21 | e414a81c5d0f0617f9b15f8254725bcb47cd5ac1 | [
"MIT"
] | null | null | null | resources/svg/localhost-Dateien/browser-sync-client.js | maroluke/portfolio21 | e414a81c5d0f0617f9b15f8254725bcb47cd5ac1 | [
"MIT"
] | 1 | 2021-07-29T19:09:13.000Z | 2021-07-29T19:09:13.000Z | window.___browserSync___ = {};
___browserSync___.socketConfig = {"reconnectionAttempts":50,"path":"/browser-sync/socket.io"};
___browserSync___.socketUrl = 'http://' + location.hostname + ':3000/browser-sync';
___browserSync___.options = {"logLevel":"info","plugins":[],"port":3000,"snippetOptions":{"async":true,"whitelist":[],"blacklist":[],"rule":{"match":{}}},"reloadDebounce":500,"mode":"proxy","scriptPaths":{"path":"/browser-sync/browser-sync-client.js","versioned":"/browser-sync/browser-sync-client.js?v=2.27.4"},"server":false,"logFileChanges":true,"reloadThrottle":0,"clientEvents":["scroll","scroll:element","input:text","input:toggles","form:submit","form:reset","click"],"urls":{"local":"http://localhost:3000","external":"http://192.168.178.39:3000"},"hostnameSuffix":false,"scrollElements":[],"scheme":"http","startPath":null,"single":false,"host":"localhost","codeSync":true,"watchEvents":["change"],"browser":"default","notify":true,"open":"local","reloadDelay":0,"minify":true,"rewriteRules":[],"injectFileTypes":["css","png","jpg","jpeg","svg","gif","webp","map"],"cors":false,"proxy":{"target":"http://portfolio21.test","url":{"port":"80","path":"/","query":null,"auth":null,"search":null,"host":"portfolio21.test","slashes":true,"href":"http://portfolio21.test/","hash":null,"pathname":"/","hostname":"portfolio21.test","protocol":"http:"}},"tagNames":{"jpg":"img","css":"link","svg":"img","gif":"img","jpeg":"img","js":"script","png":"img","scss":"link","less":"link"},"scrollRestoreTechnique":"window.name","watch":false,"watchOptions":{"ignoreInitial":true,"cwd":"/Users/marko/Projekte/portfolio21"},"cwd":"/Users/marko/Projekte/portfolio21","logConnections":false,"ghostMode":{"clicks":true,"scroll":true,"location":true,"forms":{"submit":true,"inputs":true,"toggles":true}},"middleware":[{"id":"Browsersync Proxy","route":""}],"ignore":[],"injectChanges":true,"excludedFileTypes":["js","css","pdf","map","svg","ico","woff","json","eot","ttf","png","jpg","jpeg","webp","gif","mp4","mp3","3gp","ogg","ogv","webm","m4a","flv","wmv","avi","swf","scss"],"online":true,"socket":{"socketIoOptions":{"log":false},"socketIoClientConfig":{"reconnectionAttempts":50},"path":"/browser-sync/socket.io","clientPath":"/browser-sync","namespace":"/browser-sync","clients":{"heartbeatTimeout":5000}},"ui":{"port":3001},"logPrefix":"Browsersync","scrollThrottle":0,"reloadOnRestart":false,"localOnly":false,"files":{"core":{"globs":["app/**/*.php","resources/views/**/*.php","public/**/*.(js|css)"],"objs":[]}},"version":"2.27.4","logSnippet":true,"injectNotification":false,"snippet":"<script id=\"__bs_script__\">//<![CDATA[\n document.write(\"<script async src='/browser-sync/browser-sync-client.js?v=2.27.4'><\\/script>\".replace(\"HOST\", location.hostname));\n//]]></script>\n","timestamps":true,"serveStatic":[],"scrollElementMapping":[],"scrollProportionally":true,"xip":false};
if (location.protocol == "https:" && /^http:/.test(___browserSync___.socketUrl)) {
___browserSync___.socketUrl = ___browserSync___.socketUrl.replace(/^http:/, "https:");
}
;
/*! For license information please see index.min.js.LICENSE.txt */
(()=>{var t={6906:t=>{function e(){}t.exports=function(t,r,n){var o=!1;return n=n||e,i.count=t,0===t?r():i;function i(t,e){if(i.count<=0)throw new Error("after called too many times");--i.count,t?(o=!0,r(t),r=n):0!==i.count||o||r(null,e)}}},9718:t=>{t.exports=function(t,e,r){var n=t.byteLength;if(e=e||0,r=r||n,t.slice)return t.slice(e,r);if(e<0&&(e+=n),r<0&&(r+=n),r>n&&(r=n),e>=n||e>=r||0===n)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(r-e),s=e,c=0;s<r;s++,c++)i[c]=o[s];return i.buffer}},4028:(t,e)=>{"use strict";function r(){return window}function n(){return document}function o(t,e){var r,n,o=e.documentElement,i=e.body;return void 0!==t.pageYOffset?(r=t.pageXOffset,n=t.pageYOffset):(r=o.scrollLeft||i.scrollLeft||0,n=o.scrollTop||i.scrollTop||0),{x:r,y:n}}function i(t){var e=t.documentElement,r=t.body;return{x:r.scrollHeight-e.clientWidth,y:r.scrollHeight-e.clientHeight}}function s(t,e){var r=n().getElementsByTagName(t);return Array.prototype.indexOf.call(r,e)}function c(t,e){return a(i(e),t).y}function a(t,e){return{x:e.x/t.x||0,y:e.y/t.y}}Object.defineProperty(e,"__esModule",{value:!0}),e.getWindow=r,e.getDocument=n,e.getBrowserScrollPosition=o,e.getDocumentScrollSpace=i,e.saveScrollPosition=function(t,e){var r=o(t,e);e.cookie="bs_scroll_pos="+[r.x,r.y].join(",")},e.restoreScrollPosition=function(){var t=n().cookie.replace(/(?:(?:^|.*;\s*)bs_scroll_pos\s*\=\s*([^;]*).*$)|^.*$/,"$1").split(",");r().scrollTo(Number(t[0]),Number(t[1]))},e.getElementIndex=s,e.forceChange=function(t){t.blur(),t.focus()},e.getElementData=function(t){var e=t.tagName;return{tagName:e,index:s(e,t)}},e.getSingleElement=function(t,e){return n().getElementsByTagName(t)[e]},e.getBody=function(){return n().getElementsByTagName("body")[0]},e.setScroll=function(t){r().scrollTo(t.x,t.y)},e.reloadBrowser=function(){r().location.reload(!0)},e.forEach=function(t,e){for(var r=0,n=t.length;r<n;r+=1)e(t[r],r,t)},e.isOldIe=function(){return void 0!==r().attachEvent},e.getLocation=function(t){var e=n().createElement("a");return e.href=t,""===e.host&&(e.href=e.href),e},e.isUndefined=function(t){return void 0===t},e.getByPath=function(t,e){for(var r=0,n=e.split("."),o=n.length;r<o;r++){if(!t||"object"!=typeof t)return!1;t=t[n[r]]}return void 0!==t&&t},e.getScrollPosition=function(t,e){var r=o(t,e);return{raw:r,proportional:c(r,e)}},e.getScrollPositionForElement=function(t){var e={x:t.scrollLeft,y:t.scrollTop};return{raw:e,proportional:a({x:t.scrollWidth,y:t.scrollHeight},e).y}},e.getScrollTopPercentage=c,e.getScrollPercentage=a},5053:(t,e,r)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0});var o,i=r(9122),s=r(5019),c=r(7471),a=r(1120),u=r(6082),p=r(1546);!function(t){t.PropSet="@@BSDOM.Events.PropSet",t.StyleSet="@@BSDOM.Events.StyleSet",t.LinkReplace="@@BSDOM.Events.LinkReplace",t.SetScroll="@@BSDOM.Events.SetScroll",t.SetWindowName="@@BSDOM.Events.SetWindowName"}(o=e.Events||(e.Events={})),e.domHandlers$=new i.BehaviorSubject(((n={})[o.PropSet]=s.propSetDomEffect,n[o.StyleSet]=c.styleSetDomEffect,n[o.LinkReplace]=a.linkReplaceDomEffect,n[o.SetScroll]=u.setScrollDomEffect,n[o.SetWindowName]=p.setWindowNameDomEffect,n))},1120:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2068),o=r(8111),i=r(5636),s=r(3592),c=r(6370),a=r(5053);e.linkReplaceDomEffect=function(t,e){return t.pipe(i.withLatestFrom(e.option$.pipe(c.pluck("injectNotification"))),o.filter((function(t){return t[1]})),n.map((function(t){var e=t[0],r=t[1],n="[LinkReplace] "+e.basename;return"overlay"===r?s.overlayInfo(n):s.consoleInfo(n)})))},e.linkReplace=function(t){return[a.Events.LinkReplace,t]}},5019:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2068),o=r(9890),i=r(5053),s=r(3592);e.propSetDomEffect=function(t){return t.pipe(o.tap((function(t){var e=t.target,r=t.prop,n=t.value;e[r]=n})),n.map((function(t){return s.consoleInfo("[PropSet]",t.target,t.prop+" = "+t.pathname)})))},e.propSet=function(t){return[i.Events.PropSet,t]}},6082:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1819),o=r(5636),i=r(9890),s=r(5053);e.setScroll=function(t,e){return[s.Events.SetScroll,{x:t,y:e}]},e.setScrollDomEffect=function(t,e){return t.pipe(o.withLatestFrom(e.window$),i.tap((function(t){var e=t[0];return t[1].scrollTo(e.x,e.y)})),n.ignoreElements())}},1546:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1819),o=r(5636),i=r(9890),s=r(5053);e.setWindowNameDomEffect=function(t,e){return t.pipe(o.withLatestFrom(e.window$),i.tap((function(t){var e=t[0];return t[1].name=e})),n.ignoreElements())},e.setWindowName=function(t){return[s.Events.SetWindowName,t]}},7471:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2068),o=r(5053),i=r(9890),s=r(3592);e.styleSetDomEffect=function(t){return t.pipe(i.tap((function(t){var e=t.style,r=t.styleName,n=t.newValue;e[r]=n})),n.map((function(t){return s.consoleInfo("[StyleSet] "+t.styleName+" = "+t.pathName)})))},e.styleSet=function(t){return[o.Events.StyleSet,t]}},2119:(t,e,r)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0});var o,i=r(9122),s=r(4449),c=r(6310),a=r(203),u=r(8558),p=r(5259),l=r(7680),h=r(1106),f=r(8109);!function(t){t.FileReload="@@FileReload",t.PreBrowserReload="@@PreBrowserReload",t.BrowserReload="@@BrowserReload",t.BrowserSetLocation="@@BrowserSetLocation",t.BrowserSetScroll="@@BrowserSetScroll",t.SetOptions="@@SetOptions",t.SimulateClick="@@SimulateClick",t.SetElementValue="@@SetElementValue",t.SetElementToggleValue="@@SetElementToggleValue"}(o=e.EffectNames||(e.EffectNames={})),e.effectOutputHandlers$=new i.BehaviorSubject(((n={})[o.SetOptions]=s.setOptionsEffect,n[o.FileReload]=c.fileReloadEffect,n[o.BrowserReload]=f.browserReloadEffect,n[o.BrowserSetLocation]=a.browserSetLocationEffect,n[o.SimulateClick]=u.simulateClickEffect,n[o.SetElementValue]=p.setElementValueEffect,n[o.SetElementToggleValue]=l.setElementToggleValueEffect,n[o.BrowserSetScroll]=h.setScrollEffect,n))},8109:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2119),o=r(9890),i=r(5636);e.browserReload=function(){return[n.EffectNames.BrowserReload]},e.preBrowserReload=function(){return[n.EffectNames.PreBrowserReload]},e.browserReloadEffect=function(t,e){return t.pipe(i.withLatestFrom(e.window$),o.tap((function(t){return t[1].location.reload(!0)})))}},203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1819),o=r(9890),i=r(5636),s=r(2119);e.browserSetLocationEffect=function(t,e){return t.pipe(i.withLatestFrom(e.window$),o.tap((function(t){var e=t[0],r=t[1];return e.path?r.location=r.location.protocol+"//"+r.location.host+e.path:e.url?r.location=e.url:void 0})),n.ignoreElements())},e.browserSetLocation=function(t){return[s.EffectNames.BrowserSetLocation,t]}},6310:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2119),o=r(4071),i=r(5636),s=r(904);e.fileReload=function(t){return[n.EffectNames.FileReload,t]},e.fileReloadEffect=function(t,e){return t.pipe(i.withLatestFrom(e.option$,e.document$,e.navigator$),s.mergeMap((function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return o.reload(n,i)(e,{tagNames:r.tagNames,liveCSS:!0,liveImg:!0})})))}},7680:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9890),o=r(5636),i=r(2119);e.setElementToggleValueEffect=function(t,e){return t.pipe(o.withLatestFrom(e.document$),n.tap((function(t){var e=t[0],r=t[1].getElementsByTagName(e.tagName)[e.index];r&&("radio"===e.type&&(r.checked=!0),"checkbox"===e.type&&(r.checked=e.checked),"SELECT"===e.tagName&&(r.value=e.value))})))},e.setElementToggleValue=function(t){return[i.EffectNames.SetElementToggleValue,t]}},5259:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9890),o=r(5636),i=r(2119);e.setElementValueEffect=function(t,e){return t.pipe(o.withLatestFrom(e.document$),n.tap((function(t){var e=t[0],r=t[1].getElementsByTagName(e.tagName)[e.index];r&&(r.value=e.value)})))},e.setElementValue=function(t){return[i.EffectNames.SetElementValue,t]}},4449:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1819),o=r(9890),i=r(2119);e.setOptionsEffect=function(t,e){return t.pipe(o.tap((function(t){return e.option$.next(t)})),n.ignoreElements())},e.setOptions=function(t){return[i.EffectNames.SetOptions,t]}},1106:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6370),o=r(1819),i=r(1398),s=r(3943),c=r(4028),a=r(9890),u=r(5636),p=r(2068);function l(t,e,r){return e&&t.scrollTo?t.scrollTo(0,t.scrollHeight*r.position.proportional):t.scrollTo(0,r.position.raw.y)}e.setScrollEffect=function(t,e){var r=t.pipe(u.withLatestFrom(e.window$,e.document$,e.option$.pipe(n.pluck("scrollProportionally")))),h=i.partition((function(t){return"document"===t[0].tagName}))(r),f=h[0],d=h[1],y=i.partition((function(t){return t[0].mappingIndex>-1}))(d),b=y[0],v=y[1];return s.merge(f.pipe(a.tap((function(t){var e=t[0],r=t[1],n=t[2],o=t[3],i=c.getDocumentScrollSpace(n);return o?r.scrollTo(0,i.y*e.position.proportional):r.scrollTo(0,e.position.raw.y)}))),v.pipe(a.tap((function(t){var e=t[0],r=(t[1],t[2]),n=t[3],o=r.getElementsByTagName(e.tagName);if(o&&o.length){var i=o[e.index];if(i)return l(i,n,e)}}))),b.pipe(u.withLatestFrom(e.option$.pipe(n.pluck("scrollElementMapping"))),p.map((function(t){var e=t[0],r=t[1],n=e[0];return[e,r.filter((function(t,e){return e!==n.mappingIndex}))]})),a.tap((function(t){var e=t[0],r=t[1],n=e[0],o=(e[1],e[2]),i=e[3];r.map((function(t){return o.querySelector(t)})).forEach((function(t){l(t,i,n)}))})))).pipe(o.ignoreElements())}},8558:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1819),o=r(9890),i=r(5636),s=r(2119);e.simulateClickEffect=function(t,e){return t.pipe(i.withLatestFrom(e.window$,e.document$),o.tap((function(t){var e=t[0],r=t[1],n=t[2],o=n.getElementsByTagName(e.tagName)[e.index];o&&(n.createEvent?r.setTimeout((function(){var t=n.createEvent("MouseEvents");t.initEvent("click",!0,!0),o.dispatchEvent(t)}),0):r.setTimeout((function(){if(n.createEventObject){var t=n.createEventObject();t.cancelBubble=!0,o.fireEvent("onclick",t)}}),0))})),n.ignoreElements())},e.simulateClick=function(t){return[s.EffectNames.SimulateClick,t]}},9271:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(5545),i=r(9979),s=r(4926),c=r(5053),a=r(2818),u=r(3943),p=r(3592),l=r(2119),h=r(4719),f=r(6908),d=r(7064),y=r(5636),b=r(904),v=r(567),m=r(8111),g=r(6370),w=r(9325),C=i.initWindow(),_=i.initDocument(),S=h.initWindowName(window),k=i.initSocket(),x=k.socket$,O=k.io$,E=i.initOptions(),F=w.of(navigator),j=s.initNotify(E.getValue()),A=p.initLogger(E.getValue()),P=f.initListeners(window,document,x,E),B={window$:C,document$:_,socket$:x,option$:E,navigator$:F,notifyElement$:j,logInstance$:A,io$:O,outgoing$:P};function N(t,e){return function(t,r){return r.pipe(d.groupBy((function(t){return t[0]})),y.withLatestFrom(t),m.filter((function(t){var e=t[0];return"function"==typeof t[1][e.key]})),b.mergeMap((function(t){var r=t[0];return t[1][r.key](r.pipe(g.pluck(String(1))),e)})),v.share())}}var T=o.zip(l.effectOutputHandlers$,h.scrollRestoreHandlers$,(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return n({},t,e)}),{})})),R=N(0,B)(a.socketHandlers$,u.merge(B.socket$,P)),I=N(0,B)(T,R),M=N(0,B)(c.domHandlers$,u.merge(I,S)),L=u.merge(R,I,M);N(0,B)(p.logHandler$,L).subscribe()},6908:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3943),o=r(1410),i=r(5455),s=r(1042),c=r(6889);e.initListeners=function(t,e,r,a){return n.merge(s.getScrollStream(t,e,r,a),i.getClickStream(e,r,a),o.getFormInputStream(e,r,a),c.getFormTogglesStream(e,r,a))}},5455:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(7827),o=r(2818),i=r(4028),s=r(9008),c=r(5636),a=r(8111),u=r(2068),p=r(6370),l=r(617),h=r(8713),f=r(6739),d=r(9126),y=r(6256);e.getClickStream=function(t,e,r){var b=n.createTimedBooleanSwitch(e.pipe(a.filter((function(t){return t[0]===o.IncomingSocketNames.Click}))));return r.pipe(l.skip(1),p.pluck("ghostMode","clicks"),h.distinctUntilChanged(),f.switchMap((function(e){return e?d.fromEvent(t,"click",!0).pipe(u.map((function(t){return t.target})),a.filter((function(e){if("LABEL"===e.tagName){var r=e.getAttribute("for");if(r&&t.getElementById(r))return!1}return!0})),c.withLatestFrom(b),a.filter((function(t){return t[1]})),u.map((function(t){var e=t[0];return s.outgoing(i.getElementData(e))}))):y.empty()})))}},1410:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2818),o=r(4028),i=r(7827),s=r(1077),c=r(8111),a=r(5636),u=r(2068),p=r(6370),l=r(617),h=r(8713),f=r(6739),d=r(6256),y=r(9126);e.getFormInputStream=function(t,e,r){var b=i.createTimedBooleanSwitch(e.pipe(c.filter((function(t){return t[0]===n.IncomingSocketNames.Keyup}))));return r.pipe(l.skip(1),p.pluck("ghostMode","forms","inputs"),h.distinctUntilChanged(),f.switchMap((function(e){return e?y.fromEvent(t.body,"keyup",!0).pipe(u.map((function(t){return t.target||t.srcElement})),c.filter((function(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName})),a.withLatestFrom(b),c.filter((function(t){return t[1]})),u.map((function(t){var e=t[0],r=o.getElementData(e),n=e.value;return s.outgoing(r,n)}))):d.empty()})))}},6889:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2818),o=r(4028),i=r(7827),s=r(3810),c=r(8111),a=r(617),u=r(6370),p=r(8713),l=r(5636),h=r(2068),f=r(6739),d=r(6256),y=r(9126);e.getFormTogglesStream=function(t,e,r){var b=i.createTimedBooleanSwitch(e.pipe(c.filter((function(t){return t[0]===n.IncomingSocketNames.InputToggle}))));return r.pipe(a.skip(1),u.pluck("ghostMode","forms","toggles"),p.distinctUntilChanged(),f.switchMap((function(e){return e?y.fromEvent(t,"change",!0).pipe(h.map((function(t){return t.target||t.srcElement})),c.filter((function(t){return"SELECT"===t.tagName})),l.withLatestFrom(b),c.filter((function(t){return t[1]})),h.map((function(t){var e=t[0],r=(t[1],o.getElementData(e));return s.outgoing(r,{type:e.type,checked:e.checked,value:e.value})}))):d.empty()})))}},1042:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(7827),o=r(2818),i=r(4028),s=r(2711),c=r(8111),a=r(2068),u=r(5636),p=r(6370),l=r(8713),h=r(6739),f=r(6256),d=r(617),y=r(9126);e.getScrollStream=function(t,e,r,b){var v=n.createTimedBooleanSwitch(r.pipe(c.filter((function(t){return t[0]===o.IncomingSocketNames.Scroll})))),m=b.pipe(p.pluck("scrollElementMapping"),a.map((function(t){return t.map((function(t){return e.querySelector(t)}))})));return b.pipe(d.skip(1),p.pluck("ghostMode","scroll"),l.distinctUntilChanged(),h.switchMap((function(r){return r?y.fromEvent(e,"scroll",!0).pipe(a.map((function(t){return t.target})),u.withLatestFrom(v,m),c.filter((function(t){var e=t[1];return Boolean(e)})),a.map((function(r){var n=r[0],o=(r[1],r[2]);if(n===e)return s.outgoing(i.getScrollPosition(t,e),"document",0);var c=e.getElementsByTagName(n.tagName),a=Array.prototype.indexOf.call(c||[],n);return s.outgoing(i.getScrollPositionForElement(n),n.tagName,a,o.indexOf(n))}))):f.empty()})))}},3592:(t,e,r)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0});var o,i,s=r(9122),c=r(4903),a=r(9325),u=r(8498),p=r(8111),l=r(9890),h=r(5636),f=r(6739),d=r(6370);e.initLogger=function(t){var e=new u.Nanologger(t.logPrefix||"",{colors:{magenta:"#0F2634"}});return a.of(e)},function(t){t.Log="@@Log",t.Info="@@Log.info",t.Debug="@@Log.debug"}(o=e.LogNames||(e.LogNames={})),function(t){t.Info="@@Overlay.info"}(i=e.Overlay||(e.Overlay={})),e.consoleInfo=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return[o.Log,[o.Info,t]]},e.consoleDebug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return[o.Log,[o.Debug,t]]},e.overlayInfo=function(t,e){return void 0===e&&(e=2e3),[i.Info,[t,e]]},e.logHandler$=new s.BehaviorSubject(((n={})[o.Log]=function(t,e){return t.pipe(h.withLatestFrom(e.logInstance$,e.option$.pipe(d.pluck("injectNotification"))),p.filter((function(t){return"console"===t[2]})),l.tap((function(t){var e=t[0],r=t[1];switch(e[0]){case o.Info:return r.info.apply(r,e[1]);case o.Debug:return r.debug.apply(r,e[1])}})))},n[i.Info]=function(t,e){return t.pipe(h.withLatestFrom(e.option$,e.notifyElement$,e.document$),p.filter((function(t){var e=t[1];return Boolean(e.notify)})),l.tap((function(t){var e=t[0],r=(t[1],t[2]),n=t[3];r.innerHTML=e[0],r.style.display="block",n.body.appendChild(r)})),f.switchMap((function(t){var e=t[0],r=(t[1],t[2]),n=t[3];return c.timer(e[1]||2e3).pipe(l.tap((function(){r.style.display="none",r.parentNode&&n.body.removeChild(r)})))})))},n))},2491:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6370),o=r(8111),i=r(2068),s=r(5636),c=r(203);e.incomingBrowserLocation=function(t,e){return t.pipe(s.withLatestFrom(e.option$.pipe(n.pluck("ghostMode","location"))),o.filter((function(t){return!0===t[1]})),i.map((function(t){var e=t[0];return c.browserSetLocation(e)})))}},5547:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2068),o=r(3592);e.incomingBrowserNotify=function(t){return t.pipe(n.map((function(t){return o.overlayInfo(t.message,t.timeout)})))}},4697:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8111),o=r(5636),i=r(904),s=r(5167),c=r(9325),a=r(8109),u=r(8348),p=r(8404);function l(){return s.concat(c.of(a.preBrowserReload()),c.of(a.browserReload()).pipe(u.subscribeOn(p.async)))}e.incomingBrowserReload=function(t,e){return t.pipe(o.withLatestFrom(e.option$),n.filter((function(t){return t[0],t[1].codeSync})),i.mergeMap(l))},e.reloadBrowserSafe=l},9008:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2818),o=r(6370),i=r(8111),s=r(2068),c=r(5636),a=r(8558);e.outgoing=function(t){return[n.OutgoingSocketEvents.Click,t]},e.incomingHandler$=function(t,e){return t.pipe(c.withLatestFrom(e.option$.pipe(o.pluck("ghostMode","clicks")),e.window$.pipe(o.pluck("location","pathname"))),i.filter((function(t){var e=t[0],r=t[1],n=t[2];return r&&e.pathname===n})),s.map((function(t){var e=t[0];return a.simulateClick(e)})))}},8201:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6370),o=r(9325),i=r(3592),s=r(5636),c=r(904),a=r(4449);e.incomingConnection=function(t,e){return t.pipe(s.withLatestFrom(e.option$.pipe(n.pluck("logPrefix"))),c.mergeMap((function(t){var e=t[0],r=t[1],n=r?r+": ":"";return o.of(a.setOptions(e),i.overlayInfo(n+"connected"))})))}},5950:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1819),o=r(9890);e.incomingDisconnect=function(t){return t.pipe(o.tap((function(t){return console.log(t)})),n.ignoreElements())}},1459:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8111),o=r(6256),i=r(7827),s=r(9325),c=r(5636),a=r(904),u=r(6310),p=r(4697);e.incomingFileReload=function(t,e){return t.pipe(c.withLatestFrom(e.option$),n.filter((function(t){return t[0],t[1].codeSync})),a.mergeMap((function(t){var e=t[0],r=t[1];return e.url||!r.injectChanges?p.reloadBrowserSafe():e.basename&&e.ext&&i.isBlacklisted(e)?o.empty():s.of(u.fileReload(e))})))}},3810:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(2818),i=r(6370),s=r(8111),c=r(2068),a=r(5636),u=r(7680);e.outgoing=function(t,e){return[o.OutgoingSocketEvents.InputToggle,n({},t,e)]},e.incomingInputsToggles=function(t,e){return t.pipe(a.withLatestFrom(e.option$.pipe(i.pluck("ghostMode","forms","toggles")),e.window$.pipe(i.pluck("location","pathname"))),s.filter((function(t){return!0===t[1]})),c.map((function(t){var e=t[0];return u.setElementToggleValue(e)})))}},1077:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(2818),i=r(6370),s=r(8111),c=r(2068),a=r(5636),u=r(5259);e.outgoing=function(t,e){return[o.OutgoingSocketEvents.Keyup,n({},t,{value:e})]},e.incomingKeyupHandler=function(t,e){return t.pipe(a.withLatestFrom(e.option$.pipe(i.pluck("ghostMode","forms","inputs")),e.window$.pipe(i.pluck("location","pathname"))),s.filter((function(t){var e=t[0],r=t[1],n=t[2];return r&&e.pathname===n})),c.map((function(t){var e=t[0];return u.setElementValue(e)})))}},1064:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2068),o=r(4449);e.incomingOptionsSet=function(t){return t.pipe(n.map((function(t){return o.setOptions(t.options)})))}},2711:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2818),o=r(6370),i=r(8111),s=r(2068),c=r(5636),a=r(2119);e.outgoing=function(t,e,r,o){return void 0===o&&(o=-1),[n.OutgoingSocketEvents.Scroll,{position:t,tagName:e,index:r,mappingIndex:o}]},e.incomingScrollHandler=function(t,e){return t.pipe(c.withLatestFrom(e.option$.pipe(o.pluck("ghostMode","scroll")),e.window$.pipe(o.pluck("location","pathname"))),i.filter((function(t){var e=t[0],r=t[1],n=t[2];return r&&e.pathname===n})),s.map((function(t){var e=t[0];return[a.EffectNames.BrowserSetScroll,e]})))}},4926:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9122),o={display:"none",padding:"15px",fontFamily:"sans-serif",position:"fixed",fontSize:"0.9em",zIndex:9999,right:0,top:0,borderBottomLeftRadius:"5px",backgroundColor:"#1B2032",margin:0,color:"white",textAlign:"center",pointerEvents:"none"};e.initNotify=function(t){var e,r=o;if(t.notify.styles)if("[object Array]"===Object.prototype.toString.call(t.notify.styles))r=t.notify.styles.join(";");else for(var i in t.notify.styles)t.notify.styles.hasOwnProperty(i)&&(r[i]=t.notify.styles[i]);if((e=document.createElement("DIV")).id="__bs_notify__","string"==typeof r)e.style.cssText=r;else for(var s in r)e.style[s]=r[s];return new n.BehaviorSubject(e)}},4719:(t,e,r)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0});var o=r(4028),i=r(2119),s=r(9122),c=r(6256),a=r(9325),u=r(3592),p=r(5636),l=r(2068),h=r(1546),f=r(6082);e.PREFIX="<<BS_START>>",e.SUFFIX="<<BS_START>>",e.regex=new RegExp(e.PREFIX+"(.+?)"+e.SUFFIX,"g"),e.initWindowName=function(t){var r=function(){try{return function(t){for(var r,n;r=e.regex.exec(t);)n=r[1];if(n)return JSON.parse(n)}(t.name)}catch(t){return{}}}();if(t.name=t.name.replace(e.regex,""),r&&r.bs&&r.bs.hardReload&&r.bs.scroll){var n=r.bs.scroll,o=n.x,i=n.y;return a.of(f.setScroll(o,i),u.consoleDebug("[ScrollRestore] x = "+o+" y = "+i))}return c.empty()},e.scrollRestoreHandlers$=new s.BehaviorSubject(((n={})[i.EffectNames.PreBrowserReload]=function(t,r){return t.pipe(p.withLatestFrom(r.window$,r.document$),l.map((function(t){var r=t[1],n=t[2];return[r.name,e.PREFIX,JSON.stringify({bs:{hardReload:!0,scroll:o.getBrowserScrollPosition(r,n)}}),e.SUFFIX].join("")})),l.map((function(t){return h.setWindowName(t)})))},n))},2818:function(t,e,r){"use strict";var n,o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i,s,c=r(9122),a=r(5636),u=r(1819),p=r(9890),l=r(6370),h=r(2711),f=r(9008),d=r(1077),y=r(5547),b=r(2491),v=r(4697),m=r(1459),g=r(8201),w=r(5950),C=r(3810),_=r(1064);function S(t){return function(e,r){return e.pipe(a.withLatestFrom(r.io$,r.window$.pipe(l.pluck("location","pathname"))),p.tap((function(e){var r=e[0],n=e[1],i=e[2];return n.emit(t,o({},r,{pathname:i}))})),u.ignoreElements())}}!function(t){t.Connection="connection",t.Disconnect="disconnect",t.FileReload="file:reload",t.BrowserReload="browser:reload",t.BrowserLocation="browser:location",t.BrowserNotify="browser:notify",t.Scroll="scroll",t.Click="click",t.Keyup="input:text",t.InputToggle="input:toggles",t.OptionsSet="options:set"}(i=e.IncomingSocketNames||(e.IncomingSocketNames={})),function(t){t.Scroll="@@outgoing/scroll",t.Click="@@outgoing/click",t.Keyup="@@outgoing/keyup",t.InputToggle="@@outgoing/Toggle"}(s=e.OutgoingSocketEvents||(e.OutgoingSocketEvents={})),e.socketHandlers$=new c.BehaviorSubject(((n={})[i.Connection]=g.incomingConnection,n[i.Disconnect]=w.incomingDisconnect,n[i.FileReload]=m.incomingFileReload,n[i.BrowserReload]=v.incomingBrowserReload,n[i.BrowserLocation]=b.incomingBrowserLocation,n[i.BrowserNotify]=y.incomingBrowserNotify,n[i.Scroll]=h.incomingScrollHandler,n[i.Click]=f.incomingHandler$,n[i.Keyup]=d.incomingKeyupHandler,n[i.InputToggle]=C.incomingInputsToggles,n[i.OptionsSet]=_.incomingOptionsSet,n[s.Scroll]=S(i.Scroll),n[s.Click]=S(i.Click),n[s.Keyup]=S(i.Keyup),n[s.InputToggle]=S(i.InputToggle),n))},9979:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6809),o=r(5100),i=r(9122),s=r(9325),c=r(567);e.initWindow=function(){return s.of(window)},e.initDocument=function(){return s.of(document)},e.initNavigator=function(){return s.of(navigator)},e.initOptions=function(){return new i.BehaviorSubject(window.___browserSync___.options)},e.initSocket=function(){var t=window.___browserSync___.socketConfig,e=window.___browserSync___.socketUrl,r=n(e,t),s=r.onevent,a=o.Observable.create((function(t){r.onevent=function(e){s.call(this,e),t.next(e.data)}})).pipe(c.share()),u=new i.BehaviorSubject(r);return window.___browserSync___.socket=r,{socket$:a,io$:u}}},7827:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(5167),o=r(4903),i=r(9325),s=r(6739),c=r(2946),a=r(8621);e.each=function(t){return[].slice.call(t||[])},e.splitUrl=function(t){var e,r,n;return(r=t.indexOf("#"))>=0?(e=t.slice(r),t=t.slice(0,r)):e="",(r=t.indexOf("?"))>=0?(n=t.slice(r),t=t.slice(0,r)):n="",{url:t,params:n,hash:e}},e.pathFromUrl=function(t){var r;return r=0===(t=e.splitUrl(t).url).indexOf("file://")?t.replace(new RegExp("^file://(localhost)?"),""):t.replace(new RegExp("^([^:]+:)?//([^:/]+)(:\\d*)?/"),"/"),decodeURIComponent(r)},e.pickBestMatch=function(t,r,n){var o,i={score:0,object:null};return r.forEach((function(r){(o=e.numberOfMatchingSegments(t,n(r)))>i.score&&(i={object:r,score:o})})),i.score>0?i:null},e.numberOfMatchingSegments=function(t,e){if((t=p(t))===(e=p(e)))return 1e4;for(var r=t.split("/").reverse(),n=e.split("/").reverse(),o=Math.min(r.length,n.length),i=0;i<o&&r[i]===n[i];)++i;return i},e.pathsMatch=function(t,r){return e.numberOfMatchingSegments(t,r)>0},e.getLocation=function(t){var e=document.createElement("a");return e.href=t,""===e.host&&(e.href=e.href),e},e.updateSearch=function(t,e,r){return""===t?"?"+r:"?"+t.slice(1).split("&").map((function(t){return t.split("=")})).filter((function(t){return t[0]!==e})).map((function(t){return[t[0],t[1]].join("=")})).concat(r).join("&")};var u=[function(t){return"map"===t.ext}];function p(t){return t.replace(/^\/+/,"").replace(/\\/g,"/").toLowerCase()}e.isBlacklisted=function(t){return u.some((function(e){return e(t)}))},e.createTimedBooleanSwitch=function(t,e){return void 0===e&&(e=1e3),t.pipe(s.switchMap((function(){return n.concat(i.of(!1),o.timer(e).pipe(a.mapTo(!0)))})),c.startWith(!0))},e.array=function(t){return[].slice.call(t)},e.normalisePath=p},4071:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,o=r(7827),i=r(6256),s=r(5100),c=r(3943),a=r(4903),u=r(7038),p=r(8111),l=r(2068),h=r(904),f=r(9890),d=r(8621),y=r(5019),b=r(7471),v=r(1120),m=r(3430),g=[{selector:"background",styleNames:["backgroundImage"]},{selector:"border",styleNames:["borderImage","webkitBorderImage","MozBorderImage"]}],w={link:"href",img:"src",script:"src"};e.reload=function(t,e){return function(n,o){var s=n.path;if(o.liveCSS&&s.match(/\.css$/i))return k(s,t,e);if(o.liveImg&&s.match(/\.(jpe?g|png|gif)$/i))return r(s,t);for(var c=function(t,e,r){var n=e.tagNames[t];return{attr:w[n],tagName:n,elems:r.getElementsByTagName(n)}}(n.ext,o,t),a=function(t,e,r){if("*"===e[0])return t;for(var n=[],o=new RegExp("(^|/)"+e),i=0,s=t.length;i<s;i+=1)o.test(t[i][r])&&n.push(t[i]);return n}(c.elems,n.basename,c.attr),u=0,p=a.length;u<p;u+=1)C(a[u],c,o,t,e);return i.empty()};function r(t,e){var r=E(Date.now());return c.merge(u.from([].slice.call(e.images)).pipe(p.filter((function(e){return o.pathsMatch(t,o.pathFromUrl(e.src))})),l.map((function(t){var e={target:t,prop:"src",value:S(t.src,r),pathname:o.getLocation(t.src).pathname};return y.propSet(e)}))),u.from(g).pipe(h.mergeMap((function(n){var i=n.selector,s=n.styleNames;return u.from(e.querySelectorAll("[style*="+i+"]")).pipe(h.mergeMap((function(e){return function(t,e,r,n){return u.from(e).pipe(p.filter((function(e){return"string"==typeof t[e]})),l.map((function(e){var i,s=t[e],c=s.replace(new RegExp("\\burl\\s*\\(([^)]*)\\)"),(function(t,e){var s=e;return'"'===e[0]&&'"'===e[e.length-1]&&(s=e.slice(1,-1)),i=o.getLocation(s).pathname,o.pathsMatch(r,o.pathFromUrl(s))?"url("+S(s,n)+")":t}));return[t,e,s,c,i]})),p.filter((function(t){t[0],t[1];var e=t[2];return t[3]!==e})),l.map((function(t){var e=t[0],r=t[1],n=t[2],o=t[3],i=t[4];return b.styleSet({style:e,styleName:r,value:n,newValue:o,pathName:i})})))}(e.style,s,t,r)})))}))))}function C(t,e,i,s,c){var a=e.attr,u=t[a],p=(new Date).getTime(),l="browsersync-legacy",h=l+"="+p,f=o.getLocation(u),d=o.updateSearch(f.search,l,h);switch(e.tagName){case"link":k(u,s,c);break;case"img":r(u,s);break;default:!1===i.timestamps?t[a]=f.href:t[a]=f.href.split("?")[0]+d,setTimeout((function(){n?(n.style.display="none",n.style.display="block"):(n=s.createElement("DIV"),s.body.appendChild(n))}),200)}return{elem:t,timeStamp:p}}function _(t,e,r){var n;if(t.__LiveReload_pendingRemoval)return i.empty();t.__LiveReload_pendingRemoval=!0,"STYLE"===t.tagName?((n=e.createElement("link")).rel="stylesheet",n.media=t.media,n.disabled=t.disabled):n=t.cloneNode(!1);var c=t.href,u=S(O(t));n.href=u;var p,l=o.getLocation(u).pathname,y=l.split("/").slice(-1)[0],b=t.parentNode;return b.lastChild===t?b.appendChild(n):b.insertBefore(n,t.nextSibling),p=/AppleWebKit/.test(r.userAgent)?5:200,s.Observable.create((function(t){n.onload=function(){t.next(!0),t.complete()}})).pipe(h.mergeMap((function(){return a.timer(p).pipe(f.tap((function(){t&&!t.parentNode||(t.parentNode.removeChild(t),n.onreadystatechange=null)})),d.mapTo(v.linkReplace({target:n,nextHref:u,prevHref:c,pathname:l,basename:y})))})))}function S(t,e){var r,n,i;void 0===e&&(e=E(Date.now())),t=(r=o.splitUrl(t)).url,n=r.hash;var s=(i=r.params).replace(/(\?|&)browsersync=(\d+)/,(function(t,r){return""+r+e}));return s===i&&(s=0===i.length?"?"+e:i+"&"+e),t+s+n}function k(t,e,r){var n=o.array(e.getElementsByTagName("link")).filter((function(t){return t.rel.match(/^stylesheet$/i)&&!t.__LiveReload_pendingRemoval})),s=o.array(e.getElementsByTagName("style")).filter((function(t){return Boolean(t.sheet)})).reduce((function(t,e){return t.concat(x(e,e.sheet))}),[]),c=n.reduce((function(t,e){return t.concat(x(e,e.sheet))}),[]),p=n.concat(s,c),l=o.pickBestMatch(t,p,(function(t){return o.pathFromUrl(O(t))}));if(l)return l.object&&l.object.rule?function(t,e){var r=t.rule,n=t.index,o=t.link,i=r.parentStyleSheet,s=S(r.href),c=r.media.length?[].join.call(r.media,", "):"",u='@import url("'+s+'") '+c+";";r.__LiveReload_newHref=s;var p=e.createElement("link");return p.rel="stylesheet",p.href=s,p.__LiveReload_pendingRemoval=!0,o.parentNode&&o.parentNode.insertBefore(p,o),a.timer(200).pipe(f.tap((function(){p.parentNode&&p.parentNode.removeChild(p),r.__LiveReload_newHref===s&&(i.insertRule(u,n),i.deleteRule(n+1),(r=i.cssRules[n]).__LiveReload_newHref=s)})),h.mergeMap((function(){return a.timer(200).pipe(f.tap((function(){if(r.__LiveReload_newHref===s)return i.insertRule(u,n),i.deleteRule(n+1)})))})))}(l.object,e):_(l.object,e,r);if(n.length){var d=t.split("."),y=d[0];if(d.slice(1),"*"===y)return u.from(n.map((function(t){return _(t,e,r)}))).pipe(m.mergeAll())}return i.empty()}function x(t,e){var r=[];return function t(e,o){if(o&&o.length)for(var i=0;i<o.length;i++){var s=o[i];switch(s.type){case CSSRule.CHARSET_RULE:break;case CSSRule.IMPORT_RULE:r.push({link:e,rule:s,index:i,href:s.href}),t(e,n(s.styleSheet))}}}(t,n(e)),r;function n(t){var e;try{e=null!=t?t.cssRules:void 0}catch(t){}return e}}function O(t){return t.href||t.getAttribute("data-href")}function E(t){return"browsersync="+t}}},8498:function(t,e){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var n={trace:"🔍",debug:"🐛",info:"✨",warn:"⚠️",error:"🚨",fatal:"💀"},o={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},i={foreground:"#d3c0c8",background:"#2d2d2d",black:"#2d2d2d",red:"#f2777a",green:"#99cc99",yellow:"#ffcc66",blue:"#6699cc",magenta:"#cc99cc",cyan:"#66cccc",white:"#d3d0c8",brightBlack:"#747369"},s=function(){function t(t,e){this.name=t,this.opts=e,this._name=t||"",this._colors=r({},i,e.colors||{});try{this.logLevel=window.localStorage.getItem("logLevel")||"info"}catch(t){this.logLevel="info"}this._logLevel=o[this.logLevel]}return t.prototype.trace=function(){for(var t=["trace"],e=0,r=arguments.length;e<r;e++)t.push(arguments[e]);this._print.apply(this,t)},t.prototype.debug=function(){for(var t=["debug"],e=0,r=arguments.length;e<r;e++)t.push(arguments[e]);this._print.apply(this,t)},t.prototype.info=function(){for(var t=["info"],e=0,r=arguments.length;e<r;e++)t.push(arguments[e]);this._print.apply(this,t)},t.prototype.warn=function(){for(var t=["warn"],e=0,r=arguments.length;e<r;e++)t.push(arguments[e]);this._print.apply(this,t)},t.prototype.error=function(){for(var t=["error"],e=0,r=arguments.length;e<r;e++)t.push(arguments[e]);this._print.apply(this,t)},t.prototype.fatal=function(){for(var t=["fatal"],e=0,r=arguments.length;e<r;e++)t.push(arguments[e]);this._print.apply(this,t)},t.prototype._print=function(t){if(!(o[t]<this._logLevel)){var e=n[t],r=this._name||"unknown",i="error"===t||t.fatal?this._colors.red:"warn"===t?this._colors.yellow:this._colors.green,s=[],a=[null],u=e+" %c%s";a.push(c(this._colors.magenta),r);for(var p=1,l=arguments.length;p<l;p++){var h=arguments[p];"string"==typeof h?1===p?(u+=" %c%s",a.push(c(i)),a.push(h)):/ms$/.test(h)?(u+=" %c%s",a.push(c(this._colors.brightBlack)),a.push(h)):(u+=" %c%s",a.push(c(this._colors.white)),a.push(h)):"number"==typeof h?(u+=" %c%d",a.push(c(this._colors.magenta)),a.push(h)):s.push(h)}a[0]=u,s.forEach((function(t){a.push(t)})),Function.prototype.apply.apply(console.log,[console,a])}},t}();function c(t){return"color: "+t+";"}e.Nanologger=s},3010:t=>{function e(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=e,e.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-r:t+r}return 0|Math.min(t,this.max)},e.prototype.reset=function(){this.attempts=0},e.prototype.setMin=function(t){this.ms=t},e.prototype.setMax=function(t){this.max=t},e.prototype.setJitter=function(t){this.jitter=t}},3704:(t,e)=>{!function(t){"use strict";e.encode=function(e){var r,n=new Uint8Array(e),o=n.length,i="";for(r=0;r<o;r+=3)i+=t[n[r]>>2],i+=t[(3&n[r])<<4|n[r+1]>>4],i+=t[(15&n[r+1])<<2|n[r+2]>>6],i+=t[63&n[r+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(e){var r,n,o,i,s,c=.75*e.length,a=e.length,u=0;"="===e[e.length-1]&&(c--,"="===e[e.length-2]&&c--);var p=new ArrayBuffer(c),l=new Uint8Array(p);for(r=0;r<a;r+=4)n=t.indexOf(e[r]),o=t.indexOf(e[r+1]),i=t.indexOf(e[r+2]),s=t.indexOf(e[r+3]),l[u++]=n<<2|o>>4,l[u++]=(15&o)<<4|i>>2,l[u++]=(3&i)<<6|63&s;return p}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},5548:t=>{var e=void 0!==e?e:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,r=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),n=r&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),o=e&&e.prototype.append&&e.prototype.getBlob;function i(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var r=new Uint8Array(t.byteLength);r.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=r.buffer}return e}return t}))}function s(t,r){r=r||{};var n=new e;return i(t).forEach((function(t){n.append(t)})),r.type?n.getBlob(r.type):n.getBlob()}function c(t,e){return new Blob(i(t),e||{})}"undefined"!=typeof Blob&&(s.prototype=Blob.prototype,c.prototype=Blob.prototype),t.exports=r?n?Blob:c:o?s:void 0},6077:t=>{var e=[].slice;t.exports=function(t,r){if("string"==typeof r&&(r=t[r]),"function"!=typeof r)throw new Error("bind() requires a function");var n=e.call(arguments,2);return function(){return r.apply(t,n.concat(e.call(arguments)))}}},3861:t=>{t.exports=function(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},3549:t=>{t.exports="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},5983:(t,e,r)=>{t.exports=r(2192),t.exports.parser=r(4455)},2192:(t,e,r)=>{var n=r(3352),o=r(8746),i=r(4802)("engine.io-client:socket"),s=r(7355),c=r(4455),a=r(4187),u=r(1830);function p(t,e){if(!(this instanceof p))return new p(t,e);e=e||{},t&&"object"==typeof t&&(e=t,t=null),t?(t=a(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=a(e.host).host),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=u.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.withCredentials=!1!==e.withCredentials,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.transportOptions=e.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=!1!==e.perMessageDeflate&&(e.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||void 0,this.key=e.key||void 0,this.passphrase=e.passphrase||void 0,this.cert=e.cert||void 0,this.ca=e.ca||void 0,this.ciphers=e.ciphers||void 0,this.rejectUnauthorized=void 0===e.rejectUnauthorized||e.rejectUnauthorized,this.forceNode=!!e.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),e.localAddress&&(this.localAddress=e.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}t.exports=p,p.priorWebsocketSuccess=!1,o(p.prototype),p.protocol=c.protocol,p.Socket=p,p.Transport=r(6496),p.transports=r(3352),p.parser=r(4455),p.prototype.createTransport=function(t){i('creating transport "%s"',t);var e=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}(this.query);e.EIO=c.protocol,e.transport=t;var r=this.transportOptions[t]||{};return this.id&&(e.sid=this.id),new n[t]({query:e,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,withCredentials:r.withCredentials||this.withCredentials,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative})},p.prototype.open=function(){var t;if(this.rememberUpgrade&&p.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout((function(){e.emit("error","No transports available")}),0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},p.prototype.setTransport=function(t){i("setting transport %s",t.name);var e=this;this.transport&&(i("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",(function(){e.onDrain()})).on("packet",(function(t){e.onPacket(t)})).on("error",(function(t){e.onError(t)})).on("close",(function(){e.onClose("transport close")}))},p.prototype.probe=function(t){i('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),r=!1,n=this;function o(){if(n.onlyBinaryUpgrades){var o=!this.supportsBinary&&n.transport.supportsBinary;r=r||o}r||(i('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",(function(o){if(!r)if("pong"===o.type&&"probe"===o.data){if(i('probe transport "%s" pong',t),n.upgrading=!0,n.emit("upgrading",e),!e)return;p.priorWebsocketSuccess="websocket"===e.name,i('pausing current transport "%s"',n.transport.name),n.transport.pause((function(){r||"closed"!==n.readyState&&(i("changing transport and sending upgrade packet"),h(),n.setTransport(e),e.send([{type:"upgrade"}]),n.emit("upgrade",e),e=null,n.upgrading=!1,n.flush())}))}else{i('probe transport "%s" failed',t);var s=new Error("probe error");s.transport=e.name,n.emit("upgradeError",s)}})))}function s(){r||(r=!0,h(),e.close(),e=null)}function c(r){var o=new Error("probe error: "+r);o.transport=e.name,s(),i('probe transport "%s" failed because of error: %s',t,r),n.emit("upgradeError",o)}function a(){c("transport closed")}function u(){c("socket closed")}function l(t){e&&t.name!==e.name&&(i('"%s" works - aborting "%s"',t.name,e.name),s())}function h(){e.removeListener("open",o),e.removeListener("error",c),e.removeListener("close",a),n.removeListener("close",u),n.removeListener("upgrading",l)}p.priorWebsocketSuccess=!1,e.once("open",o),e.once("error",c),e.once("close",a),this.once("close",u),this.once("upgrading",l),e.open()},p.prototype.onOpen=function(){if(i("socket open"),this.readyState="open",p.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){i("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},p.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(i('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else i('packet received with socket readyState "%s"',this.readyState)},p.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},p.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout((function(){"closed"!==e.readyState&&e.onClose("ping timeout")}),t||e.pingInterval+e.pingTimeout)},p.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout((function(){i("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)}),t.pingInterval)},p.prototype.ping=function(){var t=this;this.sendPacket("ping",(function(){t.emit("ping")}))},p.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},p.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(i("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},p.prototype.write=p.prototype.send=function(t,e,r){return this.sendPacket("message",t,e,r),this},p.prototype.sendPacket=function(t,e,r,n){if("function"==typeof e&&(n=e,e=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){(r=r||{}).compress=!1!==r.compress;var o={type:t,data:e,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}},p.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var t=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?n():e()})):this.upgrading?n():e()}function e(){t.onClose("forced close"),i("socket closing - telling transport to close"),t.transport.close()}function r(){t.removeListener("upgrade",r),t.removeListener("upgradeError",r),e()}function n(){t.once("upgrade",r),t.once("upgradeError",r)}return this},p.prototype.onError=function(t){i("socket error %j",t),p.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},p.prototype.onClose=function(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(i('socket close with reason: "%s"',t),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)},p.prototype.filterUpgrades=function(t){for(var e=[],r=0,n=t.length;r<n;r++)~s(this.transports,t[r])&&e.push(t[r]);return e}},6496:(t,e,r)=>{var n=r(4455),o=r(8746);function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.withCredentials=t.withCredentials,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.isReactNative=t.isReactNative,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}t.exports=i,o(i.prototype),i.prototype.onError=function(t,e){var r=new Error(t);return r.type="TransportError",r.description=e,this.emit("error",r),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){var e=n.decodePacket(t,this.socket.binaryType);this.onPacket(e)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},3352:(t,e,r)=>{var n=r(2777),o=r(3416),i=r(9785),s=r(4442);e.polling=function(t){var e=!1,r=!1,s=!1!==t.jsonp;if("undefined"!=typeof location){var c="https:"===location.protocol,a=location.port;a||(a=c?443:80),e=t.hostname!==location.hostname||a!==t.port,r=t.secure!==c}if(t.xdomain=e,t.xscheme=r,"open"in new n(t)&&!t.forceJSONP)return new o(t);if(!s)throw new Error("JSONP disabled");return new i(t)},e.websocket=s},9785:(t,e,r)=>{var n=r(9015),o=r(3861),i=r(3549);t.exports=p;var s,c=/\n/g,a=/\\n/g;function u(){}function p(t){n.call(this,t),this.query=this.query||{},s||(s=i.___eio=i.___eio||[]),this.index=s.length;var e=this;s.push((function(t){e.onData(t)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){e.script&&(e.script.onerror=u)}),!1)}o(p,n),p.prototype.supportsBinary=!1,p.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),n.prototype.doClose.call(this)},p.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(e,r):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)}),100)},p.prototype.doWrite=function(t,e){var r=this;if(!this.form){var n,o=document.createElement("form"),i=document.createElement("textarea"),s=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=s,o.method="POST",o.setAttribute("accept-charset","utf-8"),i.name="d",o.appendChild(i),document.body.appendChild(o),this.form=o,this.area=i}function u(){p(),e()}function p(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(t){r.onError("jsonp polling iframe removal error",t)}try{var t='<iframe src="javascript:0" name="'+r.iframeId+'">';n=document.createElement(t)}catch(t){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form.action=this.uri(),p(),t=t.replace(a,"\\\n"),this.area.value=t.replace(c,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&u()}:this.iframe.onload=u}},3416:(t,e,r)=>{var n=r(2777),o=r(9015),i=r(8746),s=r(3861),c=r(4802)("engine.io-client:polling-xhr"),a=r(3549);function u(){}function p(t){if(o.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,"undefined"!=typeof location){var e="https:"===location.protocol,r=location.port;r||(r=e?443:80),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||r!==t.port,this.xs=t.secure!==e}}function l(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.withCredentials=t.withCredentials,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}function h(){for(var t in l.requests)l.requests.hasOwnProperty(t)&&l.requests[t].abort()}t.exports=p,t.exports.Request=l,s(p,o),p.prototype.supportsBinary=!0,p.prototype.request=function(t){return(t=t||{}).uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.withCredentials=this.withCredentials,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new l(t)},p.prototype.doWrite=function(t,e){var r="string"!=typeof t&&void 0!==t,n=this.request({method:"POST",data:t,isBinary:r}),o=this;n.on("success",e),n.on("error",(function(t){o.onError("xhr post error",t)})),this.sendXhr=n},p.prototype.doPoll=function(){c("xhr poll");var t=this.request(),e=this;t.on("data",(function(t){e.onData(t)})),t.on("error",(function(t){e.onError("xhr poll error",t)})),this.pollXhr=t},i(l.prototype),l.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new n(t),r=this;try{c("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var o in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(o)&&e.setRequestHeader(o,this.extraHeaders[o])}catch(t){}if("POST"===this.method)try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in e&&(e.withCredentials=this.withCredentials),this.requestTimeout&&(e.timeout=this.requestTimeout),this.hasXDR()?(e.onload=function(){r.onLoad()},e.onerror=function(){r.onError(e.responseText)}):e.onreadystatechange=function(){if(2===e.readyState)try{var t=e.getResponseHeader("Content-Type");(r.supportsBinary&&"application/octet-stream"===t||"application/octet-stream; charset=UTF-8"===t)&&(e.responseType="arraybuffer")}catch(t){}4===e.readyState&&(200===e.status||1223===e.status?r.onLoad():setTimeout((function(){r.onError("number"==typeof e.status?e.status:0)}),0))},c("xhr data %s",this.data),e.send(this.data)}catch(t){return void setTimeout((function(){r.onError(t)}),0)}"undefined"!=typeof document&&(this.index=l.requestsCount++,l.requests[this.index]=this)},l.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},l.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},l.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},l.prototype.cleanup=function(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=u:this.xhr.onreadystatechange=u,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete l.requests[this.index],this.xhr=null}},l.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch(t){}t=("application/octet-stream"===e||"application/octet-stream; charset=UTF-8"===e)&&this.xhr.response||this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},l.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},l.prototype.abort=function(){this.cleanup()},l.requestsCount=0,l.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",h):"function"==typeof addEventListener&&addEventListener("onpagehide"in a?"pagehide":"unload",h,!1))},9015:(t,e,r)=>{var n=r(6496),o=r(1830),i=r(4455),s=r(3861),c=r(2281),a=r(4802)("engine.io-client:polling");t.exports=p;var u=null!=new(r(2777))({xdomain:!1}).responseType;function p(t){var e=t&&t.forceBase64;u&&!e||(this.supportsBinary=!1),n.call(this,t)}s(p,n),p.prototype.name="polling",p.prototype.doOpen=function(){this.poll()},p.prototype.pause=function(t){var e=this;function r(){a("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(a("we are currently polling - waiting to pause"),n++,this.once("pollComplete",(function(){a("pre-pause polling complete"),--n||r()}))),this.writable||(a("we are currently writing - waiting to pause"),n++,this.once("drain",(function(){a("pre-pause writing complete"),--n||r()})))}else r()},p.prototype.poll=function(){a("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},p.prototype.onData=function(t){var e=this;a("polling got data %s",t),i.decodePayload(t,this.socket.binaryType,(function(t,r,n){if("opening"===e.readyState&&"open"===t.type&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():a('ignoring poll - transport state "%s"',this.readyState))},p.prototype.doClose=function(){var t=this;function e(){a("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(a("transport open - closing"),e()):(a("transport not open - deferring close"),this.once("open",e))},p.prototype.write=function(t){var e=this;this.writable=!1;var r=function(){e.writable=!0,e.emit("drain")};i.encodePayload(t,this.supportsBinary,(function(t){e.doWrite(t,r)}))},p.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||t.sid||(t.b64=1),t=o.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(r=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+t}},4442:(t,e,r)=>{var n,o,i=r(6496),s=r(4455),c=r(1830),a=r(3861),u=r(2281),p=r(4802)("engine.io-client:websocket");if("undefined"!=typeof WebSocket?n=WebSocket:"undefined"!=typeof self&&(n=self.WebSocket||self.MozWebSocket),"undefined"==typeof window)try{o=r(418)}catch(t){}var l=n||o;function h(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=n&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(l=o),i.call(this,t)}t.exports=h,a(h,i),h.prototype.name="websocket",h.prototype.supportsBinary=!0,h.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,r={};this.isReactNative||(r.agent=this.agent,r.perMessageDeflate=this.perMessageDeflate,r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized),this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new l(t,e):new l(t):new l(t,e,r)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},h.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},h.prototype.write=function(t){var e=this;this.writable=!1;for(var r=t.length,n=0,o=r;n<o;n++)!function(t){s.encodePacket(t,e.supportsBinary,(function(n){if(!e.usingBrowserWebSocket){var o={};t.options&&(o.compress=t.options.compress),e.perMessageDeflate&&("string"==typeof n?Buffer.byteLength(n):n.length)<e.perMessageDeflate.threshold&&(o.compress=!1)}try{e.usingBrowserWebSocket?e.ws.send(n):e.ws.send(n,o)}catch(t){p("websocket closed before onclose event")}--r||(e.emit("flush"),setTimeout((function(){e.writable=!0,e.emit("drain")}),0))}))}(t[n])},h.prototype.onClose=function(){i.prototype.onClose.call(this)},h.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",r="";return this.port&&("wss"===e&&443!==Number(this.port)||"ws"===e&&80!==Number(this.port))&&(r=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=u()),this.supportsBinary||(t.b64=1),(t=c.encode(t)).length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+t},h.prototype.check=function(){return!(!l||"__initialize"in l&&this.name===h.prototype.name)}},2777:(t,e,r)=>{var n=r(8058),o=r(3549);t.exports=function(t){var e=t.xdomain,r=t.xscheme,i=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||n))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!r&&i)return new XDomainRequest}catch(t){}if(!e)try{return new(o[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},8746:t=>{function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}},4802:(t,e,r)=>{function n(){var t;try{t=e.storage.debug}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t}(e=t.exports=r(7616)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),r){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))})),t.splice(i,0,n)}},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=n,e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(n())},7616:(t,e,r)=>{function n(t){var r;function n(){if(n.enabled){var t=n,o=+new Date,i=o-(r||o);t.diff=i,t.prev=r,t.curr=o,r=o;for(var s=new Array(arguments.length),c=0;c<s.length;c++)s[c]=arguments[c];s[0]=e.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var a=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;a++;var o=e.formatters[n];if("function"==typeof o){var i=s[a];r=o.call(t,i),s.splice(a,1),a--}return r})),e.formatArgs.call(t,s);var u=n.log||e.log||console.log.bind(console);u.apply(t,s)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=function(t){var r,n=0;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}(t),n.destroy=o,"function"==typeof e.init&&e.init(n),e.instances.push(n),n}function o(){var t=e.instances.indexOf(this);return-1!==t&&(e.instances.splice(t,1),!0)}(e=t.exports=n.debug=n.default=n).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){var r;e.save(t),e.names=[],e.skips=[];var n=("string"==typeof t?t:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(r=0;r<e.instances.length;r++){var i=e.instances[r];i.enabled=e.enabled(i.namespace)}},e.enabled=function(t){if("*"===t[t.length-1])return!0;var r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(7824),e.instances=[],e.names=[],e.skips=[],e.formatters={}},4455:(t,e,r)=>{var n,o=r(7990),i=r(3466),s=r(9718),c=r(6906),a=r(3414);"undefined"!=typeof ArrayBuffer&&(n=r(3704));var u="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),p="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),l=u||p;e.protocol=3;var h=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},f=o(h),d={type:"error",data:"parser error"},y=r(5548);function b(t,e,r){for(var n=new Array(t.length),o=c(t.length,r),i=function(t,r,o){e(r,(function(e,r){n[t]=r,o(e,n)}))},s=0;s<t.length;s++)i(s,t[s],o)}e.encodePacket=function(t,r,n,o){"function"==typeof r&&(o=r,r=!1),"function"==typeof n&&(o=n,n=null);var i=void 0===t.data?void 0:t.data.buffer||t.data;if("undefined"!=typeof ArrayBuffer&&i instanceof ArrayBuffer)return function(t,r,n){if(!r)return e.encodeBase64Packet(t,n);var o=t.data,i=new Uint8Array(o),s=new Uint8Array(1+o.byteLength);s[0]=h[t.type];for(var c=0;c<i.length;c++)s[c+1]=i[c];return n(s.buffer)}(t,r,o);if(void 0!==y&&i instanceof y)return function(t,r,n){if(!r)return e.encodeBase64Packet(t,n);if(l)return function(t,r,n){if(!r)return e.encodeBase64Packet(t,n);var o=new FileReader;return o.onload=function(){e.encodePacket({type:t.type,data:o.result},r,!0,n)},o.readAsArrayBuffer(t.data)}(t,r,n);var o=new Uint8Array(1);return o[0]=h[t.type],n(new y([o.buffer,t.data]))}(t,r,o);if(i&&i.base64)return function(t,r){return r("b"+e.packets[t.type]+t.data.data)}(t,o);var s=h[t.type];return void 0!==t.data&&(s+=n?a.encode(String(t.data),{strict:!1}):String(t.data)),o(""+s)},e.encodeBase64Packet=function(t,r){var n,o="b"+e.packets[t.type];if(void 0!==y&&t.data instanceof y){var i=new FileReader;return i.onload=function(){var t=i.result.split(",")[1];r(o+t)},i.readAsDataURL(t.data)}try{n=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch(e){for(var s=new Uint8Array(t.data),c=new Array(s.length),a=0;a<s.length;a++)c[a]=s[a];n=String.fromCharCode.apply(null,c)}return o+=btoa(n),r(o)},e.decodePacket=function(t,r,n){if(void 0===t)return d;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),r);if(n&&!1===(t=function(t){try{t=a.decode(t,{strict:!1})}catch(t){return!1}return t}(t)))return d;var o=t.charAt(0);return Number(o)==o&&f[o]?t.length>1?{type:f[o],data:t.substring(1)}:{type:f[o]}:d}o=new Uint8Array(t)[0];var i=s(t,1);return y&&"blob"===r&&(i=new y([i])),{type:f[o],data:i}},e.decodeBase64Packet=function(t,e){var r=f[t.charAt(0)];if(!n)return{type:r,data:{base64:!0,data:t.substr(1)}};var o=n.decode(t.substr(1));return"blob"===e&&y&&(o=new y([o])),{type:r,data:o}},e.encodePayload=function(t,r,n){"function"==typeof r&&(n=r,r=null);var o=i(t);return r&&o?y&&!l?e.encodePayloadAsBlob(t,n):e.encodePayloadAsArrayBuffer(t,n):t.length?void b(t,(function(t,n){e.encodePacket(t,!!o&&r,!1,(function(t){n(null,function(t){return t.length+":"+t}(t))}))}),(function(t,e){return n(e.join(""))})):n("0:")},e.decodePayload=function(t,r,n){if("string"!=typeof t)return e.decodePayloadAsBinary(t,r,n);var o;if("function"==typeof r&&(n=r,r=null),""===t)return n(d,0,1);for(var i,s,c="",a=0,u=t.length;a<u;a++){var p=t.charAt(a);if(":"===p){if(""===c||c!=(i=Number(c)))return n(d,0,1);if(c!=(s=t.substr(a+1,i)).length)return n(d,0,1);if(s.length){if(o=e.decodePacket(s,r,!1),d.type===o.type&&d.data===o.data)return n(d,0,1);if(!1===n(o,a+i,u))return}a+=i,c=""}else c+=p}return""!==c?n(d,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,r){if(!t.length)return r(new ArrayBuffer(0));b(t,(function(t,r){e.encodePacket(t,!0,!0,(function(t){return r(null,t)}))}),(function(t,e){var n=e.reduce((function(t,e){var r;return t+(r="string"==typeof e?e.length:e.byteLength).toString().length+r+2}),0),o=new Uint8Array(n),i=0;return e.forEach((function(t){var e="string"==typeof t,r=t;if(e){for(var n=new Uint8Array(t.length),s=0;s<t.length;s++)n[s]=t.charCodeAt(s);r=n.buffer}o[i++]=e?0:1;var c=r.byteLength.toString();for(s=0;s<c.length;s++)o[i++]=parseInt(c[s]);for(o[i++]=255,n=new Uint8Array(r),s=0;s<n.length;s++)o[i++]=n[s]})),r(o.buffer)}))},e.encodePayloadAsBlob=function(t,r){b(t,(function(t,r){e.encodePacket(t,!0,!0,(function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var n=new Uint8Array(t.length),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);t=n.buffer,e[0]=0}var i=(t instanceof ArrayBuffer?t.byteLength:t.size).toString(),s=new Uint8Array(i.length+1);for(o=0;o<i.length;o++)s[o]=parseInt(i[o]);if(s[i.length]=255,y){var c=new y([e.buffer,s.buffer,t]);r(null,c)}}))}),(function(t,e){return r(new y(e))}))},e.decodePayloadAsBinary=function(t,r,n){"function"==typeof r&&(n=r,r=null);for(var o=t,i=[];o.byteLength>0;){for(var c=new Uint8Array(o),a=0===c[0],u="",p=1;255!==c[p];p++){if(u.length>310)return n(d,0,1);u+=c[p]}o=s(o,2+u.length),u=parseInt(u);var l=s(o,0,u);if(a)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(t){var h=new Uint8Array(l);for(l="",p=0;p<h.length;p++)l+=String.fromCharCode(h[p])}i.push(l),o=s(o,u)}var f=i.length;i.forEach((function(t,o){n(e.decodePacket(t,r,!0),o,f)}))}},7990:t=>{t.exports=Object.keys||function(t){var e=[],r=Object.prototype.hasOwnProperty;for(var n in t)r.call(t,n)&&e.push(n);return e}},3414:t=>{var e,r,n,o=String.fromCharCode;function i(t){for(var e,r,n=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(r=t.charCodeAt(o++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--):n.push(e);return n}function s(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function c(t,e){return o(t>>e&63|128)}function a(t,e){if(0==(4294967168&t))return o(t);var r="";return 0==(4294965248&t)?r=o(t>>6&31|192):0==(4294901760&t)?(s(t,e)||(t=65533),r=o(t>>12&15|224),r+=c(t,6)):0==(4292870144&t)&&(r=o(t>>18&7|240),r+=c(t,12),r+=c(t,6)),r+o(63&t|128)}function u(){if(n>=r)throw Error("Invalid byte index");var t=255&e[n];if(n++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function p(t){var o,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(o=255&e[n],n++,0==(128&o))return o;if(192==(224&o)){if((i=(31&o)<<6|u())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&o)){if((i=(15&o)<<12|u()<<6|u())>=2048)return s(i,t)?i:65533;throw Error("Invalid continuation byte")}if(240==(248&o)&&(i=(7&o)<<18|u()<<12|u()<<6|u())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}t.exports={version:"2.1.2",encode:function(t,e){for(var r=!1!==(e=e||{}).strict,n=i(t),o=n.length,s=-1,c="";++s<o;)c+=a(n[s],r);return c},decode:function(t,s){var c=!1!==(s=s||{}).strict;e=i(t),r=e.length,n=0;for(var a,u=[];!1!==(a=p(c));)u.push(a);return function(t){for(var e,r=t.length,n=-1,i="";++n<r;)(e=t[n])>65535&&(i+=o((e-=65536)>>>10&1023|55296),e=56320|1023&e),i+=o(e);return i}(u)}}},3466:(t,e,r)=>{var n=r(579),o=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);t.exports=function t(e){if(!e||"object"!=typeof e)return!1;if(n(e)){for(var r=0,o=e.length;r<o;r++)if(t(e[r]))return!0;return!1}if("function"==typeof Buffer&&Buffer.isBuffer&&Buffer.isBuffer(e)||"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||i&&e instanceof Blob||s&&e instanceof File)return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return t(e.toJSON(),!0);for(var c in e)if(Object.prototype.hasOwnProperty.call(e,c)&&t(e[c]))return!0;return!1}},579:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},8058:t=>{try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){t.exports=!1}},7355:t=>{var e=[].indexOf;t.exports=function(t,r){if(e)return t.indexOf(r);for(var n=0;n<t.length;++n)if(t[n]===r)return n;return-1}},7824:t=>{var e=1e3,r=60*e,n=60*r,o=24*n;function i(t,e,r){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+r:Math.ceil(t/e)+" "+r+"s"}t.exports=function(t,s){s=s||{};var c,a=typeof t;if("string"===a&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var i=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(i){var s=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===a&&!1===isNaN(t))return s.long?i(c=t,o,"day")||i(c,n,"hour")||i(c,r,"minute")||i(c,e,"second")||c+" ms":function(t){return t>=o?Math.round(t/o)+"d":t>=n?Math.round(t/n)+"h":t>=r?Math.round(t/r)+"m":t>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},1830:(t,e)=>{e.encode=function(t){var e="";for(var r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e},e.decode=function(t){for(var e={},r=t.split("&"),n=0,o=r.length;n<o;n++){var i=r[n].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}},4187:t=>{var e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var n,o,i=t,s=t.indexOf("["),c=t.indexOf("]");-1!=s&&-1!=c&&(t=t.substring(0,s)+t.substring(s,c).replace(/:/g,";")+t.substring(c,t.length));for(var a,u,p=e.exec(t||""),l={},h=14;h--;)l[r[h]]=p[h]||"";return-1!=s&&-1!=c&&(l.source=i,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=(n=l.path,o=n.replace(/\/{2,9}/g,"/").split("/"),"/"!=n.substr(0,1)&&0!==n.length||o.splice(0,1),"/"==n.substr(n.length-1,1)&&o.splice(o.length-1,1),o),l.queryKey=(a=l.query,u={},a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,r){e&&(u[e]=r)})),u),l}},9122:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(8314),i=r(7376),s=function(t){function e(e){t.call(this),this._value=e}return n(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return r&&!r.closed&&e.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new i.ObjectUnsubscribedError;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(o.Subject);e.BehaviorSubject=s},7056:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(e,r,n){t.call(this),this.parent=e,this.outerValue=r,this.outerIndex=n,this.index=0}return n(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(r(5239).Subscriber);e.InnerSubscriber=o},8270:(t,e,r)=>{"use strict";var n=r(5100),o=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return n.Observable.of(this.value);case"E":return n.Observable.throw(this.error);case"C":return n.Observable.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();e.Notification=o},5100:(t,e,r)=>{"use strict";var n=r(7919),o=r(9510),i=r(683),s=r(6903),c=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,i=o.toSubscriber(t,e,r);if(n?n.call(i,this.source):i.add(this.source||!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var r=this;if(e||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?e=n.root.Rx.config.Promise:n.root.Promise&&(e=n.root.Promise)),!e)throw new Error("no Promise impl found");return new e((function(e,n){var o;o=r.subscribe((function(e){if(o)try{t(e)}catch(t){n(t),o.unsubscribe()}else t(e)}),n,e)}))},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[i.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return 0===t.length?this:s.pipeFromArray(t)(this)},t.prototype.toPromise=function(t){var e=this;if(t||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?t=n.root.Rx.config.Promise:n.root.Promise&&(t=n.root.Promise)),!t)throw new Error("no Promise impl found");return new t((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();e.Observable=c},9275:(t,e)=>{"use strict";e.empty={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}}},3147:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.notifyNext=function(t,e,r,n,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(r(5239).Subscriber);e.OuterSubscriber=o},3422:(t,e)=>{"use strict";var r=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=Date.now?Date.now:function(){return+new Date},t}();e.Scheduler=r},8314:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5100),i=r(5239),s=r(4859),c=r(7376),a=r(3189),u=r(2992),p=function(t){function e(e){t.call(this,e),this.destination=e}return n(e,t),e}(i.Subscriber);e.SubjectSubscriber=p;var l=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return n(e,t),e.prototype[u.rxSubscriber]=function(){return new p(this)},e.prototype.lift=function(t){var e=new h(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new c.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),o=0;o<r;o++)n[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new c.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),o=0;o<r;o++)n[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new c.ObjectUnsubscribedError;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new c.ObjectUnsubscribedError;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new c.ObjectUnsubscribedError;return this.hasError?(t.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(t.complete(),s.Subscription.EMPTY):(this.observers.push(t),new a.SubjectSubscription(this,t))},e.prototype.asObservable=function(){var t=new o.Observable;return t.source=this,t},e.create=function(t,e){return new h(t,e)},e}(o.Observable);e.Subject=l;var h=function(t){function e(e,r){t.call(this),this.destination=e,this.source=r}return n(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):s.Subscription.EMPTY},e}(l);e.AnonymousSubject=h},3189:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(e,r){t.call(this),this.subject=e,this.subscriber=r,this.closed=!1}return n(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(r(4859).Subscription);e.SubjectSubscription=o},5239:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(1404),i=r(4859),s=r(9275),c=r(2992),a=function(t){function e(e,r,n){switch(t.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=s.empty;break;case 1:if(!e){this.destination=s.empty;break}if("object"==typeof e){if(p(e)){var o=e[c.rxSubscriber]();this.syncErrorThrowable=o.syncErrorThrowable,this.destination=o,o.add(this)}else this.syncErrorThrowable=!0,this.destination=new u(this,e);break}default:this.syncErrorThrowable=!0,this.destination=new u(this,e,r,n)}}return n(e,t),e.prototype[c.rxSubscriber]=function(){return this},e.create=function(t,r,n){var o=new e(t,r,n);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},e}(i.Subscription);e.Subscriber=a;var u=function(t){function e(e,r,n,i){var c;t.call(this),this._parentSubscriber=e;var a=this;o.isFunction(r)?c=r:r&&(c=r.next,n=r.error,i=r.complete,r!==s.empty&&(a=Object.create(r),o.isFunction(a.unsubscribe)&&this.add(a.unsubscribe.bind(a)),a.unsubscribe=this.unsubscribe.bind(this))),this._context=a,this._next=c,this._error=n,this._complete=i}return n(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber;if(this._error)e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!e.syncErrorThrowable)throw this.unsubscribe(),t;e.syncErrorValue=t,e.syncErrorThrown=!0,this.unsubscribe()}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){throw this.unsubscribe(),t}},e.prototype.__tryOrSetError=function(t,e,r){try{e.call(this._context,r)}catch(e){return t.syncErrorValue=e,t.syncErrorThrown=!0,!0}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(a);function p(t){return t instanceof a||"syncErrorThrowable"in t&&t[c.rxSubscriber]}},4859:(t,e,r)=>{"use strict";var n=r(5936),o=r(4548),i=r(1404),s=r(6447),c=r(4456),a=r(6288),u=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var r=this,u=r._parent,l=r._parents,h=r._unsubscribe,f=r._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var d=-1,y=l?l.length:0;u;)u.remove(this),u=++d<y&&l[d]||null;if(i.isFunction(h)&&s.tryCatch(h).call(this)===c.errorObject&&(e=!0,t=t||(c.errorObject.e instanceof a.UnsubscriptionError?p(c.errorObject.e.errors):[c.errorObject.e])),n.isArray(f))for(d=-1,y=f.length;++d<y;){var b=f[d];if(o.isObject(b)&&s.tryCatch(b.unsubscribe).call(b)===c.errorObject){e=!0,t=t||[];var v=c.errorObject.e;v instanceof a.UnsubscriptionError?t=t.concat(p(v.errors)):t.push(v)}}if(e)throw new a.UnsubscriptionError(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var r=e;switch(typeof e){case"function":r=new t(e);case"object":if(r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if("function"!=typeof r._addParent){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(r),r._addParent(this),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.prototype._addParent=function(t){var e=this._parent,r=this._parents;e&&e!==t?r?-1===r.indexOf(t)&&r.push(t):this._parents=[t]:this._parent=t},t.EMPTY=((e=new t).closed=!0,e),t}();function p(t){return t.reduce((function(t,e){return t.concat(e instanceof a.UnsubscriptionError?e.errors:e)}),[])}e.Subscription=u},1235:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5100),i=r(4819),s=r(9735),c=function(t){function e(e,r){t.call(this),this.arrayLike=e,this.scheduler=r,r||1!==e.length||(this._isScalar=!0,this.value=e[0])}return n(e,t),e.create=function(t,r){var n=t.length;return 0===n?new s.EmptyObservable:1===n?new i.ScalarObservable(t[0],r):new e(t,r)},e.dispatch=function(t){var e=t.arrayLike,r=t.index,n=t.length,o=t.subscriber;o.closed||(r>=n?o.complete():(o.next(e[r]),t.index=r+1,this.schedule(t)))},e.prototype._subscribe=function(t){var r=this.arrayLike,n=this.scheduler,o=r.length;if(n)return n.schedule(e.dispatch,0,{arrayLike:r,index:0,length:o,subscriber:t});for(var i=0;i<o&&!t.closed;i++)t.next(r[i]);t.complete()},e}(o.Observable);e.ArrayLikeObservable=c},3418:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5100),i=r(4819),s=r(9735),c=r(93),a=function(t){function e(e,r){t.call(this),this.array=e,this.scheduler=r,r||1!==e.length||(this._isScalar=!0,this.value=e[0])}return n(e,t),e.create=function(t,r){return new e(t,r)},e.of=function(){for(var t=[],r=0;r<arguments.length;r++)t[r-0]=arguments[r];var n=t[t.length-1];c.isScheduler(n)?t.pop():n=null;var o=t.length;return o>1?new e(t,n):1===o?new i.ScalarObservable(t[0],n):new s.EmptyObservable(n)},e.dispatch=function(t){var e=t.array,r=t.index,n=t.count,o=t.subscriber;r>=n?o.complete():(o.next(e[r]),o.closed||(t.index=r+1,this.schedule(t)))},e.prototype._subscribe=function(t){var r=this.array,n=r.length,o=this.scheduler;if(o)return o.schedule(e.dispatch,0,{array:r,index:0,count:n,subscriber:t});for(var i=0;i<n&&!t.closed;i++)t.next(r[i]);t.complete()},e}(o.Observable);e.ArrayObservable=a},8852:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(8314),i=r(5100),s=r(5239),c=r(4859),a=r(3061),u=function(t){function e(e,r){t.call(this),this.source=e,this.subjectFactory=r,this._refCount=0,this._isComplete=!1}return n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new c.Subscription).add(this.source.subscribe(new l(this.getSubject(),this))),t.closed?(this._connection=null,t=c.Subscription.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return a.refCount()(this)},e}(i.Observable);e.ConnectableObservable=u;var p=u.prototype;e.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:p._subscribe},_isComplete:{value:p._isComplete,writable:!0},getSubject:{value:p.getSubject},connect:{value:p.connect},refCount:{value:p.refCount}};var l=function(t){function e(e,r){t.call(this,e),this.connectable=r}return n(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(o.SubjectSubscriber);!function(t){function e(e,r){t.call(this,e),this.connectable=r}n(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null}}(s.Subscriber)},9735:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(e){t.call(this),this.scheduler=e}return n(e,t),e.create=function(t){return new e(t)},e.dispatch=function(t){t.subscriber.complete()},e.prototype._subscribe=function(t){var r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{subscriber:t});t.complete()},e}(r(5100).Observable);e.EmptyObservable=o},9483:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5100),i=r(6447),s=r(1404),c=r(4456),a=r(4859),u=Object.prototype.toString,p=function(t){function e(e,r,n,o){t.call(this),this.sourceObj=e,this.eventName=r,this.selector=n,this.options=o}return n(e,t),e.create=function(t,r,n,o){return s.isFunction(n)&&(o=n,n=void 0),new e(t,r,o,n)},e.setupSubscription=function(t,r,n,o,i){var s;if(function(t){return!!t&&"[object NodeList]"===u.call(t)}(t)||function(t){return!!t&&"[object HTMLCollection]"===u.call(t)}(t))for(var c=0,p=t.length;c<p;c++)e.setupSubscription(t[c],r,n,o,i);else if(function(t){return!!t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var l=t;t.addEventListener(r,n,i),s=function(){return l.removeEventListener(r,n,i)}}else if(function(t){return!!t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var h=t;t.on(r,n),s=function(){return h.off(r,n)}}else{if(!function(t){return!!t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t))throw new TypeError("Invalid event target");var f=t;t.addListener(r,n),s=function(){return f.removeListener(r,n)}}o.add(new a.Subscription(s))},e.prototype._subscribe=function(t){var r=this.sourceObj,n=this.eventName,o=this.options,s=this.selector,a=s?function(){for(var e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];var n=i.tryCatch(s).apply(void 0,e);n===c.errorObject?t.error(c.errorObject.e):t.next(n)}:function(e){return t.next(e)};e.setupSubscription(r,n,a,t,o)},e}(o.Observable);e.FromEventObservable=p},7305:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5936),i=r(2900),s=r(338),c=r(6694),a=r(8770),u=r(3418),p=r(1235),l=r(5810),h=r(5100),f=r(5633),d=r(683),y=function(t){function e(e,r){t.call(this,null),this.ish=e,this.scheduler=r}return n(e,t),e.create=function(t,r){if(null!=t){if("function"==typeof t[d.observable])return t instanceof h.Observable&&!r?t:new e(t,r);if(o.isArray(t))return new u.ArrayObservable(t,r);if(s.isPromise(t))return new c.PromiseObservable(t,r);if("function"==typeof t[l.iterator]||"string"==typeof t)return new a.IteratorObservable(t,r);if(i.isArrayLike(t))return new p.ArrayLikeObservable(t,r)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")},e.prototype._subscribe=function(t){var e=this.ish,r=this.scheduler;return null==r?e[d.observable]().subscribe(t):e[d.observable]().subscribe(new f.ObserveOnSubscriber(t,r,0))},e}(h.Observable);e.FromObservable=y},8770:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(7919),i=r(5100),s=r(5810),c=function(t){function e(e,r){if(t.call(this),this.scheduler=r,null==e)throw new Error("iterator cannot be null.");this.iterator=function(t){var e=t[s.iterator];if(!e&&"string"==typeof t)return new a(t);if(!e&&void 0!==t.length)return new u(t);if(!e)throw new TypeError("object is not iterable");return t[s.iterator]()}(e)}return n(e,t),e.create=function(t,r){return new e(t,r)},e.dispatch=function(t){var e=t.index,r=t.hasError,n=t.iterator,o=t.subscriber;if(r)o.error(t.error);else{var i=n.next();i.done?o.complete():(o.next(i.value),t.index=e+1,o.closed?"function"==typeof n.return&&n.return():this.schedule(t))}},e.prototype._subscribe=function(t){var r=this.iterator,n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{index:0,iterator:r,subscriber:t});for(;;){var o=r.next();if(o.done){t.complete();break}if(t.next(o.value),t.closed){"function"==typeof r.return&&r.return();break}}},e}(i.Observable);e.IteratorObservable=c;var a=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=t.length),this.str=t,this.idx=e,this.len=r}return t.prototype[s.iterator]=function(){return this},t.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}},t}(),u=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=function(t){var e,r=+t.length;return isNaN(r)?0:0!==r&&("number"==typeof(e=r)&&o.root.isFinite(e))?(r=function(t){var e=+t;return 0===e||isNaN(e)?e:e<0?-1:1}(r)*Math.floor(Math.abs(r)))<=0?0:r>p?p:r:r}(t)),this.arr=t,this.idx=e,this.len=r}return t.prototype[s.iterator]=function(){return this},t.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}},t}(),p=Math.pow(2,53)-1},6694:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(7919),i=function(t){function e(e,r){t.call(this),this.promise=e,this.scheduler=r}return n(e,t),e.create=function(t,r){return new e(t,r)},e.prototype._subscribe=function(t){var e=this,r=this.promise,n=this.scheduler;if(null==n)this._isScalar?t.closed||(t.next(this.value),t.complete()):r.then((function(r){e.value=r,e._isScalar=!0,t.closed||(t.next(r),t.complete())}),(function(e){t.closed||t.error(e)})).then(null,(function(t){o.root.setTimeout((function(){throw t}))}));else if(this._isScalar){if(!t.closed)return n.schedule(s,0,{value:this.value,subscriber:t})}else r.then((function(r){e.value=r,e._isScalar=!0,t.closed||t.add(n.schedule(s,0,{value:r,subscriber:t}))}),(function(e){t.closed||t.add(n.schedule(c,0,{err:e,subscriber:t}))})).then(null,(function(t){o.root.setTimeout((function(){throw t}))}))},e}(r(5100).Observable);function s(t){var e=t.value,r=t.subscriber;r.closed||(r.next(e),r.complete())}function c(t){var e=t.err,r=t.subscriber;r.closed||r.error(e)}e.PromiseObservable=i},4819:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(e,r){t.call(this),this.value=e,this.scheduler=r,this._isScalar=!0,r&&(this._isScalar=!1)}return n(e,t),e.create=function(t,r){return new e(t,r)},e.dispatch=function(t){var e=t.done,r=t.value,n=t.subscriber;e?n.complete():(n.next(r),n.closed||(t.done=!0,this.schedule(t)))},e.prototype._subscribe=function(t){var r=this.value,n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{done:!1,value:r,subscriber:t});t.next(r),t.closed||t.complete()},e}(r(5100).Observable);e.ScalarObservable=o},9034:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5100),i=r(2664),s=r(3523),c=function(t){function e(e,r,n){void 0===r&&(r=0),void 0===n&&(n=i.asap),t.call(this),this.source=e,this.delayTime=r,this.scheduler=n,(!s.isNumeric(r)||r<0)&&(this.delayTime=0),n&&"function"==typeof n.schedule||(this.scheduler=i.asap)}return n(e,t),e.create=function(t,r,n){return void 0===r&&(r=0),void 0===n&&(n=i.asap),new e(t,r,n)},e.dispatch=function(t){var e=t.source,r=t.subscriber;return this.add(e.subscribe(r))},e.prototype._subscribe=function(t){var r=this.delayTime,n=this.source;return this.scheduler.schedule(e.dispatch,r,{source:n,subscriber:t})},e}(o.Observable);e.SubscribeOnObservable=c},2453:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(3523),i=r(5100),s=r(8404),c=r(93),a=r(1589),u=function(t){function e(e,r,n){void 0===e&&(e=0),t.call(this),this.period=-1,this.dueTime=0,o.isNumeric(r)?this.period=Number(r)<1?1:Number(r):c.isScheduler(r)&&(n=r),c.isScheduler(n)||(n=s.async),this.scheduler=n,this.dueTime=a.isDate(e)?+e-this.scheduler.now():e}return n(e,t),e.create=function(t,r,n){return void 0===t&&(t=0),new e(t,r,n)},e.dispatch=function(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(-1===r)return n.complete();t.index=e+1,this.schedule(t,r)}},e.prototype._subscribe=function(t){var r=this,n=r.period,o=r.dueTime;return r.scheduler.schedule(e.dispatch,o,{index:0,period:n,subscriber:t})},e}(i.Observable);e.TimerObservable=u},5167:(t,e,r)=>{"use strict";var n=r(93),o=r(9325),i=r(7038),s=r(3914);e.concat=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return 1===t.length||2===t.length&&n.isScheduler(t[1])?i.from(t[0]):s.concatAll()(o.of.apply(void 0,t))}},6256:(t,e,r)=>{"use strict";var n=r(9735);e.empty=n.EmptyObservable.create},7038:(t,e,r)=>{"use strict";var n=r(7305);e.from=n.FromObservable.create},9126:(t,e,r)=>{"use strict";var n=r(9483);e.fromEvent=n.FromEventObservable.create},3943:(t,e,r)=>{"use strict";var n=r(5100),o=r(3418),i=r(93),s=r(3430);e.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r=Number.POSITIVE_INFINITY,c=null,a=t[t.length-1];return i.isScheduler(a)?(c=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof a&&(r=t.pop()),null===c&&1===t.length&&t[0]instanceof n.Observable?t[0]:s.mergeAll(r)(new o.ArrayObservable(t,c))}},9325:(t,e,r)=>{"use strict";var n=r(3418);e.of=n.ArrayObservable.of},4903:(t,e,r)=>{"use strict";var n=r(2453);e.timer=n.TimerObservable.create},5545:(t,e,r)=>{"use strict";var n=r(2434);e.zip=n.zipStatic},3914:(t,e,r)=>{"use strict";var n=r(3430);e.concatAll=function(){return n.mergeAll(1)}},8713:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239),i=r(6447),s=r(4456);e.distinctUntilChanged=function(t,e){return function(r){return r.lift(new c(t,e))}};var c=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.compare,this.keySelector))},t}(),a=function(t){function e(e,r,n){t.call(this,e),this.keySelector=n,this.hasKey=!1,"function"==typeof r&&(this.compare=r)}return n(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e=t;if(this.keySelector&&(e=i.tryCatch(this.keySelector)(t))===s.errorObject)return this.destination.error(s.errorObject.e);var r=!1;if(this.hasKey){if((r=i.tryCatch(this.compare)(this.key,e))===s.errorObject)return this.destination.error(s.errorObject.e)}else this.hasKey=!0;!1===Boolean(r)&&(this.key=e,this.destination.next(t))},e}(o.Subscriber)},8111:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239);e.filter=function(t,e){return function(r){return r.lift(new i(t,e))}};var i=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))},t}(),s=function(t){function e(e,r,n){t.call(this,e),this.predicate=r,this.thisArg=n,this.count=0}return n(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(o.Subscriber)},7064:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239),i=r(4859),s=r(5100),c=r(8314),a=r(5205),u=r(1741);e.groupBy=function(t,e,r,n){return function(o){return o.lift(new p(t,e,r,n))}};var p=function(){function t(t,e,r,n){this.keySelector=t,this.elementSelector=e,this.durationSelector=r,this.subjectSelector=n}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),l=function(t){function e(e,r,n,o,i){t.call(this,e),this.keySelector=r,this.elementSelector=n,this.durationSelector=o,this.subjectSelector=i,this.groups=null,this.attemptedToUnsubscribe=!1,this.count=0}return n(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var r=this.groups;r||(r=this.groups="string"==typeof e?new u.FastMap:new a.Map);var n,o=r.get(e);if(this.elementSelector)try{n=this.elementSelector(t)}catch(t){this.error(t)}else n=t;if(!o){o=this.subjectSelector?this.subjectSelector():new c.Subject,r.set(e,o);var i=new f(e,o,this);if(this.destination.next(i),this.durationSelector){var s=void 0;try{s=this.durationSelector(new f(e,o))}catch(t){return void this.error(t)}this.add(s.subscribe(new h(e,o,this)))}}o.closed||o.next(n)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,r){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(o.Subscriber),h=function(t){function e(e,r,n){t.call(this,r),this.key=e,this.group=r,this.parent=n}return n(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(o.Subscriber),f=function(t){function e(e,r,n){t.call(this),this.key=e,this.groupSubject=r,this.refCountSubscription=n}return n(e,t),e.prototype._subscribe=function(t){var e=new i.Subscription,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&e.add(new d(r)),e.add(n.subscribe(t)),e},e}(s.Observable);e.GroupedObservable=f;var d=function(t){function e(e){t.call(this),this.parent=e,e.count++}return n(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(i.Subscription)},1819:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239),i=r(4985);e.ignoreElements=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new c(t))},t}(),c=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype._next=function(t){i.noop()},e}(o.Subscriber)},2068:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239);e.map=function(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new i(t,e))}};var i=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.project,this.thisArg))},t}();e.MapOperator=i;var s=function(t){function e(e,r,n){t.call(this,e),this.project=r,this.count=0,this.thisArg=n||this}return n(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.Subscriber)},8621:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239);e.mapTo=function(t){return function(e){return e.lift(new i(t))}};var i=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.value))},t}(),s=function(t){function e(e,r){t.call(this,e),this.value=r}return n(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(o.Subscriber)},3430:(t,e,r)=>{"use strict";var n=r(904),o=r(5198);e.mergeAll=function(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),n.mergeMap(o.identity,null,t)}},904:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(8794),i=r(3147);e.mergeMap=function(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(n){return"number"==typeof e&&(r=e,e=null),n.lift(new s(t,e,r))}};var s=function(){function t(t,e,r){void 0===r&&(r=Number.POSITIVE_INFINITY),this.project=t,this.resultSelector=e,this.concurrent=r}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.resultSelector,this.concurrent))},t}();e.MergeMapOperator=s;var c=function(t){function e(e,r,n,o){void 0===o&&(o=Number.POSITIVE_INFINITY),t.call(this,e),this.project=r,this.resultSelector=n,this.concurrent=o,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return n(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,r)},e.prototype._innerSub=function(t,e,r){this.add(o.subscribeToResult(this,t,e,r))},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},e.prototype.notifyNext=function(t,e,r,n,o){this.resultSelector?this._notifyResultSelector(t,e,r,n):this.destination.next(e)},e.prototype._notifyResultSelector=function(t,e,r,n){var o;try{o=this.resultSelector(t,e,r,n)}catch(t){return void this.destination.error(t)}this.destination.next(o)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(i.OuterSubscriber);e.MergeMapSubscriber=c},5462:(t,e,r)=>{"use strict";var n=r(8852);e.multicast=function(t,e){return function(r){var i;if(i="function"==typeof t?t:function(){return t},"function"==typeof e)return r.lift(new o(i,e));var s=Object.create(r,n.connectableObservableDescriptor);return s.source=r,s.subjectFactory=i,s}};var o=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,n=this.subjectFactory(),o=r(n).subscribe(t);return o.add(e.subscribe(n)),o},t}();e.MulticastOperator=o},5633:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239),i=r(8270);e.observeOn=function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new s(t,e))}};var s=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.scheduler,this.delay))},t}();e.ObserveOnOperator=s;var c=function(t){function e(e,r,n){void 0===n&&(n=0),t.call(this,e),this.scheduler=r,this.delay=n}return n(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.add(this.scheduler.schedule(e.dispatch,this.delay,new a(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(i.Notification.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(i.Notification.createError(t))},e.prototype._complete=function(){this.scheduleMessage(i.Notification.createComplete())},e}(o.Subscriber);e.ObserveOnSubscriber=c;var a=function(t,e){this.notification=t,this.destination=e};e.ObserveOnMessage=a},1398:(t,e,r)=>{"use strict";var n=r(1088),o=r(8111);e.partition=function(t,e){return function(r){return[o.filter(t,e)(r),o.filter(n.not(t,e))(r)]}}},6370:(t,e,r)=>{"use strict";var n=r(2068);function o(t,e){return function(r){for(var n=r,o=0;o<e;o++){var i=n[t[o]];if(void 0===i)return;n=i}return n}}e.pluck=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r=t.length;if(0===r)throw new Error("list of properties cannot be empty.");return function(e){return n.map(o(t,r))(e)}}},3061:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239);e.refCount=function(){return function(t){return t.lift(new i(t))}};var i=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var n=new s(t,r),o=e.subscribe(n);return n.closed||(n.connection=r.connect()),o},t}(),s=function(t){function e(e,r){t.call(this,e),this.connectable=r}return n(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},e}(o.Subscriber)},567:(t,e,r)=>{"use strict";var n=r(5462),o=r(3061),i=r(8314);function s(){return new i.Subject}e.share=function(){return function(t){return o.refCount()(n.multicast(s)(t))}}},617:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239);e.skip=function(t){return function(e){return e.lift(new i(t))}};var i=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.total))},t}(),s=function(t){function e(e,r){t.call(this,e),this.total=r,this.count=0}return n(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(o.Subscriber)},2946:(t,e,r)=>{"use strict";var n=r(3418),o=r(4819),i=r(9735),s=r(5167),c=r(93);e.startWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return function(e){var r=t[t.length-1];c.isScheduler(r)?t.pop():r=null;var a=t.length;return 1===a?s.concat(new o.ScalarObservable(t[0],r),e):a>1?s.concat(new n.ArrayObservable(t,r),e):s.concat(new i.EmptyObservable(r),e)}}},8348:(t,e,r)=>{"use strict";var n=r(9034);e.subscribeOn=function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new o(t,e))}};var o=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new n.SubscribeOnObservable(e,this.delay,this.scheduler).subscribe(t)},t}()},6739:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(3147),i=r(8794);e.switchMap=function(t,e){return function(r){return r.lift(new s(t,e))}};var s=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.resultSelector))},t}(),c=function(t){function e(e,r,n){t.call(this,e),this.project=r,this.resultSelector=n,this.index=0}return n(e,t),e.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,r)},e.prototype._innerSub=function(t,e,r){var n=this.innerSubscription;n&&n.unsubscribe(),this.add(this.innerSubscription=i.subscribeToResult(this,t,e,r))},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,r,n,o){this.resultSelector?this._tryNotifyNext(t,e,r,n):this.destination.next(e)},e.prototype._tryNotifyNext=function(t,e,r,n){var o;try{o=this.resultSelector(t,e,r,n)}catch(t){return void this.destination.error(t)}this.destination.next(o)},e}(o.OuterSubscriber)},9890:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5239);e.tap=function(t,e,r){return function(n){return n.lift(new i(t,e,r))}};var i=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.nextOrObserver,this.error,this.complete))},t}(),s=function(t){function e(e,r,n,i){t.call(this,e);var s=new o.Subscriber(r,n,i);s.syncErrorThrowable=!0,this.add(s),this.safeSubscriber=s}return n(e,t),e.prototype._next=function(t){var e=this.safeSubscriber;e.next(t),e.syncErrorThrown?this.destination.error(e.syncErrorValue):this.destination.next(t)},e.prototype._error=function(t){var e=this.safeSubscriber;e.error(t),e.syncErrorThrown?this.destination.error(e.syncErrorValue):this.destination.error(t)},e.prototype._complete=function(){var t=this.safeSubscriber;t.complete(),t.syncErrorThrown?this.destination.error(t.syncErrorValue):this.destination.complete()},e}(o.Subscriber)},5636:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(3147),i=r(8794);e.withLatestFrom=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return function(e){var r;"function"==typeof t[t.length-1]&&(r=t.pop());var n=t;return e.lift(new s(n,r))}};var s=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.observables,this.project))},t}(),c=function(t){function e(e,r,n){t.call(this,e),this.observables=r,this.project=n,this.toRespond=[];var o=r.length;this.values=new Array(o);for(var s=0;s<o;s++)this.toRespond.push(s);for(s=0;s<o;s++){var c=r[s];this.add(i.subscribeToResult(this,c,c,s))}}return n(e,t),e.prototype.notifyNext=function(t,e,r,n,o){this.values[r]=e;var i=this.toRespond;if(i.length>0){var s=i.indexOf(r);-1!==s&&i.splice(s,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.OuterSubscriber)},2434:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(3418),i=r(5936),s=r(5239),c=r(3147),a=r(8794),u=r(5810);function p(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r=t[t.length-1];return"function"==typeof r&&t.pop(),new o.ArrayObservable(t).lift(new l(r))}e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return function(e){return e.lift.call(p.apply(void 0,[e].concat(t)))}},e.zipStatic=p;var l=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.project))},t}();e.ZipOperator=l;var h=function(t){function e(e,r,n){void 0===n&&(n=Object.create(null)),t.call(this,e),this.iterators=[],this.active=0,this.project="function"==typeof r?r:null,this.values=n}return n(e,t),e.prototype._next=function(t){var e=this.iterators;i.isArray(t)?e.push(new d(t)):"function"==typeof t[u.iterator]?e.push(new f(t[u.iterator]())):e.push(new y(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(0!==e){this.active=e;for(var r=0;r<e;r++){var n=t[r];n.stillUnsubscribed?this.add(n.subscribe(n,r)):this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,r=this.destination,n=0;n<e;n++)if("function"==typeof(s=t[n]).hasValue&&!s.hasValue())return;var o=!1,i=[];for(n=0;n<e;n++){var s,c=(s=t[n]).next();if(s.hasCompleted()&&(o=!0),c.done)return void r.complete();i.push(c.value)}this.project?this._tryProject(i):r.next(i),o&&r.complete()},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(s.Subscriber);e.ZipSubscriber=h;var f=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return t&&t.done},t}(),d=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[u.iterator]=function(){return this},t.prototype.next=function(t){var e=this.index++,r=this.array;return e<this.length?{value:r[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),y=function(t){function e(e,r,n){t.call(this,e),this.parent=r,this.observable=n,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return n(e,t),e.prototype[u.iterator]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,r,n,o){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return a.subscribeToResult(this,this.observable,this,e)},e}(c.OuterSubscriber)},3896:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(e,r){t.call(this)}return n(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(r(4859).Subscription);e.Action=o},2808:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(5561),i=function(t){function e(e,r){t.call(this,e,r),this.scheduler=e,this.work=r}return n(e,t),e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0?t.prototype.requestAsyncId.call(this,e,r,n):(e.actions.push(this),e.scheduled||(e.scheduled=o.Immediate.setImmediate(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,n);0===e.actions.length&&(o.Immediate.clearImmediate(r),e.scheduled=void 0)},e}(r(2932).AsyncAction);e.AsapAction=i},9953:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,n=-1,o=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++n<o&&(t=r.shift()));if(this.active=!1,e){for(;++n<o&&(t=r.shift());)t.unsubscribe();throw e}},e}(r(884).AsyncScheduler);e.AsapScheduler=o},2932:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=r(7919),i=function(t){function e(e,r){t.call(this,e,r),this.scheduler=e,this.pending=!1,this.work=r}return n(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t,this.pending=!0;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),o.root.setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;o.root.clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(r(3896).Action);e.AsyncAction=i},884:function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(){t.apply(this,arguments),this.actions=[],this.active=!1,this.scheduled=void 0}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(r(3422).Scheduler);e.AsyncScheduler=o},2664:(t,e,r)=>{"use strict";var n=r(2808),o=r(9953);e.asap=new o.AsapScheduler(n.AsapAction)},8404:(t,e,r)=>{"use strict";var n=r(2932),o=r(884);e.async=new o.AsyncScheduler(n.AsyncAction)},5810:(t,e,r)=>{"use strict";var n=r(7919);function o(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var r=t.Set;if(r&&"function"==typeof(new r)["@@iterator"])return"@@iterator";var n=t.Map;if(n)for(var o=Object.getOwnPropertyNames(n.prototype),i=0;i<o.length;++i){var s=o[i];if("entries"!==s&&"size"!==s&&n.prototype[s]===n.prototype.entries)return s}return"@@iterator"}e.symbolIteratorPonyfill=o,e.iterator=o(n.root),e.$$iterator=e.iterator},683:(t,e,r)=>{"use strict";var n=r(7919);function o(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}e.getSymbolObservable=o,e.observable=o(n.root),e.$$observable=e.observable},2992:(t,e,r)=>{"use strict";var n=r(7919).root.Symbol;e.rxSubscriber="function"==typeof n&&"function"==typeof n.for?n.for("rxSubscriber"):"@@rxSubscriber",e.$$rxSubscriber=e.rxSubscriber},1741:(t,e)=>{"use strict";var r=function(){function t(){this.values={}}return t.prototype.delete=function(t){return this.values[t]=null,!0},t.prototype.set=function(t,e){return this.values[t]=e,this},t.prototype.get=function(t){return this.values[t]},t.prototype.forEach=function(t,e){var r=this.values;for(var n in r)r.hasOwnProperty(n)&&null!==r[n]&&t.call(e,r[n],n)},t.prototype.clear=function(){this.values={}},t}();e.FastMap=r},5561:(t,e,r)=>{"use strict";var n=r(7919),o=function(){function t(t){if(this.root=t,t.setImmediate&&"function"==typeof t.setImmediate)this.setImmediate=t.setImmediate.bind(t),this.clearImmediate=t.clearImmediate.bind(t);else{this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.canUseProcessNextTick()?this.setImmediate=this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.setImmediate=this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.setImmediate=this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.setImmediate=this.createReadyStateChangeSetImmediate():this.setImmediate=this.createSetTimeoutSetImmediate();var e=function t(e){delete t.instance.tasksByHandle[e]};e.instance=this,this.clearImmediate=e}}return t.prototype.identify=function(t){return this.root.Object.prototype.toString.call(t)},t.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)},t.prototype.canUseMessageChannel=function(){return Boolean(this.root.MessageChannel)},t.prototype.canUseReadyStateChange=function(){var t=this.root.document;return Boolean(t&&"onreadystatechange"in t.createElement("script"))},t.prototype.canUsePostMessage=function(){var t=this.root;if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}return!1},t.prototype.partiallyApplied=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=function t(){var e=t.handler,r=t.args;"function"==typeof e?e.apply(void 0,r):new Function(""+e)()};return n.handler=t,n.args=e,n},t.prototype.addFromSetImmediateArguments=function(t){return this.tasksByHandle[this.nextHandle]=this.partiallyApplied.apply(void 0,t),this.nextHandle++},t.prototype.createProcessNextTickSetImmediate=function(){var t=function t(){var e=t.instance,r=e.addFromSetImmediateArguments(arguments);return e.root.process.nextTick(e.partiallyApplied(e.runIfPresent,r)),r};return t.instance=this,t},t.prototype.createPostMessageSetImmediate=function(){var t=this.root,e="setImmediate$"+t.Math.random()+"$",r=function r(n){var o=r.instance;n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&o.runIfPresent(+n.data.slice(e.length))};r.instance=this,t.addEventListener("message",r,!1);var n=function t(){var e=t,r=e.messagePrefix,n=e.instance,o=n.addFromSetImmediateArguments(arguments);return n.root.postMessage(r+o,"*"),o};return n.instance=this,n.messagePrefix=e,n},t.prototype.runIfPresent=function(t){if(this.currentlyRunningATask)this.root.setTimeout(this.partiallyApplied(this.runIfPresent,t),0);else{var e=this.tasksByHandle[t];if(e){this.currentlyRunningATask=!0;try{e()}finally{this.clearImmediate(t),this.currentlyRunningATask=!1}}}},t.prototype.createMessageChannelSetImmediate=function(){var t=this,e=new this.root.MessageChannel;e.port1.onmessage=function(e){var r=e.data;t.runIfPresent(r)};var r=function t(){var e=t,r=e.channel,n=e.instance,o=n.addFromSetImmediateArguments(arguments);return r.port2.postMessage(o),o};return r.channel=e,r.instance=this,r},t.prototype.createReadyStateChangeSetImmediate=function(){var t=function t(){var e=t.instance,r=e.root,n=r.document,o=n.documentElement,i=e.addFromSetImmediateArguments(arguments),s=n.createElement("script");return s.onreadystatechange=function(){e.runIfPresent(i),s.onreadystatechange=null,o.removeChild(s),s=null},o.appendChild(s),i};return t.instance=this,t},t.prototype.createSetTimeoutSetImmediate=function(){var t=function t(){var e=t.instance,r=e.addFromSetImmediateArguments(arguments);return e.root.setTimeout(e.partiallyApplied(e.runIfPresent,r),0),r};return t.instance=this,t},t}();e.ImmediateDefinition=o,e.Immediate=new o(n.root)},5205:(t,e,r)=>{"use strict";var n=r(7919),o=r(4846);e.Map=n.root.Map||o.MapPolyfill},4846:(t,e)=>{"use strict";var r=function(){function t(){this.size=0,this._values=[],this._keys=[]}return t.prototype.get=function(t){var e=this._keys.indexOf(t);return-1===e?void 0:this._values[e]},t.prototype.set=function(t,e){var r=this._keys.indexOf(t);return-1===r?(this._keys.push(t),this._values.push(e),this.size++):this._values[r]=e,this},t.prototype.delete=function(t){var e=this._keys.indexOf(t);return-1!==e&&(this._values.splice(e,1),this._keys.splice(e,1),this.size--,!0)},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this.size=0},t.prototype.forEach=function(t,e){for(var r=0;r<this.size;r++)t.call(e,this._values[r],this._keys[r])},t}();e.MapPolyfill=r},7376:function(t,e){"use strict";var r=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},n=function(t){function e(){var e=t.call(this,"object unsubscribed");this.name=e.name="ObjectUnsubscribedError",this.stack=e.stack,this.message=e.message}return r(e,t),e}(Error);e.ObjectUnsubscribedError=n},6288:function(t,e){"use strict";var r=this&&this.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},n=function(t){function e(e){t.call(this),this.errors=e;var r=Error.call(this,e?e.length+" errors occurred during unsubscription:\n "+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"");this.name=r.name="UnsubscriptionError",this.stack=r.stack,this.message=r.message}return r(e,t),e}(Error);e.UnsubscriptionError=n},4456:(t,e)=>{"use strict";e.errorObject={e:{}}},5198:(t,e)=>{"use strict";e.identity=function(t){return t}},5936:(t,e)=>{"use strict";e.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length}},2900:(t,e)=>{"use strict";e.isArrayLike=function(t){return t&&"number"==typeof t.length}},1589:(t,e)=>{"use strict";e.isDate=function(t){return t instanceof Date&&!isNaN(+t)}},1404:(t,e)=>{"use strict";e.isFunction=function(t){return"function"==typeof t}},3523:(t,e,r)=>{"use strict";var n=r(5936);e.isNumeric=function(t){return!n.isArray(t)&&t-parseFloat(t)+1>=0}},4548:(t,e)=>{"use strict";e.isObject=function(t){return null!=t&&"object"==typeof t}},338:(t,e)=>{"use strict";e.isPromise=function(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}},93:(t,e)=>{"use strict";e.isScheduler=function(t){return t&&"function"==typeof t.schedule}},4985:(t,e)=>{"use strict";e.noop=function(){}},1088:(t,e)=>{"use strict";e.not=function(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}},6903:(t,e,r)=>{"use strict";var n=r(4985);function o(t){return t?1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}:n.noop}e.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return o(t)},e.pipeFromArray=o},7919:(t,e,r)=>{"use strict";var n="undefined"!=typeof window&&window,o="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,i=void 0!==r.g&&r.g,s=n||i||o;e.root=s,function(){if(!s)throw new Error("RxJS could not find any global context (window, self, global)")}()},8794:(t,e,r)=>{"use strict";var n=r(7919),o=r(2900),i=r(338),s=r(4548),c=r(5100),a=r(5810),u=r(7056),p=r(683);e.subscribeToResult=function(t,e,r,l){var h=new u.InnerSubscriber(t,r,l);if(h.closed)return null;if(e instanceof c.Observable)return e._isScalar?(h.next(e.value),h.complete(),null):(h.syncErrorThrowable=!0,e.subscribe(h));if(o.isArrayLike(e)){for(var f=0,d=e.length;f<d&&!h.closed;f++)h.next(e[f]);h.closed||h.complete()}else{if(i.isPromise(e))return e.then((function(t){h.closed||(h.next(t),h.complete())}),(function(t){return h.error(t)})).then(null,(function(t){n.root.setTimeout((function(){throw t}))})),h;if(e&&"function"==typeof e[a.iterator])for(var y=e[a.iterator]();;){var b=y.next();if(b.done){h.complete();break}if(h.next(b.value),h.closed)break}else if(e&&"function"==typeof e[p.observable]){var v=e[p.observable]();if("function"==typeof v.subscribe)return v.subscribe(new u.InnerSubscriber(t,r,l));h.error(new TypeError("Provided object does not correctly implement Symbol.observable"))}else{var m="You provided "+(s.isObject(e)?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";h.error(new TypeError(m))}}return null}},9510:(t,e,r)=>{"use strict";var n=r(5239),o=r(2992),i=r(9275);e.toSubscriber=function(t,e,r){if(t){if(t instanceof n.Subscriber)return t;if(t[o.rxSubscriber])return t[o.rxSubscriber]()}return t||e||r?new n.Subscriber(t,e,r):new n.Subscriber(i.empty)}},6447:(t,e,r)=>{"use strict";var n,o=r(4456);function i(){try{return n.apply(this,arguments)}catch(t){return o.errorObject.e=t,o.errorObject}}e.tryCatch=function(t){return n=t,i}},6809:(t,e,r)=>{var n=r(3678),o=r(9113),i=r(2739),s=r(3669)("socket.io-client");t.exports=e=a;var c=e.managers={};function a(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,o=n(t),a=o.source,u=o.id,p=o.path,l=c[u]&&p in c[u].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||l?(s("ignoring socket cache for %s",a),r=i(a,e)):(c[u]||(s("new io instance for %s",a),c[u]=i(a,e)),r=c[u]),o.query&&!e.query&&(e.query=o.query),r.socket(o.path,e)}e.protocol=o.protocol,e.connect=a,e.Manager=r(2739),e.Socket=r(8584)},2739:(t,e,r)=>{var n=r(5983),o=r(8584),i=r(5848),s=r(9113),c=r(5464),a=r(6077),u=r(3669)("socket.io-client:manager"),p=r(7355),l=r(3010),h=Object.prototype.hasOwnProperty;function f(t,e){if(!(this instanceof f))return new f(t,e);t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new l({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=e.parser||s;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==e.autoConnect,this.autoConnect&&this.open()}t.exports=f,f.prototype.emitAll=function(){for(var t in this.emit.apply(this,arguments),this.nsps)h.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},f.prototype.updateSocketIds=function(){for(var t in this.nsps)h.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},f.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},i(f.prototype),f.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},f.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},f.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},f.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},f.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},f.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},f.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},f.prototype.open=f.prototype.connect=function(t,e){if(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;u("opening %s",this.uri),this.engine=n(this.uri,this.opts);var r=this.engine,o=this;this.readyState="opening",this.skipReconnect=!1;var i=c(r,"open",(function(){o.onopen(),t&&t()})),s=c(r,"error",(function(e){if(u("connect_error"),o.cleanup(),o.readyState="closed",o.emitAll("connect_error",e),t){var r=new Error("Connection error");r.data=e,t(r)}else o.maybeReconnectOnOpen()}));if(!1!==this._timeout){var a=this._timeout;u("connect attempt will timeout after %d",a),0===a&&i.destroy();var p=setTimeout((function(){u("connect attempt timed out after %d",a),i.destroy(),r.close(),r.emit("error","timeout"),o.emitAll("connect_timeout",a)}),a);this.subs.push({destroy:function(){clearTimeout(p)}})}return this.subs.push(i),this.subs.push(s),this},f.prototype.onopen=function(){u("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(c(t,"data",a(this,"ondata"))),this.subs.push(c(t,"ping",a(this,"onping"))),this.subs.push(c(t,"pong",a(this,"onpong"))),this.subs.push(c(t,"error",a(this,"onerror"))),this.subs.push(c(t,"close",a(this,"onclose"))),this.subs.push(c(this.decoder,"decoded",a(this,"ondecoded")))},f.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},f.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},f.prototype.ondata=function(t){this.decoder.add(t)},f.prototype.ondecoded=function(t){this.emit("packet",t)},f.prototype.onerror=function(t){u("error",t),this.emitAll("error",t)},f.prototype.socket=function(t,e){var r=this.nsps[t];if(!r){r=new o(this,t,e),this.nsps[t]=r;var n=this;r.on("connecting",i),r.on("connect",(function(){r.id=n.generateId(t)})),this.autoConnect&&i()}function i(){~p(n.connecting,r)||n.connecting.push(r)}return r},f.prototype.destroy=function(t){var e=p(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},f.prototype.packet=function(t){u("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,(function(r){for(var n=0;n<r.length;n++)e.engine.write(r[n],t.options);e.encoding=!1,e.processPacketQueue()})))},f.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},f.prototype.cleanup=function(){u("cleanup");for(var t=this.subs.length,e=0;e<t;e++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},f.prototype.close=f.prototype.disconnect=function(){u("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},f.prototype.onclose=function(t){u("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},f.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();u("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var r=setTimeout((function(){t.skipReconnect||(u("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open((function(e){e?(u("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(u("reconnect success"),t.onreconnect())})))}),e);this.subs.push({destroy:function(){clearTimeout(r)}})}},f.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},5464:t=>{t.exports=function(t,e,r){return t.on(e,r),{destroy:function(){t.removeListener(e,r)}}}},8584:(t,e,r)=>{var n=r(9113),o=r(5848),i=r(4042),s=r(5464),c=r(6077),a=r(3669)("socket.io-client:socket"),u=r(1830),p=r(3466);t.exports=f;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},h=o.prototype.emit;function f(t,e,r){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},r&&r.query&&(this.query=r.query),this.io.autoConnect&&this.open()}o(f.prototype),f.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[s(t,"open",c(this,"onopen")),s(t,"packet",c(this,"onpacket")),s(t,"close",c(this,"onclose"))]}},f.prototype.open=f.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.reconnecting||this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},f.prototype.send=function(){var t=i(arguments);return t.unshift("message"),this.emit.apply(this,t),this},f.prototype.emit=function(t){if(l.hasOwnProperty(t))return h.apply(this,arguments),this;var e=i(arguments),r={type:(void 0!==this.flags.binary?this.flags.binary:p(e))?n.BINARY_EVENT:n.EVENT,data:e,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(a("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this.flags={},this},f.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},f.prototype.onopen=function(){if(a("transport is open - connecting"),"/"!==this.nsp)if(this.query){var t="object"==typeof this.query?u.encode(this.query):this.query;a("sending connect packet with query %s",t),this.packet({type:n.CONNECT,query:t})}else this.packet({type:n.CONNECT})},f.prototype.onclose=function(t){a("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},f.prototype.onpacket=function(t){var e=t.nsp===this.nsp,r=t.type===n.ERROR&&"/"===t.nsp;if(e||r)switch(t.type){case n.CONNECT:this.onconnect();break;case n.EVENT:case n.BINARY_EVENT:this.onevent(t);break;case n.ACK:case n.BINARY_ACK:this.onack(t);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",t.data)}},f.prototype.onevent=function(t){var e=t.data||[];a("emitting event %j",e),null!=t.id&&(a("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?h.apply(this,e):this.receiveBuffer.push(e)},f.prototype.ack=function(t){var e=this,r=!1;return function(){if(!r){r=!0;var o=i(arguments);a("sending ack %j",o),e.packet({type:p(o)?n.BINARY_ACK:n.ACK,id:t,data:o})}}},f.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(a("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):a("bad ack %s",t.id)},f.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},f.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)h.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},f.prototype.ondisconnect=function(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},f.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},f.prototype.close=f.prototype.disconnect=function(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},f.prototype.compress=function(t){return this.flags.compress=t,this},f.prototype.binary=function(t){return this.flags.binary=t,this}},3678:(t,e,r)=>{var n=r(4187),o=r(3669)("socket.io-client:url");t.exports=function(t,e){var r=t;e=e||"undefined"!=typeof location&&location,null==t&&(t=e.protocol+"//"+e.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?e.protocol+t:e.host+t),/^(https?|wss?):\/\//.test(t)||(o("protocol-less url %s",t),t=void 0!==e?e.protocol+"//"+t:"https://"+t),o("parse %s",t),r=n(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port,r.href=r.protocol+"://"+i+(e&&e.port===r.port?"":":"+r.port),r}},5848:t=>{function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}},3669:(t,e,r)=>{function n(){var t;try{t=e.storage.debug}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t}(e=t.exports=r(1350)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),r){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))})),t.splice(i,0,n)}},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=n,e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(n())},1350:(t,e,r)=>{function n(t){var r;function n(){if(n.enabled){var t=n,o=+new Date,i=o-(r||o);t.diff=i,t.prev=r,t.curr=o,r=o;for(var s=new Array(arguments.length),c=0;c<s.length;c++)s[c]=arguments[c];s[0]=e.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var a=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;a++;var o=e.formatters[n];if("function"==typeof o){var i=s[a];r=o.call(t,i),s.splice(a,1),a--}return r})),e.formatArgs.call(t,s);var u=n.log||e.log||console.log.bind(console);u.apply(t,s)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=function(t){var r,n=0;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}(t),n.destroy=o,"function"==typeof e.init&&e.init(n),e.instances.push(n),n}function o(){var t=e.instances.indexOf(this);return-1!==t&&(e.instances.splice(t,1),!0)}(e=t.exports=n.debug=n.default=n).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){var r;e.save(t),e.names=[],e.skips=[];var n=("string"==typeof t?t:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(r=0;r<e.instances.length;r++){var i=e.instances[r];i.enabled=e.enabled(i.namespace)}},e.enabled=function(t){if("*"===t[t.length-1])return!0;var r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(7824),e.instances=[],e.names=[],e.skips=[],e.formatters={}},2326:(t,e,r)=>{var n=r(6327),o=r(6066),i=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===i.call(Blob),c="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===i.call(File);function a(t,e){if(!t)return t;if(o(t)){var r={_placeholder:!0,num:e.length};return e.push(t),r}if(n(t)){for(var i=new Array(t.length),s=0;s<t.length;s++)i[s]=a(t[s],e);return i}if("object"==typeof t&&!(t instanceof Date)){for(var c in i={},t)i[c]=a(t[c],e);return i}return t}function u(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(n(t))for(var r=0;r<t.length;r++)t[r]=u(t[r],e);else if("object"==typeof t)for(var o in t)t[o]=u(t[o],e);return t}e.deconstructPacket=function(t){var e=[],r=t.data,n=t;return n.data=a(r,e),n.attachments=e.length,{packet:n,buffers:e}},e.reconstructPacket=function(t,e){return t.data=u(t.data,e),t.attachments=void 0,t},e.removeBlobs=function(t,e){var r=0,i=t;!function t(a,u,p){if(!a)return a;if(s&&a instanceof Blob||c&&a instanceof File){r++;var l=new FileReader;l.onload=function(){p?p[u]=this.result:i=this.result,--r||e(i)},l.readAsArrayBuffer(a)}else if(n(a))for(var h=0;h<a.length;h++)t(a[h],h,a);else if("object"==typeof a&&!o(a))for(var f in a)t(a[f],f,a)}(i),r||e(i)}},9113:(t,e,r)=>{var n=r(1618)("socket.io-parser"),o=r(5778),i=r(2326),s=r(6327),c=r(6066);function a(){}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=a,e.Decoder=l;var u=e.ERROR+'"encode error"';function p(t){var r=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(r+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(r+=t.nsp+","),null!=t.id&&(r+=t.id),null!=t.data){var o=function(t){try{return JSON.stringify(t)}catch(t){return!1}}(t.data);if(!1===o)return u;r+=o}return n("encoded %j as %s",t,r),r}function l(){this.reconstructor=null}function h(t){this.reconPack=t,this.buffers=[]}function f(t){return{type:e.ERROR,data:"parser error: "+t}}a.prototype.encode=function(t,r){n("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type?function(t,e){i.removeBlobs(t,(function(t){var r=i.deconstructPacket(t),n=p(r.packet),o=r.buffers;o.unshift(n),e(o)}))}(t,r):r([p(t)])},o(l.prototype),l.prototype.add=function(t){var r;if("string"==typeof t)r=function(t){var r=0,o={type:Number(t.charAt(0))};if(null==e.types[o.type])return f("unknown packet type "+o.type);if(e.BINARY_EVENT===o.type||e.BINARY_ACK===o.type){for(var i=r+1;"-"!==t.charAt(++r)&&r!=t.length;);var c=t.substring(i,r);if(c!=Number(c)||"-"!==t.charAt(r))throw new Error("Illegal attachments");o.attachments=Number(c)}if("/"===t.charAt(r+1)){for(i=r+1;++r&&","!==(u=t.charAt(r))&&r!==t.length;);o.nsp=t.substring(i,r)}else o.nsp="/";var a=t.charAt(r+1);if(""!==a&&Number(a)==a){for(i=r+1;++r;){var u;if(null==(u=t.charAt(r))||Number(u)!=u){--r;break}if(r===t.length)break}o.id=Number(t.substring(i,r+1))}if(t.charAt(++r)){var p=function(t){try{return JSON.parse(t)}catch(t){return!1}}(t.substr(r));if(!1===p||o.type!==e.ERROR&&!s(p))return f("invalid payload");o.data=p}return n("decoded %s as %j",t,o),o}(t),e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type?(this.reconstructor=new h(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!c(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(r=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",r))}},l.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},h.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=i.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},h.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},6066:t=>{t.exports=function(t){return e&&Buffer.isBuffer(t)||r&&(t instanceof ArrayBuffer||function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer}(t))};var e="function"==typeof Buffer&&"function"==typeof Buffer.isBuffer,r="function"==typeof ArrayBuffer},5778:t=>{function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}},1618:(t,e,r)=>{function n(){var t;try{t=e.storage.debug}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t}(e=t.exports=r(968)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),r){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))})),t.splice(i,0,n)}},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=n,e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(n())},968:(t,e,r)=>{function n(t){var r;function n(){if(n.enabled){var t=n,o=+new Date,i=o-(r||o);t.diff=i,t.prev=r,t.curr=o,r=o;for(var s=new Array(arguments.length),c=0;c<s.length;c++)s[c]=arguments[c];s[0]=e.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var a=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;a++;var o=e.formatters[n];if("function"==typeof o){var i=s[a];r=o.call(t,i),s.splice(a,1),a--}return r})),e.formatArgs.call(t,s);var u=n.log||e.log||console.log.bind(console);u.apply(t,s)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=function(t){var r,n=0;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}(t),n.destroy=o,"function"==typeof e.init&&e.init(n),e.instances.push(n),n}function o(){var t=e.instances.indexOf(this);return-1!==t&&(e.instances.splice(t,1),!0)}(e=t.exports=n.debug=n.default=n).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){var r;e.save(t),e.names=[],e.skips=[];var n=("string"==typeof t?t:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(r=0;r<e.instances.length;r++){var i=e.instances[r];i.enabled=e.enabled(i.namespace)}},e.enabled=function(t){if("*"===t[t.length-1])return!0;var r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(7824),e.instances=[],e.names=[],e.skips=[],e.formatters={}},6327:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},4042:t=>{t.exports=function(t,e){for(var r=[],n=(e=e||0)||0;n<t.length;n++)r[n-e]=t[n];return r}},2281:t=>{"use strict";var e,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),n={},o=0,i=0;function s(t){var e="";do{e=r[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}function c(){var t=s(+new Date);return t!==e?(o=0,e=t):t+"."+s(o++)}for(;i<64;i++)n[r[i]]=i;c.encode=s,c.decode=function(t){var e=0;for(i=0;i<t.length;i++)e=64*e+n[t.charAt(i)];return e},t.exports=c},418:()=>{}},e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r(9271)})();"use strict";
(function (window, document, bs, undefined) {
var socket = bs.socket;
var uiOptions = {
bs: {}
};
socket.on("ui:connection", function (options) {
uiOptions = options;
bs.socket.emit("ui:history:connected", {
href: window.location.href
});
});
socket.on("ui:element:remove", function (data) {
if (data.id) {
var elem = document.getElementById(data.id);
if (elem) {
removeElement(elem);
}
}
});
socket.on("highlight", function () {
var id = "__browser-sync-highlight__";
var elem = document.getElementById(id);
if (elem) {
return removeElement(elem);
}
(function (e) {
e.style.position = "fixed";
e.style.zIndex = "1000";
e.style.width = "100%";
e.style.height = "100%";
e.style.borderWidth = "5px";
e.style.borderColor = "red";
e.style.borderStyle = "solid";
e.style.top = "0";
e.style.left = "0";
e.setAttribute("id", id);
document.getElementsByTagName("body")[0].appendChild(e);
})(document.createElement("div"));
});
socket.on("ui:element:add", function (data) {
var elem = document.getElementById(data.id);
if (!elem) {
if (data.type === "css") {
return addCss(data);
}
if (data.type === "js") {
return addJs(data);
}
if (data.type === "dom") {
return addDomNode(data);
}
}
});
bs.addDomNode = addDomNode;
bs.addJs = addJs;
bs.addCss = addJs;
function addJs(data) {
(function (e) {
e.setAttribute("src", getAbsoluteUrl(data.src));
e.setAttribute("id", data.id);
document.getElementsByTagName("body")[0].appendChild(e);
})(document.createElement("script"));
}
function addCss(data) {
(function (e) {
e.setAttribute("rel", "stylesheet");
e.setAttribute("type", "text/css");
e.setAttribute("id", data.id);
e.setAttribute("media", "all");
e.setAttribute("href", getAbsoluteUrl(data.src));
document.getElementsByTagName("head")[0].appendChild(e);
})(document.createElement("link"));
}
function addDomNode(data) {
var elem = document.createElement(data.tagName);
for (var attr in data.attrs) {
elem.setAttribute(attr, data.attrs[attr]);
}
if (data.placement) {
document.getElementsByTagName(data.placement)[0].appendChild(elem);
} else {
document.getElementsByTagName("body")[0].appendChild(elem);
}
return elem;
}
function removeElement(element) {
if (element && element.parentNode) {
element.parentNode.removeChild(element);
}
}
function getAbsoluteUrl(path) {
if (path.match(/^h/)) {
return path;
}
return [window.location.protocol, "//", getHost(), path].join("");
}
function getHost () {
return uiOptions.bs.mode === "snippet" ? window.location.hostname + ":" + uiOptions.bs.port : window.location.host;
}
})(window, document, ___browserSync___); | 1,362.868217 | 169,229 | 0.709584 |
28c83dc8e94703f6bdf5b6da91feea1fc3adca1d | 354 | js | JavaScript | docs/ui/checkbox.js | chrisrzhou/unified-doc | 84f0f02579be27123bf420e392e4c1a95e907872 | [
"MIT"
] | 12 | 2020-03-17T08:23:46.000Z | 2021-12-19T11:59:04.000Z | docs/ui/checkbox.js | chrisrzhou/unified-doc | 84f0f02579be27123bf420e392e4c1a95e907872 | [
"MIT"
] | 2 | 2020-05-15T13:35:27.000Z | 2020-07-19T22:24:34.000Z | docs/ui/checkbox.js | chrisrzhou/unified-doc | 84f0f02579be27123bf420e392e4c1a95e907872 | [
"MIT"
] | 1 | 2020-04-08T22:27:25.000Z | 2020-04-08T22:27:25.000Z | import React from 'react';
import { Checkbox as ThemeUICheckbox } from 'theme-ui';
import Label from './label';
export default function Checkbox({ id, label, value, onChange }) {
return (
<Label htmlFor={id} direction="row">
<ThemeUICheckbox
id={id}
checked={value}
onChange={() => onChange(!value)}
/>
{label}
</Label>
);
}
| 19.666667 | 66 | 0.635593 |
28c97eb69a9001232164643c27caea935c7675e7 | 373 | js | JavaScript | src/main.js | pureliumy/vue-netease-music | ff3dcfb15936ed4230933e5fe09cc9d05a8202ec | [
"MIT"
] | 1 | 2019-12-08T08:06:39.000Z | 2019-12-08T08:06:39.000Z | src/main.js | pureliumy/vue-netease-music | ff3dcfb15936ed4230933e5fe09cc9d05a8202ec | [
"MIT"
] | null | null | null | src/main.js | pureliumy/vue-netease-music | ff3dcfb15936ed4230933e5fe09cc9d05a8202ec | [
"MIT"
] | null | null | null | // The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Vuebar from 'vuebar'
import store from './store'
import router from './router'
Vue.config.productionTip = false
Vue.use(Vuebar)
/* eslint-disable no-new */
new Vue({
router,
store
}).$mount('#app')
| 23.3125 | 80 | 0.715818 |
28ca59b858fd6d7308f6f7cc1b1a58ee4650d8eb | 8,152 | js | JavaScript | src/main/resources/static/js/app/index.js | xutong3/bsds | aee51b409bd0d9880494df5d681fecc514b23fd2 | [
"Apache-2.0"
] | null | null | null | src/main/resources/static/js/app/index.js | xutong3/bsds | aee51b409bd0d9880494df5d681fecc514b23fd2 | [
"Apache-2.0"
] | null | null | null | src/main/resources/static/js/app/index.js | xutong3/bsds | aee51b409bd0d9880494df5d681fecc514b23fd2 | [
"Apache-2.0"
] | null | null | null | var $breadcrumb = $(".breadcrumb");
var $main_content = $(".main-content");
var $card = $(".card");
var $card_block = $(".card-block");
$(window).on("load", function() {
setTimeout(function() {
$(".page-loader").fadeOut()
}, 500)
}), $(document).ready(function() {
// 设置主题色
var theme_color = $MB.getThemeColor(theme);
var opacity_color = $MB.getThemeRGBA(theme,0.1);
var $head = $("head");
$("body").attr("data-ma-theme", theme);
$(".bg-" + theme).addClass("active").siblings().removeClass("active");
$head.append("<style>.toggle-switch__checkbox:checked ~ .toggle-switch__helper:after{background-color: " + theme_color + "}</style>")
.append("<style>.btn-save{background: " + theme_color + "; color: #fff }</style>")
.append("<style>.custom-control-input:checked ~ .custom-control-indicator{ border-color: " + theme_color + " }</style>")
.append("<style>.custom-radio .custom-control-indicator:before{background-color: " + theme_color + "}</style>")
.append("<style>.navigation__active > a:hover{color: " + theme_color + " !important;}</style>")
.append("<style>.navigation__active{color: " + theme_color + ";font-weight: bold;}</style>")
.append("<style>.fixed-table-pagination .pagination li.active a{ background:" + theme_color + ";border: 1px solid " + theme_color + "}</style>")
.append("<style>.form-group__bar:before, .form-group__bar:after {background-color: " + theme_color + "}</style>")
.append("<style>.daterangepicker td.active, .daterangepicker td.active:hover,.end-date {background-color: "+ theme_color +" !important}</style>")
.append("<style>.daterangepicker td.in-range {background-color:"+opacity_color+"}</style>");
}), $(document).ready(function() {
function a(a) {
a.requestFullscreen ? a.requestFullscreen() : a.mozRequestFullScreen ? a.mozRequestFullScreen() : a.webkitRequestFullscreen ? a.webkitRequestFullscreen() : a.msRequestFullscreen && a.msRequestFullscreen()
}
$("body").on("click", "[data-ma-action]", function(b) {
b.preventDefault();
var c = $(this),
d = c.data("ma-action"),
e = "";
switch (d) {
case "aside-open":
e = c.data("ma-target"), c.addClass("toggled"), $(e).addClass("toggled"), $(".content, .header").append('<div class="ma-backdrop" data-ma-action="aside-close" data-ma-target=' + e + " />");
break;
case "aside-close":
e = c.data("ma-target"), $('[data-ma-action="aside-open"], ' + e).removeClass("toggled"), $(".content, .header").find(".ma-backdrop").remove();
break;
}
})
}), $(document).ready(function() {
$("body").on("change", ".theme-switch input:radio", function() {
var a = $(this).val();
$("body").attr("data-ma-theme", a);
$.get(ctx + "user/theme", { "theme": a, "username": userName }, function(r) {
if (r.code == 0) $MB.n_success("主题更换成功,下次登录时生效!");
});
})
}), $("body").on("click", ".navigation__sub > a", function(a) {
a.preventDefault(), $(this).parent().toggleClass("navigation__sub--toggled"), $(this).next("ul").slideToggle(250)
}), $(document).ready(function() {
var str = "";
var forTree = function(o) {
o.length;
for (var i = 0; i < o.length; i++) {
var urlstr = "";
try {
if (!o[i]["url"] && !!o[i]["icon"]) {
urlstr = "<div><span><i class='" + o[i]["icon"] + "'></i> " + o[i]["text"] + "</span><ul>";
} else if (!o[i]["url"]) {
urlstr = "<div><span>" + o[i]["text"] + "</span><ul>";
} else {
var icon="";
if(o[i]["icon"]){
icon="<i class='" + o[i]["icon"] + "'></i> "
}
urlstr = "<div><span name=" + o[i]["url"] + " onclick='loadMain(this);'>" +icon+ o[i]["text"] + "</span><ul>";
}
str += urlstr;
if (o[i]["children"].length != 0) {
forTree(o[i]["children"]);
}
str += "</ul></div>";
} catch (e) {
console.log(e);
}
}
return str;
}
var menuTree = function() {
$("#navigation ul").each(function(index, element) {
var ulContent = $(element).html();
var spanContent = $(element).siblings("span").html();
if (ulContent) {
$(element).siblings("span").html(spanContent)
}
});
$("#navigation").find("div span").click(function() {
var ul = $(this).siblings("ul").hide(300);
var spanStr = $(this).html();
var spanContent = spanStr.substr(3, spanStr.length);
if (ul.find("div").html() != null) {
if (ul.css("display") == "none") {
ul.show(300);
} else {
ul.hide(300);
}
}
});
$("#navigation").find("div>span").click(function() {
var ul = $(this).parent().siblings().find(">ul");
ul.hide(300);
})
}
$.post(ctx + "menu/getUserMenu", { "userName": userName }, function(r) {
if (r.code == 0) {
var data = r.msg;
document.getElementById("navigation").innerHTML = forTree(data.children);
menuTree();
$(".scrollbar-inner")[0] && $(".scrollbar-inner").scrollbar().scrollLock()
} else {
$MB.n_danger(r.msg);
}
})
});
function loadMain(obj) {
var $this = $(obj);
$(".navigation").find("span").removeClass("navigation__active");
$this.addClass("navigation__active").parents("ul").prev().addClass("navigation__active");
var breadcrumnHtml = "";
var target_text = $this.text();
var text_arr = new Array();
var parent = $this.parents("ul").prev().each(function() {
var $this = $(this);
text_arr.unshift($this.text());
});
for (var i = 0; i < text_arr.length; i++) {
breadcrumnHtml += '<li class="breadcrumb-item">' + text_arr[i] + '</li>';
}
breadcrumnHtml += '<li class="breadcrumb-item">' + target_text + '</li>';
$breadcrumb.html("").append(breadcrumnHtml);
var $name = $this.attr("name");
$.get(ctx + $name, {}, function(r) {
if (r.indexOf('账户登录') != -1) {
location = location;
return;
}
$main_content.html("").append(r);
});
}
function fullScreen(obj) {
var $this = $(obj);
var element;
if ($this.text() == '全屏') {
$this.text("退出全屏");
element = document.documentElement;
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else {
$MB.n_info("当前浏览器不支持全屏或已被禁用!");
$this.text("全屏");
}
} else {
elem = document;
$this.text("全屏");
if (elem.webkitCancelFullScreen) {
elem.webkitCancelFullScreen();
} else if (elem.mozCancelFullScreen) {
elem.mozCancelFullScreen();
} else if (elem.cancelFullScreen) {
elem.cancelFullScreen();
} else if (elem.exitFullscreen) {
elem.exitFullscreen();
}
}
}
$(".user__img").attr("src", avatar);
$("#user__profile").on('click', function() {
$.post(ctx + "user/profile", function(r) {
$breadcrumb.html("").append('<li class="breadcrumb-item">个人信息</li>');
$main_content.html("").append(r);
});
}); | 42.458333 | 213 | 0.509568 |
28cb8ecc582e17d0f508601dbd116ccde8cf3288 | 3,987 | js | JavaScript | src/assets/js/scale/discontinuity/skipWeekends.js | ipelengbela/ipelengbela.github.io-bitflux | 837572acf31912921b391a1023e9bece3669dcf8 | [
"MIT"
] | 1 | 2016-08-17T10:13:53.000Z | 2016-08-17T10:13:53.000Z | src/assets/js/scale/discontinuity/skipWeekends.js | ipelengbela/ipelengbela.github.io-bitflux | 837572acf31912921b391a1023e9bece3669dcf8 | [
"MIT"
] | null | null | null | src/assets/js/scale/discontinuity/skipWeekends.js | ipelengbela/ipelengbela.github.io-bitflux | 837572acf31912921b391a1023e9bece3669dcf8 | [
"MIT"
] | null | null | null | import d3 from 'd3';
// TODO: Temp until merged into d3fc
export default function() {
var millisPerDay = 24 * 3600 * 1000;
var millisPerWorkWeek = millisPerDay * 5;
var millisPerWeek = millisPerDay * 7;
var skipWeekends = {};
function isWeekend(date) {
return date.getDay() === 0 || date.getDay() === 6;
}
skipWeekends.clampDown = function(date) {
if (date && isWeekend(date)) {
var daysToSubtract = date.getDay() === 0 ? 2 : 1;
// round the date up to midnight
var newDate = d3.time.day.ceil(date);
// then subtract the required number of days
return d3.time.day.offset(newDate, -daysToSubtract);
} else {
return date;
}
};
skipWeekends.clampUp = function(date) {
if (date && isWeekend(date)) {
var daysToAdd = date.getDay() === 0 ? 1 : 2;
// round the date down to midnight
var newDate = d3.time.day.floor(date);
// then add the required number of days
return d3.time.day.offset(newDate, daysToAdd);
} else {
return date;
}
};
// returns the number of included milliseconds (i.e. those which do not fall)
// within discontinuities, along this scale
skipWeekends.distance = function(startDate, endDate) {
startDate = skipWeekends.clampUp(startDate);
endDate = skipWeekends.clampDown(endDate);
// move the start date to the end of week boundary
var offsetStart = d3.time.saturday.ceil(startDate);
if (endDate < offsetStart) {
return endDate.getTime() - startDate.getTime();
}
var msAdded = offsetStart.getTime() - startDate.getTime();
// move the end date to the end of week boundary
var offsetEnd = d3.time.saturday.ceil(endDate);
var msRemoved = offsetEnd.getTime() - endDate.getTime();
// determine how many weeks there are between these two dates
var weeks = Math.round((offsetEnd.getTime() - offsetStart.getTime()) / millisPerWeek);
return weeks * millisPerWorkWeek + msAdded - msRemoved;
};
skipWeekends.offset = function(startDate, ms) {
var date = isWeekend(startDate) ? skipWeekends.clampUp(startDate) : startDate;
var remainingms = ms;
if (remainingms < 0) {
var startOfWeek = d3.time.monday.floor(date);
remainingms -= (startOfWeek.getTime() - date.getTime());
if (remainingms >= 0) {
return new Date(date.getTime() + ms);
}
date = d3.time.day.offset(startOfWeek, -2);
var weeks = Math.floor(remainingms / millisPerWorkWeek);
date = d3.time.day.offset(date, weeks * 7);
remainingms -= weeks * millisPerWorkWeek;
date = new Date(date.getTime() + remainingms);
date = d3.time.day.offset(date, 2);
return date;
} else {
// move to the end of week boundary
var endOfWeek = d3.time.saturday.ceil(date);
remainingms -= (endOfWeek.getTime() - date.getTime());
// if the distance to the boundary is greater than the number of ms
// simply add the ms to the current date
if (remainingms < 0) {
return new Date(date.getTime() + ms);
}
// skip the weekend
date = d3.time.day.offset(endOfWeek, 2);
// add all of the complete weeks to the date
var completeWeeks = Math.floor(remainingms / millisPerWorkWeek);
date = d3.time.day.offset(date, completeWeeks * 7);
remainingms -= completeWeeks * millisPerWorkWeek;
// add the remaining time
date = new Date(date.getTime() + remainingms);
return date;
}
};
skipWeekends.copy = function() { return skipWeekends; };
return skipWeekends;
}
| 35.283186 | 94 | 0.579383 |
28cc31ff1f2d1d5d5f9c12ba697186c02d5816af | 923 | js | JavaScript | server/client/public/elements/views/employment/app-employment.js | ucd-library/orcid-app | cf0620917bc84960ab50f6e1837ef4be0dd3dc04 | [
"MIT"
] | 1 | 2018-11-18T04:56:29.000Z | 2018-11-18T04:56:29.000Z | server/client/public/elements/views/employment/app-employment.js | ucd-library/orcid-app | cf0620917bc84960ab50f6e1837ef4be0dd3dc04 | [
"MIT"
] | 34 | 2018-08-17T17:43:54.000Z | 2018-10-30T21:38:36.000Z | server/client/public/elements/views/employment/app-employment.js | ucd-library/orcid-app | cf0620917bc84960ab50f6e1837ef4be0dd3dc04 | [
"MIT"
] | null | null | null | import {PolymerElement, html} from "@polymer/polymer"
import template from "./app-employment.html"
import "@polymer/iron-pages"
import "./employment-editor/app-employment-editor"
import "./app-employment-viewer"
export default class AppEmployment extends Mixin(PolymerElement)
.with(EventInterface) {
static get template() {
return html([template]);
}
static get properties() {
return {
selectedView : {
type : String,
value : 'view'
},
page : {
type : String,
value : ''
}
}
}
constructor() {
super();
this._injectModel('AppStateModel');
}
_onAppStateUpdate(e) {
if( e.location.path[0] === this.page ) {
if( e.location.path.length > 1 ) {
this.selectedView = e.location.path[1]
} else {
this.selectedView = 'view'
}
}
}
}
customElements.define('app-employment', AppEmployment); | 20.065217 | 64 | 0.605634 |
28cc9faef5dbc9f406acf24b7804f9af7825de66 | 1,947 | js | JavaScript | backend/routes/footer-links/footer-links-controller.js | Stanislav-Ivankov/Jilanov-Server | 9403e750396dde87b3d15b072a99d4a01e517b0f | [
"MIT"
] | null | null | null | backend/routes/footer-links/footer-links-controller.js | Stanislav-Ivankov/Jilanov-Server | 9403e750396dde87b3d15b072a99d4a01e517b0f | [
"MIT"
] | null | null | null | backend/routes/footer-links/footer-links-controller.js | Stanislav-Ivankov/Jilanov-Server | 9403e750396dde87b3d15b072a99d4a01e517b0f | [
"MIT"
] | null | null | null | const modelName = 'FooterLinks';
const footerLinkController = (repository) => {
const addFooterLink = async (req, res) => {
const footerLinkData = req.body;
return repository.create({ modelName, newObject: footerLinkData })
.then((response) => {
if (response.ok !== 0) {
res.status(200).send(response._doc);
} else {
res.status(400).send(
{
error: response
}
);
}
})
.catch(error => console.log(error));
};
const editFooterLink = async (req, res) => {
const footerLinkData = req.body;
return repository.update({ modelName, updatedRecord: footerLinkData })
.then((response) => {
if (response.ok !== 0) {
res.status(200).send(response._doc);
} else {
res.status(400).send(
{
error: response
}
);
}
})
.catch(error => console.log(error));
};
const removeFooterLink = async (req, res) => {
const footerLinkData = req.body;
return repository.remove({ modelName, record: footerLinkData })
.then((response) => {
if (response.ok !== 0) {
res.status(200).send(response._doc);
} else {
res.status(400).send(
{
error: response
}
);
}
}).catch(error => console.log(error));
};
const getFooterLinks = async (req, res) => {
return repository.find({ modelName })
.then((response) => {
if (response.ok !== 0) {
res.status(200).send(response);
} else {
res.status(400).send(
{
error: response
}
);
}
})
.catch(error => console.log(error));
};
return {
addFooterLink,
editFooterLink,
removeFooterLink,
getFooterLinks
};
};
module.exports = footerLinkController; | 24.961538 | 74 | 0.506934 |
28cd3d5a321b8826ee1a600fc2eab1f13f2735b9 | 4,068 | js | JavaScript | projects/book-shop/js/book-shop-controller.js | Talkoosh/Gallery | dff761a07f24d64bf74f9b067dea9b498900759c | [
"MIT"
] | null | null | null | projects/book-shop/js/book-shop-controller.js | Talkoosh/Gallery | dff761a07f24d64bf74f9b067dea9b498900759c | [
"MIT"
] | null | null | null | projects/book-shop/js/book-shop-controller.js | Talkoosh/Gallery | dff761a07f24d64bf74f9b067dea9b498900759c | [
"MIT"
] | null | null | null | 'use strict';
function onInit() {
renderBooks();
renderPageButtons();
}
function renderBooks() {
const books = getBooks();
var strHTML = '';
for (var i = 0; i < books.length; i++) {
strHTML += `<tr><td>${books[i].id}</td><td>${books[i].title}
</td><td>${books[i].price}$</td><td>${books[i].rating}</td>
<td><button onclick="onReadBook(${books[i].id})" class="read-button">Read</button></td>
<td><button onclick="onUpdateBookPrice(${books[i].id})" class="update-button">Update</button></td>
<td><button onclick="onDeleteBook(${books[i].id})" class="delete-button" id="${books[i].id}">Delete</button></td></tr>`;
}
document.querySelector('table tbody').innerHTML = strHTML;
}
function onDeleteBook(bookId) {
deleteBook(bookId);
renderBooks();
renderPageButtons();
}
function onAddBook() {
const bookTitle = document.querySelector('[name="book-name"]').value
const bookPrice = +document.querySelector('[name="book-price"]').value;
if(!bookTitle || !bookPrice) return;
addBook(bookTitle, bookPrice);
clearBookInput();
renderBooks();
renderPageButtons();
}
function onUpdateBookPrice(bookId) {
const elButton = document.querySelector('.price-modal button');
elButton.setAttribute('data-id', bookId);
showPriceUpdateModal();
}
function onReadBook(bookId) {
const book = getBook(bookId);
renderReadModal(book);
}
function renderReadModal(book) {
const elModal = document.querySelector('.read-modal');
elModal.querySelector('.read-summary').innerText = book.content;
elModal.querySelector('h3').innerText = book.title;
elModal.querySelector('.read-price').innerText = book.price + '$';
renderModalInput(elModal, book);
elModal.classList.add('show-read-modal');
}
function renderModalInput(elModal, book){
elModal.querySelector('.rating-input').innerHTML = `<input name="${book.id}" value="${book.rating}" type="number"
min="0" max="10">
<button class="rating-button" onclick="onBookRatingChange(${book.id})">Submit Rating</button>`
}
function onModalExit() {
const elModal = document.querySelector('.read-modal');
elModal.classList.remove('show-read-modal');
}
function onBookRatingChange(bookId){
const elRatingInput = document.querySelector('.rating-input input');
setBookRating(bookId, elRatingInput.value);
onModalExit();
renderBooks();
}
function onPriceModalButtonClick(elButton){
const bookId = elButton.dataset.id;
const elModalInput = document.querySelector('[name="update-input"]');
updateBookPrice(+bookId, +elModalInput.value);
hidePriceUpdateModal();
renderBooks();
elModalInput.value = '';
}
function onSortBooks(sortByStr){
sortBooks(sortByStr);
renderBooks();
}
function onNextPage(pageStr){
setNextPage(pageStr);
renderPageButtons();
renderBooks();
}
function renderPageButtons(){
togglePageButtons();
var strHTML = '';
const lastPage = getLastPage();
for(var i = 1; i <= lastPage; i++){
strHTML += `<button onclick="onPageNumberClick(${i})">${i}</button>`
}
const elPageNumbersDiv = document.querySelector('.page-numbers');
elPageNumbersDiv.innerHTML = strHTML;
}
function onPageNumberClick(pageNum){
jumpToPage(pageNum);
togglePageButtons();
renderBooks();
}
function togglePageButtons(currPageNum){
const elForwardBtn = document.querySelector('.forward-button');
const elBackwardBtn = document.querySelector('.backward-button');
elForwardBtn.disabled = isLastPage();
elBackwardBtn.disabled = isFirstPage();
}
function hidePriceUpdateModal(){
const elModal = document.querySelector('.price-modal');
elModal.classList.remove('show-price-modal');
}
function showPriceUpdateModal(){
document.querySelector('.price-modal').classList.add('show-price-modal');
}
function clearBookInput(){
document.querySelector('[name="book-name"]').value = '';
document.querySelector('[name="book-price"]').value = '';
}
| 29.911765 | 128 | 0.677729 |
28cd6895c1da3c20b385c1fb8430084761840d35 | 354 | js | JavaScript | tailwind.config.js | lucky-media/wiki-template | dd4c4bef2accd80efe0c05d3b5d2627d809e1619 | [
"MIT"
] | null | null | null | tailwind.config.js | lucky-media/wiki-template | dd4c4bef2accd80efe0c05d3b5d2627d809e1619 | [
"MIT"
] | 1 | 2021-03-10T01:05:34.000Z | 2021-03-10T01:05:34.000Z | tailwind.config.js | lucky-media/wiki-template | dd4c4bef2accd80efe0c05d3b5d2627d809e1619 | [
"MIT"
] | null | null | null | module.exports = {
theme: {
container: {
center: true,
},
fontFamily: {
'sans': 'Rubik, -apple-system, BlinkMacSystemFont',
},
extend: {}
},
variants: {
margin: ['responsive', 'first'],
textColor: ['responsive', 'hover', 'group-hover'],
borderColor: ['responsive', 'hover', 'last']
},
plugins: []
};
| 19.666667 | 57 | 0.539548 |
28ceb121df245df0a51dd07f4b59f676c28b13d1 | 2,457 | js | JavaScript | test/rootDSEPromised.js | Frank683/node-activedirectory | 1613a66505e5afc1388994d3900138c50ce33f7a | [
"MIT"
] | null | null | null | test/rootDSEPromised.js | Frank683/node-activedirectory | 1613a66505e5afc1388994d3900138c50ce33f7a | [
"MIT"
] | null | null | null | test/rootDSEPromised.js | Frank683/node-activedirectory | 1613a66505e5afc1388994d3900138c50ce33f7a | [
"MIT"
] | null | null | null | 'use strict'
/* eslint-env node, mocha */
/* eslint-disable no-unused-expressions */
const expect = require('chai').expect
const ActiveDirectory = require('../index').promiseWrapper
const config = require('./config')
let server = require('./mockServer')
describe('Promised getRootDSE method', function () {
let ad
before(function (done) {
server(function (s) {
ad = new ActiveDirectory(config)
server = s
done()
})
})
it('should return ECONNREFUSED for closed port', function (done) {
ActiveDirectory.getRootDSE('ldap://127.0.0.1:389')
.then(done)
.catch((err) => {
expect(err).to.not.be.null
expect(err).to.be.an.instanceof(Error)
expect(err.errno).to.equal('ECONNREFUSED')
done()
})
})
it('should return an error if no url specified', function (done) {
ActiveDirectory.getRootDSE(null)
.then(done)
.catch((err) => {
expect(err).to.not.be.null
expect(err).to.be.an.instanceof(Error)
expect(err.message).to.include('in the form')
done()
})
})
it('should use the instance url property if omitted', function (done) {
ad.getRootDSE()
.then((result) => {
expect(result).to.not.be.undefined
done()
})
.catch(done)
})
it('should return all attributes when none specified', function (done) {
const attrs = ['dn', 'dnsHostName', 'serverName', 'supportedLDAPVersion']
ad.getRootDSE('ldap://127.0.0.1:1389')
.then((result) => {
expect(result).to.not.be.undefined
const keys = Object.keys(result)
keys.forEach((k) => expect(attrs).to.contain(k))
done()
})
.catch(done)
})
it('should return only specified attributes', function (done) {
// dn is always returned
const attrs = ['dn', 'supportedLDAPVersion']
ad.getRootDSE('ldap://127.0.0.1:1389', attrs)
.then((result) => {
expect(result).to.not.be.undefined
const keys = Object.keys(result)
keys.forEach((k) => expect(attrs).to.contain(k))
done()
})
.catch(done)
})
it('should not return the controls attribute', function (done) {
ad.getRootDSE('ldap://127.0.0.1:1389')
.then((result) => {
expect(result).to.not.be.undefined
const keys = Object.keys(result)
expect(keys.indexOf('controls')).to.equal(-1)
done()
})
.catch(done)
})
})
| 27.606742 | 77 | 0.592593 |
28cec67b8a833be01ed0ef5d7800bb09ef9bacf7 | 3,650 | js | JavaScript | ui/js/bower_components/jquery-spinner/dist/jquery.spinner.min.js | walgheraibi/StemCells | d7e49ef97ec31e46978fe6536130111abbddf0e7 | [
"MIT"
] | null | null | null | ui/js/bower_components/jquery-spinner/dist/jquery.spinner.min.js | walgheraibi/StemCells | d7e49ef97ec31e46978fe6536130111abbddf0e7 | [
"MIT"
] | null | null | null | ui/js/bower_components/jquery-spinner/dist/jquery.spinner.min.js | walgheraibi/StemCells | d7e49ef97ec31e46978fe6536130111abbddf0e7 | [
"MIT"
] | null | null | null | /*! jQuery spinner - v0.1.5 - 2013-12-03
* https://github.com/xixilive/jquery-spinner
* Copyright (c) 2013 xixilive; Licensed MIT */
!function(a){"use strict";var b,c=function(b,d){return this.$el=b,this.options=a.extend({},c.rules.defaults,c.rules[d.rule]||{},d||{}),this.min=parseFloat(this.options.min)||0,this.max=parseFloat(this.options.max)||0,this.$el.on("focus.spinner",a.proxy(function(b){b.preventDefault(),a(document).trigger("mouseup.spinner"),this.oldValue=this.value()},this)).on("change.spinner",a.proxy(function(a){a.preventDefault(),this.value(this.$el.val())},this)).on("keydown.spinner",a.proxy(function(a){var b={38:"up",40:"down"}[a.which];b&&(a.preventDefault(),this.spin(b))},this)),this.oldValue=this.value(),this.value(this.$el.val()),this};c.rules={defaults:{min:null,max:null,step:1,precision:0},currency:{min:0,max:null,step:.01,precision:2},quantity:{min:1,max:999,step:1,precision:0},percent:{min:1,max:100,step:1,precision:0},month:{min:1,max:12,step:1,precision:0},day:{min:1,max:31,step:1,precision:0},hour:{min:0,max:23,step:1,precision:0},minute:{min:1,max:59,step:1,precision:0},second:{min:1,max:59,step:1,precision:0}},c.prototype={spin:function(a){switch(this.oldValue=this.value(),a){case"up":this.value(this.oldValue+Number(this.options.step,10));break;case"down":this.value(this.oldValue-Number(this.options.step,10))}},value:function(c){if(null===c||void 0===c)return this.numeric(this.$el.val());c=this.numeric(c);var e=this.validate(c);0!==e&&(c=-1===e?this.min:this.max),this.$el.val(c.toFixed(this.options.precision)),this.oldValue!==this.value()&&(this.$el.trigger("changing.spinner",[this.value(),this.oldValue]),clearTimeout(b),b=setTimeout(a.proxy(function(){this.$el.trigger("changed.spinner",[this.value(),this.oldValue])},this),d.delay))},numeric:function(a){return a=this.options.precision>0?parseFloat(a,10):parseInt(a,10),a||this.options.min||0},validate:function(a){return null!==this.options.min&&a<this.min?-1:null!==this.options.max&&a>this.max?1:0}};var d=function(b,d){this.$el=b,this.$spinning=a("[data-spin='spinner']",this.$el),0===this.$spinning.length&&(this.$spinning=a(":input[type='text']",this.$el)),this.spinning=new c(this.$spinning,this.$spinning.data()),this.$el.on("click.spinner","[data-spin='up'],[data-spin='down']",a.proxy(this.spin,this)).on("mousedown.spinner","[data-spin='up'],[data-spin='down']",a.proxy(this.spin,this)),a(document).on("mouseup.spinner",a.proxy(function(){clearTimeout(this.spinTimeout),clearInterval(this.spinInterval)},this)),d=a.extend({},d),d.delay&&this.delay(d.delay),d.changed&&this.changed(d.changed),d.changing&&this.changing(d.changing)};d.delay=500,d.prototype={constructor:d,spin:function(b){var c=a(b.currentTarget).data("spin");switch(b.type){case"click":b.preventDefault(),this.spinning.spin(c);break;case"mousedown":1===b.which&&(this.spinTimeout=setTimeout(a.proxy(this.beginSpin,this,c),300))}},delay:function(a){var b=parseInt(a,10);b>0&&(this.constructor.delay=b+100)},value:function(){return this.spinning.value()},changed:function(a){this.bindHandler("changed.spinner",a)},changing:function(a){this.bindHandler("changing.spinner",a)},bindHandler:function(b,c){a.isFunction(c)?this.$spinning.on(b,c):this.$spinning.off(b)},beginSpin:function(b){this.spinInterval=setInterval(a.proxy(this.spinning.spin,this.spinning,b),100)}},a.fn.spinner=function(b,c){return this.each(function(){var e=a(this),f=e.data("spinner");f||e.data("spinner",f=new d(e,a.extend({},e.data(),b))),("delay"===b||"changed"===b||"changing"===b)&&f[b](c),"spin"===b&&c&&f.spinning.spin(c)})},a(function(){a('[data-trigger="spinner"]').spinner()})}(jQuery); | 912.5 | 3,517 | 0.718904 |
28cf2cdebbf3e8d1399696c9f2c11d50a6716ee7 | 663 | js | JavaScript | tinymce/js/tinymce/plugins/example/plugin.min.js | cleblond/reveal | 5cacfa787a90d0274e81505544cee6b1c6d334e6 | [
"MIT"
] | null | null | null | tinymce/js/tinymce/plugins/example/plugin.min.js | cleblond/reveal | 5cacfa787a90d0274e81505544cee6b1c6d334e6 | [
"MIT"
] | null | null | null | tinymce/js/tinymce/plugins/example/plugin.min.js | cleblond/reveal | 5cacfa787a90d0274e81505544cee6b1c6d334e6 | [
"MIT"
] | null | null | null | tinymce.PluginManager.add("example",function(a,b){a.addButton("example",{text:"My button",icon:!1,onclick:function(){a.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Tittletle"}],onsubmit:function(b){a.insertContent("Title: "+b.data.title)}})}}),a.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){a.windowManager.open({title:"TinyMCE site",url:b+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var b=a.windowManager.getWindows()[0];a.insertContent(b.getContentWindow().document.getElementById("content").value),b.close()}},{text:"Close",onclick:"close"}]})}})});
| 331.5 | 662 | 0.739065 |
28cf589389c3efbb99eedae22e785a871cf7c2e3 | 825 | js | JavaScript | client/src/gameHelper.test.js | isifeddi/42-red-tetris | 0f2833354609aef3923fe0bcb438e0fc6f8abffe | [
"MIT"
] | null | null | null | client/src/gameHelper.test.js | isifeddi/42-red-tetris | 0f2833354609aef3923fe0bcb438e0fc6f8abffe | [
"MIT"
] | null | null | null | client/src/gameHelper.test.js | isifeddi/42-red-tetris | 0f2833354609aef3923fe0bcb438e0fc6f8abffe | [
"MIT"
] | null | null | null | import { Createstage, checkcollision, S_WIDTH, S_HEIGHT} from "./gameHelper";
let stage = Createstage()
let stageFull = Array.from(Array(S_HEIGHT), () => new Array(S_WIDTH).fill(['T', "merged"]))
test("Test CreateStage", () => expect(Createstage()).toStrictEqual(stage));
test("Test Collision TRUE", () => {
let player = {
pos: { x: S_WIDTH / 2 - 1, y: 0 },
tetromino: [
["T", "T", "T"],
[0, "T", 0],
[0, 0, 0],
],
collided: false,
};
expect(checkcollision(player, stage, { x: 1, y: 0 })).toBeFalsy();
});
test("Test Collision False", () => {
let player = {
pos: { x: S_WIDTH / 2 - 1, y: 0 },
tetromino: [
["T", "T", "T"],
[0, "T", 0],
[0, 0, 0],
],
collided: false,
};
expect(checkcollision(player, stageFull, { x: 1, y: 0 })).toBeTruthy();
}); | 29.464286 | 91 | 0.532121 |
28cfac11e76bd9110c184518fe0838a629466dc1 | 12,861 | js | JavaScript | x-pack/plugins/canvas/public/components/workpad_loader/workpad_loader.js | yojiwatanabe/kibana | 1225c32fac1e21d2648f83ee77d01ca2c425cd7a | [
"Apache-2.0"
] | 1 | 2020-07-08T17:31:29.000Z | 2020-07-08T17:31:29.000Z | x-pack/plugins/canvas/public/components/workpad_loader/workpad_loader.js | yojiwatanabe/kibana | 1225c32fac1e21d2648f83ee77d01ca2c425cd7a | [
"Apache-2.0"
] | 6 | 2021-09-02T13:55:43.000Z | 2022-03-24T01:39:46.000Z | x-pack/plugins/canvas/public/components/workpad_loader/workpad_loader.js | yojiwatanabe/kibana | 1225c32fac1e21d2648f83ee77d01ca2c425cd7a | [
"Apache-2.0"
] | null | null | null | /*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import {
EuiFlexGroup,
EuiFlexItem,
EuiBasicTable,
EuiButtonIcon,
EuiPagination,
EuiSpacer,
EuiButton,
EuiToolTip,
EuiEmptyPrompt,
EuiFilePicker,
EuiLink,
} from '@elastic/eui';
import { sortByOrder } from 'lodash';
import { ConfirmModal } from '../confirm_modal';
import { Link } from '../link';
import { Paginate } from '../paginate';
import { ComponentStrings } from '../../../i18n';
import { WorkpadDropzone } from './workpad_dropzone';
import { WorkpadCreate } from './workpad_create';
import { WorkpadSearch } from './workpad_search';
import { uploadWorkpad } from './upload_workpad';
const { WorkpadLoader: strings } = ComponentStrings;
const getDisplayName = (name, workpad, loadedWorkpad) => {
const workpadName = name.length ? name : <em>{workpad.id}</em>;
return workpad.id === loadedWorkpad ? <strong>{workpadName}</strong> : workpadName;
};
export class WorkpadLoader extends React.PureComponent {
static propTypes = {
workpadId: PropTypes.string.isRequired,
canUserWrite: PropTypes.bool.isRequired,
createWorkpad: PropTypes.func.isRequired,
findWorkpads: PropTypes.func.isRequired,
downloadWorkpad: PropTypes.func.isRequired,
cloneWorkpad: PropTypes.func.isRequired,
removeWorkpads: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired,
workpads: PropTypes.object,
formatDate: PropTypes.func.isRequired,
};
state = {
createPending: false,
deletingWorkpad: false,
sortField: '@timestamp',
sortDirection: 'desc',
selectedWorkpads: [],
pageSize: 10,
};
async componentDidMount() {
// on component load, kick off the workpad search
this.props.findWorkpads();
// keep track of whether or not the component is mounted, to prevent rogue setState calls
this._isMounted = true;
}
UNSAFE_componentWillReceiveProps(newProps) {
// the workpadId prop will change when a is created or loaded, close the toolbar when it does
const { workpadId, onClose } = this.props;
if (workpadId !== newProps.workpadId) {
onClose();
}
}
componentWillUnmount() {
this._isMounted = false;
}
// create new empty workpad
createWorkpad = async () => {
this.setState({ createPending: true });
await this.props.createWorkpad();
this._isMounted && this.setState({ createPending: false });
};
// create new workpad from uploaded JSON
onUpload = async (workpad) => {
this.setState({ createPending: true });
await this.props.createWorkpad(workpad);
this._isMounted && this.setState({ createPending: false });
};
// clone existing workpad
cloneWorkpad = async (workpad) => {
this.setState({ createPending: true });
await this.props.cloneWorkpad(workpad.id);
this._isMounted && this.setState({ createPending: false });
};
// Workpad remove methods
openRemoveConfirm = () => this.setState({ deletingWorkpad: true });
closeRemoveConfirm = () => this.setState({ deletingWorkpad: false });
removeWorkpads = () => {
const { selectedWorkpads } = this.state;
this.props.removeWorkpads(selectedWorkpads.map(({ id }) => id)).then((remainingIds) => {
const remainingWorkpads =
remainingIds.length > 0
? selectedWorkpads.filter(({ id }) => remainingIds.includes(id))
: [];
this._isMounted &&
this.setState({
deletingWorkpad: false,
selectedWorkpads: remainingWorkpads,
});
});
};
// downloads selected workpads as JSON files
downloadWorkpads = () => {
this.state.selectedWorkpads.forEach(({ id }) => this.props.downloadWorkpad(id));
};
onSelectionChange = (selectedWorkpads) => {
this.setState({ selectedWorkpads });
};
onTableChange = ({ sort = {} }) => {
const { field: sortField, direction: sortDirection } = sort;
this.setState({
sortField,
sortDirection,
});
};
renderWorkpadTable = ({ rows, pageNumber, totalPages, setPage }) => {
const { sortField, sortDirection } = this.state;
const { canUserWrite, createPending, workpadId: loadedWorkpad } = this.props;
const actions = [
{
render: (workpad) => (
<EuiFlexGroup gutterSize="xs" alignItems="center">
<EuiFlexItem grow={false}>
<EuiToolTip content={strings.getExportToolTip()}>
<EuiButtonIcon
iconType="exportAction"
onClick={() => this.props.downloadWorkpad(workpad.id)}
aria-label={strings.getExportToolTip()}
/>
</EuiToolTip>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiToolTip
content={
canUserWrite ? strings.getCloneToolTip() : strings.getNoPermissionToCloneToolTip()
}
>
<EuiButtonIcon
iconType="copy"
onClick={() => this.cloneWorkpad(workpad)}
aria-label={strings.getCloneToolTip()}
disabled={!canUserWrite}
/>
</EuiToolTip>
</EuiFlexItem>
</EuiFlexGroup>
),
},
];
const columns = [
{
field: 'name',
name: strings.getTableNameColumnTitle(),
sortable: true,
dataType: 'string',
render: (name, workpad) => {
const workpadName = getDisplayName(name, workpad, loadedWorkpad);
return (
<Link
data-test-subj="canvasWorkpadLoaderWorkpad"
name="loadWorkpad"
params={{ id: workpad.id }}
aria-label={strings.getLoadWorkpadArialLabel()}
>
{workpadName}
</Link>
);
},
},
{
field: '@created',
name: strings.getTableCreatedColumnTitle(),
sortable: true,
dataType: 'date',
width: '20%',
render: (date) => this.props.formatDate(date),
},
{
field: '@timestamp',
name: strings.getTableUpdatedColumnTitle(),
sortable: true,
dataType: 'date',
width: '20%',
render: (date) => this.props.formatDate(date),
},
{ name: '', actions, width: '5%' },
];
const sorting = {
sort: {
field: sortField,
direction: sortDirection,
},
};
const selection = {
itemId: 'id',
onSelectionChange: this.onSelectionChange,
};
const emptyTable = (
<EuiEmptyPrompt
iconType="importAction"
title={<h2>{strings.getEmptyPromptTitle()}</h2>}
titleSize="s"
body={
<Fragment>
<p>{strings.getEmptyPromptGettingStartedDescription()}</p>
<p>
{strings.getEmptyPromptNewUserDescription()}{' '}
<EuiLink href="home#/tutorial_directory/sampleData">
{strings.getSampleDataLinkLabel()}
</EuiLink>
.
</p>
</Fragment>
}
/>
);
return (
<Fragment>
<WorkpadDropzone
onUpload={this.onUpload}
disabled={createPending || !canUserWrite}
notify={this.props.notify}
>
<EuiBasicTable
items={rows}
itemId="id"
columns={columns}
sorting={sorting}
noItemsMessage={emptyTable}
onChange={this.onTableChange}
isSelectable
selection={selection}
className="canvasWorkpad__dropzoneTable"
data-test-subj="canvasWorkpadLoaderTable"
/>
<EuiSpacer />
{rows.length > 0 && (
<EuiFlexGroup gutterSize="none" justifyContent="flexEnd">
<EuiFlexItem grow={false}>
<EuiPagination
activePage={pageNumber}
onPageClick={setPage}
pageCount={totalPages}
/>
</EuiFlexItem>
</EuiFlexGroup>
)}
</WorkpadDropzone>
</Fragment>
);
};
render() {
const {
deletingWorkpad,
createPending,
selectedWorkpads,
sortField,
sortDirection,
} = this.state;
const { canUserWrite } = this.props;
const isLoading = this.props.workpads == null;
let createButton = (
<WorkpadCreate
createPending={createPending}
onCreate={this.createWorkpad}
disabled={!canUserWrite}
/>
);
let deleteButton = (
<EuiButton
color="danger"
iconType="trash"
onClick={this.openRemoveConfirm}
disabled={!canUserWrite}
aria-label={strings.getDeleteButtonAriaLabel(selectedWorkpads.length)}
>
{strings.getDeleteButtonLabel(selectedWorkpads.length)}
</EuiButton>
);
const downloadButton = (
<EuiButton
color="secondary"
onClick={this.downloadWorkpads}
iconType="exportAction"
aria-label={strings.getExportButtonAriaLabel(selectedWorkpads.length)}
>
{strings.getExportButtonLabel(selectedWorkpads.length)}
</EuiButton>
);
let uploadButton = (
<EuiFilePicker
display="default"
compressed
className="canvasWorkpad__upload--compressed"
initialPromptText={strings.getFilePickerPlaceholder()}
onChange={([file]) => uploadWorkpad(file, this.onUpload, this.props.notify)}
accept="application/json"
disabled={createPending || !canUserWrite}
/>
);
if (!canUserWrite) {
createButton = (
<EuiToolTip content={strings.getNoPermissionToCreateToolTip()}>{createButton}</EuiToolTip>
);
deleteButton = (
<EuiToolTip content={strings.getNoPermissionToDeleteToolTip()}>{deleteButton}</EuiToolTip>
);
uploadButton = (
<EuiToolTip content={strings.getNoPermissionToUploadToolTip()}>{uploadButton}</EuiToolTip>
);
}
const modalTitle =
selectedWorkpads.length === 1
? strings.getDeleteSingleWorkpadModalTitle(selectedWorkpads[0].name)
: strings.getDeleteMultipleWorkpadModalTitle(selectedWorkpads.length);
const confirmModal = (
<ConfirmModal
isOpen={deletingWorkpad}
title={modalTitle}
message={strings.getDeleteModalDescription()}
confirmButtonText={strings.getDeleteModalConfirmButtonLabel()}
onConfirm={this.removeWorkpads}
onCancel={this.closeRemoveConfirm}
/>
);
let sortedWorkpads = [];
if (!createPending && !isLoading) {
const { workpads } = this.props.workpads;
sortedWorkpads = sortByOrder(workpads, [sortField, '@timestamp'], [sortDirection, 'desc']);
}
return (
<Paginate rows={sortedWorkpads}>
{(pagination) => (
<Fragment>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={2}>
<EuiFlexGroup gutterSize="s">
{selectedWorkpads.length > 0 && (
<Fragment>
<EuiFlexItem grow={false}>{downloadButton}</EuiFlexItem>
<EuiFlexItem grow={false}>{deleteButton}</EuiFlexItem>
</Fragment>
)}
<EuiFlexItem grow={1}>
<WorkpadSearch
onChange={(text) => {
pagination.setPage(0);
this.props.findWorkpads(text);
}}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={2}>
<EuiFlexGroup gutterSize="s" justifyContent="flexEnd" wrap>
<EuiFlexItem grow={false}>{uploadButton}</EuiFlexItem>
<EuiFlexItem grow={false}>{createButton}</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer />
{createPending && (
<div style={{ width: '100%' }}>{strings.getCreateWorkpadLoadingDescription()}</div>
)}
{!createPending && isLoading && (
<div style={{ width: '100%' }}>{strings.getFetchLoadingDescription()}</div>
)}
{!createPending && !isLoading && this.renderWorkpadTable(pagination)}
{confirmModal}
</Fragment>
)}
</Paginate>
);
}
}
| 30.261176 | 100 | 0.579893 |
28cfbcf512e99b5420fd1c663a7974eb68586991 | 5,233 | js | JavaScript | public/crosswords/09-24-13.js | Cross-Wars/CW-experiment | f6c659e7510e6c7449200dd34b724be03e6ff085 | [
"MIT"
] | null | null | null | public/crosswords/09-24-13.js | Cross-Wars/CW-experiment | f6c659e7510e6c7449200dd34b724be03e6ff085 | [
"MIT"
] | null | null | null | public/crosswords/09-24-13.js | Cross-Wars/CW-experiment | f6c659e7510e6c7449200dd34b724be03e6ff085 | [
"MIT"
] | null | null | null | module.exports = {"acrossmap":null,"admin":false,"answers":{"across":["SHAH","STAD","TZUS","OUTER","TOGO","HESA","THERE","AGIO","ERST","DREWBARRYMORE","SCI","SPIELBERG","CONCEAL","ELS","OMNIS","IFELL","MSG","REED","STEAL","MOTH","ERR","SHYER","PABLO","SOI","DAIRIES","PHONEHOME","LOT","FLYINGBICYCLE","ROLE","LENT","EUBIE","AWOL","ERGO","SPACE","TEND","STER","EYER"],"down":["SOT","HUH","ATEDINNER","HERR","STABILITY","TOGAE","AGIRL","DOORBELL","THEMRS","ZEROG","USSR","SATE","REESES","WPA","YELL","SCORE","COMER","CID","FEE","EARDOCTOR","MOBILEBAY","STLEO","GHOST","SHINGLES","MAR","SOON","PIECES","SHIELD","AMY","PYLON","EBERT","HINGE","FRAT","LOWE","LUPE","ICE","EER"]},"author":"Kevin Christian","autowrap":null,"bbars":null,"circles":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"clues":{"across":["1. Deposed leader of 1979","5. Suffix meaning \"city\" in some European place names","9. Shih ___ (diminutive dogs)","13. With 59-Across, where [circled letters] came from","15. Like a drive-thru order","16. \"For ___ jolly good fellow\"","17. When repeated, consoling words","18. Charge for currency exchange","19. Once, old-style","20. Child actress who appeared with [circled letters]","23. Biol., e.g.","25. Creator of [circled letters]","26. Palm, as a playing card","28. Golf's Ernie","29. Dodge models until 1990","30. Possible answer to \"How'd you hurt yourself?\"","33. Site of four sold-out 1972 Elvis Presley concerts, for short","36. Swamp growth","37. Base runner's attempt","38. Wool lover","39. Go astray","40. Not so outgoing","41. Painter Picasso","42. \"... or ___ gather\"","43. Some Wisconsin farms","45. What [circled letters] wanted to do","48. Bunch","49. Means of escape for [circled letters]","52. It's cast","53. Time to give up?","54. Jazz's Blake","57. Wayward G.I.","58. Therefore","59. See 13-Across","60. Be inclined (to)","61. Suffix with prank","62. Observer"],"down":["1. Lush","2. \"Come again?\"","3. Had an evening meal","4. Frau's mate","5. What a gyroscope may provide","6. Forum robes","7. \"It's ___!\" (birth announcement)","8. Avon commercial sound","9. One's wife, informally","10. Free-fall effect, briefly","11. \"Back in the ___\"","12. Suffice, foodwise","14. With 41-Down, composition of a trail followed by [circled letters]","21. New Deal inits.","22. Cheerleader's cheer","23. Best Original ___ (award for the film with [circled letters])","24. Rising star","27. Spanish hero El ___","31. Checking charge","32. One using an otoscope","33. Locale of an 1864 Civil War blockade","34. Fifth-century pope with the epithet \"the Great\"","35. Costume for [circled letters] on Halloween","37. They're \"hung out\" by professionals","38. Scratch","40. Anon","41. See 14-Down","42. Warrior's aid","44. Adams of \"The Fighter\"","45. Traffic cone","46. Late thumb-turning critic","47. Stamp collector's fastener","49. \"Animal House\" house","50. Rob of \"The West Wing\"","51. \"Little Latin ___ Lu\" (1966 hit)","55. Freezer stock","56. Suffix with slogan"]},"code":null,"copyright":"2013, The New York Times","date":"9\/24\/2013","dow":"Tuesday","downmap":null,"editor":"Will Shortz","grid":["S","H","A","H",".",".","S","T","A","D",".","T","Z","U","S","O","U","T","E","R",".","T","O","G","O",".","H","E","S","A","T","H","E","R","E",".","A","G","I","O",".","E","R","S","T",".",".","D","R","E","W","B","A","R","R","Y","M","O","R","E","S","C","I",".","S","P","I","E","L","B","E","R","G",".",".","C","O","N","C","E","A","L",".",".","E","L","S",".",".",".","O","M","N","I","S",".","I","F","E","L","L",".","M","S","G","R","E","E","D",".","S","T","E","A","L",".","M","O","T","H","E","R","R",".","S","H","Y","E","R",".","P","A","B","L","O",".",".",".","S","O","I",".",".","D","A","I","R","I","E","S",".",".","P","H","O","N","E","H","O","M","E",".","L","O","T","F","L","Y","I","N","G","B","I","C","Y","C","L","E",".",".","R","O","L","E",".","L","E","N","T",".","E","U","B","I","E","A","W","O","L",".","E","R","G","O",".","S","P","A","C","E","T","E","N","D",".","S","T","E","R",".",".","E","Y","E","R"],"gridnums":[1,2,3,4,0,0,5,6,7,8,0,9,10,11,12,13,0,0,0,14,0,15,0,0,0,0,16,0,0,0,17,0,0,0,0,0,18,0,0,0,0,19,0,0,0,0,0,20,0,0,21,0,0,0,0,22,0,0,0,0,23,24,0,0,25,0,0,0,0,0,0,0,0,0,0,26,0,0,27,0,0,0,0,0,28,0,0,0,0,0,29,0,0,0,0,0,30,31,32,0,0,0,33,34,35,36,0,0,0,0,37,0,0,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,0,0,41,0,0,0,0,0,0,0,42,0,0,0,0,43,44,0,0,0,0,0,0,0,45,0,0,0,46,47,0,0,0,0,48,0,0,49,50,0,0,0,0,0,0,0,0,0,51,0,0,0,52,0,0,0,0,53,0,0,0,0,54,0,0,55,56,57,0,0,0,0,58,0,0,0,0,59,0,0,0,0,60,0,0,0,0,61,0,0,0,0,0,62,0,0,0],"hold":null,"id":null,"id2":null,"interpretcolors":null,"jnotes":null,"key":null,"mini":null,"notepad":null,"publisher":"The New York Times","rbars":null,"shadecircles":null,"size":{"cols":15,"rows":15},"title":"NY TIMES, TUE, SEP 24, 2013","track":null,"type":null} | 5,233 | 5,233 | 0.565068 |
28d120cc310a69520bcb0203ed4428649efa7afe | 6,456 | js | JavaScript | resources/tailwind.js | antwebstudio/fusion-cms | 33a15affb366231c7d516eed4f51472c6153eed7 | [
"MIT"
] | null | null | null | resources/tailwind.js | antwebstudio/fusion-cms | 33a15affb366231c7d516eed4f51472c6153eed7 | [
"MIT"
] | null | null | null | resources/tailwind.js | antwebstudio/fusion-cms | 33a15affb366231c7d516eed4f51472c6153eed7 | [
"MIT"
] | null | null | null | const defaultTheme = require('tailwindcss/defaultTheme')
const { colors } = require('tailwindcss/defaultTheme')
const cursors = {
auto: 'auto',
default: 'default',
pointer: 'pointer',
wait: 'wait',
text: 'text',
move: 'move',
'not-allowed': 'not-allowed',
'ns-resize': 'ns-resize',
}
const screens = {
sm: '640px',
md: '993px', // 768 + 225
lg: '1249px', // 1024 + 225
xl: '1505px', // 1280 + 225
}
const spacing = {
px: '1px',
'0': '0',
'0.5': '0.125rem',
'1': '0.25rem',
'1.5': '0.375rem',
'2': '0.5rem',
'2.5': '0.625rem',
'3': '0.75rem',
'3.5': '0.875rem',
'4': '1rem',
'5': '1.25rem',
'6': '1.5rem',
'7': '1.75rem',
'8': '2rem',
'9': '2.25rem',
'10': '2.5rem',
'11': '2.75rem',
'12': '3rem',
'13': '3.25rem',
'14': '3.5rem',
'15': '3.75rem',
'16': '4rem',
'20': '5rem',
'24': '6rem',
'28': '7rem',
'32': '8rem',
'36': '9rem',
'40': '10rem',
'48': '12rem',
'56': '14rem',
'60': '15rem',
'64': '16rem',
'72': '18rem',
'80': '20rem',
'96': '24rem',
'1/2': '50%',
'1/3': '33.333333%',
'2/3': '66.666667%',
'1/4': '25%',
'2/4': '50%',
'3/4': '75%',
'1/5': '20%',
'2/5': '40%',
'3/5': '60%',
'4/5': '80%',
'1/6': '16.666667%',
'2/6': '33.333333%',
'3/6': '50%',
'4/6': '66.666667%',
'5/6': '83.333333%',
'1/12': '8.333333%',
'2/12': '16.666667%',
'3/12': '25%',
'4/12': '33.333333%',
'5/12': '41.666667%',
'6/12': '50%',
'7/12': '58.333333%',
'8/12': '66.666667%',
'9/12': '75%',
'10/12': '83.333333%',
'11/12': '91.666667%',
full: '100%',
'45px': '45px',
'50px': '50px',
'60px': '60px',
'75px': '75px',
'90px': '90px',
'100px': '100px',
'225px': '225px',
'250px': '250px',
'300px': '300px',
'400px': '400px',
'500px': '500px',
'full-sidebar-open': 'calc(100% - 225px)',
'full-sidebar-collapsed': 'calc(100%)',
}
module.exports = {
theme: {
cursors: cursors,
screens: screens,
boxShadow: {
'default': '0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06)',
'md': ' 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06)',
'lg': ' 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05)',
'xl': ' 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)',
'2xl': '0 25px 50px -12px rgba(0, 0, 0, .25)',
'3xl': '0 35px 60px -15px rgba(0, 0, 0, .3)',
'inner': 'inset 0 2px 4px 0 rgba(0,0,0,0.06)',
'focus': '0 0 0 3px rgba(160,174,192,0.5)',
'focus-success': '0 0 0 3px rgba(72,187,120,0.5)',
'focus-danger': '0 0 0 3px rgba(245,101,101,0.5)',
'none': 'none',
},
extend: {
colors: {
'transparent': 'rgba(0, 0, 0, 0)',
'black': '#000000',
'white': '#ffffff',
'emoji': '#fbd043',
'smoke': {
100: 'rgba(35, 42, 60, 0.1)',
200: 'rgba(35, 42, 60, 0.2)',
300: 'rgba(35, 42, 60, 0.3)',
400: 'rgba(35, 42, 60, 0.4)',
500: 'rgba(35, 42, 60, 0.5)',
600: 'rgba(35, 42, 60, 0.6)',
700: 'rgba(35, 42, 60, 0.7)',
800: 'rgba(35, 42, 60, 0.8)',
900: 'rgba(35, 42, 60, 0.9)',
},
'brand': {
100: '#FFEEE9',
200: '#FFD5C8',
300: '#FFBCA7',
400: '#FF8964',
500: '#FF5722',
600: '#E64E1F',
700: '#993414',
800: '#73270F',
900: '#4D1A0A',
},
'primary': {
100: '#FFEEE9',
200: '#FFD5C8',
300: '#FFBCA7',
400: '#FF8964',
500: '#FF5722',
600: '#E64E1F',
700: '#993414',
800: '#73270F',
900: '#4D1A0A',
},
'secondary': {
100: '#EDFAFC',
200: '#D3F3F8',
300: '#B8ECF3',
400: '#82DEEA',
500: '#4DD0E1',
600: '#45BBCB',
700: '#2E7D87',
800: '#235E65',
900: '#173E44',
},
'gray': {
50: '#f9fafb',
...colors.gray,
},
'info': {
50: '#ebf5ff',
...colors.blue,
},
'success': {
50: '#f3faf7',
...colors.green,
},
'warning': {
50: '#fdfdea',
...colors.yellow,
},
'danger': {
50: '#fdf2f2',
...colors.red,
},
},
fontFamily: {
sans: [
'Source Sans Pro',
...defaultTheme.fontFamily.sans,
],
serif: [
'Montserrat',
...defaultTheme.fontFamily.serif,
],
},
spacing: {
...spacing,
},
width: {
...screens,
...spacing,
},
minWidth: {
...screens,
...spacing,
},
maxWidth: {
...screens,
...spacing,
},
height: {
...screens,
...spacing,
},
minHeight: {
...screens,
...spacing,
},
maxHeight: {
...screens,
...spacing,
},
padding: {
...spacing,
},
}
},
plugins: [
// require('@tailwindcss/ui')
],
} | 25.023256 | 93 | 0.329461 |
28d124d63fff687294a1cec30cbf5d14495b1749 | 1,883 | js | JavaScript | tests/dummy/app/field-template/model.js | egaba/ember-yup | 00dd344a3d770663bbb450d4d966b187994b67a8 | [
"MIT"
] | 6 | 2019-06-07T01:04:28.000Z | 2019-10-24T19:27:39.000Z | tests/dummy/app/field-template/model.js | egaba88/ember-yup | 00dd344a3d770663bbb450d4d966b187994b67a8 | [
"MIT"
] | 2 | 2019-10-10T09:27:12.000Z | 2022-02-13T20:43:43.000Z | tests/dummy/app/field-template/model.js | egaba/ember-yup | 00dd344a3d770663bbb450d4d966b187994b67a8 | [
"MIT"
] | null | null | null | import DS from 'ember-data';
const { Model } = DS;
export default Model.extend({
componentName: DS.attr({ defaultValue: 'text-field' }),
value: DS.attr(),
required: DS.attr('boolean', { defaultValue: true }),
disabled: DS.attr('boolean', { defaultValue: false }),
displayErrorMessages: DS.attr({ defaultValue: 'onInit' }),
subType: DS.attr({ defaultValue: 'none' }),
stringMatches: DS.attr({ defaultValue: '\\w+' }),
stringCharLimit: DS.attr('number', { defaultValue: 0 }),
stringMinChars: DS.attr('number', { defaultValue: 0 }),
stringMaxChars: DS.attr('number', { defaultValue: 0 }),
requiredValidationMessage: DS.attr({ defaultValue: '' }),
matchesValidationMessage: DS.attr({ defaultValue: '' }),
charLimitValidationMessage: DS.attr({ defaultValue: '' }),
emailValidationMessage: DS.attr({ defaultValue: '' }),
urlValidationMessage: DS.attr({ defaultValue: '' }),
debug: DS.attr('boolean'),
minStringCharsMessage: DS.attr({ defaultValue: '' }),
maxStringCharsMessage: DS.attr({ defaultValue: '' }),
isInteger: DS.attr('boolean'),
isNegative: DS.attr('boolean'),
isPositive: DS.attr('boolean'),
minRangeNumber: DS.attr('number'),
maxRangeNumber: DS.attr('number'),
minDate: DS.attr('date'),
maxDate: DS.attr('date'),
greaterThanNumber: DS.attr('number'),
lessThanNumber: DS.attr('number'),
integerMessage: DS.attr({ defaultValue: '' }),
negativeMessage: DS.attr({ defaultValue: '' }),
positiveMessage: DS.attr({ defaultValue: '' }),
greaterThanMessage: DS.attr({ defaultValue: '' }),
lessThanMessage: DS.attr({ defaultValue: '' }),
minNumberMessage: DS.attr({ defaultValue: '' }),
maxNumberMessage: DS.attr({ defaultValue: '' }),
minDateMessage: DS.attr({ defaultValue: '' }),
maxDateMessage: DS.attr({ defaultValue: '' }),
dataTypeMessage: DS.attr({ defaultValue: '' }),
description: DS.attr(),
});
| 40.06383 | 60 | 0.672862 |
28d3f230d9e407c0543c1423dcc837d3b2e67d33 | 433 | js | JavaScript | src/modules/Accounts/Accounts.reducer.js | goliquidapp/source | 913ab5e72ff5b78cbd60d8b7530cf45bd6b916cd | [
"Fair"
] | 13 | 2020-01-14T18:12:33.000Z | 2021-08-24T02:22:02.000Z | src/modules/Accounts/Accounts.reducer.js | goliquidapp/source | 913ab5e72ff5b78cbd60d8b7530cf45bd6b916cd | [
"Fair"
] | 5 | 2021-05-08T15:40:18.000Z | 2022-02-26T21:56:18.000Z | src/modules/Accounts/Accounts.reducer.js | goliquidapp/source | 913ab5e72ff5b78cbd60d8b7530cf45bd6b916cd | [
"Fair"
] | 5 | 2020-01-01T20:09:13.000Z | 2021-08-24T02:25:33.000Z | import {ACCOUNTS_META_START, ACCOUNTS_META_DONE} from './Accounts.types.js';
const INIT_STATE={
accounts:[],
current:null,
loading:false
}
export default (state=INIT_STATE, action)=>{
switch(action.type){
case ACCOUNTS_META_START:
return {...state, loading:true}
case ACCOUNTS_META_DONE:
const {accounts, current}=action.payload;
return {...state, loading:false, accounts, current}
default:
return state;
}
} | 22.789474 | 76 | 0.725173 |
28d446f45edd1401537e95b88c56e5d0de8c1db8 | 227 | js | JavaScript | node_modules/skylark-langx-arrays/dist/uncompressed/skylark-langx-arrays/first.js | skylark-integration/skylark-custom-h5audio | eb2f85d1740c582e4c05de128eeac1ab7041e20a | [
"MIT"
] | null | null | null | node_modules/skylark-langx-arrays/dist/uncompressed/skylark-langx-arrays/first.js | skylark-integration/skylark-custom-h5audio | eb2f85d1740c582e4c05de128eeac1ab7041e20a | [
"MIT"
] | null | null | null | node_modules/skylark-langx-arrays/dist/uncompressed/skylark-langx-arrays/first.js | skylark-integration/skylark-custom-h5audio | eb2f85d1740c582e4c05de128eeac1ab7041e20a | [
"MIT"
] | null | null | null | define([
"./arrays"
],function(arrays){
function first(items,n) {
if (n) {
return items.slice(0,n);
} else {
return items[0];
}
}
return arrays.first = first;
}); | 17.461538 | 35 | 0.45815 |
28d48efbe81215a6268cde25009845d8a2d620b2 | 943 | js | JavaScript | src/misc/util.js | saqfish/NextTab | 437f3f8e272612750a92664c36e67c0822c941ae | [
"MIT"
] | null | null | null | src/misc/util.js | saqfish/NextTab | 437f3f8e272612750a92664c36e67c0822c941ae | [
"MIT"
] | null | null | null | src/misc/util.js | saqfish/NextTab | 437f3f8e272612750a92664c36e67c0822c941ae | [
"MIT"
] | null | null | null | import * as browser from "webextension-polyfill";
const sendToBackground = (type, data) => {
try {
return browser.runtime.sendMessage({ type, data });
} catch {
return Promise.reject();
}
};
const openInWindow = url => {
return browser.windows.create({
url,
type: "popup",
height: 600,
width: 900
});
};
const openInTab = url => {
return browser.tabs.create({
url,
active: true
});
};
const open = (tab, url) => {
if (tab) openInTab(url);
else openInWindow(url);
};
const reloadInWindow = url => {
return browser.tabs.update({ url });
};
const copyToClipboard = value => {
return new Promise((reject, resolve) => {
navigator.clipboard
.writeText(value)
.then(() => {
resolve();
})
.catch(error => {
reject(error);
});
});
};
export {
sendToBackground,
openInWindow,
openInTab,
open,
reloadInWindow,
copyToClipboard
};
| 16.54386 | 55 | 0.588547 |
28d4b557d7c6d5c1ec1a7a0a6460b0257bbbf22b | 1,637 | js | JavaScript | scripts/restore-latest-backup.js | metabench/nextleveldb-client | 83e14155d35cacd75c3b50f4114a8b96193fa02a | [
"MIT"
] | 1 | 2018-06-12T17:30:56.000Z | 2018-06-12T17:30:56.000Z | scripts/restore-latest-backup.js | metabench/nextleveldb-client | 83e14155d35cacd75c3b50f4114a8b96193fa02a | [
"MIT"
] | 3 | 2018-05-27T09:51:42.000Z | 2018-06-04T18:30:09.000Z | scripts/restore-latest-backup.js | metabench/nextleveldb-client | 83e14155d35cacd75c3b50f4114a8b96193fa02a | [
"MIT"
] | null | null | null |
// Finds latest backup on disk
// Could have marking of complete backups
// Loads .be (Binary Encoded) files
// Will restore this backup
//
// Restore it to a server given in the config.
// Could restore every record in a directory.
// Possibility of changing table reference key prefix?
// Confirming that the records are going back into the correct table.
// That could possibly be done through record validation, where it checks types and structure.
// Will be able to upload a few weeks worth of bittrex in a few minutes.
// Run another server, with collecter. Keep that running.
// Keep stable.
// Keep the first version running on data1 for a while. It appears stable, but does not index the records.
// Many records, such as the snapshot records, won't be indexed apart from the PK.
// PK lookup is fine for many things.
// Run another. That can be one that we keep changing and upgrading.
// Then continue local development. See about having that local server sync with at least one of the others.
// Or, get backup done again, get other server running.
// Get third server running, and use that to make the changes.
// Have redundency
// Maybe make another server or two with auto-restart
// Could have a client that connects to multiple databases at once. Having the db use this client will enable sharding and replication, as the server will use the client to
// connect to other servers.
// 1. Keep current server running
// 2. Start server with current code
// 3. Start another
// 4. Start another, but then keep updating the code here.
// Streaming data between servers will do a lot to
| 32.098039 | 172 | 0.74099 |
28d4e42c11065b5287e5a8250b05c2be6191f559 | 51,444 | js | JavaScript | modernizr.3.0.0-alpha3.js | alfonsomunozpomer/atlas-modernizr | cd91bc6b27678a017c5289cb20130de92bf2fb40 | [
"Apache-2.0"
] | null | null | null | modernizr.3.0.0-alpha3.js | alfonsomunozpomer/atlas-modernizr | cd91bc6b27678a017c5289cb20130de92bf2fb40 | [
"Apache-2.0"
] | null | null | null | modernizr.3.0.0-alpha3.js | alfonsomunozpomer/atlas-modernizr | cd91bc6b27678a017c5289cb20130de92bf2fb40 | [
"Apache-2.0"
] | null | null | null | /*!
* modernizr v3.0.0-alpha.3
* Build http://modernizr.com/download/#-csstransforms-csstransforms3d-preserve3d-addtest-atrule-domprefixes-fnbind-hasevent-load-mq-prefixed-prefixedcss-prefixes-printshiv-testallprops-testprop-teststyles-dontmin
*
* Copyright (c)
* Faruk Ates
* Paul Irish
* Alex Sexton
* Ryan Seddon
* Alexander Farkas
* Patrick Kettner
* Stu Cox
* Richard Herrera
* MIT License
*/
/*
* Modernizr tests which native CSS3 and HTML5 features are available in the
* current UA and makes the results available to you in two ways: as properties on
* a global `Modernizr` object, and as classes on the `<html>` element. This
* information allows you to progressively enhance your pages with a granular level
* of control over the experience.
*/
;(function(window, document, undefined){
var tests = [];
var ModernizrProto = {
// The current version, dummy
_version: '3.0.0-alpha.3',
// Any settings that don't work as separate modules
// can go in here as configuration.
_config: {
'classPrefix' : '',
'enableClasses' : true,
'enableJSClass' : true,
'usePrefixes' : true
},
// Queue of tests
_q: [],
// Stub these for people who are listening
on: function( test, cb ) {
// I don't really think people should do this, but we can
// safe guard it a bit.
// -- NOTE:: this gets WAY overridden in src/addTest for
// actual async tests. This is in case people listen to
// synchronous tests. I would leave it out, but the code
// to *disallow* sync tests in the real version of this
// function is actually larger than this.
var self = this;
setTimeout(function() {
cb(self[test]);
}, 0);
},
addTest: function( name, fn, options ) {
tests.push({name : name, fn : fn, options : options });
},
addAsyncTest: function (fn) {
tests.push({name : null, fn : fn});
}
};
// Fake some of Object.create
// so we can force non test results
// to be non "own" properties.
var Modernizr = function(){};
Modernizr.prototype = ModernizrProto;
// Leak modernizr globally when you `require` it
// rather than force it here.
// Overwrite name so constructor name is nicer :D
Modernizr = new Modernizr();
var classes = [];
/**
* is returns a boolean for if typeof obj is exactly type.
*/
function is( obj, type ) {
return typeof obj === type;
}
;
// Run through all tests and detect their support in the current UA.
function testRunner() {
var featureNames;
var feature;
var aliasIdx;
var result;
var nameIdx;
var featureName;
var featureNameSplit;
for ( var featureIdx in tests ) {
featureNames = [];
feature = tests[featureIdx];
// run the test, throw the return value into the Modernizr,
// then based on that boolean, define an appropriate className
// and push it into an array of classes we'll join later.
//
// If there is no name, it's an 'async' test that is run,
// but not directly added to the object. That should
// be done with a post-run addTest call.
if ( feature.name ) {
featureNames.push(feature.name.toLowerCase());
if (feature.options && feature.options.aliases && feature.options.aliases.length) {
// Add all the aliases into the names list
for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {
featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());
}
}
}
// Run the test, or use the raw value if it's not a function
result = is(feature.fn, 'function') ? feature.fn() : feature.fn;
// Set each of the names on the Modernizr object
for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {
featureName = featureNames[nameIdx];
// Support dot properties as sub tests. We don't do checking to make sure
// that the implied parent tests have been added. You must call them in
// order (either in the test, or make the parent test a dependency).
//
// Cap it to TWO to make the logic simple and because who needs that kind of subtesting
// hashtag famous last words
featureNameSplit = featureName.split('.');
if (featureNameSplit.length === 1) {
Modernizr[featureNameSplit[0]] = result;
} else {
// cast to a Boolean, if not one already
/* jshint -W053 */
if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {
Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);
}
Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;
}
classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));
}
}
}
;
var docElement = document.documentElement;
// Pass in an and array of class names, e.g.:
// ['no-webp', 'borderradius', ...]
function setClasses( classes ) {
var className = docElement.className;
var classPrefix = Modernizr._config.classPrefix || '';
// Change `no-js` to `js` (we do this independently of the `enableClasses`
// option)
// Handle classPrefix on this too
if(Modernizr._config.enableJSClass) {
var reJS = new RegExp('(^|\\s)'+classPrefix+'no-js(\\s|$)');
className = className.replace(reJS, '$1'+classPrefix+'js$2');
}
if(Modernizr._config.enableClasses) {
// Add the new classes
className += ' ' + classPrefix + classes.join(' ' + classPrefix);
docElement.className = className;
}
}
;
// hasOwnProperty shim by kangax needed for Safari 2.0 support
var hasOwnProp;
(function() {
var _hasOwnProperty = ({}).hasOwnProperty;
/* istanbul ignore else */
/* we have no way of testing IE 5.5 or safari 2,
* so just assume the else gets hit */
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
hasOwnProp = function (object, property) {
return _hasOwnProperty.call(object, property);
};
}
else {
hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
};
}
})();
// As far as I can think of, we shouldn't need or
// allow 'on' for non-async tests, and you can't do
// async tests without this 'addTest' module.
// Listeners for async or post-run tests
ModernizrProto._l = {};
// 'addTest' implies a test after the core runloop,
// So we'll add in the events
ModernizrProto.on = function( test, cb ) {
// Create the list of listeners if it doesn't exist
if (!this._l[test]) {
this._l[test] = [];
}
// Push this test on to the listener list
this._l[test].push(cb);
// If it's already been resolved, trigger it on next tick
if (Modernizr.hasOwnProperty(test)) {
// Next Tick
setTimeout(function() {
Modernizr._trigger(test, Modernizr[test]);
}, 0);
}
};
ModernizrProto._trigger = function( test, res ) {
if (!this._l[test]) {
return;
}
var cbs = this._l[test];
// Force async
setTimeout(function() {
var i, cb;
for (i = 0; i < cbs.length; i++) {
cb = cbs[i];
cb(res);
}
},0);
// Don't trigger these again
delete this._l[test];
};
/**
* addTest allows the user to define their own feature tests
* the result will be added onto the Modernizr object,
* as well as an appropriate className set on the html element
*
* @param feature - String naming the feature
* @param test - Function returning true if feature is supported, false if not
*/
function addTest( feature, test ) {
if ( typeof feature == 'object' ) {
for ( var key in feature ) {
if ( hasOwnProp( feature, key ) ) {
addTest( key, feature[ key ] );
}
}
} else {
feature = feature.toLowerCase();
var featureNameSplit = feature.split('.');
var last = Modernizr[featureNameSplit[0]];
// Again, we don't check for parent test existence. Get that right, though.
if (featureNameSplit.length == 2) {
last = last[featureNameSplit[1]];
}
if ( typeof last != 'undefined' ) {
// we're going to quit if you're trying to overwrite an existing test
// if we were to allow it, we'd do this:
// var re = new RegExp("\\b(no-)?" + feature + "\\b");
// docElement.className = docElement.className.replace( re, '' );
// but, no rly, stuff 'em.
return Modernizr;
}
test = typeof test == 'function' ? test() : test;
// Set the value (this is the magic, right here).
if (featureNameSplit.length == 1) {
Modernizr[featureNameSplit[0]] = test;
} else {
// cast to a Boolean, if not one already
/* jshint -W053 */
if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {
Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);
}
Modernizr[featureNameSplit[0]][featureNameSplit[1]] = test;
}
// Set a single class (either `feature` or `no-feature`)
/* jshint -W041 */
setClasses([(!!test && test != false ? '' : 'no-') + featureNameSplit.join('-')]);
/* jshint +W041 */
// Trigger the event
Modernizr._trigger(feature, test);
}
return Modernizr; // allow chaining.
}
// After all the tests are run, add self
// to the Modernizr prototype
Modernizr._q.push(function() {
ModernizrProto.addTest = addTest;
});
// Following spec is to expose vendor-specific style properties as:
// elem.style.WebkitBorderRadius
// and the following would be incorrect:
// elem.style.webkitBorderRadius
// Webkit ghosts their properties in lowercase but Opera & Moz do not.
// Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+
// erik.eae.net/archives/2008/03/10/21.48.10/
// More here: github.com/Modernizr/Modernizr/issues/issue/21
var omPrefixes = 'Webkit Moz O ms';
var cssomPrefixes = (ModernizrProto._config.usePrefixes ? omPrefixes.split(' ') : []);
ModernizrProto._cssomPrefixes = cssomPrefixes;
/**
* atRule returns a given CSS property at-rule (eg @keyframes), possibly in
* some prefixed form, or false, in the case of an unsupported rule
*
* @param prop - String naming the property to test
*/
var atRule = function(prop) {
var length = prefixes.length;
var cssrule = window.CSSRule;
var rule;
if (typeof cssrule === 'undefined' || !prop) {
return false;
}
// remove literal @ from beginning of provided property
prop = prop.replace(/^@/,'');
// CSSRules use underscores instead of dashes
rule = prop.replace(/-/g,'_').toUpperCase() + '_RULE';
if (rule in cssrule) {
return '@' + prop;
}
for ( var i = 0; i < length; i++ ) {
// prefixes gives us something like -o-, and we want O_
var prefix = prefixes[i];
var thisRule = prefix.toUpperCase() + '_' + rule;
if (thisRule in cssrule) {
return '@-' + prefix.toLowerCase() + '-' + prop;
}
}
return false;
};
var domPrefixes = (ModernizrProto._config.usePrefixes ? omPrefixes.toLowerCase().split(' ') : []);
ModernizrProto._domPrefixes = domPrefixes;
// Change the function's scope.
function fnBind(fn, that) {
return function() {
return fn.apply(that, arguments);
};
}
;
var createElement = function() {
if (typeof document.createElement !== 'function') {
// This is the case in IE7, where the type of createElement is "object".
// For this reason, we cannot call apply() as Object is not a Function.
return document.createElement(arguments[0]);
} else {
return document.createElement.apply(document, arguments);
}
};
// isEventSupported determines if the given element supports the given event
// kangax.github.com/iseventsupported/
// github.com/Modernizr/Modernizr/pull/636
//
// Known incorrects:
// Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative
// Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333
var isEventSupported = (function (undefined) {
// Detect whether event support can be detected via `in`. Test on a DOM element
// using the "blur" event b/c it should always exist. bit.ly/event-detection
var needsFallback = !('onblur' in document.documentElement);
/**
* @param {string|*} eventName is the name of an event to test for (e.g. "resize")
* @param {(Object|string|*)=} element is the element|document|window|tagName to test on
* @return {boolean}
*/
function isEventSupportedInner( eventName, element ) {
var isSupported;
if ( !eventName ) { return false; }
if ( !element || typeof element === 'string' ) {
element = createElement(element || 'div');
}
// Testing via the `in` operator is sufficient for modern browsers and IE.
// When using `setAttribute`, IE skips "unload", WebKit skips "unload" and
// "resize", whereas `in` "catches" those.
eventName = 'on' + eventName;
isSupported = eventName in element;
// Fallback technique for old Firefox - bit.ly/event-detection
if ( !isSupported && needsFallback ) {
if ( !element.setAttribute ) {
// Switch to generic element if it lacks `setAttribute`.
// It could be the `document`, `window`, or something else.
element = createElement('div');
}
element.setAttribute(eventName, '');
isSupported = typeof element[eventName] === 'function';
if ( element[eventName] !== undefined ) {
// If property was created, "remove it" by setting value to `undefined`.
element[eventName] = undefined;
}
element.removeAttribute(eventName);
}
return isSupported;
}
return isEventSupportedInner;
})();
// Modernizr.hasEvent() detects support for a given event, with an optional element to test on
// Modernizr.hasEvent('gesturestart', elem)
var hasEvent = ModernizrProto.hasEvent = isEventSupported;
// Take the html5 variable out of the
// html5shiv scope so we can return it.
var html5;
/**
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.2';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Extends the built-in list of html5 elements
* @memberOf html5
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
* @param {Document} ownerDocument The context document.
*/
function addElements(newElements, ownerDocument) {
var elements = html5.elements;
if(typeof elements != 'string'){
elements = elements.join(' ');
}
if(typeof newElements != 'string'){
newElements = newElements.join(' ');
}
html5.elements = elements +' '+ newElements;
shivDocument(ownerDocument);
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment,
//extends list of elements
addElements: addElements
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
/*------------------------------- Print Shiv -------------------------------*/
/** Used to filter media types */
var reMedia = /^$|\b(?:all|print)\b/;
/** Used to namespace printable elements */
var shivNamespace = 'html5shiv';
/** Detect whether the browser supports shivable style sheets */
var supportsShivableSheets = !supportsUnknownElements && (function() {
// assign a false negative if unable to shiv
var docEl = document.documentElement;
return !(
typeof document.namespaces == 'undefined' ||
typeof document.parentWindow == 'undefined' ||
typeof docEl.applyElement == 'undefined' ||
typeof docEl.removeNode == 'undefined' ||
typeof window.attachEvent == 'undefined'
);
}());
/*--------------------------------------------------------------------------*/
/**
* Wraps all HTML5 elements in the given document with printable elements.
* (eg. the "header" element is wrapped with the "html5shiv:header" element)
* @private
* @param {Document} ownerDocument The document.
* @returns {Array} An array wrappers added.
*/
function addWrappers(ownerDocument) {
var node,
nodes = ownerDocument.getElementsByTagName('*'),
index = nodes.length,
reElements = RegExp('^(?:' + getElements().join('|') + ')$', 'i'),
result = [];
while (index--) {
node = nodes[index];
if (reElements.test(node.nodeName)) {
result.push(node.applyElement(createWrapper(node)));
}
}
return result;
}
/**
* Creates a printable wrapper for the given element.
* @private
* @param {Element} element The element.
* @returns {Element} The wrapper.
*/
function createWrapper(element) {
var node,
nodes = element.attributes,
index = nodes.length,
wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName);
// copy element attributes to the wrapper
while (index--) {
node = nodes[index];
node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue);
}
// copy element styles to the wrapper
wrapper.style.cssText = element.style.cssText;
return wrapper;
}
/**
* Shivs the given CSS text.
* (eg. header{} becomes html5shiv\:header{})
* @private
* @param {String} cssText The CSS text to shiv.
* @returns {String} The shived CSS text.
*/
function shivCssText(cssText) {
var pair,
parts = cssText.split('{'),
index = parts.length,
reElements = RegExp('(^|[\\s,>+~])(' + getElements().join('|') + ')(?=[[\\s,>+~#.:]|$)', 'gi'),
replacement = '$1' + shivNamespace + '\\:$2';
while (index--) {
pair = parts[index] = parts[index].split('}');
pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement);
parts[index] = pair.join('}');
}
return parts.join('{');
}
/**
* Removes the given wrappers, leaving the original elements.
* @private
* @params {Array} wrappers An array of printable wrappers.
*/
function removeWrappers(wrappers) {
var index = wrappers.length;
while (index--) {
wrappers[index].removeNode();
}
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document for print.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivPrint(ownerDocument) {
var shivedSheet,
wrappers,
data = getExpandoData(ownerDocument),
namespaces = ownerDocument.namespaces,
ownerWindow = ownerDocument.parentWindow;
if (!supportsShivableSheets || ownerDocument.printShived) {
return ownerDocument;
}
if (typeof namespaces[shivNamespace] == 'undefined') {
namespaces.add(shivNamespace);
}
function removeSheet() {
clearTimeout(data._removeSheetTimer);
if (shivedSheet) {
shivedSheet.removeNode(true);
}
shivedSheet= null;
}
ownerWindow.attachEvent('onbeforeprint', function() {
removeSheet();
var imports,
length,
sheet,
collection = ownerDocument.styleSheets,
cssText = [],
index = collection.length,
sheets = Array(index);
// convert styleSheets collection to an array
while (index--) {
sheets[index] = collection[index];
}
// concat all style sheet CSS text
while ((sheet = sheets.pop())) {
// IE does not enforce a same origin policy for external style sheets...
// but has trouble with some dynamically created stylesheets
if (!sheet.disabled && reMedia.test(sheet.media)) {
try {
imports = sheet.imports;
length = imports.length;
} catch(er){
length = 0;
}
for (index = 0; index < length; index++) {
sheets.push(imports[index]);
}
try {
cssText.push(sheet.cssText);
} catch(er){}
}
}
// wrap all HTML5 elements with printable elements and add the shived style sheet
cssText = shivCssText(cssText.reverse().join(''));
wrappers = addWrappers(ownerDocument);
shivedSheet = addStyleSheet(ownerDocument, cssText);
});
ownerWindow.attachEvent('onafterprint', function() {
// remove wrappers, leaving the original elements, and remove the shived style sheet
removeWrappers(wrappers);
clearTimeout(data._removeSheetTimer);
data._removeSheetTimer = setTimeout(removeSheet, 500);
});
ownerDocument.printShived = true;
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
// expose API
html5.type += ' print';
html5.shivPrint = shivPrint;
// shiv for print
shivPrint(document);
}(this, document));
var err = function() {};
var warn = function() {};
if (window.console) {
err = function() {
var method = console.error ? 'error' : 'log';
window.console[method].apply( window.console, Array.prototype.slice.call(arguments) );
};
warn = function() {
var method = console.warn ? 'warn' : 'log';
window.console[method].apply( window.console, Array.prototype.slice.call(arguments) );
};
}
ModernizrProto.load = function() {
if ('yepnope' in window) {
warn('yepnope.js (aka Modernizr.load) is no longer included as part of Modernizr. yepnope appears to be available on the page, so we’ll use it to handle this call to Modernizr.load, but please update your code to use yepnope directly.\n See http://github.com/Modernizr/Modernizr/issues/1182 for more information.');
window.yepnope.apply(window, [].slice.call(arguments,0));
} else {
err('yepnope.js (aka Modernizr.load) is no longer included as part of Modernizr. Get it from http://yepnopejs.com. See http://github.com/Modernizr/Modernizr/issues/1182 for more information.');
}
};
function getBody() {
// After page load injecting a fake body doesn't work so check if body exists
var body = document.body;
if(!body) {
// Can't use the real body create a fake one.
body = createElement('body');
body.fake = true;
}
return body;
}
;
// Inject element with style element and some CSS rules
function injectElementWithStyles( rule, callback, nodes, testnames ) {
var mod = 'modernizr';
var style;
var ret;
var node;
var docOverflow;
var div = createElement('div');
var body = getBody();
if ( parseInt(nodes, 10) ) {
// In order not to give false positives we create a node for each test
// This also allows the method to scale for unspecified uses
while ( nodes-- ) {
node = createElement('div');
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
div.appendChild(node);
}
}
// <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed
// when injected with innerHTML. To get around this you need to prepend the 'NoScope' element
// with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements.
// msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx
// Documents served as xml will throw if using ­ so use xml friendly encoded version. See issue #277
style = ['­','<style id="s', mod, '">', rule, '</style>'].join('');
div.id = mod;
// IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody.
// Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270
(!body.fake ? div : body).innerHTML += style;
body.appendChild(div);
if ( body.fake ) {
//avoid crashing IE8, if background image is used
body.style.background = '';
//Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible
body.style.overflow = 'hidden';
docOverflow = docElement.style.overflow;
docElement.style.overflow = 'hidden';
docElement.appendChild(body);
}
ret = callback(div, rule);
// If this is done after page load we don't want to remove the body so check if body exists
if ( body.fake ) {
body.parentNode.removeChild(body);
docElement.style.overflow = docOverflow;
// Trigger layout so kinetic scrolling isn't disabled in iOS6+
docElement.offsetHeight;
} else {
div.parentNode.removeChild(div);
}
return !!ret;
}
;
// adapted from matchMedia polyfill
// by Scott Jehl and Paul Irish
// gist.github.com/786768
var testMediaQuery = (function () {
var matchMedia = window.matchMedia || window.msMatchMedia;
if ( matchMedia ) {
return function ( mq ) {
var mql = matchMedia(mq);
return mql && mql.matches || false;
};
}
return function ( mq ) {
var bool = false;
injectElementWithStyles('@media ' + mq + ' { #modernizr { position: absolute; } }', function( node ) {
bool = (window.getComputedStyle ?
window.getComputedStyle(node, null) :
node.currentStyle)['position'] == 'absolute';
});
return bool;
};
})();
/** Modernizr.mq tests a given media query, live against the current state of the window
* A few important notes:
* If a browser does not support media queries at all (eg. oldIE) the mq() will always return false
* A max-width or orientation query will be evaluated against the current state, which may change later.
* You must specify values. Eg. If you are testing support for the min-width media query use:
Modernizr.mq('(min-width:0)')
* usage:
* Modernizr.mq('only screen and (max-width:768)')
*/
var mq = ModernizrProto.mq = testMediaQuery;
/**
* contains returns a boolean for if substr is found within str.
*/
function contains( str, substr ) {
return !!~('' + str).indexOf(substr);
}
;
/**
* Create our "modernizr" element that we do most feature tests on.
*/
var modElem = {
elem : createElement('modernizr')
};
// Clean up this element
Modernizr._q.push(function() {
delete modElem.elem;
});
var mStyle = {
style : modElem.elem.style
};
// kill ref for gc, must happen before
// mod.elem is removed, so we unshift on to
// the front of the queue.
Modernizr._q.unshift(function() {
delete mStyle.style;
});
// Helper function for converting camelCase to kebab-case,
// e.g. boxSizing -> box-sizing
function domToCSS( name ) {
return name.replace(/([A-Z])/g, function(str, m1) {
return '-' + m1.toLowerCase();
}).replace(/^ms-/, '-ms-');
}
;
// Function to allow us to use native feature detection functionality if available.
// Accepts a list of property names and a single value
// Returns `undefined` if native detection not available
function nativeTestProps ( props, value ) {
var i = props.length;
// Start with the JS API: http://www.w3.org/TR/css3-conditional/#the-css-interface
if ('CSS' in window && 'supports' in window.CSS) {
// Try every prefixed variant of the property
while (i--) {
if (window.CSS.supports(domToCSS(props[i]), value)) {
return true;
}
}
return false;
}
// Otherwise fall back to at-rule (for Opera 12.x)
else if ('CSSSupportsRule' in window) {
// Build a condition string for every prefixed variant
var conditionText = [];
while (i--) {
conditionText.push('(' + domToCSS(props[i]) + ':' + value + ')');
}
conditionText = conditionText.join(' or ');
return injectElementWithStyles('@supports (' + conditionText + ') { #modernizr { position: absolute; } }', function( node ) {
return getComputedStyle(node, null).position == 'absolute';
});
}
return undefined;
}
;
// Helper function for converting kebab-case to camelCase,
// e.g. box-sizing -> boxSizing
function cssToDOM( name ) {
return name.replace(/([a-z])-([a-z])/g, function(str, m1, m2) {
return m1 + m2.toUpperCase();
}).replace(/^-/, '');
}
;
// testProps is a generic CSS / DOM property test.
// In testing support for a given CSS property, it's legit to test:
// `elem.style[styleName] !== undefined`
// If the property is supported it will return an empty string,
// if unsupported it will return undefined.
// We'll take advantage of this quick test and skip setting a style
// on our modernizr element, but instead just testing undefined vs
// empty string.
// Property names can be provided in either camelCase or kebab-case.
function testProps( props, prefixed, value, skipValueTest ) {
skipValueTest = is(skipValueTest, 'undefined') ? false : skipValueTest;
// Try native detect first
if (!is(value, 'undefined')) {
var result = nativeTestProps(props, value);
if(!is(result, 'undefined')) {
return result;
}
}
// Otherwise do it properly
var afterInit, i, propsLength, prop, before;
// If we don't have a style element, that means
// we're running async or after the core tests,
// so we'll need to create our own elements to use
if ( !mStyle.style ) {
afterInit = true;
mStyle.modElem = createElement('modernizr');
mStyle.style = mStyle.modElem.style;
}
// Delete the objects if we
// we created them.
function cleanElems() {
if (afterInit) {
delete mStyle.style;
delete mStyle.modElem;
}
}
propsLength = props.length;
for ( i = 0; i < propsLength; i++ ) {
prop = props[i];
before = mStyle.style[prop];
if (contains(prop, '-')) {
prop = cssToDOM(prop);
}
if ( mStyle.style[prop] !== undefined ) {
// If value to test has been passed in, do a set-and-check test.
// 0 (integer) is a valid property value, so check that `value` isn't
// undefined, rather than just checking it's truthy.
if (!skipValueTest && !is(value, 'undefined')) {
// Needs a try catch block because of old IE. This is slow, but will
// be avoided in most cases because `skipValueTest` will be used.
try {
mStyle.style[prop] = value;
} catch (e) {}
// If the property value has changed, we assume the value used is
// supported. If `value` is empty string, it'll fail here (because
// it hasn't changed), which matches how browsers have implemented
// CSS.supports()
if (mStyle.style[prop] != before) {
cleanElems();
return prefixed == 'pfx' ? prop : true;
}
}
// Otherwise just return true, or the property name if this is a
// `prefixed()` call
else {
cleanElems();
return prefixed == 'pfx' ? prop : true;
}
}
}
cleanElems();
return false;
}
;
/**
* testDOMProps is a generic DOM property test; if a browser supports
* a certain property, it won't return undefined for it.
*/
function testDOMProps( props, obj, elem ) {
var item;
for ( var i in props ) {
if ( props[i] in obj ) {
// return the property name as a string
if (elem === false) return props[i];
item = obj[props[i]];
// let's bind a function
if (is(item, 'function')) {
// bind to obj unless overriden
return fnBind(item, elem || obj);
}
// return the unbound function or obj or value
return item;
}
}
return false;
}
;
/**
* testPropsAll tests a list of DOM properties we want to check against.
* We specify literally ALL possible (known and/or likely) properties on
* the element including the non-vendor prefixed one, for forward-
* compatibility.
*/
function testPropsAll( prop, prefixed, elem, value, skipValueTest ) {
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
// did they call .prefixed('boxSizing') or are we just testing a prop?
if(is(prefixed, 'string') || is(prefixed, 'undefined')) {
return testProps(props, prefixed, value, skipValueTest);
// otherwise, they called .prefixed('requestAnimationFrame', window[, elem])
} else {
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
return testDOMProps(props, prefixed, elem);
}
}
// Modernizr.testAllProps() investigates whether a given style property,
// or any of its vendor-prefixed variants, is recognized
// Note that the property names must be provided in the camelCase variant.
// Modernizr.testAllProps('boxSizing')
ModernizrProto.testAllProps = testPropsAll;
// Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input
// Modernizr.prefixed('boxSizing') // 'MozBoxSizing'
// Properties can be passed as DOM-style camelCase or CSS-style kebab-case.
// Return values will always be in camelCase; if you want kebab-case, use Modernizr.prefixedCSS().
// If you're trying to ascertain which transition end event to bind to, you might do something like...
//
// var transEndEventNames = {
// 'WebkitTransition' : 'webkitTransitionEnd',// Saf 6, Android Browser
// 'MozTransition' : 'transitionend', // only for FF < 15
// 'transition' : 'transitionend' // IE10, Opera, Chrome, FF 15+, Saf 7+
// },
// transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];
var prefixed = ModernizrProto.prefixed = function( prop, obj, elem ) {
if (prop.indexOf('@') === 0) {
return atRule(prop);
}
if (prop.indexOf('-') != -1) {
// Convert kebab-case to camelCase
prop = cssToDOM(prop);
}
if (!obj) {
return testPropsAll(prop, 'pfx');
} else {
// Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame'
return testPropsAll(prop, obj, elem);
}
};
// List of property values to set for css tests. See ticket #21
var prefixes = (ModernizrProto._config.usePrefixes ? ' -webkit- -moz- -o- -ms- '.split(' ') : []);
// expose these for the plugin API. Look in the source for how to join() them against your input
ModernizrProto._prefixes = prefixes;
// Modernizr.prefixedCSS() is like Modernizr.prefixed(), but returns the result in
// hyphenated form, e.g.:
// Modernizr.prefixedCSS('transition') // '-moz-transition'
// It’s only suitable for style properties.
// Properties can be passed as DOM-style camelCase or CSS-style kebab-case.
// Return values will always be the hyphenated variant, or `false` if not supported
var prefixedCSS = ModernizrProto.prefixedCSS = function(prop) {
var prefixedProp = prefixed(prop);
return prefixedProp && domToCSS(prefixedProp);
};
/**
* testAllProps determines whether a given CSS property, in some prefixed
* form, is supported by the browser. It can optionally be given a value; in
* which case testAllProps will only return true if the browser supports that
* value for the named property; this latter case will use native detection
* (via window.CSS.supports) if available. A boolean can be passed as a 3rd
* parameter to skip the value check when native detection isn't available,
* to improve performance when simply testing for support of a property.
*
* @param prop - String naming the property to test (either camelCase or
* kebab-case)
* @param value - [optional] String of the value to test
* @param skipValueTest - [optional] Whether to skip testing that the value
* is supported when using non-native detection
* (default: false)
*/
function testAllProps (prop, value, skipValueTest) {
return testPropsAll(prop, undefined, undefined, value, skipValueTest);
}
ModernizrProto.testAllProps = testAllProps;
// Modernizr.testProp() investigates whether a given style property is recognized
// Property names can be provided in either camelCase or kebab-case.
// Modernizr.testProp('pointerEvents')
// Also accepts optional 2nd arg, of a value to use for native feature detection, e.g.:
// Modernizr.testProp('pointerEvents', 'none')
var testProp = ModernizrProto.testProp = function( prop, value, useValue ) {
return testProps([prop], undefined, value, useValue);
};
var testStyles = ModernizrProto.testStyles = injectElementWithStyles;
/*!
{
"name": "CSS Transforms",
"property": "csstransforms",
"caniuse": "transforms2d",
"tags": ["css"]
}
!*/
Modernizr.addTest('csstransforms', function() {
// Android < 3.0 is buggy, so we sniff and blacklist
// http://git.io/hHzL7w
return navigator.userAgent.indexOf('Android 2.') === -1 &&
testAllProps('transform', 'scale(1)', true);
});
/*!
{
"name": "CSS Supports",
"property": "supports",
"caniuse": "css-featurequeries",
"tags": ["css"],
"builderAliases": ["css_supports"],
"notes": [{
"name": "W3 Spec",
"href": "http://dev.w3.org/csswg/css3-conditional/#at-supports"
},{
"name": "Related Github Issue",
"href": "github.com/Modernizr/Modernizr/issues/648"
},{
"name": "W3 Info",
"href": "http://dev.w3.org/csswg/css3-conditional/#the-csssupportsrule-interface"
}]
}
!*/
Modernizr.addTest('supports', 'CSS' in window && 'supports' in window.CSS);
/*!
{
"name": "CSS Transforms 3D",
"property": "csstransforms3d",
"caniuse": "transforms3d",
"tags": ["css"],
"warnings": [
"Chrome may occassionally fail this test on some systems; more info: https://code.google.com/p/chromium/issues/detail?id=129004"
]
}
!*/
Modernizr.addTest('csstransforms3d', function() {
var ret = !!testAllProps('perspective', '1px', true);
var usePrefix = Modernizr._config.usePrefixes;
// Webkit's 3D transforms are passed off to the browser's own graphics renderer.
// It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
// some conditions. As a result, Webkit typically recognizes the syntax but
// will sometimes throw a false positive, thus we must do a more thorough check:
if ( ret && (!usePrefix || 'webkitPerspective' in docElement.style )) {
var mq;
// Use CSS Conditional Rules if available
if (Modernizr.supports) {
mq = '@supports (perspective: 1px)';
} else {
// Otherwise, Webkit allows this media query to succeed only if the feature is enabled.
// `@media (transform-3d),(-webkit-transform-3d){ ... }`
mq = '@media (transform-3d)';
if (usePrefix ) mq += ',(-webkit-transform-3d)';
}
// If loaded inside the body tag and the test element inherits any padding, margin or borders it will fail #740
mq += '{#modernizr{left:9px;position:absolute;height:5px;margin:0;padding:0;border:0}}';
testStyles(mq, function( elem ) {
ret = elem.offsetLeft === 9 && elem.offsetHeight === 5;
});
}
return ret;
});
/*!
{
"name": "CSS Transform Style preserve-3d",
"property": "preserve3d",
"authors": ["edmellum"],
"tags": ["css"],
"notes": [{
"name": "MDN Docs",
"href": "https://developer.mozilla.org/en-US/docs/Web/CSS/transform-style"
},{
"name": "Related Github Issue",
"href": "https://github.com/Modernizr/Modernizr/issues/762"
}]
}
!*/
/* DOC
Detects support for `transform-style: preserve-3d`, for getting a proper 3D perspective on elements.
*/
Modernizr.addTest('preserve3d', testAllProps('transformStyle', 'preserve-3d'));
// Run each test
testRunner();
// Remove the "no-js" class if it exists
setClasses(classes);
delete ModernizrProto.addTest;
delete ModernizrProto.addAsyncTest;
// Run the things that are supposed to run after the tests
for (var i = 0; i < Modernizr._q.length; i++) {
Modernizr._q[i]();
}
// Leak Modernizr namespace
window.Modernizr = Modernizr;
;
})(window, document); | 32.477273 | 321 | 0.610606 |
28d543ab78ac75e2f72078cb5faf3de3c0b83400 | 91 | js | JavaScript | Javascript/holamundo-gt.js | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 1,428 | 2018-10-03T15:15:17.000Z | 2019-03-31T18:38:36.000Z | Javascript/holamundo-gt.js | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 1,162 | 2018-10-03T15:05:49.000Z | 2018-10-18T14:17:52.000Z | Javascript/holamundo-gt.js | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 3,909 | 2018-10-03T15:07:19.000Z | 2019-03-31T18:39:08.000Z | console.log("Que onda Mundo!", "Bienvenidos al Hacktoberfest!", "Saludos desde Guatemala"); | 91 | 91 | 0.758242 |
28d5c9c36035a0487aa916631ca3775b084a74ef | 1,583 | js | JavaScript | src/ui/lib/BootstrapIconWrapper.js | mplattu/dummylander | e0c7023b80b36d210d62ca0377627f41eec4bde7 | [
"MIT"
] | null | null | null | src/ui/lib/BootstrapIconWrapper.js | mplattu/dummylander | e0c7023b80b36d210d62ca0377627f41eec4bde7 | [
"MIT"
] | null | null | null | src/ui/lib/BootstrapIconWrapper.js | mplattu/dummylander | e0c7023b80b36d210d62ca0377627f41eec4bde7 | [
"MIT"
] | null | null | null | class BootstrapIconWrapper {
constructor() {
// Top navi buttons
this.book = '<!-- include-jsesc:src/ui/ext/icons/book.svg -->';
this.pencil = '<!-- include-jsesc:src/ui/ext/icons/pencil.svg -->';
this.folder = '<!-- include-jsesc:src/ui/ext/icons/folder.svg -->';
this.cloud_upload = '<!-- include-jsesc:src/ui/ext/icons/cloud-upload.svg -->';
this.x_circle = '<!-- include-jsesc:src/ui/ext/icons/x-circle.svg -->';
this.x_circle_fill = '<!-- include-jsesc:src/ui/ext/icons/x-circle-fill.svg -->';
this.command = '<!-- include-jsesc:src/ui/ext/icons/command.svg -->';
// Parts edit buttons
this.plus = '<!-- include-jsesc:src/ui/ext/icons/plus.svg -->';
this.chevron_up = '<!-- include-jsesc:src/ui/ext/icons/chevron-up.svg -->';
this.chevron_down = '<!-- include-jsesc:src/ui/ext/icons/chevron-down.svg -->';
this.arrow_up = '<!-- include-jsesc:src/ui/ext/icons/arrow-up.svg -->';
this.arrow_down = '<!-- include-jsesc:src/ui/ext/icons/arrow-down.svg -->';
this.trash = '<!-- include-jsesc:src/ui/ext/icons/trash.svg -->';
// Edit textarea buttons
this.reply = '<!-- include-jsesc:src/ui/ext/icons/reply.svg -->';
this.image = '<!-- include-jsesc:src/ui/ext/icons/image.svg -->';
this.type_bold = '<!-- include-jsesc:src/ui/ext/icons/type-bold.svg -->';
this.type_italic = '<!-- include-jsesc:src/ui/ext/icons/type-italic.svg -->';
this.code = '<!-- include-jsesc:src/ui/ext/icons/code.svg -->';
// FileSelector
this.check = '<!-- include-jsesc:src/ui/ext/icons/check.svg -->';
}
}
| 51.064516 | 85 | 0.620973 |
28d62e40674b98103c43654d9ff844d810ad0206 | 5,704 | js | JavaScript | public/js/functions.js | Medeiros01/SisCM | 2c3954d083c1b00722411f738fbb87e5861dcb33 | [
"Apache-2.0"
] | 1 | 2019-07-15T20:40:48.000Z | 2019-07-15T20:40:48.000Z | public/js/functions.js | Medeiros01/SisCM | 2c3954d083c1b00722411f738fbb87e5861dcb33 | [
"Apache-2.0"
] | null | null | null | public/js/functions.js | Medeiros01/SisCM | 2c3954d083c1b00722411f738fbb87e5861dcb33 | [
"Apache-2.0"
] | null | null | null |
/**
* Funções para formulaário cadastro de íten
*/
/**
*
* Funções para gerenciar filtros de listagem de férias
*
*/
jQuery(function($){
$("#st_telefoneresidencial").mask("(99) 9999-9999");
$("#st_telefonecelular").mask("(99) 99999-9999");
$("#st_cep").mask("99999-999");
$("#st_cpf").mask("999.999.999-99");
});
$(function() {
$('[type=money]').maskMoney({
thousands: '.',
decimal: ','
});
})
function consultaprodutos(id){
var id = id;
var url = '../../buscaprodutosparaadicionarcompra/'+id
var dadosForm = $('#buscaprodutocompra').serialize();
jQuery.ajax({
//Enviando via ajax
url: url,
data: dadosForm,
method: 'POST',
//Verificando se cadastrou
}).done(function(data){
if(data == 0){
alert('Produto não encontrado para o fonecedor desta compra!')
}else{
$("#tabelabuscaproduto").append("<tr><td>"+data.st_nome+"</td></tr>")
$("#st_codigo").val(data.st_codigo);
$("#st_nome").val(data.st_nome);
$("#st_descricao").val(data.st_descricao);
}
}).fail(function(){
alert('falha a enviar dados');
})
return false;
/* var dadosform = $("#buscaprodutocompra").serialize(); */
}
function consultaprodutosparavenda(id){
var id = id;
var url = '../../buscaprodutosparaadicionarnavenda/'+id
var dadosForm = $('#buscaprodutovenda').serialize();
jQuery.ajax({
//Enviando via ajax
url: url,
data: dadosForm,
method: 'POST',
//Verificando se cadastrou
}).done(function(data){
if(data == 0){
alert('Produto não encontrado para o fonecedor desta compra!')
}else{
$("#tabelabuscaproduto").append("<tr><td>"+data.st_nome+"</td></tr>")
$("#st_codigo").val(data.st_codigo);
$("#st_nome").val(data.st_nome);
$("#st_descricao").val(data.st_descricao);
}
}).fail(function(){
alert('falha a enviar dados');
})
return false;
/* var dadosform = $("#buscaprodutocompra").serialize(); */
}
/**
*
*/
function liberaedicaoprodutovenda(id){
$('#'+id).show()
$('.'+id).show()
$('#save'+id).show()
$('#edita'+id).hide()
};
function salvaedicaoprodutovenda(id){
$("#form_edita_produto_venda_"+id).attr("action","../../venda/editaprodutovenda/"+id);
$("#form_edita_produto_venda_"+id).submit();
}
//$('#reservation').daterangepicker();
/* $(function() {
//$( "#datetimepicker" ).datepicker();
$('#periodo').daterangepicker();
});
$(function() {
$( "#dt_inicio" ).datepicker();
});
$(function() {
$( "#dt_final" ).datepicker();
}); */
// ao alterar o campo altera status do servidor na hora do cadastro da Cr, exibe o campo
// status para selecionar o proximo status
function alterarstatusservidor(){
var valor = $('#st_alterastatus').val();
if(valor == 'Sim'){
$('#status').show()
$("#st_status").removeAttr("disabled");
$("#st_status").attr("required", true);
}else{
$('#status').hide()
//$("#st_status").attr("disabled");
$('#st_status').prop('disabled', true);
$("#st_status").attr("required", false);
$("#st_status").val(null);
}
};
function selectFilterFuncionarios(){
var valor = $("#filterlist").val();
if(valor == 'ce_setor'){
document.getElementById("divSetorFilter").style.display = "block";
$("#st_sigla").removeAttr("disabled");
}
else{
document.getElementById("divSetorFilter").style.display = "none";
$("#st_sigla").attr("disabled", "true");
}
if(valor == 'ce_orgao'){
document.getElementById("divOrgaoFilter").style.display = "block";
$("#st_orgao").removeAttr("disabled");
}
else{
document.getElementById("divOrgaoFilter").style.display = "none";
$("#st_orgao").attr("disabled", "true");
}
};
//Função para Habilitar os formulário de edição de outras entradas. Acionada
//ao Clicar no botão editar da tela detalhecaixa
function habilitaform(id){
$("."+id).show();
$("#salvar").show();
$("#editar").hide();
};
//Função para submeter o formulário de edição de entrada de outros valores
function submitform(id){
var form = $('form[id="'+id+'"]');
form.submit();
};
$( "#st_campo" ).change(function() {
var valorcampo = $('#st_campo').val();
if(valorcampo == 'dt_periodo'){
$('.fornecedor').hide();
$('.valor').hide();
$('.periodo').show();
// $('#dt_compra_inicio"').prop("disabled", false)
// $('#dt_compra_fim"').prop("disabled", false)
$('#st_valor').prop("disabled", true)
$('#ce_fornecedor').prop("disabled", true)
}else if(valorcampo == 'ce_fornecedor'){
$('.fornecedor').show();
$('.valor').hide();
$('.periodo').hide();
$('#dt_compra_inicio"').prop("disabled", true);
$('#dt_compra_fim"').prop("disabled", true);
$('#st_valor').prop("disabled", false);
$('#ce_fornecedor').prop("disabled", false);
}else{
$('.fornecedor').hide();
$('.valor').show();
$('.periodo').hide();
// $('#dt_compra_inicio"').prop("disabled", true)
// $('#dt_compra_fim"').prop("disabled", true)
$('#st_valor').prop("disabled", false)
$('#ce_fornecedor').prop("disabled", true)
}
}); | 26.045662 | 94 | 0.53594 |
28d6941a0f946448f14bdd6654ccda0b9c59173b | 3,986 | js | JavaScript | lib/plugin/egg-dora-mailtemplate/app/controller/manage/mailTemplate.js | devilkun/DoraCMS | 5e12787abd02c46187d8018aecfa2f7bbbf45548 | [
"MIT"
] | 2 | 2020-05-27T05:15:54.000Z | 2020-08-25T08:59:50.000Z | lib/plugin/egg-dora-mailtemplate/app/controller/manage/mailTemplate.js | devilkun/DoraCMS | 5e12787abd02c46187d8018aecfa2f7bbbf45548 | [
"MIT"
] | 3 | 2019-09-22T15:00:44.000Z | 2020-12-05T07:29:57.000Z | lib/plugin/egg-dora-mailtemplate/app/controller/manage/mailTemplate.js | devilkun/DoraCMS | 5e12787abd02c46187d8018aecfa2f7bbbf45548 | [
"MIT"
] | 1 | 2020-08-25T08:59:47.000Z | 2020-08-25T08:59:47.000Z | const _ = require('lodash');
const {
siteFunc
} = require("../../utils")
const mailTemplateRule = (ctx) => {
return {
comment: {
type: "string",
required: true,
message: ctx.__("validate_error_field", [ctx.__("备注")])
},
title: {
type: "string",
required: true,
message: ctx.__("validate_error_field", [ctx.__("标题")])
},
// subTitle: {
// type: "string",
// required: true,
// message: ctx.__("validate_error_field", [ctx.__("概要")])
// },
content: {
type: "string",
required: true,
message: ctx.__("validate_error_field", [ctx.__("内容")])
},
type: {
type: "string",
required: true,
message: ctx.__("validate_error_field", [ctx.__("类型")])
},
}
}
let MailTemplateController = {
async list(ctx) {
try {
let payload = ctx.query;
let queryObj = {};
let mailTemplateList = await ctx.service.mailTemplate.find(payload, {
query: queryObj,
searchKeys: ['comment', 'title', 'subTitle'],
});
ctx.helper.renderSuccess(ctx, {
data: mailTemplateList
});
} catch (err) {
ctx.helper.renderFail(ctx, {
message: err
});
}
},
async typelist(ctx) {
try {
let typeList = siteFunc.emailTypeKey();
ctx.helper.renderSuccess(ctx, {
data: typeList
});
} catch (err) {
ctx.helper.renderFail(ctx, {
message: err
});
}
},
async create(ctx) {
try {
let fields = ctx.request.body || {};
const formObj = {
comment: fields.comment,
title: fields.title,
subTitle: fields.subTitle,
content: fields.content,
type: fields.type,
createTime: new Date()
}
ctx.validate(mailTemplateRule(ctx), formObj);
await ctx.service.mailTemplate.create(formObj);
ctx.helper.renderSuccess(ctx);
} catch (err) {
ctx.helper.renderFail(ctx, {
message: err
});
}
},
async getOne(ctx) {
try {
let _id = ctx.query.id;
let targetItem = await ctx.service.mailTemplate.item(ctx, {
query: {
_id: _id
}
});
ctx.helper.renderSuccess(ctx, {
data: targetItem
});
} catch (err) {
ctx.helper.renderFail(ctx, {
message: err
});
}
},
async update(ctx) {
try {
let fields = ctx.request.body || {};
const formObj = {
comment: fields.comment,
title: fields.title,
subTitle: fields.subTitle,
content: fields.content,
type: fields.type,
updateTime: new Date()
}
ctx.validate(mailTemplateRule(ctx), formObj);
await ctx.service.mailTemplate.update(ctx, fields._id, formObj);
ctx.helper.renderSuccess(ctx);
} catch (err) {
ctx.helper.renderFail(ctx, {
message: err
});
}
},
async removes(ctx) {
try {
let targetIds = ctx.query.ids;
await ctx.service.mailTemplate.removes(ctx, targetIds);
ctx.helper.renderSuccess(ctx);
} catch (err) {
ctx.helper.renderFail(ctx, {
message: err
});
}
},
}
module.exports = MailTemplateController; | 20.233503 | 81 | 0.443051 |
28d7987bf98f3dd981f0dcdc46878089d0c953f6 | 1,138 | js | JavaScript | src/components/Citadel/components/DistrictNumber.js | orden-gg/ghst-gg | 6c03dcc8b8a24038e88c5d97be1908996201852e | [
"MIT"
] | 16 | 2021-12-01T16:07:04.000Z | 2022-02-13T16:33:09.000Z | src/components/Citadel/components/DistrictNumber.js | orden-gg/ghst-gg | 6c03dcc8b8a24038e88c5d97be1908996201852e | [
"MIT"
] | 48 | 2021-12-01T15:24:25.000Z | 2022-02-15T15:33:55.000Z | src/components/Citadel/components/DistrictNumber.js | orden-gg/ghst-gg | 6c03dcc8b8a24038e88c5d97be1908996201852e | [
"MIT"
] | 19 | 2021-12-02T02:42:58.000Z | 2022-03-07T20:25:53.000Z | import Phaser from 'phaser';
import { COLORS } from 'data/citadel.data';
import citadelUtils from 'utils/citadelUtils';
export default class DistrictNumber extends Phaser.GameObjects.Text {
constructor(scene, id) {
const { x, y, w, h } = citadelUtils.getDistrictParams(id);
const [offsetX, offsetY] = [w / 2, h / 2];
super(scene);
scene.add.existing(this);
this.text = id;
this.fontSize = h / 10;
this.startScale = 5;
this.setPosition(
Math.floor(x + offsetX),
Math.floor(y + offsetY)
);
this.setOrigin(.5, .5);
this.setAlpha(.7);
this.updateScale();
this.setStyle({
fontSize: this.fontSize,
color: `#${COLORS.grid.toString(16)}`
});
scene.on('zoom', () => {
this.updateScale();
});
}
updateScale() {
this.setScale(1 / this.scene.cameras.main.zoom);
const size = this.scale * this.fontSize;
if (size > this.fontSize * this.startScale) {
this.setScale(1 * this.startScale);
}
}
}
| 24.212766 | 69 | 0.540422 |
28d7a1cb45dd48402d4e649ced81f586209b0e1f | 3,968 | js | JavaScript | src/components/sizeInput.js | jeremyoo/BannerCreator | 63c3e12d620a2dfa796ba6583ee8d8088fb008f6 | [
"MIT"
] | 2 | 2021-01-12T02:29:23.000Z | 2021-01-12T02:29:26.000Z | src/components/sizeInput.js | jeremyoo/BannerCreator | 63c3e12d620a2dfa796ba6583ee8d8088fb008f6 | [
"MIT"
] | 1 | 2021-01-26T21:13:31.000Z | 2021-01-26T21:13:31.000Z | src/components/sizeInput.js | jeremyoo/DynamicBanner | 63c3e12d620a2dfa796ba6583ee8d8088fb008f6 | [
"MIT"
] | null | null | null | import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
const StyledBlock = styled.div`
${({ theme }) => theme.mixins.flexCenter};
height: 100px;
margin-top: 20px;
background: inherit;
span {
position: relative;
display: inline-block;
margin: 30px 10px 30px;
}
input {
padding: 9px 0 9px 16px;
width: 180px;
background: var(--white);
border-radius: 4px;
font-size: var(--ft-lg);
color: var(--light-navy);
text-shadow: var(--light-steel) 2px 2px;
font-weight: 600;
letter-spacing: 4px;
text-indent: 80px;
&::-webkit-input-placeholder {
text-shadow: none;
letter-spacing: normal;
color: var(--white);
text-indent: 5px;
font-weight: 300;
}
+ label {
position: absolute;
top: 8px;
left: 0;
bottom: 8px;
padding: 5px 15px;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
border-radius: 3px;
transition: var(--transition);
background: rgba(20, 204, 143, 0);
&:after {
position: absolute;
content: "";
width: 0;
height: 0;
top: 100%;
left: 50%;
margin-left: -3px;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-top: 3px solid rgba(20, 204, 143, 0);
transition: var(--transition);
}
}
@media (max-width: 414px) {
width: 160px;
text-indent: 70px;
}
@media (max-width: 320px) {
width: 140px;
text-indent: 60px;
}
}
@media (max-width: 414px) {
height: 90px;
margin-top: 15px;
}
@media (max-width: 320px) {
height: 85px;
margin-top: 10px;
}
input:focus,
input:active,
input:hover {
color: var(--navy);
text-indent: 5px;
background: var(--bright-white);
&::-webkit-input-placeholder {
color: var(--light-steel);
}
+ label {
color: var(--bright-white);
background: var(--dark-teal);
transform: translateY(-40px);
&:after {
border-top: 3px solid rgba(20, 204, 143, 1);
}
}
}
`;
const SizeInput = ({ onChangeField, width, height }) => {
const [deviceWidth, setDeviceWidth] = useState(width);
const [valueChange, setValueChange] = useState(false);
useEffect(() => {
const currentWidth = window.innerWidth;
setDeviceWidth(currentWidth);
if (deviceWidth <= width) {
onChangeField({ key: "canvasWidth", value: `${deviceWidth}` });
onChangeField({ key: "canvasHeight", value: `${deviceWidth}`*0.6 });
};
}, [width, deviceWidth, onChangeField, ])
const onChange = (e) => {
setValueChange(true);
const value = e.target.value;
const name = e.target.name;
value < deviceWidth ?
onChangeField({ key: name, value: value }) :
onChangeField({ key: name, value: deviceWidth });
};
return (
<StyledBlock>
<span>
<input id="width" type="number" value={valueChange ? width : ""} max={deviceWidth} placeholder={width} onChange={onChange} name="canvasWidth"/>
<label htmlFor="width">width</label>
</span>
<span>
<input id="height" type="number" placeholder={height} onChange={onChange} name="canvasHeight"/>
<label htmlFor="height">height</label>
</span>
</StyledBlock>
)
}
export default SizeInput; | 29.834586 | 160 | 0.502268 |
28d8ab8bc03d503f0233df4a89ac50e2e6ff390a | 3,896 | js | JavaScript | node_modules/element-plus/lib/el-radio-group/index.js | louisyoungx/rocket | 18af492f7401e8a5f804337dc759a498dae688f2 | [
"MIT"
] | null | null | null | node_modules/element-plus/lib/el-radio-group/index.js | louisyoungx/rocket | 18af492f7401e8a5f804337dc759a498dae688f2 | [
"MIT"
] | null | null | null | node_modules/element-plus/lib/el-radio-group/index.js | louisyoungx/rocket | 18af492f7401e8a5f804337dc759a498dae688f2 | [
"MIT"
] | null | null | null | import { ref, inject, computed, provide, reactive, toRefs, watch, onMounted, nextTick, openBlock, createBlock, renderSlot } from 'vue';
import { EVENT_CODE } from '../utils/aria';
import { UPDATE_MODEL_EVENT } from '../utils/constants';
import { isValidComponentSize } from '../utils/validators';
import { elFormItemKey } from '../el-form';
const radioGroupKey = 'RadioGroup';
var script = {
name: 'ElRadioGroup',
componentName: 'ElRadioGroup',
props: {
modelValue: {
type: [Boolean, String, Number],
default: '',
},
size: {
type: String,
validator: isValidComponentSize,
},
fill: {
type: String,
default: '',
},
textColor: {
type: String,
default: '',
},
disabled: Boolean,
},
emits: [UPDATE_MODEL_EVENT, 'change'],
setup(props, ctx) {
const radioGroup = ref(null);
const elFormItem = inject(elFormItemKey, {});
const radioGroupSize = computed(() => {
return props.size || elFormItem.size;
});
const changeEvent = value => {
ctx.emit(UPDATE_MODEL_EVENT, value);
nextTick(() => {
ctx.emit('change', value);
});
};
provide(radioGroupKey, reactive(Object.assign(Object.assign({ name: 'ElRadioGroup' }, toRefs(props)), { radioGroupSize: radioGroupSize, changeEvent: changeEvent })));
watch(() => props.modelValue, val => {
var _a;
(_a = elFormItem.formItemMitt) === null || _a === void 0 ? void 0 : _a.emit('el.form.change', [val]);
});
const handleKeydown = e => {
const target = e.target;
const className = target.nodeName === 'INPUT' ? '[type=radio]' : '[role=radio]';
const radios = radioGroup.value.querySelectorAll(className);
const length = radios.length;
const index = Array.from(radios).indexOf(target);
const roleRadios = radioGroup.value.querySelectorAll('[role=radio]');
let nextIndex = null;
switch (e.code) {
case EVENT_CODE.left:
case EVENT_CODE.up:
e.stopPropagation();
e.preventDefault();
nextIndex = index === 0 ? length - 1 : index - 1;
break;
case EVENT_CODE.right:
case EVENT_CODE.down:
e.stopPropagation();
e.preventDefault();
nextIndex = (index === (length - 1)) ? 0 : index + 1;
break;
}
if (nextIndex === null)
return;
roleRadios[nextIndex].click();
roleRadios[nextIndex].focus();
};
onMounted(() => {
const radios = radioGroup.value.querySelectorAll('[type=radio]');
const firstLabel = radios[0];
if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) {
firstLabel.tabIndex = 0;
}
});
return {
handleKeydown,
radioGroupSize,
radioGroup,
};
},
};
function render(_ctx, _cache, $props, $setup, $data, $options) {
return (openBlock(), createBlock("div", {
ref: "radioGroup",
class: "el-radio-group",
role: "radiogroup",
onKeydown: _cache[1] || (_cache[1] = (...args) => ($setup.handleKeydown(...args)))
}, [
renderSlot(_ctx.$slots, "default")
], 544 /* HYDRATE_EVENTS, NEED_PATCH */))
}
script.render = render;
script.__file = "packages/radio/src/radio-group.vue";
script.install = (app) => {
app.component(script.name, script);
};
export default script;
| 35.418182 | 175 | 0.515657 |
28daac92b89406915b55c58c06f98a79365205d0 | 101 | js | JavaScript | node_modules/@antv/adjust/bundler/data/template.js | lsabella/baishu-admin | 4fa931a52ec7c6990daf1cec7aeea690bb3aa68a | [
"MIT"
] | 1 | 2020-03-09T06:14:02.000Z | 2020-03-09T06:14:02.000Z | node_modules/@antv/adjust/bundler/data/template.js | lsabella/baishu-admin | 4fa931a52ec7c6990daf1cec7aeea690bb3aa68a | [
"MIT"
] | 34 | 2020-09-28T07:24:42.000Z | 2022-02-26T14:29:57.000Z | node_modules/@antv/adjust/bundler/data/template.js | lsabella/baishu-admin | 4fa931a52ec7c6990daf1cec7aeea690bb3aa68a | [
"MIT"
] | 1 | 2021-09-17T01:53:58.000Z | 2021-09-17T01:53:58.000Z | module.exports = blocks => `
const adjust = require('./core');
${blocks}
module.exports = adjust;
`;
| 16.833333 | 33 | 0.653465 |
28db500eb9134591f57e4ecaa24ad8b8fbf14eaa | 149 | js | JavaScript | packages/augur-ui/src/modules/markets/selectors/__mocks__/market.js | autun12/augur | 71ec78e09c1bba3ef15a9f90336edc78c76b5c9e | [
"MIT"
] | null | null | null | packages/augur-ui/src/modules/markets/selectors/__mocks__/market.js | autun12/augur | 71ec78e09c1bba3ef15a9f90336edc78c76b5c9e | [
"MIT"
] | null | null | null | packages/augur-ui/src/modules/markets/selectors/__mocks__/market.js | autun12/augur | 71ec78e09c1bba3ef15a9f90336edc78c76b5c9e | [
"MIT"
] | null | null | null | const market = jest.genMockFromModule("modules/markets/selectors/market");
market.selectMarket = jest.fn(value => value);
module.exports = market;
| 24.833333 | 74 | 0.765101 |
28db693576c218d3ca6ec4786a51139e8ba9e821 | 633 | js | JavaScript | front/assets/src/utils/cookies.js | aurmeneta/ramos-uc | 364ab3c5a55032ab7ffc08665a2da4c5ff04ae58 | [
"MIT"
] | 7 | 2021-07-14T18:13:35.000Z | 2021-11-21T20:10:54.000Z | front/assets/src/utils/cookies.js | aurmeneta/ramos-uc | 364ab3c5a55032ab7ffc08665a2da4c5ff04ae58 | [
"MIT"
] | 57 | 2021-07-10T01:31:56.000Z | 2022-01-14T02:02:58.000Z | front/assets/src/utils/cookies.js | aurmeneta/ramos-uc | 364ab3c5a55032ab7ffc08665a2da4c5ff04ae58 | [
"MIT"
] | 4 | 2021-07-23T16:51:55.000Z | 2021-08-31T02:41:41.000Z | // Set value of cookie and time to expire in days
const setCookie = (cname, cvalue, exdays) => {
var expire_date = new Date()
expire_date.setTime(expire_date.getTime() + (exdays * 24 * 60 * 60 * 1000))
var expires = `expires=${expire_date.toUTCString()}`
document.cookie = `${cname}=${cvalue};${expires};path=/;SameSite=Lax`
}
// Get the value of a cookie by name, or empty string if not exists
const getCookie = cname => {
const cookie_regrex = `${cname}=(?<value>[^;]*?)(;|$)`
const match = document.cookie.match(cookie_regrex)
return match ? match.groups.value : ""
}
export { setCookie, getCookie }
| 37.235294 | 79 | 0.658768 |
28db72ec7d4d9ee0257f29cc7fc843c1b42df7e7 | 497 | js | JavaScript | icons/standard/document.js | andrewmurraydavid/design-system-react | d47e22dc6b27163baa5f36a717f6a1784e062ea8 | [
"BSD-3-Clause"
] | 2 | 2019-03-26T10:16:56.000Z | 2020-01-03T17:56:03.000Z | icons/standard/document.js | andrewmurraydavid/design-system-react | d47e22dc6b27163baa5f36a717f6a1784e062ea8 | [
"BSD-3-Clause"
] | 6 | 2020-06-19T18:24:08.000Z | 2022-02-13T14:37:27.000Z | icons/standard/document.js | andrewmurraydavid/design-system-react | d47e22dc6b27163baa5f36a717f6a1784e062ea8 | [
"BSD-3-Clause"
] | 3 | 2019-09-26T07:53:34.000Z | 2022-02-10T23:11:17.000Z | /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
export default {"viewBox":"0 0 24 24","xmlns":"http://www.w3.org/2000/svg","path":{"d":"M17.5 10.1h-3.3c-.8 0-1.5-.7-1.5-1.5V5.3c0-.3-.2-.5-.5-.5H7.4c-.8 0-1.4.6-1.4 1.4v11.6c0 .8.6 1.4 1.4 1.4h9.2c.8 0 1.4-.6 1.4-1.4v-7.2c0-.3-.2-.5-.5-.5zm.4-2l-3.2-3.2c0-.1-.1-.1-.2-.1-.2 0-.3.1-.3.3v2.6c0 .5.4.9.9.9h2.6c.2 0 .3-.1.3-.3 0-.1 0-.2-.1-.2z"}};
| 82.833333 | 344 | 0.587525 |
28dbd642ac1dd2a1400eb81fd53ec6610a8ad85e | 1,287 | js | JavaScript | react/features/mobile/proximity/middleware.js | citygxoxo/jitsi-meet | 6be2a8575fff43e49a2f49f2fe7581ab1a1c2524 | [
"Apache-2.0"
] | 18,615 | 2015-01-03T18:52:40.000Z | 2022-03-31T17:20:31.000Z | react/features/mobile/proximity/middleware.js | citygxoxo/jitsi-meet | 6be2a8575fff43e49a2f49f2fe7581ab1a1c2524 | [
"Apache-2.0"
] | 7,805 | 2015-01-07T16:45:36.000Z | 2022-03-31T15:50:40.000Z | react/features/mobile/proximity/middleware.js | citygxoxo/jitsi-meet | 6be2a8575fff43e49a2f49f2fe7581ab1a1c2524 | [
"Apache-2.0"
] | 6,887 | 2015-01-13T08:55:48.000Z | 2022-03-30T23:17:39.000Z | import { NativeModules } from 'react-native';
import { getCurrentConference } from '../../base/conference';
import { StateListenerRegistry } from '../../base/redux';
/**
* State listener which enables / disables the proximity sensor based on the
* current conference state. If the proximity sensor is enabled, it will dim
* the screen and disable touch controls when an object is nearby. The
* functionality is enabled when the current audio device is the earpiece.
*/
StateListenerRegistry.register(
/* selector */ state => {
const { devices } = state['features/mobile/audio-mode'];
const selectedDevice = devices.filter(d => d.selected)[0];
const conference = getCurrentConference(state);
return Boolean(conference && selectedDevice?.type === 'EARPIECE');
},
/* listener */ proximityEnabled => _setProximityEnabled(proximityEnabled)
);
/**
* Enables / disables the proximity sensor. If the proximity sensor is enabled,
* it will dim the screen and disable touch controls when an object is nearby.
*
* @param {boolean} enabled - True to enable the proximity sensor or false to
* disable it.
* @private
* @returns {void}
*/
function _setProximityEnabled(enabled) {
NativeModules.Proximity.setEnabled(Boolean(enabled));
}
| 36.771429 | 79 | 0.71251 |
28dbf2d7b18e4e368db9dfe7140deeccefb808f2 | 6,158 | js | JavaScript | e2e/start-exploring.spec.js | rectinajh/metamask-mobile | 243cf80cbcba5fe9bd16f4772a53915170a49b8a | [
"MIT"
] | 2 | 2021-02-03T09:02:46.000Z | 2021-07-07T21:28:47.000Z | e2e/start-exploring.spec.js | cusomeday/metamask-mobile | efc39fb6c794fe574fcf33fc2f71b2a069ecc4e7 | [
"MIT"
] | 28 | 2021-03-02T07:33:54.000Z | 2022-03-29T18:38:45.000Z | e2e/start-exploring.spec.js | cusomeday/metamask-mobile | efc39fb6c794fe574fcf33fc2f71b2a069ecc4e7 | [
"MIT"
] | 1 | 2021-02-18T11:22:37.000Z | 2021-02-18T11:22:37.000Z | 'use strict';
import TestHelpers from './helpers';
const ACCOUNT = 'Test Account One';
const PASSWORD = '12345678';
describe('Start Exploring', () => {
beforeEach(() => {
jest.setTimeout(150000);
});
it('should show the onboarding screen', async () => {
// Check that we are on the onboarding carousel screen
await TestHelpers.checkIfVisible('onboarding-carousel-screen');
// Check that title of screen 1 is correct
await TestHelpers.checkIfElementHasString('carousel-screen-one', 'Welcome to MetaMask');
// Check that right image is displayed
await TestHelpers.checkIfVisible('carousel-one-image');
// Swipe left
await TestHelpers.swipe('onboarding-carousel-screen', 'left');
// Check that title of screen 2 is correct
await TestHelpers.checkIfElementHasString('carousel-screen-two', 'Say hello to your wallet...');
// Check that right image is displayed
await TestHelpers.checkIfVisible('carousel-two-image');
// Swipe left
await TestHelpers.swipe('onboarding-carousel-screen', 'left');
// Check that title of screen 3 is correct
await TestHelpers.checkIfElementHasString('carousel-screen-three', 'Explore decentralized apps');
// Check that right image is displayed
await TestHelpers.checkIfVisible('carousel-three-image');
// Check that Get started CTA is visible & tap it
await TestHelpers.waitAndTap('onboarding-get-started-button');
// Check that we are on the onboarding screen
await TestHelpers.checkIfVisible('onboarding-screen');
// Check that the title is correct
await TestHelpers.checkIfElementHasString('onboarding-screen-title', 'Get started!');
});
it('should allow you to create a new wallet', async () => {
// Check that Create a new wallet CTA is visible & tap it
await TestHelpers.waitAndTap('create-wallet-button');
// Check that we are on the Create password screen
await TestHelpers.checkIfVisible('create-password-screen');
// Input new password
await TestHelpers.typeTextAndHideKeyboard('input-password', PASSWORD);
// Input confirm password
await TestHelpers.typeTextAndHideKeyboard('input-password-confirm', PASSWORD);
// Mark the checkbox that you understand the password cannot be recovered
if (device.getPlatform() === 'ios') {
await TestHelpers.tap('password-understand-box');
} else {
// Tap by the I understand text
await TestHelpers.delay(1000);
await TestHelpers.tap('i-understand-text');
}
// Tap on create password button
await TestHelpers.tap('submit-button');
// Check that we are on the Secure your wallet screen
await TestHelpers.checkIfVisible('protect-your-account-screen');
// Tap on the remind me later button
await TestHelpers.tap('remind-me-later-button');
// Check the box to state you understand
if (device.getPlatform() === 'ios') {
await TestHelpers.tap('skip-backup-check');
} else {
// Tap by the I understand text
await TestHelpers.delay(1000);
await TestHelpers.tap('skip-backup-text');
}
// Tap on Skip button
await TestHelpers.tapByText('Skip');
// Check that we are on the metametrics optIn screen
await TestHelpers.checkIfVisible('metaMetrics-OptIn');
});
it('should tap I Agree and land on the wallet view with tutorial open', async () => {
// Check that I Agree CTA is visible and tap it
await TestHelpers.waitAndTap('agree-button');
// Check that we are on the wallet screen
if (!device.getPlatform() === 'android') {
await TestHelpers.checkIfExists('wallet-screen');
}
// Check that the onboarding wizard is present
await TestHelpers.checkIfVisible('onboarding-wizard-step1-view');
});
it('should go through the onboarding wizard flow', async () => {
// Check that Take the tour CTA is visible and tap it
await TestHelpers.waitAndTap('onboarding-wizard-next-button');
// Ensure step 2 is shown correctly
await TestHelpers.checkIfVisible('step2-title');
// Check that Got it! CTA is visible and tap it
await TestHelpers.tapByText('Got it!');
// Ensure step 3 is shown correctly
await TestHelpers.checkIfVisible('step3-title');
// Focus into account 1 name
await TestHelpers.tapAndLongPress('account-label');
// Clear text
await TestHelpers.clearField('account-label-text-input');
// Change account name
if (device.getPlatform() === 'android') {
await TestHelpers.replaceTextInField('account-label-text-input', ACCOUNT);
await element(by.id('account-label-text-input')).tapReturnKey();
} else {
await TestHelpers.typeTextAndHideKeyboard('account-label-text-input', ACCOUNT);
}
// Check that Got it! CTA is visible and tap it
if (!device.getPlatform() === 'android') {
await TestHelpers.tapByText('Got it!');
}
await TestHelpers.tapByText('Got it!');
// Check that the account name edit stuck
await TestHelpers.checkIfElementHasString('account-label-text-input', ACCOUNT);
// Ensure step 4 is shown correctly
await TestHelpers.checkIfVisible('step4-title');
// Tap on the menu navigation
await TestHelpers.waitAndTap('hamburger-menu-button-wallet-fake');
// Ensure step 5 is shown correctly
await TestHelpers.checkIfVisible('step5-title');
// Tap on Back
await TestHelpers.tapByText('Back');
// Ensure step 4 is shown correctly
await TestHelpers.checkIfVisible('step4-title');
// Check that Got it! CTA is visible and tap it
await TestHelpers.tapByText('Got it!');
// Ensure step 5 is shown correctly
await TestHelpers.checkIfVisible('step5-title');
// Check that Got it! CTA is visible and tap it
await TestHelpers.tapByText('Got it!');
// Ensure step 6 is shown correctly
await TestHelpers.checkIfVisible('step6-title');
// Tap on Back
await TestHelpers.tapByText('Back');
// Ensure step 5 is shown correctly
await TestHelpers.checkIfVisible('step5-title');
// Check that Got it! CTA is visible and tap it
await TestHelpers.tapByText('Got it!');
// Ensure step 6 is shown correctly
await TestHelpers.checkIfVisible('step6-title');
// Check that Got it! CTA is visible and tap it
await TestHelpers.tapByText('Got it!');
// Check that we are on the Browser page
await TestHelpers.checkIfVisible('browser-screen');
});
});
| 42.178082 | 99 | 0.727996 |
28dbf916d3e99fca65ad485d174948ded3fc0a48 | 647 | js | JavaScript | index.js | q-nick/eslint-plugin-ultimate-typescript-config | 7a5fb9e7cf454ab976f21dd7d6fb1366db580f86 | [
"MIT"
] | 2 | 2021-11-04T19:36:38.000Z | 2021-12-11T09:26:21.000Z | index.js | q-nick/eslint-plugin-ultimate-typescript-config | 7a5fb9e7cf454ab976f21dd7d6fb1366db580f86 | [
"MIT"
] | 1 | 2022-01-20T07:10:30.000Z | 2022-01-21T07:10:49.000Z | index.js | q-nick/eslint-config-turbocharge | 7a5fb9e7cf454ab976f21dd7d6fb1366db580f86 | [
"MIT"
] | null | null | null | const rules = require('./cross-platform-rules');
const nodeRules = require('./node');
module.exports = {
env: {
node: true,
},
plugins: ['import', 'node', 'simple-import-sort', 'unicorn'],
extends: [
'eslint:all',
'plugin:unicorn/recommended',
'plugin:node/recommended',
'prettier',
],
parserOptions: {
sourceType: 'module',
},
rules: Object.assign({}, rules.crossPlatformJSRules, {
'import/no-nodejs-modules': 'off',
'import/unambiguous': 'off',
'import/no-commonjs': 'off',
'unicorn/numeric-separators-style': 'off',
}),
overrides: [Object.assign({ files: ['*.ts'] }, nodeRules)],
};
| 24.884615 | 63 | 0.612056 |
28de331139659a915cd6c342c9d8a3716a6f3e85 | 864 | js | JavaScript | dist/utils/readFileList.js | Z-HNAN/nppack | 5052dfa114d3d247b0d85dc1f5b680daff3c93d9 | [
"MIT"
] | null | null | null | dist/utils/readFileList.js | Z-HNAN/nppack | 5052dfa114d3d247b0d85dc1f5b680daff3c93d9 | [
"MIT"
] | null | null | null | dist/utils/readFileList.js | Z-HNAN/nppack | 5052dfa114d3d247b0d85dc1f5b680daff3c93d9 | [
"MIT"
] | null | null | null | "use strict";
/**
* 递归读取文件
*/
const tslib_1 = require("tslib");
const fs = tslib_1.__importStar(require("fs"));
const path = tslib_1.__importStar(require("path"));
function readFileList(
/* eslint-disable-next-line */
{ dir, deep, filter = (file) => true }) {
let files = [];
const fileList = fs.readdirSync(dir);
fileList.forEach(file => {
const fileFullPath = path.join(dir, file);
const fileState = fs.statSync(fileFullPath);
if (fileState.isDirectory() && deep === true) {
// 递归读取目录
files = [
...files,
...readFileList({ dir: fileFullPath, deep, filter }),
];
}
else if (filter(fileFullPath) === true) {
// 满足过滤状况则进行填充
files.push(fileFullPath);
}
});
return files;
}
module.exports = readFileList;
| 27.870968 | 69 | 0.553241 |
28de6aa94cc3d159b0ffaaf2f612b506ed47e09c | 20,199 | js | JavaScript | test/unit/zendesk-uploader/section-uploader.js | rakutentech/docpub | f55676e88d3ffaffcfa192c1a2348a31d78dfe39 | [
"MIT"
] | 12 | 2017-03-14T03:14:49.000Z | 2019-06-04T17:59:55.000Z | test/unit/zendesk-uploader/section-uploader.js | rakutentech/docpub | f55676e88d3ffaffcfa192c1a2348a31d78dfe39 | [
"MIT"
] | 45 | 2017-03-15T06:24:17.000Z | 2017-05-15T12:51:53.000Z | test/unit/zendesk-uploader/section-uploader.js | rakutentech/docpub | f55676e88d3ffaffcfa192c1a2348a31d78dfe39 | [
"MIT"
] | 8 | 2017-03-16T02:08:29.000Z | 2021-12-27T13:24:26.000Z | const SectionUploader = require('../../../lib/zendesk-uploader/section-uploader');
const ArticleUploader = require('../../../lib/zendesk-uploader/article-uploader');
const logger = require('../../../lib/logger');
const testUtils = require('../test-utils');
describe('SectionUploader', () => {
const sandbox = sinon.sandbox.create();
let zendeskClient;
beforeEach(() => {
zendeskClient = {
sections: {
create: sandbox.stub().resolves({id: 123456, position: 2}),
update: sandbox.stub().resolves()
},
translations: {
updateForSection: sandbox.stub().resolves({id: 54321})
},
accesspolicies: {
update: sandbox.stub().resolves()
}
};
sandbox.stub(ArticleUploader.prototype, 'create').resolves();
sandbox.stub(ArticleUploader.prototype, 'sync').resolves();
sandbox.stub(logger, 'info');
});
afterEach(() => {
sandbox.restore();
});
describe('create', () => {
it('should create a section if it doesnt exist', () => {
const section = testUtils.createDummySection({isNew: true});
const uploader = createUploader_(section);
return uploader.create()
.then(() => {
expect(zendeskClient.sections.create)
.to.have.been.called;
});
});
it('should log create section action if section does not exist', () => {
const section = testUtils.createDummySection({isNew: true, path: 'category/path'});
const uploader = createUploader_(section);
return uploader.create()
.then(() => {
expect(logger.info)
.to.have.been.calledWith(`Creating new section on ZenDesk: category/path`);
});
});
it('should not create the section if it already exists', () => {
const section = testUtils.createDummySection({isNew: false});
const uploader = createUploader_(section);
return uploader.create()
.then(() => {
expect(zendeskClient.sections.create)
.to.not.have.been.called;
});
});
it('should not log create section action if already exists', () => {
const section = testUtils.createDummySection({isNew: false});
const uploader = createUploader_(section);
return uploader.create()
.then(() => {
expect(logger.info)
.to.have.been.not.called;
});
});
it('should reject the promise when the create sections API returns an error', () => {
const section = testUtils.createDummySection({isNew: true});
const uploader = createUploader_(section);
const error = new Error('error');
zendeskClient.sections.create.rejects(error);
return expect(uploader.create()).to.be.rejectedWith(error);
});
it('should set `locale` metadata to the request', () => {
const section = testUtils.createDummySection({
isNew: true,
meta: {locale: 'test-locale'}
});
const uploader = createUploader_(section);
return uploader.create()
.then(() => {
expect(zendeskClient.sections.create)
.to.have.been.calledWith(sinon.match.any, {
section: sinon.match({
locale: 'test-locale'
})
});
});
});
it('should update the sections zendeskId meta property', () => {
const section = testUtils.createDummySection({isNew: true});
const uploader = createUploader_(section);
zendeskClient.sections.create.resolves({id: 123456, position: 42});
return uploader.create()
.then(() => {
expect(uploader.meta.update)
.to.have.been.calledWith({zendeskId: 123456});
});
});
it('should write the metadata after it has been updated', () => {
const section = testUtils.createDummySection({isNew: true});
const uploader = createUploader_(section);
zendeskClient.sections.create.resolves({id: 123456, position: 42});
return uploader.create()
.then(() => {
expect(uploader.meta.write)
.to.have.been.calledAfter(uploader.meta.update);
});
});
it('should create each article passed in the `articles` array', () => {
const section = testUtils.createDummySection();
const uploader = createUploader_(section);
section.sections = [
testUtils.createDummyArticle({section: section}),
testUtils.createDummyArticle({section: section})
];
return uploader.create()
.then(() => {
expect(ArticleUploader.prototype.create)
.to.have.been.calledTwice;
});
});
it('should not create any articles if no articles were provided', () => {
const section = testUtils.createDummySection({articles: []});
const uploader = createUploader_(section);
return uploader.create()
.then(() => {
expect(ArticleUploader.prototype.create)
.to.not.have.been.called;
});
});
it('should reject with an error if an article upload returns an error', () => {
const section = testUtils.createDummySection({isNew: true});
const uploader = createUploader_(section);
const error = new Error('error');
ArticleUploader.prototype.create.rejects(error);
return expect(uploader.create()).to.be.rejectedWith(error);
});
});
describe('sync', () => {
describe('section update', () => {
it('should update a section if it has been changed', () => {
const section = testUtils.createDummySection({isChanged: true});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.sections.update)
.to.have.been.called;
});
});
it('should log update section action if section has been changed', () => {
const section = testUtils.createDummySection({isChanged: true, path: 'section/path'});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(logger.info)
.to.have.been.calledWith('Synchronizing section on ZenDesk: section/path');
});
});
it('should not update a section if it has not been changed', () => {
const section = testUtils.createDummySection({isChanged: false});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.sections.update)
.to.not.have.been.called;
});
});
it('should not log update section action if section has not been changed', () => {
const section = testUtils.createDummySection({isChanged: false});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(logger.info)
.to.have.been.not.called;
});
});
it('should reject the promise when the update section update API returns an error', () => {
const section = testUtils.createDummySection({isChanged: true});
const uploader = createUploader_(section);
const error = new Error('error');
zendeskClient.sections.update.rejects(error);
return expect(uploader.sync())
.to.be.rejectedWith(error);
});
it('should update the correct section zendeskId', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {zendeskId: 12345}
});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.sections.update)
.to.have.been.calledWithMatch(12345);
});
});
it('should set the section `position` to the request if one is provided', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {position: 42}
});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.sections.update)
.to.have.been.calledWith(sinon.match.any, {
section: sinon.match({
position: 42
})
});
});
});
});
describe('translations update', () => {
it('should update the translation if a section has changed', () => {
const section = testUtils.createDummySection({isChanged: true});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.translations.updateForSection)
.to.have.been.called;
});
});
it('should not update the translation if a section has not changed', () => {
const section = testUtils.createDummySection({isChanged: false});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.translations.updateForSection)
.to.not.have.been.called;
});
});
it('should reject the promise when the translations API returns an error', () => {
const section = testUtils.createDummySection({isChanged: true});
const uploader = createUploader_(section);
const error = new Error('error');
zendeskClient.translations.updateForSection.rejects(error);
return expect(uploader.sync()).to.be.rejectedWith(error);
});
it('should update the translation for the correct zendeskId', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {zendeskId: 12345}
});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.translations.updateForSection)
.to.have.been.calledWithMatch(12345);
});
});
it('should update the translation for the correct locale', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {locale: 'test-locale'}
});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.translations.updateForSection)
.to.have.been.calledWithMatch(sinon.match.any, 'test-locale');
});
});
it('should set the locale to the request', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {locale: 'test-locale'}
});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.translations.updateForSection)
.to.have.been.calledWithMatch(sinon.match.any, sinon.match.any, {
translation: sinon.match({
locale: 'test-locale'
})
});
});
});
it('should set the section description to the request if one is provided', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {description: 'Description goes here'}
});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.translations.updateForSection)
.to.have.been.calledWithMatch(sinon.match.any, sinon.match.any, {
translation: sinon.match({
body: 'Description goes here'
})
});
});
});
});
describe('access policy', () => {
it('should set the access policy for the correct section id', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {
zendeskId: 12345,
viewableBy: 'everyone',
manageableBy: 'everyone'
}
});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.accesspolicies.update)
.to.have.been.calledWith(12345, sinon.match.any);
});
});
it('should reject the promise with an error if the accesspolicies api returns an error', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {
viewableBy: 'everyone',
manageableBy: 'everyone'
}
});
const uploader = createUploader_(section);
const error = new Error('error');
zendeskClient.accesspolicies.update.rejects(error);
return expect(uploader.sync()).to.be.rejectedWith(error);
});
it('should set the `viewable_by` property to the request', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {
viewableBy: 'staff'
}
});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.accesspolicies.update)
.to.have.been.calledWithMatch(sinon.match.any, {
'access_policy': sinon.match({
'viewable_by': 'staff'
})
});
});
});
it('should set the `manageable_by` property to the request', () => {
const section = testUtils.createDummySection({
isChanged: true,
meta: {
manageableBy: 'everyone'
}
});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(zendeskClient.accesspolicies.update)
.to.have.been.calledWithMatch(sinon.match.any, {
'access_policy': sinon.match({
'manageable_by': 'everyone'
})
});
});
});
});
describe('hash', () => {
it('should update section hash after updating section if section was changed', () => {
const section = testUtils.createDummySection({isChanged: true});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(section.updateHash).to.be.calledOnce;
});
});
it('should reject if failed to update section hash', () => {
const section = testUtils.createDummySection({isChanged: true});
const uploader = createUploader_(section);
const error = new Error('error');
section.updateHash.rejects(error);
return expect(uploader.sync())
.to.be.rejectedWith(error);
});
it('should not update section hash if section has not been changed', () => {
const section = testUtils.createDummySection({isChanged: false});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(section.updateHash).to.be.not.called;
});
});
});
describe('article sync', () => {
it('should sync each article passed in the `articles` array', () => {
const section = testUtils.createDummySection();
const uploader = createUploader_(section);
section.sections = [
testUtils.createDummyArticle({section: section}),
testUtils.createDummyArticle({section: section})
];
return uploader.sync()
.then(() => {
expect(ArticleUploader.prototype.sync)
.to.have.been.calledTwice;
});
});
it('should not sync any articles if no articles were provided', () => {
const section = testUtils.createDummySection({articles: []});
const uploader = createUploader_(section);
return uploader.sync()
.then(() => {
expect(ArticleUploader.prototype.sync)
.to.not.have.been.called;
});
});
it('should reject with an error if an article sync returns an error', () => {
const section = testUtils.createDummySection();
const uploader = createUploader_(section);
const error = new Error('error');
ArticleUploader.prototype.sync.rejects(error);
return expect(uploader.sync()).to.be.rejectedWith(error);
});
});
});
function createUploader_(category) {
const config = testUtils.createDummyConfig();
return new SectionUploader(category, config, zendeskClient);
}
});
| 39.297665 | 108 | 0.472598 |
28dea2d68b33764316f951c427154d86a9e68a6c | 3,997 | js | JavaScript | frontend/web/src/js/components/animation.js | MaKonstLP/pmnetwork | 9f06bdff774b4fcad0af07b3aacba9e799709f22 | [
"BSD-3-Clause"
] | 1 | 2020-02-17T11:38:23.000Z | 2020-02-17T11:38:23.000Z | frontend/web/src/js/components/animation.js | MaKonstLP/pmnetwork | 9f06bdff774b4fcad0af07b3aacba9e799709f22 | [
"BSD-3-Clause"
] | 1 | 2020-09-17T16:22:56.000Z | 2020-09-17T16:22:56.000Z | frontend/web/src/js/components/animation.js | MaKonstLP/pmnetwork | 9f06bdff774b4fcad0af07b3aacba9e799709f22 | [
"BSD-3-Clause"
] | null | null | null | export default class Animation {
checkTarget(target) {
if (target == undefined) return false;
if ( !(target instanceof Element) && !(target instanceof $) && typeof target !== 'string') return false;
var $target = $(target);
if ($target.length == 0) return false;
return $target;
}
fadeIn(target, options = {from,to,duration},callback) {
options.direction = 'in';
this.fade(target, options,callback);
}
fadeOut(target, options = {from,to,duration},callback) {
options.direction = 'out';
this.fade(target,options,callback);
}
fade(target, options, callback ) {
var $target = this.checkTarget(target);
if (!$target) return false;
let params = {
from: 1,
to: 0,
duration: 200,
}
if (typeof options == 'function')
callback = options;
callback = typeof callback === 'function' ? callback : function () {};
Object.assign(params, options);
params.duration = String(params.duration / 1000) + 's';
if (params.direction === 'in')
params.from = [params.to, params.to = params.from][0];
$target.css({
'opacity': params.from,
'transition-duration' : params.duration,
'transition-property': 'opacity',
'transition-timing-function': 'ease'
});
function end() {
$target.off('transitionend',end);
$target.removeAttr('style');
callback();
}
raf(function() {
$target.css({
'opacity': params.to
});
});
$target.on('transitionend',end);
}
slideUp(target, options = {duration,addHidden},callback) {
options.direction = 'up';
this.slide(target, options,callback);
}
slideDown(target, options = {duration,removeStyle},callback) {
options.direction = 'down';
this.slide(target,options,callback);
}
slide(target, options, callback ) {
var $target = this.checkTarget(target);
if (!$target) return false;
let params = {
start:0,
end:0,
duration: 200,
removeStyle: false,
addHidden: false
}
if (typeof options == 'function')
callback = options;
callback = typeof callback === 'function' ? callback : function () {};
Object.assign(params, options);
params.duration = String(params.duration / 1000) + 's';
$target.css({
'overflow': 'hidden',
'height': params.start,
'transition-duration': params.duration,
'transition-property': 'height',
'transition-timing-function': 'ease'
});
function end() {
$target.off('transitionend',end);
// if (params.removeStyle || options.direction == 'up')
$target.removeAttr('style');
if (params.addHidden)
$target.addClass('hidden');
callback();
}
// if(params.play !== false) {
raf(function() {
$target.css({
'height': params.end
});
});
// }
$target.on('transitionend',end);
}
play(target, style, callback){
callback = callback || function() {};
var add = function() {
target.addClass(style + '-play');
}
target.addClass(style + '-start');
var rem = function() {
target.off('animationend', rem);
target.removeClass(style + '-start');
target.removeClass(style + '-play');
callback();
}
raf(add);
target.on('animationend', rem);
}
}
| 27.565517 | 113 | 0.491369 |
28dec23b1fdd8404865c54840b22a9fc7f8d6389 | 2,750 | js | JavaScript | js/createAccountController.js | oxypomme/IUT-InfoNews | 8a16754f9415836e1e6bf8e7b0464cc068d54b01 | [
"MIT"
] | 2 | 2021-12-15T14:50:25.000Z | 2021-12-15T14:50:56.000Z | js/createAccountController.js | oxypomme/IUT-InfoNews | 8a16754f9415836e1e6bf8e7b0464cc068d54b01 | [
"MIT"
] | null | null | null | js/createAccountController.js | oxypomme/IUT-InfoNews | 8a16754f9415836e1e6bf8e7b0464cc068d54b01 | [
"MIT"
] | 1 | 2020-10-19T11:14:23.000Z | 2020-10-19T11:14:23.000Z | const trads = new Trads(false);
function validate() {
var result = true;
if (!document.forms["redactor"].lname || !document.forms["redactor"].lname.value.match(/^.{3,}$/)) {
result = false;
document.getElementById("lname").innerHTML = trads.getTrad('lnameError');
} else
document.getElementById("lname").innerHTML = "";
if (!document.forms["redactor"].fname || !document.forms["redactor"].fname.value.match(/^.{3,}$/)) {
result = false;
document.getElementById("fname").innerHTML = trads.getTrad('fnameError');
} else
document.getElementById("fname").innerHTML = "";
if (!document.forms["redactor"].login || !document.forms["redactor"].login.value.match(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+\.([a-zA-Z0-9-]+){2,4}$/)) {
result = false;
document.getElementById("login").innerHTML = trads.getTrad('loginError');
} else
document.getElementById("login").innerHTML = "";
if (!document.forms["redactor"].passwd || !document.forms["redactor"].passwd.value.match(/^.{6,}$/)) {
result = false;
document.getElementById("passwd").innerHTML = trads.getTrad('passwdLengthError');
} else
document.getElementById("passwd").innerHTML = "";
return result;
}
function checkPassword() {
if (document.forms["redactor"].passwd) {
var score = getPasswordScore(document.forms["redactor"].passwd.value);
document.getElementById("passwordStrenghBar").value = score;
if (score >= 45 && score < 80)
document.getElementById("passwordStrengh").innerHTML = trads.getTrad('mid');
else if (score >= 80)
document.getElementById("passwordStrengh").innerHTML = trads.getTrad('strong');
else
document.getElementById("passwordStrengh").innerHTML = trads.getTrad('weak');
} else
document.getElementById("passwordStrengh").innerHTML = trads.getTrad('invalid');
}
function getPasswordScore(password) {
var score = 0;
if (!password)
return score;
// add score for each characters only if there's not more than one of it
var chars = new Array();
for (var i = 0; i < password.length; i++) {
chars[password[i]] = (chars[password[i]] || 0) + 1;
score += 3.0 / chars[password[i]];
}
// add score if the pass word contain specific chars
var verifications = {
digits: /\d/.test(password),
lower: /[a-z]/.test(password),
upper: /[A-Z]/.test(password),
specialChar: /[^A-Za-z0-9]/.test(password),
noWord: /\W/.test(password)
}
for (var check in verifications)
score += (verifications[check] == true) ? 10 : 0;
return parseInt(score);
} | 39.285714 | 167 | 0.611273 |
28defe20d5355736e04b475a48d4a594fb439845 | 141 | js | JavaScript | vsdoc/toc--/t_450.js | asiboro/asiboro.github.io | a2e56607dca65eed437b6a666dcbc3f586492d8c | [
"MIT"
] | null | null | null | vsdoc/toc--/t_450.js | asiboro/asiboro.github.io | a2e56607dca65eed437b6a666dcbc3f586492d8c | [
"MIT"
] | null | null | null | vsdoc/toc--/t_450.js | asiboro/asiboro.github.io | a2e56607dca65eed437b6a666dcbc3f586492d8c | [
"MIT"
] | null | null | null | c['450']=[['451',"CardsController Constructor","topic_00000000000001B1.html",0],['452',"Methods","topic_00000000000001B0_methods--.html",1]]; | 141 | 141 | 0.744681 |
28deff25e8ce78f90a623ba58898d086f5da7933 | 403 | js | JavaScript | test/index.js | nathanfaucett/crypto | 94205c26cf94f3edca8ffd37b267dd1811373f7b | [
"MIT"
] | null | null | null | test/index.js | nathanfaucett/crypto | 94205c26cf94f3edca8ffd37b267dd1811373f7b | [
"MIT"
] | null | null | null | test/index.js | nathanfaucett/crypto | 94205c26cf94f3edca8ffd37b267dd1811373f7b | [
"MIT"
] | null | null | null | var tape = require("tape"),
crypto = require("..");
tape("crypto#randomBytes(size[, callback])", function(assert) {
assert.equal(crypto.randomBytes(32).length, 32, "should return a array of random bytes");
crypto.randomBytes(32, function(error, array) {
assert.equal(array.length, 32, "should return a array of random bytes asynchronously");
assert.end(error);
});
});
| 33.583333 | 95 | 0.662531 |
28df074e2ebc864982bc770ce411254c4f549fb1 | 1,088 | js | JavaScript | src/component.js | brabadu/tanok | 6d07b5c2232d37a694783d31767cd0019bc9ed48 | [
"MIT"
] | 29 | 2015-10-30T12:09:36.000Z | 2022-02-09T08:34:10.000Z | src/component.js | brabadu/tanok | 6d07b5c2232d37a694783d31767cd0019bc9ed48 | [
"MIT"
] | 16 | 2015-11-06T07:33:40.000Z | 2018-07-31T08:35:59.000Z | src/component.js | brabadu/tanok | 6d07b5c2232d37a694783d31767cd0019bc9ed48 | [
"MIT"
] | 22 | 2015-11-02T23:11:42.000Z | 2019-01-23T12:52:37.000Z | import React from 'react';
import PropTypes from 'prop-types';
import { StreamWrapper } from './streamWrapper.js';
/**
* Decorator used with class-based React components.
* It provides all the required props and helpers for tanok internals.
*
* Usage example:
*
* @tanokComponent
* class MyComponent extends React.Component {
* ... your component methods.
* }
*
* */
export function tanokComponent(target) {
target.propTypes = target.propTypes || {};
target.propTypes.tanokStream = PropTypes.instanceOf(StreamWrapper);
target.displayName = `TanokComponent(${target.displayName || target.name})`;
target.prototype.send = function send(action, payload, metadata = null) {
if (metadata !== null) {
console.error('Hey! You no longer can pass metadata `.send()`, use `.sub()`');
}
const stream = this.props.tanokStream;
stream.send(action, payload);
};
target.prototype.sub = function sub(name, metadata = null) {
const stream = this.props.tanokStream;
return stream && stream.subWithMeta(name, metadata);
};
return target;
}
| 27.2 | 84 | 0.690257 |
28df0ae5890032052978b8c80eb13b1d93b81902 | 621 | js | JavaScript | src/js/directives/loading.js | MishRanu/rx_health_web | 188d9d18a01c9e35cd666fcf7a42c7b7342f1156 | [
"MIT"
] | null | null | null | src/js/directives/loading.js | MishRanu/rx_health_web | 188d9d18a01c9e35cd666fcf7a42c7b7342f1156 | [
"MIT"
] | null | null | null | src/js/directives/loading.js | MishRanu/rx_health_web | 188d9d18a01c9e35cd666fcf7a42c7b7342f1156 | [
"MIT"
] | null | null | null | /**
* Loading Directive
* @see http://tobiasahlin.com/spinkit/
*/
angular
.module('RxHealth')
.directive('rdLoading', ['$timeout', rdLoading]);
function rdLoading($timeout) {
var directive = {
scope: {
loading: '=',
classes: '@?'
},
transclude : true,
restrict: 'AE',
template: '<div ng-show="loading" layout-fill layout><div layout layout-fill layout-align = "center center"><md-progress-circular md-mode="indeterminate"></md-progress-circular></div></div><div ng-hide="loading" layout-fill ng-transclude></div>'
};
return directive;
};
| 28.227273 | 253 | 0.607085 |
28dfbfdacf938ee09485b0344616e8e313a0c54b | 2,906 | js | JavaScript | src/screens/claim-screen/index.js | leonaldopasaribu/react-native-eworkplace-moonlay | 376a9321596bd8eae084659b668a09d21ab90ade | [
"MIT"
] | null | null | null | src/screens/claim-screen/index.js | leonaldopasaribu/react-native-eworkplace-moonlay | 376a9321596bd8eae084659b668a09d21ab90ade | [
"MIT"
] | null | null | null | src/screens/claim-screen/index.js | leonaldopasaribu/react-native-eworkplace-moonlay | 376a9321596bd8eae084659b668a09d21ab90ade | [
"MIT"
] | null | null | null | import React, { Component } from 'react';
import { Text, View, Image, StyleSheet, TouchableOpacity } from 'react-native';
import { Card } from 'react-native-elements';
import Coffee from '../../../image/coffee.svg';
import Aid from '../../../image/first-aid.svg';
import Clock from '../../../app/assets/icons/clock.svg'
import Money from '../../../app/assets/icons/money.svg'
export default class index extends Component {
constructor(props) {
super(props);
this.moveToDayOff = this.moveToDayOff.bind(this);
this.moveToSick = this.moveToSick.bind(this);
this.moveToReimbursement = this.moveToReimbursement.bind(this);
}
moveToDayOff() {
this.props.navigation.navigate('DayOff');
}
moveToSick() {
this.props.navigation.navigate('Sick');
}
moveToReimbursement(){
this.props.navigation.navigate('Reimbursement');
}
render() {
return (
<View style={styles.container}>
<View style={{ flex: 1, marginLeft: 25 }}>
<Text style={styles.text2}>Request</Text>
</View>
<View style={{ flex: 6, flexDirection: 'row', alignSelf: 'center' }}>
<Card containerStyle={styles.card}>
<TouchableOpacity style={styles.Button} onPress={this.moveToReimbursement}>
<Clock width={70} height={70} />
<Text style={styles.text}>Reimbursement</Text>
</TouchableOpacity>
</Card>
<Card containerStyle={styles.card}>
<TouchableOpacity style={styles.Button} onPress={this.moveToDayOff}>
<Coffee width={70} height={70} />
<Text style={styles.text}>Taking Day Off</Text>
</TouchableOpacity>
</Card>
</View>
<View style={{ flex:15, flexDirection: 'row', alignSelf: 'center' }}>
<Card containerStyle={styles.card}>
<TouchableOpacity style={styles.Button} onPress={this.moveToSick}>
<Aid width={70} height={70} />
<Text style={styles.text}>Sick Leave</Text>
</TouchableOpacity>
</Card>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F9FCFF',
},
card: {
width: 160,
height: 160,
justifyContent: 'center',
alignItems: 'center',
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
borderRadius: 7,
},
Button: {
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: '100%',
},
text: {
fontFamily: 'Nunito-Bold',
fontSize: 16,
fontWeight: '600',
marginLeft: 5,
color: '#505050',
paddingTop: 13,
},
text2: {
fontFamily: 'Nunito-Bold',
fontSize: 20,
fontWeight: '600',
marginLeft: 5,
color: '#505050',
paddingTop: 13,
},
});
| 27.415094 | 87 | 0.587749 |
28e004a1739e15e6a7dbfd813f95a61660ea2a4b | 702 | js | JavaScript | static/src/js/util/__tests__/pluralize.test.js | clynnes/earthdata-search | 75a6ef7c9053a8676c15c35548f3414e47935709 | [
"Apache-2.0"
] | null | null | null | static/src/js/util/__tests__/pluralize.test.js | clynnes/earthdata-search | 75a6ef7c9053a8676c15c35548f3414e47935709 | [
"Apache-2.0"
] | null | null | null | static/src/js/util/__tests__/pluralize.test.js | clynnes/earthdata-search | 75a6ef7c9053a8676c15c35548f3414e47935709 | [
"Apache-2.0"
] | null | null | null | import { pluralize } from '../pluralize'
describe('util#pluralize', () => {
describe('when given no value', () => {
test('returns the correct string', () => {
expect(pluralize('test')).toEqual('test')
})
})
describe('when given value of 0', () => {
test('returns the correct string', () => {
expect(pluralize('test', 0)).toEqual('tests')
})
})
describe('when given value of 1', () => {
test('returns the correct string', () => {
expect(pluralize('test', 1)).toEqual('test')
})
})
describe('when given value greater than 1', () => {
test('returns the correct string', () => {
expect(pluralize('test', 2)).toEqual('tests')
})
})
}) | 29.25 | 53 | 0.555556 |
28e01aef4c110ba061f0ef1d690a2b7fc1f73eb6 | 21,213 | js | JavaScript | src/node_modules/components/UndrawPlayfulCat/UndrawPlayfulCat.js | GraemeFulton/react-undraw-illustrations | 19dff57bc4b3aff60048fdefa18fc4ef16cffa9e | [
"MIT"
] | 141 | 2018-04-07T02:30:56.000Z | 2022-03-21T16:02:09.000Z | src/node_modules/components/UndrawPlayfulCat/UndrawPlayfulCat.js | wentin/react-undraw-illustrations | 19dff57bc4b3aff60048fdefa18fc4ef16cffa9e | [
"MIT"
] | 1 | 2018-09-13T13:51:51.000Z | 2018-12-21T20:12:39.000Z | src/node_modules/components/UndrawPlayfulCat/UndrawPlayfulCat.js | wentin/react-undraw-illustrations | 19dff57bc4b3aff60048fdefa18fc4ef16cffa9e | [
"MIT"
] | 17 | 2018-11-10T17:51:48.000Z | 2022-01-03T17:29:53.000Z | import React from "react";
import PropTypes from "prop-types";
const UndrawPlayfulCat = props => (
<svg
style={{height:props.height, width:'100%'}}
className={props.class}
id="39a6c29f-fe67-4b70-b1d8-8cf786f1bfe7"
data-name="Layer 1"
xmlnsXlink="http://www.w3.org/1999/xlink"
viewBox="0 0 937.26 812.12"
>
<defs>
<linearGradient
id="2e46f35f-56f4-430b-9d95-d68d73cfef1c"
x1={550.61}
y1={391.21}
x2={550.61}
y2={119.94}
gradientUnits="userSpaceOnUse"
>
<stop offset={0} stopColor="gray" stopOpacity={0.25} />
<stop offset={0.54} stopColor="gray" stopOpacity={0.12} />
<stop offset={1} stopColor="gray" stopOpacity={0.1} />
</linearGradient>
<linearGradient
id="fdac7634-b642-40fa-8a43-085b572eede9"
x1={600}
y1={712.18}
x2={600}
y2={177.78}
xlinkHref="#2e46f35f-56f4-430b-9d95-d68d73cfef1c"
/>
<linearGradient
id="912b237e-fa3a-47c4-bbed-6d4e5065e09a"
x1={400.37}
y1={509.13}
x2={400.37}
y2={43.94}
xlinkHref="#2e46f35f-56f4-430b-9d95-d68d73cfef1c"
/>
<linearGradient
id="72464db5-fd84-4643-baf7-d68ae36fa109"
x1={563.63}
y1={812.12}
x2={563.63}
y2={624.12}
xlinkHref="#2e46f35f-56f4-430b-9d95-d68d73cfef1c"
/>
<linearGradient
id="2caddc49-1727-4c31-95e0-c0d7e82ae402"
x1={491.42}
y1={799.41}
x2={491.42}
y2={441.32}
xlinkHref="#2e46f35f-56f4-430b-9d95-d68d73cfef1c"
/>
<linearGradient
id="6764eae3-0569-4495-8bae-0afb3d7c8ccf"
x1={388}
y1={279}
x2={388}
y2={259}
gradientUnits="userSpaceOnUse"
>
<stop offset={0} stopColor="#fff" />
<stop offset={1} />
</linearGradient>
</defs>
<title>playful cat</title>
<g opacity={0.5}>
<path
d="M619.25,248.3c-4.14-22.71-8.35-45.66-17.71-66.76a146.63,146.63,0,0,0-46.91-58.4A15.78,15.78,0,0,0,544,120h0c-5.88.52-7.73,4.14-8.68,8-.11.45-.21.9-.3,1.35-2.34,11.52-.78,22.9,2.6,34.12,4.22,14,11.27,27.75,17.12,41.2a274.9,274.9,0,0,1,20.79,76.25c.43,3.49.77,7.06.86,10.62a61.91,61.91,0,0,1-.15,6.37A38.05,38.05,0,0,1,573.45,310q-.41,1-.89,1.88t-1,1.82c-3.59,5.87-9.21,10.16-14.7,14.32s-11.71,8.62-18.28,10.86l.22,0a26.37,26.37,0,0,1-9.52,1.57c-10.13-.31-20.93-8.48-31.13-6.56h-.06c-.38.07-.76.16-1.15.26-10.44,2.83-18.44,19.22-18.5,29.71,0,0,0,.06,0,.09q0,1.24.09,2.41c0,.28.07.55.1.82.06.52.11,1,.2,1.55.05.31.13.6.19.91s.19.9.31,1.33.19.6.28.91.26.81.4,1.2.24.59.36.87.32.74.5,1.1.29.56.44.83.38.69.59,1,.34.52.51.78.44.64.68.94.38.49.58.73.5.59.76.87.42.46.64.68.56.55.84.81.45.42.69.62.61.5.92.75.48.38.73.57.67.47,1,.69l.76.5c.36.23.73.44,1.1.65l.77.44c.41.22.82.42,1.24.62l.73.36c.6.27,1.21.53,1.82.78l.9.34c.47.17.94.35,1.42.51l1,.32,1.16.35,1.14.29,1.1.27,1.22.26,1.06.21,1.28.22,1,.16,1.33.17,1,.11,1.38.13,1,.07,1.42.08.91,0,1.48,0h.83l1.54,0,.73,0,1.63-.07.58,0,1.74-.13.33,0a57,57,0,0,0,14.45-3.18c14.76-5.59,27.27-15.83,38.87-26.54,23-21.24,44.71-47.59,46.55-78.84C623.36,270.92,621.31,259.55,619.25,248.3Z"
transform="translate(-131.37 -43.94)"
fill="url(#2e46f35f-56f4-430b-9d95-d68d73cfef1c)"
/>
</g>
<path
d="M538.42,376.32c13.49-5.11,24.92-14.46,35.52-24.25,21-19.41,40.86-43.49,42.54-72,.61-10.43-1.27-20.83-3.14-31.1-3.78-20.75-7.63-41.72-16.18-61a134,134,0,0,0-42.87-53.36,14.41,14.41,0,0,0-9.7-2.88c-6,.53-7.42,4.6-8.21,8.5-4.81,23.66,8.38,46.69,18,68.82a251.22,251.22,0,0,1,19,69.68c1.25,10.19,1.69,21.22-3.67,30-3.28,5.36-8.42,9.29-13.43,13.08-7.5,5.68-15.81,11.62-25.21,11.34-9.63-.29-19.91-8.35-29.55-5.74s-16.85,17.56-16.91,27.15C484.47,380.43,520.36,383.16,538.42,376.32Z"
transform="translate(-131.37 -43.94)"
fill="#ffd180"
/>
<g opacity={0.1}>
<path
d="M569.73,308.66c-3.28,5.36-8.42,9.29-13.43,13.08s-10.7,7.88-16.7,9.92c8.54-.57,16.17-6,23.11-11.23,5-3.79,10.15-7.72,13.43-13.08,5.36-8.76,4.92-19.79,3.67-30a251.2,251.2,0,0,0-19-69.68c-9.64-22.13-22.83-45.17-18-68.82.56-2.74,1.46-5.54,4-7.16a12.89,12.89,0,0,0-2.2,0c-6,.53-7.42,4.6-8.21,8.5-4.81,23.66,8.38,46.69,18,68.82a251.2,251.2,0,0,1,19,69.68C574.65,288.87,575.09,299.9,569.73,308.66Z"
transform="translate(-131.37 -43.94)"
/>
<path
d="M491,353.17c.05-8.86,6.31-22.3,14.79-26.33a15.51,15.51,0,0,0-4.28.5c-9.54,2.58-16.85,17.56-16.91,27.15-.15,24.21,31.06,28.21,49.91,23.08C515.79,380.29,490.9,374.8,491,353.17Z"
transform="translate(-131.37 -43.94)"
/>
</g>
<g opacity={0.5}>
<path
d="M1032.73,477.32S1005.86,413.91,993.12,364l-5.8-34.18a25.3,25.3,0,0,0,11.38-21.14h0a25.34,25.34,0,0,0-19.14-24.56l-1.29-7.57H865.94V239H682.13v37.44H518.75V232.24H456.3a30.63,30.63,0,1,0-38.49,0H324.73v44.25h-88.6A29,29,0,0,0,200.76,274h0a28.8,28.8,0,0,0-11.32,14.64,29,29,0,0,0,3.33,36.66l26.44,26.87v18.55c-8.06,25.81-25.25,72-61.27,144-3.4,3.4-81.69,149.77,47.65,197.42H995.29S1131.44,688.35,1032.73,477.32Z"
transform="translate(-131.37 -43.94)"
fill="url(#fdac7634-b642-40fa-8a43-085b572eede9)"
/>
</g>
<rect x={204.43} y={196.85} width={186.22} height={53.91} opacity={0.1} />
<rect x={204.43} y={196.85} width={186.22} height={49.01} fill={props.primaryColor} />
<circle cx={312.24} cy={173.98} r={29.4} fill={props.primaryColor} />
<rect x={139.09} y={294.86} width={352.84} height={189.49} fill={props.primaryColor} />
<rect x={139.09} y={294.86} width={352.84} height={189.49} opacity={0.5} />
<path
d="M1015.33,476c94.74,202.55-35.94,225.42-35.94,225.42H574.29l-9.8-369.17,406.74,1.63c3.27,45.74,44.1,142.11,44.1,142.11"
transform="translate(-131.37 -43.94)"
fill={props.primaryColor}
/>
<rect x={103.15} y={239.32} width={728.54} height={91.48} fill={props.primaryColor} />
<polygon
points="846.39 325.9 103.15 330.8 103.15 239.32 831.69 239.32 846.39 325.9"
opacity={0.1}
/>
<path
d="M623.29,472.75s-50.37-86.28-63.71-135.58l18,364.27S718,675.3,623.29,472.75Z"
transform="translate(-131.37 -43.94)"
opacity={0.1}
/>
<g opacity={0.5}>
<path
d="M353.44,83.16s53.8-10.76,80.7,0c0,0,16.14-37.66,32.28-37.66s21.52,59.18,21.52,59.18l21.52,86.09s102.23,182.93,0,279.78-263.64-10.76-263.64-80.7,32.28-215.21,32.28-215.21,32.28-118.37,43-129.13S353.44,83.16,353.44,83.16Z"
transform="translate(-131.37 -43.94)"
fill="url(#912b237e-fa3a-47c4-bbed-6d4e5065e09a)"
/>
</g>
<path
d="M355.26,90.64s51.72-10.34,77.58,0c0,0,15.52-36.2,31-36.2s20.69,56.89,20.69,56.89l20.69,82.75s98.27,175.85,0,269-253.43-10.34-253.43-77.58,31-206.89,31-206.89,31-113.79,41.38-124.13S355.26,90.64,355.26,90.64Z"
transform="translate(-131.37 -43.94)"
fill="#ffd180"
/>
<path
d="M241.05,348.6S234.52,394.34,175.71,512c-3.27,3.27-78.41,143.75,45.74,189.49H574.29S705,678.57,610.22,476c0,0-47.37-99.64-50.64-145.38L384.8,492.35Z"
transform="translate(-131.37 -43.94)"
fill={props.primaryColor}
/>
<g opacity={0.1}>
<path
d="M541.43,290.75a409.09,409.09,0,0,0-36.19-96.66l3.27,13.07A408.92,408.92,0,0,1,541.43,290.75Z"
transform="translate(-131.37 -43.94)"
fill="#fff"
/>
<path
d="M261.08,371.52c0-67.24,25-179.89,25-179.89s31-113.79,41.38-124.13,31,36.21,31,36.21,51.72-10.34,77.58,0c0,0,15.52-36.21,31-36.21,6,0,10.48,8.58,13.69,19.07-3.15-15.34-8.52-32.14-17-32.14-15.52,0-31,36.21-31,36.21-25.86-10.34-77.58,0-77.58,0s-20.69-46.55-31-36.21-41.38,124.13-41.38,124.13-25,112.65-25,179.89C257.81,364.53,261.08,373.45,261.08,371.52Z"
transform="translate(-131.37 -43.94)"
fill="#fff"
/>
</g>
<path
d="M241.05,348.6S234.52,394.34,175.71,512c-3.27,3.27-78.41,143.75,45.74,189.49H574.29S705,678.57,610.22,476c0,0-47.37-99.64-50.64-145.38L384.8,492.35Z"
transform="translate(-131.37 -43.94)"
fill="#fff"
opacity={0.2}
/>
<path
d="M388.07,449.88,541.62,289.8H958.35a24.31,24.31,0,0,1,24.31,24.31h0A24.31,24.31,0,0,1,958,338.42l-393.49-6.15L388.07,502.15Z"
transform="translate(-131.37 -43.94)"
fill={props.primaryColor}
/>
<path
d="M253.78,286.4,388.07,449.88v52.27L212.41,323.62a27.85,27.85,0,0,1,4.4-42.71h0A27.85,27.85,0,0,1,253.78,286.4Z"
transform="translate(-131.37 -43.94)"
fill={props.primaryColor}
/>
<path
d="M388.07,456.41,541.62,296.33H958.35a24.31,24.31,0,0,1,24.31,24.31h0A24.31,24.31,0,0,1,958,345L564.49,338.8,388.07,508.69Z"
transform="translate(-131.37 -43.94)"
opacity={0.1}
/>
<path
d="M388.07,449.88,541.62,289.8H958.35a24.31,24.31,0,0,1,24.31,24.31h0A24.31,24.31,0,0,1,958,338.42l-393.49-6.15L388.07,502.15Z"
transform="translate(-131.37 -43.94)"
fill={props.primaryColor}
/>
<path
d="M250.52,292.94,384.8,456.41v52.27L209.14,330.15a27.85,27.85,0,0,1,4.4-42.71h0A27.85,27.85,0,0,1,250.52,292.94Z"
transform="translate(-131.37 -43.94)"
opacity={0.1}
/>
<path
d="M253.78,286.4,388.07,449.88v52.27L212.41,323.62a27.85,27.85,0,0,1,4.4-42.71h0A27.85,27.85,0,0,1,253.78,286.4Z"
transform="translate(-131.37 -43.94)"
fill={props.primaryColor}
/>
<rect
x={175.02}
y={559.49}
width={182.95}
height={32.67}
fill="#fff"
opacity={0.5}
/>
<rect
x={616.07}
y={559.49}
width={186.22}
height={32.67}
fill="#fff"
opacity={0.5}
/>
<rect x={547.46} y={203.39} width={176.42} height={62.07} fill={props.primaryColor} />
<circle cx={622.6} cy={180.52} r={29.4} fill={props.primaryColor} />
<circle cx={250.16} cy={438.61} r={35.94} opacity={0.1} />
<circle cx={250.16} cy={432.08} r={35.94} fill={props.primaryColor} />
<circle cx={250.16} cy={432.08} r={35.94} opacity={0.3} />
<circle cx={324.74} cy={137.22} r={10.34} fill="#58555d" />
<circle cx={205.78} cy={137.22} r={10.34} fill="#58555d" />
<ellipse cx={267.85} cy={147.56} rx={15.52} ry={10.34} fill="#58555d" />
<rect
x={486.58}
y={173.4}
width={47.68}
height={5.17}
transform="translate(-157.38 70.86) rotate(-12.52)"
fill="#ffd180"
/>
<rect
x={486.63}
y={194.09}
width={52.75}
height={5.17}
transform="translate(-159.91 60.07) rotate(-11.27)"
fill="#ffd180"
/>
<rect
x={272.5}
y={137.79}
width={5.17}
height={55.71}
transform="translate(-112.24 315.6) rotate(-68.2)"
fill="#ffd180"
/>
<rect
x={264.74}
y={152.31}
width={5.17}
height={68.03}
transform="translate(-88.85 378.28) rotate(-81.25)"
fill="#ffd180"
/>
<path
d="M377.46,345.81s36,78.21-11.25,84.87-25.67-65.5-25.67-65.5-4.72-21.43-16.23-22.64"
transform="translate(-131.37 -43.94)"
opacity={0.1}
/>
<path
d="M420.92,343.92s-42.76,74.71,3.68,85.54,31.38-63,31.38-63,6.61-20.93,18.17-21.11"
transform="translate(-131.37 -43.94)"
opacity={0.1}
/>
<path
d="M373.23,343.63s36,78.21-11.25,84.87S336.3,363,336.3,363s-4.72-21.43-16.23-22.64"
transform="translate(-131.37 -43.94)"
fill="#ffd180"
/>
<path
d="M424.19,340.63s-42.76,74.71,3.68,85.54,31.38-63,31.38-63,6.61-20.93,18.17-21.11"
transform="translate(-131.37 -43.94)"
fill="#ffd180"
/>
<rect
x={215.45}
y={368.37}
width={0.82}
height={15.26}
fill="#58555d"
opacity={0.5}
/>
<rect
x={228.52}
y={368.37}
width={0.82}
height={15.26}
fill="#58555d"
opacity={0.5}
/>
<rect
x={221.43}
y={363.5}
width={0.82}
height={21.36}
fill="#58555d"
opacity={0.5}
/>
<rect
x={300.39}
y={365.1}
width={0.82}
height={15.26}
fill="#58555d"
opacity={0.5}
/>
<rect
x={313.46}
y={365.1}
width={0.82}
height={15.26}
fill="#58555d"
opacity={0.5}
/>
<rect
x={306.37}
y={360.23}
width={0.82}
height={21.36}
fill="#58555d"
opacity={0.5}
/>
<g opacity={0.5}>
<circle
cx={563.63}
cy={718.12}
r={94}
fill="url(#72464db5-fd84-4643-baf7-d68ae36fa109)"
/>
</g>
<circle cx={563.63} cy={718.12} r={88} fill="#f55f44" />
<g opacity={0.5}>
<path
d="M435.38,799.41c-13.34,0-27.31-7.86-29-21.23-1-7.72,2.29-14.9,5.44-21.84,3.46-7.61,6.45-14.18,3.49-20.07-1.35-2.68-3.93-4.85-6.51-6.8-3.37-2.53-7-4.92-10.54-7.23-6.09-4-12.39-8.12-17.86-13.33-10.74-10.25-15.49-23.08-12.72-34.32,2.4-9.71,9.72-16.67,16.8-23.39,7.26-6.9,14.12-13.41,14.74-22.07.84-11.78-10.44-21.29-20.39-29.68l-1.55-1.31C365.14,587.86,354.1,570.92,363,557c3.09-4.87,7.78-7.75,12.32-10.54a42,42,0,0,0,8.4-6.12c8.63-9,5.92-23.58,4.36-29.46-1.19-4.46-2.87-9-4.49-13.31-2.39-6.43-4.87-13.07-6-20.1l-.19-1.15c-2.79-16.93-2.73-17.55,3.17-33l.74-1.93,6.54,2.49-.74,1.94c-5.34,14-5.34,14-2.8,29.41l.19,1.16c1,6.36,3.29,12.4,5.68,18.8,1.68,4.5,3.41,9.16,4.69,14,4,14.84,1.74,28-6.08,36.12a47.81,47.81,0,0,1-9.77,7.23c-4,2.48-7.85,4.83-10.08,8.33C362,571.57,373.75,586,381.8,592.79l1.54,1.3c10.67,9,24,20.19,22.86,35.53-.81,11.37-9,19.14-16.9,26.65-6.64,6.31-12.92,12.27-14.83,20-2.55,10.33,3.89,21,10.76,27.58,5,4.77,10.76,8.54,16.86,12.54,3.62,2.37,7.36,4.82,10.92,7.49,3.27,2.46,6.56,5.28,8.56,9.25,4.47,8.88.48,17.64-3.37,26.11-2.88,6.33-5.6,12.31-4.87,18.06,1.32,10.39,14.28,16.21,25.09,14.94,8.84-1,16.91-5.14,25.45-9.47,2.76-1.4,5.62-2.85,8.48-4.18,15.63-7.23,29.29-8.13,39.51-2.6a51.7,51.7,0,0,1,8.94,6.6,52.21,52.21,0,0,0,6.84,5.26,25.16,25.16,0,0,0,33.11-8.32c.61-1,1.17-2.12,1.76-3.29,1.89-3.71,4-7.91,8.27-10.28,4.45-2.49,9.61-2,13.38-1.62l39,3.77-.68,7-39-3.77c-3.7-.36-6.94-.55-9.29.77s-3.88,4.26-5.46,7.35c-.62,1.21-1.26,2.47-2,3.69A32.14,32.14,0,0,1,524,793.85a58.22,58.22,0,0,1-7.78-5.94,45.74,45.74,0,0,0-7.71-5.75c-10.36-5.61-23.8-1.58-33.24,2.79-2.75,1.27-5.55,2.69-8.25,4.07-8.71,4.42-17.71,9-27.8,10.18A32.84,32.84,0,0,1,435.38,799.41Z"
transform="translate(-131.37 -43.94)"
fill="url(#2caddc49-1727-4c31-95e0-c0d7e82ae402)"
/>
</g>
<path
d="M437.38,796.41c-13.34,0-27.31-7.86-29-21.23-1-7.72,2.29-14.9,5.44-21.84,3.46-7.61,6.45-14.18,3.49-20.07-1.35-2.68-3.93-4.85-6.51-6.8-3.37-2.53-7-4.92-10.54-7.23-6.09-4-12.39-8.12-17.86-13.33-10.74-10.25-15.49-23.08-12.72-34.32,2.4-9.71,9.72-16.67,16.8-23.39,7.26-6.9,14.12-13.41,14.74-22.07.84-11.78-10.44-21.29-20.39-29.68l-1.55-1.31C367.14,584.86,356.1,567.92,365,554c3.09-4.87,7.78-7.75,12.32-10.54a42,42,0,0,0,8.4-6.12c8.63-9,5.92-23.58,4.36-29.46-1.19-4.46-2.87-9-4.49-13.31-2.39-6.43-4.87-13.07-6-20.1l-.19-1.15c-2.79-16.93-2.73-17.55,3.17-33l.74-1.93,6.54,2.49-.74,1.94c-5.34,14-5.34,14-2.8,29.41l.19,1.16c1,6.36,3.29,12.4,5.68,18.8,1.68,4.5,3.41,9.16,4.69,14,4,14.84,1.74,28-6.08,36.12a47.81,47.81,0,0,1-9.77,7.23c-4,2.48-7.85,4.83-10.08,8.33C364,568.57,375.75,583,383.8,589.79l1.54,1.3c10.67,9,24,20.19,22.86,35.53-.81,11.37-9,19.14-16.9,26.65-6.64,6.31-12.92,12.27-14.83,20-2.55,10.33,3.89,21,10.76,27.58,5,4.77,10.76,8.54,16.86,12.54,3.62,2.37,7.36,4.82,10.92,7.49,3.27,2.46,6.56,5.28,8.56,9.25,4.47,8.88.48,17.64-3.37,26.11-2.88,6.33-5.6,12.31-4.87,18.06,1.32,10.39,14.28,16.21,25.09,14.94,8.84-1,16.91-5.14,25.45-9.47,2.76-1.4,5.62-2.85,8.48-4.18,15.63-7.23,29.29-8.13,39.51-2.6a51.7,51.7,0,0,1,8.94,6.6,52.21,52.21,0,0,0,6.84,5.26,25.16,25.16,0,0,0,33.11-8.32c.61-1,1.17-2.12,1.76-3.29,1.89-3.71,4-7.91,8.27-10.28,4.45-2.49,9.61-2,13.38-1.62l39,3.77-.68,7-39-3.77c-3.7-.36-6.94-.55-9.29.77s-3.88,4.26-5.46,7.35c-.62,1.21-1.26,2.47-2,3.69A32.14,32.14,0,0,1,526,790.85a58.22,58.22,0,0,1-7.78-5.94,45.74,45.74,0,0,0-7.71-5.75c-10.36-5.61-23.8-1.58-33.24,2.79-2.75,1.27-5.55,2.69-8.25,4.07-8.71,4.42-17.71,9-27.8,10.18A32.84,32.84,0,0,1,437.38,796.41Z"
transform="translate(-131.37 -43.94)"
fill="#f55f44"
/>
<path
d="M710,701.06s48.5,8.5,49.5,80.5"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M624.5,786.56s-18-60,61-93"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M644.5,773.56s-8-31,17-48"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M693.5,725.56s19,16,9,56"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M734.5,688.56s32,18,40,73"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M685.5,688.56s20-6,33,5"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M661.5,800.56s17,21,86,0"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M648.5,826.56s9,18,41,16"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M648.5,693.56s-27,18-30,56"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M637.5,786.56s-6,12,6,23"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M754.5,809.56s-9,24-23,21"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M668.5,820.56a56.93,56.93,0,0,0,50,0"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M718.5,740.56s9,12,3,26"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M668.5,741.56s-9,16-4,29"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M679.5,741.56s7,19,0,29"
transform="translate(-131.37 -43.94)"
fill="none"
stroke="#000"
strokeMiterlimit={10}
opacity={0.2}
/>
<path
d="M386.33,257.67a236.61,236.61,0,0,1-40.41-3.45c-42.07-7.3-71.85-25.54-72.93-26.22l1.8-8.35c.25.16,32.63,18.84,73.07,25.78,37.23,6.39,101.27,4.47,166.37-31.44l4.35,7.88C471.34,247.93,421.61,257.67,386.33,257.67Z"
transform="translate(-131.37 -43.94)"
opacity={0.1}
/>
<path
d="M388.18,263.18l-.35-.35a5.42,5.42,0,0,0,0-8.63l.31-.39a5.91,5.91,0,0,1,0,9.37Z"
transform="translate(-131.37 -43.94)"
fill="#4d8af0"
/>
<path
d="M388.18,263.18l-.35-.35a5.42,5.42,0,0,0,0-8.63l.31-.39a5.91,5.91,0,0,1,0,9.37Z"
transform="translate(-131.37 -43.94)"
opacity={0.1}
/>
<path
d="M514.25,212c-65.1,35.91-129.15,37.83-166.37,31.44-40.44-6.94-72.82-25.62-73.07-25.78L270,225.27c1.08.68,33.84,19.65,75.91,27a236.61,236.61,0,0,0,40.41,3.45c35.27,0,85-9.74,132.26-35.81ZM388,255a1,1,0,1,1,1-1A1,1,0,0,1,388,255Z"
transform="translate(-131.37 -43.94)"
fill="#f55f44"
/>
<path
d="M378,269h0a10,10,0,0,0,10,10h0a10,10,0,0,0,10-10h0a10,10,0,0,0-10-10h0A10,10,0,0,0,378,269Zm10-5a1.67,1.67,0,1,1,1.67-1.67A1.67,1.67,0,0,1,388,264Z"
transform="translate(-131.37 -43.94)"
opacity={0.1}
fill="url(#6764eae3-0569-4495-8bae-0afb3d7c8ccf)"
/>
<path
d="M379,269h0a9,9,0,0,0,9,9h0a9,9,0,0,0,9-9h0a9,9,0,0,0-9-9h0A9,9,0,0,0,379,269Zm9-4.5a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,388,264.5Z"
transform="translate(-131.37 -43.94)"
fill="#4d8af0"
/>
<path
d="M387.82,263.18a5.91,5.91,0,0,1,0-9.37l.31.39a5.42,5.42,0,0,0,0,8.63Z"
transform="translate(-131.37 -43.94)"
fill="#4d8af0"
/>
<polyline
points="256.63 210.06 256.63 210.06 256.63 210.06 256.63 210.06"
fill="#4d8af0"
/>
<path
d="M501,215c-137.67,81-217,6-217,6Z"
transform="translate(-131.37 -43.94)"
fill="#ffd180"
/>
</svg>
);
UndrawPlayfulCat.propTypes = {
/**
* Hex color
*/
primaryColor: PropTypes.string,
/**
* percentage
*/
height: PropTypes.string,
/**
* custom class for svg
*/
class: PropTypes.string
};
UndrawPlayfulCat.defaultProps = {
primaryColor: "#6c68fb",
height: "250px",
class: ""
};
export default UndrawPlayfulCat;
| 40.794231 | 1,673 | 0.575072 |
28e0be7920ee2a6df85a99ee9bb44a38bd75aee9 | 3,427 | js | JavaScript | src/components/SuperLayout/layouts/Grid/Design.js | ggyybowiee/Platform | 532a4ab84d654f12f4d2020f9ba3162bda3917aa | [
"MIT"
] | null | null | null | src/components/SuperLayout/layouts/Grid/Design.js | ggyybowiee/Platform | 532a4ab84d654f12f4d2020f9ba3162bda3917aa | [
"MIT"
] | null | null | null | src/components/SuperLayout/layouts/Grid/Design.js | ggyybowiee/Platform | 532a4ab84d654f12f4d2020f9ba3162bda3917aa | [
"MIT"
] | null | null | null | import React from 'react';
import { Row, Col, Card, Icon, Popconfirm, Badge, Tag, Button, Popover } from 'antd';
import SuperAction from 'components/SuperAction';
import styles from './index.less';
const createNewId = (elements, detail) =>{
return _.last(elements) ? _.last(elements).id + 1 : 0;
};
export default class GridLayout extends React.Component {
handleAddRow = () => {
const { elements, detail, createNewElement, onChange } = this.props;
if (!onChange) {
throw new Error('onChange 不是一个函数');
}
const newId = createNewId(elements, detail);
const newElement = createNewElement();
newElement.id = newId;
onChange({
elements: [
...elements, newElement,
],
detail: [ ...detail, [ newId ] ],
});
}
handleAddCell = (rowIndex) => {
const { elements, detail, createNewElement, onChange } = this.props;
if (!onChange) {
throw new Error('onChange 不是一个函数');
}
const newId = createNewId(elements, detail);
const newElement = createNewElement();
newElement.id = newId;
const newDetail = [ ...detail ];
newDetail[rowIndex].push(newId);
onChange({
elements: [...elements, newElement ],
detail: newDetail,
});
}
handleRemoveCell = (rowIndex, keyOrIndex) => {
const { elements, detail, createNewElement, onChange } = this.props;
if (!onChange) {
throw new Error('onChange 不是一个函数');
}
const elementToRemove = _.find(elements, { id: keyOrIndex });
if (!elementToRemove) {
throw new Error('没有找到需要删除的元素');
}
const newElements = [...elements];
_.remove(newElements, elementToRemove);
const newDetail = [...detail];
_.remove(newDetail[rowIndex], itemIndex => (itemIndex === keyOrIndex));
onChange({
elements: newElements,
detail: newDetail,
});
}
render() {
const { elements, detail, ElementPlaceholder } = this.props;
const elementsMap = _.mapKeys(elements, 'id');
return (
<div>
<div>
{_.map(detail, (row, rowIndex) => {
const span = Math.floor(24 / (row.length + 1));
return (
<Row gutter={16} key={`row-${rowIndex}`} className={styles.row}>
{
_.map(row, (keyOrIndex, cellIndex) => (
<Col span={span} className={styles.cell} key={keyOrIndex}>
<SuperAction.ActionsGroup
overflow
actions={{
edit: () => this.props.onEdit(elementsMap[keyOrIndex], keyOrIndex, rowIndex, cellIndex),
remove: () => this.handleRemoveCell(rowIndex, keyOrIndex),
}}
>
<ElementPlaceholder element={elementsMap[keyOrIndex]} />
</SuperAction.ActionsGroup>
</Col>
))
}
<Col span={span} className={styles.extraCell}>
<Button type="dashed" className={styles.newButton} onClick={() => this.handleAddCell(rowIndex)}>
<Icon type="plus" /> 新增项
</Button>
</Col>
</Row>
);
})}
</div>
<div>
<Button icon="plus" type="primary" onClick={this.handleAddRow}>添加行</Button>
</div>
</div>
)
}
}
| 30.598214 | 114 | 0.54129 |
28e10934f62428e21f854cda2d31abeb209910c7 | 891 | js | JavaScript | server/db/models/product.js | Thrifty-Pandas/grace-shopper | d051864d227a18571e46995e98aabff385ce6c9c | [
"MIT"
] | 1 | 2018-10-29T22:02:00.000Z | 2018-10-29T22:02:00.000Z | server/db/models/product.js | Thrifty-Pandas/grace-shopper | d051864d227a18571e46995e98aabff385ce6c9c | [
"MIT"
] | 39 | 2018-10-29T21:47:27.000Z | 2018-11-06T22:30:14.000Z | server/db/models/product.js | Thrifty-Pandas/grace-shopper | d051864d227a18571e46995e98aabff385ce6c9c | [
"MIT"
] | null | null | null | const Sequelize = require('sequelize')
const db = require('../db')
const Category = require('./category')
const Review = require('./review')
const Product = db.define('product', {
name: {
type: Sequelize.STRING,
allowNull: false,
validate: {notEmpty: true}
},
description: {
type: Sequelize.TEXT,
allowNull: false,
validate: {notEmpty: true, len: [5, 500]}
},
stock: {
type: Sequelize.INTEGER,
allowNull: false,
validate: {isNumeric: true, min: 0}
},
price: {
type: Sequelize.INTEGER,
allowNull: false,
validate: {isNumeric: true, min: 0}
},
imageUrl: {
type: Sequelize.STRING,
defaultValue: '/default-panda.jpg'
}
})
Product.eagerLoadCategoriesReviews = async productId => {
const product = await Product.findById(productId, {
include: [Category, Review]
})
return product
}
module.exports = Product
| 21.214286 | 57 | 0.645342 |
28e2caa47f38e57960208a9ebe6b1993c794a2ac | 7,555 | js | JavaScript | views/scripts/seatavailability.js | varun-saini-18/varun120303 | 440a23863a4cf74a992befa279ca4692de41aecd | [
"Apache-2.0"
] | null | null | null | views/scripts/seatavailability.js | varun-saini-18/varun120303 | 440a23863a4cf74a992befa279ca4692de41aecd | [
"Apache-2.0"
] | null | null | null | views/scripts/seatavailability.js | varun-saini-18/varun120303 | 440a23863a4cf74a992befa279ca4692de41aecd | [
"Apache-2.0"
] | null | null | null | $.getJSON("https://api.ipify.org?format=json",
function(data) {
$("#ip-addr").html(data.ip);
})
function bookTicket(id)
{
let train_num = id.split("-book-ticket");
train_num = train_num[0];
let src = document.getElementById(`${train_num}-src`).innerText;
let dest = document.getElementById(`${train_num}-dest`).innerText;
document.getElementById(`modal-h1`).innerHTML = 'Wait....';
document.getElementById(`modal-h4`).innerHTML = 'We are trying to book your ticket!';
document.getElementById(`modal-h5`).innerHTML = 'Thanks for showing patience.';
document.getElementById(`modal-span`).innerHTML = '';
document.getElementById('id01').style.display='block';
const url = '/bookticket';
fetch(url, {
method: "POST",
body: JSON.stringify({
"train_num" : train_num,
"src" : src,
"dest" : dest
}),
headers: {
"Content-type": "application/json; charset=UTF-8"
}
})
.then(response => response.json())
.then(json => json.data)
.then((data) => {
if(!!data.id)
{
document.getElementById(`modal-h1`).innerHTML = 'Success';
document.getElementById(`modal-h4`).innerHTML = 'Your ticket was successfuly booked!';
document.getElementById(`modal-h5`).innerHTML = `See your ticket <a href="/ticketdetail/${data.id}">"here"</a>`;
document.getElementById(`modal-span`).innerHTML = `<span onclick="document.getElementById('id01').style.display='none'"class="w3-button w3-display-topright">x</span>`;
}
else
{
document.getElementById(`modal-h1`).innerHTML = 'Sorry';
document.getElementById(`modal-h4`).innerHTML = 'There was some issue while booking your ticket!';
document.getElementById(`modal-h5`).innerHTML = 'You can try again!';
document.getElementById(`modal-span`).innerHTML = `<span onclick="document.getElementById('id01').style.display='none'"class="w3-button w3-display-topright">x</span>`;
}
})
}
function loadHTMLTable(data) {
if (data.length === 0) {
document.getElementById(`modal-h1`).innerHTML = 'Oh ho!';
document.getElementById(`modal-h4`).innerHTML = 'Sorry there are no trains on this route.';
document.getElementById(`modal-h5`).innerHTML = 'Please try other routes.';
document.getElementById(`modal-span`).innerHTML = `<span onclick="document.getElementById('id01').style.display='none'"class="w3-button w3-display-topright">x</span>`;
document.getElementById('id01').style.display='block';
document.getElementById("table").innerHTML = "";
return;
}
let tableHtml = `<tr>
<th>Train Number</th>
<th>Source</th>
<th>Source Arr</th>
<th>Source Dep</th>
<th>Destination</th>
<th>Destination Arr</th>
<th>Destination Dep</th>
<th>Book Ticket?</th>
</tr>`;
data.forEach(function (data) {
tableHtml += "<tr>";
tableHtml += `<td><a href="/traindetail/${data}">${data}</a></td>`;
tableHtml += `<td id="${data}-src"></td>`;
tableHtml += `<td id="${data}-src-arr"></td>`;
tableHtml += `<td id="${data}-src-dep"></td>`;
tableHtml += `<td id="${data}-dest"></td>`;
tableHtml += `<td id="${data}-dest-arr"></td>`;
tableHtml += `<td id="${data}-dest-dep"></td>`;
tableHtml += `<td ><button id="${data}-book-ticket" onClick="bookTicket(this.id);">Book Ticket</button></td>`;
tableHtml += "</tr>";
});
document.getElementById("table").innerHTML = tableHtml;
}
function searchTrains() {
var src = document.getElementById("src").value;
var dest = document.getElementById("dest").value;
var url = `/searchtrains/${src}+${dest}`;
fetch(url)
.then(function (response) {
return response.json();
})
.then(function (data) {
data = data.data;
document.getElementById("table").style.display = "";
loadHTMLTable(data);
for(let i=0;i<data.length;i++)
{
var url1 = '/gettraindetail/' + data[i];
// var url2 = '/gettrainname/' + train_num;
fetch(url1)
.then(function (response) {
return response.json();
})
.then(function (data1) {
var result = data1.data;
for(let j=0;j<result.length;j++)
{
if(result[j].src_station.toLowerCase()===src.toLowerCase())
{
document.getElementById(`${data[i]}-src`).innerHTML = src;
let arr_time = String(Math.ceil(parseInt(result[j].arr)/60));
let arr_time_min = parseInt(result[j].arr)%60;
if(arr_time_min<10)
arr_time += ':0';
else
arr_time += ':';
arr_time+=arr_time_min;
let dep_time = String(Math.ceil(parseInt(result[j].dep)/60));
let dep_time_min = parseInt(result[j].dep)%60;
if(dep_time_min<10)
dep_time += ':0';
else
dep_time += ':';
dep_time+=dep_time_min;
document.getElementById(`${data[i]}-src-arr`).innerHTML = arr_time;
document.getElementById(`${data[i]}-src-dep`).innerHTML = dep_time;
}
if(result[j].src_station.toLowerCase()===dest.toLowerCase())
{
document.getElementById(`${data[i]}-dest`).innerHTML = dest;
let arr_time = String(Math.ceil(parseInt(result[j].arr)/60));
let arr_time_min = parseInt(result[j].arr)%60;
if(arr_time_min<10)
arr_time += ':0';
else
arr_time += ':';
arr_time+=arr_time_min;
let dep_time = String(Math.ceil(parseInt(result[j].dep)/60));
let dep_time_min = parseInt(result[j].dep)%60;
if(dep_time_min<10)
dep_time += ':0';
else
dep_time += ':';
dep_time+=dep_time_min;
document.getElementById(`${data[i]}-dest-arr`).innerHTML = arr_time;
document.getElementById(`${data[i]}-dest-dep`).innerHTML = dep_time;
}
}
});
}
})
}
function loadStations()
{
fetch('/getstations')
.then(response => response.json())
.then(data => {
data = data.data;
let src = '<option value="0">Select Src</option>';
let dest = '<option value="0">Select Dest</option>';
for(let i=0;i<data.length;i++)
{
src+=`<option value="${data[i].name}">${data[i].name}</option>`
dest+=`<option value="${data[i].name}">${data[i].name}</option>`
}
document.getElementById("src").innerHTML = src;
document.getElementById("dest").innerHTML = dest;
});
}
loadStations();
| 42.206704 | 183 | 0.513435 |
28e2fd44ead4bc67e707d2a3205a733071f07adf | 6,459 | js | JavaScript | dist/uncompressed/skylark-visibility/core.js | skylark-integration/skylark-visibility | 0644f40f054abe79281aeb45ea52872e15182624 | [
"MIT"
] | null | null | null | dist/uncompressed/skylark-visibility/core.js | skylark-integration/skylark-visibility | 0644f40f054abe79281aeb45ea52872e15182624 | [
"MIT"
] | 3 | 2021-03-09T14:11:48.000Z | 2021-09-01T20:17:06.000Z | src/core.js | skylark-integration/skylark-visibility | 0644f40f054abe79281aeb45ea52872e15182624 | [
"MIT"
] | null | null | null | define([
"./fallback"
],function(){
if (window.Visibility) {
return window.Visibility;
}
var lastId = -1;
// Visibility.js allow you to know, that your web page is in the background
// tab and thus not visible to the user. This library is wrap under
// Page Visibility API. It fix problems with different vendor prefixes and
// add high-level useful functions.
var self = {
// Call callback only when page become to visible for user or
// call it now if page is visible now or Page Visibility API
// doesn’t supported.
//
// Return false if API isn’t supported, true if page is already visible
// or listener ID (you can use it in `unbind` method) if page isn’t
// visible now.
//
// Visibility.onVisible(function () {
// startIntroAnimation();
// });
onVisible: function (callback) {
var support = self.isSupported();
if ( !support || !self.hidden() ) {
callback();
return support;
}
var listener = self.change(function (e, state) {
if ( !self.hidden() ) {
self.unbind(listener);
callback();
}
});
return listener;
},
// Call callback when visibility will be changed. First argument for
// callback will be original event object, second will be visibility
// state name.
//
// Return listener ID to unbind listener by `unbind` method.
//
// If Page Visibility API doesn’t supported method will be return false
// and callback never will be called.
//
// Visibility.change(function(e, state) {
// Statistics.visibilityChange(state);
// });
//
// It is just proxy to `visibilitychange` event, but use vendor prefix.
change: function (callback) {
if ( !self.isSupported() ) {
return false;
}
lastId += 1;
var number = lastId;
self._callbacks[number] = callback;
self._listen();
return number;
},
// Remove `change` listener by it ID.
//
// var id = Visibility.change(function(e, state) {
// firstChangeCallback();
// Visibility.unbind(id);
// });
unbind: function (id) {
delete self._callbacks[id];
},
// Call `callback` in any state, expect “prerender”. If current state
// is “prerender” it will wait until state will be changed.
// If Page Visibility API doesn’t supported, it will call `callback`
// immediately.
//
// Return false if API isn’t supported, true if page is already after
// prerendering or listener ID (you can use it in `unbind` method)
// if page is prerended now.
//
// Visibility.afterPrerendering(function () {
// Statistics.countVisitor();
// });
afterPrerendering: function (callback) {
var support = self.isSupported();
var prerender = 'prerender';
if ( !support || prerender != self.state() ) {
callback();
return support;
}
var listener = self.change(function (e, state) {
if ( prerender != state ) {
self.unbind(listener);
callback();
}
});
return listener;
},
// Return true if page now isn’t visible to user.
//
// if ( !Visibility.hidden() ) {
// VideoPlayer.play();
// }
//
// It is just proxy to `document.hidden`, but use vendor prefix.
hidden: function () {
return !!(self._doc.hidden || self._doc.webkitHidden);
},
// Return visibility state: 'visible', 'hidden' or 'prerender'.
//
// if ( 'prerender' == Visibility.state() ) {
// Statistics.pageIsPrerendering();
// }
//
// Don’t use `Visibility.state()` to detect, is page visible, because
// visibility states can extend in next API versions.
// Use more simpler and general `Visibility.hidden()` for this cases.
//
// It is just proxy to `document.visibilityState`, but use
// vendor prefix.
state: function () {
return self._doc.visibilityState ||
self._doc.webkitVisibilityState ||
'visible';
},
// Return true if browser support Page Visibility API.
// refs: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
//
// if ( Visibility.isSupported() ) {
// Statistics.startTrackingVisibility();
// Visibility.change(function(e, state)) {
// Statistics.trackVisibility(state);
// });
// }
isSupported: function () {
return self._doc.hidden !== undefined || self._doc.webkitHidden !== undefined;
},
// Link to document object to change it in tests.
_doc: document || {},
// Callbacks from `change` method, that wait visibility changes.
_callbacks: { },
// Listener for `visibilitychange` event.
_change: function(event) {
var state = self.state();
for ( var i in self._callbacks ) {
self._callbacks[i].call(self._doc, event, state);
}
},
// Set listener for `visibilitychange` event.
_listen: function () {
if ( self._init ) {
return;
}
var event = 'visibilitychange';
if ( self._doc.webkitVisibilityState ) {
event = 'webkit' + event;
}
var listener = function () {
self._change.apply(self, arguments);
};
if ( self._doc.addEventListener ) {
self._doc.addEventListener(event, listener);
} else {
self._doc.attachEvent(event, listener);
}
self._init = true;
}
};
return window.Visibility = self;
});
| 33.640625 | 90 | 0.511534 |
28e3058135fc50d1dce5c82e76ff871e11013b34 | 3,291 | js | JavaScript | test/loaders.test.js | gt3/react-circuit | e08999234d6f30cba4018f493f338b33398be9ea | [
"MIT"
] | null | null | null | test/loaders.test.js | gt3/react-circuit | e08999234d6f30cba4018f493f338b33398be9ea | [
"MIT"
] | 9 | 2017-04-09T03:28:48.000Z | 2017-06-26T05:20:18.000Z | test/loaders.test.js | gt3/react-circuit | e08999234d6f30cba4018f493f338b33398be9ea | [
"MIT"
] | null | null | null | import assert from 'assert'
import { chan, go, putAsync, takeAsync, buffers, CLOSED } from 'js-csp'
import { eq, neq, oeq, oneq } from './helpers'
import { putter } from '../src/middleware/csp'
import { initializeAsyncSources as ias } from '../src/middleware/loaders'
import Message from '../src/message'
let _networkError = new Error('some network error!')
function fetchSync(i, cb) {
return cb(++i)
}
function fetchAsync(i, cb) {
return setTimeout(() => cb(++i))
}
function fetchAsyncErr(i, cb) {
return setTimeout(() => cb(_networkError))
}
let fetchAsyncWait = (wait = 0) => (i, cb) => (wait < 0 ? cb(++i) : setTimeout(() => cb(++i), wait))
let fetchAsyncWaitOnce = (wait = 0) => (i, cb) => {
wait < 0 ? cb(++i) : setTimeout(() => cb(++i), wait)
wait = -1
}
describe('data-loader', function() {
describe('#initializeAsyncSources #serial', function() {
it('should accept synchronous callbacks', function(done) {
let c = chan(),
i = 0
let success = m => {
eq(m, i + 1)
done()
}
let failure = m => void 0
ias()(fetchSync, success, failure, c)
putter(c, { close: true })(i)
})
it('should control processing flow with backpressure support', function(done) {
let c = chan(4),
i = 1,
j
let success = m => {
eq(m, ++i)
if (i === 5) return done()
}
let failure = m => void 0
ias()(fetchAsync, success, failure, c)
for (j = 1; j < 5; j++) {
putter(c)(j)
}
})
it('should invoke error callback', function(done) {
let c = chan()
let success = m => void 0
let failure = m => {
eq(m.error, _networkError)
done()
}
ias()(fetchAsyncErr, success, failure, c)
putter(c, { close: true })(true)
})
it('should timeout, report error, yield to next request', function(done) {
let c = chan(2),
failed
let success = m => {
assert.ok(failed)
eq(m, 2 + 1)
done()
}
let failure = m => {
failed = true
eq(m.value, 1)
}
ias('serial', { abandonAfter: 100 })(fetchAsyncWaitOnce(200), success, failure, c)
putter(c)(1)
putter(c)(2)
})
it('should run load processes for each source channel', function(done) {
let c1 = chan(),
c2 = chan(),
c3 = chan(),
c4 = chan(),
i = 0,
cnt = 0
let success = m => {
eq(m, ++i - cnt)
if (++cnt === 4) done()
}
let failure = m => void 0
ias()(fetchAsync, success, failure, c1, c2, c3, c4)
putter(c1, { close: true })(i)
putter(c2, { close: true })(i)
putter(c3, { close: true })(i)
putter(c4, { close: true })(i)
})
})
describe('#initializeAsyncSources #parallel', function() {
it('should run load processes in parallel each source channel', function(done) {
let c = chan(5),
i = 1,
j
let success = m => {
eq(m, ++i)
if (i === 100) return done()
else if (i === 5) i = 99
}
let failure = m => void 0
ias('parallel')(fetchAsyncWaitOnce(100), success, failure, c)
putter(c)(99)
for (j = 1; j < 5; j++) {
putter(c)(j)
}
})
})
})
| 28.617391 | 100 | 0.520814 |
28e30a7dee07717cd09aa099e490662340413ba6 | 1,455 | js | JavaScript | cypress/support/ui/auth_commands.js | ipackr/saas-ui | 291ef0aa28d24b5711c2826d2787c5651f2a863f | [
"Apache-2.0"
] | null | null | null | cypress/support/ui/auth_commands.js | ipackr/saas-ui | 291ef0aa28d24b5711c2826d2787c5651f2a863f | [
"Apache-2.0"
] | null | null | null | cypress/support/ui/auth_commands.js | ipackr/saas-ui | 291ef0aa28d24b5711c2826d2787c5651f2a863f | [
"Apache-2.0"
] | null | null | null | /// <reference types="cypress" />
import { pageDetailsMap, Pages } from 'pages/common/constants';
import {
emailField,
emailValidation,
firstNameField,
lastNameField,
passwordField,
passwordValidation,
submitButton,
termsCheckbox,
} from 'pages/auth/selectors';
import { gettingStartedContainer, homeIcon, profileIcon } from 'pages/main/selectors';
Cypress.Commands.add('runLoginFlow',
(user) => {
const { email } = user.user;
submitButton().isDisabled();
fillEmailPassword(user.user);
submitButton().isEnabled().click();
cy.checkPopUpMessage(user.signedInMessage);
cy.contains(email);
gettingStartedContainer().isVisible();
profileIcon().isVisible();
homeIcon().isVisible();
},
);
Cypress.Commands.add('runSignUpFlow',
(user) => {
const { email, firstName, lastName } = user.user;
submitButton().isDisabled();
fillEmail(email);
firstNameField().type(firstName);
lastNameField().type(lastName);
termsCheckbox().click({ force: true });
submitButton().isEnabled().click();
cy.checkPopUpMessage(user.activationEmailSentMessage);
cy.url().should('contain', pageDetailsMap[Pages.Login].url);
},
);
const fillEmailPassword = ({ email, password }) => {
fillEmail(email);
passwordField().clear().type(password);
passwordValidation().hasText('');
};
const fillEmail = (email) => {
emailField().clear().type(email);
emailValidation().hasText('');
};
| 25.086207 | 86 | 0.685223 |
28e3c214b730188b4f47215e6bb7fb9f989ca810 | 932 | js | JavaScript | src/main/resources/static/js/search.js | falia/semantic-cube | 8bb80ab7fc751cb55621189267c0e6f2d267ec43 | [
"Unlicense"
] | null | null | null | src/main/resources/static/js/search.js | falia/semantic-cube | 8bb80ab7fc751cb55621189267c0e6f2d267ec43 | [
"Unlicense"
] | null | null | null | src/main/resources/static/js/search.js | falia/semantic-cube | 8bb80ab7fc751cb55621189267c0e6f2d267ec43 | [
"Unlicense"
] | null | null | null | $(document).ready(function(){
$("#searchButton").click(function(){
var val = $("#searchField").val();
$.get( "/search/find?search=" + val +"&lang=" + $('#countryselector').val(), function( data ) {
$(".main").html( data );
}).fail(function(){
alert("An error occurred.")
});
});
$(function(){
$('.selectpicker').selectpicker();
});
$("#searchField").autocomplete({
source: function( request, response ) {
$.ajax( {
url: "search/autocomplete",
dataType: "jsonp",
data: {
term: request.term,
lang: $('#countryselector').val()
},
success: function( data ) {
response( data );
}
} );
},
minLength: 2
});
}); | 28.242424 | 105 | 0.396996 |
28e3ff3c7bf91d540d9785fed89919ae08415ff8 | 144 | js | JavaScript | tests/js/results/index.dev.js | nic-azure/compile-superhero | f31101ea361f9747dd1b27a8aef797ec1ef974b9 | [
"MIT"
] | 5 | 2020-06-13T15:07:19.000Z | 2020-11-06T14:56:32.000Z | tests/js/results/index.dev.js | nicyapi/compile-superhero | 4ab4da6554bb710c92727640d8050f45487020cd | [
"MIT"
] | 5 | 2020-06-17T06:45:35.000Z | 2021-07-12T12:17:15.000Z | tests/js/results/index.dev.js | BananaAcid/compile-superhero | f31101ea361f9747dd1b27a8aef797ec1ef974b9 | [
"MIT"
] | 4 | 2020-06-30T06:56:12.000Z | 2021-09-18T04:45:59.000Z | "use strict";
var a = [1, 2, 3].concat();
console.log(123);
//# sourceMappingURL=d:/GitHub/compile-superhero/tests/js/results/index.dev.js.map
| 24 | 82 | 0.701389 |
28e44f6a6ffe1660bbc2cee950e1c3e7772933d3 | 5,712 | js | JavaScript | src/views/TableList.js | UsamaAliChk/invoice | a591955cfd7c6efc08b3a03fc44b119549e2e7b1 | [
"MIT"
] | null | null | null | src/views/TableList.js | UsamaAliChk/invoice | a591955cfd7c6efc08b3a03fc44b119549e2e7b1 | [
"MIT"
] | null | null | null | src/views/TableList.js | UsamaAliChk/invoice | a591955cfd7c6efc08b3a03fc44b119549e2e7b1 | [
"MIT"
] | null | null | null | import React,{useState,useEffect} from "react";
//import axios from 'axios'
import {setCompanies, setCompany,setContacts} from '../redux/action/index'
import {useDispatch} from 'react-redux'
import {Link} from 'react-router-dom'
import axios from 'axios'
// react-bootstrap components
import {
FormLabel,FormControl,
Button,
Card,
Table,
Container,
Row,
Col,
} from "react-bootstrap";
import Loader from '../loader/Loading'
import CompanyAddModel from '../Models/CompanyAddModel'
import CompanyEditModel from '../Models/CompanyEditModel'
function TableList() {
const [IsOpen,setIsOpen]=useState(false)
const [companyData,setcompanyData]=useState('');
const [Edit,setEdit]=useState(false);
const [id1,setid1]=useState();
const editCompnay=(id)=>{
let s={}
for(let i=0;i<companies.length;i++){
if(companies[i].companyId===id){
s=companies[i];
}
}
setcompanyData(s);
setid1(id);
setEdit(true);
}
const dispatch=useDispatch()
const handelClick=async(id)=>{
const company= await axios
.get(`http://18.204.10.41:5000/company/${id}`)
.then(res => {return res.data})
.catch(err => console.error(err));
const contacts=await axios
.get(`http://18.204.10.41:5000/contacts/${id}`)
.then(res => {return res.data})
.catch(err => console.error(err));
dispatch(setCompany(company));
dispatch(setContacts(contacts));
}
const searchByName=(value)=>{
value=value.toUpperCase();
let data=allCompnies;
let data2=[];
for(let i=0;i<data.length;i++){
if(data[i].companyName.toUpperCase().indexOf(value)>-1){
data2.push(data[i]);
}
}
setcompnies(data2)
}
const searchByCountry=(value)=>{
value=value.toUpperCase();
let data=allCompnies;
let data2=[];
for(let i=0;i<data.length;i++){
if(data[i].Country.toUpperCase().indexOf(value)>-1){
data2.push(data[i]);
}
}
setcompnies(data2)
}
const getCompanies=async()=>{
dispatch(setCompany([]))
const data= await axios
.get("http://18.204.10.41:5000/companies")
.then(res => {console.log(res.data); return res.data})
.catch(err => console.error(err));
let invoices=await axios.get("http://18.204.10.41:5000/getNoOfInvoices")
.then(res=>{return res.data})
.catch(err=>console.log(err))
localStorage.setItem("invoiceNo",(invoices.no_Of_invoices+1).toString());
setcompnies(data)
setallCompanies(data);
setloading(false);
}
useEffect(()=>{
getCompanies();
},[])
const [allCompnies,setallCompanies]=useState([]);
const [companies,setcompnies]=useState([]);
const [loading,setloading]=useState(true);
return (
<>
<CompanyEditModel setCompanies={setcompnies} setallCompanies={setallCompanies} Edit={Edit} setEdit={setEdit} setloading={setloading} id1={id1} companyData={companyData}/>
<CompanyAddModel open={IsOpen} setopen={setIsOpen} setloading={setloading} setcompnies={setcompnies} setallCompanies={setallCompanies}/>
{
loading?
<Loader show={true}/>
:
<Container fluid>
<Row>
<Col md="10">
<Card className="strpied-tabled-with-hover">
<Card.Header>
<Card.Title as="h4">COMPANIES</Card.Title>
<p className="card-category">
Here is a the list of all companies
</p>
</Card.Header>
<Card.Body className="table-full-width table-responsive px-0">
<Row style={{marginLeft:'2px',marginBottom:'10px'}}>
<Col md="4">
<FormLabel>Search By Company Name</FormLabel>
<FormControl onChange={e=>searchByName(e.target.value)} type="text" placeholder="Company Name"></FormControl>
</Col>
<Col md="4">
<FormLabel>Search By Country Name</FormLabel>
<FormControl onChange={e=>searchByCountry(e.target.value)} type="text" placeholder="Country Name"></FormControl>
</Col>
<Col>
<Button onClick={e=>{setIsOpen(true); console.log(IsOpen)}} style={{marginTop:"25px",height:'40px'}}>ADD COMPANY</Button>
</Col>
</Row>
<Table className="table-hover table-striped">
<thead>
</thead>
<tbody>
{
companies.length>0 ?
companies.map(e=>{
return (
<tr>
<td><img src={e.logoUrl} style={{height:"30px",width:"auto"}} /></td>
<td ><Link to={'user'} onClick={e1=>{handelClick(e.companyId)}} style={{textTransform:'uppercase'}}>{e.companyName}</Link></td>
<td>{e.chairPersonName}</td>
<td style={{textTransform:'uppercase'}}>{e.Country}</td>
<td className="editIcon" onClick={e1=>{editCompnay(e.companyId)}}><i class="far fa-edit"></i></td>
</tr>
)
}): <Card.Header>
<Card.Title as="h4">NO COMPANY HAS BEEN FOUND</Card.Title>
</Card.Header>
}
</tbody>
</Table>
</Card.Body>
</Card>
</Col>
</Row>
</Container>
}
</>
);
}
export default TableList;
| 31.910615 | 174 | 0.545168 |
28e47ba1fdfe790a7f022283bf4970eff02a50f8 | 2,647 | js | JavaScript | src/store/layout.js | whitehorse1234/sing-app-vue-dashboard | 40f1f3bb3f880647d38afa3aa2d3d236f53950dc | [
"MIT"
] | null | null | null | src/store/layout.js | whitehorse1234/sing-app-vue-dashboard | 40f1f3bb3f880647d38afa3aa2d3d236f53950dc | [
"MIT"
] | null | null | null | src/store/layout.js | whitehorse1234/sing-app-vue-dashboard | 40f1f3bb3f880647d38afa3aa2d3d236f53950dc | [
"MIT"
] | null | null | null | import isScreen from '@/core/screenHelper';
export const MessageStates = {
READ: "read",
NEW: "new",
HIDDEN: "hidden"
};
Object.freeze(MessageStates);
export default {
namespaced: true,
state: {
sidebarClose: false,
sidebarStatic: false,
sidebarActiveElement: null,
chatOpen: false,
chatNotificationIcon: false,
chatNotificationPopover: false,
chatNotificationMessageState: MessageStates.HIDDEN,
},
mutations: {
initApp(state) {
setTimeout(() => {
state.chatNotificationIcon = true;
state.chatNotificationPopover = true;
setTimeout(() => {
state.chatNotificationPopover = false;
}, 1000 * 6);
}, 1000 * 4);
},
readMessage(state) {
if (state.chatNotificationMessageState !== MessageStates.READ)
state.chatNotificationMessageState = MessageStates.READ;
},
toggleChat(state) {
state.chatOpen = !state.chatOpen;
if (state.chatNotificationIcon) {
state.chatNotificationIcon = false;
}
if (state.chatNotificationMessageState === MessageStates.HIDDEN) {
setTimeout(() => {
state.chatNotificationMessageState = MessageStates.NEW;
}, 1000);
}
},
toggleSidebar(state) {
const nextState = !state.sidebarStatic;
localStorage.sidebarStatic = nextState;
state.sidebarStatic = nextState;
if (!nextState && (isScreen('lg') || isScreen('xl'))) {
state.sidebarClose = true;
}
},
switchSidebar(state, value) {
if (value) {
state.sidebarClose = value;
} else {
state.sidebarClose = !state.sidebarClose;
}
},
handleSwipe(state, e) {
if ('ontouchstart' in window) {
if (e.direction === 4 && !state.chatOpen) {
state.sidebarClose = false;
}
if (e.direction === 2 && !state.sidebarClose) {
state.sidebarClose = true;
return;
}
state.chatOpen = e.direction === 2;
}
},
changeSidebarActive(state, index) {
state.sidebarActiveElement = index;
},
},
actions: {
initApp({commit}) {
commit('initApp');
},
readMessage({commit}) {
commit('readMessage');
},
toggleChat({ commit }) {
commit('toggleChat');
},
toggleSidebar({ commit }) {
commit('toggleSidebar');
},
switchSidebar({ commit }, value) {
commit('switchSidebar', value);
},
handleSwipe({ commit }, e) {
commit('handleSwipe', e);
},
changeSidebarActive({ commit }, index) {
commit('changeSidebarActive', index);
},
},
};
| 24.738318 | 72 | 0.586324 |
28e515e10a79f92dcc480b8b17338122dd12acc4 | 1,130 | js | JavaScript | test/mock.js | cape-io/redux-field | fe9b0d9563107f70d979fe47e97a7944a7db71d8 | [
"MIT"
] | 15 | 2016-02-11T16:01:15.000Z | 2019-04-17T19:27:44.000Z | test/mock.js | cape-io/redux-field | fe9b0d9563107f70d979fe47e97a7944a7db71d8 | [
"MIT"
] | null | null | null | test/mock.js | cape-io/redux-field | fe9b0d9563107f70d979fe47e97a7944a7db71d8 | [
"MIT"
] | null | null | null | import { combineReducers, createStore } from 'redux'
import reducer, { REDUCER_KEY } from '../src'
export const store = createStore(combineReducers({ [REDUCER_KEY]: reducer }))
export const emptyGetStateResult = {
blur: false,
dragCount: 0,
error: null,
errorMessage: null,
focus: false,
hasError: false,
id: null,
initialValue: null,
invalid: {},
invalidValue: null,
isClosed: true,
isDirty: false,
isEditing: false,
isOpen: false,
isPristine: true,
isSaved: false,
isSaving: false,
isTouched: false,
isValid: false,
meta: null,
savedProgress: 0,
savedValue: null,
status: null,
suggestion: null,
valid: {},
validValue: null,
value: null,
}
export const fieldEvent = [
'clear', 'clearError', 'close', 'error', 'invalid',
'meta', 'open', 'save', 'saved', 'savedProgress', 'valid',
]
export const formEvent = [
'onBlur', 'onChange', 'onFocus', 'onInput', 'onSubmit',
]
export const formHandler = [
'handleBlur', 'handleChange', 'handleFocus', 'handleInput', 'handleSubmit',
]
export const nativeEvent = {
nativeEvent: true,
target: {
value: 'Kumbaya',
},
}
| 22.156863 | 77 | 0.666372 |
28e55e27ef19cf2e6c5dc5cbca2d31315130d131 | 1,176 | js | JavaScript | lib/doc-source.js | pmuellr/node-doc-browser | 540ba80e2f158425601b38325a258e852a33fcc4 | [
"MIT"
] | null | null | null | lib/doc-source.js | pmuellr/node-doc-browser | 540ba80e2f158425601b38325a258e852a33fcc4 | [
"MIT"
] | null | null | null | lib/doc-source.js | pmuellr/node-doc-browser | 540ba80e2f158425601b38325a258e852a33fcc4 | [
"MIT"
] | null | null | null | 'use strict'
const request = require('request')
const yieldCallback = require('yield-callback')
exports.getNodeVersions = yieldCallback(getNodeVersionsGen)
exports.getIndexJSON = yieldCallback(getIndexJSONGen)
const DistIndexJSON = 'https://nodejs.org/dist/index.json'
// Return the Node.js versions array in the callback.
function * getNodeVersionsGen (cb) {
let [err, res, body] = yield request(DistIndexJSON, cb)
if (err) return err
if (res.statusCode !== 200) {
return new Error(`http status ${res.statusCode} from ${DistIndexJSON}`)
}
let versions
try {
versions = JSON.parse(body)
} catch (err) {
return err
}
// need to return an array here, since versions is also an array
return [null, versions]
}
// Return the index.json content for a specific version.
function * getIndexJSONGen (version, cb) {
const url = `https://nodejs.org/dist/${version}/docs/api/index.json`
let [err, res, body] = yield request(url, cb)
if (err) return err
if (res.statusCode !== 200) {
return new Error(`http status ${res.statusCode} from ${url}`)
}
try {
return [null, JSON.parse(body)]
} catch (err) {
return err
}
}
| 24.5 | 75 | 0.685374 |
28e64bfe4aa0717dd5a56d097be86e8005587665 | 560 | js | JavaScript | node_modules/laravel-mix/src/components/DisableNotifications.js | siddhartha-bhattarai/component3 | 14154b6f3ab5c10307435c5eb377e90bd42dec57 | [
"MIT"
] | null | null | null | node_modules/laravel-mix/src/components/DisableNotifications.js | siddhartha-bhattarai/component3 | 14154b6f3ab5c10307435c5eb377e90bd42dec57 | [
"MIT"
] | null | null | null | node_modules/laravel-mix/src/components/DisableNotifications.js | siddhartha-bhattarai/component3 | 14154b6f3ab5c10307435c5eb377e90bd42dec57 | [
"MIT"
] | null | null | null | class DisableNotifications {
/**
* The API name for the component.
*/
name() {
return ['disableNotifications', 'disableSuccessNotifications'];
}
/**
* Register the component.
*/
register() {
if (this.caller === 'disableSuccessNotifications') {
Config.notifications = {
onSuccess: false,
onFailure: true
};
} else {
Config.notifications = false;
}
}
}
module.exports = DisableNotifications;
| 22.4 | 72 | 0.501786 |
28e685246a3c8257223acc28c4eff9d3a9d0c5a7 | 3,291 | js | JavaScript | Labs/Azure Services/Blockchain on Azure (Rate My Professor)/Resources/index.js | kungenAntmar/computerscience | 444fa4e714d150bed930980ce5902e1012e2766a | [
"MIT"
] | 3 | 2020-04-11T19:23:49.000Z | 2020-04-14T18:32:51.000Z | Labs/Azure Services/Blockchain on Azure (Rate My Professor)/Resources/index.js | kungenAntmar/computerscience | 444fa4e714d150bed930980ce5902e1012e2766a | [
"MIT"
] | null | null | null | Labs/Azure Services/Blockchain on Azure (Rate My Professor)/Resources/index.js | kungenAntmar/computerscience | 444fa4e714d150bed930980ce5902e1012e2766a | [
"MIT"
] | 4 | 2020-04-11T18:25:02.000Z | 2020-04-11T19:54:57.000Z | const Web3 = require('web3');
var express = require('express');
var bodyParser = require('body-parser');
var path = require('path');
var app = express();
var etherUrl = "ENDPOINT_URL";
var account = "ACCOUNT_ADDRESS";
var contract = "CONTRACT_ADDRESS";
var httpPort = 8080;
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider(etherUrl));
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(function(req, res, next) {
console.log(req.method + " " + req.url);
next();
});
app.use(express.static("public"));
app.get("/ratings", function(req, res) {
res.sendFile(path.join(__dirname + "/public/ratings.html"));
});
var abi = [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "id",
"type": "uint256"
}
],
"name": "newRating",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "professorID",
"type": "uint256"
},
{
"name": "comment",
"type": "string"
},
{
"name": "stars",
"type": "uint256"
}
],
"name": "addRating",
"outputs": [
{
"name": "ratingID",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getRatingsCount",
"outputs": [
{
"name": "count",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "index",
"type": "uint256"
}
],
"name": "getRating",
"outputs": [
{
"name": "professorID",
"type": "uint256"
},
{
"name": "comment",
"type": "string"
},
{
"name": "stars",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
];
contractInstance = new web3.eth.Contract(abi, contract);
app.get("/count", function (req, res) {
contractInstance.methods.getRatingsCount().call(function(error, count) {
if (error) {
res.status(500).send(error);
}
else {
res.status = 200;
res.json(count);
}
});
});
app.get("/rating/:index", function (req, res) {
contractInstance.methods.getRating(parseInt(req.params.index)).call(function(error, comment) {
if (error) {
res.status(500).send(error);
}
else {
res.status = 200;
res.json({
"professorID": parseInt(comment.professorID),
"comment": comment.comment,
"stars": parseInt(comment.stars)
});
}
});
});
app.post("/add", function (req, res) {
contractInstance.methods.addRating(parseInt(req.body.professorId), req.body.comment, parseInt(req.body.stars)).send({ from: account, gas:500000 }, function(error, transactionHash) {
if (error) {
res.status(500).send(error) ;
}
else {
res.status = 200;
res.json({ id: 0 });
}
});
});
app.listen(httpPort, function () {
console.log("Listening on port " + httpPort);
}); | 20.961783 | 182 | 0.51261 |
28e6b1d3414df5480e11691b73909fe2578f991b | 5,472 | js | JavaScript | files/rxjs/2.2.20/rx.binding.min.js | isaackwan/jsdelivr | 8fd58a1cad97aacc58f9723b81f06ff231ceed60 | [
"MIT"
] | 5 | 2015-02-20T16:11:30.000Z | 2017-05-15T11:50:44.000Z | files/rxjs/2.2.20/rx.binding.min.js | isaackwan/jsdelivr | 8fd58a1cad97aacc58f9723b81f06ff231ceed60 | [
"MIT"
] | null | null | null | files/rxjs/2.2.20/rx.binding.min.js | isaackwan/jsdelivr | 8fd58a1cad97aacc58f9723b81f06ff231ceed60 | [
"MIT"
] | 5 | 2015-01-23T17:09:43.000Z | 2021-09-22T11:48:20.000Z | (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(){if(this.isDisposed)throw new Error(r)}var e=c.Observable,f=e.prototype,g=c.AnonymousObservable,h=c.Subject,i=c.AsyncSubject,j=c.Observer,k=c.internals.ScheduledObserver,l=c.Disposable.create,m=c.Disposable.empty,n=c.CompositeDisposable,o=c.Scheduler.currentThread,p=c.internals.inherits,q=c.internals.addProperties,r="Object has been disposed";f.multicast=function(a,b){var c=this;return"function"==typeof a?new g(function(d){var e=c.multicast(a());return new n(b(e).subscribe(d),e.connect())}):new v(c,a)},f.publish=function(a){return a?this.multicast(function(){return new h},a):this.multicast(new h)},f.share=function(){return this.publish(null).refCount()},f.publishLast=function(a){return a?this.multicast(function(){return new i},a):this.multicast(new i)},f.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new t(b)},a):this.multicast(new t(a))},f.shareValue=function(a){return this.publishValue(a).refCount()},f.replay=function(a,b,c,d){return a?this.multicast(function(){return new u(b,c,d)},a):this.multicast(new u(b,c,d))},f.replayWhileObserved=function(a,b,c){return this.replay(null,a,b,c).refCount()};var s=function(a,b){this.subject=a,this.observer=b};s.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var t=c.BehaviorSubject=function(a){function b(a){if(d.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new s(this,a);var b=this.exception;return b?a.onError(b):a.onCompleted(),m}function c(c){a.call(this,b),this.value=c,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return p(c,a),q(c.prototype,j,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(d.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(d.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,e=b.length;e>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(d.call(this),!this.isStopped){this.value=a;for(var b=this.observers.slice(0),c=0,e=b.length;e>c;c++)b[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),c}(e),u=c.ReplaySubject=function(a){function b(a,b){this.subject=a,this.observer=b}function c(a){var c=new k(this.scheduler,a),e=new b(this,c);d.call(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)c.onNext(this.q[g].value);return this.hasError?(f++,c.onError(this.error)):this.isStopped&&(f++,c.onCompleted()),c.ensureActive(f),e}function e(b,d,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==d?Number.MAX_VALUE:d,this.scheduler=e||o,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,c)}return b.prototype.dispose=function(){if(this.observer.dispose(),!this.subject.isDisposed){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1)}},p(e,a),q(e.prototype,j,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){var b;if(d.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)b=e[f],b.onNext(a),b.ensureActive()}},onError:function(a){var b;if(d.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)b=e[f],b.onError(a),b.ensureActive();this.observers=[]}},onCompleted:function(){var a;if(d.call(this),!this.isStopped){this.isStopped=!0;var b=this.scheduler.now();this._trim(b);for(var c=this.observers.slice(0),e=0,f=c.length;f>e;e++)a=c[e],a.onCompleted(),a.ensureActive();this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(e),v=c.ConnectableObservable=function(a){function b(b,c){function d(a){return e.subject.subscribe(a)}var e={subject:c,source:b.asObservable(),hasSubscription:!1,subscription:null};this.connect=function(){return e.hasSubscription||(e.hasSubscription=!0,e.subscription=new n(e.source.subscribe(e.subject),l(function(){e.hasSubscription=!1}))),e.subscription},a.call(this,d)}return p(b,a),b.prototype.connect=function(){return this.connect()},b.prototype.refCount=function(){var a=null,b=0,c=this;return new g(function(d){var e,f;return b++,e=1===b,f=c.subscribe(d),e&&(a=c.connect()),l(function(){f.dispose(),b--,0===b&&a.dispose()})})},b}(e);return c}); | 5,472 | 5,472 | 0.737025 |
28e7e9849ce1a75b54fe8506ef47badf75fdd95c | 5,888 | js | JavaScript | components/charts/Sparkline.js | stevenblair/vue-sparklines | 4fabdde06652487f1c6801b53fa9ff9bebe56d89 | [
"MIT"
] | 48 | 2018-04-12T09:34:18.000Z | 2021-12-14T20:45:43.000Z | components/charts/Sparkline.js | stevenblair/vue-sparklines | 4fabdde06652487f1c6801b53fa9ff9bebe56d89 | [
"MIT"
] | 13 | 2018-08-30T09:37:41.000Z | 2021-12-03T06:43:38.000Z | components/charts/Sparkline.js | stevenblair/vue-sparklines | 4fabdde06652487f1c6801b53fa9ff9bebe56d89 | [
"MIT"
] | 23 | 2018-04-12T09:34:19.000Z | 2022-02-27T01:44:46.000Z | import Vue from 'vue'
import Line from './Line'
import Curve from './Curve'
import Bar from './Bar'
import Pie from './Pie'
import MaxZIndex from './mixins'
export default {
name: 'sparkline',
mixins: [MaxZIndex],
props: {
width: {
type: [Number, String],
default: 100
},
height: {
type: [Number, String],
default: 30
},
preserveAspectRatio: {
type: String,
default: 'none'
},
margin: {
type: Number,
default: 2
},
styles: {
type: Object,
default: () => ({})
},
indicatorStyles: {
type: [Object, Boolean],
default: () => ({
stroke: 'red'
})
},
tooltipProps: {
type: Object,
default: () => ({
formatter () {
return null
}
})
},
tooltipStyles: {
type: Object,
default: () => ({
position: 'absolute',
display: 'none',
background: 'rgba(0, 0, 0, 0.6)',
borderRadius: '3px',
minWidth: '30px',
padding: '3px',
color: '#fff',
fontSize: '12px'
})
}
},
data () {
return {
datum: {},
curEvt: {},
onFocus: false
}
},
created () {
this.bus.$on('setValue', val => {
const { data, points, color, limit } = val
this.datum[val.id] = {
data: data.length >= limit ? data.slice(-limit) : data,
points,
color
}
Object.keys(this.curEvt).length && this.updateData()
})
},
mounted () {
const fragment = document.createDocumentFragment()
fragment.appendChild(this.$refs.sparklineTooltip)
document.body.appendChild(fragment)
},
beforeDestroy () {
const tooltip = this.$refs.sparklineTooltip
tooltip && tooltip.parentNode.removeChild(tooltip)
},
computed: {
bus () {
return new Vue()
}
},
methods: {
setStatus (status = true) {
const indicator = this.$refs.sparklineIndicator
const tooltip = this.$refs.sparklineTooltip
tooltip && (tooltip.style.display = status ? '' : 'none')
indicator && (indicator.style.display = status ? '' : 'none')
},
updateData () {
if (!this.onFocus) {
return false
}
let rect
let curData
let tooltipContent = ''
const tooltip = this.$refs.sparklineTooltip
for (let datum in this.datum) {
curData = null
if (this.datum.hasOwnProperty(datum)) {
this.setStatus(false)
for (let [index, pos] of this.datum[datum].points.entries()) {
if (this.curEvt.ox < pos.x && curData === null) {
this.setStatus()
rect = tooltip.getBoundingClientRect()
curData = {
value: this.datum[datum].data[index],
color: this.datum[datum].color,
index
}
tooltipContent += `<span style="color:${curData.color};">•</span> ${curData.value}<br />`
}
}
}
}
if (rect) {
tooltip.style.left = `${this.curEvt.cx + rect.width * .25}px`
tooltip.style.top = `${this.curEvt.cy - rect.height}px`
tooltip.style.zIndex = this.zIndex
try {
tooltip.innerHTML = this.tooltipProps.formatter(curData) || tooltipContent
} catch (e) {
return (tooltip.innerHTML = tooltipContent)
}
}
}
},
render (h) {
const {
width,
height,
preserveAspectRatio,
styles,
indicatorStyles
} = this
const svgOpts = {
viewBox: `0 0 ${width} ${height}`,
preserveAspectRatio
}
styles.width = `${parseInt(width, 10)}px`
styles.height = `${parseInt(height, 10)}px`
const rootProps = this.$props
indicatorStyles && (rootProps.bus = this.bus)
const slots = this.$slots.default
return h('div', {
'class': 'sparkline-wrap'
}, [
h('svg', {
style: styles,
attrs: svgOpts,
on: {
mousemove: evt => {
if (indicatorStyles) {
const ox = evt.offsetX || evt.layerX
const oy = evt.offsetY || evt.layerY
const cx = evt.clientX
const cy = evt.clientY
this.curEvt = {
ox,
oy,
cx,
cy,
target: evt.target
}
const indicator = this.$refs.sparklineIndicator
indicator.setAttribute('x1', ox)
indicator.setAttribute('x2', ox)
}
this.onFocus = true
this.updateData()
},
mouseleave: () => {
this.onFocus = false
this.setStatus(false)
}
}
}, (() => {
const items = slots.map(item => {
const tag = item.tag
const props = Object.assign({}, rootProps, item.data && item.data.attrs || {})
if (tag === 'sparklineLine') {
return h(Line, { props })
} else if (tag === 'sparklineCurve') {
return h(Curve, { props })
} else if (tag === 'sparklineBar') {
return h(Bar, { props })
} else {
return h(Pie, { props })
}
})
if (indicatorStyles) {
indicatorStyles['shape-rendering'] = 'crispEdges'
indicatorStyles['display'] = 'none'
items.push(h('line', {
style: indicatorStyles,
attrs: {
x1: 0,
y1: 0,
x2: 0,
y2: height
},
ref: 'sparklineIndicator'
}))
}
return items
})()),
h('div', {
'class': 'sparkline-tooltip',
style: this.tooltipStyles,
ref: 'sparklineTooltip'
})
])
}
}
| 24.533333 | 113 | 0.488281 |
28e7fef315182081606a061db4658cf3b122fb06 | 970 | js | JavaScript | news-service/newsapi.js | cerebrium/frontend-challenge | 3cd8e7b49b36c3326d67bdaae4be7f61ee8cc732 | [
"Apache-2.0"
] | null | null | null | news-service/newsapi.js | cerebrium/frontend-challenge | 3cd8e7b49b36c3326d67bdaae4be7f61ee8cc732 | [
"Apache-2.0"
] | null | null | null | news-service/newsapi.js | cerebrium/frontend-challenge | 3cd8e7b49b36c3326d67bdaae4be7f61ee8cc732 | [
"Apache-2.0"
] | null | null | null | /* eslint-disable prettier/prettier */
/* eslint-disable consistent-return */
/* eslint-disable no-console */
require('dotenv').config()
const NewsAPI = require('newsapi')
const newsapi = new NewsAPI(process.env.NEWS_API_KEY).v2
module.exports.headlines = async (params) => newsapi.topHeadlines(params)
module.exports.everything = async (params) => newsapi.everything(params)
module.exports.fetchArticles = async (type, params) => {
switch (type) {
case 'headlines':
return exports
.headlines(params)
.then((data) => {
console.log('found: ', data.totalResults)
return data.articles
})
.catch((e) => console.error(e))
case 'search':
return exports
.everything(params)
.then((data) => {
console.log('found: ', data.totalResults)
return data.articles
})
.catch((e) => console.error(e))
default:
console.log('none')
break
}
}
| 26.944444 | 73 | 0.613402 |
28e88222f0cdbb96416fac282441c85a100483c4 | 602 | js | JavaScript | dashboard/backend/dashboard/dashboard.js | sjuhyeon/discord-dashboard-template | ba5ea5c1aa6015237b91f74148106e9c628a15b0 | [
"MIT"
] | 1 | 2021-09-05T13:11:29.000Z | 2021-09-05T13:11:29.000Z | dashboard/backend/dashboard/dashboard.js | sjuhyeon/discord-dashboard-template | ba5ea5c1aa6015237b91f74148106e9c628a15b0 | [
"MIT"
] | null | null | null | dashboard/backend/dashboard/dashboard.js | sjuhyeon/discord-dashboard-template | ba5ea5c1aa6015237b91f74148106e9c628a15b0 | [
"MIT"
] | null | null | null | const express = require('express')
const index = express.Router();
const config = require('config')
const Discord = require('discord.js')
const lowdb = require('lowdb');
const fileSync = require('lowdb/adapters/FileSync')
const dataFile = new fileSync('config/default.json');
const datas = lowdb(dataFile);
module.exports = function (passport, checkAuth, client, renderTemplate, error) {
datas.read();
index.route('/dashboard').get(checkAuth, async (req, res) => {
renderTemplate(res, req, "dashboard.ejs", { perms: Discord.Permissions, data: datas});
})
return index;
} | 30.1 | 94 | 0.692691 |
28e8f5838f2c0dff2cb9a65720017d140bd56376 | 534 | js | JavaScript | public/js/new-essay-management.js | luantnguyen/Luolympic | 468b44fc11c7573ba97f781cdcb1cbfc1897dde9 | [
"MIT"
] | 1 | 2019-03-19T14:47:51.000Z | 2019-03-19T14:47:51.000Z | public/js/new-essay-management.js | luantnguyen/Luolympic | 468b44fc11c7573ba97f781cdcb1cbfc1897dde9 | [
"MIT"
] | null | null | null | public/js/new-essay-management.js | luantnguyen/Luolympic | 468b44fc11c7573ba97f781cdcb1cbfc1897dde9 | [
"MIT"
] | null | null | null | function resetQuestion() {
document.getElementsByClassName("richText-editor")[0].innerHTML = "";
}
function createEssayQuestion() {
var answer = document.getElementById("the_answer").value;
if (answer == "")
document.getElementById("err-mess").innerHTML = "<i class='fa fa-times'></i> Đáp án không được phép rỗng";
else {
var questionContent = document.getElementsByClassName("richText-editor")[0].innerHTML;
document.getElementById("question_content").value = questionContent;
document.forms["essay-form"].submit();
}
} | 38.142857 | 108 | 0.737828 |
28e929268a7169e537fb850bcfa274ca90005bee | 5,023 | js | JavaScript | modules/React/views/admin/pages/components/form/ClassRelationForm.js | chunghsien/pinpin-react | d15841b92b8ee320a6a19be2b0ee5906002dda45 | [
"MIT"
] | 2 | 2020-11-09T07:21:34.000Z | 2020-11-09T14:46:24.000Z | modules/React/views/admin/pages/components/form/ClassRelationForm.js | chunghsien/pinpin-react | d15841b92b8ee320a6a19be2b0ee5906002dda45 | [
"MIT"
] | null | null | null | modules/React/views/admin/pages/components/form/ClassRelationForm.js | chunghsien/pinpin-react | d15841b92b8ee320a6a19be2b0ee5906002dda45 | [
"MIT"
] | null | null | null | import React, { useEffect, useState, useRef } from 'react';
import { connect } from "react-redux";
import { useTranslation } from 'react-i18next';
import {
CRow, CCol, CFormGroup, CLabel,
CCard,
CInvalidFeedback,
CTabContent, CTabPane
} from '@coreui/react'
import { useForm } from "react-hook-form";
import Form from '../Form';
import Select from 'react-select';
const ClassRelationForm = (props) => {
const { t } = useTranslation(['translation']);
const methods = useForm({ mode: 'all' });
const { register, errors } = methods;
const matcher = location.pathname.match(/\/\d+$/);
let href = props.href;
if (location.pathname.match(/\/\d+$/)) {
href = href.replace(/\/$/, '') + matcher[0];
} else {
href += 'add';
}
let self_id_value = '';
if (matcher && matcher[0]) {
self_id_value = matcher[0].replace(/^\//, '');
}
const [remaining, setRemaining] = useState({});
const selectMenuStyles = {
menu: (provided/*, state*/) => {
return {
...provided,
fontSize: '0.95rem'
}
},
container: (provided/*, state*/) => {
return {
...provided,
fontSize: '0.95rem'
}
}
};
const remainderChange = (e) => {
let dom = null;
if (e && typeof e.preventDefault == 'function') {
e.preventDefault();
dom = e.target;
} else {
dom = e;
}
let name = dom.name;
let tObj = {};
tObj[name] = dom.value.length;
//setRemaining({ ...remaining, ...tObj });
setRemaining((remaining) => ({ ...remaining, ...tObj }));
return remaining[name];
}
const [reactSelectOptions, setReactSelectOptions] = useState({
options: {},
values: {}
});
const NC = 0;
const { self, parent, bind } = props.classRelation;
const self_id_name = self + '_id';
const parent_id_name = parent + '_id';
const { formRows } = props;
const bindRow = formRows ? formRows[bind] : null;
const [selectDefaultValue, setSelectDefaultValue] = useState([]);
useEffect(() => {
if (bindRow) {
setReactSelectOptions({
options: bindRow.options,
values: bindRow.values
});
var _selectDefaultValue = [];
bindRow.values[parent].forEach((item) => {
_selectDefaultValue.push(item.value);
});
setSelectDefaultValue(_selectDefaultValue);
}
}, [bindRow, NC]);
const formRef = useRef();
const parentClassChange = (options) => {
if(!Array.isArray(options)) {
options = [options];
}
var value = [];
if (options) {
options.forEach((item) => {
value.push(item.value);
});
setSelectDefaultValue(value);
//formRef.current.elements[parent_id_name].value = value.join(',');
} else {
formRef.current.elements[parent_id_name].value = '';
}
setReactSelectOptions((reactSelectOptions) => {
let values = {};
values[parent] = options;
return {
...reactSelectOptions,
values: values
}
});
}
//console.log(reactSelectOptions.values);
const isMulti = typeof props.isMulti != 'undefined' ? props.isMulti : true;
return (
<CTabContent>
<CTabPane data-tab="class-releation-form">
<CCard className="tab-card">
<Form
innerRef={formRef}
href={href}
griduse
{...methods}
{...props}
remainderChange={remainderChange}
setReactSelectOptions={setReactSelectOptions}
selectOnChanges={[parentClassChange]}
>
<input type="hidden" name={self_id_name} ref={register()} value={self_id_value} />
<CRow className="mt-2">
<CCol>
<CFormGroup>
<CLabel>{t('columns-name')}</CLabel>
<Select
styles={selectMenuStyles}
name={parent + '_container'}
placeholder={t("isUseOptionsDefault")}
isMulti={isMulti}
options={reactSelectOptions.options[parent]}
value={reactSelectOptions.values[parent]}
onChange={parentClassChange}
/>
<input
className={errors[parent_id_name] && 'is-invalid'}
name={parent_id_name}
type="hidden"
ref={register()}
defaultValue={selectDefaultValue.join(",")}
/>
<CInvalidFeedback>{
(
errors[parent_id_name] &&
errors[parent_id_name].type == 'required') && t('The input is an empty string')}</CInvalidFeedback>
</CFormGroup>
</CCol>
</CRow>
</Form>
</CCard>
</CTabPane>
</CTabContent>
);
}
const mapStateToProps = (state) => {
return {
formRows: state.formRows
};
};
export default connect(mapStateToProps)(ClassRelationForm); | 28.378531 | 121 | 0.545491 |
28e949e6a56b84d756f207e96fba1be1ae127f3b | 4,117 | js | JavaScript | src/desktop/components/article/test/image_set.test.js | zephraph/force | ab5a9a12aff78fff1ab92ff101dc23ef8d5272b3 | [
"MIT"
] | 1 | 2021-06-27T13:17:37.000Z | 2021-06-27T13:17:37.000Z | src/desktop/components/article/test/image_set.test.js | GinXian/force | 827573a86d2345506b7ea32d5b15eaf66f647451 | [
"MIT"
] | null | null | null | src/desktop/components/article/test/image_set.test.js | GinXian/force | 827573a86d2345506b7ea32d5b15eaf66f647451 | [
"MIT"
] | null | null | null | /*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const _ = require("underscore")
const benv = require("benv")
const sinon = require("sinon")
const Backbone = require("backbone")
const CurrentUser = require("../../../models/current_user")
const fixtures = require("../../../test/helpers/fixtures.coffee")
const sd = require("sharify").data
const { resolve } = require("path")
const { fabricate } = require("@artsy/antigravity")
const { stubChildClasses } = require("../../../test/helpers/stubs")
describe("ImageSetView", function () {
beforeEach(function (done) {
return benv.setup(() => {
benv.expose({
$: benv.require("jquery"),
jQuery: benv.require("jquery"),
_s: benv.require("underscore.string"),
})
Backbone.$ = $
$.fn.imagesLoaded = function () {}
this.ImageSetView = benv.requireWithJadeify(
resolve(__dirname, "../client/image_set"),
["template"]
)
this.ImageSetView.__set__("Image", function () {})
this.ImageSetView.__set__("resize", url => url)
this.ImageSetView.__set__("Follow", {
Following: sinon.stub(),
FollowButton: sinon.stub(),
})
this.flickity = {
navigation: {
flickity: {
select: (this.select = sinon.stub()),
next: (this.next = sinon.stub()),
previous: (this.previous = sinon.stub()),
},
},
}
this.ImageSetView.__set__(
"initCarousel",
sinon.stub().returns(this.flickity)
)
stubChildClasses(
this.ImageSetView,
this,
["addFollowButton", "setupFollowButtons"],
[]
)
this.user = sinon.stub()
this.collection = [
{
type: "image",
caption: "This is a caption",
url: "http://image.com/img.png",
},
{
type: "artwork",
artist: { name: "Van Gogh", slug: "van-gogh" },
partner: { name: "Partner Gallery" },
title: "Starry Night",
image: "http://partnergallery.com/image.png",
slug: "van-gogh-starry-night",
date: "1999",
},
]
sinon.stub(Backbone, "sync")
this.view = new this.ImageSetView({
el: $("body"),
items: this.collection,
user: this.user,
startIndex: 0,
_s,
})
this.view.carousel = this.flickity
return done()
})
})
afterEach(function () {
benv.teardown()
return Backbone.sync.restore()
})
describe("slideshow is functional", function () {
it("iterates to the next page on next", function () {
this.view.next()
return this.next.called.should.be.true()
})
it("loops back to the beginning on last image", function () {
this.view.next()
this.view.next()
return this.next.callCount.should.equal(2)
})
return it("iterates to previous page on previous", function () {
this.view.next()
this.view.previous()
this.next.callCount.should.equal(1)
return this.previous.callCount.should.equal(1)
})
})
return describe("#render", function () {
it("renders a regular image", function () {
this.view.render()
this.view.$el.html().should.containEql("1/2")
this.view.$el.html().should.containEql("This is a caption")
return this.view.$el.html().should.containEql("http://image.com/img.png")
})
return it("renders an artwork on next()", function () {
this.view.render()
this.view.next()
this.view.$el.html().should.containEql("2/2")
this.view.$el.html().should.containEql("Starry Night")
this.view.$el.html().should.containEql("Partner Gallery")
this.view.$el.html().should.containEql("van-gogh-starry-night")
this.view.$el.html().should.containEql("1999")
return this.view.$el
.html()
.should.containEql("http://partnergallery.com/image.png")
})
})
})
| 30.954887 | 90 | 0.582706 |
28e9febfe4ac3c718cdec4219c33aab255d06099 | 165 | js | JavaScript | resources/assets/js/menu-header.js | danmooney/slackleaderboard | 2f035fdc09e355a9a62c724632d87879405d8e28 | [
"MIT"
] | 1 | 2017-05-02T14:36:40.000Z | 2017-05-02T14:36:40.000Z | resources/assets/js/menu-header.js | danmooney/slackleaderboard | 2f035fdc09e355a9a62c724632d87879405d8e28 | [
"MIT"
] | null | null | null | resources/assets/js/menu-header.js | danmooney/slackleaderboard | 2f035fdc09e355a9a62c724632d87879405d8e28 | [
"MIT"
] | null | null | null | $('nav .list').on('mouseenter', function () {
$(this).addClass('hover');
}).on('mouseleave', _.debounce(function () {
$(this).removeClass('hover');
}, 250)); | 33 | 45 | 0.581818 |
28ea74ec51f80dcafb70fc106eb2cb81aac92a41 | 326 | js | JavaScript | src/components/Header/index.js | isaac-martin/gatsby-ip | 46adbc32c60d962564c74d3faa5764bb8c9bac14 | [
"MIT"
] | null | null | null | src/components/Header/index.js | isaac-martin/gatsby-ip | 46adbc32c60d962564c74d3faa5764bb8c9bac14 | [
"MIT"
] | 6 | 2021-03-10T00:21:27.000Z | 2021-10-06T08:04:43.000Z | src/components/Header/index.js | isaac-martin/gatsby-ip | 46adbc32c60d962564c74d3faa5764bb8c9bac14 | [
"MIT"
] | null | null | null | import {Link} from 'gatsby';
import React from 'react';
import {Container} from '../Layout/layout.styles';
import * as SC from './styles';
const Header = ({siteTitle}) => (
<SC.Header>
<Container>
<h1>
<Link to="/">{siteTitle}</Link>
</h1>
</Container>
</SC.Header>
);
export default Header;
| 19.176471 | 50 | 0.592025 |
28eb4711480734a9725cc913443d5f1ba4fd32ea | 1,058 | js | JavaScript | entry/tabs.js | fratercula/puffin | 94b72ea031904a48446d26dc1407bca24e0fe65e | [
"MIT"
] | null | null | null | entry/tabs.js | fratercula/puffin | 94b72ea031904a48446d26dc1407bca24e0fe65e | [
"MIT"
] | 1 | 2018-08-23T01:34:26.000Z | 2018-09-01T04:52:49.000Z | entry/tabs.js | fratercula/puffin | 94b72ea031904a48446d26dc1407bca24e0fe65e | [
"MIT"
] | null | null | null | import React from 'react'
import PropTypes from 'prop-types'
import * as antd from 'antd'
import { C } from '../src'
const T = antd.Tabs
function Tabs({ props, children }) {
const {
tabBarExtraContent, // eslint-disable-line
...rest
} = props
return (
<T
tabBarExtraContent={(<C {...tabBarExtraContent} />)}
{...rest}
>
{
children.map((item, i) => {
const { props: childProps = {} } = item
const { disabled, tab, ...childRest } = childProps
const node = { ...item, node: 'div', props: childRest }
return (
<T.TabPane
key={i}
disabled={disabled}
tab={(<C {...tab} components={{ ...antd }} />)}
>
<C {...node} components={{ ...antd }} />
</T.TabPane>
)
})
}
</T>
)
}
Tabs.propTypes = {
props: PropTypes.object,
children: PropTypes.array,
}
Tabs.defaultProps = {
props: {},
children: [],
}
Tabs.puffinParse = false
export default Tabs
| 19.962264 | 65 | 0.50189 |
28eca3d270ceabb09da82109a3cf5c1ba2ed470b | 3,233 | js | JavaScript | controllers/api/question-routes.js | mani29jan/quiz-app | 5bc06562dab04ca9eb128b37d8fa163b24192b61 | [
"OML"
] | null | null | null | controllers/api/question-routes.js | mani29jan/quiz-app | 5bc06562dab04ca9eb128b37d8fa163b24192b61 | [
"OML"
] | null | null | null | controllers/api/question-routes.js | mani29jan/quiz-app | 5bc06562dab04ca9eb128b37d8fa163b24192b61 | [
"OML"
] | null | null | null | const router = require('express').Router();
const { Question } = require('../../models');
router.get('/', (req, res) => {
Question.findAll({
// attributes: ['id', 'cat_number', 'category', 'question', 'correct_answer', 'answer1', 'answer2', 'answer3', 'answer4']
})
.then(dbQuestionData => res.json(dbQuestionData))
.catch(err => {
console.log(err);
res.status(500).json(err);
});
});
router.get('/Romance', (req, res) => {
Question.findAll({
attributes: ['id', 'cat_number', 'category', 'question', 'correct_answer', 'answer1', 'answer2', 'answer3', 'answer4'],
where: { category: 'Romance' },
},
)
.then(dbQuestionData => res.json(dbQuestionData))
.catch(err => {
console.log(err);
res.status(500).json(err);
});
});
router.get('/Horror', (req, res) => {
Question.findAll({
attributes: ['id', 'cat_number', 'category', 'question', 'correct_answer', 'answer1', 'answer2', 'answer3', 'answer4'],
where: { category: 'Horror' },
},
)
.then(dbQuestionData => res.json(dbQuestionData))
.catch(err => {
console.log(err);
res.status(500).json(err);
});
});
router.get('/Action', (req, res) => {
Question.findAll({
attributes: ['id', 'cat_number', 'category', 'question', 'correct_answer', 'answer1', 'answer2', 'answer3', 'answer4'],
where: { category: 'Action' },
},
)
.then(dbQuestionData => res.json(dbQuestionData))
.catch(err => {
console.log(err);
res.status(500).json(err);
});
});
router.get('/Comedy', (req, res) => {
Question.findAll({
attributes: ['id', 'cat_number', 'category', 'question', 'correct_answer', 'answer1', 'answer2', 'answer3', 'answer4'],
where: { category: 'Comedy' },
},
)
.then(dbQuestionData => res.json(dbQuestionData))
.catch(err => {
console.log(err);
res.status(500).json(err);
});
});
router.get('/Sci-Fi', (req, res) => {
Question.findAll({
attributes: ['id', 'cat_number', 'category', 'question', 'correct_answer', 'answer1', 'answer2', 'answer3', 'answer4'],
where: { category: 'Fantasy/Sci-Fi' },
},
)
.then(dbQuestionData => res.json(dbQuestionData))
.catch(err => {
console.log(err);
res.status(500).json(err);
});
});
router.get('/All', (req, res) => {
Question.findAll({
attributes: ['id', 'cat_number', 'category', 'question', 'correct_answer', 'answer1', 'answer2', 'answer3', 'answer4'],
where: { category: 'All' },
},
)
.then(dbQuestionData => res.json(dbQuestionData))
.catch(err => {
console.log(err);
res.status(500).json(err);
});
});
router.post('/', (req, res) => {
// expects {username: 'Lernantino', email: 'lernantino@gmail.com', password: 'password1234'}
User.create({
cat_number: req.body.cat_number,
category: req.body.category,
question: req.body.question,
correct_answer: req.body.correct_answer,
answer1: req.body.answer1,
answer2: req.body.answer2,
answer3: req.body.answer3,
answer4: req.body.answer4,
})
.then(dbUserData => res.json(dbUserData))
.catch(err => {
console.log(err);
res.status(500).json(err);
});
});
module.exports = router; | 28.113043 | 125 | 0.589855 |
28ecb0208b5c2c3b5127a0fd2f1c7a4e69637e61 | 1,199 | js | JavaScript | models/defaultInvoice.js | gabizz/e-factura-ubl-ro | 0748634cad4f0db500ae81582a63bfc0862dc7ae | [
"MIT"
] | null | null | null | models/defaultInvoice.js | gabizz/e-factura-ubl-ro | 0748634cad4f0db500ae81582a63bfc0862dc7ae | [
"MIT"
] | null | null | null | models/defaultInvoice.js | gabizz/e-factura-ubl-ro | 0748634cad4f0db500ae81582a63bfc0862dc7ae | [
"MIT"
] | null | null | null | import moment from "moment";
export const DEFAULTINVOICE = {
nr: 1,
dt: moment(new Date()).format('YYYY-MM-DD'),
vat: true,
invoiceType: 380,
currency: "RON",
supplier: {
name: "MAFTEI PFA",
legalForm: "PFA",
cif: "34612616",
iban: "RO67BTRLRONCRT0302934301",
bank: "BTRL",
address: "SPL.G-RAL GH.MAGHERU, bl.304B, ap.26",
city: "ARAD",
county: "AR",
country: "RO",
email: "gmaftei@gmail.com",
phone: "+40744845974",
representative: {
name: "MAFTEI GABRIEL",
phone: "0744845974",
email: "gmaftei@gmail.com",
}
},
customer: {
name: "COMUNA ZERIND",
legalForm: "PUB",
cif: "3519364",
iban: "RO14TREZ02124510220XXXXX",
bank: "TREZ",
address: "ZERIND, STR. PRINCIPALA, NR.1",
city: "ZERIND",
county: "AR",
country: "RO",
email: "gmaftei@gmail.com",
phone: "+40744845974",
representative: {
name: "SIMANDI ALEXANDRU",
phone: "000000000",
email: "primaria@zerind.ro",
}
},
items: []
} | 26.065217 | 56 | 0.499583 |
28ed195cf0aef77f4723721c57e06b28f95978a5 | 541 | js | JavaScript | config/connection.js | edurank/dashboard-covid | 26418d4ff8db70f2f3509f729c4cbc1ae8a2224a | [
"MIT"
] | null | null | null | config/connection.js | edurank/dashboard-covid | 26418d4ff8db70f2f3509f729c4cbc1ae8a2224a | [
"MIT"
] | null | null | null | config/connection.js | edurank/dashboard-covid | 26418d4ff8db70f2f3509f729c4cbc1ae8a2224a | [
"MIT"
] | 1 | 2021-04-17T22:38:38.000Z | 2021-04-17T22:38:38.000Z | var mysql = require('mysql');
// Conexão ao banco de dados
module.exports = function () {
var connection = mysql.createConnection({
host : 'localhost',
database : 'epivision',
user : 'root',
password : '',
});
connection.connect(function(err) {
if(err) {
console.error("Erro ao conectar: " + err.stack);
return false;
}
});
connection.query("SET lc_time_names = 'pt_PT';", function(e, res){});
return connection;
}
| 21.64 | 74 | 0.524954 |
28eddfa0a23b868555e51386741e36fa0990ce20 | 559 | js | JavaScript | src/__tests__/components/Body.js | emersonlaurentino/conf | 107f5b82510a1e24b7354214719743c0731ec8b5 | [
"MIT"
] | null | null | null | src/__tests__/components/Body.js | emersonlaurentino/conf | 107f5b82510a1e24b7354214719743c0731ec8b5 | [
"MIT"
] | null | null | null | src/__tests__/components/Body.js | emersonlaurentino/conf | 107f5b82510a1e24b7354214719743c0731ec8b5 | [
"MIT"
] | null | null | null | import React from 'react';
import ReactDOM from 'react-dom';
import { shallow } from 'enzyme';
import TestUtils from 'react-addons-test-utils';
import Body from '../../components/Body';
import Logo from '../../components/Logo';
import ActionButton from '../../components/ActionButton';
describe('<Body />', () => {
const wrapper = shallow(<Body />);
it('render Logo', () => {
expect(wrapper.find(Logo)).toHaveLength(1); // passes
});
it('render ActionButton', () => {
expect(wrapper.find(ActionButton)).toHaveLength(1); // passes
});
});
| 27.95 | 65 | 0.649374 |
28ee5b00a85b7fb7b2e594b829e4c6340f17e581 | 1,707 | js | JavaScript | majo.js | Hardik3117/DASHBOARD1 | ce257b81a6d3c461c89d3cc4954504151ec377a3 | [
"MIT"
] | 1 | 2022-02-02T07:27:22.000Z | 2022-02-02T07:27:22.000Z | majo.js | Hardik3117/DASHBOARD1 | ce257b81a6d3c461c89d3cc4954504151ec377a3 | [
"MIT"
] | null | null | null | majo.js | Hardik3117/DASHBOARD1 | ce257b81a6d3c461c89d3cc4954504151ec377a3 | [
"MIT"
] | 1 | 2022-02-01T21:40:55.000Z | 2022-02-01T21:40:55.000Z | // Majo.exe
const chalk = require("chalk");
require("dotenv").config();
require("./utilities/ascii");
require("./utilities/checks");
if (!process.env.TOKEN) return console.log(chalk.bold(chalk.red(`[X]`)) + chalk.bold.redBright(` Skipping everything! Token is not provided!`));
console.log(chalk.bold(chalk.blue(`[❔]`) + chalk.cyan(` Green`) + chalk.green(` ">" `) + chalk.cyan(`= logs from Majo.exe Bot`)));
console.log(chalk.bold(chalk.blue(`[❔]`) + chalk.cyan(` Magenta`) + chalk.magenta(` ">" `) + chalk.cyan(`= logs from Majo.exe Dashboard`)));
console.log(chalk.bold(chalk.blue(`[❔]`) + chalk.cyan(` Red`) + chalk.red(` ">" `) + chalk.cyan(`= logs from Majo.exe API`)));
if (process.argv.includes(`--bot`)) {
console.log(chalk.bold(chalk.green(`[✅]`)) + chalk.bold.greenBright(` Running Majo.exe Bot! (1/3) `));
require("./bot/index");
} else {
console.log(chalk.bold(chalk.red(`[❌]`)) + chalk.bold.red(` Skipping Bot launch! (1/3) `) + chalk.bold.red.dim(`[Run script with "--bot" argument]`));
}
if (process.argv.includes(`--dashboard`)) {
console.log(chalk.bold(chalk.green(`[✅]`)) + chalk.bold.greenBright(` Running Majo.exe Dashboard! (2/3) `));
require("./dashboard/dashboard");
} else {
console.log(chalk.bold(chalk.red(`[❌]`)) + chalk.bold.red(` Skipping Dashboard launch! (2/3) `) + chalk.bold.red.dim(`[Run script with "--dashboard" argument]`));
}
if (process.argv.includes(`--api`)) {
console.log(chalk.bold(chalk.green(`[✅]`)) + chalk.bold.greenBright(` Running Majo.exe API! (3/3) `));
//require("./api/index")
} else {
console.log(chalk.bold(chalk.red(`[❌]`)) + chalk.bold.red(` Skipping API launch! (3/3) `) + chalk.bold.red.dim(`[Run script with "--api" argument]`));
}
| 51.727273 | 163 | 0.642648 |
28ee77d0917b4d74c09a1f85a44971746db8a212 | 8,189 | js | JavaScript | dist/js/1.js | tw352066187/heimammm | 03e57fe0f4b5ec0a7351cf14cec0478e5e6bb1e3 | [
"MIT"
] | null | null | null | dist/js/1.js | tw352066187/heimammm | 03e57fe0f4b5ec0a7351cf14cec0478e5e6bb1e3 | [
"MIT"
] | null | null | null | dist/js/1.js | tw352066187/heimammm | 03e57fe0f4b5ec0a7351cf14cec0478e5e6bb1e3 | [
"MIT"
] | null | null | null | webpackJsonp([1],{223:function(t,s,i){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var n=i(260),a=i(235),e=(i(267),i(80)),o=Object(e.a)(a.a,n.a,n.b,!1,null,"35cba95c",null);o.options.__file="src\\components\\shopcart\\shopcart.vue",s.default=o.exports},235:function(t,s,i){"use strict";var n=i(236);s.a=n.a},236:function(t,s,i){"use strict";(function(t){var n=i(262),a=i(81);s.a={data:function(){return{goodsList:[]}},components:{subShopccart:n.a},created:function(){this.getShopData()},computed:{getTotalCount:function(){var t=0;return this.goodsList.forEach(function(s){s.isSelected&&(t+=s.buycount)}),t},getTltalMoney:function(){var t=0;return this.goodsList.forEach(function(s){s.isSelected&&(t+=s.buycount*s.sell_price)}),t}},methods:{getOrder:function(){var t=[];if(0==this.goodsList.length)return void this.$message({message:"至少选择一件商品",type:"warning"});this.goodsList.forEach(function(s){s.isSelected&&t.push(s.id)}),this.$router.push({path:"/site/order/"+t.join()})},continueBuy:function(){this.$router.push({path:"/site/goodslist"})},deleteGoods:function(t){var s=this;this.$confirm("确定要删除id为"+t+"的商品吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var i=s.goodsList.findIndex(function(s){if(s.id==t)return!0});s.goodsList.splice(i,1),s.$store.commit("deletaGooods",t)}).catch(function(){})},goodsChange:function(t){this.goodsList.forEach(function(s){s.id==t.id&&(s.buycount=t.count)}),this.$store.commit("updateCount",t)},getShopData:function(){var s=this,i=Object(a.d)(),n=[];for(var e in i)n.push(e);var o="site/comment/getshopcargoods/"+n.join();t.get(o).then(function(t){t.data.message.forEach(function(t){t.buycount=i[t.id],t.isSelected=!0}),s.goodsList=t.data.message}).catch(function(t){})}}}}).call(s,i(20))},237:function(t,s,i){"use strict";var n=i(238);s.a=n.a},238:function(t,s,i){"use strict";s.a={props:["goodsCount","goodsId"],data:function(){return{count:1}},created:function(){this.count=this.goodsCount},methods:{plus:function(){this.count++,this.notify()},subtract:function(){this.count>1&&this.count--,this.notify()},notify:function(){var t={id:this.goodsId,count:this.count};this.$emit("goodsCountchange",t)}}}},239:function(t,s,i){var n=i(266);"string"==typeof n&&(n=[[t.i,n,""]]);var a={hmr:!0};a.transform=void 0,a.insertInto=void 0;i(220)(n,a);n.locals&&(t.exports=n.locals)},240:function(t,s,i){var n=i(268);"string"==typeof n&&(n=[[t.i,n,""]]);var a={hmr:!0};a.transform=void 0,a.insertInto=void 0;i(220)(n,a);n.locals&&(t.exports=n.locals)},260:function(t,s,i){"use strict";var n=i(261);i.d(s,"a",function(){return n.a}),i.d(s,"b",function(){return n.b})},261:function(t,s,i){"use strict";i.d(s,"a",function(){return n}),i.d(s,"b",function(){return a});var n=function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",[t._m(0),t._v(" "),i("div",{staticClass:"section"},[i("div",{staticClass:"wrapper"},[i("div",{staticClass:"bg-wrap"},[t._m(1),t._v(" "),i("div",{staticClass:"cart-box"},[i("input",{attrs:{id:"jsondata",name:"jsondata",type:"hidden"}}),t._v(" "),i("table",{staticClass:"cart-table",attrs:{width:"100%",align:"center",border:"0",cellspacing:"0",cellpadding:"8"}},[i("tbody",[t._m(2),t._v(" "),t._l(t.goodsList,function(s){return i("tr",{key:s.id},[i("td",{attrs:{width:"48",align:"center"}},[i("el-switch",{attrs:{"active-color":"#409eff","inactive-color":"#555555"},model:{value:s.isSelected,callback:function(i){t.$set(s,"isSelected",i)},expression:"item.isSelected"}})],1),t._v(" "),i("td",{attrs:{align:"left",colspan:"2"}},[i("div",{staticClass:"shopInfo"},[i("img",{staticStyle:{width:"50px",height:"50px","margin-right":"10px"},attrs:{src:s.img_url,alt:""}}),t._v(" "),i("span",[t._v(t._s(s.title))])])]),t._v(" "),i("td",{attrs:{width:"84",align:"left"}},[t._v(t._s(s.sell_price))]),t._v(" "),i("td",{attrs:{width:"104",align:"center"}},[i("subShopccart",{attrs:{goodsId:s.id,goodsCount:s.buycount},on:{goodsCountchange:t.goodsChange}})],1),t._v(" "),i("td",{attrs:{width:"104",align:"left"}},[t._v(t._s(s.sell_price*s.buycount))]),t._v(" "),i("td",{attrs:{width:"54",align:"center"}},[i("a",{attrs:{href:""},on:{click:function(i){i.preventDefault(),t.deleteGoods(s.id)}}},[t._v("删除")])])])}),t._v(" "),0==t.goodsList.length?i("tr",[t._m(3)]):t._e(),t._v(" "),i("tr",[i("th",{attrs:{align:"right",colspan:"8"}},[t._v("\n 已选择商品\n "),i("b",{staticClass:"red",attrs:{id:"totalQuantity"}},[t._v(t._s(t.getTotalCount))]),t._v(" 件 商品总金额(不含运费):\n "),i("span",{staticClass:"red"},[t._v("¥")]),t._v(" "),i("b",{staticClass:"red",attrs:{id:"totalAmount"}},[t._v(t._s(t.getTltalMoney))]),t._v("元\n ")])])],2)])]),t._v(" "),i("div",{staticClass:"cart-foot clearfix"},[i("div",{staticClass:"right-box"},[i("button",{staticClass:"button",on:{click:t.continueBuy}},[t._v("继续购物")]),t._v(" "),i("button",{staticClass:"submit",on:{click:t.getOrder}},[t._v("立即结算")])])])])])])])},a=[function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{staticClass:"section"},[i("div",{staticClass:"location"},[i("span",[t._v("当前位置:")]),t._v(" "),i("a",{attrs:{href:"/index.html"}},[t._v("首页")]),t._v(" >\n "),i("a",{attrs:{href:"/cart.html"}},[t._v("购物车")])])])},function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{staticClass:"cart-head clearfix"},[i("h2",[i("i",{staticClass:"iconfont icon-cart"}),t._v("我的购物车")]),t._v(" "),i("div",{staticClass:"cart-setp"},[i("ul",[i("li",{staticClass:"first active"},[i("div",{staticClass:"progress"},[i("span",[t._v("1")]),t._v("\n 放进购物车\n ")])]),t._v(" "),i("li",[i("div",{staticClass:"progress"},[i("span",[t._v("2")]),t._v("\n 填写订单信息\n ")])]),t._v(" "),i("li",{staticClass:"last"},[i("div",{staticClass:"progress"},[i("span",[t._v("3")]),t._v("\n 支付/确认订单\n ")])])])])])},function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("tr",[i("th",{attrs:{width:"48",align:"center"}},[i("a",[t._v("选择")])]),t._v(" "),i("th",{attrs:{align:"left",colspan:"2"}},[t._v("商品信息")]),t._v(" "),i("th",{attrs:{width:"84",align:"left"}},[t._v("单价")]),t._v(" "),i("th",{attrs:{width:"104",align:"center"}},[t._v("数量")]),t._v(" "),i("th",{attrs:{width:"104",align:"left"}},[t._v("金额(元)")]),t._v(" "),i("th",{attrs:{width:"54",align:"center"}},[t._v("操作")])])},function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("td",{attrs:{colspan:"10"}},[i("div",{staticClass:"msg-tips"},[i("div",{staticClass:"icon warning"},[i("i",{staticClass:"iconfont icon-tip"})]),t._v(" "),i("div",{staticClass:"info"},[i("strong",[t._v("购物车没有商品!")]),t._v(" "),i("p",[t._v("您的购物车为空,\n "),i("a",{attrs:{href:"/index.html"}},[t._v("马上去购物")]),t._v("吧!")])])])])}];n._withStripped=!0},262:function(t,s,i){"use strict";var n=i(263),a=i(237),e=(i(265),i(80)),o=Object(e.a)(a.a,n.a,n.b,!1,null,"0d1b3c50",null);o.options.__file="src\\components\\subShopcart\\subShopcart.vue",s.a=o.exports},263:function(t,s,i){"use strict";var n=i(264);i.d(s,"a",function(){return n.a}),i.d(s,"b",function(){return n.b})},264:function(t,s,i){"use strict";i.d(s,"a",function(){return n}),i.d(s,"b",function(){return a});var n=function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",[i("div",{staticClass:"left",on:{click:t.subtract}},[t._v("-")]),t._v(" "),i("div",{staticClass:"center"},[t._v(t._s(t.count))]),t._v(" "),i("div",{staticClass:"right",on:{click:t.plus}},[t._v("+")])])},a=[];n._withStripped=!0},265:function(t,s,i){"use strict";var n=i(239),a=i.n(n);a.a},266:function(t,s,i){s=t.exports=i(219)(!1),s.push([t.i,"div>div[data-v-0d1b3c50]{display:inline-block;width:30px;height:30px;border:1px solid #ddd;text-align:center;line-height:30px}",""])},267:function(t,s,i){"use strict";var n=i(240),a=i.n(n);a.a},268:function(t,s,i){s=t.exports=i(219)(!1),s.push([t.i,".shopInfo[data-v-35cba95c]{display:flex;align-items:center}",""])}}); | 8,189 | 8,189 | 0.605202 |
28ef0936e05097257e12fa21a90bf229339a44e1 | 7,331 | js | JavaScript | src/components/Pin.js | Office-of-Digital-Innovation/DigitalCovid19VaccineRecord-UI | 7238c6b2bbef49c2ac27a7b35376bf4fb11635b3 | [
"CC0-1.0"
] | null | null | null | src/components/Pin.js | Office-of-Digital-Innovation/DigitalCovid19VaccineRecord-UI | 7238c6b2bbef49c2ac27a7b35376bf4fb11635b3 | [
"CC0-1.0"
] | null | null | null | src/components/Pin.js | Office-of-Digital-Innovation/DigitalCovid19VaccineRecord-UI | 7238c6b2bbef49c2ac27a7b35376bf4fb11635b3 | [
"CC0-1.0"
] | null | null | null | /* eslint-disable react-hooks/exhaustive-deps */
import React, { useState, useEffect } from "react";
import Card from "@material-ui/core/Card";
import CardActions from "@material-ui/core/CardActions";
import CircularProgress from "@material-ui/core/CircularProgress";
import TextField from "@material-ui/core/TextField";
import { makeStyles } from '@material-ui/core/styles';
import { Trans, useTranslation } from "react-i18next";
const Pin = ({ pin, setPin, setQr, setUser, id, setHealthCard, lang, walletCode }) => {
const [loading, setLoading] = useState(false);
const { i18n } = useTranslation();
const [errorMessage, setErrorMessage] = useState({});
const changeLanguage = (language) => {
i18n.changeLanguage(language);
};
useEffect(() => {
// console.log('the current state for Wallet Code is...2', walletCode);
changeLanguage(lang);
}, [walletCode]);
const [error, setError] = useState({
FirstName: false,
LastName: false,
Phone: false,
Email: false,
Pin: false,
Date: false
})
const { CREDENTIALS_API_QR } = window.config;
const getBlobUrl = (data, type) => {
const byteCharacters = atob(data);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob([byteArray], { type: type });
return URL.createObjectURL(blob);
};
const submitPin = (e) => {
const credentialData = walletCode !== null ? {
Id: id,
Pin: pin,
WalletCode: walletCode
} : {
Id: id,
Pin: pin,
}
e.preventDefault();
let status = 0;
setLoading(true);
fetch(`${CREDENTIALS_API_QR}/vaccineCredential`, {
method: "POST",
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(credentialData)
})
.then((res) => {
if (res.status === 404) {
setErrorMessage({ type: 'pinErrorMsg3', message: "Error: The PIN entered is incorrect or you've passed the 24-hour limit to retrieve your DCVR. Please try again or start over at the DCVR portal." });
setLoading(false);
}
else if (res.status === 429) {
setErrorMessage({ type: 'pinErrorMsg4', message: "Please try your request again in 1 minute." });
setLoading(false);
}
else if (res.status === 422) {
setErrorMessage({ type: 'pinErrorMsg5', message: "We are currently experiencing difficulties accessing your record. Please start over at the DCVR portal in 24 hours. If you still experience issues, please submit a remediation request through our " + <a href={'https://chat.myturn.ca.gov/?id=17'} style={{ display: "inline", color: "#0D6EFD", margin: "0 0", textDecoration: "underline" }}>Virtual Assitant</a> + "." });
setLoading(false);
}
else if (res.status !== 200) {
setLoading(false);
setErrorMessage({ type: 'pinErrorMsg6', message: "Could not complete the request, please retry later." });
}
status = res.status;
return res.json();
})
.then((data) => {
if (status === 200) {
setUser(data);
setQr(getBlobUrl(data.fileContentQr, data.mimeTypeQr));
setHealthCard(
getBlobUrl(data.fileContentSmartCard, data.mimeTypeSmartCard)
);
setLoading(false);
}
})
.catch((err) => {
setLoading(false);
setErrorMessage({ type: 'pinErrorMsg6', message: "Could not connect right now, please retry later." });
});
};
const numbersOnly = (e) => {
if (e.target.value.length === 4) {
e.target.style.background = "repeating-linear-gradient(90deg, dimgrey 0, dimgrey 1ch, transparent 0, transparent 1.5ch) 0 100%/100% 2px no-repeat";
setError({ ...error, Pin: false });
}
const numsOnly = e.target.value.replace(/[^0-9]/g, "");
setPin(numsOnly);
};
const useStyles = makeStyles({
underline: {
"&&&:before": {
borderBottom: "none"
},
"&&:after": {
borderBottom: "none"
}
}
});
const classes = useStyles();
return (
<div className="pin-container" style={{ margin: "30px" }}>
<form onSubmit={submitPin} id={"main"}>
<Card
className="MuiRootCard"
style={{ border: "none", boxShadow: "none" }}
>
<label htmlFor={'partitioned'} style={{ display: 'block' }}>
<h1
style={{ color: "#F06724", fontSize: "24px", marginBottom: "25px" }}
>
<Trans i18nKey="qrpage.pincode">PIN CODE:</Trans>
</h1>
</label>
<div>
<p style={{ marginLeft: "0" }}>
<Trans i18nKey="vaccineform.enterPin">Please enter the PIN code you created to request access to your
vaccine record.</Trans>
</p>
</div>
<TextField
inputProps={{
autoComplete: "off",
type: 'tel',
name: "PIN",
value: pin,
onChange: numbersOnly,
maxLength: 4,
minLength: 4,
required: true,
onBlur: (e) => e.target.value.length < 4 ? [e.target.style.background = "repeating-linear-gradient(90deg, #f44336 0, #f44336 1ch, transparent 0, transparent 1.5ch) 0 100%/100% 2px no-repeat", setError({ ...error, Pin: true })] : [e.target.style.background = "repeating-linear-gradient(90deg, dimgrey 0, dimgrey 1ch, transparent 0, transparent 1.5ch) 0 100%/100% 2px no-repeat", setError({ ...error, Pin: false })]
}}
InputProps={{
className: classes.underline
}}
id="partitioned"
/>
<CardActions style={{ padding: "8px 0px" }}>
{loading ? (
<CircularProgress />
) : (
<button
style={{
borderRadius: "50px",
padding: '10px 30px',
backgroundColor: pin ? "#22489C" : "gray",
color: "white",
height: '50px',
margin: "0px",
marginTop: "30px",
width: '123px',
}}
type="submit"
size="small"
disabled={!pin}
>
<Trans i18nKey="vaccineform.submitbutton">Submit</Trans>
</button>
)}
</CardActions>
</Card>
<div style={{ color: 'red' }}>
{errorMessage.message ?
<Trans i18nKey={`vaccineform.${errorMessage.type}`}>
<a href={'https://myvaccinerecord.cdph.ca.gov/'} style={{ display: "inline", color: "#0D6EFD", margin: "0 0", textDecoration: "underline" }}>
{errorMessage.message}
</a>
<a href={'https://chat.myturn.ca.gov/?id=17'} style={{ display: "inline", color: "#0D6EFD", margin: "0 0", textDecoration: "underline" }}>
{errorMessage.message}
</a>
</Trans> :
''}
</div>
</form>
</div>
);
};
export default Pin;
| 34.744076 | 428 | 0.549448 |
28ef6c3ef522a6863a5a31d5c4463785115f4e6d | 702 | js | JavaScript | src/components/common/BlogLayout/Icons/Item.js | TheGiwi/george-mutambuka | d0b09f5b36cfe3a5da33667d06b4ccf2662e1b50 | [
"MIT"
] | null | null | null | src/components/common/BlogLayout/Icons/Item.js | TheGiwi/george-mutambuka | d0b09f5b36cfe3a5da33667d06b4ccf2662e1b50 | [
"MIT"
] | null | null | null | src/components/common/BlogLayout/Icons/Item.js | TheGiwi/george-mutambuka | d0b09f5b36cfe3a5da33667d06b4ccf2662e1b50 | [
"MIT"
] | null | null | null | import React, { Component } from 'react'
import { extendParentClass, extend } from '../../../../utils/classes'
import { string } from 'prop-types'
export class Item extends Component {
static propTypes = {
href: string.isRequired,
alt: string.isRequired,
icon: string.isRequired,
}
baseClass = extendParentClass.bind(this)('item')
render() {
const link = extend(this.baseClass, 'link')
const image = extend(link, 'icon')
const { href, alt, icon } = this.props
return (
<li className={this.baseClass}>
<a href={href} className={link}>
<img src={icon} alt={alt} className={image} />
</a>
</li>
)
}
}
export default Item
| 24.206897 | 69 | 0.61396 |
28efae66f4e44fecfb562b9063658800d5cdb971 | 4,451 | js | JavaScript | server/controllers/project-controller.js | YOHO-LAB/bi-dashboard | fa183f80bb1226ed536ea4a57fd072e32d0e6339 | [
"MIT"
] | 7 | 2018-05-31T07:46:26.000Z | 2019-04-15T10:08:18.000Z | server/controllers/project-controller.js | YOHO-LAB/bi-dashboard | fa183f80bb1226ed536ea4a57fd072e32d0e6339 | [
"MIT"
] | 1 | 2018-12-13T02:49:22.000Z | 2018-12-13T02:49:22.000Z | server/controllers/project-controller.js | YOHO-LAB/bi-dashboard | fa183f80bb1226ed536ea4a57fd072e32d0e6339 | [
"MIT"
] | 2 | 2020-07-05T09:36:16.000Z | 2021-03-11T13:23:22.000Z | const Controller = require('../framework/controller');
const sequelize = require('sequelize');
const _ = require('lodash');
const {BiProjects} = require('../db');
const Op = sequelize.Op;
class ProjectController extends Controller {
constructor(projectService) {
super();
this.projectService = projectService;
}
static route() {
return [
{ path: '/fetch-list', action: 'FetchList', purview: '0207' },
{ path: '/fetch-data', action: 'FetchData', purview: '0207' },
{ path: '/save-data', method: 'post', action: 'SaveData', purview: '0201' },
{ path: '/delete-data', action: 'DeleteData', purview: '0203' },
];
}
async FetchList(req, res) {
let {page = 1, size = 10} = req.query;
page = _.parseInt(page);
size = _.parseInt(size);
if (page < 1 || size <= 0 || size > 100) {
return res.json({
code: 400
});
}
let where = {};
if (this.$user.roleId !== 1) {
where = {
[Op.or]: [{
create_user: this.$user.userId
}, {
is_public: 1,
create_role: this.$user.roleId
}]
};
}
const queryData = await BiProjects.findAndCountAll({
attributes: Object.keys(BiProjects.attributes).concat([
[sequelize.literal('(SELECT count(*) FROM `bi_project_worksheets` WHERE `bi_project_worksheets`.`project_id` = `BiProjects`.`id`)'), 'sumWorksheet'],
[sequelize.literal('(SELECT count(*) FROM `bi_project_views` WHERE `bi_project_views`.`project_id` = `BiProjects`.`id`)'), 'sumView'],
[sequelize.literal('(SELECT count(*) FROM `bi_project_sources` WHERE `bi_project_sources`.`project_id` = `BiProjects`.`id`)'), 'sumSource'],
[sequelize.literal(`(SELECT count(distinct bi_project_views.id) FROM bi_project_views LEFT JOIN bi_project_view_roles ON bi_project_views.id = bi_project_view_roles.view_id WHERE (bi_project_views.create_user = ${this.$user.userId} or bi_project_view_roles.role_id = ${this.$user.roleId}) AND bi_project_views.project_id = BiProjects.id)`), 'visibleSumView']
]),
where,
offset: (page - 1) * size,
limit: size
});
res.json({
code: 200,
data: queryData
});
}
async FetchData(req, res) {
const id = req.query.id;
if (!id) {
return res.json({
code: 400
});
}
const queryData = await BiProjects.find({
attributes: Object.keys(BiProjects.attributes).concat([
[sequelize.literal('(SELECT count(*) FROM `bi_project_worksheets` WHERE `bi_project_worksheets`.`project_id` = `BiProjects`.`id`)'), 'sumWorksheet'],
[sequelize.literal('(SELECT count(*) FROM `bi_project_views` WHERE `bi_project_views`.`project_id` = `BiProjects`.`id`)'), 'sumView'],
[sequelize.literal('(SELECT count(*) FROM `bi_project_sources` WHERE `bi_project_sources`.`project_id` = `BiProjects`.`id`)'), 'sumSource']
]),
where: {
id
}
});
res.json({
code: 200,
data: queryData
});
}
async SaveData(req, res) {
const {project_name, project_intro, is_public, id} = req.body;
if (!project_name || !project_intro) {
return res.json({
code: 400
});
}
if (id) {
const projectData = await BiProjects.find({
where: {
id
}
});
if (!projectData) {
return res.json({
code: 404,
message: 'not found project'
});
}
Object.assign(projectData, {
project_name,
project_intro,
is_public,
create_user: this.$user.userId,
create_role: this.$user.roleId,
});
await projectData.save();
return res.json({
code: 200
});
} else {
const result = await BiProjects.create({
project_name,
project_intro,
create_user: this.$user.userId,
create_role: this.$user.roleId,
is_public
});
res.json({
code: 200,
data: result
});
}
}
async DeleteData(req, res) {
const id = req.query.id;
if (!id) {
return res.json({
code: 400
});
}
const projectData = await BiProjects.findById(id);
if (!projectData) {
return res.json({
code: 404
});
}
await this.projectService.deleteProject(id);
return res.json({
code: 200
});
}
}
module.exports = ProjectController;
| 28.350318 | 366 | 0.58279 |
28f006f4a455e4466ca5ea3a14d60d8c9c89a0f7 | 774 | js | JavaScript | old/front-end/algorithm/intermediate/romanNumConverter.js | jolav/freeCodeCamp | 90ac637f42615b74b0772848bc1256055ee6fcf5 | [
"BSD-3-Clause"
] | null | null | null | old/front-end/algorithm/intermediate/romanNumConverter.js | jolav/freeCodeCamp | 90ac637f42615b74b0772848bc1256055ee6fcf5 | [
"BSD-3-Clause"
] | null | null | null | old/front-end/algorithm/intermediate/romanNumConverter.js | jolav/freeCodeCamp | 90ac637f42615b74b0772848bc1256055ee6fcf5 | [
"BSD-3-Clause"
] | 4 | 2018-04-12T04:24:48.000Z | 2021-05-07T14:53:21.000Z | // jshint esversion: 6
function convertToRoman (num) {
let result = '';
let ones, tens, hunds, thous;
const hundsA = ['C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'];
const tensA = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'];
const onesA = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
thous = Math.floor(num / 1000);
hunds = Math.floor(num % 1000 / 100);
tens = Math.floor(num % 100 / 10);
ones = Math.floor(num % 10);
console.log(thous, hunds, tens, ones);
for (let i = 0; i < thous;i++) {
result += 'M';
}
if (hunds) {
result += hundsA[hunds - 1];
}
if (tens) {
result += tensA[tens - 1];
}
if (ones) {
result += onesA[ones - 1];
}
return result;
}
console.log(convertToRoman(36));
| 25.8 | 74 | 0.520672 |
28f029abf0ea309bb5983e35ea0a83952c224d39 | 2,657 | js | JavaScript | src/components/common/AMap/FilledAreaReverse.js | SkyWongHZ/react-dva-demo | 81725cfda3f0ae5c15d37ff7104da8f4209a41e2 | [
"MIT"
] | null | null | null | src/components/common/AMap/FilledAreaReverse.js | SkyWongHZ/react-dva-demo | 81725cfda3f0ae5c15d37ff7104da8f4209a41e2 | [
"MIT"
] | null | null | null | src/components/common/AMap/FilledAreaReverse.js | SkyWongHZ/react-dva-demo | 81725cfda3f0ae5c15d37ff7104da8f4209a41e2 | [
"MIT"
] | null | null | null | import React from 'react';
import PropTypes from 'prop-types';
import APILoader from 'react-amap/lib/utils/APILoader'
class FilledAreaReverse extends React.Component {
constructor (props) {
super(props)
this.loader = new APILoader({key: props.amapkey, useAMapUI: true}).load();
}
componentDidMount() {
this.loader.then(() => {
const { AMap, AMapUI } = window;
const { __map__, location, areaStyle } = this.props;
let bounds = null;
const polygonStyle = {
lineJoin: 'round',
strokeWeight: 1, //线宽
strokeColor: '#01BCEB',
strokeOpacity: 1,
fillColor: '#051b2c', //填充色
fillOpacity: 0.7, //填充透明度
...areaStyle
}
AMap.service('AMap.DistrictSearch', function () {
var opts = {
subdistrict: 1, //返回下一级行政区
extensions: 'all', //返回行政区边界坐标组等具体信息
level: 'city' //查询行政级别为 市
};
//实例化DistrictSearch
var district = new AMap.DistrictSearch(opts);
district.setLevel('district');
//行政区查询
district.search(location, function (status, result) {
bounds = result.districtList[0].boundaries;
});
});
AMapUI.loadUI(['geo/DistrictExplorer'], function(DistrictExplorer) {
initPage(DistrictExplorer);
});
function getAllRings(feature) {
var coords = feature.geometry.coordinates;
var rings = [];
for (var i = 0, len = coords.length; i < len; i++) {
rings.push(coords[i][0]);
}
return rings;
}
function getLongestRing(feature) {
var rings = getAllRings(feature);
rings.sort(function(a, b) {
return b.length - a.length;
});
return rings[0];
}
function initPage(DistrictExplorer) {
//创建一个实例
var districtExplorer = new DistrictExplorer({
map:__map__
});
districtExplorer.loadCountryNode(
//只需加载全国和市,全国的节点包含省级
function(error, areaNodes) {
var path = [];
//首先放置背景区域,这里是大陆的边界
path.push(getLongestRing(areaNodes.getParentFeature()));
path.push.apply(path, bounds)
//绘制带环多边形
//http://lbs.amap.com/api/javascript-api/reference/overlay#Polygon
new AMap.Polygon({
bubble: true,
map: __map__,
path: path,
...polygonStyle
});
});
}
})
}
render() {
return null;
}
}
export default FilledAreaReverse
FilledAreaReverse.propTypes = {
location: PropTypes.string.isRequired
}
| 24.376147 | 78 | 0.559277 |
28f03636de6176f58af2d7cc176b38b364b4fc4d | 101 | js | JavaScript | app/components/square-payment-form-apple-pay-button.js | bmish/ember-square-payment-form | f9a2eeb52ed3ae5cd0195528fbbbd28a428c9038 | [
"MIT"
] | 13 | 2019-03-18T16:04:45.000Z | 2022-02-09T06:34:00.000Z | app/components/square-payment-form-apple-pay-button.js | ericghpham/ember-square-payment-form | f9a2eeb52ed3ae5cd0195528fbbbd28a428c9038 | [
"MIT"
] | 27 | 2019-06-06T03:42:29.000Z | 2022-02-12T07:33:08.000Z | app/components/square-payment-form-apple-pay-button.js | ericghpham/ember-square-payment-form | f9a2eeb52ed3ae5cd0195528fbbbd28a428c9038 | [
"MIT"
] | 7 | 2019-05-16T18:40:34.000Z | 2020-11-13T11:57:11.000Z | export { default } from 'ember-square-payment-form/components/square-payment-form-apple-pay-button';
| 50.5 | 100 | 0.792079 |