code
stringlengths 2
1.05M
| repo_name
stringlengths 5
114
| path
stringlengths 4
991
| language
stringclasses 1
value | license
stringclasses 15
values | size
int32 2
1.05M
|
---|---|---|---|---|---|
//process.argv.forEach(function (val, index, array) { console.log(index + ': ' + val); });
var fs = require('fs');
(function () {
function slugify(text) {
text = text.replace(/[^-a-zA-Z0-9,&\s]+/ig, '');
text = text.replace(/-/gi, "_");
text = text.replace(/\s/gi, "-");
return text;
}
var DocGen = {
filesArr: null,
files: {},
functions: [],
nbLoaded: 0,
init: function (files) {
this.filesArr = files;
},
start: function () {
for (var i=0, len=this.filesArr.length; i<len; i++) {
var file = this.filesArr[i];
this.processFile(file);
}
},
fileLoaded: function() {
this.nbLoaded++;
if (this.nbLoaded == this.filesArr.length) {
this.exportHtml();
}
},
getSignatures: function (m) {
var sig = null;
var signatures = [];
var rSig = /\\*\s?(@sig\s.*)\n/gi;
while (sig = rSig.exec(m)) {
var params = [];
var rParam = /(\w+):(\w+)/gi;
while (param = rParam.exec(sig[1])) {
var name = param[1];
var type = param[2];
params.push({ name: name, type: type });
}
if (params.length >= 1) {
ret = params.pop();
}
signatures.push({ params: params, ret: ret});
}
return signatures;
},
extractInfos: function (m) {
var self = this;
var fun = m[2];
var rFun = /['|"]?([a-zA-Z0-9._-]+)['|"]?\s?:\s?function\s?\(.*\)\s?{/gi;
var isFun = rFun.exec(fun);
if (!isFun) {
rFun = /socket\.on\(['|"]([a-zA-Z0-9._-]+)['|"]\s?,\s?function\s?\(.*\)\s?{/gi;
isFun = rFun.exec(fun);
}
if (isFun) {
var comment = m[1];
var name = isFun[1];
var sigs = self.getSignatures(comment);
var desc = (/\*\s(.*?)\n/gi).exec(m[1])[1];
var f = { name: name, description: desc, sigs: sigs };
return f;
}
return null;
},
processFile: function (file) {
var self = this;
// Get the file in a buffer
fs.readFile(file, function(err, data) {
var buf = data.toString('binary');
var functions = [];
// Get all long comment ( /** )
var rgx = new RegExp("/\\*\\*\n([a-zA-Z0-9 -_\n\t]*)\\*/\n(.*)\n", "gi");
while (m = rgx.exec(buf)) {
info = self.extractInfos(m);
if (info) {
functions.push(info);
}
}
self.files[file] = { functions: functions };
self.fileLoaded();
});
},
sortFunctions: function (fun1, fun2) {
var name1 = fun1.name.toLowerCase();
var name2 = fun2.name.toLowerCase();
if (name1 < name2) { return -1; }
else if (name1 > name2) { return 1; }
else { return 0; }
},
exportHtml: function() {
for (var fileName in this.files) {
var file = this.files[fileName];
file.functions.sort(this.sortFunctions);
console.log(fileName, file.functions.length);
var html = '<!DOCTYPE html>\n' +
'<html>\n' +
'<head>\n' +
' <title></title>\n' +
' <link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" charset="utf-8" />\n' +
' <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />\n' +
//' <script src="js/scripts.js" type="text/javascript"></script>' +
'</head>\n' +
'<body>\n' +
'\n' +
'<div class="menu" id="menu">\n' +
' <h1>Files</h1>\n' +
' <ul>\n';
for (var f in this.files) {
html += ' <li><a href="'+f+'.html">'+f+'</a></li>\n';
}
html += ' </ul>\n' +
' <h1>Functions</h1>\n' +
' <ul>\n';
for (var i=0, len=file.functions.length; i<len; i++) {
html += ' <li><a href="#'+slugify(file.functions[i].name)+'">'+file.functions[i].name+'</a></li>\n';
}
html += ' </ul>\n'
html += '</div>\n' +
'<div id="page">\n' +
' <div class="content">\n';
for (var i=0, len=file.functions.length; i<len; i++) {
var fn = file.functions[i];
if (fn.sigs.length > 0) {
html += '<h3><a name="'+slugify(fn.name)+'">'+fn.name+'</a></h3>\n';
html += '<span class="signature">\n';
for (var s=0, len2=fn.sigs.length; s<len2; s++) {
var sig = fn.sigs[s];
html += '<span class="name">'+fn.name+'</span> ( ';
for (var p=0, len3=sig.params.length; p<len3; p++) {
var param = sig.params[p];
html += '<span class="param">'+param.name+'</span>:<span class="type">'+param.type+'</span>, ';
}
html = html.substr(0, html.length-2);
html += ' ) : <span class="param">'+sig.ret.name+'</span>:<span class="type">'+sig.ret.type+'</span><br />';
}
html = html.substr(0, html.length-6);
html += '</span>\n';
html += '<p>'+fn.description+'</p>';
}
}
html += ' </div>\n' +
'</div>\n' +
'\n' +
'</body>\n'
'</html>';
fs.writeFile('doc/'+fileName+'.html', html);
}
}
};
var files = ['sockets.js', 'database_operations.js'];
DocGen.init(files);
DocGen.start();
})();
| alaingilbert/ttdashboard | server/gatherer/parser.js | JavaScript | mit | 5,796 |
'use strict';
exports.name = '/activation';
| longlh/di-linker | test/data/activation.js | JavaScript | mit | 45 |
const _ = require('lodash')
const Joi = require('joi')
module.exports = {
name: 'href',
params: {
href: Joi.array().items(
Joi.string(),
Joi.func().ref()
).min(1)
},
setup (params) {
params.href = [''].concat(params.href)
this._flags.href = params.href
},
validate (params, value, state, options) {
let parts = value.split('/').slice(1)
if (!parts.every((p) => _.size(p) > 0)) {
return this.createError('link.href', { v: value }, state, options)
} else {
return value
}
}
}
| hrithikp/joi-link | lib/rule.js | JavaScript | mit | 545 |
// Mucking with different levels
let currentLevel = { cells: undefined, dims: undefined };
if (0) {
currentLevel.cells = level;
currentLevel.dims = level_dims;
} else {
currentLevel.cells = LEVEL_ONE;
currentLevel.dims = LEVEL_ONE_DIMS;
}
// Return a reference to the (logical) cell's unique object
const _getCellReference = (i, j, k = 1) => {
if (i < 0 || j < 0) {
return undefined;
}
if (i >= currentLevel.dims.i || j >= currentLevel.dims.j) {
return undefined;
}
return currentLevel.cells[i + j * (currentLevel.dims.j)];
};
/**
* The drawing grid used to represent the editable regions of the level.
* [i, j] refer to logical coordinates. [w, h] represent the number of pixels
* per grid division on the target 2D rendering surface.
*/
const grid = {
i: 20,
j: 20,
w: undefined,
h: undefined,
};
// Translate party front/back/left/right to N/S/E/W
const XLATE_UCS2PARTY = {
n: { f: 'n', b: 's', r: 'e', l: 'w' },
s: { f: 's', b: 'n', r: 'w', l: 'e' },
e: { f: 'e', b: 'w', r: 's', l: 'n' },
w: { f: 'w', b: 'e', r: 'n', l: 's' }
};
// JavaScript divmod is boned
const divMod = (n, d) => {
return n - d * Math.floor(n / d);
};
// Give an [i, j] coordinate and wrap it if exceeds grid dimensions
const gridWrap = (i, j) => {
return [divMod(i, grid.i), divMod(j, grid.j)];
};
| petertorelli/OldSchoolRPG | js/globals.js | JavaScript | mit | 1,316 |
var fastn = require('fastn')({
_generic: require('fastn/genericComponent'),
list: require('fastn/listComponent'),
templater: require('fastn/templaterComponent'),
text: require('fastn/textComponent'),
ratingControl: require('./ratingControlComponent')
});
module.exports = function(settings){
return fastn('ratingControl', settings).attach().render();
}; | shotlom/rating-control-component | index.js | JavaScript | mit | 378 |
#!/usr/bin/env node
'use strict';
var assert = require('assert');
var depRep = require('../../lib/depRep');
var oldJson = require('../fixtures/old.json');
var newJson = require('../fixtures/new.json');
var unsupported = require('../fixtures/unsupported.json');
function key(number, dev) {
var prefix = "/dependencies/";
if (dev) prefix = "/devDependencies/";
return prefix + number;
}
describe('Compare', function () {
// describe('#report()', function () {
// it('should generate a proper report for dependencies', function () {
// depRep
// .report(oldJson, newJson)
// .then(function () {
// assert.equal(analyze[key(1)].status, "major");
// assert.equal(report[key(2)].status, null);
// assert.equal(report[key(3)], null);
// assert.equal(report[key(4)].status, null);
// assert.equal(report[key(5)].status, null);
// assert.equal(report[key(6)], null);
// assert.equal(report[key(7)].status, null);
// assert.equal(report[key(8)].status, "minor");
// assert.equal(report[key(9)].status, "major");
// done();
// });
// });
// });
//
// describe('#report()', function () {
// it('should generate a proper report for devDependencies', function () {
// depRep
// .report(oldJson, newJson)
// .then(function () {
// assert.equal(report[key(1, true)].status, "major");
// assert.equal(report[key(2, true)].status, null);
// assert.equal(report[key(3, true)], null);
// assert.equal(report[key(4, true)].status, null);
// assert.equal(report[key(5, true)].status, null);
// assert.equal(report[key(6, true)], null);
// assert.equal(report[key(7, true)].status, null);
// assert.equal(report[key(8, true)].status, "minor");
// assert.equal(report[key(9, true)].status, "major");
// done();
// });
// });
// });
}); | kevin-smets/dep-rep | test/specs/depRepSpec.js | JavaScript | mit | 2,302 |
/**
* Angular Paginate
* @homepage https://github.com/darthwade/angular-paginate
* @author Vadym Petrychenko https://github.com/darthwade
* @license The MIT License (http://www.opensource.org/licenses/mit-license.php)
* @copyright 2014 Vadym Petrychenko
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['angular'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('angular'));
} else {
// Browser globals
factory(window.angular)
}
}(function (angular) {
'use strict';
angular.module('darthwade.paginate', [])
.provider('$paginate', function () {
var provider = this;
provider.templateUrl = 'angular-paginate.html';
provider.options = {
perPage: 10, // Items count per page.
range: 5, // Number of pages neighbouring the current page which will be displayed.
boundaryLinks: true, // Whether to display First / Last buttons.
directionLinks: true, // Whether to display Previous / Next buttons.
rotate: true, // Whether to keep current page in the middle of the visible ones.
paramName: 'page',
previousText: 'Previous', // Text for previous button
nextText: 'Next', // Text for next button
moreText: '...' // Text for more button
};
provider.$get = function() {
var wrapper = function(options) {
return new Paginator(options);
};
wrapper.getDefaultOptions = function() {
return provider.options;
};
wrapper.getTemplateUrl = function() {
return provider.templateUrl;
};
return wrapper;
};
/**
* Overrides default options
* @param {Object} options
*/
provider.setDefaultOptions = function (options) {
angular.extend(provider.options, options);
};
provider.setTemplateUrl = function (templateUrl) {
provider.templateUrl = templateUrl;
};
var Paginator = function(options) {
var self = this;
var defaultOptions = {
$page: 1,
$objects: [],
$totalCount: 0,
$startIndex: 0,
$endIndex: 0,
$totalPages: 0,
onPageChange: angular.noop
};
self.page = function (page) {
if (self.$page === page) {
return;
}
self.$page = page;
calculate();
if (self.onPageChange) {
self.onPageChange.call(self);
}
};
self.options = function (options) {
angular.extend(self, options);
};
self.previous = function () {
if (self.hasPrevious()) {
self.page(self.$page - 1);
}
};
self.next = function () {
if (self.hasNext()) {
self.page(self.$page + 1);
}
};
self.hasPrevious = function () {
return self.$page > 1;
};
self.hasNext = function () {
return self.$page < self.$totalPages;
};
// Create page object used in template
var makePage = function (number, text, active) {
return {
number: number,
text: text,
active: active
};
};
var getPages = function () {
var pages = [];
// Default page limits
var startPage = 1, endPage = self.$totalPages;
var isRanged = self.range < self.$totalPages;
// recompute if maxSize
if (isRanged) {
if (self.rotate) {
// Current page is displayed in the middle of the visible ones
startPage = Math.max(self.$page - Math.floor(self.range / 2), 1);
endPage = startPage + self.range - 1;
// Adjust if limit is exceeded
if (endPage > self.$totalPages) {
endPage = self.$totalPages;
startPage = endPage - self.range + 1;
}
} else {
// Visible pages are paginated with maxSize
startPage = ((Math.ceil(self.$page / self.range) - 1) * self.range) + 1;
// Adjust last page if limit is exceeded
endPage = Math.min(startPage + self.range - 1, self.$totalPages);
}
}
// Add page number links
for (var number = startPage; number <= endPage; number++) {
var page = makePage(number, number, number === self.$page);
pages.push(page);
}
// Add links to move between page sets
if (isRanged) { // && !self.rotate
var margin = self.boundaryLinks ? 1 : 0;
if (startPage - margin > 1) {
var previousPageSet = makePage(startPage - 1, self.moreText, false);
pages.unshift(previousPageSet);
}
if (endPage + margin < self.$totalPages) {
var nextPageSet = makePage(endPage + 1, self.moreText, false);
pages.push(nextPageSet);
}
}
// Add boundary links if needed
if (self.boundaryLinks) {
if (startPage > 1) {
var firstPage = makePage(1, 1, false);
pages.unshift(firstPage);
}
if (endPage < self.$totalPages) {
var lastPage = makePage(self.$totalPages, self.$totalPages, false);
pages.push(lastPage);
}
}
return pages;
};
var calculate = function() {
self.$page = parseInt(self.$page) || 1;
self.$objects = self.$objects || [];
self.$totalCount = parseInt(self.$totalCount) || 0;
self.$totalPages = Math.ceil(self.$totalCount / self.perPage);
self.$startIndex = (self.$page - 1) * self.perPage;
self.$endIndex = self.$startIndex + self.$objects.length;
if (self.$endIndex) {
self.$startIndex += 1;
}
self.$pages = getPages();
};
angular.extend(self, provider.options, defaultOptions, options);
calculate();
};
return provider;
})
.directive('dwPaginate', ['$paginate', function ($paginate) {
return {
restrict: 'EA',
scope: {
paginator: '=dwPaginate'
},
replace: true,
templateUrl: $paginate.getTemplateUrl(),
link: function (scope, element, attrs) {
}
};
}]);
})); | darthwade/angular-paginate | angular-paginate.js | JavaScript | mit | 6,581 |
var express = require('express')
var braintree = require('braintree')
var router = express.Router() // eslint-disable-line new-cap
var gateway = require('../lib/gateway')
var TRANSACTION_SUCCESS_STATUSES = [
braintree.Transaction.Status.Authorizing,
braintree.Transaction.Status.Authorized,
braintree.Transaction.Status.Settled,
braintree.Transaction.Status.Settling,
braintree.Transaction.Status.SettlementConfirmed,
braintree.Transaction.Status.SettlementPending,
braintree.Transaction.Status.SubmittedForSettlement
]
function formatErrors(errors) {
var formattedErrors = ''
for (var i in errors) { // eslint-disable-line no-inner-declarations, vars-on-top
if (errors.hasOwnProperty(i)) {
formattedErrors += 'Error: ' + errors[i].code + ': ' + errors[i].message + '\n'
}
}
return formattedErrors
}
function createResultObject(transaction) {
var result
var status = transaction.status
if (TRANSACTION_SUCCESS_STATUSES.indexOf(status) !== -1) {
result = {
header: 'Sweet Success!',
icon: 'success',
message: 'Your test transaction has been successfully processed. See the Braintree API response and try again.'
}
} else {
result = {
header: 'Transaction Failed',
icon: 'fail',
message: 'Your test transaction has a status of ' + status + '. See the Braintree API response and try again.'
}
}
return result
}
router.get('/', function (req, res) {
res.redirect('/checkouts/new')
})
router.get('/checkouts/new', function (req, res) {
gateway.clientToken.generate({}, function (err, response) {
res.render('checkouts/new', {clientToken: response.clientToken, messages: req.flash('error')})
})
})
router.get('/checkouts/:id', function (req, res) {
var result
var transactionId = req.params.id
gateway.transaction.find(transactionId, function (err, transaction) {
result = createResultObject(transaction)
res.render('checkouts/show', {transaction: transaction, result: result})
})
})
router.post('/checkouts', function (req, res) {
var transactionErrors
var amount = req.body.amount // In production you should not take amounts directly from clients
var nonce = req.body.payment_method_nonce
gateway.transaction.sale({
amount: amount,
paymentMethodNonce: nonce,
customer: {
firstName: req.body.firstName,
lastName: req.body.lastName,
email: req.body.email
},
options: {
submitForSettlement: true,
storeInVaultOnSuccess: true
}
}, function (err, result) {
if (result.success || result.transaction) {
res.redirect('checkouts/' + result.transaction.id)
} else {
transactionErrors = result.errors.deepErrors()
req.flash('error', {msg: formatErrors(transactionErrors)})
res.redirect('checkouts/new')
}
})
})
module.exports = router
| alexanderalmstrom/alexanderalmstrom | app/routes/checkout.js | JavaScript | mit | 2,862 |
import { Component } from 'react';
import Router from 'next/router';
import io from 'socket.io-client';
import fetch from 'isomorphic-fetch';
import Page from '../../layouts/page.js';
import Slide from '../../components/slide.js';
import Code from '../../components/code.js'
import Emojis from '../../components/emojis.js';
import SlideNavigation from '../../components/slidenavigation.js';
import { Title, Headline, Enum, Column } from '../../components/text.js';
import withRedux from 'next-redux-wrapper';
import { makeStore, _changeRole } from '../../components/store.js';
class SlideFour extends Component {
constructor(props) {
super(props);
this.props = props;
this.state = {
socket: undefined
};
this.emojiModule = this.emojiModule.bind(this);
this.navModule = this.navModule.bind(this);
}
static async getInitialProps({ isServer }) {
let host = 'http://localhost:3000';
if (!isServer)
host = `${location.protocol}//${location.host}`;
const response = await fetch(`${host}/static/html_template.txt`);
const htmlCode = await response.text();
return { htmlCode };
}
componentDidMount() {
// socket
if (!this.state.socket) {
const socket = io(`${location.protocol}//${location.host}/`);
socket.on('viewer-update', data => {
if (this.props.role === 'VIEWER') {
Router.replace(data.url);
}
});
this.setState(state => ( {socket: socket} ));
}
}
componentWillUnmount() {
if (this.state.socket)
this.state.socket.close();
}
emojiModule() {
if (this.state.socket) {
return (
<Emojis
socket={this.state.socket}
/>
);
}
}
navModule() {
if (this.state.socket && this.props.role) {
return (
<SlideNavigation
role={this.props.role}
socket={this.state.socket}
prev="/slides/0x04_y_tho"
next="/slides/0x06_include"
/>
);
}
}
render() {
return (
<Page>
<Slide>
<Title>0x05_call_by_reference</Title>
<Headline>Anwendung im Browser</Headline>
<Column>
<Enum>JavaScript kann direkt im { '<script>-Tag' } geschrieben werden</Enum>
<Enum>oder als externe Datei durch das src-Attribut eingebunden werden</Enum>
</Column>
<Column>
<Code language='html'>{ this.props.htmlCode }</Code>
</Column>
{ this.navModule() }
</Slide>
{ this.emojiModule() }
</Page>
);
}
};
const mapStateToProps = state => ({
role: state.role
});
const mapDispatchToProps = dipatch => ({
changeRole: role => (dispatch(_changeRole(role)))
});
export default withRedux(makeStore, mapStateToProps, mapDispatchToProps)(SlideFour); | AndyBitz/dme11a-js-presentation | pages/slides/0x05_call_by_reference.js | JavaScript | mit | 2,834 |
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Example = mongoose.model('Example'),
_ = require('lodash'),
upload = require('./upload');
/**
* Find example by id
*/
exports.example = function(req, res, next, id) {
Example.load(id, function(err, example) {
if (err) return next(err);
if (!example) return next(new Error('Failed to load example ' + id));
req.example = example;
next();
});
};
/**
* Create a example
*/
exports.create = function(req, res) {
var example = new Example(req.body);
example.user = req.user;
example.save(function(err) {
if (err) {
return res.send('/login', {
errors: err.errors,
example: example
});
} else {
res.jsonp(example);
}
});
};
/**
* Update a example
*/
exports.update = function(req, res) {
var example = req.example;
example = _.extend(example, req.body);
example.save(function(err) {
if (err) {
console.log("Error -" + err);
return res.send('/login', {
errors: err,
example: example
});
} else {
console.log("Example Saved - " + example);
res.jsonp(example);
}
});
};
/**
* Delete an example
*/
exports.destroy = function(req, res) {
var example = req.example;
example.remove(function(err) {
if (err) {
return res.send('/login', {
errors: err.errors,
example: example
});
} else {
res.jsonp(example);
}
});
};
/**
* Show an example
*/
exports.show = function(req, res) {
res.jsonp(req.example);
};
/**
* List of Examples
*/
exports.all = function(req, res) {
Example.find().sort('-created').populate('user', 'name username').exec(function(err, examples) {
if (err) {
res.render('error', {
status: 500
});
} else {
res.jsonp(examples);
}
});
}; | dylanlawrence/ango | lib/controllers/example.js | JavaScript | mit | 2,149 |
import { fireShuffleTasks } from 'src/model/ModelBase';
import { REFERENCE } from 'config/types';
import { rebindMatch } from 'shared/rebind';
import { isArray, isString } from 'utils/is';
import { escapeKey } from 'shared/keypaths';
import ExpressionProxy from './ExpressionProxy';
import resolveReference from './resolveReference';
import resolve from './resolve';
import LinkModel, { Missing } from 'src/model/LinkModel';
export default class ReferenceExpressionProxy extends LinkModel {
constructor(fragment, template) {
super(null, null, null, '@undefined');
this.root = fragment.ractive.viewmodel;
this.template = template;
this.rootLink = true;
this.template = template;
this.fragment = fragment;
this.rebound();
}
getKeypath() {
return this.model ? this.model.getKeypath() : '@undefined';
}
rebound() {
const fragment = this.fragment;
const template = this.template;
let base = (this.base = resolve(fragment, template));
let idx;
if (this.proxy) {
teardown(this);
}
const proxy = (this.proxy = {
rebind: (next, previous) => {
if (previous === base) {
next = rebindMatch(template, next, previous);
if (next !== base) {
this.base = base = next;
}
} else if (~(idx = members.indexOf(previous))) {
next = rebindMatch(template.m[idx].n, next, previous);
if (next !== members[idx]) {
members.splice(idx, 1, next || Missing);
}
}
if (next !== previous) {
previous.unregister(proxy);
if (next) next.addShuffleTask(() => next.register(proxy));
}
},
handleChange: () => {
pathChanged();
}
});
base.register(proxy);
const members = (this.members = template.m.map(tpl => {
if (isString(tpl)) {
return { get: () => tpl };
}
let model;
if (tpl.t === REFERENCE) {
model = resolveReference(fragment, tpl.n);
model.register(proxy);
return model;
}
model = new ExpressionProxy(fragment, tpl);
model.register(proxy);
return model;
}));
const pathChanged = () => {
const model =
base &&
base.joinAll(
members.reduce((list, m) => {
const k = m.get();
if (isArray(k)) return list.concat(k);
else list.push(escapeKey(String(k)));
return list;
}, [])
);
if (model !== this.model) {
this.model = model;
this.relinking(model);
fireShuffleTasks();
refreshPathDeps(this);
this.fragment.shuffled();
}
};
pathChanged();
}
teardown() {
teardown(this);
super.teardown();
}
unreference() {
super.unreference();
if (!this.deps.length && !this.refs) this.teardown();
}
unregister(dep) {
super.unregister(dep);
if (!this.deps.length && !this.refs) this.teardown();
}
}
function teardown(proxy) {
if (proxy.base) proxy.base.unregister(proxy.proxy);
if (proxy.models) {
proxy.models.forEach(m => {
if (m.unregister) m.unregister(proxy);
});
}
}
function refreshPathDeps(proxy) {
let len = proxy.deps.length;
let i, v;
for (i = 0; i < len; i++) {
v = proxy.deps[i];
if (v.pathChanged) v.pathChanged();
if (v.fragment && v.fragment.pathModel) v.fragment.pathModel.applyValue(proxy.getKeypath());
}
len = proxy.children.length;
for (i = 0; i < len; i++) {
refreshPathDeps(proxy.children[i]);
}
}
const eproto = ExpressionProxy.prototype;
const proto = ReferenceExpressionProxy.prototype;
proto.unreference = eproto.unreference;
proto.unregister = eproto.unregister;
proto.unregisterLink = eproto.unregisterLink;
| ractivejs/ractive | src/view/resolvers/ReferenceExpressionProxy.js | JavaScript | mit | 3,804 |
'use strict';
const config = require('config');
const esdoc = require('gulp-esdoc');
const gulp = require('gulp');
module.exports = function documentationBuilder() {
return gulp.src('./src')
.pipe(esdoc({
destination: config.get('build.documentation.outputPath'),
unexportIdentifier: config.get('build.documentation.unexportedIdentifiers'),
undocumentIdentifier: config.get('build.documentation.undocumentedIdentifiers'),
test: {
type: config.get('build.documentation.testType'),
source: config.get('build.documentation.testRoot'),
},
}));
};
| node-templates/base-microservice-swagger | bld/documentation.js | JavaScript | mit | 601 |
'use strict'
var test = require('tape')
var createDate = require('./')
test(function (t) {
t.ok(createDate('1-1-2000') instanceof Date)
t.end()
})
| bendrucker/create-date | test.js | JavaScript | mit | 153 |
'use strict';
// Configuring the Articles module
angular.module('categories').run(['Menus',
function(Menus) {
// Set top bar menu items
// Menus.addMenuItem('topbar', 'Categories', 'categories', 'item', '/categories(?:/[^/]+)?', null, null, 9);
// Set admin menu items
Menus.addMenuItem('admin', 'Categories', 'categories', 'dropdown', '/categories(/create)?');
Menus.addSubMenuItem('admin', 'categories', 'List Categories', 'categories');
Menus.addSubMenuItem('admin', 'categories', 'New Category', 'categories/create');
}
]);
| crosscent/platform | public/modules/categories/config/categories.client.config.js | JavaScript | mit | 544 |
/**
* Created by zhang on 16/5/19.
*/
$.myjq = function () {
alert("hello my jQuery")
};
//js的扩展
$.fn.myjq=function(){
$(this).text("hello")
}; | qiang437587687/pythonBrother | jQueryFirst/jQuery扩展和noConflict/myjQuery.js | JavaScript | mit | 161 |
// Generated by CoffeeScript 1.10.0
var Graphics;
Graphics = (function() {
function Graphics(ctx, viewport1) {
this.ctx = ctx;
this.viewport = viewport1;
this.transform = {
x: 0,
y: 0,
rotation: 0,
scale: 1
};
}
Graphics.prototype.translate = function(dx, dy) {
this.transform.x += dx;
this.transform.y += dy;
return this.ctx.translate(dx, dy);
};
Graphics.prototype.setColor = function(color) {
this.ctx.fillStyle = color;
return this.ctx.strokeStyle = color;
};
Graphics.prototype.setLineWidth = function(linewidth) {
return this.ctx.lineWidth = linewidth;
};
Graphics.prototype.setFont = function(fontdef) {
return this.ctx.font = fontdef;
};
Graphics.prototype.drawArc = function(x, y, r, sAngle, eAngle) {
this.ctx.beginPath();
this.ctx.arc(x, y, r, sAngle, eAngle, true);
return this.ctx.stroke();
};
Graphics.prototype.fillArc = function(x, y, r, sAngle, eAngle) {
this.ctx.beginPath();
this.ctx.arc(x, y, r, sAngle, eAngle, true);
return this.ctx.fill();
};
Graphics.prototype.drawCircle = function(x, y, r) {
return this.drawArc(x, y, r, 0, 2 * Math.PI);
};
Graphics.prototype.fillCircle = function(x, y, r) {
return this.fillArc(x, y, r, 0, 2 * Math.PI);
};
Graphics.prototype.drawRect = function(x, y, width, height) {
return this.ctx.strokeRect(x, y, width, height);
};
Graphics.prototype.fillRect = function(x, y, width, height) {
return this.ctx.fillRect(x, y, width, height);
};
Graphics.prototype.drawText = function(x, y, text) {
return this.ctx.fillText(text, x, y);
};
Graphics.prototype.drawLine = function(x1, y1, x2, y2) {
this.ctx.beginPath();
this.ctx.moveTo(x1, y1);
this.ctx.lineTo(x2, y2);
return this.ctx.stroke();
};
Graphics.prototype.drawPoly = function(ptlist) {
var i, len, pt;
this.ctx.beginPath();
this.ctx.moveTo(ptlist[0].x, ptlist[0].y);
for (i = 0, len = ptlist.length; i < len; i++) {
pt = ptlist[i];
this.ctx.lineTo(pt.x, pt.y);
}
this.ctx.closePath();
return this.ctx.stroke();
};
Graphics.prototype.fillPoly = function(ptlist) {
var i, len, pt;
this.ctx.beginPath();
this.ctx.moveTo(ptlist[0].x, ptlist[0].y);
for (i = 0, len = ptlist.length; i < len; i++) {
pt = ptlist[i];
this.ctx.lineTo(pt.x, pt.y);
}
this.ctx.closePath();
return this.ctx.fill();
};
return Graphics;
})();
exports.createFromCanvas = function(canvas, viewport) {
return new Graphics(canvas.getContext('2d'), viewport);
};
| aziis98/node-canvas-graphics-wrapper | graphics.js | JavaScript | mit | 2,626 |
"use strict";
var EventEmitter = require ('events');
module.exports = new EventEmitter ();
| alexandruradovici/messengertrivia | source/bus.js | JavaScript | mit | 92 |
'use strict'
const tap = require('tap')
const ActiveDirectory = require('../index')
const config = require('./config')
const serverFactory = require('./mockServer')
const settings = require('./settings').getGroupMembershipForUser
tap.beforeEach((done, t) => {
serverFactory(function (err, server) {
if (err) return done(err)
const connectionConfig = config(server.port)
t.context.ad = new ActiveDirectory(connectionConfig)
t.context.server = server
done()
})
})
tap.afterEach((done, t) => {
if (t.context.server) t.context.server.close()
done()
})
tap.test('#getGroupMembershipForUser()', t => {
settings.users.forEach((user) => {
['dn', 'userPrincipalName', 'sAMAccountName'].forEach((attr) => {
const len = user.members.length
t.test(`should return ${len} groups for ${attr}`, t => {
t.context.ad.getGroupMembershipForUser(user[attr], function (err, groups) {
t.error(err)
t.true(groups.length >= user.members.length)
const groupNames = groups.map((g) => {
return g.cn
})
user.members.forEach((g) => {
t.true(groupNames.includes(g))
})
t.end()
})
})
})
})
t.test('should return empty groups if groupName doesn\'t exist', t => {
t.context.ad.getGroupMembershipForUser('!!!NON-EXISTENT GROUP!!!', function (err, groups) {
t.error(err)
t.type(groups, Array)
t.equal(groups.length, 0)
t.end()
})
})
t.test('should return default group attributes when not specified', t => {
const defaultAttributes = ['objectCategory', 'distinguishedName', 'cn', 'description']
const user = settings.users[0]
t.context.ad.getGroupMembershipForUser(user.userPrincipalName, function (err, groups) {
t.error(err)
t.ok(groups)
groups.forEach((g) => {
const keys = Object.keys(g)
defaultAttributes.forEach((attr) => {
t.true(keys.includes(attr))
})
})
t.end()
})
})
t.end()
})
tap.test('#getGroupMembershipForUser(opts)', t => {
t.test('should return only requested attributes', t => {
const opts = {
attributes: ['createTimeStamp']
}
const user = settings.users[0]
t.context.ad.getGroupMembershipForUser(opts, user.userPrincipalName, function (err, groups) {
t.error(err)
t.ok(groups)
t.true(groups.length >= user.members.length)
groups.forEach((g) => {
const keys = Object.keys(g)
keys.forEach((attr) => {
t.true(opts.attributes.includes(attr))
})
})
t.end()
})
})
t.end()
})
| jsumners/node-activedirectory | test/getgroupmembershipforuser.test.js | JavaScript | mit | 2,662 |
version https://git-lfs.github.com/spec/v1
oid sha256:b1b66ad7cf63a081650856aed61fbfdf1b6b511e47c622989e9927e504424a5d
size 2493
| yogeshsaroya/new-cdnjs | ajax/libs/jquery.lazyloadxt/0.8.12/jquery.lazyloadxt.extra.min.js | JavaScript | mit | 129 |
tinyMCE.init({
mode : 'textareas',
theme : "advanced",
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
}); | thoas/i386 | src/milkshape/media/tiny_mce/init.js | JavaScript | mit | 502 |
/* eslint-env node */
'use strict';
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function(defaults) {
let app = new EmberAddon(defaults, {
'ember-cli-babel': {
includePolyfill: true
}
});
app.import('node_modules/highlightjs/styles/monokai-sublime.css');
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/
return app.toTree();
};
| btecu/ember-keyboard | ember-cli-build.js | JavaScript | mit | 621 |
import { SplashEffect } from "./effect.js";
import { Linear } from "../interpolation.js";
export class TranslateFromPosition extends SplashEffect {
constructor(element, options) {
super(element);
options = options || {};
this.x = options.x || 0;
this.y = options.y || 0;
// Can be whatever, but the effect won't do
// anything if it isn't a valid css unit.
this.unit = options.unit || "px";
// Can be either "transform" or "position"
this.translationType = options.translationType || "transform";
this.interpolation = options.interpolation || new Linear();
}
in(value) {
this._set(
this.interpolation.in(value * -1 + 1) * this.x,
this.interpolation.in(value * -1 + 1) * this.y
);
}
out(value) {
this._set(
this.interpolation.out(value) * this.x,
this.interpolation.out(value) * this.y
);
}
_set(x, y) {
if (this.translationType = "transform") {
this.setTransform("translateX", x + this.unit);
this.setTransform("translateY", y + this.unit);
} else if (this.translationType = "position") {
this.setStyle("left", x + this.unit);
this.setStyle("top", y + this.unit);
} else {
console.error("Unknown translation type: " + this.translationType);
}
}
}
| magnontobi/splasher.js | src/js/effects/translateFromPosition.js | JavaScript | mit | 1,226 |
/**
* Wheel, copyright (c) 2019 - present by Arno van der Vegt
* Distributed under an MIT license: https://arnovandervegt.github.io/wheel/license.txt
**/
const File = require('./File');
exports.FileDetail = class extends File.File {
constructor(opts) {
opts.className = 'file detail';
super(opts);
}
initDOM(parentNode) {
let file = this._file;
this.create(
parentNode,
{
id: this.setElement.bind(this),
className: this._className,
children: [
File.getIcon(this._getImage, file),
{
id: this.setLinkElement.bind(this),
type: 'a',
href: '#',
className: 'no-select name',
innerHTML: file.name
},
!file.directory && file.size ?
{
type: 'span',
href: '#',
className: 'no-select size',
innerHTML: file.size + ' - ' + this.bytesToSize(file.size)
} :
null,
(file.modified || file.hash) ?
{
type: 'span',
href: '#',
className: 'no-select modified',
innerHTML: file.modified || file.hash
} :
null
]
}
);
}
/**
* https://stackoverflow.com/questions/15900485/correct-way-to-convert-size-in-bytes-to-kb-mb-gb-in-javascript
**/
bytesToSize(bytes) {
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (parseInt(bytes, 10) === 0) {
return '0 Byte';
}
let i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
}
};
| ArnoVanDerVegt/wheel | js/frontend/lib/components/files/FileDetail.js | JavaScript | mit | 2,137 |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Position } from '../core/position';
import { Range } from '../core/range';
import { InlineDecoration, ViewModelDecoration } from './viewModel';
import { filterValidationDecorations } from '../config/editorOptions';
var ViewModelDecorations = /** @class */ (function () {
function ViewModelDecorations(editorId, model, configuration, linesCollection, coordinatesConverter) {
this.editorId = editorId;
this.model = model;
this.configuration = configuration;
this._linesCollection = linesCollection;
this._coordinatesConverter = coordinatesConverter;
this._decorationsCache = Object.create(null);
this._cachedModelDecorationsResolver = null;
this._cachedModelDecorationsResolverViewRange = null;
}
ViewModelDecorations.prototype._clearCachedModelDecorationsResolver = function () {
this._cachedModelDecorationsResolver = null;
this._cachedModelDecorationsResolverViewRange = null;
};
ViewModelDecorations.prototype.dispose = function () {
this._decorationsCache = Object.create(null);
this._clearCachedModelDecorationsResolver();
};
ViewModelDecorations.prototype.reset = function () {
this._decorationsCache = Object.create(null);
this._clearCachedModelDecorationsResolver();
};
ViewModelDecorations.prototype.onModelDecorationsChanged = function () {
this._decorationsCache = Object.create(null);
this._clearCachedModelDecorationsResolver();
};
ViewModelDecorations.prototype.onLineMappingChanged = function () {
this._decorationsCache = Object.create(null);
this._clearCachedModelDecorationsResolver();
};
ViewModelDecorations.prototype._getOrCreateViewModelDecoration = function (modelDecoration) {
var id = modelDecoration.id;
var r = this._decorationsCache[id];
if (!r) {
var modelRange = modelDecoration.range;
var options = modelDecoration.options;
var viewRange = void 0;
if (options.isWholeLine) {
var start = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.startLineNumber, 1));
var end = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber)));
viewRange = new Range(start.lineNumber, start.column, end.lineNumber, end.column);
}
else {
viewRange = this._coordinatesConverter.convertModelRangeToViewRange(modelRange);
}
r = new ViewModelDecoration(viewRange, options);
this._decorationsCache[id] = r;
}
return r;
};
ViewModelDecorations.prototype.getDecorationsViewportData = function (viewRange) {
var cacheIsValid = (this._cachedModelDecorationsResolver !== null);
cacheIsValid = cacheIsValid && (viewRange.equalsRange(this._cachedModelDecorationsResolverViewRange));
if (!cacheIsValid) {
this._cachedModelDecorationsResolver = this._getDecorationsViewportData(viewRange);
this._cachedModelDecorationsResolverViewRange = viewRange;
}
return this._cachedModelDecorationsResolver;
};
ViewModelDecorations.prototype._getDecorationsViewportData = function (viewportRange) {
var modelDecorations = this._linesCollection.getDecorationsInRange(viewportRange, this.editorId, filterValidationDecorations(this.configuration.options));
var startLineNumber = viewportRange.startLineNumber;
var endLineNumber = viewportRange.endLineNumber;
var decorationsInViewport = [], decorationsInViewportLen = 0;
var inlineDecorations = [];
for (var j = startLineNumber; j <= endLineNumber; j++) {
inlineDecorations[j - startLineNumber] = [];
}
for (var i = 0, len = modelDecorations.length; i < len; i++) {
var modelDecoration = modelDecorations[i];
var decorationOptions = modelDecoration.options;
var viewModelDecoration = this._getOrCreateViewModelDecoration(modelDecoration);
var viewRange = viewModelDecoration.range;
decorationsInViewport[decorationsInViewportLen++] = viewModelDecoration;
if (decorationOptions.inlineClassName) {
var inlineDecoration = new InlineDecoration(viewRange, decorationOptions.inlineClassName, decorationOptions.inlineClassNameAffectsLetterSpacing ? 3 /* RegularAffectingLetterSpacing */ : 0 /* Regular */);
var intersectedStartLineNumber = Math.max(startLineNumber, viewRange.startLineNumber);
var intersectedEndLineNumber = Math.min(endLineNumber, viewRange.endLineNumber);
for (var j = intersectedStartLineNumber; j <= intersectedEndLineNumber; j++) {
inlineDecorations[j - startLineNumber].push(inlineDecoration);
}
}
if (decorationOptions.beforeContentClassName) {
if (startLineNumber <= viewRange.startLineNumber && viewRange.startLineNumber <= endLineNumber) {
var inlineDecoration = new InlineDecoration(new Range(viewRange.startLineNumber, viewRange.startColumn, viewRange.startLineNumber, viewRange.startColumn), decorationOptions.beforeContentClassName, 1 /* Before */);
inlineDecorations[viewRange.startLineNumber - startLineNumber].push(inlineDecoration);
}
}
if (decorationOptions.afterContentClassName) {
if (startLineNumber <= viewRange.endLineNumber && viewRange.endLineNumber <= endLineNumber) {
var inlineDecoration = new InlineDecoration(new Range(viewRange.endLineNumber, viewRange.endColumn, viewRange.endLineNumber, viewRange.endColumn), decorationOptions.afterContentClassName, 2 /* After */);
inlineDecorations[viewRange.endLineNumber - startLineNumber].push(inlineDecoration);
}
}
}
return {
decorations: decorationsInViewport,
inlineDecorations: inlineDecorations
};
};
return ViewModelDecorations;
}());
export { ViewModelDecorations };
| TeamSPoon/logicmoo_workspace | packs_web/swish/web/node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelDecorations.js | JavaScript | mit | 6,682 |
const _transform = require('lodash/transform');
function MatchTransformer(match) {
if( !(this instanceof MatchTransformer) ) {
return this.transform(new MatchTransformer(match));
}
if( typeof match === 'string' ) {
// Escape string
match = match.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
match = new RegExp(match);
}
this._match = match;
}
MatchTransformer.prototype.parse = function(source) {
return _transform(source, (result, value, key) => {
if( this._match.test(key) )
result[key] = value;
}, {});
};
MatchTransformer.prototype.reverse = MatchTransformer.prototype.parse;
module.exports = MatchTransformer;
| bubobox/parse-js | src/transformers/match.js | JavaScript | mit | 696 |
import ProgressBar from "progress";
import padEnd from "lodash/padEnd";
class ProgressBarController {
constructor() {
this.bar = null;
}
init(total) {
if (this.bar) {
this.terminate();
}
// Intentionally a noop because node-progress doesn't work well in non-TTY
// environments
if (!process.stdout.isTTY) {
return;
}
// Don't do any of this while testing
if (process.env.NODE_ENV === "lerna-test") {
return;
}
this.bar = new ProgressBar(":packagename ╢:bar╟", {
total: total,
complete: "█",
incomplete: "░",
clear: true,
// terminal columns - package name length - additional characters length
width: (process.stdout.columns || 100) - 50 - 3
});
}
tick(name) {
if (this.bar) {
this.bar.tick({
packagename: padEnd(name.slice(0, 50), 50)
});
}
}
clear() {
if (this.bar) {
this.bar.terminate();
}
}
restore() {
if (this.bar) {
// This is a hack to get the bar to redraw it's last state.
// See: https://github.com/tj/node-progress/blob/d47913502ba5b551fcaad9e94fe7b2f5876a7939/lib/node-progress.js#L154-L159
this.bar.stream.write(this.bar.lastDraw);
}
}
terminate() {
this.clear();
this.bar = null;
}
}
export default new ProgressBarController();
| onigoetz/lerna-hg | src/progressBar.js | JavaScript | mit | 1,365 |
var commons = require('../commons')
var frisby = require('frisby');
var FormData = require('form-data');
frisby.create('Get file')
.get(commons.host+'/file/2134354/zgzhrthztrh/sgeh' )
.after(function(err, res, body) {
expect(res.request.href.match(/errcode=404/)).not.toBeNull()
})
.toss()
| bodji/test2 | test/file/non_existing_spec.js | JavaScript | mit | 312 |
search_result['2189']=["topic_0000000000000543_attached_props--.html","VerifyPhoneNumberModel Attached Properties",""]; | asiboro/asiboro.github.io | vsdoc/search--/s_2189.js | JavaScript | mit | 119 |
$(document).ready(function () {
startAnimation();
});
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = (window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame || function (callback) {
return window.setTimeout(callback, 1000 / 60);
});
}
(function ($, window) {
function Constellation (canvas, options) {
var $canvas = $(canvas),
context = canvas.getContext('2d'),
defaults = {
star: {
color: 'rgba(255, 255, 255, .5)',
width: 2
},
line: {
color: 'rgba(255, 255, 255, .5)',
width: 0.4
},
position: {
x: 0, // This value will be overwritten at startup
y: 0 // This value will be overwritten at startup
},
width: window.innerWidth,
height: window.innerHeight,
velocity: 0.1,
length: 100,
distance: 120,
radius: 150,
stars: []
},
config = $.extend(true, {}, defaults, options);
function Star () {
this.x = Math.random() * canvas.width;
this.y = Math.random() * canvas.height;
this.vx = (config.velocity - (Math.random() * 0.5));
this.vy = (config.velocity - (Math.random() * 0.5));
this.radius = Math.random() * config.star.width;
}
Star.prototype = {
create: function(){
context.beginPath();
context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);
context.fill();
},
animate: function(){
var i;
for (i = 0; i < config.length; i++) {
var star = config.stars[i];
if (star.y < 0 || star.y > canvas.height) {
star.vx = star.vx;
star.vy = - star.vy;
} else if (star.x < 0 || star.x > canvas.width) {
star.vx = - star.vx;
star.vy = star.vy;
}
star.x += star.vx;
star.y += star.vy;
}
},
line: function(){
var length = config.length,
iStar,
jStar,
i,
j;
for (i = 0; i < length; i++) {
for (j = 0; j < length; j++) {
iStar = config.stars[i];
jStar = config.stars[j];
if (
(iStar.x - jStar.x) < config.distance &&
(iStar.y - jStar.y) < config.distance &&
(iStar.x - jStar.x) > - config.distance &&
(iStar.y - jStar.y) > - config.distance
) {
if (
(iStar.x - config.position.x) < config.radius &&
(iStar.y - config.position.y) < config.radius &&
(iStar.x - config.position.x) > - config.radius &&
(iStar.y - config.position.y) > - config.radius
) {
context.beginPath();
context.moveTo(iStar.x, iStar.y);
context.lineTo(jStar.x, jStar.y);
context.stroke();
context.closePath();
}
}
}
}
}
};
this.createStars = function () {
var length = config.length,
star,
i;
context.clearRect(0, 0, canvas.width, canvas.height);
for (i = 0; i < length; i++) {
config.stars.push(new Star());
star = config.stars[i];
star.create();
}
star.line();
star.animate();
};
this.setCanvas = function () {
canvas.width = config.width;
canvas.height = config.height;
};
this.setContext = function () {
context.fillStyle = config.star.color;
context.strokeStyle = config.line.color;
context.lineWidth = config.line.width;
};
this.setInitialPosition = function () {
if (!options || !options.hasOwnProperty('position')) {
config.position = {
x: canvas.width * 0.5,
y: canvas.height * 0.5
};
}
};
this.loop = function (callback) {
callback();
window.requestAnimationFrame(function () {
this.loop(callback);
}.bind(this));
};
this.bind = function () {
$canvas.on('mousemove', function(e){
config.position.x = e.pageX - $canvas.offset().left;
config.position.y = e.pageY - $canvas.offset().top;
});
};
this.init = function () {
this.setCanvas();
this.setContext();
this.setInitialPosition();
this.loop(this.createStars);
this.bind();
};
}
$.fn.constellation = function (options) {
return this.each(function () {
var c = new Constellation(this, options);
c.init();
});
};
})($, window);
var startAnimation = function() {
window.addEventListener("resize", function() { startAnimation()} );
$('canvas').constellation({
line: {
color: 'rgba(255, 255, 255, .5)'
}
});
};
| mzgnr/black-screen.github.io | js/script.js | JavaScript | mit | 4,347 |
/*jshint camelcase: false */
(function(window, module, undefined) {
'use strict';
// lifted from Underscore then bastardized
var _flatten = function(input, output) {
for (var i = 0, length = input.length; i < length; i++) {
var value = input[i];
if (value.type === 'div') {
_flatten(value.contents, output);
}
else if (value.type !== 'button') {
output.push(formBuilder.determineFieldName(value));
}
}
return output;
};
var flatten = function(array) {
return _flatten(array, []);
};
var copyObject = function(obj) {
return window.JSON.parse(window.JSON.stringify(obj));
};
var unionArrays = function (x, y) {
var obj = {};
for (var ix = x.length-1; ix >= 0; -- ix) {
obj[x[ix]] = x[ix];
}
for (var iy = y.length-1; iy >= 0; -- iy) {
obj[y[iy]] = y[iy];
}
var res = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
res.push(obj[k]);
}
}
return res;
};
var formBuilder = {
buildForm: function(buildArray, config) {
return this.buildRecurse(buildArray, config);
},
buildRecurse: function(buildArray, config) {
var htmlString = "";
for (var i = 0; i < buildArray.length; i++) {
var current = buildArray[i];
if(['number', 'text', 'email', 'tel', 'week', 'url', 'date', 'datetime', 'datetime-local', 'color', 'search', 'password'].indexOf(current.type) >= 0) {
htmlString += formBuilder.input(current, config);
}
else if(current.type === 'select') {
htmlString += formBuilder.select(current, config);
}
else if (current.type === 'div') {
var className = formBuilder.determineClassString(current, config);
var openTag = "<div>";
if (className) {
openTag = "<div class='" + className + "'>";
}
htmlString += openTag + this.buildRecurse(current.contents, config) + "</div>";
}
else if (current.type === 'textarea') {
htmlString += formBuilder.textarea(current, config);
}
else if (current.type === 'button') {
htmlString += formBuilder.button(current, config);
}
else if (current.type === 'hidden') {
htmlString += formBuilder.hidden(current, config);
}
else if (current.type === 'checkbox') {
htmlString += formBuilder.checkbox(current, config);
}
}
return htmlString;
},
camelcase: function(input) {
return input.toLowerCase().replace(/[- ](.)/g, function(match, group1) {
return group1.toUpperCase();
});
},
determineFieldName: function(config) {
return config.fieldName || this.camelcase(config.name);
},
determineClassString: function(config, global) {
var className = "";
if (!config.noDefaultClasses && global.defaultClass) {
className = global.defaultClass;
}
if (config.className) {
if (className) {
className += " ";
}
className += config.className;
}
return className;
},
input: function(config, global) {
var className = this.determineClassString(config, global);
var placeholder = config.placeholder || config.name;
var fieldName = this.determineFieldName(config);
var options = " ";
if (config.required) {
options += "required ";
}
if (config.charLimit) {
options += "maxlength='" + config.charLimit + "' ";
}
return "<input type='" + config.type + "' class='" + className +
"' placeholder='" + placeholder + "' data-forge-key='" + fieldName + "'" + options +"/>";
},
select: function(config, global) {
var className = this.determineClassString(config, global);
var fieldName = (config.fieldName) ? config.fieldName : this.camelcase(config.name);
var options = " ";
if (config.required) {
options += "required ";
}
var html = "<select class='" + className + "' data-forge-key='" + fieldName + "'" + options +">";
for (var i = 0; i < config.options.length; i++) {
html += "<option value='" + config.options[i][0] + "'>" + config.options[i][1] + "</option>";
}
html += "</select>";
return html;
},
textarea: function(config, global) {
var className = this.determineClassString(config, global);
var placeholder = config.placeholder || config.name;
var fieldName = this.determineFieldName(config);
var options = " ";
if (config.required) {
options += "required ";
}
if (config.charLimit) {
options += "maxlength='" + config.charLimit + "' ";
}
return "<textarea class='" + className + "' placeholder='" + placeholder +
"' data-forge-key='" + fieldName + "'" + options +"></textarea>";
},
button: function(config, global) {
return "<button type='submit' class='" + this.determineClassString(config, global) + "'>" + config.name + "</button>";
},
hidden: function(config, global) {
var fieldName = this.determineFieldName(config);
return "<input value='' type='" + config.type + "' data-forge-key='" + fieldName + "'/>";
},
checkbox: function(config, global) {
return "<label class='" + config.label.className + "'><input data-forge-key=" + this.determineFieldName(config, global) + " class='" + config.className + "' type='checkbox' /> " + config.label.text + "</label>";
}
};
var mergeObjects = function(obj1, obj2) {
var impureMerge = function(fromObj, toObj) {
for (var key in fromObj) {
if (fromObj.hasOwnProperty(key)) {
toObj[key] = fromObj[key];
}
}
return toObj;
};
var newObj = {};
newObj = impureMerge(obj1, newObj);
newObj = impureMerge(obj2, newObj);
return newObj;
};
var discoverWatches = function(form) {
var watches = {};
for (var i = 0; i < form.length; i++) {
var current = form[i];
if (current.type === 'div') {
var newWatches = discoverWatches(current.contents);
watches = mergeObjects(watches, newWatches);
}
else if (current.conditional) {
if (current.conditional.callback && current.conditional.dependencies) {
for (var j = 0; j < current.conditional.dependencies.length; j++) {
if (!watches[current.conditional.dependencies[j]]) {
watches[current.conditional.dependencies[j]] = [];
}
var clone = {
targets: formBuilder.determineFieldName(current),
dependencies: current.conditional.dependencies,
callback: current.conditional.callback
};
watches[current.conditional.dependencies[j]].push(clone);
}
}
else {
window.console.warn('To register a conditional watch, you must include both callback and dependencies. Watch skipped for ', current);
}
}
}
return watches;
};
var isEmptyObject = function(obj) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
return false;
}
}
return true;
};
var gatherArgs = function(deps, values, config) {
var ans = [];
for (var i = 0, l = deps.length; i < l; i++) {
if (deps[i] !== '$internals') {
ans.push(values[deps[i]]);
}
else {
ans.push(config.internals);
}
}
return ans;
};
var gatherNodes = function(domTree, values) {
var nodes = {};
for (var key in values) {
if (values.hasOwnProperty(key)) {
var node = domTree.querySelector("[data-forge-key='" + key +"']");
nodes[key] = node;
if (node.type !== 'checkbox') {
this._values[key] = nodes[key].value;
}
else {
this._values[key] = nodes[key].checked;
}
}
}
return nodes;
};
var Forge = function(form, config){
this._form = form;
this._config = config;
this._target = null;
this._innerHTML = "";
this._values = {};
this._domNode = null;
this._watches = {};
this._nodes = {};
this._init();
};
Forge.prototype._init = function() {
var flattened = flatten(this._form);
var obj = {};
flattened.map(function(el) {
obj[el] = "";
});
this._values = obj;
this._watches = discoverWatches(this._form);
this._hasWatches = !isEmptyObject(this._watches);
this._generateCss();
};
Forge.prototype._generateCss = function() {
if (!window.document.getElementById('forge-generated-styles')) {
var style = window.document.createElement('style');
style.type = 'text/css';
style.id = "forge-generated-styles";
style.innerHTML = '.forge-hidden { display: none !important; }';
window.document.getElementsByTagName('head')[0].appendChild(style);
}
};
Forge.prototype._runAllConditionals = function() {
for (var key in this._watches) {
if (this._watches.hasOwnProperty(key)) {
this._checkValueForConditionals(key);
}
}
};
Forge.prototype.render = function(target) {
var node = window.document.querySelector(target);
this._innerHTML = formBuilder.buildForm(this._form, this._config);
var form = window.document.createElement('form');
form.innerHTML = this._innerHTML;
form.id = this._config.formId;
form.addEventListener('change', this.eventDispatch.bind(this));
form.addEventListener('keydown', this.eventDispatch.bind(this));
if (this._config.formSubmit) {
form.addEventListener('submit', this._config.formSubmit);
}
this._domNode= form;
this._nodes = gatherNodes.call(this, form, this._values);
this._runAllConditionals();
node.appendChild(form);
this._target = target;
};
Forge.prototype.eventDispatch = function(e) {
var target = e.target;
var key = target.dataset.forgeKey;
if (target.type === 'checkbox') {
this._values[key] = e.target.checked;
}
else {
this._values[key] = e.target.value;
}
this._checkValueForConditionals(key);
};
Forge.prototype._checkValueForConditionals = function(key) {
if (this._hasWatches && this._watches[key]) {
var current = this._watches[key];
for (var i = 0, l = current.length; i < l; i++) {
var node = this._nodes[current[i].targets];
var gatheredArgs = gatherArgs(current[i].dependencies, this._values, this._config);
if (!current[i].callback.apply(this, gatheredArgs)) {
if (node.className.indexOf('forge-hidden') < 0) {
node.className += " forge-hidden";
}
}
else if (node.className.indexOf('forge-hidden') >= 0) {
node.className = node.className.replace('forge-hidden','','i');
}
}
}
};
Forge.prototype.set = function(key, value) {
var node = this._domNode.querySelector("[data-forge-key='" + key +"']");
this._values[key] = value;
if (node.type === 'checkbox') {
node.checked = value;
}
else {
node.value = value;
}
this._checkValueForConditionals(key);
};
Forge.prototype.getData = function() {
return copyObject(this._values);
};
Forge.prototype.getConfig = function() {
return copyObject(this._config);
};
Forge.prototype.validate = function() {
var validateRecurse = function(form, acc) {
for (var i = 0, l = form.length; i < l; i++) {
if (form[i].type === 'div') {
validateRecurse(form[i].contents, acc);
}
else if (form[i].type === 'button') {
// do nothing
}
else {
var fieldName = formBuilder.determineFieldName(form[i]);
if (form[i].required && !this._values[fieldName]) {
acc.push(fieldName);
}
}
}
return acc;
}.bind(this);
var errors = validateRecurse(this._form, []);
if (this._config.validate) {
var validateErrors = this._config.validate(this._values);
errors = unionArrays(errors, validateErrors);
}
for (var key in this._values) {
if (this._values.hasOwnProperty(key)) {
var node = this._nodes[key];
if (errors.indexOf(key) >= 0 && node.className.indexOf('forge-error') < 0) {
node.className += " forge-error";
}
else if (errors.indexOf(key) < 0 && node.className.indexOf('forge-error') >= 0) {
node.className = node.className.replace('forge-error','','i');
}
}
}
return errors;
};
module.exports = function(form, config) {
return new Forge(form, config);
};
})(window, module);
| btholt/fucina | fucina.js | JavaScript | mit | 12,761 |
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
// watch for changes and trigger compass, jshint, uglify and livereload
watch: {
js: {
files: ['jquery.accrue.js'],
tasks: ['jshint','uglify'],
options: {
livereload: true,
},
},
css: {
files: 'example.scss',
tasks: ['sass'],
options: {
livereload: true,
},
}
},
// we use the Sass
sass: {
dist: {
options: {
// nested, compact, compressed, expanded
style: 'compressed'
},
files: {
'example.css': 'example.scss'
}
}
},
// uglify to concat & minify
uglify: {
js: {
files: {
'jquery.accrue.min.js': 'jquery.accrue.js',
}
}
},
// lint me.
jshint: {
all: ['jquery.accrue.js']
}
});
// register task
grunt.registerTask('default', ['watch']);
}; | jpederson/Accrue.js | gruntfile.js | JavaScript | mit | 1,376 |
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import update from 'immutability-helper';
class ListItemBullet extends Component {
render() {
let cssClasses = `listbullet`;
const bulletStyle = {
border: `5px solid ${this.props.color}`,
backgroundColor: 'white'
};
return (
<div className={cssClasses} style={bulletStyle}></div>
);
}
};
class MyRouteMap extends Component {
render() {
const renderList = (list) => {
const lis = list.map((data, index) => {
return (<li key={index}><ListItemBullet color={this.props.color} />
{
data.url?
(<a href={data.url}><span className='description'>{data.name}</span><div className='details'>This is a test.<br/>This is second line</div></a>)
:
(<span className='description'>{data.name}</span>)
}
</li>);
})
return lis;
};
const cssClasses = `App-routemap ${this.props.color}`;
const ulStyle = {
//color: this.props.color,
marginTop: '30px'
};
const ulBeforeStyle = {
content: " ",
position: 'absolute',
marginLeft: '8px',
left: '0px',
top: '20px',
bottom: '40px',
width: '12px',
zIndex: -5,
backgroundColor: this.props.color
};
return (
<div className="App-routemap-div">
<h2>{this.props.title}</h2>
<ul className={cssClasses} style={ulStyle}>
<div style={ulBeforeStyle}></div>
{ renderList(this.props.datalist) }
</ul>
</div>
);
}
}
class App extends Component {
constructor() {
super();
this.state = {
list_unix: [
{
name: "Git 使用與教學",
url: "https://se101.mtsa.me/Slide/Git/#/"
}
],
'list_system': [
"作業系統概述",
"分散式系統架構",
"Scaling Up"
],
'list_data': [
"大數據分析簡介",
"TensorFlow 簡介",
],
'list_algo': [
"Python3 語法介紹",
"演算法簡介",
"基礎資料結構",
"字串處理",
"動態規劃",
"圖論演算法"
]
};
}
handleClick(e) {
var p = this.state.list_data;
p.push("Test Item");
var newState = update(this.state, {'list_data': {$set: p}});
this.setState(newState);
}
render() {
return (
<div className="App">
<div className="App-header">
<h1>SE101: 我想成為軟體工程師!</h1>
<span className="App-intro">UMich Taiwanese Software Engineers Reading Group - Fall 2017</span>
</div>
<div className="App-contents">
<MyRouteMap title='黑框框與開發者工具'datalist={this.state.list_unix} color='red' />
<MyRouteMap title='系統架設與維運' datalist={this.state.list_system} color='darkgreen' />
<MyRouteMap title='資料科學與技術' datalist={this.state.list_data} color='darkblue' />
<MyRouteMap title='編程面試與程式語言' datalist={this.state.list_algo} color='orange' />
</div>
</div>
);
//<button onClick={() => this.handleClick()}>Add Item</button>
}
}
export default App;
| tmt514/se101f17 | website/src/App.js | JavaScript | mit | 3,281 |
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
didInsertElement: function() {
this.startPoppover();
},
willDestroyElement: function() {
this.dismissPoppover();
},
startPoppover: function() {
var options = this.getPoppoverOptions();
Ember.$(function() {
Ember.$('[data-toggle="popover"]').popover(options);
});
},
getPoppoverOptions: function() {
var template = Ember.$('.poppover-template').innerHTML;
var content = Ember.$('.poppover-content').html();
return {
template: template,
placement: 'right',
title: 'Download Tip',
trigger: 'hover',
content: content,
html: true
};
},
dismissPoppover: function() {
Ember.$('[data-toggle="popover"]').popover('hide');
}
});
| iorrah/you-rockstar | app/components/resume/yr-download-tips.js | JavaScript | mit | 806 |
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* SoundcloudSearch Schema
*/
var SoundcloudSearchSchema = new Schema({
// SoundcloudSearch model fields
// ...
search: {
type: String,
required: 'There must be a search term',
trim: true
},
result: {
type: Object
},
created: {
type: Date,
default: Date.now
}
});
mongoose.model('SoundcloudSearch', SoundcloudSearchSchema); | bhops/Music | app/models/soundcloud-search.server.model.js | JavaScript | mit | 463 |
// * ———————————————————————————————————————————————————————— * //
// * cli upload
// * uploads image by providing a link by running:
// * enduro upload http://www.imgur.com/asd.png
// * ———————————————————————————————————————————————————————— * //
var cli_upload = function () {}
// vendor dependencies
var Promise = require('bluebird')
// local dependencies
var logger = require(ENDURO_FOLDER + '/libs/logger')
var file_uploader = require(ENDURO_FOLDER + '/libs/admin_utilities/file_uploader')
// * ———————————————————————————————————————————————————————— * //
// * cli upload
// * generates object based on flag array
// *
// * @return {string} - url for uploaded link
// * ———————————————————————————————————————————————————————— * //
cli_upload.prototype.cli_upload = function (file_url) {
if (!file_url) {
logger.err('File url not specified\nUsage: $ enduro upload http://yourdomain.com/yourimage.png')
return Promise.reject()
}
return file_uploader.upload_by_url(file_url)
}
module.exports = new cli_upload()
| dmourato/mastercv | libs/cli_tools/cli_upload.js | JavaScript | mit | 1,479 |
import React from "react"
import Img from "gatsby-image"
import { StaticQuery, graphql } from "gatsby"
import html5 from "../images/html5.svg"
import js from "../images/javascript.svg"
import jQuery from "../images/jquery.svg"
import php from "../images/php.svg"
import python from "../images/python.svg"
import css3 from "../images/css3.svg"
import sass from "../images/sass.svg"
import react from "../images/react.svg"
import redux from "../images/redux.svg"
import angular from "../images/angular.svg"
import nodejs from "../images/nodejs.svg"
import express from "../images/express.svg"
import graphQL from "../images/graphql.svg"
import apollo from "../images/apollo.svg"
import laravel from "../images/laravel.svg"
import django from "../images/django.svg"
import ruby from "../images/ruby.svg"
import rails from "../images/rails.svg"
import firebase from "../images/firebase.svg"
import mongodb from "../images/mongodb.svg"
import postgresql from "../images/postgresql.svg"
const About = ({ id }) => (
<StaticQuery
query={graphql`
query AboutImgQuery {
aboutImg: file(relativePath: { eq: "towers.jpg" }) {
childImageSharp {
fluid(maxWidth: 1200) {
...GatsbyImageSharpFluid
}
}
}
}
`}
render={data => (
<section id={id} className="section cover">
<Img
title="About image"
alt="Towers"
fluid={data.aboutImg.childImageSharp.fluid}
style={{
borderBottom: "2px solid #0F2027",
position: "absolute",
left: 0,
top: 0,
width: "100%",
height: "100%",
}}
/>
<div className="overlay" />
<div className="about">
<h1 className="name mt-5">
<b>About Me</b>
</h1>
<div className="description mb-4">
<h5 className="greetings">
I'm a developer who is driven by the motivation to learn and
utilize all of the <br />
newest and leading software technologies, tools and frameworks.{" "}
<br />
Here are some of the technologies I have worked with:
</h5>
</div>
<div className="svg-container">
<div className="logo-container">
<a
href="https://rebrand.ly/w1zfk5"
target="_blank"
rel="noopener noreferrer"
>
<img src={html5} alt="html5" />
</a>
<h5>HTML</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/gpe80b"
target="_blank"
rel="noopener noreferrer"
>
<img src={css3} alt="css3" />
</a>
<h5>CSS</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/ac3zez"
target="_blank"
rel="noopener noreferrer"
>
<img src={sass} alt="sass" />
</a>
<h5>Sass</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/gdw8nf"
target="_blank"
rel="noopener noreferrer"
>
<img src={js} alt="js" />
</a>
<h5>JavaScript</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/t8q4kk"
target="_blank"
rel="noopener noreferrer"
>
<img src={jQuery} alt="jQuery" />
</a>
<h5>jQuery</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/5dmk0k"
target="_blank"
rel="noopener noreferrer"
>
<img src={php} alt="php" />
</a>
<h5>PHP</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/51v3f7"
target="_blank"
rel="noopener noreferrer"
>
<img src={ruby} alt="ruby" />
</a>
<h5>Ruby</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/u9f3bu"
target="_blank"
rel="noopener noreferrer"
>
<img src={python} alt="python" />
</a>
<h5>Python</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/4711zo"
target="_blank"
rel="noopener noreferrer"
>
<img src={react} alt="react" />
</a>
<h5>React</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/f4fdtb"
target="_blank"
rel="noopener noreferrer"
>
<img src={redux} alt="redux" />
</a>
<h5>Redux</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/0af3pn"
target="_blank"
rel="noopener noreferrer"
>
<img src={angular} alt="angular" />
</a>
<h5>Angular</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/fno5hy"
target="_blank"
rel="noopener noreferrer"
>
<img src={nodejs} alt="nodejs" />
</a>
<h5>Node</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/8pwvla"
target="_blank"
rel="noopener noreferrer"
>
<img src={express} alt="express" />
</a>
<h5>Express</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/chgco7"
target="_blank"
rel="noopener noreferrer"
>
<img src={graphQL} alt="graphQL" />
</a>
<h5>GraphQL</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/s8v7qq"
target="_blank"
rel="noopener noreferrer"
>
<img src={apollo} alt="apollo" />
</a>
<h5>Apollo</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/jm3gu8"
target="_blank"
rel="noopener noreferrer"
>
<img src={laravel} alt="laravel" />
</a>
<h5>Laravel</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/hbkv6c"
target="_blank"
rel="noopener noreferrer"
>
<img src={django} alt="django" />
</a>
<h5>Django</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/71jw07"
target="_blank"
rel="noopener noreferrer"
>
<img src={rails} alt="rails" />
</a>
<h5>Ruby on Rails</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/8jg10f"
target="_blank"
rel="noopener noreferrer"
>
<img src={firebase} alt="firebase" />
</a>
<h5>Firebase</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/1lamx3"
target="_blank"
rel="noopener noreferrer"
>
<img src={mongodb} alt="mongodb" />
</a>
<h5>MongoDB</h5>
</div>
<div className="logo-container">
<a
href="https://rebrand.ly/az0ssm"
target="_blank"
rel="noopener noreferrer"
>
<img src={postgresql} alt="postgresql" />
</a>
<h5>PostgreSQL</h5>
</div>
</div>
<div className="arrow animated bounceInDown" />
</div>
</section>
)}
/>
)
export default About
| ajspotts/ajspotts.github.io | src/components/about.js | JavaScript | mit | 9,133 |
var debug = require('debug')('harmonyhubjs:client:login:hub')
var Client = require('node-xmpp-client')
var Q = require('q')
var util = require('../util')
/** PrivateFunction: getIdentity
* Logs in to a Harmony hub as a guest and uses the userAuthToken from logitech's
* web service to retrieve an identity token.
*
* Parameters:
* (String) hubhost - Hostname/IP of the Harmony hub to connect.
* (int) hubport - Optional. Port of the Harmony hub to connect. By default,
* this is set to 5222.
*
* Returns:
* (Q.promise) - The resolved promise passes the retrieved identity token.
*/
function getIdentity (hubhost, hubport) {
debug('retrieve identity by logging in as guest')
// guest@x.com / guest
// guest@connect.logitech.com/gatorade
var deferred = Q.defer()
var iqId
var xmppClient = new Client({
jid: 'guest@x.com/gatorade',
password: 'guest',
host: hubhost,
port: hubport,
disallowTLS: true,
reconnect: true
})
xmppClient.on('online', function () {
debug('XMPP client connected')
var body = 'method=pair:name=harmonyjs#iOS6.0.1#iPhone'
var iq = util.buildIqStanza(
'get', 'connect.logitech.com', 'vnd.logitech.connect/vnd.logitech.pair',
body, 'guest')
iqId = iq.attr('id')
xmppClient.send(iq)
})
xmppClient.on('error', function (e) {
debug('XMPP client error', e)
xmppClient.end()
deferred.reject(e)
})
xmppClient.on('stanza', function (stanza) {
debug('received XMPP stanza: ' + stanza)
if (stanza.attrs.id === iqId.toString()) {
var body = stanza.getChildText('oa')
var response = util.decodeColonSeparatedResponse(body)
if (response.identity && response.identity !== undefined) {
debug('received identity token: ' + response.identity)
xmppClient.end()
deferred.resolve(response.identity)
} else {
debug('could not find identity token')
xmppClient.end()
deferred.reject(new Error('Did not retrieve identity.'))
}
}
})
return deferred.promise
}
/** PrivateFunction: loginWithIdentity
* After fetching an identity from the Harmony hub, this function creates an
* XMPP client using that identity. It returns a promise which, when resolved,
* passes that XMPP client.
*
* Parameters:
* (String) identity - Identity token to login to the Harmony hub.
* (String) hubhost - Hostname/IP of the Harmony hub to connect.
* (int) hubport - Optional. Port of the Harmony hub to connect. By default,
* this is set to 5222.
*
* Returns:
* (Q.promise) - When resolved, passes the logged in XMPP client, ready to
* communicate with the Harmony hub.
*/
function loginWithIdentity (identity, hubhost, hubport) {
debug('create xmpp client using retrieved identity token: ' + identity)
var deferred = Q.defer()
var jid = identity + '@connect.logitech.com/gatorade'
var password = identity
var xmppClient = new Client({
jid: jid,
password: password,
host: hubhost,
port: hubport,
disallowTLS: true
})
xmppClient.on('error', function (e) {
debug('XMPP login error', e)
xmppClient.end()
deferred.reject(e)
})
xmppClient.once('online', function () {
debug('XMPP client connected using identity token')
deferred.resolve(xmppClient)
})
return deferred.promise
}
/** Function: loginToHub
* Uses a userAuthToken to login to a Harmony hub.
*
* Parameters:
* (String) userAuthToken - A authentication token, retrieved from logitechs
* web service.
* (String) hubhost - Hostname/IP of the Harmony hub to connect.
* (int) hubport - Optional. Port of the Harmony hub to connect. By default,
* this is set to 5222.
*
* Returns:
* (Q.promise) - The final resolved promise will pass a fully authenticated
* XMPP client which can be used to communicate with the
* Harmony hub.
*/
function loginToHub (hubhost, hubport) {
debug('perform hub login')
hubport = hubport || 5222
return getIdentity(hubhost, hubport)
.then(function (identity) {
return loginWithIdentity(identity, hubhost, hubport)
})
}
module.exports = loginToHub
| swissmanu/harmonyhubjs-client | lib/login/hub.js | JavaScript | mit | 4,310 |
module.exports = require('regenerate')(0x261D, 0x26F9, 0x1F385, 0x1F3C7, 0x1F46E, 0x1F47C, 0x1F4AA, 0x1F57A, 0x1F590, 0x1F6A3, 0x1F6C0, 0x1F6CC, 0x1F926).addRange(0x270A, 0x270D).addRange(0x1F3C2, 0x1F3C4).addRange(0x1F3CA, 0x1F3CC).addRange(0x1F442, 0x1F443).addRange(0x1F446, 0x1F450).addRange(0x1F466, 0x1F469).addRange(0x1F470, 0x1F478).addRange(0x1F481, 0x1F483).addRange(0x1F485, 0x1F487).addRange(0x1F574, 0x1F575).addRange(0x1F595, 0x1F596).addRange(0x1F645, 0x1F647).addRange(0x1F64B, 0x1F64F).addRange(0x1F6B4, 0x1F6B6).addRange(0x1F918, 0x1F91C).addRange(0x1F91E, 0x1F91F).addRange(0x1F930, 0x1F939).addRange(0x1F93D, 0x1F93E).addRange(0x1F9D1, 0x1F9DD);
| ocadni/citychrone | .build/bundle/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/regenerate-unicode-properties/Binary_Property/Emoji_Modifier_Base.js | JavaScript | mit | 666 |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
__webpack_require__(1);
var _jquery = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"jquery\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()));
var _jquery2 = _interopRequireDefault(_jquery);
var _cats = __webpack_require__(327);
var _cats2 = _interopRequireDefault(_cats);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
(0, _jquery2.default)('<h1>Cats</h1>').appendTo('body');
var ul = (0, _jquery2.default)('<ul></ul>').appendTo('body');
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = _cats2.default[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var cat = _step.value;
(0, _jquery2.default)('<li></li>').text(cat).appendTo(ul);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {"use strict";
__webpack_require__(2);
__webpack_require__(323);
__webpack_require__(324);
if (global._babelPolyfill) {
throw new Error("only one instance of babel-polyfill is allowed");
}
global._babelPolyfill = true;
var DEFINE_PROPERTY = "defineProperty";
function define(O, key, value) {
O[key] || Object[DEFINE_PROPERTY](O, key, {
writable: true,
configurable: true,
value: value
});
}
define(String.prototype, "padLeft", "".padStart);
define(String.prototype, "padRight", "".padEnd);
"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
[][key] && define(Array, key, Function.call.bind([][key]));
});
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(3);
__webpack_require__(51);
__webpack_require__(52);
__webpack_require__(53);
__webpack_require__(54);
__webpack_require__(56);
__webpack_require__(59);
__webpack_require__(60);
__webpack_require__(61);
__webpack_require__(62);
__webpack_require__(63);
__webpack_require__(64);
__webpack_require__(65);
__webpack_require__(66);
__webpack_require__(67);
__webpack_require__(69);
__webpack_require__(71);
__webpack_require__(73);
__webpack_require__(75);
__webpack_require__(78);
__webpack_require__(79);
__webpack_require__(80);
__webpack_require__(84);
__webpack_require__(86);
__webpack_require__(88);
__webpack_require__(91);
__webpack_require__(92);
__webpack_require__(93);
__webpack_require__(94);
__webpack_require__(96);
__webpack_require__(97);
__webpack_require__(98);
__webpack_require__(99);
__webpack_require__(100);
__webpack_require__(101);
__webpack_require__(102);
__webpack_require__(104);
__webpack_require__(105);
__webpack_require__(106);
__webpack_require__(108);
__webpack_require__(109);
__webpack_require__(110);
__webpack_require__(112);
__webpack_require__(114);
__webpack_require__(115);
__webpack_require__(116);
__webpack_require__(117);
__webpack_require__(118);
__webpack_require__(119);
__webpack_require__(120);
__webpack_require__(121);
__webpack_require__(122);
__webpack_require__(123);
__webpack_require__(124);
__webpack_require__(125);
__webpack_require__(126);
__webpack_require__(131);
__webpack_require__(132);
__webpack_require__(136);
__webpack_require__(137);
__webpack_require__(138);
__webpack_require__(139);
__webpack_require__(141);
__webpack_require__(142);
__webpack_require__(143);
__webpack_require__(144);
__webpack_require__(145);
__webpack_require__(146);
__webpack_require__(147);
__webpack_require__(148);
__webpack_require__(149);
__webpack_require__(150);
__webpack_require__(151);
__webpack_require__(152);
__webpack_require__(153);
__webpack_require__(154);
__webpack_require__(155);
__webpack_require__(157);
__webpack_require__(158);
__webpack_require__(160);
__webpack_require__(161);
__webpack_require__(167);
__webpack_require__(168);
__webpack_require__(170);
__webpack_require__(171);
__webpack_require__(172);
__webpack_require__(176);
__webpack_require__(177);
__webpack_require__(178);
__webpack_require__(179);
__webpack_require__(180);
__webpack_require__(182);
__webpack_require__(183);
__webpack_require__(184);
__webpack_require__(185);
__webpack_require__(188);
__webpack_require__(190);
__webpack_require__(191);
__webpack_require__(192);
__webpack_require__(194);
__webpack_require__(196);
__webpack_require__(198);
__webpack_require__(199);
__webpack_require__(200);
__webpack_require__(202);
__webpack_require__(203);
__webpack_require__(204);
__webpack_require__(205);
__webpack_require__(216);
__webpack_require__(220);
__webpack_require__(221);
__webpack_require__(223);
__webpack_require__(224);
__webpack_require__(228);
__webpack_require__(229);
__webpack_require__(231);
__webpack_require__(232);
__webpack_require__(233);
__webpack_require__(234);
__webpack_require__(235);
__webpack_require__(236);
__webpack_require__(237);
__webpack_require__(238);
__webpack_require__(239);
__webpack_require__(240);
__webpack_require__(241);
__webpack_require__(242);
__webpack_require__(243);
__webpack_require__(244);
__webpack_require__(245);
__webpack_require__(246);
__webpack_require__(247);
__webpack_require__(248);
__webpack_require__(249);
__webpack_require__(251);
__webpack_require__(252);
__webpack_require__(253);
__webpack_require__(254);
__webpack_require__(255);
__webpack_require__(257);
__webpack_require__(258);
__webpack_require__(259);
__webpack_require__(261);
__webpack_require__(262);
__webpack_require__(263);
__webpack_require__(264);
__webpack_require__(265);
__webpack_require__(266);
__webpack_require__(267);
__webpack_require__(268);
__webpack_require__(270);
__webpack_require__(271);
__webpack_require__(273);
__webpack_require__(274);
__webpack_require__(275);
__webpack_require__(276);
__webpack_require__(279);
__webpack_require__(280);
__webpack_require__(282);
__webpack_require__(283);
__webpack_require__(284);
__webpack_require__(285);
__webpack_require__(287);
__webpack_require__(288);
__webpack_require__(289);
__webpack_require__(290);
__webpack_require__(291);
__webpack_require__(292);
__webpack_require__(293);
__webpack_require__(294);
__webpack_require__(295);
__webpack_require__(296);
__webpack_require__(298);
__webpack_require__(299);
__webpack_require__(300);
__webpack_require__(301);
__webpack_require__(302);
__webpack_require__(303);
__webpack_require__(304);
__webpack_require__(305);
__webpack_require__(306);
__webpack_require__(307);
__webpack_require__(308);
__webpack_require__(310);
__webpack_require__(311);
__webpack_require__(312);
__webpack_require__(313);
__webpack_require__(314);
__webpack_require__(315);
__webpack_require__(316);
__webpack_require__(317);
__webpack_require__(318);
__webpack_require__(319);
__webpack_require__(320);
__webpack_require__(321);
__webpack_require__(322);
module.exports = __webpack_require__(9);
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// ECMAScript 6 symbols shim
var global = __webpack_require__(4);
var has = __webpack_require__(5);
var DESCRIPTORS = __webpack_require__(6);
var $export = __webpack_require__(8);
var redefine = __webpack_require__(18);
var META = __webpack_require__(22).KEY;
var $fails = __webpack_require__(7);
var shared = __webpack_require__(23);
var setToStringTag = __webpack_require__(25);
var uid = __webpack_require__(19);
var wks = __webpack_require__(26);
var wksExt = __webpack_require__(27);
var wksDefine = __webpack_require__(28);
var enumKeys = __webpack_require__(29);
var isArray = __webpack_require__(44);
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
var toIObject = __webpack_require__(32);
var toPrimitive = __webpack_require__(16);
var createDesc = __webpack_require__(17);
var _create = __webpack_require__(45);
var gOPNExt = __webpack_require__(48);
var $GOPD = __webpack_require__(50);
var $DP = __webpack_require__(11);
var $keys = __webpack_require__(30);
var gOPD = $GOPD.f;
var dP = $DP.f;
var gOPN = gOPNExt.f;
var $Symbol = global.Symbol;
var $JSON = global.JSON;
var _stringify = $JSON && $JSON.stringify;
var PROTOTYPE = 'prototype';
var HIDDEN = wks('_hidden');
var TO_PRIMITIVE = wks('toPrimitive');
var isEnum = {}.propertyIsEnumerable;
var SymbolRegistry = shared('symbol-registry');
var AllSymbols = shared('symbols');
var OPSymbols = shared('op-symbols');
var ObjectProto = Object[PROTOTYPE];
var USE_NATIVE = typeof $Symbol == 'function';
var QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function () {
return _create(dP({}, 'a', {
get: function () { return dP(this, 'a', { value: 7 }).a; }
})).a != 7;
}) ? function (it, key, D) {
var protoDesc = gOPD(ObjectProto, key);
if (protoDesc) delete ObjectProto[key];
dP(it, key, D);
if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
} : dP;
var wrap = function (tag) {
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
sym._k = tag;
return sym;
};
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
return typeof it == 'symbol';
} : function (it) {
return it instanceof $Symbol;
};
var $defineProperty = function defineProperty(it, key, D) {
if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
anObject(it);
key = toPrimitive(key, true);
anObject(D);
if (has(AllSymbols, key)) {
if (!D.enumerable) {
if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
it[HIDDEN][key] = true;
} else {
if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
D = _create(D, { enumerable: createDesc(0, false) });
} return setSymbolDesc(it, key, D);
} return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P) {
anObject(it);
var keys = enumKeys(P = toIObject(P));
var i = 0;
var l = keys.length;
var key;
while (l > i) $defineProperty(it, key = keys[i++], P[key]);
return it;
};
var $create = function create(it, P) {
return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
var E = isEnum.call(this, key = toPrimitive(key, true));
if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
it = toIObject(it);
key = toPrimitive(key, true);
if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
var D = gOPD(it, key);
if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it) {
var names = gOPN(toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
} return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
var IS_OP = it === ObjectProto;
var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
} return result;
};
// 19.4.1.1 Symbol([description])
if (!USE_NATIVE) {
$Symbol = function Symbol() {
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
var $set = function (value) {
if (this === ObjectProto) $set.call(OPSymbols, value);
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
setSymbolDesc(this, tag, createDesc(1, value));
};
if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
return wrap(tag);
};
redefine($Symbol[PROTOTYPE], 'toString', function toString() {
return this._k;
});
$GOPD.f = $getOwnPropertyDescriptor;
$DP.f = $defineProperty;
__webpack_require__(49).f = gOPNExt.f = $getOwnPropertyNames;
__webpack_require__(43).f = $propertyIsEnumerable;
__webpack_require__(42).f = $getOwnPropertySymbols;
if (DESCRIPTORS && !__webpack_require__(24)) {
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
}
wksExt.f = function (name) {
return wrap(wks(name));
};
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
for (var es6Symbols = (
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
// 19.4.2.1 Symbol.for(key)
'for': function (key) {
return has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = $Symbol(key);
},
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function keyFor(sym) {
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
},
useSetter: function () { setter = true; },
useSimple: function () { setter = false; }
});
$export($export.S + $export.F * !USE_NATIVE, 'Object', {
// 19.1.2.2 Object.create(O [, Properties])
create: $create,
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
defineProperty: $defineProperty,
// 19.1.2.3 Object.defineProperties(O, Properties)
defineProperties: $defineProperties,
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $getOwnPropertyNames,
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: $getOwnPropertySymbols
});
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it) {
var args = [it];
var i = 1;
var replacer, $replacer;
while (arguments.length > i) args.push(arguments[i++]);
$replacer = replacer = args[1];
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!isArray(replacer)) replacer = function (key, value) {
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
if (!isSymbol(value)) return value;
};
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(10)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);
/***/ }),
/* 4 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 5 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(7)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 7 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var core = __webpack_require__(9);
var hide = __webpack_require__(10);
var redefine = __webpack_require__(18);
var ctx = __webpack_require__(20);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
var key, own, out, exp;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
// export native or passed
out = (own ? target : source)[key];
// bind timers to global for call from export context
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// extend global
if (target) redefine(target, key, out, type & $export.U);
// export
if (exports[key] != out) hide(exports, key, exp);
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
}
};
global.core = core;
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 9 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.5.7' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(11);
var createDesc = __webpack_require__(17);
module.exports = __webpack_require__(6) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(12);
var IE8_DOM_DEFINE = __webpack_require__(14);
var toPrimitive = __webpack_require__(16);
var dP = Object.defineProperty;
exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 13 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(6) && !__webpack_require__(7)(function () {
return Object.defineProperty(__webpack_require__(15)('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
var document = __webpack_require__(4).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(13);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/* 17 */
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var hide = __webpack_require__(10);
var has = __webpack_require__(5);
var SRC = __webpack_require__(19)('src');
var TO_STRING = 'toString';
var $toString = Function[TO_STRING];
var TPL = ('' + $toString).split(TO_STRING);
__webpack_require__(9).inspectSource = function (it) {
return $toString.call(it);
};
(module.exports = function (O, key, val, safe) {
var isFunction = typeof val == 'function';
if (isFunction) has(val, 'name') || hide(val, 'name', key);
if (O[key] === val) return;
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
if (O === global) {
O[key] = val;
} else if (!safe) {
delete O[key];
hide(O, key, val);
} else if (O[key]) {
O[key] = val;
} else {
hide(O, key, val);
}
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString() {
return typeof this == 'function' && this[SRC] || $toString.call(this);
});
/***/ }),
/* 19 */
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(21);
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/* 21 */
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
var META = __webpack_require__(19)('meta');
var isObject = __webpack_require__(13);
var has = __webpack_require__(5);
var setDesc = __webpack_require__(11).f;
var id = 0;
var isExtensible = Object.isExtensible || function () {
return true;
};
var FREEZE = !__webpack_require__(7)(function () {
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function (it) {
setDesc(it, META, { value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
} });
};
var fastKey = function (it, create) {
// return primitive with prefix
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return 'F';
// not necessary to add metadata
if (!create) return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function (it, create) {
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return true;
// not necessary to add metadata
if (!create) return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__(9);
var global = __webpack_require__(4);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: core.version,
mode: __webpack_require__(24) ? 'pure' : 'global',
copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/* 24 */
/***/ (function(module, exports) {
module.exports = false;
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
var def = __webpack_require__(11).f;
var has = __webpack_require__(5);
var TAG = __webpack_require__(26)('toStringTag');
module.exports = function (it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(23)('wks');
var uid = __webpack_require__(19);
var Symbol = __webpack_require__(4).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
exports.f = __webpack_require__(26);
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var core = __webpack_require__(9);
var LIBRARY = __webpack_require__(24);
var wksExt = __webpack_require__(27);
var defineProperty = __webpack_require__(11).f;
module.exports = function (name) {
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
};
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
// all enumerable object keys, includes symbols
var getKeys = __webpack_require__(30);
var gOPS = __webpack_require__(42);
var pIE = __webpack_require__(43);
module.exports = function (it) {
var result = getKeys(it);
var getSymbols = gOPS.f;
if (getSymbols) {
var symbols = getSymbols(it);
var isEnum = pIE.f;
var i = 0;
var key;
while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
} return result;
};
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(31);
var enumBugKeys = __webpack_require__(41);
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(5);
var toIObject = __webpack_require__(32);
var arrayIndexOf = __webpack_require__(36)(false);
var IE_PROTO = __webpack_require__(40)('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(33);
var defined = __webpack_require__(35);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(34);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/* 34 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/* 35 */
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(32);
var toLength = __webpack_require__(37);
var toAbsoluteIndex = __webpack_require__(39);
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(38);
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/* 38 */
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(38);
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__(23)('keys');
var uid = __webpack_require__(19);
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/* 41 */
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/* 42 */
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/* 43 */
/***/ (function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ }),
/* 44 */
/***/ (function(module, exports, __webpack_require__) {
// 7.2.2 IsArray(argument)
var cof = __webpack_require__(34);
module.exports = Array.isArray || function isArray(arg) {
return cof(arg) == 'Array';
};
/***/ }),
/* 45 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(12);
var dPs = __webpack_require__(46);
var enumBugKeys = __webpack_require__(41);
var IE_PROTO = __webpack_require__(40)('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(15)('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
__webpack_require__(47).appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(11);
var anObject = __webpack_require__(12);
var getKeys = __webpack_require__(30);
module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/* 47 */
/***/ (function(module, exports, __webpack_require__) {
var document = __webpack_require__(4).document;
module.exports = document && document.documentElement;
/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = __webpack_require__(32);
var gOPN = __webpack_require__(49).f;
var toString = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function (it) {
try {
return gOPN(it);
} catch (e) {
return windowNames.slice();
}
};
module.exports.f = function getOwnPropertyNames(it) {
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};
/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = __webpack_require__(31);
var hiddenKeys = __webpack_require__(41).concat('length', 'prototype');
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return $keys(O, hiddenKeys);
};
/***/ }),
/* 50 */
/***/ (function(module, exports, __webpack_require__) {
var pIE = __webpack_require__(43);
var createDesc = __webpack_require__(17);
var toIObject = __webpack_require__(32);
var toPrimitive = __webpack_require__(16);
var has = __webpack_require__(5);
var IE8_DOM_DEFINE = __webpack_require__(14);
var gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__(6) ? gOPD : function getOwnPropertyDescriptor(O, P) {
O = toIObject(O);
P = toPrimitive(P, true);
if (IE8_DOM_DEFINE) try {
return gOPD(O, P);
} catch (e) { /* empty */ }
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
};
/***/ }),
/* 51 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, 'Object', { create: __webpack_require__(45) });
/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperty: __webpack_require__(11).f });
/***/ }),
/* 53 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperties: __webpack_require__(46) });
/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
var toIObject = __webpack_require__(32);
var $getOwnPropertyDescriptor = __webpack_require__(50).f;
__webpack_require__(55)('getOwnPropertyDescriptor', function () {
return function getOwnPropertyDescriptor(it, key) {
return $getOwnPropertyDescriptor(toIObject(it), key);
};
});
/***/ }),
/* 55 */
/***/ (function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__(8);
var core = __webpack_require__(9);
var fails = __webpack_require__(7);
module.exports = function (KEY, exec) {
var fn = (core.Object || {})[KEY] || Object[KEY];
var exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
};
/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 Object.getPrototypeOf(O)
var toObject = __webpack_require__(57);
var $getPrototypeOf = __webpack_require__(58);
__webpack_require__(55)('getPrototypeOf', function () {
return function getPrototypeOf(it) {
return $getPrototypeOf(toObject(it));
};
});
/***/ }),
/* 57 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(35);
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/* 58 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(5);
var toObject = __webpack_require__(57);
var IE_PROTO = __webpack_require__(40)('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/* 59 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 Object.keys(O)
var toObject = __webpack_require__(57);
var $keys = __webpack_require__(30);
__webpack_require__(55)('keys', function () {
return function keys(it) {
return $keys(toObject(it));
};
});
/***/ }),
/* 60 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.7 Object.getOwnPropertyNames(O)
__webpack_require__(55)('getOwnPropertyNames', function () {
return __webpack_require__(48).f;
});
/***/ }),
/* 61 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.5 Object.freeze(O)
var isObject = __webpack_require__(13);
var meta = __webpack_require__(22).onFreeze;
__webpack_require__(55)('freeze', function ($freeze) {
return function freeze(it) {
return $freeze && isObject(it) ? $freeze(meta(it)) : it;
};
});
/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.17 Object.seal(O)
var isObject = __webpack_require__(13);
var meta = __webpack_require__(22).onFreeze;
__webpack_require__(55)('seal', function ($seal) {
return function seal(it) {
return $seal && isObject(it) ? $seal(meta(it)) : it;
};
});
/***/ }),
/* 63 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.15 Object.preventExtensions(O)
var isObject = __webpack_require__(13);
var meta = __webpack_require__(22).onFreeze;
__webpack_require__(55)('preventExtensions', function ($preventExtensions) {
return function preventExtensions(it) {
return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
};
});
/***/ }),
/* 64 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.12 Object.isFrozen(O)
var isObject = __webpack_require__(13);
__webpack_require__(55)('isFrozen', function ($isFrozen) {
return function isFrozen(it) {
return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
};
});
/***/ }),
/* 65 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.13 Object.isSealed(O)
var isObject = __webpack_require__(13);
__webpack_require__(55)('isSealed', function ($isSealed) {
return function isSealed(it) {
return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
};
});
/***/ }),
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.11 Object.isExtensible(O)
var isObject = __webpack_require__(13);
__webpack_require__(55)('isExtensible', function ($isExtensible) {
return function isExtensible(it) {
return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
};
});
/***/ }),
/* 67 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__(8);
$export($export.S + $export.F, 'Object', { assign: __webpack_require__(68) });
/***/ }),
/* 68 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 19.1.2.1 Object.assign(target, source, ...)
var getKeys = __webpack_require__(30);
var gOPS = __webpack_require__(42);
var pIE = __webpack_require__(43);
var toObject = __webpack_require__(57);
var IObject = __webpack_require__(33);
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__(7)(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = gOPS.f;
var isEnum = pIE.f;
while (aLen > index) {
var S = IObject(arguments[index++]);
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
} return T;
} : $assign;
/***/ }),
/* 69 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.10 Object.is(value1, value2)
var $export = __webpack_require__(8);
$export($export.S, 'Object', { is: __webpack_require__(70) });
/***/ }),
/* 70 */
/***/ (function(module, exports) {
// 7.2.9 SameValue(x, y)
module.exports = Object.is || function is(x, y) {
// eslint-disable-next-line no-self-compare
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
};
/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__(8);
$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(72).set });
/***/ }),
/* 72 */
/***/ (function(module, exports, __webpack_require__) {
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = __webpack_require__(13);
var anObject = __webpack_require__(12);
var check = function (O, proto) {
anObject(O);
if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
function (test, buggy, set) {
try {
set = __webpack_require__(20)(Function.call, __webpack_require__(50).f(Object.prototype, '__proto__').set, 2);
set(test, []);
buggy = !(test instanceof Array);
} catch (e) { buggy = true; }
return function setPrototypeOf(O, proto) {
check(O, proto);
if (buggy) O.__proto__ = proto;
else set(O, proto);
return O;
};
}({}, false) : undefined),
check: check
};
/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 19.1.3.6 Object.prototype.toString()
var classof = __webpack_require__(74);
var test = {};
test[__webpack_require__(26)('toStringTag')] = 'z';
if (test + '' != '[object z]') {
__webpack_require__(18)(Object.prototype, 'toString', function toString() {
return '[object ' + classof(this) + ']';
}, true);
}
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__(34);
var TAG = __webpack_require__(26)('toStringTag');
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (e) { /* empty */ }
};
module.exports = function (it) {
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
var $export = __webpack_require__(8);
$export($export.P, 'Function', { bind: __webpack_require__(76) });
/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var aFunction = __webpack_require__(21);
var isObject = __webpack_require__(13);
var invoke = __webpack_require__(77);
var arraySlice = [].slice;
var factories = {};
var construct = function (F, len, args) {
if (!(len in factories)) {
for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
// eslint-disable-next-line no-new-func
factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
} return factories[len](F, args);
};
module.exports = Function.bind || function bind(that /* , ...args */) {
var fn = aFunction(this);
var partArgs = arraySlice.call(arguments, 1);
var bound = function (/* args... */) {
var args = partArgs.concat(arraySlice.call(arguments));
return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
};
if (isObject(fn.prototype)) bound.prototype = fn.prototype;
return bound;
};
/***/ }),
/* 77 */
/***/ (function(module, exports) {
// fast apply, http://jsperf.lnkit.com/fast-apply/5
module.exports = function (fn, args, that) {
var un = that === undefined;
switch (args.length) {
case 0: return un ? fn()
: fn.call(that);
case 1: return un ? fn(args[0])
: fn.call(that, args[0]);
case 2: return un ? fn(args[0], args[1])
: fn.call(that, args[0], args[1]);
case 3: return un ? fn(args[0], args[1], args[2])
: fn.call(that, args[0], args[1], args[2]);
case 4: return un ? fn(args[0], args[1], args[2], args[3])
: fn.call(that, args[0], args[1], args[2], args[3]);
} return fn.apply(that, args);
};
/***/ }),
/* 78 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(11).f;
var FProto = Function.prototype;
var nameRE = /^\s*function ([^ (]*)/;
var NAME = 'name';
// 19.2.4.2 name
NAME in FProto || __webpack_require__(6) && dP(FProto, NAME, {
configurable: true,
get: function () {
try {
return ('' + this).match(nameRE)[1];
} catch (e) {
return '';
}
}
});
/***/ }),
/* 79 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var isObject = __webpack_require__(13);
var getPrototypeOf = __webpack_require__(58);
var HAS_INSTANCE = __webpack_require__(26)('hasInstance');
var FunctionProto = Function.prototype;
// 19.2.3.6 Function.prototype[@@hasInstance](V)
if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(11).f(FunctionProto, HAS_INSTANCE, { value: function (O) {
if (typeof this != 'function' || !isObject(O)) return false;
if (!isObject(this.prototype)) return O instanceof this;
// for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
return false;
} });
/***/ }),
/* 80 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $parseInt = __webpack_require__(81);
// 18.2.5 parseInt(string, radix)
$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
var $parseInt = __webpack_require__(4).parseInt;
var $trim = __webpack_require__(82).trim;
var ws = __webpack_require__(83);
var hex = /^[-+]?0[xX]/;
module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
var string = $trim(String(str), 3);
return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
} : $parseInt;
/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var defined = __webpack_require__(35);
var fails = __webpack_require__(7);
var spaces = __webpack_require__(83);
var space = '[' + spaces + ']';
var non = '\u200b\u0085';
var ltrim = RegExp('^' + space + space + '*');
var rtrim = RegExp(space + space + '*$');
var exporter = function (KEY, exec, ALIAS) {
var exp = {};
var FORCE = fails(function () {
return !!spaces[KEY]() || non[KEY]() != non;
});
var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
if (ALIAS) exp[ALIAS] = fn;
$export($export.P + $export.F * FORCE, 'String', exp);
};
// 1 -> String#trimLeft
// 2 -> String#trimRight
// 3 -> String#trim
var trim = exporter.trim = function (string, TYPE) {
string = String(defined(string));
if (TYPE & 1) string = string.replace(ltrim, '');
if (TYPE & 2) string = string.replace(rtrim, '');
return string;
};
module.exports = exporter;
/***/ }),
/* 83 */
/***/ (function(module, exports) {
module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $parseFloat = __webpack_require__(85);
// 18.2.4 parseFloat(string)
$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });
/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {
var $parseFloat = __webpack_require__(4).parseFloat;
var $trim = __webpack_require__(82).trim;
module.exports = 1 / $parseFloat(__webpack_require__(83) + '-0') !== -Infinity ? function parseFloat(str) {
var string = $trim(String(str), 3);
var result = $parseFloat(string);
return result === 0 && string.charAt(0) == '-' ? -0 : result;
} : $parseFloat;
/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(4);
var has = __webpack_require__(5);
var cof = __webpack_require__(34);
var inheritIfRequired = __webpack_require__(87);
var toPrimitive = __webpack_require__(16);
var fails = __webpack_require__(7);
var gOPN = __webpack_require__(49).f;
var gOPD = __webpack_require__(50).f;
var dP = __webpack_require__(11).f;
var $trim = __webpack_require__(82).trim;
var NUMBER = 'Number';
var $Number = global[NUMBER];
var Base = $Number;
var proto = $Number.prototype;
// Opera ~12 has broken Object#toString
var BROKEN_COF = cof(__webpack_require__(45)(proto)) == NUMBER;
var TRIM = 'trim' in String.prototype;
// 7.1.3 ToNumber(argument)
var toNumber = function (argument) {
var it = toPrimitive(argument, false);
if (typeof it == 'string' && it.length > 2) {
it = TRIM ? it.trim() : $trim(it, 3);
var first = it.charCodeAt(0);
var third, radix, maxCode;
if (first === 43 || first === 45) {
third = it.charCodeAt(2);
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
} else if (first === 48) {
switch (it.charCodeAt(1)) {
case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
default: return +it;
}
for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
code = digits.charCodeAt(i);
// parseInt parses a string to a first unavailable symbol
// but ToNumber should return NaN if a string contains unavailable symbols
if (code < 48 || code > maxCode) return NaN;
} return parseInt(digits, radix);
}
} return +it;
};
if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
$Number = function Number(value) {
var it = arguments.length < 1 ? 0 : value;
var that = this;
return that instanceof $Number
// check on 1..constructor(foo) case
&& (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
};
for (var keys = __webpack_require__(6) ? gOPN(Base) : (
// ES3:
'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
// ES6 (in case, if modules with ES6 Number statics required before):
'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
).split(','), j = 0, key; keys.length > j; j++) {
if (has(Base, key = keys[j]) && !has($Number, key)) {
dP($Number, key, gOPD(Base, key));
}
}
$Number.prototype = proto;
proto.constructor = $Number;
__webpack_require__(18)(global, NUMBER, $Number);
}
/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
var setPrototypeOf = __webpack_require__(72).set;
module.exports = function (that, target, C) {
var S = target.constructor;
var P;
if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
setPrototypeOf(that, P);
} return that;
};
/***/ }),
/* 88 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toInteger = __webpack_require__(38);
var aNumberValue = __webpack_require__(89);
var repeat = __webpack_require__(90);
var $toFixed = 1.0.toFixed;
var floor = Math.floor;
var data = [0, 0, 0, 0, 0, 0];
var ERROR = 'Number.toFixed: incorrect invocation!';
var ZERO = '0';
var multiply = function (n, c) {
var i = -1;
var c2 = c;
while (++i < 6) {
c2 += n * data[i];
data[i] = c2 % 1e7;
c2 = floor(c2 / 1e7);
}
};
var divide = function (n) {
var i = 6;
var c = 0;
while (--i >= 0) {
c += data[i];
data[i] = floor(c / n);
c = (c % n) * 1e7;
}
};
var numToString = function () {
var i = 6;
var s = '';
while (--i >= 0) {
if (s !== '' || i === 0 || data[i] !== 0) {
var t = String(data[i]);
s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
}
} return s;
};
var pow = function (x, n, acc) {
return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
};
var log = function (x) {
var n = 0;
var x2 = x;
while (x2 >= 4096) {
n += 12;
x2 /= 4096;
}
while (x2 >= 2) {
n += 1;
x2 /= 2;
} return n;
};
$export($export.P + $export.F * (!!$toFixed && (
0.00008.toFixed(3) !== '0.000' ||
0.9.toFixed(0) !== '1' ||
1.255.toFixed(2) !== '1.25' ||
1000000000000000128.0.toFixed(0) !== '1000000000000000128'
) || !__webpack_require__(7)(function () {
// V8 ~ Android 4.3-
$toFixed.call({});
})), 'Number', {
toFixed: function toFixed(fractionDigits) {
var x = aNumberValue(this, ERROR);
var f = toInteger(fractionDigits);
var s = '';
var m = ZERO;
var e, z, j, k;
if (f < 0 || f > 20) throw RangeError(ERROR);
// eslint-disable-next-line no-self-compare
if (x != x) return 'NaN';
if (x <= -1e21 || x >= 1e21) return String(x);
if (x < 0) {
s = '-';
x = -x;
}
if (x > 1e-21) {
e = log(x * pow(2, 69, 1)) - 69;
z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
z *= 0x10000000000000;
e = 52 - e;
if (e > 0) {
multiply(0, z);
j = f;
while (j >= 7) {
multiply(1e7, 0);
j -= 7;
}
multiply(pow(10, j, 1), 0);
j = e - 1;
while (j >= 23) {
divide(1 << 23);
j -= 23;
}
divide(1 << j);
multiply(1, 1);
divide(2);
m = numToString();
} else {
multiply(0, z);
multiply(1 << -e, 0);
m = numToString() + repeat.call(ZERO, f);
}
}
if (f > 0) {
k = m.length;
m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
} else {
m = s + m;
} return m;
}
});
/***/ }),
/* 89 */
/***/ (function(module, exports, __webpack_require__) {
var cof = __webpack_require__(34);
module.exports = function (it, msg) {
if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
return +it;
};
/***/ }),
/* 90 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var toInteger = __webpack_require__(38);
var defined = __webpack_require__(35);
module.exports = function repeat(count) {
var str = String(defined(this));
var res = '';
var n = toInteger(count);
if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
return res;
};
/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $fails = __webpack_require__(7);
var aNumberValue = __webpack_require__(89);
var $toPrecision = 1.0.toPrecision;
$export($export.P + $export.F * ($fails(function () {
// IE7-
return $toPrecision.call(1, undefined) !== '1';
}) || !$fails(function () {
// V8 ~ Android 4.3-
$toPrecision.call({});
})), 'Number', {
toPrecision: function toPrecision(precision) {
var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
}
});
/***/ }),
/* 92 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.1 Number.EPSILON
var $export = __webpack_require__(8);
$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });
/***/ }),
/* 93 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.2 Number.isFinite(number)
var $export = __webpack_require__(8);
var _isFinite = __webpack_require__(4).isFinite;
$export($export.S, 'Number', {
isFinite: function isFinite(it) {
return typeof it == 'number' && _isFinite(it);
}
});
/***/ }),
/* 94 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var $export = __webpack_require__(8);
$export($export.S, 'Number', { isInteger: __webpack_require__(95) });
/***/ }),
/* 95 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var isObject = __webpack_require__(13);
var floor = Math.floor;
module.exports = function isInteger(it) {
return !isObject(it) && isFinite(it) && floor(it) === it;
};
/***/ }),
/* 96 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.4 Number.isNaN(number)
var $export = __webpack_require__(8);
$export($export.S, 'Number', {
isNaN: function isNaN(number) {
// eslint-disable-next-line no-self-compare
return number != number;
}
});
/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.5 Number.isSafeInteger(number)
var $export = __webpack_require__(8);
var isInteger = __webpack_require__(95);
var abs = Math.abs;
$export($export.S, 'Number', {
isSafeInteger: function isSafeInteger(number) {
return isInteger(number) && abs(number) <= 0x1fffffffffffff;
}
});
/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.6 Number.MAX_SAFE_INTEGER
var $export = __webpack_require__(8);
$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
/***/ }),
/* 99 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.10 Number.MIN_SAFE_INTEGER
var $export = __webpack_require__(8);
$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
/***/ }),
/* 100 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $parseFloat = __webpack_require__(85);
// 20.1.2.12 Number.parseFloat(string)
$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });
/***/ }),
/* 101 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $parseInt = __webpack_require__(81);
// 20.1.2.13 Number.parseInt(string, radix)
$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });
/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.3 Math.acosh(x)
var $export = __webpack_require__(8);
var log1p = __webpack_require__(103);
var sqrt = Math.sqrt;
var $acosh = Math.acosh;
$export($export.S + $export.F * !($acosh
// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
&& Math.floor($acosh(Number.MAX_VALUE)) == 710
// Tor Browser bug: Math.acosh(Infinity) -> NaN
&& $acosh(Infinity) == Infinity
), 'Math', {
acosh: function acosh(x) {
return (x = +x) < 1 ? NaN : x > 94906265.62425156
? Math.log(x) + Math.LN2
: log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
}
});
/***/ }),
/* 103 */
/***/ (function(module, exports) {
// 20.2.2.20 Math.log1p(x)
module.exports = Math.log1p || function log1p(x) {
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
};
/***/ }),
/* 104 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.5 Math.asinh(x)
var $export = __webpack_require__(8);
var $asinh = Math.asinh;
function asinh(x) {
return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
}
// Tor Browser bug: Math.asinh(0) -> -0
$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });
/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.7 Math.atanh(x)
var $export = __webpack_require__(8);
var $atanh = Math.atanh;
// Tor Browser bug: Math.atanh(-0) -> 0
$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
atanh: function atanh(x) {
return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
}
});
/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.9 Math.cbrt(x)
var $export = __webpack_require__(8);
var sign = __webpack_require__(107);
$export($export.S, 'Math', {
cbrt: function cbrt(x) {
return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
}
});
/***/ }),
/* 107 */
/***/ (function(module, exports) {
// 20.2.2.28 Math.sign(x)
module.exports = Math.sign || function sign(x) {
// eslint-disable-next-line no-self-compare
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
};
/***/ }),
/* 108 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.11 Math.clz32(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
clz32: function clz32(x) {
return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
}
});
/***/ }),
/* 109 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.12 Math.cosh(x)
var $export = __webpack_require__(8);
var exp = Math.exp;
$export($export.S, 'Math', {
cosh: function cosh(x) {
return (exp(x = +x) + exp(-x)) / 2;
}
});
/***/ }),
/* 110 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.14 Math.expm1(x)
var $export = __webpack_require__(8);
var $expm1 = __webpack_require__(111);
$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });
/***/ }),
/* 111 */
/***/ (function(module, exports) {
// 20.2.2.14 Math.expm1(x)
var $expm1 = Math.expm1;
module.exports = (!$expm1
// Old FF bug
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
// Tor Browser bug
|| $expm1(-2e-17) != -2e-17
) ? function expm1(x) {
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
} : $expm1;
/***/ }),
/* 112 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.16 Math.fround(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', { fround: __webpack_require__(113) });
/***/ }),
/* 113 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.16 Math.fround(x)
var sign = __webpack_require__(107);
var pow = Math.pow;
var EPSILON = pow(2, -52);
var EPSILON32 = pow(2, -23);
var MAX32 = pow(2, 127) * (2 - EPSILON32);
var MIN32 = pow(2, -126);
var roundTiesToEven = function (n) {
return n + 1 / EPSILON - 1 / EPSILON;
};
module.exports = Math.fround || function fround(x) {
var $abs = Math.abs(x);
var $sign = sign(x);
var a, result;
if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
a = (1 + EPSILON32 / EPSILON) * $abs;
result = a - (a - $abs);
// eslint-disable-next-line no-self-compare
if (result > MAX32 || result != result) return $sign * Infinity;
return $sign * result;
};
/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
var $export = __webpack_require__(8);
var abs = Math.abs;
$export($export.S, 'Math', {
hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
var sum = 0;
var i = 0;
var aLen = arguments.length;
var larg = 0;
var arg, div;
while (i < aLen) {
arg = abs(arguments[i++]);
if (larg < arg) {
div = larg / arg;
sum = sum * div * div + 1;
larg = arg;
} else if (arg > 0) {
div = arg / larg;
sum += div * div;
} else sum += arg;
}
return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
}
});
/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.18 Math.imul(x, y)
var $export = __webpack_require__(8);
var $imul = Math.imul;
// some WebKit versions fails with big numbers, some has wrong arity
$export($export.S + $export.F * __webpack_require__(7)(function () {
return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
}), 'Math', {
imul: function imul(x, y) {
var UINT16 = 0xffff;
var xn = +x;
var yn = +y;
var xl = UINT16 & xn;
var yl = UINT16 & yn;
return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
}
});
/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.21 Math.log10(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
log10: function log10(x) {
return Math.log(x) * Math.LOG10E;
}
});
/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.20 Math.log1p(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', { log1p: __webpack_require__(103) });
/***/ }),
/* 118 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.22 Math.log2(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
log2: function log2(x) {
return Math.log(x) / Math.LN2;
}
});
/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.28 Math.sign(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', { sign: __webpack_require__(107) });
/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.30 Math.sinh(x)
var $export = __webpack_require__(8);
var expm1 = __webpack_require__(111);
var exp = Math.exp;
// V8 near Chromium 38 has a problem with very small numbers
$export($export.S + $export.F * __webpack_require__(7)(function () {
return !Math.sinh(-2e-17) != -2e-17;
}), 'Math', {
sinh: function sinh(x) {
return Math.abs(x = +x) < 1
? (expm1(x) - expm1(-x)) / 2
: (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
}
});
/***/ }),
/* 121 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.33 Math.tanh(x)
var $export = __webpack_require__(8);
var expm1 = __webpack_require__(111);
var exp = Math.exp;
$export($export.S, 'Math', {
tanh: function tanh(x) {
var a = expm1(x = +x);
var b = expm1(-x);
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
}
});
/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.34 Math.trunc(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
trunc: function trunc(it) {
return (it > 0 ? Math.floor : Math.ceil)(it);
}
});
/***/ }),
/* 123 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var toAbsoluteIndex = __webpack_require__(39);
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;
// length should be 1, old FF problem
$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
// 21.1.2.2 String.fromCodePoint(...codePoints)
fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
var res = [];
var aLen = arguments.length;
var i = 0;
var code;
while (aLen > i) {
code = +arguments[i++];
if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
res.push(code < 0x10000
? fromCharCode(code)
: fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
);
} return res.join('');
}
});
/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var toIObject = __webpack_require__(32);
var toLength = __webpack_require__(37);
$export($export.S, 'String', {
// 21.1.2.4 String.raw(callSite, ...substitutions)
raw: function raw(callSite) {
var tpl = toIObject(callSite.raw);
var len = toLength(tpl.length);
var aLen = arguments.length;
var res = [];
var i = 0;
while (len > i) {
res.push(String(tpl[i++]));
if (i < aLen) res.push(String(arguments[i]));
} return res.join('');
}
});
/***/ }),
/* 125 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 21.1.3.25 String.prototype.trim()
__webpack_require__(82)('trim', function ($trim) {
return function trim() {
return $trim(this, 3);
};
});
/***/ }),
/* 126 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $at = __webpack_require__(127)(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(128)(String, 'String', function (iterated) {
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
var O = this._t;
var index = this._i;
var point;
if (index >= O.length) return { value: undefined, done: true };
point = $at(O, index);
this._i += point.length;
return { value: point, done: false };
});
/***/ }),
/* 127 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(38);
var defined = __webpack_require__(35);
// true -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
return function (that, pos) {
var s = String(defined(that));
var i = toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ }),
/* 128 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var LIBRARY = __webpack_require__(24);
var $export = __webpack_require__(8);
var redefine = __webpack_require__(18);
var hide = __webpack_require__(10);
var Iterators = __webpack_require__(129);
var $iterCreate = __webpack_require__(130);
var setToStringTag = __webpack_require__(25);
var getPrototypeOf = __webpack_require__(58);
var ITERATOR = __webpack_require__(26)('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = $native || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/* 129 */
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/* 130 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var create = __webpack_require__(45);
var descriptor = __webpack_require__(17);
var setToStringTag = __webpack_require__(25);
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(10)(IteratorPrototype, __webpack_require__(26)('iterator'), function () { return this; });
module.exports = function (Constructor, NAME, next) {
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ }),
/* 131 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $at = __webpack_require__(127)(false);
$export($export.P, 'String', {
// 21.1.3.3 String.prototype.codePointAt(pos)
codePointAt: function codePointAt(pos) {
return $at(this, pos);
}
});
/***/ }),
/* 132 */
/***/ (function(module, exports, __webpack_require__) {
// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
'use strict';
var $export = __webpack_require__(8);
var toLength = __webpack_require__(37);
var context = __webpack_require__(133);
var ENDS_WITH = 'endsWith';
var $endsWith = ''[ENDS_WITH];
$export($export.P + $export.F * __webpack_require__(135)(ENDS_WITH), 'String', {
endsWith: function endsWith(searchString /* , endPosition = @length */) {
var that = context(this, searchString, ENDS_WITH);
var endPosition = arguments.length > 1 ? arguments[1] : undefined;
var len = toLength(that.length);
var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
var search = String(searchString);
return $endsWith
? $endsWith.call(that, search, end)
: that.slice(end - search.length, end) === search;
}
});
/***/ }),
/* 133 */
/***/ (function(module, exports, __webpack_require__) {
// helper for String#{startsWith, endsWith, includes}
var isRegExp = __webpack_require__(134);
var defined = __webpack_require__(35);
module.exports = function (that, searchString, NAME) {
if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
return String(defined(that));
};
/***/ }),
/* 134 */
/***/ (function(module, exports, __webpack_require__) {
// 7.2.8 IsRegExp(argument)
var isObject = __webpack_require__(13);
var cof = __webpack_require__(34);
var MATCH = __webpack_require__(26)('match');
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
};
/***/ }),
/* 135 */
/***/ (function(module, exports, __webpack_require__) {
var MATCH = __webpack_require__(26)('match');
module.exports = function (KEY) {
var re = /./;
try {
'/./'[KEY](re);
} catch (e) {
try {
re[MATCH] = false;
return !'/./'[KEY](re);
} catch (f) { /* empty */ }
} return true;
};
/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {
// 21.1.3.7 String.prototype.includes(searchString, position = 0)
'use strict';
var $export = __webpack_require__(8);
var context = __webpack_require__(133);
var INCLUDES = 'includes';
$export($export.P + $export.F * __webpack_require__(135)(INCLUDES), 'String', {
includes: function includes(searchString /* , position = 0 */) {
return !!~context(this, searchString, INCLUDES)
.indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/* 137 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
$export($export.P, 'String', {
// 21.1.3.13 String.prototype.repeat(count)
repeat: __webpack_require__(90)
});
/***/ }),
/* 138 */
/***/ (function(module, exports, __webpack_require__) {
// 21.1.3.18 String.prototype.startsWith(searchString [, position ])
'use strict';
var $export = __webpack_require__(8);
var toLength = __webpack_require__(37);
var context = __webpack_require__(133);
var STARTS_WITH = 'startsWith';
var $startsWith = ''[STARTS_WITH];
$export($export.P + $export.F * __webpack_require__(135)(STARTS_WITH), 'String', {
startsWith: function startsWith(searchString /* , position = 0 */) {
var that = context(this, searchString, STARTS_WITH);
var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = String(searchString);
return $startsWith
? $startsWith.call(that, search, index)
: that.slice(index, index + search.length) === search;
}
});
/***/ }),
/* 139 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.2 String.prototype.anchor(name)
__webpack_require__(140)('anchor', function (createHTML) {
return function anchor(name) {
return createHTML(this, 'a', 'name', name);
};
});
/***/ }),
/* 140 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var fails = __webpack_require__(7);
var defined = __webpack_require__(35);
var quot = /"/g;
// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
var createHTML = function (string, tag, attribute, value) {
var S = String(defined(string));
var p1 = '<' + tag;
if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
return p1 + '>' + S + '</' + tag + '>';
};
module.exports = function (NAME, exec) {
var O = {};
O[NAME] = exec(createHTML);
$export($export.P + $export.F * fails(function () {
var test = ''[NAME]('"');
return test !== test.toLowerCase() || test.split('"').length > 3;
}), 'String', O);
};
/***/ }),
/* 141 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.3 String.prototype.big()
__webpack_require__(140)('big', function (createHTML) {
return function big() {
return createHTML(this, 'big', '', '');
};
});
/***/ }),
/* 142 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.4 String.prototype.blink()
__webpack_require__(140)('blink', function (createHTML) {
return function blink() {
return createHTML(this, 'blink', '', '');
};
});
/***/ }),
/* 143 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.5 String.prototype.bold()
__webpack_require__(140)('bold', function (createHTML) {
return function bold() {
return createHTML(this, 'b', '', '');
};
});
/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.6 String.prototype.fixed()
__webpack_require__(140)('fixed', function (createHTML) {
return function fixed() {
return createHTML(this, 'tt', '', '');
};
});
/***/ }),
/* 145 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.7 String.prototype.fontcolor(color)
__webpack_require__(140)('fontcolor', function (createHTML) {
return function fontcolor(color) {
return createHTML(this, 'font', 'color', color);
};
});
/***/ }),
/* 146 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.8 String.prototype.fontsize(size)
__webpack_require__(140)('fontsize', function (createHTML) {
return function fontsize(size) {
return createHTML(this, 'font', 'size', size);
};
});
/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.9 String.prototype.italics()
__webpack_require__(140)('italics', function (createHTML) {
return function italics() {
return createHTML(this, 'i', '', '');
};
});
/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.10 String.prototype.link(url)
__webpack_require__(140)('link', function (createHTML) {
return function link(url) {
return createHTML(this, 'a', 'href', url);
};
});
/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.11 String.prototype.small()
__webpack_require__(140)('small', function (createHTML) {
return function small() {
return createHTML(this, 'small', '', '');
};
});
/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.12 String.prototype.strike()
__webpack_require__(140)('strike', function (createHTML) {
return function strike() {
return createHTML(this, 'strike', '', '');
};
});
/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.13 String.prototype.sub()
__webpack_require__(140)('sub', function (createHTML) {
return function sub() {
return createHTML(this, 'sub', '', '');
};
});
/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.14 String.prototype.sup()
__webpack_require__(140)('sup', function (createHTML) {
return function sup() {
return createHTML(this, 'sup', '', '');
};
});
/***/ }),
/* 153 */
/***/ (function(module, exports, __webpack_require__) {
// 20.3.3.1 / 15.9.4.4 Date.now()
var $export = __webpack_require__(8);
$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(57);
var toPrimitive = __webpack_require__(16);
$export($export.P + $export.F * __webpack_require__(7)(function () {
return new Date(NaN).toJSON() !== null
|| Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
}), 'Date', {
// eslint-disable-next-line no-unused-vars
toJSON: function toJSON(key) {
var O = toObject(this);
var pv = toPrimitive(O);
return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
}
});
/***/ }),
/* 155 */
/***/ (function(module, exports, __webpack_require__) {
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var $export = __webpack_require__(8);
var toISOString = __webpack_require__(156);
// PhantomJS / old WebKit has a broken implementations
$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
toISOString: toISOString
});
/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var fails = __webpack_require__(7);
var getTime = Date.prototype.getTime;
var $toISOString = Date.prototype.toISOString;
var lz = function (num) {
return num > 9 ? num : '0' + num;
};
// PhantomJS / old WebKit has a broken implementations
module.exports = (fails(function () {
return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
}) || !fails(function () {
$toISOString.call(new Date(NaN));
})) ? function toISOString() {
if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
var d = this;
var y = d.getUTCFullYear();
var m = d.getUTCMilliseconds();
var s = y < 0 ? '-' : y > 9999 ? '+' : '';
return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
'-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
} : $toISOString;
/***/ }),
/* 157 */
/***/ (function(module, exports, __webpack_require__) {
var DateProto = Date.prototype;
var INVALID_DATE = 'Invalid Date';
var TO_STRING = 'toString';
var $toString = DateProto[TO_STRING];
var getTime = DateProto.getTime;
if (new Date(NaN) + '' != INVALID_DATE) {
__webpack_require__(18)(DateProto, TO_STRING, function toString() {
var value = getTime.call(this);
// eslint-disable-next-line no-self-compare
return value === value ? $toString.call(this) : INVALID_DATE;
});
}
/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {
var TO_PRIMITIVE = __webpack_require__(26)('toPrimitive');
var proto = Date.prototype;
if (!(TO_PRIMITIVE in proto)) __webpack_require__(10)(proto, TO_PRIMITIVE, __webpack_require__(159));
/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var anObject = __webpack_require__(12);
var toPrimitive = __webpack_require__(16);
var NUMBER = 'number';
module.exports = function (hint) {
if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
return toPrimitive(anObject(this), hint != NUMBER);
};
/***/ }),
/* 160 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
var $export = __webpack_require__(8);
$export($export.S, 'Array', { isArray: __webpack_require__(44) });
/***/ }),
/* 161 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var ctx = __webpack_require__(20);
var $export = __webpack_require__(8);
var toObject = __webpack_require__(57);
var call = __webpack_require__(162);
var isArrayIter = __webpack_require__(163);
var toLength = __webpack_require__(37);
var createProperty = __webpack_require__(164);
var getIterFn = __webpack_require__(165);
$export($export.S + $export.F * !__webpack_require__(166)(function (iter) { Array.from(iter); }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var C = typeof this == 'function' ? this : Array;
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var index = 0;
var iterFn = getIterFn(O);
var length, result, step, iterator;
if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
// if object isn't iterable or it's array with default iterator - use simple case
if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
}
} else {
length = toLength(O.length);
for (result = new C(length); length > index; index++) {
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
}
}
result.length = index;
return result;
}
});
/***/ }),
/* 162 */
/***/ (function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
var anObject = __webpack_require__(12);
module.exports = function (iterator, fn, value, entries) {
try {
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch (e) {
var ret = iterator['return'];
if (ret !== undefined) anObject(ret.call(iterator));
throw e;
}
};
/***/ }),
/* 163 */
/***/ (function(module, exports, __webpack_require__) {
// check on default Array iterator
var Iterators = __webpack_require__(129);
var ITERATOR = __webpack_require__(26)('iterator');
var ArrayProto = Array.prototype;
module.exports = function (it) {
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};
/***/ }),
/* 164 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $defineProperty = __webpack_require__(11);
var createDesc = __webpack_require__(17);
module.exports = function (object, index, value) {
if (index in object) $defineProperty.f(object, index, createDesc(0, value));
else object[index] = value;
};
/***/ }),
/* 165 */
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(74);
var ITERATOR = __webpack_require__(26)('iterator');
var Iterators = __webpack_require__(129);
module.exports = __webpack_require__(9).getIteratorMethod = function (it) {
if (it != undefined) return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ }),
/* 166 */
/***/ (function(module, exports, __webpack_require__) {
var ITERATOR = __webpack_require__(26)('iterator');
var SAFE_CLOSING = false;
try {
var riter = [7][ITERATOR]();
riter['return'] = function () { SAFE_CLOSING = true; };
// eslint-disable-next-line no-throw-literal
Array.from(riter, function () { throw 2; });
} catch (e) { /* empty */ }
module.exports = function (exec, skipClosing) {
if (!skipClosing && !SAFE_CLOSING) return false;
var safe = false;
try {
var arr = [7];
var iter = arr[ITERATOR]();
iter.next = function () { return { done: safe = true }; };
arr[ITERATOR] = function () { return iter; };
exec(arr);
} catch (e) { /* empty */ }
return safe;
};
/***/ }),
/* 167 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var createProperty = __webpack_require__(164);
// WebKit Array.of isn't generic
$export($export.S + $export.F * __webpack_require__(7)(function () {
function F() { /* empty */ }
return !(Array.of.call(F) instanceof F);
}), 'Array', {
// 22.1.2.3 Array.of( ...items)
of: function of(/* ...args */) {
var index = 0;
var aLen = arguments.length;
var result = new (typeof this == 'function' ? this : Array)(aLen);
while (aLen > index) createProperty(result, index, arguments[index++]);
result.length = aLen;
return result;
}
});
/***/ }),
/* 168 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 22.1.3.13 Array.prototype.join(separator)
var $export = __webpack_require__(8);
var toIObject = __webpack_require__(32);
var arrayJoin = [].join;
// fallback for not array-like strings
$export($export.P + $export.F * (__webpack_require__(33) != Object || !__webpack_require__(169)(arrayJoin)), 'Array', {
join: function join(separator) {
return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
}
});
/***/ }),
/* 169 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var fails = __webpack_require__(7);
module.exports = function (method, arg) {
return !!method && fails(function () {
// eslint-disable-next-line no-useless-call
arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
});
};
/***/ }),
/* 170 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var html = __webpack_require__(47);
var cof = __webpack_require__(34);
var toAbsoluteIndex = __webpack_require__(39);
var toLength = __webpack_require__(37);
var arraySlice = [].slice;
// fallback for not array-like ES3 strings and DOM objects
$export($export.P + $export.F * __webpack_require__(7)(function () {
if (html) arraySlice.call(html);
}), 'Array', {
slice: function slice(begin, end) {
var len = toLength(this.length);
var klass = cof(this);
end = end === undefined ? len : end;
if (klass == 'Array') return arraySlice.call(this, begin, end);
var start = toAbsoluteIndex(begin, len);
var upTo = toAbsoluteIndex(end, len);
var size = toLength(upTo - start);
var cloned = new Array(size);
var i = 0;
for (; i < size; i++) cloned[i] = klass == 'String'
? this.charAt(start + i)
: this[start + i];
return cloned;
}
});
/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var aFunction = __webpack_require__(21);
var toObject = __webpack_require__(57);
var fails = __webpack_require__(7);
var $sort = [].sort;
var test = [1, 2, 3];
$export($export.P + $export.F * (fails(function () {
// IE8-
test.sort(undefined);
}) || !fails(function () {
// V8 bug
test.sort(null);
// Old WebKit
}) || !__webpack_require__(169)($sort)), 'Array', {
// 22.1.3.25 Array.prototype.sort(comparefn)
sort: function sort(comparefn) {
return comparefn === undefined
? $sort.call(toObject(this))
: $sort.call(toObject(this), aFunction(comparefn));
}
});
/***/ }),
/* 172 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $forEach = __webpack_require__(173)(0);
var STRICT = __webpack_require__(169)([].forEach, true);
$export($export.P + $export.F * !STRICT, 'Array', {
// 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
forEach: function forEach(callbackfn /* , thisArg */) {
return $forEach(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {
// 0 -> Array#forEach
// 1 -> Array#map
// 2 -> Array#filter
// 3 -> Array#some
// 4 -> Array#every
// 5 -> Array#find
// 6 -> Array#findIndex
var ctx = __webpack_require__(20);
var IObject = __webpack_require__(33);
var toObject = __webpack_require__(57);
var toLength = __webpack_require__(37);
var asc = __webpack_require__(174);
module.exports = function (TYPE, $create) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
var create = $create || asc;
return function ($this, callbackfn, that) {
var O = toObject($this);
var self = IObject(O);
var f = ctx(callbackfn, that, 3);
var length = toLength(self.length);
var index = 0;
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
var val, res;
for (;length > index; index++) if (NO_HOLES || index in self) {
val = self[index];
res = f(val, index, O);
if (TYPE) {
if (IS_MAP) result[index] = res; // map
else if (res) switch (TYPE) {
case 3: return true; // some
case 5: return val; // find
case 6: return index; // findIndex
case 2: result.push(val); // filter
} else if (IS_EVERY) return false; // every
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
};
};
/***/ }),
/* 174 */
/***/ (function(module, exports, __webpack_require__) {
// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
var speciesConstructor = __webpack_require__(175);
module.exports = function (original, length) {
return new (speciesConstructor(original))(length);
};
/***/ }),
/* 175 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
var isArray = __webpack_require__(44);
var SPECIES = __webpack_require__(26)('species');
module.exports = function (original) {
var C;
if (isArray(original)) {
C = original.constructor;
// cross-realm fallback
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
if (isObject(C)) {
C = C[SPECIES];
if (C === null) C = undefined;
}
} return C === undefined ? Array : C;
};
/***/ }),
/* 176 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $map = __webpack_require__(173)(1);
$export($export.P + $export.F * !__webpack_require__(169)([].map, true), 'Array', {
// 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
map: function map(callbackfn /* , thisArg */) {
return $map(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 177 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $filter = __webpack_require__(173)(2);
$export($export.P + $export.F * !__webpack_require__(169)([].filter, true), 'Array', {
// 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
filter: function filter(callbackfn /* , thisArg */) {
return $filter(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 178 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $some = __webpack_require__(173)(3);
$export($export.P + $export.F * !__webpack_require__(169)([].some, true), 'Array', {
// 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
some: function some(callbackfn /* , thisArg */) {
return $some(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 179 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $every = __webpack_require__(173)(4);
$export($export.P + $export.F * !__webpack_require__(169)([].every, true), 'Array', {
// 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
every: function every(callbackfn /* , thisArg */) {
return $every(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 180 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $reduce = __webpack_require__(181);
$export($export.P + $export.F * !__webpack_require__(169)([].reduce, true), 'Array', {
// 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
reduce: function reduce(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments[1], false);
}
});
/***/ }),
/* 181 */
/***/ (function(module, exports, __webpack_require__) {
var aFunction = __webpack_require__(21);
var toObject = __webpack_require__(57);
var IObject = __webpack_require__(33);
var toLength = __webpack_require__(37);
module.exports = function (that, callbackfn, aLen, memo, isRight) {
aFunction(callbackfn);
var O = toObject(that);
var self = IObject(O);
var length = toLength(O.length);
var index = isRight ? length - 1 : 0;
var i = isRight ? -1 : 1;
if (aLen < 2) for (;;) {
if (index in self) {
memo = self[index];
index += i;
break;
}
index += i;
if (isRight ? index < 0 : length <= index) {
throw TypeError('Reduce of empty array with no initial value');
}
}
for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
memo = callbackfn(memo, self[index], index, O);
}
return memo;
};
/***/ }),
/* 182 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $reduce = __webpack_require__(181);
$export($export.P + $export.F * !__webpack_require__(169)([].reduceRight, true), 'Array', {
// 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
reduceRight: function reduceRight(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments[1], true);
}
});
/***/ }),
/* 183 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $indexOf = __webpack_require__(36)(false);
var $native = [].indexOf;
var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(169)($native)), 'Array', {
// 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
return NEGATIVE_ZERO
// convert -0 to +0
? $native.apply(this, arguments) || 0
: $indexOf(this, searchElement, arguments[1]);
}
});
/***/ }),
/* 184 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toIObject = __webpack_require__(32);
var toInteger = __webpack_require__(38);
var toLength = __webpack_require__(37);
var $native = [].lastIndexOf;
var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(169)($native)), 'Array', {
// 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
// convert -0 to +0
if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
var O = toIObject(this);
var length = toLength(O.length);
var index = length - 1;
if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
if (index < 0) index = length + index;
for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
return -1;
}
});
/***/ }),
/* 185 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
var $export = __webpack_require__(8);
$export($export.P, 'Array', { copyWithin: __webpack_require__(186) });
__webpack_require__(187)('copyWithin');
/***/ }),
/* 186 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
'use strict';
var toObject = __webpack_require__(57);
var toAbsoluteIndex = __webpack_require__(39);
var toLength = __webpack_require__(37);
module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
var O = toObject(this);
var len = toLength(O.length);
var to = toAbsoluteIndex(target, len);
var from = toAbsoluteIndex(start, len);
var end = arguments.length > 2 ? arguments[2] : undefined;
var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
var inc = 1;
if (from < to && to < from + count) {
inc = -1;
from += count - 1;
to += count - 1;
}
while (count-- > 0) {
if (from in O) O[to] = O[from];
else delete O[to];
to += inc;
from += inc;
} return O;
};
/***/ }),
/* 187 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.31 Array.prototype[@@unscopables]
var UNSCOPABLES = __webpack_require__(26)('unscopables');
var ArrayProto = Array.prototype;
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(10)(ArrayProto, UNSCOPABLES, {});
module.exports = function (key) {
ArrayProto[UNSCOPABLES][key] = true;
};
/***/ }),
/* 188 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
var $export = __webpack_require__(8);
$export($export.P, 'Array', { fill: __webpack_require__(189) });
__webpack_require__(187)('fill');
/***/ }),
/* 189 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
'use strict';
var toObject = __webpack_require__(57);
var toAbsoluteIndex = __webpack_require__(39);
var toLength = __webpack_require__(37);
module.exports = function fill(value /* , start = 0, end = @length */) {
var O = toObject(this);
var length = toLength(O.length);
var aLen = arguments.length;
var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
var end = aLen > 2 ? arguments[2] : undefined;
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
while (endPos > index) O[index++] = value;
return O;
};
/***/ }),
/* 190 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
var $export = __webpack_require__(8);
var $find = __webpack_require__(173)(5);
var KEY = 'find';
var forced = true;
// Shouldn't skip holes
if (KEY in []) Array(1)[KEY](function () { forced = false; });
$export($export.P + $export.F * forced, 'Array', {
find: function find(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(187)(KEY);
/***/ }),
/* 191 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
var $export = __webpack_require__(8);
var $find = __webpack_require__(173)(6);
var KEY = 'findIndex';
var forced = true;
// Shouldn't skip holes
if (KEY in []) Array(1)[KEY](function () { forced = false; });
$export($export.P + $export.F * forced, 'Array', {
findIndex: function findIndex(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(187)(KEY);
/***/ }),
/* 192 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(193)('Array');
/***/ }),
/* 193 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(4);
var dP = __webpack_require__(11);
var DESCRIPTORS = __webpack_require__(6);
var SPECIES = __webpack_require__(26)('species');
module.exports = function (KEY) {
var C = global[KEY];
if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
configurable: true,
get: function () { return this; }
});
};
/***/ }),
/* 194 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var addToUnscopables = __webpack_require__(187);
var step = __webpack_require__(195);
var Iterators = __webpack_require__(129);
var toIObject = __webpack_require__(32);
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__(128)(Array, 'Array', function (iterated, kind) {
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
var O = this._t;
var kind = this._k;
var index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return step(1);
}
if (kind == 'keys') return step(0, index);
if (kind == 'values') return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
/* 195 */
/***/ (function(module, exports) {
module.exports = function (done, value) {
return { value: value, done: !!done };
};
/***/ }),
/* 196 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var inheritIfRequired = __webpack_require__(87);
var dP = __webpack_require__(11).f;
var gOPN = __webpack_require__(49).f;
var isRegExp = __webpack_require__(134);
var $flags = __webpack_require__(197);
var $RegExp = global.RegExp;
var Base = $RegExp;
var proto = $RegExp.prototype;
var re1 = /a/g;
var re2 = /a/g;
// "new" creates a new object, old webkit buggy here
var CORRECT_NEW = new $RegExp(re1) !== re1;
if (__webpack_require__(6) && (!CORRECT_NEW || __webpack_require__(7)(function () {
re2[__webpack_require__(26)('match')] = false;
// RegExp constructor can alter flags and IsRegExp works correct with @@match
return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
}))) {
$RegExp = function RegExp(p, f) {
var tiRE = this instanceof $RegExp;
var piRE = isRegExp(p);
var fiU = f === undefined;
return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
: inheritIfRequired(CORRECT_NEW
? new Base(piRE && !fiU ? p.source : p, f)
: Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
, tiRE ? this : proto, $RegExp);
};
var proxy = function (key) {
key in $RegExp || dP($RegExp, key, {
configurable: true,
get: function () { return Base[key]; },
set: function (it) { Base[key] = it; }
});
};
for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);
proto.constructor = $RegExp;
$RegExp.prototype = proto;
__webpack_require__(18)(global, 'RegExp', $RegExp);
}
__webpack_require__(193)('RegExp');
/***/ }),
/* 197 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 21.2.5.3 get RegExp.prototype.flags
var anObject = __webpack_require__(12);
module.exports = function () {
var that = anObject(this);
var result = '';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.unicode) result += 'u';
if (that.sticky) result += 'y';
return result;
};
/***/ }),
/* 198 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
__webpack_require__(199);
var anObject = __webpack_require__(12);
var $flags = __webpack_require__(197);
var DESCRIPTORS = __webpack_require__(6);
var TO_STRING = 'toString';
var $toString = /./[TO_STRING];
var define = function (fn) {
__webpack_require__(18)(RegExp.prototype, TO_STRING, fn, true);
};
// 21.2.5.14 RegExp.prototype.toString()
if (__webpack_require__(7)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
define(function toString() {
var R = anObject(this);
return '/'.concat(R.source, '/',
'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
});
// FF44- RegExp#toString has a wrong name
} else if ($toString.name != TO_STRING) {
define(function toString() {
return $toString.call(this);
});
}
/***/ }),
/* 199 */
/***/ (function(module, exports, __webpack_require__) {
// 21.2.5.3 get RegExp.prototype.flags()
if (__webpack_require__(6) && /./g.flags != 'g') __webpack_require__(11).f(RegExp.prototype, 'flags', {
configurable: true,
get: __webpack_require__(197)
});
/***/ }),
/* 200 */
/***/ (function(module, exports, __webpack_require__) {
// @@match logic
__webpack_require__(201)('match', 1, function (defined, MATCH, $match) {
// 21.1.3.11 String.prototype.match(regexp)
return [function match(regexp) {
'use strict';
var O = defined(this);
var fn = regexp == undefined ? undefined : regexp[MATCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
}, $match];
});
/***/ }),
/* 201 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var hide = __webpack_require__(10);
var redefine = __webpack_require__(18);
var fails = __webpack_require__(7);
var defined = __webpack_require__(35);
var wks = __webpack_require__(26);
module.exports = function (KEY, length, exec) {
var SYMBOL = wks(KEY);
var fns = exec(defined, SYMBOL, ''[KEY]);
var strfn = fns[0];
var rxfn = fns[1];
if (fails(function () {
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
})) {
redefine(String.prototype, KEY, strfn);
hide(RegExp.prototype, SYMBOL, length == 2
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
? function (string, arg) { return rxfn.call(string, this, arg); }
// 21.2.5.6 RegExp.prototype[@@match](string)
// 21.2.5.9 RegExp.prototype[@@search](string)
: function (string) { return rxfn.call(string, this); }
);
}
};
/***/ }),
/* 202 */
/***/ (function(module, exports, __webpack_require__) {
// @@replace logic
__webpack_require__(201)('replace', 2, function (defined, REPLACE, $replace) {
// 21.1.3.14 String.prototype.replace(searchValue, replaceValue)
return [function replace(searchValue, replaceValue) {
'use strict';
var O = defined(this);
var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
return fn !== undefined
? fn.call(searchValue, O, replaceValue)
: $replace.call(String(O), searchValue, replaceValue);
}, $replace];
});
/***/ }),
/* 203 */
/***/ (function(module, exports, __webpack_require__) {
// @@search logic
__webpack_require__(201)('search', 1, function (defined, SEARCH, $search) {
// 21.1.3.15 String.prototype.search(regexp)
return [function search(regexp) {
'use strict';
var O = defined(this);
var fn = regexp == undefined ? undefined : regexp[SEARCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
}, $search];
});
/***/ }),
/* 204 */
/***/ (function(module, exports, __webpack_require__) {
// @@split logic
__webpack_require__(201)('split', 2, function (defined, SPLIT, $split) {
'use strict';
var isRegExp = __webpack_require__(134);
var _split = $split;
var $push = [].push;
var $SPLIT = 'split';
var LENGTH = 'length';
var LAST_INDEX = 'lastIndex';
if (
'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
'.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
'.'[$SPLIT](/()()/)[LENGTH] > 1 ||
''[$SPLIT](/.?/)[LENGTH]
) {
var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group
// based on es5-shim implementation, need to rework it
$split = function (separator, limit) {
var string = String(this);
if (separator === undefined && limit === 0) return [];
// If `separator` is not a regex, use native split
if (!isRegExp(separator)) return _split.call(string, separator, limit);
var output = [];
var flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.unicode ? 'u' : '') +
(separator.sticky ? 'y' : '');
var lastLastIndex = 0;
var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
// Make `global` and avoid `lastIndex` issues by working with a copy
var separatorCopy = new RegExp(separator.source, flags + 'g');
var separator2, match, lastIndex, lastLength, i;
// Doesn't need flags gy, but they don't hurt
if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
while (match = separatorCopy.exec(string)) {
// `separatorCopy.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0][LENGTH];
if (lastIndex > lastLastIndex) {
output.push(string.slice(lastLastIndex, match.index));
// Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG
// eslint-disable-next-line no-loop-func
if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {
for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;
});
if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
lastLength = match[0][LENGTH];
lastLastIndex = lastIndex;
if (output[LENGTH] >= splitLimit) break;
}
if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
}
if (lastLastIndex === string[LENGTH]) {
if (lastLength || !separatorCopy.test('')) output.push('');
} else output.push(string.slice(lastLastIndex));
return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
};
// Chakra, V8
} else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
$split = function (separator, limit) {
return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
};
}
// 21.1.3.17 String.prototype.split(separator, limit)
return [function split(separator, limit) {
var O = defined(this);
var fn = separator == undefined ? undefined : separator[SPLIT];
return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
}, $split];
});
/***/ }),
/* 205 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var LIBRARY = __webpack_require__(24);
var global = __webpack_require__(4);
var ctx = __webpack_require__(20);
var classof = __webpack_require__(74);
var $export = __webpack_require__(8);
var isObject = __webpack_require__(13);
var aFunction = __webpack_require__(21);
var anInstance = __webpack_require__(206);
var forOf = __webpack_require__(207);
var speciesConstructor = __webpack_require__(208);
var task = __webpack_require__(209).set;
var microtask = __webpack_require__(210)();
var newPromiseCapabilityModule = __webpack_require__(211);
var perform = __webpack_require__(212);
var userAgent = __webpack_require__(213);
var promiseResolve = __webpack_require__(214);
var PROMISE = 'Promise';
var TypeError = global.TypeError;
var process = global.process;
var versions = process && process.versions;
var v8 = versions && versions.v8 || '';
var $Promise = global[PROMISE];
var isNode = classof(process) == 'process';
var empty = function () { /* empty */ };
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
var USE_NATIVE = !!function () {
try {
// correct subclassing with @@species support
var promise = $Promise.resolve(1);
var FakePromise = (promise.constructor = {})[__webpack_require__(26)('species')] = function (exec) {
exec(empty, empty);
};
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test
return (isNode || typeof PromiseRejectionEvent == 'function')
&& promise.then(empty) instanceof FakePromise
// v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
// we can't detect it synchronously, so just check versions
&& v8.indexOf('6.6') !== 0
&& userAgent.indexOf('Chrome/66') === -1;
} catch (e) { /* empty */ }
}();
// helpers
var isThenable = function (it) {
var then;
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
};
var notify = function (promise, isReject) {
if (promise._n) return;
promise._n = true;
var chain = promise._c;
microtask(function () {
var value = promise._v;
var ok = promise._s == 1;
var i = 0;
var run = function (reaction) {
var handler = ok ? reaction.ok : reaction.fail;
var resolve = reaction.resolve;
var reject = reaction.reject;
var domain = reaction.domain;
var result, then, exited;
try {
if (handler) {
if (!ok) {
if (promise._h == 2) onHandleUnhandled(promise);
promise._h = 1;
}
if (handler === true) result = value;
else {
if (domain) domain.enter();
result = handler(value); // may throw
if (domain) {
domain.exit();
exited = true;
}
}
if (result === reaction.promise) {
reject(TypeError('Promise-chain cycle'));
} else if (then = isThenable(result)) {
then.call(result, resolve, reject);
} else resolve(result);
} else reject(value);
} catch (e) {
if (domain && !exited) domain.exit();
reject(e);
}
};
while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
promise._c = [];
promise._n = false;
if (isReject && !promise._h) onUnhandled(promise);
});
};
var onUnhandled = function (promise) {
task.call(global, function () {
var value = promise._v;
var unhandled = isUnhandled(promise);
var result, handler, console;
if (unhandled) {
result = perform(function () {
if (isNode) {
process.emit('unhandledRejection', value, promise);
} else if (handler = global.onunhandledrejection) {
handler({ promise: promise, reason: value });
} else if ((console = global.console) && console.error) {
console.error('Unhandled promise rejection', value);
}
});
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
promise._h = isNode || isUnhandled(promise) ? 2 : 1;
} promise._a = undefined;
if (unhandled && result.e) throw result.v;
});
};
var isUnhandled = function (promise) {
return promise._h !== 1 && (promise._a || promise._c).length === 0;
};
var onHandleUnhandled = function (promise) {
task.call(global, function () {
var handler;
if (isNode) {
process.emit('rejectionHandled', promise);
} else if (handler = global.onrejectionhandled) {
handler({ promise: promise, reason: promise._v });
}
});
};
var $reject = function (value) {
var promise = this;
if (promise._d) return;
promise._d = true;
promise = promise._w || promise; // unwrap
promise._v = value;
promise._s = 2;
if (!promise._a) promise._a = promise._c.slice();
notify(promise, true);
};
var $resolve = function (value) {
var promise = this;
var then;
if (promise._d) return;
promise._d = true;
promise = promise._w || promise; // unwrap
try {
if (promise === value) throw TypeError("Promise can't be resolved itself");
if (then = isThenable(value)) {
microtask(function () {
var wrapper = { _w: promise, _d: false }; // wrap
try {
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
} catch (e) {
$reject.call(wrapper, e);
}
});
} else {
promise._v = value;
promise._s = 1;
notify(promise, false);
}
} catch (e) {
$reject.call({ _w: promise, _d: false }, e); // wrap
}
};
// constructor polyfill
if (!USE_NATIVE) {
// 25.4.3.1 Promise(executor)
$Promise = function Promise(executor) {
anInstance(this, $Promise, PROMISE, '_h');
aFunction(executor);
Internal.call(this);
try {
executor(ctx($resolve, this, 1), ctx($reject, this, 1));
} catch (err) {
$reject.call(this, err);
}
};
// eslint-disable-next-line no-unused-vars
Internal = function Promise(executor) {
this._c = []; // <- awaiting reactions
this._a = undefined; // <- checked in isUnhandled reactions
this._s = 0; // <- state
this._d = false; // <- done
this._v = undefined; // <- value
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
this._n = false; // <- notify
};
Internal.prototype = __webpack_require__(215)($Promise.prototype, {
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
then: function then(onFulfilled, onRejected) {
var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
reaction.fail = typeof onRejected == 'function' && onRejected;
reaction.domain = isNode ? process.domain : undefined;
this._c.push(reaction);
if (this._a) this._a.push(reaction);
if (this._s) notify(this, false);
return reaction.promise;
},
// 25.4.5.1 Promise.prototype.catch(onRejected)
'catch': function (onRejected) {
return this.then(undefined, onRejected);
}
});
OwnPromiseCapability = function () {
var promise = new Internal();
this.promise = promise;
this.resolve = ctx($resolve, promise, 1);
this.reject = ctx($reject, promise, 1);
};
newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
return C === $Promise || C === Wrapper
? new OwnPromiseCapability(C)
: newGenericPromiseCapability(C);
};
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
__webpack_require__(25)($Promise, PROMISE);
__webpack_require__(193)(PROMISE);
Wrapper = __webpack_require__(9)[PROMISE];
// statics
$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
// 25.4.4.5 Promise.reject(r)
reject: function reject(r) {
var capability = newPromiseCapability(this);
var $$reject = capability.reject;
$$reject(r);
return capability.promise;
}
});
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
// 25.4.4.6 Promise.resolve(x)
resolve: function resolve(x) {
return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
}
});
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(166)(function (iter) {
$Promise.all(iter)['catch'](empty);
})), PROMISE, {
// 25.4.4.1 Promise.all(iterable)
all: function all(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var resolve = capability.resolve;
var reject = capability.reject;
var result = perform(function () {
var values = [];
var index = 0;
var remaining = 1;
forOf(iterable, false, function (promise) {
var $index = index++;
var alreadyCalled = false;
values.push(undefined);
remaining++;
C.resolve(promise).then(function (value) {
if (alreadyCalled) return;
alreadyCalled = true;
values[$index] = value;
--remaining || resolve(values);
}, reject);
});
--remaining || resolve(values);
});
if (result.e) reject(result.v);
return capability.promise;
},
// 25.4.4.4 Promise.race(iterable)
race: function race(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var reject = capability.reject;
var result = perform(function () {
forOf(iterable, false, function (promise) {
C.resolve(promise).then(capability.resolve, reject);
});
});
if (result.e) reject(result.v);
return capability.promise;
}
});
/***/ }),
/* 206 */
/***/ (function(module, exports) {
module.exports = function (it, Constructor, name, forbiddenField) {
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
throw TypeError(name + ': incorrect invocation!');
} return it;
};
/***/ }),
/* 207 */
/***/ (function(module, exports, __webpack_require__) {
var ctx = __webpack_require__(20);
var call = __webpack_require__(162);
var isArrayIter = __webpack_require__(163);
var anObject = __webpack_require__(12);
var toLength = __webpack_require__(37);
var getIterFn = __webpack_require__(165);
var BREAK = {};
var RETURN = {};
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
var f = ctx(fn, that, entries ? 2 : 1);
var index = 0;
var length, step, iterator, result;
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
// fast case for arrays with default iterator
if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
if (result === BREAK || result === RETURN) return result;
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
result = call(iterator, f, step.value, entries);
if (result === BREAK || result === RETURN) return result;
}
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;
/***/ }),
/* 208 */
/***/ (function(module, exports, __webpack_require__) {
// 7.3.20 SpeciesConstructor(O, defaultConstructor)
var anObject = __webpack_require__(12);
var aFunction = __webpack_require__(21);
var SPECIES = __webpack_require__(26)('species');
module.exports = function (O, D) {
var C = anObject(O).constructor;
var S;
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
};
/***/ }),
/* 209 */
/***/ (function(module, exports, __webpack_require__) {
var ctx = __webpack_require__(20);
var invoke = __webpack_require__(77);
var html = __webpack_require__(47);
var cel = __webpack_require__(15);
var global = __webpack_require__(4);
var process = global.process;
var setTask = global.setImmediate;
var clearTask = global.clearImmediate;
var MessageChannel = global.MessageChannel;
var Dispatch = global.Dispatch;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = 'onreadystatechange';
var defer, channel, port;
var run = function () {
var id = +this;
// eslint-disable-next-line no-prototype-builtins
if (queue.hasOwnProperty(id)) {
var fn = queue[id];
delete queue[id];
fn();
}
};
var listener = function (event) {
run.call(event.data);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if (!setTask || !clearTask) {
setTask = function setImmediate(fn) {
var args = [];
var i = 1;
while (arguments.length > i) args.push(arguments[i++]);
queue[++counter] = function () {
// eslint-disable-next-line no-new-func
invoke(typeof fn == 'function' ? fn : Function(fn), args);
};
defer(counter);
return counter;
};
clearTask = function clearImmediate(id) {
delete queue[id];
};
// Node.js 0.8-
if (__webpack_require__(34)(process) == 'process') {
defer = function (id) {
process.nextTick(ctx(run, id, 1));
};
// Sphere (JS game engine) Dispatch API
} else if (Dispatch && Dispatch.now) {
defer = function (id) {
Dispatch.now(ctx(run, id, 1));
};
// Browsers with MessageChannel, includes WebWorkers
} else if (MessageChannel) {
channel = new MessageChannel();
port = channel.port2;
channel.port1.onmessage = listener;
defer = ctx(port.postMessage, port, 1);
// Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
defer = function (id) {
global.postMessage(id + '', '*');
};
global.addEventListener('message', listener, false);
// IE8-
} else if (ONREADYSTATECHANGE in cel('script')) {
defer = function (id) {
html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
html.removeChild(this);
run.call(id);
};
};
// Rest old browsers
} else {
defer = function (id) {
setTimeout(ctx(run, id, 1), 0);
};
}
}
module.exports = {
set: setTask,
clear: clearTask
};
/***/ }),
/* 210 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var macrotask = __webpack_require__(209).set;
var Observer = global.MutationObserver || global.WebKitMutationObserver;
var process = global.process;
var Promise = global.Promise;
var isNode = __webpack_require__(34)(process) == 'process';
module.exports = function () {
var head, last, notify;
var flush = function () {
var parent, fn;
if (isNode && (parent = process.domain)) parent.exit();
while (head) {
fn = head.fn;
head = head.next;
try {
fn();
} catch (e) {
if (head) notify();
else last = undefined;
throw e;
}
} last = undefined;
if (parent) parent.enter();
};
// Node.js
if (isNode) {
notify = function () {
process.nextTick(flush);
};
// browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
} else if (Observer && !(global.navigator && global.navigator.standalone)) {
var toggle = true;
var node = document.createTextNode('');
new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
notify = function () {
node.data = toggle = !toggle;
};
// environments with maybe non-completely correct, but existent Promise
} else if (Promise && Promise.resolve) {
// Promise.resolve without an argument throws an error in LG WebOS 2
var promise = Promise.resolve(undefined);
notify = function () {
promise.then(flush);
};
// for other environments - macrotask based on:
// - setImmediate
// - MessageChannel
// - window.postMessag
// - onreadystatechange
// - setTimeout
} else {
notify = function () {
// strange IE + webpack dev server bug - use .call(global)
macrotask.call(global, flush);
};
}
return function (fn) {
var task = { fn: fn, next: undefined };
if (last) last.next = task;
if (!head) {
head = task;
notify();
} last = task;
};
};
/***/ }),
/* 211 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 25.4.1.5 NewPromiseCapability(C)
var aFunction = __webpack_require__(21);
function PromiseCapability(C) {
var resolve, reject;
this.promise = new C(function ($$resolve, $$reject) {
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
resolve = $$resolve;
reject = $$reject;
});
this.resolve = aFunction(resolve);
this.reject = aFunction(reject);
}
module.exports.f = function (C) {
return new PromiseCapability(C);
};
/***/ }),
/* 212 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return { e: false, v: exec() };
} catch (e) {
return { e: true, v: e };
}
};
/***/ }),
/* 213 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var navigator = global.navigator;
module.exports = navigator && navigator.userAgent || '';
/***/ }),
/* 214 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
var newPromiseCapability = __webpack_require__(211);
module.exports = function (C, x) {
anObject(C);
if (isObject(x) && x.constructor === C) return x;
var promiseCapability = newPromiseCapability.f(C);
var resolve = promiseCapability.resolve;
resolve(x);
return promiseCapability.promise;
};
/***/ }),
/* 215 */
/***/ (function(module, exports, __webpack_require__) {
var redefine = __webpack_require__(18);
module.exports = function (target, src, safe) {
for (var key in src) redefine(target, key, src[key], safe);
return target;
};
/***/ }),
/* 216 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var strong = __webpack_require__(217);
var validate = __webpack_require__(218);
var MAP = 'Map';
// 23.1 Map Objects
module.exports = __webpack_require__(219)(MAP, function (get) {
return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.1.3.6 Map.prototype.get(key)
get: function get(key) {
var entry = strong.getEntry(validate(this, MAP), key);
return entry && entry.v;
},
// 23.1.3.9 Map.prototype.set(key, value)
set: function set(key, value) {
return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
}
}, strong, true);
/***/ }),
/* 217 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var dP = __webpack_require__(11).f;
var create = __webpack_require__(45);
var redefineAll = __webpack_require__(215);
var ctx = __webpack_require__(20);
var anInstance = __webpack_require__(206);
var forOf = __webpack_require__(207);
var $iterDefine = __webpack_require__(128);
var step = __webpack_require__(195);
var setSpecies = __webpack_require__(193);
var DESCRIPTORS = __webpack_require__(6);
var fastKey = __webpack_require__(22).fastKey;
var validate = __webpack_require__(218);
var SIZE = DESCRIPTORS ? '_s' : 'size';
var getEntry = function (that, key) {
// fast case
var index = fastKey(key);
var entry;
if (index !== 'F') return that._i[index];
// frozen object case
for (entry = that._f; entry; entry = entry.n) {
if (entry.k == key) return entry;
}
};
module.exports = {
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
anInstance(that, C, NAME, '_i');
that._t = NAME; // collection type
that._i = create(null); // index
that._f = undefined; // first entry
that._l = undefined; // last entry
that[SIZE] = 0; // size
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
});
redefineAll(C.prototype, {
// 23.1.3.1 Map.prototype.clear()
// 23.2.3.2 Set.prototype.clear()
clear: function clear() {
for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
entry.r = true;
if (entry.p) entry.p = entry.p.n = undefined;
delete data[entry.i];
}
that._f = that._l = undefined;
that[SIZE] = 0;
},
// 23.1.3.3 Map.prototype.delete(key)
// 23.2.3.4 Set.prototype.delete(value)
'delete': function (key) {
var that = validate(this, NAME);
var entry = getEntry(that, key);
if (entry) {
var next = entry.n;
var prev = entry.p;
delete that._i[entry.i];
entry.r = true;
if (prev) prev.n = next;
if (next) next.p = prev;
if (that._f == entry) that._f = next;
if (that._l == entry) that._l = prev;
that[SIZE]--;
} return !!entry;
},
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
forEach: function forEach(callbackfn /* , that = undefined */) {
validate(this, NAME);
var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
var entry;
while (entry = entry ? entry.n : this._f) {
f(entry.v, entry.k, this);
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
}
},
// 23.1.3.7 Map.prototype.has(key)
// 23.2.3.7 Set.prototype.has(value)
has: function has(key) {
return !!getEntry(validate(this, NAME), key);
}
});
if (DESCRIPTORS) dP(C.prototype, 'size', {
get: function () {
return validate(this, NAME)[SIZE];
}
});
return C;
},
def: function (that, key, value) {
var entry = getEntry(that, key);
var prev, index;
// change existing entry
if (entry) {
entry.v = value;
// create new entry
} else {
that._l = entry = {
i: index = fastKey(key, true), // <- index
k: key, // <- key
v: value, // <- value
p: prev = that._l, // <- previous entry
n: undefined, // <- next entry
r: false // <- removed
};
if (!that._f) that._f = entry;
if (prev) prev.n = entry;
that[SIZE]++;
// add to index
if (index !== 'F') that._i[index] = entry;
} return that;
},
getEntry: getEntry,
setStrong: function (C, NAME, IS_MAP) {
// add .keys, .values, .entries, [@@iterator]
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
$iterDefine(C, NAME, function (iterated, kind) {
this._t = validate(iterated, NAME); // target
this._k = kind; // kind
this._l = undefined; // previous
}, function () {
var that = this;
var kind = that._k;
var entry = that._l;
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
// get next entry
if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
// or finish the iteration
that._t = undefined;
return step(1);
}
// return step by kind
if (kind == 'keys') return step(0, entry.k);
if (kind == 'values') return step(0, entry.v);
return step(0, [entry.k, entry.v]);
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
// add [@@species], 23.1.2.2, 23.2.2.2
setSpecies(NAME);
}
};
/***/ }),
/* 218 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
module.exports = function (it, TYPE) {
if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
return it;
};
/***/ }),
/* 219 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(4);
var $export = __webpack_require__(8);
var redefine = __webpack_require__(18);
var redefineAll = __webpack_require__(215);
var meta = __webpack_require__(22);
var forOf = __webpack_require__(207);
var anInstance = __webpack_require__(206);
var isObject = __webpack_require__(13);
var fails = __webpack_require__(7);
var $iterDetect = __webpack_require__(166);
var setToStringTag = __webpack_require__(25);
var inheritIfRequired = __webpack_require__(87);
module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
var Base = global[NAME];
var C = Base;
var ADDER = IS_MAP ? 'set' : 'add';
var proto = C && C.prototype;
var O = {};
var fixMethod = function (KEY) {
var fn = proto[KEY];
redefine(proto, KEY,
KEY == 'delete' ? function (a) {
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'has' ? function has(a) {
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'get' ? function get(a) {
return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
: function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
);
};
if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
new C().entries().next();
}))) {
// create collection constructor
C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
redefineAll(C.prototype, methods);
meta.NEED = true;
} else {
var instance = new C();
// early implementations not supports chaining
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
// most early implementations doesn't supports iterables, most modern - not close it correctly
var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
// for early implementations -0 and +0 not the same
var BUGGY_ZERO = !IS_WEAK && fails(function () {
// V8 ~ Chromium 42- fails only with 5+ elements
var $instance = new C();
var index = 5;
while (index--) $instance[ADDER](index, index);
return !$instance.has(-0);
});
if (!ACCEPT_ITERABLES) {
C = wrapper(function (target, iterable) {
anInstance(target, C, NAME);
var that = inheritIfRequired(new Base(), target, C);
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
return that;
});
C.prototype = proto;
proto.constructor = C;
}
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
fixMethod('delete');
fixMethod('has');
IS_MAP && fixMethod('get');
}
if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
// weak collections should not contains .clear method
if (IS_WEAK && proto.clear) delete proto.clear;
}
setToStringTag(C, NAME);
O[NAME] = C;
$export($export.G + $export.W + $export.F * (C != Base), O);
if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
return C;
};
/***/ }),
/* 220 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var strong = __webpack_require__(217);
var validate = __webpack_require__(218);
var SET = 'Set';
// 23.2 Set Objects
module.exports = __webpack_require__(219)(SET, function (get) {
return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.2.3.1 Set.prototype.add(value)
add: function add(value) {
return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
}
}, strong);
/***/ }),
/* 221 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var each = __webpack_require__(173)(0);
var redefine = __webpack_require__(18);
var meta = __webpack_require__(22);
var assign = __webpack_require__(68);
var weak = __webpack_require__(222);
var isObject = __webpack_require__(13);
var fails = __webpack_require__(7);
var validate = __webpack_require__(218);
var WEAK_MAP = 'WeakMap';
var getWeak = meta.getWeak;
var isExtensible = Object.isExtensible;
var uncaughtFrozenStore = weak.ufstore;
var tmp = {};
var InternalMap;
var wrapper = function (get) {
return function WeakMap() {
return get(this, arguments.length > 0 ? arguments[0] : undefined);
};
};
var methods = {
// 23.3.3.3 WeakMap.prototype.get(key)
get: function get(key) {
if (isObject(key)) {
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
return data ? data[this._i] : undefined;
}
},
// 23.3.3.5 WeakMap.prototype.set(key, value)
set: function set(key, value) {
return weak.def(validate(this, WEAK_MAP), key, value);
}
};
// 23.3 WeakMap Objects
var $WeakMap = module.exports = __webpack_require__(219)(WEAK_MAP, wrapper, methods, weak, true, true);
// IE11 WeakMap frozen keys fix
if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {
InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
assign(InternalMap.prototype, methods);
meta.NEED = true;
each(['delete', 'has', 'get', 'set'], function (key) {
var proto = $WeakMap.prototype;
var method = proto[key];
redefine(proto, key, function (a, b) {
// store frozen objects on internal weakmap shim
if (isObject(a) && !isExtensible(a)) {
if (!this._f) this._f = new InternalMap();
var result = this._f[key](a, b);
return key == 'set' ? this : result;
// store all the rest on native weakmap
} return method.call(this, a, b);
});
});
}
/***/ }),
/* 222 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var redefineAll = __webpack_require__(215);
var getWeak = __webpack_require__(22).getWeak;
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
var anInstance = __webpack_require__(206);
var forOf = __webpack_require__(207);
var createArrayMethod = __webpack_require__(173);
var $has = __webpack_require__(5);
var validate = __webpack_require__(218);
var arrayFind = createArrayMethod(5);
var arrayFindIndex = createArrayMethod(6);
var id = 0;
// fallback for uncaught frozen keys
var uncaughtFrozenStore = function (that) {
return that._l || (that._l = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function () {
this.a = [];
};
var findUncaughtFrozen = function (store, key) {
return arrayFind(store.a, function (it) {
return it[0] === key;
});
};
UncaughtFrozenStore.prototype = {
get: function (key) {
var entry = findUncaughtFrozen(this, key);
if (entry) return entry[1];
},
has: function (key) {
return !!findUncaughtFrozen(this, key);
},
set: function (key, value) {
var entry = findUncaughtFrozen(this, key);
if (entry) entry[1] = value;
else this.a.push([key, value]);
},
'delete': function (key) {
var index = arrayFindIndex(this.a, function (it) {
return it[0] === key;
});
if (~index) this.a.splice(index, 1);
return !!~index;
}
};
module.exports = {
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
anInstance(that, C, NAME, '_i');
that._t = NAME; // collection type
that._i = id++; // collection id
that._l = undefined; // leak store for uncaught frozen objects
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
});
redefineAll(C.prototype, {
// 23.3.3.2 WeakMap.prototype.delete(key)
// 23.4.3.3 WeakSet.prototype.delete(value)
'delete': function (key) {
if (!isObject(key)) return false;
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
return data && $has(data, this._i) && delete data[this._i];
},
// 23.3.3.4 WeakMap.prototype.has(key)
// 23.4.3.4 WeakSet.prototype.has(value)
has: function has(key) {
if (!isObject(key)) return false;
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
return data && $has(data, this._i);
}
});
return C;
},
def: function (that, key, value) {
var data = getWeak(anObject(key), true);
if (data === true) uncaughtFrozenStore(that).set(key, value);
else data[that._i] = value;
return that;
},
ufstore: uncaughtFrozenStore
};
/***/ }),
/* 223 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var weak = __webpack_require__(222);
var validate = __webpack_require__(218);
var WEAK_SET = 'WeakSet';
// 23.4 WeakSet Objects
__webpack_require__(219)(WEAK_SET, function (get) {
return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.4.3.1 WeakSet.prototype.add(value)
add: function add(value) {
return weak.def(validate(this, WEAK_SET), value, true);
}
}, weak, false, true);
/***/ }),
/* 224 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $typed = __webpack_require__(225);
var buffer = __webpack_require__(226);
var anObject = __webpack_require__(12);
var toAbsoluteIndex = __webpack_require__(39);
var toLength = __webpack_require__(37);
var isObject = __webpack_require__(13);
var ArrayBuffer = __webpack_require__(4).ArrayBuffer;
var speciesConstructor = __webpack_require__(208);
var $ArrayBuffer = buffer.ArrayBuffer;
var $DataView = buffer.DataView;
var $isView = $typed.ABV && ArrayBuffer.isView;
var $slice = $ArrayBuffer.prototype.slice;
var VIEW = $typed.VIEW;
var ARRAY_BUFFER = 'ArrayBuffer';
$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });
$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
// 24.1.3.1 ArrayBuffer.isView(arg)
isView: function isView(it) {
return $isView && $isView(it) || isObject(it) && VIEW in it;
}
});
$export($export.P + $export.U + $export.F * __webpack_require__(7)(function () {
return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
}), ARRAY_BUFFER, {
// 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
slice: function slice(start, end) {
if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
var len = anObject(this).byteLength;
var first = toAbsoluteIndex(start, len);
var fin = toAbsoluteIndex(end === undefined ? len : end, len);
var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));
var viewS = new $DataView(this);
var viewT = new $DataView(result);
var index = 0;
while (first < fin) {
viewT.setUint8(index++, viewS.getUint8(first++));
} return result;
}
});
__webpack_require__(193)(ARRAY_BUFFER);
/***/ }),
/* 225 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var hide = __webpack_require__(10);
var uid = __webpack_require__(19);
var TYPED = uid('typed_array');
var VIEW = uid('view');
var ABV = !!(global.ArrayBuffer && global.DataView);
var CONSTR = ABV;
var i = 0;
var l = 9;
var Typed;
var TypedArrayConstructors = (
'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
).split(',');
while (i < l) {
if (Typed = global[TypedArrayConstructors[i++]]) {
hide(Typed.prototype, TYPED, true);
hide(Typed.prototype, VIEW, true);
} else CONSTR = false;
}
module.exports = {
ABV: ABV,
CONSTR: CONSTR,
TYPED: TYPED,
VIEW: VIEW
};
/***/ }),
/* 226 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(4);
var DESCRIPTORS = __webpack_require__(6);
var LIBRARY = __webpack_require__(24);
var $typed = __webpack_require__(225);
var hide = __webpack_require__(10);
var redefineAll = __webpack_require__(215);
var fails = __webpack_require__(7);
var anInstance = __webpack_require__(206);
var toInteger = __webpack_require__(38);
var toLength = __webpack_require__(37);
var toIndex = __webpack_require__(227);
var gOPN = __webpack_require__(49).f;
var dP = __webpack_require__(11).f;
var arrayFill = __webpack_require__(189);
var setToStringTag = __webpack_require__(25);
var ARRAY_BUFFER = 'ArrayBuffer';
var DATA_VIEW = 'DataView';
var PROTOTYPE = 'prototype';
var WRONG_LENGTH = 'Wrong length!';
var WRONG_INDEX = 'Wrong index!';
var $ArrayBuffer = global[ARRAY_BUFFER];
var $DataView = global[DATA_VIEW];
var Math = global.Math;
var RangeError = global.RangeError;
// eslint-disable-next-line no-shadow-restricted-names
var Infinity = global.Infinity;
var BaseBuffer = $ArrayBuffer;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var BUFFER = 'buffer';
var BYTE_LENGTH = 'byteLength';
var BYTE_OFFSET = 'byteOffset';
var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
// IEEE754 conversions based on https://github.com/feross/ieee754
function packIEEE754(value, mLen, nBytes) {
var buffer = new Array(nBytes);
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
var i = 0;
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
var e, m, c;
value = abs(value);
// eslint-disable-next-line no-self-compare
if (value != value || value === Infinity) {
// eslint-disable-next-line no-self-compare
m = value != value ? 1 : 0;
e = eMax;
} else {
e = floor(log(value) / LN2);
if (value * (c = pow(2, -e)) < 1) {
e--;
c *= 2;
}
if (e + eBias >= 1) {
value += rt / c;
} else {
value += rt * pow(2, 1 - eBias);
}
if (value * c >= 2) {
e++;
c /= 2;
}
if (e + eBias >= eMax) {
m = 0;
e = eMax;
} else if (e + eBias >= 1) {
m = (value * c - 1) * pow(2, mLen);
e = e + eBias;
} else {
m = value * pow(2, eBias - 1) * pow(2, mLen);
e = 0;
}
}
for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
e = e << mLen | m;
eLen += mLen;
for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
buffer[--i] |= s * 128;
return buffer;
}
function unpackIEEE754(buffer, mLen, nBytes) {
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var nBits = eLen - 7;
var i = nBytes - 1;
var s = buffer[i--];
var e = s & 127;
var m;
s >>= 7;
for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
m = e & (1 << -nBits) - 1;
e >>= -nBits;
nBits += mLen;
for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
if (e === 0) {
e = 1 - eBias;
} else if (e === eMax) {
return m ? NaN : s ? -Infinity : Infinity;
} else {
m = m + pow(2, mLen);
e = e - eBias;
} return (s ? -1 : 1) * m * pow(2, e - mLen);
}
function unpackI32(bytes) {
return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
}
function packI8(it) {
return [it & 0xff];
}
function packI16(it) {
return [it & 0xff, it >> 8 & 0xff];
}
function packI32(it) {
return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
}
function packF64(it) {
return packIEEE754(it, 52, 8);
}
function packF32(it) {
return packIEEE754(it, 23, 4);
}
function addGetter(C, key, internal) {
dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
}
function get(view, bytes, index, isLittleEndian) {
var numIndex = +index;
var intIndex = toIndex(numIndex);
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b;
var start = intIndex + view[$OFFSET];
var pack = store.slice(start, start + bytes);
return isLittleEndian ? pack : pack.reverse();
}
function set(view, bytes, index, conversion, value, isLittleEndian) {
var numIndex = +index;
var intIndex = toIndex(numIndex);
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b;
var start = intIndex + view[$OFFSET];
var pack = conversion(+value);
for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
}
if (!$typed.ABV) {
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
var byteLength = toIndex(length);
this._b = arrayFill.call(new Array(byteLength), 0);
this[$LENGTH] = byteLength;
};
$DataView = function DataView(buffer, byteOffset, byteLength) {
anInstance(this, $DataView, DATA_VIEW);
anInstance(buffer, $ArrayBuffer, DATA_VIEW);
var bufferLength = buffer[$LENGTH];
var offset = toInteger(byteOffset);
if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
this[$BUFFER] = buffer;
this[$OFFSET] = offset;
this[$LENGTH] = byteLength;
};
if (DESCRIPTORS) {
addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
addGetter($DataView, BUFFER, '_b');
addGetter($DataView, BYTE_LENGTH, '_l');
addGetter($DataView, BYTE_OFFSET, '_o');
}
redefineAll($DataView[PROTOTYPE], {
getInt8: function getInt8(byteOffset) {
return get(this, 1, byteOffset)[0] << 24 >> 24;
},
getUint8: function getUint8(byteOffset) {
return get(this, 1, byteOffset)[0];
},
getInt16: function getInt16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments[1]);
return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
},
getUint16: function getUint16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments[1]);
return bytes[1] << 8 | bytes[0];
},
getInt32: function getInt32(byteOffset /* , littleEndian */) {
return unpackI32(get(this, 4, byteOffset, arguments[1]));
},
getUint32: function getUint32(byteOffset /* , littleEndian */) {
return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
},
getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
},
getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
},
setInt8: function setInt8(byteOffset, value) {
set(this, 1, byteOffset, packI8, value);
},
setUint8: function setUint8(byteOffset, value) {
set(this, 1, byteOffset, packI8, value);
},
setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packF32, value, arguments[2]);
},
setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
set(this, 8, byteOffset, packF64, value, arguments[2]);
}
});
} else {
if (!fails(function () {
$ArrayBuffer(1);
}) || !fails(function () {
new $ArrayBuffer(-1); // eslint-disable-line no-new
}) || fails(function () {
new $ArrayBuffer(); // eslint-disable-line no-new
new $ArrayBuffer(1.5); // eslint-disable-line no-new
new $ArrayBuffer(NaN); // eslint-disable-line no-new
return $ArrayBuffer.name != ARRAY_BUFFER;
})) {
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, $ArrayBuffer);
return new BaseBuffer(toIndex(length));
};
var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
}
if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
}
// iOS Safari 7.x bug
var view = new $DataView(new $ArrayBuffer(2));
var $setInt8 = $DataView[PROTOTYPE].setInt8;
view.setInt8(0, 2147483648);
view.setInt8(1, 2147483649);
if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
setInt8: function setInt8(byteOffset, value) {
$setInt8.call(this, byteOffset, value << 24 >> 24);
},
setUint8: function setUint8(byteOffset, value) {
$setInt8.call(this, byteOffset, value << 24 >> 24);
}
}, true);
}
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
hide($DataView[PROTOTYPE], $typed.VIEW, true);
exports[ARRAY_BUFFER] = $ArrayBuffer;
exports[DATA_VIEW] = $DataView;
/***/ }),
/* 227 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/ecma262/#sec-toindex
var toInteger = __webpack_require__(38);
var toLength = __webpack_require__(37);
module.exports = function (it) {
if (it === undefined) return 0;
var number = toInteger(it);
var length = toLength(number);
if (number !== length) throw RangeError('Wrong length!');
return length;
};
/***/ }),
/* 228 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
$export($export.G + $export.W + $export.F * !__webpack_require__(225).ABV, {
DataView: __webpack_require__(226).DataView
});
/***/ }),
/* 229 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(230)('Int8', 1, function (init) {
return function Int8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 230 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
if (__webpack_require__(6)) {
var LIBRARY = __webpack_require__(24);
var global = __webpack_require__(4);
var fails = __webpack_require__(7);
var $export = __webpack_require__(8);
var $typed = __webpack_require__(225);
var $buffer = __webpack_require__(226);
var ctx = __webpack_require__(20);
var anInstance = __webpack_require__(206);
var propertyDesc = __webpack_require__(17);
var hide = __webpack_require__(10);
var redefineAll = __webpack_require__(215);
var toInteger = __webpack_require__(38);
var toLength = __webpack_require__(37);
var toIndex = __webpack_require__(227);
var toAbsoluteIndex = __webpack_require__(39);
var toPrimitive = __webpack_require__(16);
var has = __webpack_require__(5);
var classof = __webpack_require__(74);
var isObject = __webpack_require__(13);
var toObject = __webpack_require__(57);
var isArrayIter = __webpack_require__(163);
var create = __webpack_require__(45);
var getPrototypeOf = __webpack_require__(58);
var gOPN = __webpack_require__(49).f;
var getIterFn = __webpack_require__(165);
var uid = __webpack_require__(19);
var wks = __webpack_require__(26);
var createArrayMethod = __webpack_require__(173);
var createArrayIncludes = __webpack_require__(36);
var speciesConstructor = __webpack_require__(208);
var ArrayIterators = __webpack_require__(194);
var Iterators = __webpack_require__(129);
var $iterDetect = __webpack_require__(166);
var setSpecies = __webpack_require__(193);
var arrayFill = __webpack_require__(189);
var arrayCopyWithin = __webpack_require__(186);
var $DP = __webpack_require__(11);
var $GOPD = __webpack_require__(50);
var dP = $DP.f;
var gOPD = $GOPD.f;
var RangeError = global.RangeError;
var TypeError = global.TypeError;
var Uint8Array = global.Uint8Array;
var ARRAY_BUFFER = 'ArrayBuffer';
var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
var PROTOTYPE = 'prototype';
var ArrayProto = Array[PROTOTYPE];
var $ArrayBuffer = $buffer.ArrayBuffer;
var $DataView = $buffer.DataView;
var arrayForEach = createArrayMethod(0);
var arrayFilter = createArrayMethod(2);
var arraySome = createArrayMethod(3);
var arrayEvery = createArrayMethod(4);
var arrayFind = createArrayMethod(5);
var arrayFindIndex = createArrayMethod(6);
var arrayIncludes = createArrayIncludes(true);
var arrayIndexOf = createArrayIncludes(false);
var arrayValues = ArrayIterators.values;
var arrayKeys = ArrayIterators.keys;
var arrayEntries = ArrayIterators.entries;
var arrayLastIndexOf = ArrayProto.lastIndexOf;
var arrayReduce = ArrayProto.reduce;
var arrayReduceRight = ArrayProto.reduceRight;
var arrayJoin = ArrayProto.join;
var arraySort = ArrayProto.sort;
var arraySlice = ArrayProto.slice;
var arrayToString = ArrayProto.toString;
var arrayToLocaleString = ArrayProto.toLocaleString;
var ITERATOR = wks('iterator');
var TAG = wks('toStringTag');
var TYPED_CONSTRUCTOR = uid('typed_constructor');
var DEF_CONSTRUCTOR = uid('def_constructor');
var ALL_CONSTRUCTORS = $typed.CONSTR;
var TYPED_ARRAY = $typed.TYPED;
var VIEW = $typed.VIEW;
var WRONG_LENGTH = 'Wrong length!';
var $map = createArrayMethod(1, function (O, length) {
return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
});
var LITTLE_ENDIAN = fails(function () {
// eslint-disable-next-line no-undef
return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
});
var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
new Uint8Array(1).set({});
});
var toOffset = function (it, BYTES) {
var offset = toInteger(it);
if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
return offset;
};
var validate = function (it) {
if (isObject(it) && TYPED_ARRAY in it) return it;
throw TypeError(it + ' is not a typed array!');
};
var allocate = function (C, length) {
if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
throw TypeError('It is not a typed array constructor!');
} return new C(length);
};
var speciesFromList = function (O, list) {
return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
};
var fromList = function (C, list) {
var index = 0;
var length = list.length;
var result = allocate(C, length);
while (length > index) result[index] = list[index++];
return result;
};
var addGetter = function (it, key, internal) {
dP(it, key, { get: function () { return this._d[internal]; } });
};
var $from = function from(source /* , mapfn, thisArg */) {
var O = toObject(source);
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var iterFn = getIterFn(O);
var i, length, values, result, step, iterator;
if (iterFn != undefined && !isArrayIter(iterFn)) {
for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
values.push(step.value);
} O = values;
}
if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
result[i] = mapping ? mapfn(O[i], i) : O[i];
}
return result;
};
var $of = function of(/* ...items */) {
var index = 0;
var length = arguments.length;
var result = allocate(this, length);
while (length > index) result[index] = arguments[index++];
return result;
};
// iOS Safari 6.x fails here
var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
var $toLocaleString = function toLocaleString() {
return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
};
var proto = {
copyWithin: function copyWithin(target, start /* , end */) {
return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
},
every: function every(callbackfn /* , thisArg */) {
return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
return arrayFill.apply(validate(this), arguments);
},
filter: function filter(callbackfn /* , thisArg */) {
return speciesFromList(this, arrayFilter(validate(this), callbackfn,
arguments.length > 1 ? arguments[1] : undefined));
},
find: function find(predicate /* , thisArg */) {
return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
findIndex: function findIndex(predicate /* , thisArg */) {
return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
forEach: function forEach(callbackfn /* , thisArg */) {
arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
indexOf: function indexOf(searchElement /* , fromIndex */) {
return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
includes: function includes(searchElement /* , fromIndex */) {
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
join: function join(separator) { // eslint-disable-line no-unused-vars
return arrayJoin.apply(validate(this), arguments);
},
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
return arrayLastIndexOf.apply(validate(this), arguments);
},
map: function map(mapfn /* , thisArg */) {
return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
},
reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduce.apply(validate(this), arguments);
},
reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduceRight.apply(validate(this), arguments);
},
reverse: function reverse() {
var that = this;
var length = validate(that).length;
var middle = Math.floor(length / 2);
var index = 0;
var value;
while (index < middle) {
value = that[index];
that[index++] = that[--length];
that[length] = value;
} return that;
},
some: function some(callbackfn /* , thisArg */) {
return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
sort: function sort(comparefn) {
return arraySort.call(validate(this), comparefn);
},
subarray: function subarray(begin, end) {
var O = validate(this);
var length = O.length;
var $begin = toAbsoluteIndex(begin, length);
return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
O.buffer,
O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
);
}
};
var $slice = function slice(start, end) {
return speciesFromList(this, arraySlice.call(validate(this), start, end));
};
var $set = function set(arrayLike /* , offset */) {
validate(this);
var offset = toOffset(arguments[1], 1);
var length = this.length;
var src = toObject(arrayLike);
var len = toLength(src.length);
var index = 0;
if (len + offset > length) throw RangeError(WRONG_LENGTH);
while (index < len) this[offset + index] = src[index++];
};
var $iterators = {
entries: function entries() {
return arrayEntries.call(validate(this));
},
keys: function keys() {
return arrayKeys.call(validate(this));
},
values: function values() {
return arrayValues.call(validate(this));
}
};
var isTAIndex = function (target, key) {
return isObject(target)
&& target[TYPED_ARRAY]
&& typeof key != 'symbol'
&& key in target
&& String(+key) == String(key);
};
var $getDesc = function getOwnPropertyDescriptor(target, key) {
return isTAIndex(target, key = toPrimitive(key, true))
? propertyDesc(2, target[key])
: gOPD(target, key);
};
var $setDesc = function defineProperty(target, key, desc) {
if (isTAIndex(target, key = toPrimitive(key, true))
&& isObject(desc)
&& has(desc, 'value')
&& !has(desc, 'get')
&& !has(desc, 'set')
// TODO: add validation descriptor w/o calling accessors
&& !desc.configurable
&& (!has(desc, 'writable') || desc.writable)
&& (!has(desc, 'enumerable') || desc.enumerable)
) {
target[key] = desc.value;
return target;
} return dP(target, key, desc);
};
if (!ALL_CONSTRUCTORS) {
$GOPD.f = $getDesc;
$DP.f = $setDesc;
}
$export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
getOwnPropertyDescriptor: $getDesc,
defineProperty: $setDesc
});
if (fails(function () { arrayToString.call({}); })) {
arrayToString = arrayToLocaleString = function toString() {
return arrayJoin.call(this);
};
}
var $TypedArrayPrototype$ = redefineAll({}, proto);
redefineAll($TypedArrayPrototype$, $iterators);
hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
redefineAll($TypedArrayPrototype$, {
slice: $slice,
set: $set,
constructor: function () { /* noop */ },
toString: arrayToString,
toLocaleString: $toLocaleString
});
addGetter($TypedArrayPrototype$, 'buffer', 'b');
addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
addGetter($TypedArrayPrototype$, 'byteLength', 'l');
addGetter($TypedArrayPrototype$, 'length', 'e');
dP($TypedArrayPrototype$, TAG, {
get: function () { return this[TYPED_ARRAY]; }
});
// eslint-disable-next-line max-statements
module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
CLAMPED = !!CLAMPED;
var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
var GETTER = 'get' + KEY;
var SETTER = 'set' + KEY;
var TypedArray = global[NAME];
var Base = TypedArray || {};
var TAC = TypedArray && getPrototypeOf(TypedArray);
var FORCED = !TypedArray || !$typed.ABV;
var O = {};
var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
var getter = function (that, index) {
var data = that._d;
return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
};
var setter = function (that, index, value) {
var data = that._d;
if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
};
var addElement = function (that, index) {
dP(that, index, {
get: function () {
return getter(this, index);
},
set: function (value) {
return setter(this, index, value);
},
enumerable: true
});
};
if (FORCED) {
TypedArray = wrapper(function (that, data, $offset, $length) {
anInstance(that, TypedArray, NAME, '_d');
var index = 0;
var offset = 0;
var buffer, byteLength, length, klass;
if (!isObject(data)) {
length = toIndex(data);
byteLength = length * BYTES;
buffer = new $ArrayBuffer(byteLength);
} else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
buffer = data;
offset = toOffset($offset, BYTES);
var $len = data.byteLength;
if ($length === undefined) {
if ($len % BYTES) throw RangeError(WRONG_LENGTH);
byteLength = $len - offset;
if (byteLength < 0) throw RangeError(WRONG_LENGTH);
} else {
byteLength = toLength($length) * BYTES;
if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
}
length = byteLength / BYTES;
} else if (TYPED_ARRAY in data) {
return fromList(TypedArray, data);
} else {
return $from.call(TypedArray, data);
}
hide(that, '_d', {
b: buffer,
o: offset,
l: byteLength,
e: length,
v: new $DataView(buffer)
});
while (index < length) addElement(that, index++);
});
TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
hide(TypedArrayPrototype, 'constructor', TypedArray);
} else if (!fails(function () {
TypedArray(1);
}) || !fails(function () {
new TypedArray(-1); // eslint-disable-line no-new
}) || !$iterDetect(function (iter) {
new TypedArray(); // eslint-disable-line no-new
new TypedArray(null); // eslint-disable-line no-new
new TypedArray(1.5); // eslint-disable-line no-new
new TypedArray(iter); // eslint-disable-line no-new
}, true)) {
TypedArray = wrapper(function (that, data, $offset, $length) {
anInstance(that, TypedArray, NAME);
var klass;
// `ws` module bug, temporarily remove validation length for Uint8Array
// https://github.com/websockets/ws/pull/645
if (!isObject(data)) return new Base(toIndex(data));
if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
return $length !== undefined
? new Base(data, toOffset($offset, BYTES), $length)
: $offset !== undefined
? new Base(data, toOffset($offset, BYTES))
: new Base(data);
}
if (TYPED_ARRAY in data) return fromList(TypedArray, data);
return $from.call(TypedArray, data);
});
arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
});
TypedArray[PROTOTYPE] = TypedArrayPrototype;
if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
}
var $nativeIterator = TypedArrayPrototype[ITERATOR];
var CORRECT_ITER_NAME = !!$nativeIterator
&& ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
var $iterator = $iterators.values;
hide(TypedArray, TYPED_CONSTRUCTOR, true);
hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
hide(TypedArrayPrototype, VIEW, true);
hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
dP(TypedArrayPrototype, TAG, {
get: function () { return NAME; }
});
}
O[NAME] = TypedArray;
$export($export.G + $export.W + $export.F * (TypedArray != Base), O);
$export($export.S, NAME, {
BYTES_PER_ELEMENT: BYTES
});
$export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
from: $from,
of: $of
});
if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
$export($export.P, NAME, proto);
setSpecies(NAME);
$export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
$export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
$export($export.P + $export.F * fails(function () {
new TypedArray(1).slice();
}), NAME, { slice: $slice });
$export($export.P + $export.F * (fails(function () {
return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
}) || !fails(function () {
TypedArrayPrototype.toLocaleString.call([1, 2]);
})), NAME, { toLocaleString: $toLocaleString });
Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
};
} else module.exports = function () { /* empty */ };
/***/ }),
/* 231 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(230)('Uint8', 1, function (init) {
return function Uint8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 232 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(230)('Uint8', 1, function (init) {
return function Uint8ClampedArray(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
}, true);
/***/ }),
/* 233 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(230)('Int16', 2, function (init) {
return function Int16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 234 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(230)('Uint16', 2, function (init) {
return function Uint16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 235 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(230)('Int32', 4, function (init) {
return function Int32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 236 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(230)('Uint32', 4, function (init) {
return function Uint32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 237 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(230)('Float32', 4, function (init) {
return function Float32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 238 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(230)('Float64', 8, function (init) {
return function Float64Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 239 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
var $export = __webpack_require__(8);
var aFunction = __webpack_require__(21);
var anObject = __webpack_require__(12);
var rApply = (__webpack_require__(4).Reflect || {}).apply;
var fApply = Function.apply;
// MS Edge argumentsList argument is optional
$export($export.S + $export.F * !__webpack_require__(7)(function () {
rApply(function () { /* empty */ });
}), 'Reflect', {
apply: function apply(target, thisArgument, argumentsList) {
var T = aFunction(target);
var L = anObject(argumentsList);
return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
}
});
/***/ }),
/* 240 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
var $export = __webpack_require__(8);
var create = __webpack_require__(45);
var aFunction = __webpack_require__(21);
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
var fails = __webpack_require__(7);
var bind = __webpack_require__(76);
var rConstruct = (__webpack_require__(4).Reflect || {}).construct;
// MS Edge supports only 2 arguments and argumentsList argument is optional
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
var NEW_TARGET_BUG = fails(function () {
function F() { /* empty */ }
return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
});
var ARGS_BUG = !fails(function () {
rConstruct(function () { /* empty */ });
});
$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
construct: function construct(Target, args /* , newTarget */) {
aFunction(Target);
anObject(args);
var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
if (Target == newTarget) {
// w/o altered newTarget, optimization for 0-4 arguments
switch (args.length) {
case 0: return new Target();
case 1: return new Target(args[0]);
case 2: return new Target(args[0], args[1]);
case 3: return new Target(args[0], args[1], args[2]);
case 4: return new Target(args[0], args[1], args[2], args[3]);
}
// w/o altered newTarget, lot of arguments case
var $args = [null];
$args.push.apply($args, args);
return new (bind.apply(Target, $args))();
}
// with altered newTarget, not support built-in constructors
var proto = newTarget.prototype;
var instance = create(isObject(proto) ? proto : Object.prototype);
var result = Function.apply.call(Target, instance, args);
return isObject(result) ? result : instance;
}
});
/***/ }),
/* 241 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
var dP = __webpack_require__(11);
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
var toPrimitive = __webpack_require__(16);
// MS Edge has broken Reflect.defineProperty - throwing instead of returning false
$export($export.S + $export.F * __webpack_require__(7)(function () {
// eslint-disable-next-line no-undef
Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });
}), 'Reflect', {
defineProperty: function defineProperty(target, propertyKey, attributes) {
anObject(target);
propertyKey = toPrimitive(propertyKey, true);
anObject(attributes);
try {
dP.f(target, propertyKey, attributes);
return true;
} catch (e) {
return false;
}
}
});
/***/ }),
/* 242 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.4 Reflect.deleteProperty(target, propertyKey)
var $export = __webpack_require__(8);
var gOPD = __webpack_require__(50).f;
var anObject = __webpack_require__(12);
$export($export.S, 'Reflect', {
deleteProperty: function deleteProperty(target, propertyKey) {
var desc = gOPD(anObject(target), propertyKey);
return desc && !desc.configurable ? false : delete target[propertyKey];
}
});
/***/ }),
/* 243 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 26.1.5 Reflect.enumerate(target)
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
var Enumerate = function (iterated) {
this._t = anObject(iterated); // target
this._i = 0; // next index
var keys = this._k = []; // keys
var key;
for (key in iterated) keys.push(key);
};
__webpack_require__(130)(Enumerate, 'Object', function () {
var that = this;
var keys = that._k;
var key;
do {
if (that._i >= keys.length) return { value: undefined, done: true };
} while (!((key = keys[that._i++]) in that._t));
return { value: key, done: false };
});
$export($export.S, 'Reflect', {
enumerate: function enumerate(target) {
return new Enumerate(target);
}
});
/***/ }),
/* 244 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.6 Reflect.get(target, propertyKey [, receiver])
var gOPD = __webpack_require__(50);
var getPrototypeOf = __webpack_require__(58);
var has = __webpack_require__(5);
var $export = __webpack_require__(8);
var isObject = __webpack_require__(13);
var anObject = __webpack_require__(12);
function get(target, propertyKey /* , receiver */) {
var receiver = arguments.length < 3 ? target : arguments[2];
var desc, proto;
if (anObject(target) === receiver) return target[propertyKey];
if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
? desc.value
: desc.get !== undefined
? desc.get.call(receiver)
: undefined;
if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
}
$export($export.S, 'Reflect', { get: get });
/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
var gOPD = __webpack_require__(50);
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
$export($export.S, 'Reflect', {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
return gOPD.f(anObject(target), propertyKey);
}
});
/***/ }),
/* 246 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.8 Reflect.getPrototypeOf(target)
var $export = __webpack_require__(8);
var getProto = __webpack_require__(58);
var anObject = __webpack_require__(12);
$export($export.S, 'Reflect', {
getPrototypeOf: function getPrototypeOf(target) {
return getProto(anObject(target));
}
});
/***/ }),
/* 247 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.9 Reflect.has(target, propertyKey)
var $export = __webpack_require__(8);
$export($export.S, 'Reflect', {
has: function has(target, propertyKey) {
return propertyKey in target;
}
});
/***/ }),
/* 248 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.10 Reflect.isExtensible(target)
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
var $isExtensible = Object.isExtensible;
$export($export.S, 'Reflect', {
isExtensible: function isExtensible(target) {
anObject(target);
return $isExtensible ? $isExtensible(target) : true;
}
});
/***/ }),
/* 249 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.11 Reflect.ownKeys(target)
var $export = __webpack_require__(8);
$export($export.S, 'Reflect', { ownKeys: __webpack_require__(250) });
/***/ }),
/* 250 */
/***/ (function(module, exports, __webpack_require__) {
// all object keys, includes non-enumerable and symbols
var gOPN = __webpack_require__(49);
var gOPS = __webpack_require__(42);
var anObject = __webpack_require__(12);
var Reflect = __webpack_require__(4).Reflect;
module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
var keys = gOPN.f(anObject(it));
var getSymbols = gOPS.f;
return getSymbols ? keys.concat(getSymbols(it)) : keys;
};
/***/ }),
/* 251 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.12 Reflect.preventExtensions(target)
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
var $preventExtensions = Object.preventExtensions;
$export($export.S, 'Reflect', {
preventExtensions: function preventExtensions(target) {
anObject(target);
try {
if ($preventExtensions) $preventExtensions(target);
return true;
} catch (e) {
return false;
}
}
});
/***/ }),
/* 252 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
var dP = __webpack_require__(11);
var gOPD = __webpack_require__(50);
var getPrototypeOf = __webpack_require__(58);
var has = __webpack_require__(5);
var $export = __webpack_require__(8);
var createDesc = __webpack_require__(17);
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
function set(target, propertyKey, V /* , receiver */) {
var receiver = arguments.length < 4 ? target : arguments[3];
var ownDesc = gOPD.f(anObject(target), propertyKey);
var existingDescriptor, proto;
if (!ownDesc) {
if (isObject(proto = getPrototypeOf(target))) {
return set(proto, propertyKey, V, receiver);
}
ownDesc = createDesc(0);
}
if (has(ownDesc, 'value')) {
if (ownDesc.writable === false || !isObject(receiver)) return false;
if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
existingDescriptor.value = V;
dP.f(receiver, propertyKey, existingDescriptor);
} else dP.f(receiver, propertyKey, createDesc(0, V));
return true;
}
return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
}
$export($export.S, 'Reflect', { set: set });
/***/ }),
/* 253 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.14 Reflect.setPrototypeOf(target, proto)
var $export = __webpack_require__(8);
var setProto = __webpack_require__(72);
if (setProto) $export($export.S, 'Reflect', {
setPrototypeOf: function setPrototypeOf(target, proto) {
setProto.check(target, proto);
try {
setProto.set(target, proto);
return true;
} catch (e) {
return false;
}
}
});
/***/ }),
/* 254 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/Array.prototype.includes
var $export = __webpack_require__(8);
var $includes = __webpack_require__(36)(true);
$export($export.P, 'Array', {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(187)('includes');
/***/ }),
/* 255 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
var $export = __webpack_require__(8);
var flattenIntoArray = __webpack_require__(256);
var toObject = __webpack_require__(57);
var toLength = __webpack_require__(37);
var aFunction = __webpack_require__(21);
var arraySpeciesCreate = __webpack_require__(174);
$export($export.P, 'Array', {
flatMap: function flatMap(callbackfn /* , thisArg */) {
var O = toObject(this);
var sourceLen, A;
aFunction(callbackfn);
sourceLen = toLength(O.length);
A = arraySpeciesCreate(O, 0);
flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);
return A;
}
});
__webpack_require__(187)('flatMap');
/***/ }),
/* 256 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
var isArray = __webpack_require__(44);
var isObject = __webpack_require__(13);
var toLength = __webpack_require__(37);
var ctx = __webpack_require__(20);
var IS_CONCAT_SPREADABLE = __webpack_require__(26)('isConcatSpreadable');
function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
var targetIndex = start;
var sourceIndex = 0;
var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;
var element, spreadable;
while (sourceIndex < sourceLen) {
if (sourceIndex in source) {
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
spreadable = false;
if (isObject(element)) {
spreadable = element[IS_CONCAT_SPREADABLE];
spreadable = spreadable !== undefined ? !!spreadable : isArray(element);
}
if (spreadable && depth > 0) {
targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
} else {
if (targetIndex >= 0x1fffffffffffff) throw TypeError();
target[targetIndex] = element;
}
targetIndex++;
}
sourceIndex++;
}
return targetIndex;
}
module.exports = flattenIntoArray;
/***/ }),
/* 257 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten
var $export = __webpack_require__(8);
var flattenIntoArray = __webpack_require__(256);
var toObject = __webpack_require__(57);
var toLength = __webpack_require__(37);
var toInteger = __webpack_require__(38);
var arraySpeciesCreate = __webpack_require__(174);
$export($export.P, 'Array', {
flatten: function flatten(/* depthArg = 1 */) {
var depthArg = arguments[0];
var O = toObject(this);
var sourceLen = toLength(O.length);
var A = arraySpeciesCreate(O, 0);
flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
return A;
}
});
__webpack_require__(187)('flatten');
/***/ }),
/* 258 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/mathiasbynens/String.prototype.at
var $export = __webpack_require__(8);
var $at = __webpack_require__(127)(true);
$export($export.P, 'String', {
at: function at(pos) {
return $at(this, pos);
}
});
/***/ }),
/* 259 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(8);
var $pad = __webpack_require__(260);
var userAgent = __webpack_require__(213);
// https://github.com/zloirock/core-js/issues/280
$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
padStart: function padStart(maxLength /* , fillString = ' ' */) {
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
}
});
/***/ }),
/* 260 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-string-pad-start-end
var toLength = __webpack_require__(37);
var repeat = __webpack_require__(90);
var defined = __webpack_require__(35);
module.exports = function (that, maxLength, fillString, left) {
var S = String(defined(that));
var stringLength = S.length;
var fillStr = fillString === undefined ? ' ' : String(fillString);
var intMaxLength = toLength(maxLength);
if (intMaxLength <= stringLength || fillStr == '') return S;
var fillLen = intMaxLength - stringLength;
var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
return left ? stringFiller + S : S + stringFiller;
};
/***/ }),
/* 261 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(8);
var $pad = __webpack_require__(260);
var userAgent = __webpack_require__(213);
// https://github.com/zloirock/core-js/issues/280
$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
}
});
/***/ }),
/* 262 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(82)('trimLeft', function ($trim) {
return function trimLeft() {
return $trim(this, 1);
};
}, 'trimStart');
/***/ }),
/* 263 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(82)('trimRight', function ($trim) {
return function trimRight() {
return $trim(this, 2);
};
}, 'trimEnd');
/***/ }),
/* 264 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/String.prototype.matchAll/
var $export = __webpack_require__(8);
var defined = __webpack_require__(35);
var toLength = __webpack_require__(37);
var isRegExp = __webpack_require__(134);
var getFlags = __webpack_require__(197);
var RegExpProto = RegExp.prototype;
var $RegExpStringIterator = function (regexp, string) {
this._r = regexp;
this._s = string;
};
__webpack_require__(130)($RegExpStringIterator, 'RegExp String', function next() {
var match = this._r.exec(this._s);
return { value: match, done: match === null };
});
$export($export.P, 'String', {
matchAll: function matchAll(regexp) {
defined(this);
if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');
var S = String(this);
var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);
var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
rx.lastIndex = toLength(regexp.lastIndex);
return new $RegExpStringIterator(rx, S);
}
});
/***/ }),
/* 265 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(28)('asyncIterator');
/***/ }),
/* 266 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(28)('observable');
/***/ }),
/* 267 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-getownpropertydescriptors
var $export = __webpack_require__(8);
var ownKeys = __webpack_require__(250);
var toIObject = __webpack_require__(32);
var gOPD = __webpack_require__(50);
var createProperty = __webpack_require__(164);
$export($export.S, 'Object', {
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
var O = toIObject(object);
var getDesc = gOPD.f;
var keys = ownKeys(O);
var result = {};
var i = 0;
var key, desc;
while (keys.length > i) {
desc = getDesc(O, key = keys[i++]);
if (desc !== undefined) createProperty(result, key, desc);
}
return result;
}
});
/***/ }),
/* 268 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(8);
var $values = __webpack_require__(269)(false);
$export($export.S, 'Object', {
values: function values(it) {
return $values(it);
}
});
/***/ }),
/* 269 */
/***/ (function(module, exports, __webpack_require__) {
var getKeys = __webpack_require__(30);
var toIObject = __webpack_require__(32);
var isEnum = __webpack_require__(43).f;
module.exports = function (isEntries) {
return function (it) {
var O = toIObject(it);
var keys = getKeys(O);
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) if (isEnum.call(O, key = keys[i++])) {
result.push(isEntries ? [key, O[key]] : O[key]);
} return result;
};
};
/***/ }),
/* 270 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(8);
var $entries = __webpack_require__(269)(true);
$export($export.S, 'Object', {
entries: function entries(it) {
return $entries(it);
}
});
/***/ }),
/* 271 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(57);
var aFunction = __webpack_require__(21);
var $defineProperty = __webpack_require__(11);
// B.2.2.2 Object.prototype.__defineGetter__(P, getter)
__webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
__defineGetter__: function __defineGetter__(P, getter) {
$defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });
}
});
/***/ }),
/* 272 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// Forced replacement prototype accessors methods
module.exports = __webpack_require__(24) || !__webpack_require__(7)(function () {
var K = Math.random();
// In FF throws only define methods
// eslint-disable-next-line no-undef, no-useless-call
__defineSetter__.call(null, K, function () { /* empty */ });
delete __webpack_require__(4)[K];
});
/***/ }),
/* 273 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(57);
var aFunction = __webpack_require__(21);
var $defineProperty = __webpack_require__(11);
// B.2.2.3 Object.prototype.__defineSetter__(P, setter)
__webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
__defineSetter__: function __defineSetter__(P, setter) {
$defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });
}
});
/***/ }),
/* 274 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(57);
var toPrimitive = __webpack_require__(16);
var getPrototypeOf = __webpack_require__(58);
var getOwnPropertyDescriptor = __webpack_require__(50).f;
// B.2.2.4 Object.prototype.__lookupGetter__(P)
__webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
__lookupGetter__: function __lookupGetter__(P) {
var O = toObject(this);
var K = toPrimitive(P, true);
var D;
do {
if (D = getOwnPropertyDescriptor(O, K)) return D.get;
} while (O = getPrototypeOf(O));
}
});
/***/ }),
/* 275 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(57);
var toPrimitive = __webpack_require__(16);
var getPrototypeOf = __webpack_require__(58);
var getOwnPropertyDescriptor = __webpack_require__(50).f;
// B.2.2.5 Object.prototype.__lookupSetter__(P)
__webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
__lookupSetter__: function __lookupSetter__(P) {
var O = toObject(this);
var K = toPrimitive(P, true);
var D;
do {
if (D = getOwnPropertyDescriptor(O, K)) return D.set;
} while (O = getPrototypeOf(O));
}
});
/***/ }),
/* 276 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var $export = __webpack_require__(8);
$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(277)('Map') });
/***/ }),
/* 277 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var classof = __webpack_require__(74);
var from = __webpack_require__(278);
module.exports = function (NAME) {
return function toJSON() {
if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
return from(this);
};
};
/***/ }),
/* 278 */
/***/ (function(module, exports, __webpack_require__) {
var forOf = __webpack_require__(207);
module.exports = function (iter, ITERATOR) {
var result = [];
forOf(iter, false, result.push, result, ITERATOR);
return result;
};
/***/ }),
/* 279 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var $export = __webpack_require__(8);
$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(277)('Set') });
/***/ }),
/* 280 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
__webpack_require__(281)('Map');
/***/ }),
/* 281 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-setmap-offrom/
var $export = __webpack_require__(8);
module.exports = function (COLLECTION) {
$export($export.S, COLLECTION, { of: function of() {
var length = arguments.length;
var A = new Array(length);
while (length--) A[length] = arguments[length];
return new this(A);
} });
};
/***/ }),
/* 282 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
__webpack_require__(281)('Set');
/***/ }),
/* 283 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of
__webpack_require__(281)('WeakMap');
/***/ }),
/* 284 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of
__webpack_require__(281)('WeakSet');
/***/ }),
/* 285 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
__webpack_require__(286)('Map');
/***/ }),
/* 286 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-setmap-offrom/
var $export = __webpack_require__(8);
var aFunction = __webpack_require__(21);
var ctx = __webpack_require__(20);
var forOf = __webpack_require__(207);
module.exports = function (COLLECTION) {
$export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
var mapFn = arguments[1];
var mapping, A, n, cb;
aFunction(this);
mapping = mapFn !== undefined;
if (mapping) aFunction(mapFn);
if (source == undefined) return new this();
A = [];
if (mapping) {
n = 0;
cb = ctx(mapFn, arguments[2], 2);
forOf(source, false, function (nextItem) {
A.push(cb(nextItem, n++));
});
} else {
forOf(source, false, A.push, A);
}
return new this(A);
} });
};
/***/ }),
/* 287 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
__webpack_require__(286)('Set');
/***/ }),
/* 288 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from
__webpack_require__(286)('WeakMap');
/***/ }),
/* 289 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from
__webpack_require__(286)('WeakSet');
/***/ }),
/* 290 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-global
var $export = __webpack_require__(8);
$export($export.G, { global: __webpack_require__(4) });
/***/ }),
/* 291 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-global
var $export = __webpack_require__(8);
$export($export.S, 'System', { global: __webpack_require__(4) });
/***/ }),
/* 292 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/ljharb/proposal-is-error
var $export = __webpack_require__(8);
var cof = __webpack_require__(34);
$export($export.S, 'Error', {
isError: function isError(it) {
return cof(it) === 'Error';
}
});
/***/ }),
/* 293 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
clamp: function clamp(x, lower, upper) {
return Math.min(upper, Math.max(lower, x));
}
});
/***/ }),
/* 294 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });
/***/ }),
/* 295 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
var RAD_PER_DEG = 180 / Math.PI;
$export($export.S, 'Math', {
degrees: function degrees(radians) {
return radians * RAD_PER_DEG;
}
});
/***/ }),
/* 296 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
var scale = __webpack_require__(297);
var fround = __webpack_require__(113);
$export($export.S, 'Math', {
fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {
return fround(scale(x, inLow, inHigh, outLow, outHigh));
}
});
/***/ }),
/* 297 */
/***/ (function(module, exports) {
// https://rwaldron.github.io/proposal-math-extensions/
module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
if (
arguments.length === 0
// eslint-disable-next-line no-self-compare
|| x != x
// eslint-disable-next-line no-self-compare
|| inLow != inLow
// eslint-disable-next-line no-self-compare
|| inHigh != inHigh
// eslint-disable-next-line no-self-compare
|| outLow != outLow
// eslint-disable-next-line no-self-compare
|| outHigh != outHigh
) return NaN;
if (x === Infinity || x === -Infinity) return x;
return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
};
/***/ }),
/* 298 */
/***/ (function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
iaddh: function iaddh(x0, x1, y0, y1) {
var $x0 = x0 >>> 0;
var $x1 = x1 >>> 0;
var $y0 = y0 >>> 0;
return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
}
});
/***/ }),
/* 299 */
/***/ (function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
isubh: function isubh(x0, x1, y0, y1) {
var $x0 = x0 >>> 0;
var $x1 = x1 >>> 0;
var $y0 = y0 >>> 0;
return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
}
});
/***/ }),
/* 300 */
/***/ (function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
imulh: function imulh(u, v) {
var UINT16 = 0xffff;
var $u = +u;
var $v = +v;
var u0 = $u & UINT16;
var v0 = $v & UINT16;
var u1 = $u >> 16;
var v1 = $v >> 16;
var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
}
});
/***/ }),
/* 301 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });
/***/ }),
/* 302 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
var DEG_PER_RAD = Math.PI / 180;
$export($export.S, 'Math', {
radians: function radians(degrees) {
return degrees * DEG_PER_RAD;
}
});
/***/ }),
/* 303 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
$export($export.S, 'Math', { scale: __webpack_require__(297) });
/***/ }),
/* 304 */
/***/ (function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
umulh: function umulh(u, v) {
var UINT16 = 0xffff;
var $u = +u;
var $v = +v;
var u0 = $u & UINT16;
var v0 = $v & UINT16;
var u1 = $u >>> 16;
var v1 = $v >>> 16;
var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
}
});
/***/ }),
/* 305 */
/***/ (function(module, exports, __webpack_require__) {
// http://jfbastien.github.io/papers/Math.signbit.html
var $export = __webpack_require__(8);
$export($export.S, 'Math', { signbit: function signbit(x) {
// eslint-disable-next-line no-self-compare
return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;
} });
/***/ }),
/* 306 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-promise-finally
'use strict';
var $export = __webpack_require__(8);
var core = __webpack_require__(9);
var global = __webpack_require__(4);
var speciesConstructor = __webpack_require__(208);
var promiseResolve = __webpack_require__(214);
$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
var C = speciesConstructor(this, core.Promise || global.Promise);
var isFunction = typeof onFinally == 'function';
return this.then(
isFunction ? function (x) {
return promiseResolve(C, onFinally()).then(function () { return x; });
} : onFinally,
isFunction ? function (e) {
return promiseResolve(C, onFinally()).then(function () { throw e; });
} : onFinally
);
} });
/***/ }),
/* 307 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/proposal-promise-try
var $export = __webpack_require__(8);
var newPromiseCapability = __webpack_require__(211);
var perform = __webpack_require__(212);
$export($export.S, 'Promise', { 'try': function (callbackfn) {
var promiseCapability = newPromiseCapability.f(this);
var result = perform(callbackfn);
(result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
return promiseCapability.promise;
} });
/***/ }),
/* 308 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(309);
var anObject = __webpack_require__(12);
var toMetaKey = metadata.key;
var ordinaryDefineOwnMetadata = metadata.set;
metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {
ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
} });
/***/ }),
/* 309 */
/***/ (function(module, exports, __webpack_require__) {
var Map = __webpack_require__(216);
var $export = __webpack_require__(8);
var shared = __webpack_require__(23)('metadata');
var store = shared.store || (shared.store = new (__webpack_require__(221))());
var getOrCreateMetadataMap = function (target, targetKey, create) {
var targetMetadata = store.get(target);
if (!targetMetadata) {
if (!create) return undefined;
store.set(target, targetMetadata = new Map());
}
var keyMetadata = targetMetadata.get(targetKey);
if (!keyMetadata) {
if (!create) return undefined;
targetMetadata.set(targetKey, keyMetadata = new Map());
} return keyMetadata;
};
var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
};
var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
};
var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
};
var ordinaryOwnMetadataKeys = function (target, targetKey) {
var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
var keys = [];
if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });
return keys;
};
var toMetaKey = function (it) {
return it === undefined || typeof it == 'symbol' ? it : String(it);
};
var exp = function (O) {
$export($export.S, 'Reflect', O);
};
module.exports = {
store: store,
map: getOrCreateMetadataMap,
has: ordinaryHasOwnMetadata,
get: ordinaryGetOwnMetadata,
set: ordinaryDefineOwnMetadata,
keys: ordinaryOwnMetadataKeys,
key: toMetaKey,
exp: exp
};
/***/ }),
/* 310 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(309);
var anObject = __webpack_require__(12);
var toMetaKey = metadata.key;
var getOrCreateMetadataMap = metadata.map;
var store = metadata.store;
metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {
var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);
var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;
if (metadataMap.size) return true;
var targetMetadata = store.get(target);
targetMetadata['delete'](targetKey);
return !!targetMetadata.size || store['delete'](target);
} });
/***/ }),
/* 311 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(309);
var anObject = __webpack_require__(12);
var getPrototypeOf = __webpack_require__(58);
var ordinaryHasOwnMetadata = metadata.has;
var ordinaryGetOwnMetadata = metadata.get;
var toMetaKey = metadata.key;
var ordinaryGetMetadata = function (MetadataKey, O, P) {
var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);
var parent = getPrototypeOf(O);
return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
};
metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
/***/ }),
/* 312 */
/***/ (function(module, exports, __webpack_require__) {
var Set = __webpack_require__(220);
var from = __webpack_require__(278);
var metadata = __webpack_require__(309);
var anObject = __webpack_require__(12);
var getPrototypeOf = __webpack_require__(58);
var ordinaryOwnMetadataKeys = metadata.keys;
var toMetaKey = metadata.key;
var ordinaryMetadataKeys = function (O, P) {
var oKeys = ordinaryOwnMetadataKeys(O, P);
var parent = getPrototypeOf(O);
if (parent === null) return oKeys;
var pKeys = ordinaryMetadataKeys(parent, P);
return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
};
metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
} });
/***/ }),
/* 313 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(309);
var anObject = __webpack_require__(12);
var ordinaryGetOwnMetadata = metadata.get;
var toMetaKey = metadata.key;
metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {
return ordinaryGetOwnMetadata(metadataKey, anObject(target)
, arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
/***/ }),
/* 314 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(309);
var anObject = __webpack_require__(12);
var ordinaryOwnMetadataKeys = metadata.keys;
var toMetaKey = metadata.key;
metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {
return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
} });
/***/ }),
/* 315 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(309);
var anObject = __webpack_require__(12);
var getPrototypeOf = __webpack_require__(58);
var ordinaryHasOwnMetadata = metadata.has;
var toMetaKey = metadata.key;
var ordinaryHasMetadata = function (MetadataKey, O, P) {
var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
if (hasOwn) return true;
var parent = getPrototypeOf(O);
return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
};
metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {
return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
/***/ }),
/* 316 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(309);
var anObject = __webpack_require__(12);
var ordinaryHasOwnMetadata = metadata.has;
var toMetaKey = metadata.key;
metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {
return ordinaryHasOwnMetadata(metadataKey, anObject(target)
, arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
/***/ }),
/* 317 */
/***/ (function(module, exports, __webpack_require__) {
var $metadata = __webpack_require__(309);
var anObject = __webpack_require__(12);
var aFunction = __webpack_require__(21);
var toMetaKey = $metadata.key;
var ordinaryDefineOwnMetadata = $metadata.set;
$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
return function decorator(target, targetKey) {
ordinaryDefineOwnMetadata(
metadataKey, metadataValue,
(targetKey !== undefined ? anObject : aFunction)(target),
toMetaKey(targetKey)
);
};
} });
/***/ }),
/* 318 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
var $export = __webpack_require__(8);
var microtask = __webpack_require__(210)();
var process = __webpack_require__(4).process;
var isNode = __webpack_require__(34)(process) == 'process';
$export($export.G, {
asap: function asap(fn) {
var domain = isNode && process.domain;
microtask(domain ? domain.bind(fn) : fn);
}
});
/***/ }),
/* 319 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/zenparsing/es-observable
var $export = __webpack_require__(8);
var global = __webpack_require__(4);
var core = __webpack_require__(9);
var microtask = __webpack_require__(210)();
var OBSERVABLE = __webpack_require__(26)('observable');
var aFunction = __webpack_require__(21);
var anObject = __webpack_require__(12);
var anInstance = __webpack_require__(206);
var redefineAll = __webpack_require__(215);
var hide = __webpack_require__(10);
var forOf = __webpack_require__(207);
var RETURN = forOf.RETURN;
var getMethod = function (fn) {
return fn == null ? undefined : aFunction(fn);
};
var cleanupSubscription = function (subscription) {
var cleanup = subscription._c;
if (cleanup) {
subscription._c = undefined;
cleanup();
}
};
var subscriptionClosed = function (subscription) {
return subscription._o === undefined;
};
var closeSubscription = function (subscription) {
if (!subscriptionClosed(subscription)) {
subscription._o = undefined;
cleanupSubscription(subscription);
}
};
var Subscription = function (observer, subscriber) {
anObject(observer);
this._c = undefined;
this._o = observer;
observer = new SubscriptionObserver(this);
try {
var cleanup = subscriber(observer);
var subscription = cleanup;
if (cleanup != null) {
if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };
else aFunction(cleanup);
this._c = cleanup;
}
} catch (e) {
observer.error(e);
return;
} if (subscriptionClosed(this)) cleanupSubscription(this);
};
Subscription.prototype = redefineAll({}, {
unsubscribe: function unsubscribe() { closeSubscription(this); }
});
var SubscriptionObserver = function (subscription) {
this._s = subscription;
};
SubscriptionObserver.prototype = redefineAll({}, {
next: function next(value) {
var subscription = this._s;
if (!subscriptionClosed(subscription)) {
var observer = subscription._o;
try {
var m = getMethod(observer.next);
if (m) return m.call(observer, value);
} catch (e) {
try {
closeSubscription(subscription);
} finally {
throw e;
}
}
}
},
error: function error(value) {
var subscription = this._s;
if (subscriptionClosed(subscription)) throw value;
var observer = subscription._o;
subscription._o = undefined;
try {
var m = getMethod(observer.error);
if (!m) throw value;
value = m.call(observer, value);
} catch (e) {
try {
cleanupSubscription(subscription);
} finally {
throw e;
}
} cleanupSubscription(subscription);
return value;
},
complete: function complete(value) {
var subscription = this._s;
if (!subscriptionClosed(subscription)) {
var observer = subscription._o;
subscription._o = undefined;
try {
var m = getMethod(observer.complete);
value = m ? m.call(observer, value) : undefined;
} catch (e) {
try {
cleanupSubscription(subscription);
} finally {
throw e;
}
} cleanupSubscription(subscription);
return value;
}
}
});
var $Observable = function Observable(subscriber) {
anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
};
redefineAll($Observable.prototype, {
subscribe: function subscribe(observer) {
return new Subscription(observer, this._f);
},
forEach: function forEach(fn) {
var that = this;
return new (core.Promise || global.Promise)(function (resolve, reject) {
aFunction(fn);
var subscription = that.subscribe({
next: function (value) {
try {
return fn(value);
} catch (e) {
reject(e);
subscription.unsubscribe();
}
},
error: reject,
complete: resolve
});
});
}
});
redefineAll($Observable, {
from: function from(x) {
var C = typeof this === 'function' ? this : $Observable;
var method = getMethod(anObject(x)[OBSERVABLE]);
if (method) {
var observable = anObject(method.call(x));
return observable.constructor === C ? observable : new C(function (observer) {
return observable.subscribe(observer);
});
}
return new C(function (observer) {
var done = false;
microtask(function () {
if (!done) {
try {
if (forOf(x, false, function (it) {
observer.next(it);
if (done) return RETURN;
}) === RETURN) return;
} catch (e) {
if (done) throw e;
observer.error(e);
return;
} observer.complete();
}
});
return function () { done = true; };
});
},
of: function of() {
for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];
return new (typeof this === 'function' ? this : $Observable)(function (observer) {
var done = false;
microtask(function () {
if (!done) {
for (var j = 0; j < items.length; ++j) {
observer.next(items[j]);
if (done) return;
} observer.complete();
}
});
return function () { done = true; };
});
}
});
hide($Observable.prototype, OBSERVABLE, function () { return this; });
$export($export.G, { Observable: $Observable });
__webpack_require__(193)('Observable');
/***/ }),
/* 320 */
/***/ (function(module, exports, __webpack_require__) {
// ie9- setTimeout & setInterval additional parameters fix
var global = __webpack_require__(4);
var $export = __webpack_require__(8);
var userAgent = __webpack_require__(213);
var slice = [].slice;
var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
var wrap = function (set) {
return function (fn, time /* , ...args */) {
var boundArgs = arguments.length > 2;
var args = boundArgs ? slice.call(arguments, 2) : false;
return set(boundArgs ? function () {
// eslint-disable-next-line no-new-func
(typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
} : fn, time);
};
};
$export($export.G + $export.B + $export.F * MSIE, {
setTimeout: wrap(global.setTimeout),
setInterval: wrap(global.setInterval)
});
/***/ }),
/* 321 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $task = __webpack_require__(209);
$export($export.G + $export.B, {
setImmediate: $task.set,
clearImmediate: $task.clear
});
/***/ }),
/* 322 */
/***/ (function(module, exports, __webpack_require__) {
var $iterators = __webpack_require__(194);
var getKeys = __webpack_require__(30);
var redefine = __webpack_require__(18);
var global = __webpack_require__(4);
var hide = __webpack_require__(10);
var Iterators = __webpack_require__(129);
var wks = __webpack_require__(26);
var ITERATOR = wks('iterator');
var TO_STRING_TAG = wks('toStringTag');
var ArrayValues = Iterators.Array;
var DOMIterables = {
CSSRuleList: true, // TODO: Not spec compliant, should be false.
CSSStyleDeclaration: false,
CSSValueList: false,
ClientRectList: false,
DOMRectList: false,
DOMStringList: false,
DOMTokenList: true,
DataTransferItemList: false,
FileList: false,
HTMLAllCollection: false,
HTMLCollection: false,
HTMLFormElement: false,
HTMLSelectElement: false,
MediaList: true, // TODO: Not spec compliant, should be false.
MimeTypeArray: false,
NamedNodeMap: false,
NodeList: true,
PaintRequestList: false,
Plugin: false,
PluginArray: false,
SVGLengthList: false,
SVGNumberList: false,
SVGPathSegList: false,
SVGPointList: false,
SVGStringList: false,
SVGTransformList: false,
SourceBufferList: false,
StyleSheetList: true, // TODO: Not spec compliant, should be false.
TextTrackCueList: false,
TextTrackList: false,
TouchList: false
};
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
var NAME = collections[i];
var explicit = DOMIterables[NAME];
var Collection = global[NAME];
var proto = Collection && Collection.prototype;
var key;
if (proto) {
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = ArrayValues;
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
}
}
/***/ }),
/* 323 */
/***/ (function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* https://raw.github.com/facebook/regenerator/master/LICENSE file. An
* additional grant of patent rights can be found in the PATENTS file in
* the same directory.
*/
!(function(global) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
var inModule = typeof module === "object";
var runtime = global.regeneratorRuntime;
if (runtime) {
if (inModule) {
// If regeneratorRuntime is defined globally and we're in a module,
// make the exports object identical to regeneratorRuntime.
module.exports = runtime;
}
// Don't bother evaluating the rest of this file if the runtime was
// already defined globally.
return;
}
// Define the runtime globally (as expected by generated code) as either
// module.exports (if we're in a module) or a new, empty object.
runtime = global.regeneratorRuntime = inModule ? module.exports : {};
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
runtime.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype =
Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] =
GeneratorFunction.displayName = "GeneratorFunction";
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
prototype[method] = function(arg) {
return this._invoke(method, arg);
};
});
}
runtime.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
runtime.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
runtime.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return Promise.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return Promise.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
// result for this iteration will be rejected with the same
// reason. Note that rejections of yielded Promises are not
// thrown back into the generator function, as is the case
// when an awaited Promise is rejected. This difference in
// behavior between yield and await is important, because it
// allows the consumer to decide what to do with the yielded
// rejection (swallow it and continue, manually .throw it back
// into the generator, abandon iteration, whatever). With
// await, by contrast, there is no opportunity to examine the
// rejection reason outside the generator function, so the
// only option is to throw it from the await expression, and
// let the generator function handle the exception.
result.value = unwrapped;
resolve(result);
}, reject);
}
}
if (typeof global.process === "object" && global.process.domain) {
invoke = global.process.domain.bind(invoke);
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
runtime.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
runtime.async = function(innerFn, outerFn, self, tryLocsList) {
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList)
);
return runtime.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done
? GenStateCompleted
: GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
if (delegate.iterator.return) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (! info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value;
// Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator";
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function() {
return this;
};
Gp.toString = function() {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
runtime.keys = function(object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
}
// Return an iterator with no values.
return { next: doneResult };
}
runtime.values = values;
function doneResult() {
return { value: undefined, done: true };
}
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !! caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry &&
(type === "break" ||
type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" ||
record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
}
};
})(
// Among the various tricks for obtaining a reference to the global
// object, this seems to be the most reliable technique that does not
// use indirect eval (which violates Content Security Policy).
typeof global === "object" ? global :
typeof window === "object" ? window :
typeof self === "object" ? self : this
);
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }),
/* 324 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(325);
module.exports = __webpack_require__(9).RegExp.escape;
/***/ }),
/* 325 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/benjamingr/RexExp.escape
var $export = __webpack_require__(8);
var $re = __webpack_require__(326)(/[\\^$*+?.()|[\]{}]/g, '\\$&');
$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });
/***/ }),
/* 326 */
/***/ (function(module, exports) {
module.exports = function (regExp, replace) {
var replacer = replace === Object(replace) ? function (part) {
return replace[part];
} : replace;
return function (it) {
return String(it).replace(regExp, replacer);
};
};
/***/ }),
/* 327 */
/***/ (function(module, exports) {
'use strict';
module.exports = ['dave', 'henry', 'martha'];
/***/ })
/******/ ]); | syndbg/webpack-google-cloud-storage-plugin | examples/bin/app.bundle.js | JavaScript | mit | 271,678 |
/**
* Scale Interpolation Function.
*
* @param {number} a start scale
* @param {number} b end scale
* @param {number} v progress
* @returns {string} the interpolated scale
*/
export default function scale(a, b, v) {
// eslint-disable-next-line no-bitwise
return `scale(${((a + (b - a) * v) * 1000 >> 0) / 1000})`;
}
| thednp/kute.js | src/interpolation/scale.js | JavaScript | mit | 327 |
/*
* jQuery ZenPen url/link action
*
* Copyright (c) 2013 Deux Huit Huit (http://www.deuxhuithuit.com/)
* Licensed under the MIT (http://deuxhuithuit.mit-license.org)
* Based on the work of Tim Holman (https://github.com/tholman/zenpen)
* Licensed under the Apache License (https://github.com/tholman/zenpen/blob/master/licence.md)
*/
(function ($) {
if (!$.zenpen) {
return;
}
var api = $.zenpen.api;
$.zenpen.actions.url = {
validNode: function (node) {
return !!node.closest('a').length;
},
create: function (options) {
var btn = api.createButtonFactory('url useicons', '', 'url')();
var input = $('<input />').addClass('url-input')
.attr('type','text')
.attr('placeholder','Type or Paste URL here');
var self = this;
var exit = function () {
setTimeout(function () {
self._options.opts.removeClass('url-mode');
self._options.popup.width(self._options.popup.data().width);
}, 100);
};
var realExec = function () {
var url = input.val();
api.rehighlightLastSelection(self._options.range);
// Unlink any current links
document.execCommand( 'unlink', false );
if (!!url) {
// Insert HTTP if it doesn't exist.
if ( !url.match("^(http|https|ftp|ftps|sftp)://")
&& !url.match("^(mailto|tel|fax|skype|irc):")
&& !url.match("^/") ) {
url = "http://" + url;
}
document.execCommand( 'createLink', false, url );
input.val(''); // creates a blur
self._options.popup.trigger('update');
}
};
input.keyup(function (e) {
if (e.which === 13) {
realExec();
} else if (e.which === 27) {
exit();
}
});
input.blur(exit);
return btn.add(input);
},
exec: function ( btn, popup, lastSelection, options ) {
var opts = popup.find('.zenpen-options');
if (!opts.hasClass('url-mode')) {
var width = popup.width();
opts.addClass('url-mode');
var newWidth = /*popup.find('input.url-input').width()*/245 + btn.width();
popup.width(newWidth);
// save options
if (!!lastSelection && !lastSelection.isCollapsed) {
this._options = {
btn: btn,
popup: popup,
opts: opts,
range: lastSelection.getRangeAt(0)
};
popup.data('width', width);
popup.find('input.url-input').val($(lastSelection.focusNode).closest('a').attr('href'));
}
setTimeout(function () {
popup.find('input.url-input').focus();
}, 50);
}
}
};
})(jQuery); | DeuxHuitHuit/jQuery-zenpen | src/js/jquery.zenpen.url.js | JavaScript | mit | 2,580 |
'use strict';
var assert = require('assert');
var fs = require('fs');
var path = require('path');
describe('responsive-compass-sprite', function() {
describe('icon-sprite', function() {
function compare(expected, tmp, done) {
var baseExpected = __dirname + '/expected/icon-sprite',
baseTmp = __dirname + '/tmp/icon-sprite';
if(typeof tmp === 'function') {
done = tmp;
tmp = expected;
}
assert.equal(fs.readFileSync(baseExpected + '/' + expected, 'utf-8'), fs.readFileSync(baseTmp + '/' + tmp, 'utf-8'));
done();
};
it('simple test', function(done) {
compare('simple.css', done);
});
it('renderAll test', function(done) {
compare('renderAllSprites.css', done);
});
});
});
| git-patrickliu/responsive-compass-sprite | test/main.js | JavaScript | mit | 867 |
//~ name a744
alert(a744);
//~ component a745.js
| homobel/makebird-node | test/projects/large/a744.js | JavaScript | mit | 52 |
'use strict';
var Q = require('q')
, _ = require('underscore');
exports.defaults = function () { return { storage: {} }; };
exports.mixin = {
/**
* Converts `arguments` to a key to be stored.
*/
toKey: function () {
return _.toArray(arguments);
},
contains: function () {
return this.containsKey(this.toKey.apply(this, _.toArray(arguments)));
},
containsKey: function (key) {
return Q.when(_.has(this.storage, key));
},
del: function () {
var args = _.toArray(arguments)
, key = this.toKey.apply(this, arguments);
if (!this.containsKey(key)) return Q.when(false);
this.emit.apply(this, [ 'del' ].concat(args));
delete this.storage[key];
return Q.when(true);
},
set: function (key, val) {
this.storage[key] = val;
return Q.when(true);
},
get: function (key) {
return Q.when(this.storage[key]);
}
};
| filipovskii/bolter | lib/bolter-memory.js | JavaScript | mit | 894 |
capstone.controller("RegisterCtrl", function($scope,$http,AuthFactory,$location,user1){
// $(".button-collapse").sideNav();
$http.get(`states.json`)
.then((data)=>{
$scope.stateName = data.data
console.log($scope.stateName)
$('input.autocomplete').autocomplete({
data: $scope.stateName,
limit: 10 // The max amount of results that can be shown at once. Default: Infinity.
});
})
$scope.date = new Date();
let storageRef = firebase.storage().ref();
let inputElement = document.getElementById("fileInput");
inputElement.addEventListener("change", handleFiles, false)
function handleFiles() {
var fileList = this.files; /* now you can work with the file list */
console.log("filelist[0]", fileList[0])
storageRef.child(fileList[0].name).put(fileList[0])
.then(function(snapshot) {
console.log('Uploaded a blob or file!');
storageRef.child(fileList[0].name).getDownloadURL()
.then((url)=>{
var img =document.getElementById("myImg")
img.src = url;
$scope.img = img.src;
})
.catch((error)=>{
alert("error")
})
});
}
$scope.register = () => {
if($scope.user_email === $scope.user_confirmEmail){
AuthFactory.getter($scope.user_email,$scope.user_password)
.then ((data)=> {
console.log(data)
$scope.UID = data
// $http.post(`https://frontendcapstone.firebaseio.com/users/.json`,{
// uid: $scope.UID
// })
$http.post(`https://frontendcapstone.firebaseio.com/users/${$scope.UID}.json`,{
uid: $scope.UID,
Firstname: $scope.firstName,
Lastname: $scope.lastName,
email: $scope.user_email,
password: $scope.user_password,
DOB: $scope.user_dob,
imageUrl : $scope.img,
Address: {Address1: $scope.user_addressLine1,
Address2: $scope.user_addressLine2,
City: $scope.user_city,
state: $scope.user_state,
zipcode: $scope.user_zipcode}
})
Materialize.toast("registered successfully", 2000)
$location.path(`/`)
})
}
else {
Materialize.toast("Emails have to match", 1000)
$("input[type='email']").focus()
}
}
})
| priyakamesh/frontendcapstone-priya | app/controller/registerCtrl.js | JavaScript | mit | 2,390 |
// # Ghost Configuration
// Setup your Ghost install for various environments
// Documentation can be found at http://support.ghost.org/config/
var path = require('path'),
config;
config = {
// ### Production
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://my-ghost-blog.com',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost.db')
},
debug: false
},
// 配置MySQL 数据库
/*database: {
client: 'mysql',
connection: {
host : 'host',
user : 'user',
password : 'password',
database : 'database',
charset : 'utf8'
},
debug: false
},*/
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
},
//Storage.Now,we can support `qiniu`,`upyun`, `aliyun oss`, `aliyun ace-storage` and `local-file-store`
storage: {
provider: 'local-file-store'
}
// or
// 参考文档: http://www.ghostchina.com/qiniu-cdn-for-ghost/
/*storage: {
provider: 'qiniu',
bucketname: 'your-bucket-name',
ACCESS_KEY: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
SECRET_KEY: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
root: '/image/',
prefix: 'http://your-bucket-name.qiniudn.com'
}*/
// or
// 参考文档: http://www.ghostchina.com/upyun-cdn-for-ghost/
/*storage: {
provider: 'upyun',
bucketname: 'your-bucket-name',
username: 'your user name',
password: 'your password',
root: '/image/',
prefix: 'http://your-bucket-name.b0.upaiyun.com'
}*/
// or
// 参考文档: http://www.ghostchina.com/aliyun-oss-for-ghost/
/*storage: {
provider: 'oss',
bucketname: 'your-bucket-name',
ACCESS_KEY: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
SECRET_KEY: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
root: '/image/',
prefix: 'http://your-bucket-name.oss-cn-hangzhou.aliyuncs.com'
}*/
// or
// 参考文档: http://www.ghostchina.com/install-ghost-on-aliyun-ace/
/*storage: {
provider: 'ace-storage',
bucketname: 'your-bucket-name'
}*/
},
// ### Development **(default)**
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
// Change this to your Ghost blogs published URL.
url: 'http://localhost:2368',
// Example mail config
// Visit http://support.ghost.org/mail for instructions
// ```
// mail: {
// transport: 'SMTP',
// options: {
// service: 'Mailgun',
// auth: {
// user: '', // mailgun username
// pass: '' // mailgun password
// }
// }
// },
// ```
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-dev.db')
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
},
paths: {
contentPath: path.join(__dirname, '/content/')
}
},
// **Developers only need to edit below here**
// ### Testing
// Used when developing Ghost to run tests and check the health of Ghost
// Uses a different port number
testing: {
url: 'http://127.0.0.1:2369',
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-test.db')
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing MySQL
// Used by Travis - Automated testing run through GitHub
'testing-mysql': {
url: 'http://127.0.0.1:2369',
database: {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'root',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing pg
// Used by Travis - Automated testing run through GitHub
'testing-pg': {
url: 'http://127.0.0.1:2369',
database: {
client: 'pg',
connection: {
host : '127.0.0.1',
user : 'postgres',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
}
};
// Export config
module.exports = config;
| PHILIP-2014/philip-blog | config.example.js | JavaScript | mit | 5,939 |
(function(){
angular
.module('users')
.controller('UserController', [
'userService', '$mdSidenav', '$mdBottomSheet', '$log', '$q',
UserController
]);
/**
* Main Controller for the Angular Material Starter App
* @param $scope
* @param $mdSidenav
* @param avatarsService
* @constructor
*/
function UserController( userService, $mdSidenav, $mdBottomSheet, $log, $q) {
var self = this;
self.selected = null;
self.users = [ ];
self.selectUser = selectUser;
self.toggleList = toggleUsersList;
self.share = share;
// Load all registered users
userService
.loadAllUsers()
.then( function( users ) {
self.users = [].concat(users);
self.selected = users[0];
});
// *********************************
// Internal methods
// *********************************
/**
* First hide the bottomsheet IF visible, then
* hide or Show the 'left' sideNav area
*/
function toggleUsersList() {
var pending = $mdBottomSheet.hide() || $q.when(true);
pending.then(function(){
$mdSidenav('left').toggle();
});
}
/**
* Select the current avatars
* @param menuId
*/
function selectUser ( user ) {
self.selected = angular.isNumber(user) ? $scope.users[user] : user;
self.toggleList();
}
/**
* Show the bottom sheet
*/
function share($event) {
var user = self.selected;
$mdBottomSheet.show({
parent: angular.element(document.getElementById('content')),
templateUrl: '/src/users/view/contactSheet.html',
controller: [ '$mdBottomSheet', UserSheetController],
controllerAs: "vm",
bindToController : true,
targetEvent: $event
}).then(function(clickedItem) {
clickedItem && $log.debug( clickedItem.name + ' clicked!');
});
/**
* Bottom Sheet controller for the Avatar Actions
*/
function UserSheetController( $mdBottomSheet ) {
this.user = user;
this.items = [
{ name: 'Github' , icon: 'github' , icon_url: 'assets/svg/github.svg', urlPath: "https://github.com/hassanabidpk/"},
{ name: 'Twitter' , icon: 'twitter' , icon_url: 'assets/svg/twitter.svg', urlPath: "https://twitter.com/hassanabidpk"},
{ name: 'Google+' , icon: 'google_plus' , icon_url: 'assets/svg/google_plus.svg', urlPath: "https://plus.google.com/+HassanAbid/"},
{ name: 'Linkedin' , icon: 'linkedin' , icon_url: 'assets/svg/linkedin.svg', urlPath: "https://kr.linkedin.com/pub/hassan-abid/12/700/66b"}
];
this.performAction = function(action) {
window.location.href = action.urlPath;
$mdBottomSheet.hide(action);
};
}
}
}
})();
| hassanabidpk/portfolio | app/src/users/UserController.js | JavaScript | mit | 2,971 |
var gulp = require('gulp'),
concat = require('gulp-concat'),
compass = require('gulp-compass'),
notify = require('gulp-notify');
function swallowError(error) {
this.emit('end');
}
function reportError(error) {
notify.onError().apply(this, arguments);
this.emit('end');
}
// combine js into single file
//===========================================
gulp.task('scripts', function() {
gulp.src([
'./src/js/lib/jquery.min.js',
'./src/js/lib/cssbeautify.js',
'./src/js/lib/specificity.js',
'./src/js/lib/tablesorter.js',
'./src/js/local/helpers.js',
// './src/js/local/syntax-highlight.js',
'./src/js/local/build-html.js',
// './src/js/local/build-specificity.js',
'./src/js/local/button-control.js',
// './src/js/local/css-highlight.js',
'./src/js/local/tabs.js'
])
.pipe(concat('smprof.js'))
.pipe(gulp.dest('./ext/js/'))
});
// compass: compile sass to css
//===========================================
gulp.task('compass', function() {
gulp.src('./assets/sass/*.scss')
.pipe(compass({
config_file: './config.rb',
css: './ext/css/',
sass: './assets/sass'
}))
.on('error', reportError);
});
// watch: monitor html and static assets updates
//===========================================
gulp.task('watch', function() {
// watch task for sass
gulp.watch('./assets/sass/**/*.scss', ['compass']);
gulp.watch('./src/js/**/*.js', ['scripts']);
});
// Default Gulp Task
//===========================================
gulp.task('default', ['compass', 'scripts', 'watch']); | jalvarado91/searchMyProf | gulpfile.js | JavaScript | mit | 1,611 |
module.exports = require( "./src/LRUCache" ); | eventEmitter/ee-lru-cache | index.js | JavaScript | mit | 49 |
'use strict';
angular.module('sportzCast')
.controller('FooterCtrl', function ($scope) {
$('#footer').hide();
$(function () {
$(window).scroll(function () {
// set distance user needs to scroll before we start fadeIn
if ($(this).scrollTop() > 500) {
$('.navbar').fadeIn();
} else {
$('.navbar').fadeOut();
}
});
});
}); | AriGonzo/SportzCast | src/components/footer/footerController.js | JavaScript | mit | 439 |
/**
* Usuario Controller Test Suite
*
* @author Thiago Paes <mrprompt@gmail.com>
* @license MIT
*/
'use strict';
var connection = require('../test');
var Usuario = require('../../src/controllers/UsuarioController');
var sinon = require('sinon');
var assert = require('assert');
var request = require('request');
var response = {
content: null,
statusCode: 0,
json: function(content){
this.content = content;
return this;
},
status: function(status) {
this.statusCode = status;
return this;
}
};
describe('Usuario Controller', function () {
it('#lista() deve retornar um array', function (done) {
request.headers = {};
request.params = { };
request.query = {
page : 1,
limit: 1
};
Usuario.lista(request, response, function() {
assert.equal(response.content.object, 'list');
done();
});
});
it('#abre() deve retornar um objeto', function (done) {
request.headers = { };
request.params = {
id: 1
};
request.query = {
page : 1,
limit: 1
};
Usuario.abre(request, response, function() {
assert.equal(response.content.object, 'error');
assert.equal(response.statusCode, 404);
done();
});
});
it('#adiciona() deve retornar um objeto', function (done) {
request.headers = { };
request.body = {
nome : 'Foo Bar',
email : 'foo@bar.bar',
password: 'foo',
uf : 'AA',
estado : 'aaa aaa',
cidade : 'bbb bbb bb'
};
Usuario.adiciona(request, response, function() {
assert.equal(response.content.object, 'error');
done();
});
});
it('#atualiza() deve retornar um objeto', function (done) {
request.headers = { };
request.params = {
id: 1
};
request.query = {
page : 1,
limit: 1
};
Usuario.atualiza(request, response, function() {
assert.equal(response.content.object, 'error');
done();
});
});
it('#apaga() deve retornar um objeto', function (done) {
request.headers = { };
request.params = {
id: 1
};
request.query = {
page : 1,
limit: 1
};
Usuario.apaga(request, response, function() {
assert.equal(response.content.object, 'error');
done();
});
});
}); | mrprompt/expressjs-api-skel | test/controllers/UsuarioControllerTest.js | JavaScript | mit | 2,672 |
define([
], function () {
'use strict';
return function (req, res, next) {
function filterParams(req, action) {
var paramsWhitelist = action.params,
whitelistParam,
paramValue,
type,
filteredParams = {};
// check all actions params
for (whitelistParam in paramsWhitelist) {
if (paramsWhitelist.hasOwnProperty(whitelistParam)) {
type = '';
// get param from body or query
if (paramsWhitelist[whitelistParam].query === true) {
paramValue = req.query[whitelistParam];
} else {
paramValue = req.body[whitelistParam];
}
// if defined or not optional -> validate
if (paramValue !== undefined || !paramsWhitelist[whitelistParam].optional) {
// validate missing params
if (paramValue === undefined && !paramsWhitelist[whitelistParam].optional) { // necessary param missing
type = 'missing_parameter';
} else if (paramValue && paramValue.constructor !== paramsWhitelist[whitelistParam].type) { // validate param type
type = 'wrong_type';
} else if (paramsWhitelist[whitelistParam].hasOwnProperty('regex') && !paramsWhitelist[whitelistParam].regex.test(paramValue)) {
type = 'invalid_structure'; // validate param for custom regex
} else if (paramsWhitelist[whitelistParam].hasOwnProperty('validate') && !paramsWhitelist[whitelistParam].validate(paramValue)) {
type = 'custom_validation'; // validate param for custom validate function
}
// if error type is set -> throw error
if (type) {
throw {
error: type,
param: whitelistParam
};
}
// set validated param
filteredParams[whitelistParam] = paramValue;
}
}
}
return filteredParams;
}
if (req.customData && req.customData.action) {
try {
req.customData.params = filterParams(req, req.customData.action);
} catch (e) {
return res.status(400).send(e);
}
}
next();
};
});
| KillerCodeMonkey/handmade | middleware/validation.js | JavaScript | mit | 2,697 |
var gulp = require('gulp'),
webserver = require('gulp-webserver'),
htmlreplace = require('gulp-html-replace');
//gulp.task('default', function() {
// gulp.run('watcher', 'webserver');
//});
gulp.task('webserver', function() {
gulp.src('build')
.pipe(webserver({
livereload: true
}));
});
gulp.task('watcher', function() {
gulp.watch('app/**', function (event) {
gulp.run('copy');
});
});
gulp.task('copy', function(){
gulp.src('app/index.html')
.pipe(htmlreplace({
'css': 'css/styles.css',
'js' : 'js/main.js',
'jslib': 'js/lib/jquery.js'
}))
.pipe(gulp.dest('build/'));
gulp.src('app/index.html')
.pipe(htmlreplace({
'css': 'app/css/styles.css',
'jslib' : 'bower_components/jQuery/dist/jquery.js',
'js' : 'app/js/main.js'
}))
.pipe(gulp.dest(''));
gulp.src('bower_components/jQuery/dist/jquery.js')
.pipe(gulp.dest('build/js/lib/'));
gulp.src('app/js/main.js')
.pipe(gulp.dest('build/js/'));
gulp.src('app/css/styles.css')
.pipe(gulp.dest('build/css/'));
gulp.src('app/structure.json')
.pipe(gulp.dest('build/'));
gulp.src('app/tasks/**')
.pipe(gulp.dest('build/tasks'));
}); | julia-reutskaya/julia.reutskaya.tasks.github.com | gulpfile.js | JavaScript | mit | 1,333 |
/**
* Created by siddharthsharma on 5/21/16.
*/
var React = require('react');
var Contact = require('./contact/app-catalog');
var Cart = require('./cart/app-cart');
var Router = require('react-router-component');
var CatalogDetail = require('./product/app-catalogdetail');
var Template = require('./app-template.js');
var Locations = Router.Locations;
var Location = Router.Location;
var App = React.createClass({
render:function(){
return (
<Template>
<Locations>
<Location path="/" handler={Catalog} />
<Location path="/cart" handler={Cart} />
<Location path="/item/:item" handler={CatalogDetail} />
</Locations>
</Template>
);
}
});
module.exports = App;
| hearsid/react-contacts-manager | app/js/components/app.js | JavaScript | mit | 772 |
"use strict";
var gulp = require('gulp');
var clean = require('gulp-clean');
var cleanTask = function() {
return gulp.src('dist', { read: false })
.pipe(clean());
};
gulp.task('clean', cleanTask);
module.exports = cleanTask;
| troykinsella/junkie | tasks/clean.js | JavaScript | mit | 233 |
var scroller = angular.module("scroller", ["ngTouch", "angular-websql"]); | jouk0/Scroller | js/index.js | JavaScript | mit | 73 |
import { get_definition } from './../base';
export const push_link = (
oid, linkurl, linkname, onmenu='true', instance_name,
when, additional_args, description
) => get_definition({
oid,
linkurl,
linkname,
onmenu,
instance_name
},
{
label: 'VersionOne - Push Link',
method: 'push_link',
module: 'main',
name: 'v1plugin'
},
when, additional_args, description
); | walkerrandolphsmith/VersionOne.JavaScript.PipelineBuilder | src/plugins/v1/push_link.js | JavaScript | mit | 457 |
'use strict';
// Load the application's configuration
const config = require('../server/config');
const url = config.express_host + '/api';
// Required modules
const async = require('async');
const colors = require('colors');
const request = require('request');
// Counter for the Measurements
let counter = 1;
// Read the arguments from the command line or set them to the default values
const interval = process.argv[2] || 2000;
const thingName = process.argv[3] || 'Demo';
const thingLocLat = process.argv[4] || 51.964113;
const thingLocLng = process.argv[5] || 7.624862;
// REST API authentication token
let token;
console.log('\n////////////////////////////////////////////////////////////\n');
console.log(' STARTING DEMONSTRATION...'.cyan);
console.log('\n////////////////////////////////////////////////////////////\n');
async.waterfall([
// Create a new User
function(callback) {
console.log(' Creating a new', 'User...\n'.cyan);
const userJson = {
email: 'demo#' + Math.random().toFixed() + '@example.com',
password: 'demoPass'
};
// Post the new User
request.post({
headers: {'content-type': 'application/json'},
url: url + '/users',
json: userJson
}, function(error, response, body) {
if (!error) {
console.log(' New User', 'created.'.green);
token = body.token;
} else {
console.log(' New User creation', 'failed'.red);
}
console.log('\n------------------------------------------------------------\n');
callback(error, body._id);
});
},
// Create a new Thing
function(userId, callback) {
console.log(' Creating a new', 'Thing...\n'.cyan);
const thingJson = {
name: thingName,
loc: {
coordinates: [ thingLocLat, thingLocLng ]
},
userId: userId,
waterbodyId: '5752d2d7e5d703480187e0d9',
token: token
};
// Post the new Thing
request.post({
headers: {'content-type': 'application/json'},
url: url + '/things',
json: thingJson
}, function(error, response, body) {
if (!error) {
console.log(' New Thing', 'created.'.green);
} else {
console.log(' New Thing creation', 'failed'.red);
}
console.log('\n------------------------------------------------------------\n');
callback(error, body._id);
});
},
// Create a new Feature
function(thingId, callback) {
console.log(' Creating a new', 'Feature...\n'.cyan);
const featureJson = {
name: 'demoFeature',
unit: 'foo',
token: token
};
// Post the new Feature
request.post({
headers: {'content-type': 'application/json'},
url: url + '/features',
json: featureJson
}, function(error, response, body) {
if (!error) {
console.log(' New Feature', 'created'.green);
} else {
console.log(' New Feature creation', 'failed'.red);
}
console.log('\n------------------------------------------------------------\n');
callback(error, thingId, body._id);
});
},
// Create a new Sensor
function(thingId, featureId, callback) {
console.log(' Creating a new', 'Sensor...\n'.cyan);
const sensorJson = {
name: 'demoSensor',
interval: interval,
refLevel: 2,
warnLevel: 6,
riskLevel: 8,
thingId: thingId,
featureId: featureId,
token: token
};
// Post the new Sensor
request.post({
headers: {'content-type': 'application/json'},
url: url + '/sensors',
json: sensorJson
}, function(error, response, body) {
if (!error) {
console.log(' New Sensor', 'created.'.green);
} else {
console.log(' New Sensor creation', 'failed'.red);
}
console.log('\n------------------------------------------------------------\n');
callback(error, body._id);
});
},
// Create new Measurements in an interval
function(sensorId, callback) {
console.log(' Finished demo setup. Measuring now...'.cyan);
console.log('\n------------------------------------------------------------\n');
let value = 4;
setInterval(function() {
console.log(' Creating a new', 'Measurement...\n'.cyan);
// Calculate the Measurement's value as a random number with respect to its previous value
if (value < 1 || Math.random() > 0.5) {
value += Math.random();
} else {
value -= Math.random();
}
value = parseFloat(value.toFixed(2));
let measurementJson = {
date: Date.now(),
value: value,
sensorId: sensorId,
token: token
};
// Post the new Measurement
request.post({
headers: {'content-type': 'application/json'},
url: url + '/measurements',
json: measurementJson
}, function(error, response, body) {
if (!error) {
console.log(' New Measurement', ('#' + counter).cyan, 'created.'.green, '\nValue:', body.value.cyan);
counter++;
} else {
console.log(' New Measurement creation', 'failed'.red);
callback(error);
}
console.log('\n------------------------------------------------------------\n');
});
}, interval);
}
], function(err, result) {
if (err) {
console.log(err);
}
}); | mrunde/WoT-Vertical-Approach | server/demo/demoSensorController.js | JavaScript | mit | 5,051 |
import React from 'react'
import {HOC, Link} from 'cerebral-view-react'
import PageProgress from '../PageProgress'
// View
class AutoReload extends React.Component {
constructor (props) {
super(props)
this.state = {
secondsElapsed: 0
}
this.onInterval = this.onInterval.bind(this)
}
componentWillMount () {
this.intervals = []
}
componentWillUnmount () {
this.intervals.forEach(clearInterval)
}
componentDidMount () {
this.setInterval(this.onInterval, 1000)
}
setInterval () {
this.intervals.push(setInterval.apply(null, arguments))
}
onInterval () {
let secondsElapsed = 0
if (this.props.isEnabled) {
secondsElapsed = this.state.secondsElapsed + 1
if (secondsElapsed >= this.props.triggerAfterSeconds) {
this.trigger()
secondsElapsed = 0
}
}
if (secondsElapsed !== this.state.secondsElapsed) {
this.setState({
secondsElapsed: secondsElapsed
})
}
}
trigger () {
this.props.triggers.map((trigger) => trigger())
}
triggerNow (e) {
if (e) {
e.preventDefault()
}
if (this.props.isEnabled) {
if (this.state.secondsElapsed > 0) {
this.trigger()
this.setState({
secondsElapsed: 0
})
}
}
}
render () {
const signals = this.props.signals
const progress = {
isEnabled: this.props.isEnabled,
elapsed: this.state.secondsElapsed,
total: this.props.triggerAfterSeconds
}
return (
<div>
<PageProgress {...progress} />
<hr />
<pre>
BastardAutoloaderFromHell<br />
=========================<br />
[{'='.repeat(this.state.secondsElapsed)}{'.'.repeat(this.props.triggerAfterSeconds - this.state.secondsElapsed - 1)}]<br />
isEnabled: {this.props.isEnabled ? 'yepp' : 'nope'}<br />
triggerAfterSeconds: {this.props.triggerAfterSeconds}<br />
numberOfTriggers: {this.props.triggers.length}<br />
secondsElapsed: {this.state.secondsElapsed}<br />
secondsBeforeReload: {this.props.triggerAfterSeconds - this.state.secondsElapsed}<br />
-------------------------<br />
<Link signal={signals.app.reload.reloadingDisabled}>clickmeto_<b>disable</b>_reloading</Link><br />
--<br />
<Link signal={signals.app.reload.reloadingEnabled}>clickmeto_<b>enable</b>_reloading</Link><br />
--<br />
<Link signal={signals.app.reload.reloadingToggled}>clickmeto_<b>toggle</b>_reloading</Link><br />
-------------------------<br />
<a onClick={(e) => this.triggerNow(e)}>clickmeto_<b>trigger_NOW</b></a><br />
-------------------------<br />
<Link signal={signals.app.reload.triggerIntervalChanged} params={{interval: 10}}>clickmeto_reload_@<b>10_seconds</b></Link><br />
--<br />
<Link signal={signals.app.reload.triggerIntervalChanged} params={{interval: 20}}>clickmeto_reload_@<b>20_seconds</b></Link><br />
--<br />
<Link signal={signals.app.reload.triggerIntervalChanged} params={{interval: 30}}>clickmeto_reload_@<b>30_seconds</b></Link><br />
--<br />
<Link signal={signals.app.reload.triggerIntervalChanged} params={{interval: 60}}>clickmeto_reload_@<b>60_seconds</b></Link><br />
====<br />
<i>designed by pbit</i>
</pre>
</div>
)
}
}
// Model
AutoReload.propTypes = {
isEnabled: React.PropTypes.bool,
triggerAfterSeconds: React.PropTypes.number,
signals: React.PropTypes.object,
triggers: React.PropTypes.array
}
AutoReload.defaultProps = {
triggers: []
}
// Binding
const StatefullAutoReload = HOC(AutoReload, {
isEnabled: ['app', 'reload', 'isEnabled'],
triggerAfterSeconds: ['app', 'reload', 'triggerAfterSeconds']
})
// API
export default StatefullAutoReload
| burning-duck/twibral | src/ui/components/AutoReload/index.js | JavaScript | mit | 3,914 |
/* Client-side router settings */
Router.configure({
layoutTemplate:"layout",
notFoundTemplate:"page_not_found",
loadingTemplate:"loading"
});
Router.route("/", {
name:"home",
template:"home"
});
Router.route("/profile", {
name:"profile",
template:"profile"
});
Router.route("/admin", {
name:"admin",
template:"admin"
});
Router.route("/user/:_id", {
name:"user",
template:"user",
data: function(){
return Meteor.users.findOne({_id: this.params._id});
}
});
| RadioRevolt/DABelFish | client/router.js | JavaScript | mit | 494 |
//Change class of "Home" and "About"
function setActive() {
document.getElementById("about").className += "active"
document.getElementById("home").setAttribute('class','no')
}
| losko/CodeNameSite | public/js/helper.js | JavaScript | mit | 184 |
export const ADD_COCKTAIL = 'ADD_COCKTAIL';
export const LOAD_COCKTAILS = 'LOAD_COCKTAILS';
export const ADD_SPIRIT = 'ADD_SPIRIT';
export const REMOVE_SPIRIT = 'REMOVE_SPIRIT';
export const UPDATE_HUE = 'UPDATE_HUE';
| Jack95uk/HappyHour | src/actions/types.js | JavaScript | mit | 218 |
// animating the scroll effect
$('.screenshots').on('click', function(e){
e.preventDefault();
$("html, body").animate({ scrollTop: "950px", duration: 500 });
});
| PersonifyJS/PersonifyApp | app/public/javascripts/application.js | JavaScript | mit | 167 |
'use strict';
var path = require('path');
module.exports = path.join.bind(path, __dirname, '..');
| stackjie/vue-pull-to | build/index.js | JavaScript | mit | 99 |
var markdown = window.markdownit();
$(document).ready(function() {
var $wish = $('#wish');
var todoNotificationArea = $('#todos .notification-area');
var todoNotificationIcon = $('#todos .notification-area > i');
var todoNotificationText = $('#todos .notification-area > span');
$('#news-stream .menu .item').tab({history:false});
$('.todo.menu .item').tab({history:false});
$('.top.menu .item').tab({history:false});
$('body').on('click', '.button', function() {
$(this).transition('pulse');
})
$('#todos').ready(function() {
$.each($('#todos .segment'), function(index, $element){
var $html, $md;
$element = $($element);
$md = $element.find('.md-content-name');
$html = $element.find('.html-content-name');
$html.html(markdown.render($md.val()));
$md = $element.find('.md-content');
$html = $element.find('.html-content');
$html.html(markdown.render($md.val()));
});
});
$('#todos').on('click', '.edit.button', function() {
var $button = $(this);
var $html = $button.parent().siblings('.html-content');
var $md = $button.parent().siblings('.md-content');
var $htmlname = $button.parent().siblings('.html-content-name');
var $mdname = $button.parent().siblings('.md-content-name');
if($html.css('display') == 'none') {
var result = markdown.render($md.val());
$html.html(result);
result = markdown.render($mdname.val());
$htmlname.html(result);
$button.text('Edit');
}
else {
$button.text('Preview');
}
$md.toggle();
$html.toggle();
$mdname.toggle();
$htmlname.toggle();
});
$('#todos').on('click', '.save.button', function() {
var $button = $(this);
var $mdname = $button.parent().parent().find('input');
var $md = $button.parent().parent().find('textarea');
var id = $button.parent().parent().attr('data-tab');
$.post('/todos/save', {id:id, name: $mdname.val(), content: $md.val()}, function(resp){
console.log('Saved');
});
});
$('#todos').on('click', '.delete.button', function() {
var $button = $(this);
var id = $button.parent().parent().attr('data-tab');
$.post('/todos/delete', {id:id}, function(resp){
$('*[data-tab="'+id+'"]').remove();
});
});
$('#new-todo').click(function(e) {
$button = $(this);
$.post('/todos/create', function(resp) {
var $menuItem = $('<a>').addClass('item').attr('data-tab', resp.id)
.html(resp.name);
var $todoContent = $('<div>').addClass('ui tab basic segment basic')
.attr('data-tab', resp.id)
.append(
$('<div>').addClass('ui text menu right floated')
.append($('<div>').addClass('ui edit basic button item').text('Edit'))
.append($('<div>').addClass('ui save basic button item').text('Save'))
.append($('<div>').addClass('ui download basic button item').text('Download'))
.append($('<div>').addClass('ui delete basic button item').text('Delete'))
)
.append(
$('<div>').addClass('ui section divider')
)
.append(
$('<input>').addClass('ui fluid md-content-name')
.attr('style', 'display:none;').val(resp.name)
)
.append(
$('<div>').addClass('html-content-name').html(markdown.render(resp.name))
)
.append(
$('<div>').addClass('ui horizontal divider')
)
.append(
$('<textarea>').addClass('md-content')
.attr('style', 'display:none;').html(resp.content)
)
.append(
$('<div>').addClass('html-content')
);
$button.parent().append($menuItem);
$button.parent().parent().next().prepend($todoContent);
$button.parent().children().last().tab({history:false});
})
.fail(function() {
uiModules.showError('Something went wrong while creating a Todo');
});
})
$('#reminders').on('click', 'i.delete', function(e){
var $parentTr = $(this).parents("tr");
$.post('/reminders/' + $parentTr.attr('id') + '/delete', function(resp) {
$parentTr.remove();
})
});
$('#wish-form').submit(function(e){
e.preventDefault();
var wish = $wish.val();
$.get('/wish', {wish: wish}, function(resp) {
var targetType = resp.type;
if(targetType === 'remind') {
var value = resp.response;
var error = resp.error
if (error) {
uiModules.showError(error);
return;
}
$('#reminders table tbody').append(
$('<tr>').attr('id', value.id)
.append($('<td>').html(value.m))
.append($('<td>').html(value.t))
.append($('<td>').html(value.d))
.append($('<td>').append($('<i>').addClass('ui delete red icon')))
);
}
else if(targetType === 'comic') {
var link = resp.response;
var error = resp.error
if (error) {
uiModules.showError(error);
return;
}
var $webcomicmodal = $('#webcomic-modal');
$webcomicmodal.find('.header').html(link.title);
$webcomicmodal.find('a').attr('href', link.url);
var showModal = true;
if (link.content_type == 'image') {
$webcomicmodal.find('img').attr('src', link.content_url);
}
else if (link.content_type == 'page') {
alert('Page found');
}
else {
showModal = false;
uiModules.showError('Unsuported content_type ' + link.content_type);
}
if( showModal ) {
$webcomicmodal.modal({
context: 'html',
observeChanges: true,
onVisible: function () {
$webcomicmodal.modal("refresh");
}
}).modal('show');
}
}
else if(targetType === 'astro') {
var url = resp.response;
var error = resp.error
if (error) {
uiModules.showError(error);
return;
}
$('#astro-modal iframe').attr('src', url);
$('#astro-modal').modal({
onVisible: function () {
$("#astro-modal").modal("refresh");
}
}).modal('show');
}
else {
uiModules.showError('Invalid type ' + resp.type);
}
// $('#reply').addClass('animated slideInDown').html(resp.response.message);
// setTimeout(function() {
// $('#reply').removeClass('animated slideInDown');
// }, 1000);
});
$wish.val(null);
});
$.get('/commands', function(resp) {
$('#commands').html(resp);
});
$('#webcomics .button').click(function(e) {
var $comic = $(this).parent()
var comic_id = $comic.attr('id');
var $button = $comic.find('.button');
$button.addClass('disabled');
$.post('/webcomics/' + comic_id + '/sync', function(response) {
$comic.find('p').text(response.resp.links_count);
$comic.find('label').text(response.resp.last_sync);
}).
always(function() {
$button.removeClass('disabled');
});
});
$('#astros .button').click(function(e) {
var $astro = $(this).parent()
var astro_id = $astro.attr('id');
var $button = $astro.find('.button');
$button.addClass('disabled');
$.post('/astros/' + astro_id + '/sync', function(response) {
$astro.find('p').text(response.resp.links_count);
$astro.find('label').text(response.resp.last_sync);
}).
always(function() {
$button.removeClass('disabled');
});
});
$('#create-playlist-button').click(function(e) {
var $playlist_name = $('#playlist-name');
var name = $playlist_name.val();
if(!name) {
uiModules.showError('Playlist name cannot be empty');
return;
}
name = name.trim();
$.post('/music/playlist/create', {name:name}, function(resp) {
if(resp.error) {
uiModules.showError(resp.error);
return;
}
$('#music .playlists').append(resp.html);
$playlist_name.val(null);
});
});
$('#music').on('click', 'i.delete-playlist', function(e) {
var $playlist_element = $(this).parents('div');
var playlist_id = $playlist_element.attr('id');
$.post('/music/playlist/delete', {id:playlist_id}, function(resp) {
if(resp.error) {
uiModules.showError(resp.error);
return;
}
if(resp.resp) {
$('#' + playlist_id).remove();
uiModules.notify('Playlist deleted successfully');
}
else {
uiModules.showError('Playlist not deleted');
}
})
});
$('#music').on('click', '.youtube-link button', function(e) {
var $button = $(this);
var $link_input = $(this).siblings('input');
var link = $link_input.val();
if(!link) {
$link_input.parent().addClass('error');
uiModules.showError('No link found');
return;
}
var playlist_id = $button.parents('div.playlist').attr('id');
var $playlist_element = $('#' + playlist_id);
$button.addClass('loading');
$.post('/music/playlist/'+ playlist_id +'/add', {link: link, site: 'youtube'}, function(resp) {
if(resp.error) {
uiModules.showError(resp.error);
return;
}
$playlist_element.find('.update-field').text(resp.resp.updated_at);
$playlist_element.find('.links-count').text(resp.resp.links_count)
}).always(function(){
$link_input.val(null);
$button.removeClass('loading');
});
});
$('#music').on('click', '.random-music', function(e) {
var $button = $(this);
var playlist_id = $button.parents('div.playlist').attr('id');
var $playlist_element = $('#' + playlist_id);
$.get('/music/playlist/'+ playlist_id +'/random', function(resp) {
var video_id = resp.resp.video_id;
var $musicmodal = $('#music-modal');
$musicmodal.find('.header').html(resp.resp.title);
$musicmodal.modal({
context: 'html',
observeChanges: true,
onVisible: function () {
$musicmodal.modal("refresh");
music_player.loadVideoById(video_id, 0, "large")
},
onHidden: function() {
music_player.stopVideo();
}
}).modal('show');
}).fail(function(response) {
uiModules.showError(response.responseText);
})
});
$('#music').on('click', '.full-playlist', function(e) {
var $button = $(this);
var playlist_id = $button.parents('div.playlist').attr('id');
var $playlist_element = $('#' + playlist_id);
var playlist_name = $playlist_element.find('a.header').text();
$.get('/music/playlist/'+ playlist_id +'/all', function(resp) {
var $musicmodal = $('#music-modal');
$musicmodal.find('.header').html(resp.resp.title);
$musicmodal.modal({
context: 'html',
observeChanges: true,
onVisible: function () {
$musicmodal.modal("refresh");
var ids = [];
for( var i = 0; i < 100 && i < resp.resp.length ; i++ ) {
var video = resp.resp[i];
ids.push(video.video_id);
}
music_player.loadPlaylist(ids);
},
onHidden: function() {
music_player.stopVideo();
}
}).modal('show');
}).fail(function(response) {
uiModules.showError(response.responseText);
})
});
});
| arpitbbhayani/penny | app/static/js/index.js | JavaScript | mit | 13,851 |
"use strict";
var http_1 = require("@angular/http");
var AppSettings = (function () {
function AppSettings() {
}
Object.defineProperty(AppSettings, "API_OPTIONS", {
get: function () {
var headers = new http_1.Headers({ 'Content-Type': 'application/json' }), options = new http_1.RequestOptions({ headers: headers });
return options;
},
enumerable: true,
configurable: true
});
Object.defineProperty(AppSettings, "API_URL", {
get: function () {
var devMode = true, prodPath = "http://cristi.red:8080/api", apiSecured = false, apiHost = "localhost", apiPort = "8080/api";
return (devMode) ? ("http" + ((apiSecured) ? "s" : "") + "://" + apiHost + ":" + apiPort) : prodPath;
},
enumerable: true,
configurable: true
});
Object.defineProperty(AppSettings, "SOCKETG_URL", {
get: function () {
var devMode = true, prodPath = "http://cristi.red:8080/gs-guide-websocket", local = "http://localhost:8080/gs-guide-websocket";
return (devMode) ? local : prodPath;
},
enumerable: true,
configurable: true
});
return AppSettings;
}());
exports.AppSettings = AppSettings;
//# sourceMappingURL=app.settings.js.map | cristirosu/rpg-scheduler-front | src/app/shared/services/app.settings.js | JavaScript | mit | 1,301 |
const fs = require('fs')
const path = require('path')
const {generateBabelEnvLoader, getConfig} = require('./common')
const buildCache = {}
module.exports = (params) => {
const baseConfig = getConfig(params)
const config = Object.assign({}, baseConfig)
config.outputPath = path.join(__dirname, '../dist-' + config.app)
return {
entry: config.sourcePath + '/tools/initdb.js',
context: config.sourcePath,
target: 'node',
output: {
path: config.outputPath,
filename: 'initdb.js'
},
stats: {
colors: true,
reasons: true,
chunks: false
},
cache: buildCache,
module: {
rules: [generateBabelEnvLoader({node: 'current'}, config)]
},
resolve: {
extensions: ['.js', '.jsx'],
alias: baseConfig.aliases
},
devServer: {
contentBase: config.sourcePath
}
}
}
| bourbest/keeptrack | client/tasks/tool-initdb.js | JavaScript | mit | 868 |
'use strict';
var page = 'projects';
module.exports = {
renderPage: function(req, res) {
if (!req.user) {
res.redirect('/login');
} else {
res.render(page, {
helpers: {
activeClass: function(section) {
if (section === 'projects') {
return 'active';
} else {
return '';
}
}
},
user: req.user ? req.user.toJSON() : null
});
}
}
}
| bobholt/genealogists-friend | app/controllers/project.js | JavaScript | mit | 472 |
Search = function(data, input, result) {
this.data = data;
this.$input = $(input);
this.$result = $(result);
this.$current = null;
this.$view = this.$result.parent();
this.searcher = new Searcher(data.index);
this.init();
};
Search.prototype = $.extend({}, Navigation, new function() {
var suid = 1;
this.init = function() {
var _this = this;
var observer = function(e) {
switch(e.originalEvent.keyCode) {
case 38: // Event.KEY_UP
case 40: // Event.KEY_DOWN
return;
}
_this.search(_this.$input[0].value);
};
this.$input.keyup(observer);
this.$input.click(observer); // mac's clear field
this.searcher.ready(function(results, isLast) {
_this.addResults(results, isLast);
});
this.initNavigation();
this.setNavigationActive(false);
};
this.search = function(value, selectFirstMatch) {
value = jQuery.trim(value).toLowerCase();
if (value) {
this.setNavigationActive(true);
} else {
this.setNavigationActive(false);
}
if (value == '') {
this.lastQuery = value;
this.$result.empty();
this.$result.attr('aria-expanded', 'false');
this.setNavigationActive(false);
} else if (value != this.lastQuery) {
this.lastQuery = value;
this.$result.attr('aria-busy', 'true');
this.$result.attr('aria-expanded', 'true');
this.firstRun = true;
this.searcher.find(value);
}
};
this.addResults = function(results, isLast) {
var target = this.$result.get(0);
if (this.firstRun && (results.length > 0 || isLast)) {
this.$current = null;
this.$result.empty();
}
for (var i=0, l = results.length; i < l; i++) {
var item = this.renderItem.call(this, results[i]);
item.setAttribute('id', 'search-result-' + target.childElementCount);
target.appendChild(item);
}
if (this.firstRun && results.length > 0) {
this.firstRun = false;
this.$current = $(target.firstChild);
this.$current.addClass('search-selected');
}
if (jQuery.browser.msie) this.$element[0].className += '';
if (isLast) this.$result.attr('aria-busy', 'false');
};
this.move = function(isDown) {
if (!this.$current) return;
var $next = this.$current[isDown ? 'next' : 'prev']();
if ($next.length) {
this.$current.removeClass('search-selected');
$next.addClass('search-selected');
this.$input.attr('aria-activedescendant', $next.attr('id'));
this.scrollIntoView($next[0], this.$view[0]);
this.$current = $next;
this.$input.val($next[0].firstChild.firstChild.text);
this.$input.select();
}
return true;
};
this.hlt = function(html) {
return this.escapeHTML(html).
replace(/\u0001/g, '<em>').
replace(/\u0002/g, '</em>');
};
this.escapeHTML = function(html) {
return html.replace(/[&<>]/g, function(c) {
return '&#' + c.charCodeAt(0) + ';';
});
}
});
| gadzorg/gorg_mail | doc/app/js/search.js | JavaScript | mit | 2,999 |
version https://git-lfs.github.com/spec/v1
oid sha256:505b4ccd47ed9526d0238c6f2d03a343ce476abc1c4aa79a9f22cabcbd0a3c16
size 12575
| yogeshsaroya/new-cdnjs | ajax/libs/require.js/0.22.0/require.min.js | JavaScript | mit | 130 |
'use strict';
//Ghost service used for communicating with the ghost api
angular.module('ghost').factory('Ghost', ['$http', 'localStorageService',
function($http, localStorageService) {
return {
login: function() {
return $http.get('api/ghost/login').
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
data.authenticator = 'simple-auth-authenticator:oauth2-password-grant';
data.expires_at = data.expires_in + Date.now();
localStorageService.set('ghost-cms:session',data);
}).
error(function(data, status, headers, config) {
// called asynchronously if an error occurs
// or server returns response with an error status.
console.log('ghost login failure');
});
}
};
}
]).factory('GhostPosts', ['$http',
function($http) {
return {
read: function(options) {
return $http.get('api/ghost/posts/slug/' + options.slug).
success(function(data, status, headers, config) {
//console.log(data);
return data;
});
},
query: function(options) {
return $http.get('api/ghost/posts/tag/' + options.tag).
success(function(data, status, headers, config) {
//console.log(data);
return data;
});
}
};
}
]);
| newcrossfoodcoop/nxfc | modules/ghost/client/services/ghost.client.service.js | JavaScript | mit | 1,804 |
//config file for bae
if(sumeru.BAE_VERSION){
sumeru.config.database({
dbname : '',
user: '',//bae 3.0 required
password: ''//bae 3.0 required
});
sumeru.config({
site_url : '' //with tailing slash
});
} | Clouda-team/Cloudajs-examples | ExternalData/clouda_request_data/app/server_config/bae.js | JavaScript | mit | 251 |
///<reference src="js/tempus-dominus"/>
/*global $ */
tempusDominus.jQueryInterface = function (option, argument) {
if (this.length === 1) {
return tempusDominus.jQueryHandleThis(this, option, argument);
}
// "this" is jquery here
return this.each(function () {
tempusDominus.jQueryHandleThis(this, option, argument);
});
};
tempusDominus.jQueryHandleThis = function (me, option, argument) {
let data = $(me).data(tempusDominus.Namespace.dataKey);
if (typeof option === 'object') {
$.extend({}, tempusDominus.DefaultOptions, option);
}
if (!data) {
data = new tempusDominus.TempusDominus($(me)[0], option);
$(me).data(tempusDominus.Namespace.dataKey, data);
}
if (typeof option === 'string') {
if (data[option] === undefined) {
throw new Error(`No method named "${option}"`);
}
if (argument === undefined) {
return data[option]();
} else {
if (option === 'date') {
data.isDateUpdateThroughDateOptionFromClientCode = true;
}
const ret = data[option](argument);
data.isDateUpdateThroughDateOptionFromClientCode = false;
return ret;
}
}
};
tempusDominus.getSelectorFromElement = function ($element) {
let selector = $element.data('target'),
$selector;
if (!selector) {
selector = $element.attr('href') || '';
selector = /^#[a-z]/i.test(selector) ? selector : null;
}
$selector = $(selector);
if ($selector.length === 0) {
return $element;
}
if (!$selector.data(tempusDominus.Namespace.dataKey)) {
$.extend({}, $selector.data(), $(this).data());
}
return $selector;
};
/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/
$(document)
.on(
`click${tempusDominus.Namespace.events.key}.data-api`,
`[data-toggle="${tempusDominus.Namespace.dataKey}"]`,
function () {
const $originalTarget = $(this),
$target = tempusDominus.getSelectorFromElement($originalTarget),
config = $target.data(tempusDominus.Namespace.dataKey);
if ($target.length === 0) {
return;
}
if (
config._options.allowInputToggle &&
$originalTarget.is('input[data-toggle="datetimepicker"]')
) {
return;
}
tempusDominus.jQueryInterface.call($target, 'toggle');
}
)
.on(
tempusDominus.Namespace.events.change,
`.${tempusDominus.Namespace.NAME}-input`,
function (event) {
const $target = tempusDominus.getSelectorFromElement($(this));
if ($target.length === 0 || event.isInit) {
return;
}
tempusDominus.jQueryInterface.call($target, '_change', event);
}
)
.on(
tempusDominus.Namespace.events.blur,
`.${tempusDominus.Namespace.NAME}-input`,
function (event) {
const $target = tempusDominus.getSelectorFromElement($(this)),
config = $target.data(tempusDominus.Namespace.dataKey);
if ($target.length === 0) {
return;
}
if (config._options.debug || window.debug) {
return;
}
tempusDominus.jQueryInterface.call($target, 'hide', event);
}
)
/*.on(tempusDominus.Namespace.Events.keydown, `.${tempusDominus.Namespace.NAME}-input`, function (event) {
const $target = tempusDominus.getSelectorFromElement($(this));
if ($target.length === 0) {
return;
}
tempusDominus.jQueryInterface.call($target, '_keydown', event);
})
.on(tempusDominus.Namespace.Events.keyup, `.${tempusDominus.Namespace.NAME}-input`, function (event) {
const $target = tempusDominus.getSelectorFromElement($(this));
if ($target.length === 0) {
return;
}
tempusDominus.jQueryInterface.call($target, '_keyup', event);
})*/
.on(
tempusDominus.Namespace.events.focus,
`.${tempusDominus.Namespace.NAME}-input`,
function (event) {
const $target = tempusDominus.getSelectorFromElement($(this)),
config = $target.data(tempusDominus.Namespace.dataKey);
if ($target.length === 0) {
return;
}
if (!config._options.allowInputToggle) {
return;
}
tempusDominus.jQueryInterface.call($target, 'show', event);
}
);
const name = 'tempusDominus';
$.fn[name] = tempusDominus.jQueryInterface;
$.fn[name].Constructor = tempusDominus.TempusDominus;
$.fn[name].noConflict = function () {
$.fn[name] = $.fn[name];
return tempusDominus.jQueryInterface;
};
| cdnjs/cdnjs | ajax/libs/tempus-dominus/6-alpha1/js/jQuery-provider.js | JavaScript | mit | 4,501 |
import Telescope from 'meteor/nova:lib';
import Posts from "meteor/nova:posts";
import Comments from "meteor/nova:comments";
import Users from 'meteor/nova:users';
serveAPI = function(terms){
var posts = [];
var parameters = Posts.parameters.get(terms);
const postsCursor = Posts.find(parameters.selector, parameters.options);
postsCursor.forEach(function(post) {
var url = Posts.getLink(post);
var postOutput = {
title: post.title,
headline: post.title, // for backwards compatibility
author: post.author,
date: post.postedAt,
url: url,
pageUrl: Posts.getPageUrl(post, true),
guid: post._id
};
if(post.body)
postOutput.body = post.body;
if(post.url)
postOutput.domain = Telescope.utils.getDomain(url);
if (post.thumbnailUrl) {
postOutput.thumbnailUrl = Telescope.utils.addHttp(post.thumbnailUrl);
}
var twitterName = Users.getTwitterNameById(post.userId);
if(twitterName)
postOutput.twitterName = twitterName;
var comments = [];
Comments.find({postId: post._id}, {sort: {postedAt: -1}, limit: 50}).forEach(function(comment) {
var commentProperties = {
body: comment.body,
author: comment.author,
date: comment.postedAt,
guid: comment._id,
parentCommentId: comment.parentCommentId
};
comments.push(commentProperties);
});
var commentsToDelete = [];
comments.forEach(function(comment, index) {
if (comment.parentCommentId) {
var parent = comments.filter(function(obj) {
return obj.guid === comment.parentCommentId;
})[0];
if (parent) {
parent.replies = parent.replies || [];
parent.replies.push(JSON.parse(JSON.stringify(comment)));
commentsToDelete.push(index);
}
}
});
commentsToDelete.reverse().forEach(function(index) {
comments.splice(index,1);
});
postOutput.comments = comments;
posts.push(postOutput);
});
return JSON.stringify(posts);
};
| trujunzhang/newspoliticl | packages/nova-api/lib/server/api.js | JavaScript | mit | 2,059 |
import React from 'react';
import Helmet from 'react-helmet';
import { Route } from '../../core/router';
import { Model as Waste } from '../../entities/Waste';
import { Deferred } from '../../util/utils';
import NavLink from '../../components/NavLink';
import Progress from 'react-progress-2';
import { PageHeader, Row, Col, Panel, Label } from 'react-bootstrap';
import radio from 'backbone.radio';
const router = radio.channel('router');
export default class WasteShowRoute extends Route {
breadcrumb({ params }) {
const dfd = new Deferred;
const waste = new Waste({ fid: params.wfid });
waste.forSubjectParam(params.fid);
waste.fetch({ success: m => dfd.resolve(m.get('title')) });
return dfd.promise;
}
fetch({ params }) {
this.companyFid = params.fid;
this.waste = new Waste({ fid: params.wfid });
this.waste.forSubjectParam(params.fid).expandParam('subtype');
return this.waste.fetch();
}
render() {
const waste = this.waste.toJSON();
return (
<div>
<Helmet title={waste.title} />
<PageHeader>{waste.title}</PageHeader>
<Row>
<Col md={12}>
<ul className="nav menu-nav-pills">
<li>
<NavLink
to={`/companies/${this.companyFid}/waste/${waste.fid}/edit`}
>
<i className="fa fa-pencil-square-o" /> Редактировать
</NavLink>
</li>
<li>
<a
href="javascript:;"
onClick={() => {
Progress.show();
this.waste.destroy({
success: () => {
Progress.hide();
router.request('navigate', `companies/${this.companyFid}`);
},
});
}}
>
<i className="fa fa-ban" aria-hidden="true" /> Удалить
</a>
</li>
</ul>
</Col>
</Row>
<Row>
<Col md={12}>
<Panel>
<h4><Label>Название</Label>{' '}
{waste.title}
</h4>
<h4><Label>Вид отходов</Label>{' '}
<NavLink to={`/waste-types/${waste.subtype.fid}`}>{waste.subtype.title}</NavLink>
</h4>
<h4><Label>Количество</Label>{' '}
{waste.amount} т
</h4>
</Panel>
</Col>
</Row>
</div>
);
}
}
| ryrudnev/dss-wm | app/routes/waste/ShowRoute.js | JavaScript | mit | 2,612 |
var basePaths = {
src: 'public/',
dest: 'public.dist/',
bower: 'bower_components/'
};
var paths = {
images: {
src: basePaths.src + 'images/',
dest: basePaths.dest + 'images/min/'
},
scripts: {
src: basePaths.src + 'scripts/',
dest: basePaths.dest + 'scripts/min/'
},
styles: {
src: basePaths.src + 'styles/',
dest: basePaths.dest + 'styles/min/'
},
sprite: {
src: basePaths.src + 'sprite/*'
}
};
var appFiles = {
styles: paths.styles.src + '**/*.scss',
scripts: [paths.scripts.src + 'scripts.js']
};
var vendorFiles = {
styles: '',
scripts: ''
};
var spriteConfig = {
imgName: 'sprite.png',
cssName: '_sprite.scss',
imgPath: paths.images.dest.replace('public', '') + 'sprite.png'
};
// let the magic begin
var gulp = require('gulp');
var es = require('event-stream');
var gutil = require('gulp-util');
var autoprefixer = require('gulp-autoprefixer');
var plugins = require("gulp-load-plugins")({
pattern: ['gulp-*', 'gulp.*'],
replaceString: /\bgulp[\-.]/
});
// allows gulp --dev to be run for a more verbose output
var isProduction = true;
var sassStyle = 'compressed';
var sourceMap = false;
if (gutil.env.dev === true) {
sassStyle = 'expanded';
sourceMap = true;
isProduction = false;
}
var changeEvent = function(evt) {
gutil.log('File', gutil.colors.cyan(evt.path.replace(new RegExp('/.*(?=/' + basePaths.src + ')/'), '')), 'was', gutil.colors.magenta(evt.type));
};
gulp.task('css', function() {
var sassFiles = gulp.src(appFiles.styles)
/*
.pipe(plugins.rubySass({
style: sassStyle, sourcemap: sourceMap, precision: 2
}))
*/
.pipe(plugins.sass())
.on('error', function(err) {
new gutil.PluginError('CSS', err, {showStack: true});
});
return es.concat(gulp.src(vendorFiles.styles), sassFiles)
.pipe(plugins.concat('style.min.css'))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4', 'Firefox >= 4'))
/*
.pipe(isProduction ? plugins.combineMediaQueries({
log: true
}) : gutil.noop())
*/
.pipe(isProduction ? plugins.cssmin() : gutil.noop())
.pipe(plugins.size())
.pipe(gulp.dest(paths.styles.dest))
;
});
gulp.task('scripts', function() {
gulp.src(vendorFiles.scripts.concat(appFiles.scripts))
.pipe(plugins.concat('app.js'))
.pipe(isProduction ? plugins.uglify() : gutil.noop())
.pipe(plugins.size())
.pipe(gulp.dest(paths.scripts.dest))
;
});
// sprite generator
gulp.task('sprite', function() {
var spriteData = gulp.src(paths.sprite.src).pipe(plugins.spritesmith({
imgName: spriteConfig.imgName,
cssName: spriteConfig.cssName,
imgPath: spriteConfig.imgPath,
cssOpts: {
functions: false
},
cssVarMap: function (sprite) {
sprite.name = 'sprite-' + sprite.name;
}
}));
spriteData.img.pipe(gulp.dest(paths.images.dest));
spriteData.css.pipe(gulp.dest(paths.styles.src));
});
gulp.task('watch', ['sprite', 'css', 'scripts'], function() {
gulp.watch(appFiles.styles, ['css']).on('change', function(evt) {
changeEvent(evt);
});
gulp.watch(paths.scripts.src + '*.js', ['scripts']).on('change', function(evt) {
changeEvent(evt);
});
gulp.watch(paths.sprite.src, ['sprite']).on('change', function(evt) {
changeEvent(evt);
});
});
gulp.task('default', ['css', 'scripts']); | marcolino/escrape2 | .old/gulpfile-advanced.js | JavaScript | mit | 3,371 |
var g_batchAssessmentEditor = null;
var g_tabAssessments = null;
var g_updatingAttendance = false;
var g_onRefresh = null;
var g_lockedCount = 0;
var g_btnSubmit = null;
var g_sectionAssessmentEditors = null;
var g_sectionAssessmentButtons = null;
function createAssessment(content, to) {
var assessmentJson = {};
assessmentJson["content"] = content;
assessmentJson["to"] = to;
return new Assessment(assessmentJson);
}
function SingleAssessmentEditor(){
this.participantId = 0;
this.name = "";
this.content = "";
this.lock = null;
}
function BatchAssessmentEditor(){
this.switchAttendance = null;
this.selectAll = null;
this.editors = null;
}
function generateAssessmentEditor(par, participant, activity, batchEditor){
var singleEditor = new SingleAssessmentEditor();
var row = $('<div>', {
"class": "assessment-input-row"
}).appendTo(par);
var avatar = $("<img>", {
src: participant.avatar,
"class": "assessment-avatar"
}).click(function(evt) {
evt.preventDefault();
window.location.hash = ("profile?" + g_keyVieweeId + "=" + participant.id.toString());
}).appendTo(row);
var name = $('<a>', {
href: "#",
text: participant.name
}).appendTo(row);
name.click(function(evt) {
evt.preventDefault();
window.location.hash = ("profile?" + g_keyVieweeId + "=" + participant.id.toString());
});
singleEditor.participantId = participant.id;
singleEditor.name = participant.name;
if ( activity.containsRelation() && ((activity.relation & assessed) == 0) ) generateUnassessedView(row, singleEditor, batchEditor);
else generateAssessedView(row, participant, activity);
if(g_loggedInUser != null && g_loggedInUser.id == participant.id) row.hide();
return singleEditor;
}
function generateAssessmentEditors(par, activity, batchEditor) {
par.empty();
var participants = activity.selectedParticipants;
var editors = new Array();
for(var i = 0; i < participants.length; i++){
var editor = generateAssessmentEditor(par, participants[i], activity, batchEditor);
editors.push(editor);
}
return editors;
}
function generateAssessmentButtons(par, activity, batchEditor){
par.empty();
if(batchEditor.editors == null || batchEditor.editors.length <= 1) return;
var row = $('<div>', {
"class": "assessment-button"
}).appendTo(par);
var btnCheckAll = $("<button>", {
text: TITLES["check_all"],
"class": "gray assessment-button"
}).appendTo(row);
btnCheckAll.click(batchEditor, function(evt){
evt.preventDefault();
for(var i = 0; i < evt.data.editors.length; i++) {
var editor = evt.data.editors[i];
editor.lock.prop("checked", true).change();
}
});
var btnUncheckAll = $("<button>", {
text: TITLES["uncheck_all"],
"class": "gray assessment-button"
}).appendTo(row);
btnUncheckAll.click(batchEditor, function(evt){
evt.preventDefault();
for(var i = 0; i < evt.data.editors.length; i++) {
var editor = evt.data.editors[i];
editor.lock.prop("checked", false).change();
}
});
g_btnSubmit = $("<button>", {
text: TITLES["submit"],
"class": "assessment-button positive-button"
}).appendTo(row);
g_btnSubmit.click({editor: batchEditor, activity: activity}, function(evt){
evt.preventDefault();
if (g_loggedInUser == null) return;
var aBatchEditor = evt.data.editor;
var aActivity = evt.data.activity;
var assessments = new Array();
for(var i = 0; i < aBatchEditor.editors.length; i++) {
var editor = aBatchEditor.editors[i];
var content = editor.content;
var to = editor.participantId;
if(to == g_loggedInUser.id) continue;
var assessment = createAssessment(content, to);
assessments.push(assessment);
}
if (assessments.length == 0) return;
var params = {};
var token = $.cookie(g_keyToken);
params[g_keyToken] = token;
params[g_keyActivityId] = aActivity.id;
params[g_keyBundle] = JSON.stringify(assessments);
var aButton = $(this);
disableField(aButton);
$.ajax({
type: "POST",
url: "/assessment/submit",
data: params,
success: function(data, status, xhr){
enableField(aButton);
if (isTokenExpired(data)) {
logout(null);
return;
}
alert(ALERTS["assessment_submitted"]);
aActivity.relation |= assessed;
refreshBatchEditor(aActivity);
},
error: function(xhr, status, err){
enableField(aButton);
alert(ALERTS["assessment_not_submitted"]);
}
});
}).appendTo(row);
disableField(g_btnSubmit);
}
function generateBatchAssessmentEditor(par, activity, onRefresh){
par.empty();
if(g_onRefresh == null) g_onRefresh = onRefresh;
g_lockedCount = 0; // clear lock count on batch editor generated
g_batchAssessmentEditor = new BatchAssessmentEditor();
if(activity == null) return g_batchAssessmentEditor;
var editors = [];
var sectionAll = $('<div>', {
"class": "assessment-container"
}).appendTo(par);
var initVal = false;
var disabled = false;
// Determine attendance switch initial state based on viewer-activity-relation
if (g_loggedInUser != null && activity.host.id == g_loggedInUser.id) {
// host cannot choose presence
initVal = true;
disabled = true;
} else if((activity.relation & present) > 0) {
// present participants
initVal = true;
} else if((activity.relation & selected) > 0 || (activity.relation & absent) > 0) {
// selected but not present
initVal = false;
} else {
disabled = true;
}
var attendanceSwitch = createBinarySwitch(sectionAll, disabled, initVal, TITLES["assessment_disabled"], TITLES["present"], TITLES["absent"], "switch-attendance");
g_sectionAssessmentEditors = $('<div>', {
style: "margin-top: 5pt"
}).appendTo(sectionAll);
g_sectionAssessmentButtons = $('<div>', {
style: "margin-top: 5pt"
}).appendTo(sectionAll);
if( g_loggedInUser != null && ( ((activity.relation & present) > 0) || (activity.containsRelation() == false) ) ) {
/*
* show list for logged-in users
*/
refreshBatchEditor(activity);
}
var onSuccess = function(data){
g_updatingAttendance = false;
// update activity.relation by returned value
var relationJson = data;
activity.relation = parseInt(relationJson[g_keyRelation]);
g_sectionAssessmentEditors.empty();
g_sectionAssessmentButtons.empty();
var value = getBinarySwitchState(attendanceSwitch);
if(!value) return;
// assessed participants cannot edit or re-submit assessments
refreshBatchEditor(activity);
};
var onError = function(err){
g_updatingAttendance = false;
// reset switch status if updating attendance fails
var value = getBinarySwitchState(attendanceSwitch);
var resetVal = !value;
setBinarySwitch(attendanceSwitch, resetVal);
};
var onClick = function(evt){
evt.preventDefault();
if(activity.relation == invalid) return;
if(!activity.hasBegun()) {
alert(ALERTS["activity_not_begun"]);
return;
}
var value = getBinarySwitchState(attendanceSwitch);
var newVal = !value;
setBinarySwitch(attendanceSwitch, newVal);
attendance = activity.relation;
if(newVal) attendance = present;
else attendance = absent;
updateAttendance(activity.id, attendance, onSuccess, onError);
};
setBinarySwitchOnClick(attendanceSwitch, onClick);
return g_batchAssessmentEditor;
}
function updateAttendance(activityId, attendance, onSuccess, onError){
// prototypes: onSuccess(data), onError(err)
if(g_updatingAttendance) return;
var token = $.cookie(g_keyToken);
if(token == null) return;
var params={};
params[g_keyRelation] = attendance;
params[g_keyToken] = token;
params[g_keyActivityId] = activityId;
g_updatingAttendance = true;
$.ajax({
type: "PUT",
url: "/activity/mark",
data: params,
success: function(data, status, xhr) {
if (isTokenExpired(data)) {
logout(null);
return;
}
onSuccess(data);
},
error: function(xhr, status, err) {
onError(err);
}
});
}
function generateAssessedView(row, participant, activity) {
var btnView = $('<span>', {
text: TITLES["view_assessment"],
style: "display: inline; color: blue; margin-left: 5pt; cursor: pointer"
}).appendTo(row);
btnView.click(function(evt){
evt.preventDefault();
queryAssessmentsAndRefresh(participant.id, activity.id);
});
}
function generateUnassessedView(row, singleEditor, batchEditor) {
var lock = $('<input>', {
type: "checkbox",
"class": "left"
}).appendTo(row);
var contentInput = $('<input>', {
type: 'text'
}).appendTo(row);
contentInput.on("input paste keyup", singleEditor, function(evt){
evt.data.content = $(this).val();
});
lock.change({input: contentInput, editor: batchEditor}, function(evt){
var aInput = evt.data.input;
var aBatchEditor = evt.data.editor;
evt.preventDefault();
var checked = isChecked($(this));
if(!checked) {
enableField(aInput);
--g_lockedCount;
if(g_btnSubmit != null) disableField(g_btnSubmit);
} else {
disableField(aInput);
++g_lockedCount;
if(g_lockedCount >= (aBatchEditor.editors.length - 1) && g_btnSubmit != null) enableField(g_btnSubmit);
}
});
singleEditor.lock = lock;
}
function refreshBatchEditor(activity) {
if (!activity.hasBegun()) return;
if(g_batchAssessmentEditor == null || g_sectionAssessmentEditors == null || g_sectionAssessmentButtons == null) return;
var editors = generateAssessmentEditors(g_sectionAssessmentEditors, activity, g_batchAssessmentEditor);
g_batchAssessmentEditor.editors = editors;
g_sectionAssessmentButtons.empty();
if(!activity.containsRelation() || (activity.containsRelation() && (activity.relation & assessed) > 0) || g_batchAssessmentEditor.editors.length <= 1) return;
generateAssessmentButtons(g_sectionAssessmentButtons, activity, g_batchAssessmentEditor);
}
| duanp0128/PlayHongKongResort | public/javascripts/assessment/editor.js | JavaScript | mit | 9,652 |
var fs = require('fs');
var mysql = require('mysql');
var qs = require('querystring');
var express = require('express');
var config = JSON.parse(fs.readFileSync(__dirname+'/config.json', 'UTF-8'));
// -----------------------------------------------------------------------------
// Keep a persistant connection to the database (reconnect after an error or disconnect)
// -----------------------------------------------------------------------------
if (typeof config.databaseConnection == 'undefined' || typeof config.databaseConnection.retryMinTimeout == 'undefined')
config.databaseConnection = {retryMinTimeout: 2000, retryMaxTimeout: 60000};
var connection, retryTimeout = config.databaseConnection.retryMinTimeout;
function persistantConnection(){
connection = mysql.createConnection(config.database);
connection.connect(
function (err){
if (err){
console.log('Error connecting to database: '+err.code);
setTimeout(persistantConnection, retryTimeout);
console.log('Retrying in '+(retryTimeout / 1000)+' seconds');
if (retryTimeout < config.databaseConnection.retryMaxTimeout)
retryTimeout += 1000;
}
else{
retryTimeout = config.databaseConnection.retryMinTimeout;
console.log('Connected to database');
}
});
connection.on('error',
function (err){
console.log('Database error: '+err.code);
if (err.code === 'PROTOCOL_CONNECTION_LOST')
persistantConnection();
});
}
//persistantConnection();
var app = express();
// -----------------------------------------------------------------------------
// Deliver the base template of SPA
// -----------------------------------------------------------------------------
app.get('/', function (req, res){
res.send(loadTemplatePart('base.html', req));
});
app.get('/images/:id', function (req, res){
res.send(dataStore.images);
});
// -----------------------------------------------------------------------------
// Deliver static assets
// -----------------------------------------------------------------------------
app.use('/static/', express.static('static'));
// ==================================================
// Below this point are URIs that are accesible from outside, in REST API calls
// ==================================================
app.use(function(req, res, next){
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
// -----------------------------------------------------------------------------
// API Endpoint to receive data
// -----------------------------------------------------------------------------
var dataStore = {};
app.post('/api/put', function (req, res){
// Needs to authenticate the RPi module
//
handlePost(req, function(data){
//console.log(data);
for (var i = 0; i < 4; i++){
//var img = Buffer.from(, 'base64');
fs.writeFile('./static/images/'+data.id+'/'+i+'.png',
'data:image/png;base64,'+data.images[i],
function(err){
if (err)
console.log(err);
}
);
}
//
//dataStore[data.id] = data;
dataStore = data;
res.send('ok');
});
});
app.listen(config.listenPort, function (){
console.log('RainCatcher server is listening on port '+config.listenPort);
});
// --------------------------------------------------------------------------
// Handler for multipart POST request/response body
function handlePost(req, callback){
var body = '';
req.on('data', function (data){
body += data;
if (body.length > 1e8)
req.connection.destroy();
});
req.on('end', function (data){
var post = body;
try{
post = JSON.parse(post);
}
catch(e){
try{
post = qs.parse(post);
}
catch(e){}
}
callback(post);
});
}
function loadTemplatePart(template, req){
try{
return fs.readFileSync('./templates/'+template, 'utf8');
}
catch(e){
return '<h2>Page Not Found</h2>';
}
}
Date.prototype.sqlFormatted = function() {
var yyyy = this.getFullYear().toString();
var mm = (this.getMonth()+1).toString();
var dd = this.getDate().toString();
return yyyy +'-'+ (mm[1]?mm:"0"+mm[0]) +'-'+ (dd[1]?dd:"0"+dd[0]);
};
function isset(obj){
return typeof obj != 'undefined';
}
| vishva8kumara/rain-catcher | server/sky.js | JavaScript | mit | 4,212 |
import SuccessPage from '../index';
import expect from 'expect';
import { shallow } from 'enzyme';
import React from 'react';
describe('<SuccessPage />', () => {
});
| Luandro-com/repsparta-web-app | app/components/SuccessPage/tests/index.test.js | JavaScript | mit | 169 |
/**
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'lib/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
//Testing libraries
//'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
//'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
//'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
//'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
//'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
//'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
//'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
//'@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './main.js',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
}
}
});
})(this);
| Quilt4/Quilt4.Web | src/Quilt4.Web/wwwroot/systemjs.config.js | JavaScript | mit | 2,468 |
/**
* Created by Tomas Kulhanek on 1/16/17.
*/
//import {HttpClient} from 'aurelia-http-client';
import {ProjectApi} from "../components/projectapi";
import {Vfstorage} from '../components/vfstorage';
//import {bindable} from 'aurelia-framework';
export class Modulecontrol{
// @bindable classin = "w3-card-4 w3-sand w3-padding w3-margin w3-round";
constructor () {
this.client=new HttpClient();
this.url=window.location.href;
this.baseurl=Vfstorage.getBaseUrl()
this.enabled=false;
this.client.configure(config=> {
config.withHeader('Accept', 'application/json');
config.withHeader('Content-Type', 'application/json');
});
}
attached(){
//console.log("attached() url:"+this.url);
this.client.get(this.baseurl+this.url)
.then(response => this.okcallback(response))
.catch(error => this.failcallback(error))
}
okcallback(response){
//console.log("okcallback()");
var res= JSON.parse(response.response);
//console.log(res.enabled);
this.enabled= res.enabled;
}
failcallback(error){
this.enabled=false;
console.log('Sorry, error when connecting backend web service at '+this.url+' error:'+error.response+" status:"+error.statusText);
}
enable(){
this.client.post(this.baseurl+this.url)
.then(response => this.okcallback(response))
.catch(error => this.failcallback(error))
}
}
| h2020-westlife-eu/west-life-wp6 | wp6-virtualfolder/www/src/virtualfoldermodules/modulecontrol.js | JavaScript | mit | 1,402 |
/* eslint-disable no-undef,no-unused-expressions */
const request = require('supertest')
const expect = require('chai').expect
const app = require('../../bin/www')
const fixtures = require('../data/fixtures')
describe('/api/mappings', () => {
beforeEach(() => {
this.Sample = require('../../models').Sample
this.Instrument = require('../../models').Instrument
this.InstrumentMapping = require('../../models').InstrumentMapping
this.ValidationError = require('../../models').sequelize.ValidationError
expect(this.Sample).to.exist
expect(this.Instrument).to.exist
expect(this.InstrumentMapping).to.exist
expect(this.ValidationError).to.exist
return require('../../models').sequelize
.sync({force: true, logging: false})
.then(() => {
console.log('db synced')
return this.Sample
.bulkCreate(fixtures.samples)
})
.then(samples => {
this.samples = samples
return this.Instrument
.bulkCreate(fixtures.instruments)
})
.then(instruments => {
return this.InstrumentMapping.bulkCreate(fixtures.instrumentMappings)
})
.then(() => console.log('Fixtures loaded'))
})
it('should return 200 on GET /api/instruments/:instrumentId/mappings', () => {
return request(app)
.get('/api/instruments/a35c6ac4-53f7-49b7-82e3-7a0aba5c2c45/mappings')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(200)
.then((res) => {
expect(res.body, 'body should be an array').to.be.an('array')
expect(res.body, 'body should contain 2 items').to.have.lengthOf(2)
expect(res.body[0], 'item 0 should be an object').to.be.an('object')
})
})
it('should return 201 on POST /api/instruments/:instrumentId/mappings', () => {
return request(app)
.post('/api/instruments/a35c6ac4-53f7-49b7-82e3-7a0aba5c2c45/mappings')
.send({
lowerRank: 55,
upperRank: 56,
referenceRank: 55,
sampleId: '636f247a-dc88-4b52-b8e8-78448b5e5790'
})
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(201)
.then(res => {
expect(res.body, 'body should be an object')
expect(res.body.lowerRank, 'lowerRank should equal 55').to.equal(55)
expect(res.body.upperRank, 'upperRank should equal 56').to.equal(56)
expect(res.body.referenceRank, 'referenceRank should equal 55').to.equal(55)
expect(res.body.sampleId).to.equal('636f247a-dc88-4b52-b8e8-78448b5e5790', 'sampleId should equal 636f247a-dc88-4b52-b8e8-78448b5e5790')
expect(res.body.instrumentId).to.equal('a35c6ac4-53f7-49b7-82e3-7a0aba5c2c45', 'instrumentId should equal a35c6ac4-53f7-49b7-82e3-7a0aba5c2c45')
})
})
it('should return 200 GET /api/mappings/:id', () => {
return request(app)
.get('/api/mappings/1bcab515-ed82-4449-aec9-16a6142b0d15')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(200)
.then((res) => {
expect(res.body, 'body should be an object').to.be.an('object')
expect(res.body.id, 'id should equal 1bcab515-ed82-4449-aec9-16a6142b0d15').to.equal('1bcab515-ed82-4449-aec9-16a6142b0d15')
})
})
it('should return 200 on PUT /api/mappings/:id', () => {
return request(app)
.put('/api/mappings/712fda5f-3ff5-4e23-8949-320a96e0d565')
.send({
lowerRank: 45,
upperRank: 46,
referenceRank: 45,
sampleId: '0f1ed577-955a-494d-868c-cf4dc5c3c892'
})
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(200)
.then(res => {
expect(res.body.lowerRank, 'lowerRank should equal 45').to.equal(45)
expect(res.body.upperRank, 'upperRank should equal 46').to.equal(46)
expect(res.body.referenceRank, 'referenceRank should equal 45').to.equal(45)
expect(res.body.sampleId).to.equal('0f1ed577-955a-494d-868c-cf4dc5c3c892', 'sampleId should equal 0f1ed577-955a-494d-868c-cf4dc5c3c892')
})
})
it('should return 404 on PUT /api/mappings/:id when id is unknown', () => {
return request(app)
.put('/api/mappings/bb459a9e-0d2c-4da1-b538-88ea43d30f8c')
.send({
sampleId: '0f1ed577-955a-494d-868c-cf4dc5c3c892'
})
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(404)
.then((res) => {
expect(res.body, 'body should be a object').to.be.an('object')
expect(res.body).to.include({
msg: 'Failed to retrieve instrument mapping n°bb459a9e-0d2c-4da1-b538-88ea43d30f8c',
name: 'DatabaseError'
})
})
})
it('should return 204 on DELETE /api/mappings/:id', () => {
return request(app)
.delete('/api/mappings/712fda5f-3ff5-4e23-8949-320a96e0d565')
.expect(204)
.then((res) => {
expect(res.body, 'body should be empty').to.be.empty
})
})
it('should return 404 on DELETE /api/mappings/:id when id is unknown', () => {
return request(app)
.delete('/api/mappings/bb459a9e-0d2c-4da1-b538-88ea43d30f8c')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(404)
.then((res) => {
expect(res.body, 'body should be a object').to.be.an('object')
expect(res.body).to.include({
msg: 'Failed to retrieve instrument mapping n°bb459a9e-0d2c-4da1-b538-88ea43d30f8c',
name: 'DatabaseError'
})
})
})
})
| lighting-perspectives/jams | server/test/integration/instrument-mappings.test.js | JavaScript | mit | 5,577 |
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("a11yhelp","es",{title:"Instrucciones de accesibilidad",contents:"Ayuda. Para cerrar presione ESC.",legend:[{name:"General",items:[{name:"Barra de herramientas del editor",legend:'Presiona ${toolbarFocus} para navegar por la barra de herramientas. Para moverse por los distintos grupos de herramientas usa las teclas TAB y MAY-TAB. Para moverse por las distintas herramientas usa FLECHA DERECHA o FECHA IZQUIERDA. Presiona "espacio" o "intro" para activar la herramienta.'},{name:"Editor de diálogo",
legend:"Dentro de un cuadro de diálogo, presione la tecla TAB para desplazarse al campo siguiente del cuadro de diálogo, pulse SHIFT + TAB para desplazarse al campo anterior, pulse ENTER para presentar cuadro de diálogo, pulse la tecla ESC para cancelar el diálogo. Para los diálogos que tienen varias páginas, presione ALT + F10 para navegar a la pestaña de la lista. Luego pasar a la siguiente pestaña con TAB o FLECHA DERECHA. Para ir a la ficha anterior con SHIFT + TAB o FLECHA IZQUIERDA. Presione ESPACIO o ENTRAR para seleccionar la página de ficha."},
{name:"Editor del menú contextual",legend:"Presiona ${contextMenu} o TECLA MENÚ para abrir el menú contextual. Entonces muévete a la siguiente opción del menú con TAB o FLECHA ABAJO. Muévete a la opción previa con SHIFT + TAB o FLECHA ARRIBA. Presiona ESPACIO o ENTER para seleccionar la opción del menú. Abre el submenú de la opción actual con ESPACIO o ENTER o FLECHA DERECHA. Regresa al elemento padre del menú con ESC o FLECHA IZQUIERDA. Cierra el menú contextual con ESC."},{name:"Lista del Editor",
legend:"Dentro de una lista, te mueves al siguiente elemento de la lista con TAB o FLECHA ABAJO. Te mueves al elemento previo de la lista con SHIFT + TAB o FLECHA ARRIBA. Presiona ESPACIO o ENTER para elegir la opción de la lista. Presiona ESC para cerrar la lista."},{name:"Barra de Ruta del Elemento en el Editor",legend:"Presiona ${elementsPathFocus} para navegar a los elementos de la barra de ruta. Te mueves al siguiente elemento botón con TAB o FLECHA DERECHA. Te mueves al botón previo con SHIFT + TAB o FLECHA IZQUIERDA. Presiona ESPACIO o ENTER para seleccionar el elemento en el editor."}]},
{name:"Comandos",items:[{name:"Comando deshacer",legend:"Presiona ${undo}"},{name:"Comando rehacer",legend:"Presiona ${redo}"},{name:"Comando negrita",legend:"Presiona ${bold}"},{name:"Comando itálica",legend:"Presiona ${italic}"},{name:"Comando subrayar",legend:"Presiona ${underline}"},{name:"Comando liga",legend:"Presiona ${liga}"},{name:"Comando colapsar barra de herramientas",legend:"Presiona ${toolbarCollapse}"},{name:"Comando accesar el anterior espacio de foco",legend:"Presiona ${accessPreviousSpace} para accesar el espacio de foco no disponible más cercano anterior al cursor, por ejemplo: dos elementos HR adyacentes. Repite la combinación de teclas para alcanzar espacios de foco distantes."},
{name:"Comando accesar el siguiente spacio de foco",legend:"Presiona ${accessNextSpace} para accesar el espacio de foco no disponible más cercano después del cursor, por ejemplo: dos elementos HR adyacentes. Repite la combinación de teclas para alcanzar espacios de foco distantes."},{name:"Ayuda de Accesibilidad",legend:"Presiona ${a11yHelp}"}]}]});
| rsuarezdeveloper/smath | web/js/plugin/ckeditor/plugins/a11yhelp/dialogs/lang/es.js | JavaScript | mit | 3,434 |
/**
* @license Highcharts JS v9.0.1 (2021-02-16)
* @module highcharts/modules/dependency-wheel
* @requires highcharts
* @requires highcharts/modules/sankey
*
* Dependency wheel module
*
* (c) 2010-2021 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
import '../../Series/DependencyWheel/DependencyWheelSeries.js';
| cdnjs/cdnjs | ajax/libs/highcharts/9.0.1/es-modules/masters/modules/dependency-wheel.src.js | JavaScript | mit | 349 |
/*!
* OOUI v0.40.3
* https://www.mediawiki.org/wiki/OOUI
*
* Copyright 2011–2020 OOUI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
* Date: 2020-09-02T15:42:49Z
*/
( function ( OO ) {
'use strict';
/**
* An ActionWidget is a {@link OO.ui.ButtonWidget button widget} that executes an action.
* Action widgets are used with OO.ui.ActionSet, which manages the behavior and availability
* of the actions.
*
* Both actions and action sets are primarily used with {@link OO.ui.Dialog Dialogs}.
* Please see the [OOUI documentation on MediaWiki] [1] for more information
* and examples.
*
* [1]: https://www.mediawiki.org/wiki/OOUI/Windows/Process_Dialogs#Action_sets
*
* @class
* @extends OO.ui.ButtonWidget
* @mixins OO.ui.mixin.PendingElement
*
* @constructor
* @param {Object} [config] Configuration options
* @cfg {string} [action] Symbolic name of the action (e.g., ‘continue’ or ‘cancel’).
* @cfg {string[]} [modes] Symbolic names of the modes (e.g., ‘edit’ or ‘read’) in which the action
* should be made available. See the action set's {@link OO.ui.ActionSet#setMode setMode} method
* for more information about setting modes.
* @cfg {boolean} [framed=false] Render the action button with a frame
*/
OO.ui.ActionWidget = function OoUiActionWidget( config ) {
// Configuration initialization
config = $.extend( { framed: false }, config );
// Parent constructor
OO.ui.ActionWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.PendingElement.call( this, config );
// Properties
this.action = config.action || '';
this.modes = config.modes || [];
this.width = 0;
this.height = 0;
// Initialization
this.$element.addClass( 'oo-ui-actionWidget' );
};
/* Setup */
OO.inheritClass( OO.ui.ActionWidget, OO.ui.ButtonWidget );
OO.mixinClass( OO.ui.ActionWidget, OO.ui.mixin.PendingElement );
/* Methods */
/**
* Check if the action is configured to be available in the specified `mode`.
*
* @param {string} mode Name of mode
* @return {boolean} The action is configured with the mode
*/
OO.ui.ActionWidget.prototype.hasMode = function ( mode ) {
return this.modes.indexOf( mode ) !== -1;
};
/**
* Get the symbolic name of the action (e.g., ‘continue’ or ‘cancel’).
*
* @return {string}
*/
OO.ui.ActionWidget.prototype.getAction = function () {
return this.action;
};
/**
* Get the symbolic name of the mode or modes for which the action is configured to be available.
*
* The current mode is set with the action set's {@link OO.ui.ActionSet#setMode setMode} method.
* Only actions that are configured to be available in the current mode will be visible.
* All other actions are hidden.
*
* @return {string[]}
*/
OO.ui.ActionWidget.prototype.getModes = function () {
return this.modes.slice();
};
/* eslint-disable no-unused-vars */
/**
* ActionSets manage the behavior of the {@link OO.ui.ActionWidget action widgets} that
* comprise them.
* Actions can be made available for specific contexts (modes) and circumstances
* (abilities). Action sets are primarily used with {@link OO.ui.Dialog Dialogs}.
*
* ActionSets contain two types of actions:
*
* - Special: Special actions are the first visible actions with special flags, such as 'safe' and
* 'primary', the default special flags. Additional special flags can be configured in subclasses
* with the static #specialFlags property.
* - Other: Other actions include all non-special visible actions.
*
* See the [OOUI documentation on MediaWiki][1] for more information.
*
* @example
* // Example: An action set used in a process dialog
* function MyProcessDialog( config ) {
* MyProcessDialog.super.call( this, config );
* }
* OO.inheritClass( MyProcessDialog, OO.ui.ProcessDialog );
* MyProcessDialog.static.title = 'An action set in a process dialog';
* MyProcessDialog.static.name = 'myProcessDialog';
* // An action set that uses modes ('edit' and 'help' mode, in this example).
* MyProcessDialog.static.actions = [
* {
* action: 'continue',
* modes: 'edit',
* label: 'Continue',
* flags: [ 'primary', 'progressive' ]
* },
* { action: 'help', modes: 'edit', label: 'Help' },
* { modes: 'edit', label: 'Cancel', flags: 'safe' },
* { action: 'back', modes: 'help', label: 'Back', flags: 'safe' }
* ];
*
* MyProcessDialog.prototype.initialize = function () {
* MyProcessDialog.super.prototype.initialize.apply( this, arguments );
* this.panel1 = new OO.ui.PanelLayout( { padded: true, expanded: false } );
* this.panel1.$element.append( '<p>This dialog uses an action set (continue, help, ' +
* 'cancel, back) configured with modes. This is edit mode. Click \'help\' to see ' +
* 'help mode.</p>' );
* this.panel2 = new OO.ui.PanelLayout( { padded: true, expanded: false } );
* this.panel2.$element.append( '<p>This is help mode. Only the \'back\' action widget ' +
* 'is configured to be visible here. Click \'back\' to return to \'edit\' mode.' +
* '</p>' );
* this.stackLayout = new OO.ui.StackLayout( {
* items: [ this.panel1, this.panel2 ]
* } );
* this.$body.append( this.stackLayout.$element );
* };
* MyProcessDialog.prototype.getSetupProcess = function ( data ) {
* return MyProcessDialog.super.prototype.getSetupProcess.call( this, data )
* .next( function () {
* this.actions.setMode( 'edit' );
* }, this );
* };
* MyProcessDialog.prototype.getActionProcess = function ( action ) {
* if ( action === 'help' ) {
* this.actions.setMode( 'help' );
* this.stackLayout.setItem( this.panel2 );
* } else if ( action === 'back' ) {
* this.actions.setMode( 'edit' );
* this.stackLayout.setItem( this.panel1 );
* } else if ( action === 'continue' ) {
* var dialog = this;
* return new OO.ui.Process( function () {
* dialog.close();
* } );
* }
* return MyProcessDialog.super.prototype.getActionProcess.call( this, action );
* };
* MyProcessDialog.prototype.getBodyHeight = function () {
* return this.panel1.$element.outerHeight( true );
* };
* var windowManager = new OO.ui.WindowManager();
* $( document.body ).append( windowManager.$element );
* var dialog = new MyProcessDialog( {
* size: 'medium'
* } );
* windowManager.addWindows( [ dialog ] );
* windowManager.openWindow( dialog );
*
* [1]: https://www.mediawiki.org/wiki/OOUI/Windows/Process_Dialogs#Action_sets
*
* @abstract
* @class
* @mixins OO.EventEmitter
*
* @constructor
* @param {Object} [config] Configuration options
*/
OO.ui.ActionSet = function OoUiActionSet( config ) {
// Configuration initialization
config = config || {};
// Mixin constructors
OO.EventEmitter.call( this );
// Properties
this.list = [];
this.categories = {
actions: 'getAction',
flags: 'getFlags',
modes: 'getModes'
};
this.categorized = {};
this.special = {};
this.others = [];
this.organized = false;
this.changing = false;
this.changed = false;
};
/* eslint-enable no-unused-vars */
/* Setup */
OO.mixinClass( OO.ui.ActionSet, OO.EventEmitter );
/* Static Properties */
/**
* Symbolic name of the flags used to identify special actions. Special actions are displayed in the
* header of a {@link OO.ui.ProcessDialog process dialog}.
* See the [OOUI documentation on MediaWiki][2] for more information and examples.
*
* [2]:https://www.mediawiki.org/wiki/OOUI/Windows/Process_Dialogs
*
* @abstract
* @static
* @inheritable
* @property {string}
*/
OO.ui.ActionSet.static.specialFlags = [ 'safe', 'primary' ];
/* Events */
/**
* @event click
*
* A 'click' event is emitted when an action is clicked.
*
* @param {OO.ui.ActionWidget} action Action that was clicked
*/
/**
* @event add
*
* An 'add' event is emitted when actions are {@link #method-add added} to the action set.
*
* @param {OO.ui.ActionWidget[]} added Actions added
*/
/**
* @event remove
*
* A 'remove' event is emitted when actions are {@link #method-remove removed}
* or {@link #clear cleared}.
*
* @param {OO.ui.ActionWidget[]} added Actions removed
*/
/**
* @event change
*
* A 'change' event is emitted when actions are {@link #method-add added}, {@link #clear cleared},
* or {@link #method-remove removed} from the action set or when the {@link #setMode mode}
* is changed.
*
*/
/* Methods */
/**
* Handle action change events.
*
* @private
* @fires change
*/
OO.ui.ActionSet.prototype.onActionChange = function () {
this.organized = false;
if ( this.changing ) {
this.changed = true;
} else {
this.emit( 'change' );
}
};
/**
* Check if an action is one of the special actions.
*
* @param {OO.ui.ActionWidget} action Action to check
* @return {boolean} Action is special
*/
OO.ui.ActionSet.prototype.isSpecial = function ( action ) {
var flag;
for ( flag in this.special ) {
if ( action === this.special[ flag ] ) {
return true;
}
}
return false;
};
/**
* Get action widgets based on the specified filter: ‘actions’, ‘flags’, ‘modes’, ‘visible’,
* or ‘disabled’.
*
* @param {Object} [filters] Filters to use, omit to get all actions
* @param {string|string[]} [filters.actions] Actions that action widgets must have
* @param {string|string[]} [filters.flags] Flags that action widgets must have (e.g., 'safe')
* @param {string|string[]} [filters.modes] Modes that action widgets must have
* @param {boolean} [filters.visible] Action widgets must be visible
* @param {boolean} [filters.disabled] Action widgets must be disabled
* @return {OO.ui.ActionWidget[]} Action widgets matching all criteria
*/
OO.ui.ActionSet.prototype.get = function ( filters ) {
var i, len, list, category, actions, index, match, matches;
if ( filters ) {
this.organize();
// Collect category candidates
matches = [];
for ( category in this.categorized ) {
list = filters[ category ];
if ( list ) {
if ( !Array.isArray( list ) ) {
list = [ list ];
}
for ( i = 0, len = list.length; i < len; i++ ) {
actions = this.categorized[ category ][ list[ i ] ];
if ( Array.isArray( actions ) ) {
matches.push.apply( matches, actions );
}
}
}
}
// Remove by boolean filters
for ( i = 0, len = matches.length; i < len; i++ ) {
match = matches[ i ];
if (
( filters.visible !== undefined && match.isVisible() !== filters.visible ) ||
( filters.disabled !== undefined && match.isDisabled() !== filters.disabled )
) {
matches.splice( i, 1 );
len--;
i--;
}
}
// Remove duplicates
for ( i = 0, len = matches.length; i < len; i++ ) {
match = matches[ i ];
index = matches.lastIndexOf( match );
while ( index !== i ) {
matches.splice( index, 1 );
len--;
index = matches.lastIndexOf( match );
}
}
return matches;
}
return this.list.slice();
};
/**
* Get 'special' actions.
*
* Special actions are the first visible action widgets with special flags, such as 'safe' and
* 'primary'.
* Special flags can be configured in subclasses by changing the static #specialFlags property.
*
* @return {OO.ui.ActionWidget[]|null} 'Special' action widgets.
*/
OO.ui.ActionSet.prototype.getSpecial = function () {
this.organize();
return $.extend( {}, this.special );
};
/**
* Get 'other' actions.
*
* Other actions include all non-special visible action widgets.
*
* @return {OO.ui.ActionWidget[]} 'Other' action widgets
*/
OO.ui.ActionSet.prototype.getOthers = function () {
this.organize();
return this.others.slice();
};
/**
* Set the mode (e.g., ‘edit’ or ‘view’). Only {@link OO.ui.ActionWidget#modes actions} configured
* to be available in the specified mode will be made visible. All other actions will be hidden.
*
* @param {string} mode The mode. Only actions configured to be available in the specified
* mode will be made visible.
* @chainable
* @return {OO.ui.ActionSet} The widget, for chaining
* @fires toggle
* @fires change
*/
OO.ui.ActionSet.prototype.setMode = function ( mode ) {
var i, len, action;
this.changing = true;
for ( i = 0, len = this.list.length; i < len; i++ ) {
action = this.list[ i ];
action.toggle( action.hasMode( mode ) );
}
this.organized = false;
this.changing = false;
this.emit( 'change' );
return this;
};
/**
* Set the abilities of the specified actions.
*
* Action widgets that are configured with the specified actions will be enabled
* or disabled based on the boolean values specified in the `actions`
* parameter.
*
* @param {Object.<string,boolean>} actions A list keyed by action name with boolean
* values that indicate whether or not the action should be enabled.
* @chainable
* @return {OO.ui.ActionSet} The widget, for chaining
*/
OO.ui.ActionSet.prototype.setAbilities = function ( actions ) {
var i, len, action, item;
for ( i = 0, len = this.list.length; i < len; i++ ) {
item = this.list[ i ];
action = item.getAction();
if ( actions[ action ] !== undefined ) {
item.setDisabled( !actions[ action ] );
}
}
return this;
};
/**
* Executes a function once per action.
*
* When making changes to multiple actions, use this method instead of iterating over the actions
* manually to defer emitting a #change event until after all actions have been changed.
*
* @param {Object|null} filter Filters to use to determine which actions to iterate over; see #get
* @param {Function} callback Callback to run for each action; callback is invoked with three
* arguments: the action, the action's index, the list of actions being iterated over
* @chainable
* @return {OO.ui.ActionSet} The widget, for chaining
*/
OO.ui.ActionSet.prototype.forEach = function ( filter, callback ) {
this.changed = false;
this.changing = true;
this.get( filter ).forEach( callback );
this.changing = false;
if ( this.changed ) {
this.emit( 'change' );
}
return this;
};
/**
* Add action widgets to the action set.
*
* @param {OO.ui.ActionWidget[]} actions Action widgets to add
* @chainable
* @return {OO.ui.ActionSet} The widget, for chaining
* @fires add
* @fires change
*/
OO.ui.ActionSet.prototype.add = function ( actions ) {
var i, len, action;
this.changing = true;
for ( i = 0, len = actions.length; i < len; i++ ) {
action = actions[ i ];
action.connect( this, {
click: [ 'emit', 'click', action ],
toggle: [ 'onActionChange' ]
} );
this.list.push( action );
}
this.organized = false;
this.emit( 'add', actions );
this.changing = false;
this.emit( 'change' );
return this;
};
/**
* Remove action widgets from the set.
*
* To remove all actions, you may wish to use the #clear method instead.
*
* @param {OO.ui.ActionWidget[]} actions Action widgets to remove
* @chainable
* @return {OO.ui.ActionSet} The widget, for chaining
* @fires remove
* @fires change
*/
OO.ui.ActionSet.prototype.remove = function ( actions ) {
var i, len, index, action;
this.changing = true;
for ( i = 0, len = actions.length; i < len; i++ ) {
action = actions[ i ];
index = this.list.indexOf( action );
if ( index !== -1 ) {
action.disconnect( this );
this.list.splice( index, 1 );
}
}
this.organized = false;
this.emit( 'remove', actions );
this.changing = false;
this.emit( 'change' );
return this;
};
/**
* Remove all action widgets from the set.
*
* To remove only specified actions, use the {@link #method-remove remove} method instead.
*
* @chainable
* @return {OO.ui.ActionSet} The widget, for chaining
* @fires remove
* @fires change
*/
OO.ui.ActionSet.prototype.clear = function () {
var i, len, action,
removed = this.list.slice();
this.changing = true;
for ( i = 0, len = this.list.length; i < len; i++ ) {
action = this.list[ i ];
action.disconnect( this );
}
this.list = [];
this.organized = false;
this.emit( 'remove', removed );
this.changing = false;
this.emit( 'change' );
return this;
};
/**
* Organize actions.
*
* This is called whenever organized information is requested. It will only reorganize the actions
* if something has changed since the last time it ran.
*
* @private
* @chainable
* @return {OO.ui.ActionSet} The widget, for chaining
*/
OO.ui.ActionSet.prototype.organize = function () {
var i, iLen, j, jLen, flag, action, category, list, item, special,
specialFlags = this.constructor.static.specialFlags;
if ( !this.organized ) {
this.categorized = {};
this.special = {};
this.others = [];
for ( i = 0, iLen = this.list.length; i < iLen; i++ ) {
action = this.list[ i ];
if ( action.isVisible() ) {
// Populate categories
for ( category in this.categories ) {
if ( !this.categorized[ category ] ) {
this.categorized[ category ] = {};
}
list = action[ this.categories[ category ] ]();
if ( !Array.isArray( list ) ) {
list = [ list ];
}
for ( j = 0, jLen = list.length; j < jLen; j++ ) {
item = list[ j ];
if ( !this.categorized[ category ][ item ] ) {
this.categorized[ category ][ item ] = [];
}
this.categorized[ category ][ item ].push( action );
}
}
// Populate special/others
special = false;
for ( j = 0, jLen = specialFlags.length; j < jLen; j++ ) {
flag = specialFlags[ j ];
if ( !this.special[ flag ] && action.hasFlag( flag ) ) {
this.special[ flag ] = action;
special = true;
break;
}
}
if ( !special ) {
this.others.push( action );
}
}
}
this.organized = true;
}
return this;
};
/**
* Errors contain a required message (either a string or jQuery selection) that is used to describe
* what went wrong in a {@link OO.ui.Process process}. The error's #recoverable and #warning
* configurations are used to customize the appearance and functionality of the error interface.
*
* The basic error interface contains a formatted error message as well as two buttons: 'Dismiss'
* and 'Try again' (i.e., the error is 'recoverable' by default). If the error is not recoverable,
* the 'Try again' button will not be rendered and the widget that initiated the failed process will
* be disabled.
*
* If the error is a warning, the error interface will include a 'Dismiss' and a 'Continue' button,
* which will try the process again.
*
* For an example of error interfaces, please see the [OOUI documentation on MediaWiki][1].
*
* [1]: https://www.mediawiki.org/wiki/OOUI/Windows/Process_Dialogs#Processes_and_errors
*
* @class
*
* @constructor
* @param {string|jQuery} message Description of error
* @param {Object} [config] Configuration options
* @cfg {boolean} [recoverable=true] Error is recoverable.
* By default, errors are recoverable, and users can try the process again.
* @cfg {boolean} [warning=false] Error is a warning.
* If the error is a warning, the error interface will include a
* 'Dismiss' and a 'Continue' button. It is the responsibility of the developer to ensure that the
* warning is not triggered a second time if the user chooses to continue.
*/
OO.ui.Error = function OoUiError( message, config ) {
// Allow passing positional parameters inside the config object
if ( OO.isPlainObject( message ) && config === undefined ) {
config = message;
message = config.message;
}
// Configuration initialization
config = config || {};
// Properties
this.message = message instanceof $ ? message : String( message );
this.recoverable = config.recoverable === undefined || !!config.recoverable;
this.warning = !!config.warning;
};
/* Setup */
OO.initClass( OO.ui.Error );
/* Methods */
/**
* Check if the error is recoverable.
*
* If the error is recoverable, users are able to try the process again.
*
* @return {boolean} Error is recoverable
*/
OO.ui.Error.prototype.isRecoverable = function () {
return this.recoverable;
};
/**
* Check if the error is a warning.
*
* If the error is a warning, the error interface will include a 'Dismiss' and a 'Continue' button.
*
* @return {boolean} Error is warning
*/
OO.ui.Error.prototype.isWarning = function () {
return this.warning;
};
/**
* Get error message as DOM nodes.
*
* @return {jQuery} Error message in DOM nodes
*/
OO.ui.Error.prototype.getMessage = function () {
return this.message instanceof $ ?
this.message.clone() :
$( '<div>' ).text( this.message ).contents();
};
/**
* Get the error message text.
*
* @return {string} Error message
*/
OO.ui.Error.prototype.getMessageText = function () {
return this.message instanceof $ ? this.message.text() : this.message;
};
/**
* A Process is a list of steps that are called in sequence. The step can be a number, a
* promise (jQuery, native, or any other “thenable”), or a function:
*
* - **number**: the process will wait for the specified number of milliseconds before proceeding.
* - **promise**: the process will continue to the next step when the promise is successfully
* resolved or stop if the promise is rejected.
* - **function**: the process will execute the function. The process will stop if the function
* returns either a boolean `false` or a promise that is rejected; if the function returns a
* number, the process will wait for that number of milliseconds before proceeding.
*
* If the process fails, an {@link OO.ui.Error error} is generated. Depending on how the error is
* configured, users can dismiss the error and try the process again, or not. If a process is
* stopped, its remaining steps will not be performed.
*
* @class
*
* @constructor
* @param {number|jQuery.Promise|Function} step Number of milliseconds to wait before proceeding,
* promise that must be resolved before proceeding, or a function to execute. See #createStep for
* more information. See #createStep for more information.
* @param {Object} [context=null] Execution context of the function. The context is ignored if the
* step is a number or promise.
*/
OO.ui.Process = function ( step, context ) {
// Properties
this.steps = [];
// Initialization
if ( step !== undefined ) {
this.next( step, context );
}
};
/* Setup */
OO.initClass( OO.ui.Process );
/* Methods */
/**
* Start the process.
*
* @return {jQuery.Promise} Promise that is resolved when all steps have successfully completed.
* If any of the steps return a promise that is rejected or a boolean false, this promise is
* rejected and any remaining steps are not performed.
*/
OO.ui.Process.prototype.execute = function () {
var i, len, promise;
/**
* Continue execution.
*
* @ignore
* @param {Array} step A function and the context it should be called in
* @return {Function} Function that continues the process
*/
function proceed( step ) {
return function () {
// Execute step in the correct context
var deferred,
result = step.callback.call( step.context );
if ( result === false ) {
// Use rejected promise for boolean false results
return $.Deferred().reject( [] ).promise();
}
if ( typeof result === 'number' ) {
if ( result < 0 ) {
throw new Error( 'Cannot go back in time: flux capacitor is out of service' );
}
// Use a delayed promise for numbers, expecting them to be in milliseconds
deferred = $.Deferred();
setTimeout( deferred.resolve, result );
return deferred.promise();
}
if ( result instanceof OO.ui.Error ) {
// Use rejected promise for error
return $.Deferred().reject( [ result ] ).promise();
}
if ( Array.isArray( result ) && result.length && result[ 0 ] instanceof OO.ui.Error ) {
// Use rejected promise for list of errors
return $.Deferred().reject( result ).promise();
}
// Duck-type the object to see if it can produce a promise
if ( result && typeof result.then === 'function' ) {
// Use a promise generated from the result
return $.when( result ).promise();
}
// Use resolved promise for other results
return $.Deferred().resolve().promise();
};
}
if ( this.steps.length ) {
// Generate a chain reaction of promises
promise = proceed( this.steps[ 0 ] )();
for ( i = 1, len = this.steps.length; i < len; i++ ) {
promise = promise.then( proceed( this.steps[ i ] ) );
}
} else {
promise = $.Deferred().resolve().promise();
}
return promise;
};
/**
* Create a process step.
*
* @private
* @param {number|jQuery.Promise|Function} step
*
* - Number of milliseconds to wait before proceeding
* - Promise that must be resolved before proceeding
* - Function to execute
* - If the function returns a boolean false the process will stop
* - If the function returns a promise, the process will continue to the next
* step when the promise is resolved or stop if the promise is rejected
* - If the function returns a number, the process will wait for that number of
* milliseconds before proceeding
* @param {Object} [context=null] Execution context of the function. The context is
* ignored if the step is a number or promise.
* @return {Object} Step object, with `callback` and `context` properties
*/
OO.ui.Process.prototype.createStep = function ( step, context ) {
if ( typeof step === 'number' || typeof step.then === 'function' ) {
return {
callback: function () {
return step;
},
context: null
};
}
if ( typeof step === 'function' ) {
return {
callback: step,
context: context
};
}
throw new Error( 'Cannot create process step: number, promise or function expected' );
};
/**
* Add step to the beginning of the process.
*
* @inheritdoc #createStep
* @return {OO.ui.Process} this
* @chainable
*/
OO.ui.Process.prototype.first = function ( step, context ) {
this.steps.unshift( this.createStep( step, context ) );
return this;
};
/**
* Add step to the end of the process.
*
* @inheritdoc #createStep
* @return {OO.ui.Process} this
* @chainable
*/
OO.ui.Process.prototype.next = function ( step, context ) {
this.steps.push( this.createStep( step, context ) );
return this;
};
/**
* A window instance represents the life cycle for one single opening of a window
* until its closing.
*
* While OO.ui.WindowManager will reuse OO.ui.Window objects, each time a window is
* opened, a new lifecycle starts.
*
* For more information, please see the [OOUI documentation on MediaWiki] [1].
*
* [1]: https://www.mediawiki.org/wiki/OOUI/Windows
*
* @class
*
* @constructor
*/
OO.ui.WindowInstance = function OoUiWindowInstance() {
var deferreds = {
opening: $.Deferred(),
opened: $.Deferred(),
closing: $.Deferred(),
closed: $.Deferred()
};
/**
* @private
* @property {Object}
*/
this.deferreds = deferreds;
// Set these up as chained promises so that rejecting of
// an earlier stage automatically rejects the subsequent
// would-be stages as well.
/**
* @property {jQuery.Promise}
*/
this.opening = deferreds.opening.promise();
/**
* @property {jQuery.Promise}
*/
this.opened = this.opening.then( function () {
return deferreds.opened;
} );
/**
* @property {jQuery.Promise}
*/
this.closing = this.opened.then( function () {
return deferreds.closing;
} );
/**
* @property {jQuery.Promise}
*/
this.closed = this.closing.then( function () {
return deferreds.closed;
} );
};
/* Setup */
OO.initClass( OO.ui.WindowInstance );
/**
* Check if window is opening.
*
* @return {boolean} Window is opening
*/
OO.ui.WindowInstance.prototype.isOpening = function () {
return this.deferreds.opened.state() === 'pending';
};
/**
* Check if window is opened.
*
* @return {boolean} Window is opened
*/
OO.ui.WindowInstance.prototype.isOpened = function () {
return this.deferreds.opened.state() === 'resolved' &&
this.deferreds.closing.state() === 'pending';
};
/**
* Check if window is closing.
*
* @return {boolean} Window is closing
*/
OO.ui.WindowInstance.prototype.isClosing = function () {
return this.deferreds.closing.state() === 'resolved' &&
this.deferreds.closed.state() === 'pending';
};
/**
* Check if window is closed.
*
* @return {boolean} Window is closed
*/
OO.ui.WindowInstance.prototype.isClosed = function () {
return this.deferreds.closed.state() === 'resolved';
};
/**
* Window managers are used to open and close {@link OO.ui.Window windows} and control their
* presentation. Managed windows are mutually exclusive. If a new window is opened while a current
* window is opening or is opened, the current window will be closed and any on-going
* {@link OO.ui.Process process} will be cancelled. Windows
* themselves are persistent and—rather than being torn down when closed—can be repopulated with the
* pertinent data and reused.
*
* Over the lifecycle of a window, the window manager makes available three promises: `opening`,
* `opened`, and `closing`, which represent the primary stages of the cycle:
*
* **Opening**: the opening stage begins when the window manager’s #openWindow or a window’s
* {@link OO.ui.Window#open open} method is used, and the window manager begins to open the window.
*
* - an `opening` event is emitted with an `opening` promise
* - the #getSetupDelay method is called and the returned value is used to time a pause in execution
* before the window’s {@link OO.ui.Window#method-setup setup} method is called which executes
* OO.ui.Window#getSetupProcess.
* - a `setup` progress notification is emitted from the `opening` promise
* - the #getReadyDelay method is called the returned value is used to time a pause in execution
* before the window’s {@link OO.ui.Window#method-ready ready} method is called which executes
* OO.ui.Window#getReadyProcess.
* - a `ready` progress notification is emitted from the `opening` promise
* - the `opening` promise is resolved with an `opened` promise
*
* **Opened**: the window is now open.
*
* **Closing**: the closing stage begins when the window manager's #closeWindow or the
* window's {@link OO.ui.Window#close close} methods is used, and the window manager begins
* to close the window.
*
* - the `opened` promise is resolved with `closing` promise and a `closing` event is emitted
* - the #getHoldDelay method is called and the returned value is used to time a pause in execution
* before the window's {@link OO.ui.Window#getHoldProcess getHoldProcess} method is called on the
* window and its result executed
* - a `hold` progress notification is emitted from the `closing` promise
* - the #getTeardownDelay() method is called and the returned value is used to time a pause in
* execution before the window's {@link OO.ui.Window#getTeardownProcess getTeardownProcess} method
* is called on the window and its result executed
* - a `teardown` progress notification is emitted from the `closing` promise
* - the `closing` promise is resolved. The window is now closed
*
* See the [OOUI documentation on MediaWiki][1] for more information.
*
* [1]: https://www.mediawiki.org/wiki/OOUI/Windows/Window_managers
*
* @class
* @extends OO.ui.Element
* @mixins OO.EventEmitter
*
* @constructor
* @param {Object} [config] Configuration options
* @cfg {OO.Factory} [factory] Window factory to use for automatic instantiation
* Note that window classes that are instantiated with a factory must have
* a {@link OO.ui.Dialog#static-name static name} property that specifies a symbolic name.
* @cfg {boolean} [modal=true] Prevent interaction outside the dialog
*/
OO.ui.WindowManager = function OoUiWindowManager( config ) {
// Configuration initialization
config = config || {};
// Parent constructor
OO.ui.WindowManager.super.call( this, config );
// Mixin constructors
OO.EventEmitter.call( this );
// Properties
this.factory = config.factory;
this.modal = config.modal === undefined || !!config.modal;
this.windows = {};
// Deprecated placeholder promise given to compatOpening in openWindow()
// that is resolved in closeWindow().
this.compatOpened = null;
this.preparingToOpen = null;
this.preparingToClose = null;
this.currentWindow = null;
this.globalEvents = false;
this.$returnFocusTo = null;
this.$ariaHidden = null;
this.onWindowResizeTimeout = null;
this.onWindowResizeHandler = this.onWindowResize.bind( this );
this.afterWindowResizeHandler = this.afterWindowResize.bind( this );
// Initialization
this.$element
.addClass( 'oo-ui-windowManager' )
.toggleClass( 'oo-ui-windowManager-modal', this.modal );
if ( this.modal ) {
this.$element.attr( 'aria-hidden', true );
}
};
/* Setup */
OO.inheritClass( OO.ui.WindowManager, OO.ui.Element );
OO.mixinClass( OO.ui.WindowManager, OO.EventEmitter );
/* Events */
/**
* An 'opening' event is emitted when the window begins to be opened.
*
* @event opening
* @param {OO.ui.Window} win Window that's being opened
* @param {jQuery.Promise} opened A promise resolved with a value when the window is opened
* successfully. This promise also emits `setup` and `ready` notifications. When this promise is
* resolved, the first argument of the value is an 'closed' promise, the second argument is the
* opening data.
* @param {Object} data Window opening data
*/
/**
* A 'closing' event is emitted when the window begins to be closed.
*
* @event closing
* @param {OO.ui.Window} win Window that's being closed
* @param {jQuery.Promise} closed A promise resolved with a value when the window is closed
* successfully. This promise also emits `hold` and `teardown` notifications. When this promise is
* resolved, the first argument of its value is the closing data.
* @param {Object} data Window closing data
*/
/**
* A 'resize' event is emitted when a window is resized.
*
* @event resize
* @param {OO.ui.Window} win Window that was resized
*/
/* Static Properties */
/**
* Map of the symbolic name of each window size and its CSS properties.
*
* @static
* @inheritable
* @property {Object}
*/
OO.ui.WindowManager.static.sizes = {
small: {
width: 300
},
medium: {
width: 500
},
large: {
width: 700
},
larger: {
width: 900
},
full: {
// These can be non-numeric because they are never used in calculations
width: '100%',
height: '100%'
}
};
/**
* Symbolic name of the default window size.
*
* The default size is used if the window's requested size is not recognized.
*
* @static
* @inheritable
* @property {string}
*/
OO.ui.WindowManager.static.defaultSize = 'medium';
/* Methods */
/**
* Handle window resize events.
*
* @private
* @param {jQuery.Event} e Window resize event
*/
OO.ui.WindowManager.prototype.onWindowResize = function () {
clearTimeout( this.onWindowResizeTimeout );
this.onWindowResizeTimeout = setTimeout( this.afterWindowResizeHandler, 200 );
};
/**
* Handle window resize events.
*
* @private
* @param {jQuery.Event} e Window resize event
*/
OO.ui.WindowManager.prototype.afterWindowResize = function () {
var currentFocusedElement = document.activeElement;
if ( this.currentWindow ) {
this.updateWindowSize( this.currentWindow );
// Restore focus to the original element if it has changed.
// When a layout change is made on resize inputs lose focus
// on Android (Chrome and Firefox), see T162127.
if ( currentFocusedElement !== document.activeElement ) {
currentFocusedElement.focus();
}
}
};
/**
* Check if window is opening.
*
* @param {OO.ui.Window} win Window to check
* @return {boolean} Window is opening
*/
OO.ui.WindowManager.prototype.isOpening = function ( win ) {
return win === this.currentWindow && !!this.lifecycle &&
this.lifecycle.isOpening();
};
/**
* Check if window is closing.
*
* @param {OO.ui.Window} win Window to check
* @return {boolean} Window is closing
*/
OO.ui.WindowManager.prototype.isClosing = function ( win ) {
return win === this.currentWindow && !!this.lifecycle &&
this.lifecycle.isClosing();
};
/**
* Check if window is opened.
*
* @param {OO.ui.Window} win Window to check
* @return {boolean} Window is opened
*/
OO.ui.WindowManager.prototype.isOpened = function ( win ) {
return win === this.currentWindow && !!this.lifecycle &&
this.lifecycle.isOpened();
};
/**
* Check if a window is being managed.
*
* @param {OO.ui.Window} win Window to check
* @return {boolean} Window is being managed
*/
OO.ui.WindowManager.prototype.hasWindow = function ( win ) {
var name;
for ( name in this.windows ) {
if ( this.windows[ name ] === win ) {
return true;
}
}
return false;
};
/**
* Get the number of milliseconds to wait after opening begins before executing the ‘setup’ process.
*
* @param {OO.ui.Window} win Window being opened
* @param {Object} [data] Window opening data
* @return {number} Milliseconds to wait
*/
OO.ui.WindowManager.prototype.getSetupDelay = function () {
return 0;
};
/**
* Get the number of milliseconds to wait after setup has finished before executing the ‘ready’
* process.
*
* @param {OO.ui.Window} win Window being opened
* @param {Object} [data] Window opening data
* @return {number} Milliseconds to wait
*/
OO.ui.WindowManager.prototype.getReadyDelay = function () {
return this.modal ? OO.ui.theme.getDialogTransitionDuration() : 0;
};
/**
* Get the number of milliseconds to wait after closing has begun before executing the 'hold'
* process.
*
* @param {OO.ui.Window} win Window being closed
* @param {Object} [data] Window closing data
* @return {number} Milliseconds to wait
*/
OO.ui.WindowManager.prototype.getHoldDelay = function () {
return 0;
};
/**
* Get the number of milliseconds to wait after the ‘hold’ process has finished before
* executing the ‘teardown’ process.
*
* @param {OO.ui.Window} win Window being closed
* @param {Object} [data] Window closing data
* @return {number} Milliseconds to wait
*/
OO.ui.WindowManager.prototype.getTeardownDelay = function () {
return this.modal ? OO.ui.theme.getDialogTransitionDuration() : 0;
};
/**
* Get a window by its symbolic name.
*
* If the window is not yet instantiated and its symbolic name is recognized by a factory, it will
* be instantiated and added to the window manager automatically. Please see the [OOUI documentation
* on MediaWiki][3] for more information about using factories.
* [3]: https://www.mediawiki.org/wiki/OOUI/Windows/Window_managers
*
* @param {string} name Symbolic name of the window
* @return {jQuery.Promise} Promise resolved with matching window, or rejected with an OO.ui.Error
* @throws {Error} An error is thrown if the symbolic name is not recognized by the factory.
* @throws {Error} An error is thrown if the named window is not recognized as a managed window.
*/
OO.ui.WindowManager.prototype.getWindow = function ( name ) {
var deferred = $.Deferred(),
win = this.windows[ name ];
if ( !( win instanceof OO.ui.Window ) ) {
if ( this.factory ) {
if ( !this.factory.lookup( name ) ) {
deferred.reject( new OO.ui.Error(
'Cannot auto-instantiate window: symbolic name is unrecognized by the factory'
) );
} else {
win = this.factory.create( name );
this.addWindows( [ win ] );
deferred.resolve( win );
}
} else {
deferred.reject( new OO.ui.Error(
'Cannot get unmanaged window: symbolic name unrecognized as a managed window'
) );
}
} else {
deferred.resolve( win );
}
return deferred.promise();
};
/**
* Get current window.
*
* @return {OO.ui.Window|null} Currently opening/opened/closing window
*/
OO.ui.WindowManager.prototype.getCurrentWindow = function () {
return this.currentWindow;
};
/**
* Open a window.
*
* @param {OO.ui.Window|string} win Window object or symbolic name of window to open
* @param {Object} [data] Window opening data
* @param {jQuery|null} [data.$returnFocusTo] Element to which the window will return focus when
* closed. Defaults the current activeElement. If set to null, focus isn't changed on close.
* @param {OO.ui.WindowInstance} [lifecycle] Used internally
* @param {jQuery.Deferred} [compatOpening] Used internally
* @return {OO.ui.WindowInstance} A lifecycle object representing this particular
* opening of the window. For backwards-compatibility, then object is also a Thenable that is
* resolved when the window is done opening, with nested promise for when closing starts. This
* behaviour is deprecated and is not compatible with jQuery 3, see T163510.
* @fires opening
*/
OO.ui.WindowManager.prototype.openWindow = function ( win, data, lifecycle, compatOpening ) {
var error,
manager = this;
data = data || {};
// Internal parameter 'lifecycle' allows this method to always return
// a lifecycle even if the window still needs to be created
// asynchronously when 'win' is a string.
lifecycle = lifecycle || new OO.ui.WindowInstance();
compatOpening = compatOpening || $.Deferred();
// Turn lifecycle into a Thenable for backwards-compatibility with
// the deprecated nested-promise behaviour, see T163510.
[ 'state', 'always', 'catch', 'pipe', 'then', 'promise', 'progress', 'done', 'fail' ]
.forEach( function ( method ) {
lifecycle[ method ] = function () {
OO.ui.warnDeprecation(
'Using the return value of openWindow as a promise is deprecated. ' +
'Use .openWindow( ... ).opening.' + method + '( ... ) instead.'
);
return compatOpening[ method ].apply( this, arguments );
};
} );
// Argument handling
if ( typeof win === 'string' ) {
this.getWindow( win ).then(
function ( w ) {
manager.openWindow( w, data, lifecycle, compatOpening );
},
function ( err ) {
lifecycle.deferreds.opening.reject( err );
}
);
return lifecycle;
}
// Error handling
if ( !this.hasWindow( win ) ) {
error = 'Cannot open window: window is not attached to manager';
} else if ( this.lifecycle && this.lifecycle.isOpened() ) {
error = 'Cannot open window: another window is open';
} else if ( this.preparingToOpen || ( this.lifecycle && this.lifecycle.isOpening() ) ) {
error = 'Cannot open window: another window is opening';
}
if ( error ) {
compatOpening.reject( new OO.ui.Error( error ) );
lifecycle.deferreds.opening.reject( new OO.ui.Error( error ) );
return lifecycle;
}
// If a window is currently closing, wait for it to complete
this.preparingToOpen = $.when( this.lifecycle && this.lifecycle.closed );
// Ensure handlers get called after preparingToOpen is set
this.preparingToOpen.done( function () {
if ( manager.modal ) {
manager.toggleGlobalEvents( true );
manager.toggleAriaIsolation( true );
}
manager.$returnFocusTo = data.$returnFocusTo !== undefined ?
data.$returnFocusTo :
$( document.activeElement );
manager.currentWindow = win;
manager.lifecycle = lifecycle;
manager.preparingToOpen = null;
manager.emit( 'opening', win, compatOpening, data );
lifecycle.deferreds.opening.resolve( data );
setTimeout( function () {
manager.compatOpened = $.Deferred();
win.setup( data ).then( function () {
compatOpening.notify( { state: 'setup' } );
setTimeout( function () {
win.ready( data ).then( function () {
compatOpening.notify( { state: 'ready' } );
lifecycle.deferreds.opened.resolve( data );
compatOpening.resolve( manager.compatOpened.promise(), data );
manager.togglePreventIosScrolling( true );
}, function ( dataOrErr ) {
lifecycle.deferreds.opened.reject();
compatOpening.reject();
manager.closeWindow( win );
if ( dataOrErr instanceof Error ) {
setTimeout( function () {
throw dataOrErr;
} );
}
} );
}, manager.getReadyDelay() );
}, function ( dataOrErr ) {
lifecycle.deferreds.opened.reject();
compatOpening.reject();
manager.closeWindow( win );
if ( dataOrErr instanceof Error ) {
setTimeout( function () {
throw dataOrErr;
} );
}
} );
}, manager.getSetupDelay() );
} );
return lifecycle;
};
/**
* Close a window.
*
* @param {OO.ui.Window|string} win Window object or symbolic name of window to close
* @param {Object} [data] Window closing data
* @return {OO.ui.WindowInstance} A lifecycle object representing this particular
* opening of the window. For backwards-compatibility, the object is also a Thenable that is
* resolved when the window is done closing, see T163510.
* @fires closing
*/
OO.ui.WindowManager.prototype.closeWindow = function ( win, data ) {
var error,
manager = this,
compatClosing = $.Deferred(),
lifecycle = this.lifecycle,
compatOpened;
// Argument handling
if ( typeof win === 'string' ) {
win = this.windows[ win ];
} else if ( !this.hasWindow( win ) ) {
win = null;
}
// Error handling
if ( !lifecycle ) {
error = 'Cannot close window: no window is currently open';
} else if ( !win ) {
error = 'Cannot close window: window is not attached to manager';
} else if ( win !== this.currentWindow || this.lifecycle.isClosed() ) {
error = 'Cannot close window: window already closed with different data';
} else if ( this.preparingToClose || this.lifecycle.isClosing() ) {
error = 'Cannot close window: window already closing with different data';
}
if ( error ) {
// This function was called for the wrong window and we don't want to mess with the current
// window's state.
lifecycle = new OO.ui.WindowInstance();
// Pretend the window has been opened, so that we can pretend to fail to close it.
lifecycle.deferreds.opening.resolve( {} );
lifecycle.deferreds.opened.resolve( {} );
}
// Turn lifecycle into a Thenable for backwards-compatibility with
// the deprecated nested-promise behaviour, see T163510.
[ 'state', 'always', 'catch', 'pipe', 'then', 'promise', 'progress', 'done', 'fail' ]
.forEach( function ( method ) {
lifecycle[ method ] = function () {
OO.ui.warnDeprecation(
'Using the return value of closeWindow as a promise is deprecated. ' +
'Use .closeWindow( ... ).closed.' + method + '( ... ) instead.'
);
return compatClosing[ method ].apply( this, arguments );
};
} );
if ( error ) {
compatClosing.reject( new OO.ui.Error( error ) );
lifecycle.deferreds.closing.reject( new OO.ui.Error( error ) );
return lifecycle;
}
// If the window is currently opening, close it when it's done
this.preparingToClose = $.when( this.lifecycle.opened );
// Ensure handlers get called after preparingToClose is set
this.preparingToClose.always( function () {
manager.preparingToClose = null;
manager.emit( 'closing', win, compatClosing, data );
lifecycle.deferreds.closing.resolve( data );
compatOpened = manager.compatOpened;
manager.compatOpened = null;
compatOpened.resolve( compatClosing.promise(), data );
manager.togglePreventIosScrolling( false );
setTimeout( function () {
win.hold( data ).then( function () {
compatClosing.notify( { state: 'hold' } );
setTimeout( function () {
win.teardown( data ).then( function () {
compatClosing.notify( { state: 'teardown' } );
if ( manager.modal ) {
manager.toggleGlobalEvents( false );
manager.toggleAriaIsolation( false );
}
if ( manager.$returnFocusTo && manager.$returnFocusTo.length ) {
manager.$returnFocusTo[ 0 ].focus();
}
manager.currentWindow = null;
manager.lifecycle = null;
lifecycle.deferreds.closed.resolve( data );
compatClosing.resolve( data );
} );
}, manager.getTeardownDelay() );
} );
}, manager.getHoldDelay() );
} );
return lifecycle;
};
/**
* Add windows to the window manager.
*
* Windows can be added by reference, symbolic name, or explicitly defined symbolic names.
* See the [OOUI documentation on MediaWiki] [2] for examples.
* [2]: https://www.mediawiki.org/wiki/OOUI/Windows/Window_managers
*
* This function can be called in two manners:
*
* 1. `.addWindows( [ winA, winB, ... ] )` (where `winA`, `winB` are OO.ui.Window objects)
*
* This syntax registers windows under the symbolic names defined in their `.static.name`
* properties. For example, if `windowA.constructor.static.name` is `'nameA'`, calling
* `.openWindow( 'nameA' )` afterwards will open the window `windowA`. This syntax requires the
* static name to be set, otherwise an exception will be thrown.
*
* This is the recommended way, as it allows for an easier switch to using a window factory.
*
* 2. `.addWindows( { nameA: winA, nameB: winB, ... } )`
*
* This syntax registers windows under the explicitly given symbolic names. In this example,
* calling `.openWindow( 'nameA' )` afterwards will open the window `windowA`, regardless of what
* its `.static.name` is set to. The static name is not required to be set.
*
* This should only be used if you need to override the default symbolic names.
*
* Example:
*
* var windowManager = new OO.ui.WindowManager();
* $( document.body ).append( windowManager.$element );
*
* // Add a window under the default name: see OO.ui.MessageDialog.static.name
* windowManager.addWindows( [ new OO.ui.MessageDialog() ] );
* // Add a window under an explicit name
* windowManager.addWindows( { myMessageDialog: new OO.ui.MessageDialog() } );
*
* // Open window by default name
* windowManager.openWindow( 'message' );
* // Open window by explicitly given name
* windowManager.openWindow( 'myMessageDialog' );
*
*
* @param {Object.<string,OO.ui.Window>|OO.ui.Window[]} windows An array of window objects specified
* by reference, symbolic name, or explicitly defined symbolic names.
* @throws {Error} An error is thrown if a window is added by symbolic name, but has neither an
* explicit nor a statically configured symbolic name.
*/
OO.ui.WindowManager.prototype.addWindows = function ( windows ) {
var i, len, win, name, list;
if ( Array.isArray( windows ) ) {
// Convert to map of windows by looking up symbolic names from static configuration
list = {};
for ( i = 0, len = windows.length; i < len; i++ ) {
name = windows[ i ].constructor.static.name;
if ( !name ) {
throw new Error( 'Windows must have a `name` static property defined.' );
}
list[ name ] = windows[ i ];
}
} else if ( OO.isPlainObject( windows ) ) {
list = windows;
}
// Add windows
for ( name in list ) {
win = list[ name ];
this.windows[ name ] = win.toggle( false );
this.$element.append( win.$element );
win.setManager( this );
}
};
/**
* Remove the specified windows from the windows manager.
*
* Windows will be closed before they are removed. If you wish to remove all windows, you may wish
* to use the #clearWindows method instead. If you no longer need the window manager and want to
* ensure that it no longer listens to events, use the #destroy method.
*
* @param {string[]} names Symbolic names of windows to remove
* @return {jQuery.Promise} Promise resolved when window is closed and removed
* @throws {Error} An error is thrown if the named windows are not managed by the window manager.
*/
OO.ui.WindowManager.prototype.removeWindows = function ( names ) {
var promises,
manager = this;
function cleanup( name, win ) {
delete manager.windows[ name ];
win.$element.detach();
}
promises = names.map( function ( name ) {
var cleanupWindow,
win = manager.windows[ name ];
if ( !win ) {
throw new Error( 'Cannot remove window' );
}
cleanupWindow = cleanup.bind( null, name, win );
return manager.closeWindow( name ).closed.then( cleanupWindow, cleanupWindow );
} );
return $.when.apply( $, promises );
};
/**
* Remove all windows from the window manager.
*
* Windows will be closed before they are removed. Note that the window manager, though not in use,
* will still listen to events. If the window manager will not be used again, you may wish to use
* the #destroy method instead. To remove just a subset of windows, use the #removeWindows method.
*
* @return {jQuery.Promise} Promise resolved when all windows are closed and removed
*/
OO.ui.WindowManager.prototype.clearWindows = function () {
return this.removeWindows( Object.keys( this.windows ) );
};
/**
* Set dialog size. In general, this method should not be called directly.
*
* Fullscreen mode will be used if the dialog is too wide to fit in the screen.
*
* @param {OO.ui.Window} win Window to update, should be the current window
* @chainable
* @return {OO.ui.WindowManager} The manager, for chaining
*/
OO.ui.WindowManager.prototype.updateWindowSize = function ( win ) {
var isFullscreen;
// Bypass for non-current, and thus invisible, windows
if ( win !== this.currentWindow ) {
return;
}
isFullscreen = win.getSize() === 'full';
this.$element.toggleClass( 'oo-ui-windowManager-fullscreen', isFullscreen );
this.$element.toggleClass( 'oo-ui-windowManager-floating', !isFullscreen );
win.setDimensions( win.getSizeProperties() );
this.emit( 'resize', win );
return this;
};
/**
* Prevent scrolling of the document on iOS devices that don't respect `body { overflow: hidden; }`.
*
* This function is called when the window is opened (ready), and so the background is covered up,
* and the user won't see that we're doing weird things to the scroll position.
*
* @private
* @param {boolean} on
* @chainable
* @return {OO.ui.WindowManager} The manager, for chaining
*/
OO.ui.WindowManager.prototype.togglePreventIosScrolling = function ( on ) {
var
isIos = /ipad|iphone|ipod/i.test( navigator.userAgent ),
$body = $( this.getElementDocument().body ),
scrollableRoot = OO.ui.Element.static.getRootScrollableElement( $body[ 0 ] ),
stackDepth = $body.data( 'windowManagerGlobalEvents' ) || 0;
// Only if this is the first/last WindowManager (see #toggleGlobalEvents)
if ( !isIos || stackDepth !== 1 ) {
return this;
}
if ( on ) {
// We can't apply this workaround for non-fullscreen dialogs, because the user would see the
// scroll position change. If they have content that needs scrolling, you're out of luck…
// Always remember the scroll position in case dialog is closed with different size.
this.iosOrigScrollPosition = scrollableRoot.scrollTop;
if ( this.getCurrentWindow().getSize() === 'full' ) {
$body.add( $body.parent() ).addClass( 'oo-ui-windowManager-ios-modal-ready' );
}
} else {
// Always restore ability to scroll in case dialog was opened with different size.
$body.add( $body.parent() ).removeClass( 'oo-ui-windowManager-ios-modal-ready' );
if ( this.getCurrentWindow().getSize() === 'full' ) {
scrollableRoot.scrollTop = this.iosOrigScrollPosition;
}
}
return this;
};
/**
* Bind or unbind global events for scrolling.
*
* @private
* @param {boolean} [on] Bind global events
* @chainable
* @return {OO.ui.WindowManager} The manager, for chaining
*/
OO.ui.WindowManager.prototype.toggleGlobalEvents = function ( on ) {
var scrollWidth, bodyMargin,
$body = $( this.getElementDocument().body ),
// We could have multiple window managers open so only modify
// the body css at the bottom of the stack
stackDepth = $body.data( 'windowManagerGlobalEvents' ) || 0;
on = on === undefined ? !!this.globalEvents : !!on;
if ( on ) {
if ( !this.globalEvents ) {
$( this.getElementWindow() ).on( {
// Start listening for top-level window dimension changes
'orientationchange resize': this.onWindowResizeHandler
} );
if ( stackDepth === 0 ) {
scrollWidth = window.innerWidth - document.documentElement.clientWidth;
bodyMargin = parseFloat( $body.css( 'margin-right' ) ) || 0;
$body.addClass( 'oo-ui-windowManager-modal-active' );
$body.css( 'margin-right', bodyMargin + scrollWidth );
}
stackDepth++;
this.globalEvents = true;
}
} else if ( this.globalEvents ) {
$( this.getElementWindow() ).off( {
// Stop listening for top-level window dimension changes
'orientationchange resize': this.onWindowResizeHandler
} );
stackDepth--;
if ( stackDepth === 0 ) {
$body.removeClass( 'oo-ui-windowManager-modal-active' );
$body.css( 'margin-right', '' );
}
this.globalEvents = false;
}
$body.data( 'windowManagerGlobalEvents', stackDepth );
return this;
};
/**
* Toggle screen reader visibility of content other than the window manager.
*
* @private
* @param {boolean} [isolate] Make only the window manager visible to screen readers
* @chainable
* @return {OO.ui.WindowManager} The manager, for chaining
*/
OO.ui.WindowManager.prototype.toggleAriaIsolation = function ( isolate ) {
var $topLevelElement;
isolate = isolate === undefined ? !this.$ariaHidden : !!isolate;
if ( isolate ) {
if ( !this.$ariaHidden ) {
// Find the top level element containing the window manager or the
// window manager's element itself in case its a direct child of body
$topLevelElement = this.$element.parentsUntil( 'body' ).last();
$topLevelElement = $topLevelElement.length === 0 ? this.$element : $topLevelElement;
// In case previously set by another window manager
this.$element.removeAttr( 'aria-hidden' );
// Hide everything other than the window manager from screen readers
this.$ariaHidden = $( document.body )
.children()
.not( 'script' )
.not( $topLevelElement )
.attr( 'aria-hidden', true );
}
} else if ( this.$ariaHidden ) {
// Restore screen reader visibility
this.$ariaHidden.removeAttr( 'aria-hidden' );
this.$ariaHidden = null;
// and hide the window manager
this.$element.attr( 'aria-hidden', true );
}
return this;
};
/**
* Destroy the window manager.
*
* Destroying the window manager ensures that it will no longer listen to events. If you would like
* to continue using the window manager, but wish to remove all windows from it, use the
* #clearWindows method instead.
*/
OO.ui.WindowManager.prototype.destroy = function () {
this.toggleGlobalEvents( false );
this.toggleAriaIsolation( false );
this.clearWindows();
this.$element.remove();
};
/**
* A window is a container for elements that are in a child frame. They are used with
* a window manager (OO.ui.WindowManager), which is used to open and close the window and control
* its presentation. The size of a window is specified using a symbolic name (e.g., ‘small’,
* ‘medium’, ‘large’), which is interpreted by the window manager. If the requested size is not
* recognized, the window manager will choose a sensible fallback.
*
* The lifecycle of a window has three primary stages (opening, opened, and closing) in which
* different processes are executed:
*
* **opening**: The opening stage begins when the window manager's
* {@link OO.ui.WindowManager#openWindow openWindow} or the window's {@link #open open} methods are
* used, and the window manager begins to open the window.
*
* - {@link #getSetupProcess} method is called and its result executed
* - {@link #getReadyProcess} method is called and its result executed
*
* **opened**: The window is now open
*
* **closing**: The closing stage begins when the window manager's
* {@link OO.ui.WindowManager#closeWindow closeWindow}
* or the window's {@link #close} methods are used, and the window manager begins to close the
* window.
*
* - {@link #getHoldProcess} method is called and its result executed
* - {@link #getTeardownProcess} method is called and its result executed. The window is now closed
*
* Each of the window's processes (setup, ready, hold, and teardown) can be extended in subclasses
* by overriding the window's #getSetupProcess, #getReadyProcess, #getHoldProcess and
* #getTeardownProcess methods. Note that each {@link OO.ui.Process process} is executed in series,
* so asynchronous processing can complete. Always assume window processes are executed
* asynchronously.
*
* For more information, please see the [OOUI documentation on MediaWiki] [1].
*
* [1]: https://www.mediawiki.org/wiki/OOUI/Windows
*
* @abstract
* @class
* @extends OO.ui.Element
* @mixins OO.EventEmitter
*
* @constructor
* @param {Object} [config] Configuration options
* @cfg {string} [size] Symbolic name of the dialog size: `small`, `medium`, `large`, `larger` or
* `full`. If omitted, the value of the {@link #static-size static size} property will be used.
*/
OO.ui.Window = function OoUiWindow( config ) {
// Configuration initialization
config = config || {};
// Parent constructor
OO.ui.Window.super.call( this, config );
// Mixin constructors
OO.EventEmitter.call( this );
// Properties
this.manager = null;
this.size = config.size || this.constructor.static.size;
this.$frame = $( '<div>' );
/**
* Overlay element to use for the `$overlay` configuration option of widgets that support it.
* Things put inside it are overlaid on top of the window and are not bound to its dimensions.
* See <https://www.mediawiki.org/wiki/OOUI/Concepts#Overlays>.
*
* MyDialog.prototype.initialize = function () {
* ...
* var popupButton = new OO.ui.PopupButtonWidget( {
* $overlay: this.$overlay,
* label: 'Popup button',
* popup: {
* $content: $( '<p>Popup content.</p><p>More content.</p><p>Yet more content.</p>' ),
* padded: true
* }
* } );
* ...
* };
*
* @property {jQuery}
*/
this.$overlay = $( '<div>' );
this.$content = $( '<div>' );
this.$focusTrapBefore = $( '<div>' ).prop( 'tabIndex', 0 );
this.$focusTrapAfter = $( '<div>' ).prop( 'tabIndex', 0 );
this.$focusTraps = this.$focusTrapBefore.add( this.$focusTrapAfter );
// Initialization
this.$overlay.addClass( 'oo-ui-window-overlay' );
this.$content
.addClass( 'oo-ui-window-content' )
.attr( 'tabindex', -1 );
this.$frame
.addClass( 'oo-ui-window-frame' )
.append( this.$focusTrapBefore, this.$content, this.$focusTrapAfter );
this.$element
.addClass( 'oo-ui-window' )
.append( this.$frame, this.$overlay );
// Initially hidden - using #toggle may cause errors if subclasses override toggle with methods
// that reference properties not initialized at that time of parent class construction
// TODO: Find a better way to handle post-constructor setup
this.visible = false;
this.$element.addClass( 'oo-ui-element-hidden' );
};
/* Setup */
OO.inheritClass( OO.ui.Window, OO.ui.Element );
OO.mixinClass( OO.ui.Window, OO.EventEmitter );
/* Static Properties */
/**
* Symbolic name of the window size: `small`, `medium`, `large`, `larger` or `full`.
*
* The static size is used if no #size is configured during construction.
*
* @static
* @inheritable
* @property {string}
*/
OO.ui.Window.static.size = 'medium';
/* Methods */
/**
* Handle mouse down events.
*
* @private
* @param {jQuery.Event} e Mouse down event
* @return {OO.ui.Window} The window, for chaining
*/
OO.ui.Window.prototype.onMouseDown = function ( e ) {
// Prevent clicking on the click-block from stealing focus
if ( e.target === this.$element[ 0 ] ) {
return false;
}
};
/**
* Check if the window has been initialized.
*
* Initialization occurs when a window is added to a manager.
*
* @return {boolean} Window has been initialized
*/
OO.ui.Window.prototype.isInitialized = function () {
return !!this.manager;
};
/**
* Check if the window is visible.
*
* @return {boolean} Window is visible
*/
OO.ui.Window.prototype.isVisible = function () {
return this.visible;
};
/**
* Check if the window is opening.
*
* This method is a wrapper around the window manager's
* {@link OO.ui.WindowManager#isOpening isOpening} method.
*
* @return {boolean} Window is opening
*/
OO.ui.Window.prototype.isOpening = function () {
return this.manager.isOpening( this );
};
/**
* Check if the window is closing.
*
* This method is a wrapper around the window manager's
* {@link OO.ui.WindowManager#isClosing isClosing} method.
*
* @return {boolean} Window is closing
*/
OO.ui.Window.prototype.isClosing = function () {
return this.manager.isClosing( this );
};
/**
* Check if the window is opened.
*
* This method is a wrapper around the window manager's
* {@link OO.ui.WindowManager#isOpened isOpened} method.
*
* @return {boolean} Window is opened
*/
OO.ui.Window.prototype.isOpened = function () {
return this.manager.isOpened( this );
};
/**
* Get the window manager.
*
* All windows must be attached to a window manager, which is used to open
* and close the window and control its presentation.
*
* @return {OO.ui.WindowManager} Manager of window
*/
OO.ui.Window.prototype.getManager = function () {
return this.manager;
};
/**
* Get the symbolic name of the window size (e.g., `small` or `medium`).
*
* @return {string} Symbolic name of the size: `small`, `medium`, `large`, `larger`, `full`
*/
OO.ui.Window.prototype.getSize = function () {
var viewport = OO.ui.Element.static.getDimensions( this.getElementWindow() ),
sizes = this.manager.constructor.static.sizes,
size = this.size;
if ( !sizes[ size ] ) {
size = this.manager.constructor.static.defaultSize;
}
if ( size !== 'full' && viewport.rect.right - viewport.rect.left < sizes[ size ].width ) {
size = 'full';
}
return size;
};
/**
* Get the size properties associated with the current window size
*
* @return {Object} Size properties
*/
OO.ui.Window.prototype.getSizeProperties = function () {
return this.manager.constructor.static.sizes[ this.getSize() ];
};
/**
* Disable transitions on window's frame for the duration of the callback function, then enable them
* back.
*
* @private
* @param {Function} callback Function to call while transitions are disabled
*/
OO.ui.Window.prototype.withoutSizeTransitions = function ( callback ) {
// Temporarily resize the frame so getBodyHeight() can use scrollHeight measurements.
// Disable transitions first, otherwise we'll get values from when the window was animating.
// We need to build the transition CSS properties using these specific properties since
// Firefox doesn't return anything useful when asked just for 'transition'.
var oldTransition = this.$frame.css( 'transition-property' ) + ' ' +
this.$frame.css( 'transition-duration' ) + ' ' +
this.$frame.css( 'transition-timing-function' ) + ' ' +
this.$frame.css( 'transition-delay' );
this.$frame.css( 'transition', 'none' );
callback();
// Force reflow to make sure the style changes done inside callback
// really are not transitioned
this.$frame.height();
this.$frame.css( 'transition', oldTransition );
};
/**
* Get the height of the full window contents (i.e., the window head, body and foot together).
*
* What constitutes the head, body, and foot varies depending on the window type.
* A {@link OO.ui.MessageDialog message dialog} displays a title and message in its body,
* and any actions in the foot. A {@link OO.ui.ProcessDialog process dialog} displays a title
* and special actions in the head, and dialog content in the body.
*
* To get just the height of the dialog body, use the #getBodyHeight method.
*
* @return {number} The height of the window contents (the dialog head, body and foot) in pixels
*/
OO.ui.Window.prototype.getContentHeight = function () {
var bodyHeight,
win = this,
bodyStyleObj = this.$body[ 0 ].style,
frameStyleObj = this.$frame[ 0 ].style;
// Temporarily resize the frame so getBodyHeight() can use scrollHeight measurements.
// Disable transitions first, otherwise we'll get values from when the window was animating.
this.withoutSizeTransitions( function () {
var oldHeight = frameStyleObj.height,
oldPosition = bodyStyleObj.position;
frameStyleObj.height = '1px';
// Force body to resize to new width
bodyStyleObj.position = 'relative';
bodyHeight = win.getBodyHeight();
frameStyleObj.height = oldHeight;
bodyStyleObj.position = oldPosition;
} );
return (
// Add buffer for border
( this.$frame.outerHeight() - this.$frame.innerHeight() ) +
// Use combined heights of children
( this.$head.outerHeight( true ) + bodyHeight + this.$foot.outerHeight( true ) )
);
};
/**
* Get the height of the window body.
*
* To get the height of the full window contents (the window body, head, and foot together),
* use #getContentHeight.
*
* When this function is called, the window will temporarily have been resized
* to height=1px, so .scrollHeight measurements can be taken accurately.
*
* @return {number} Height of the window body in pixels
*/
OO.ui.Window.prototype.getBodyHeight = function () {
return this.$body[ 0 ].scrollHeight;
};
/**
* Get the directionality of the frame (right-to-left or left-to-right).
*
* @return {string} Directionality: `'ltr'` or `'rtl'`
*/
OO.ui.Window.prototype.getDir = function () {
return OO.ui.Element.static.getDir( this.$content ) || 'ltr';
};
/**
* Get the 'setup' process.
*
* The setup process is used to set up a window for use in a particular context, based on the `data`
* argument. This method is called during the opening phase of the window’s lifecycle (before the
* opening animation). You can add elements to the window in this process or set their default
* values.
*
* Override this method to add additional steps to the ‘setup’ process the parent method provides
* using the {@link OO.ui.Process#first first} and {@link OO.ui.Process#next next} methods
* of OO.ui.Process.
*
* To add window content that persists between openings, you may wish to use the #initialize method
* instead.
*
* @param {Object} [data] Window opening data
* @return {OO.ui.Process} Setup process
*/
OO.ui.Window.prototype.getSetupProcess = function () {
return new OO.ui.Process();
};
/**
* Get the ‘ready’ process.
*
* The ready process is used to ready a window for use in a particular context, based on the `data`
* argument. This method is called during the opening phase of the window’s lifecycle, after the
* window has been {@link #getSetupProcess setup} (after the opening animation). You can focus
* elements in the window in this process, or open their dropdowns.
*
* Override this method to add additional steps to the ‘ready’ process the parent method
* provides using the {@link OO.ui.Process#first first} and {@link OO.ui.Process#next next}
* methods of OO.ui.Process.
*
* @param {Object} [data] Window opening data
* @return {OO.ui.Process} Ready process
*/
OO.ui.Window.prototype.getReadyProcess = function () {
return new OO.ui.Process();
};
/**
* Get the 'hold' process.
*
* The hold process is used to keep a window from being used in a particular context, based on the
* `data` argument. This method is called during the closing phase of the window’s lifecycle (before
* the closing animation). You can close dropdowns of elements in the window in this process, if
* they do not get closed automatically.
*
* Override this method to add additional steps to the 'hold' process the parent method provides
* using the {@link OO.ui.Process#first first} and {@link OO.ui.Process#next next} methods
* of OO.ui.Process.
*
* @param {Object} [data] Window closing data
* @return {OO.ui.Process} Hold process
*/
OO.ui.Window.prototype.getHoldProcess = function () {
return new OO.ui.Process();
};
/**
* Get the ‘teardown’ process.
*
* The teardown process is used to teardown a window after use. During teardown, user interactions
* within the window are conveyed and the window is closed, based on the `data` argument. This
* method is called during the closing phase of the window’s lifecycle (after the closing
* animation). You can remove elements in the window in this process or clear their values.
*
* Override this method to add additional steps to the ‘teardown’ process the parent method provides
* using the {@link OO.ui.Process#first first} and {@link OO.ui.Process#next next} methods
* of OO.ui.Process.
*
* @param {Object} [data] Window closing data
* @return {OO.ui.Process} Teardown process
*/
OO.ui.Window.prototype.getTeardownProcess = function () {
return new OO.ui.Process();
};
/**
* Set the window manager.
*
* This will cause the window to initialize. Calling it more than once will cause an error.
*
* @param {OO.ui.WindowManager} manager Manager for this window
* @throws {Error} An error is thrown if the method is called more than once
* @chainable
* @return {OO.ui.Window} The window, for chaining
*/
OO.ui.Window.prototype.setManager = function ( manager ) {
if ( this.manager ) {
throw new Error( 'Cannot set window manager, window already has a manager' );
}
this.manager = manager;
this.initialize();
return this;
};
/**
* Set the window size by symbolic name (e.g., 'small' or 'medium')
*
* @param {string} size Symbolic name of size: `small`, `medium`, `large`, `larger` or
* `full`
* @chainable
* @return {OO.ui.Window} The window, for chaining
*/
OO.ui.Window.prototype.setSize = function ( size ) {
this.size = size;
this.updateSize();
return this;
};
/**
* Update the window size.
*
* @throws {Error} An error is thrown if the window is not attached to a window manager
* @chainable
* @return {OO.ui.Window} The window, for chaining
*/
OO.ui.Window.prototype.updateSize = function () {
if ( !this.manager ) {
throw new Error( 'Cannot update window size, must be attached to a manager' );
}
this.manager.updateWindowSize( this );
return this;
};
/**
* Set window dimensions. This method is called by the {@link OO.ui.WindowManager window manager}
* when the window is opening. In general, setDimensions should not be called directly.
*
* To set the size of the window, use the #setSize method.
*
* @param {Object} dim CSS dimension properties
* @param {string|number} [dim.width] Width
* @param {string|number} [dim.minWidth] Minimum width
* @param {string|number} [dim.maxWidth] Maximum width
* @param {string|number} [dim.height] Height, omit to set based on height of contents
* @param {string|number} [dim.minHeight] Minimum height
* @param {string|number} [dim.maxHeight] Maximum height
* @chainable
* @return {OO.ui.Window} The window, for chaining
*/
OO.ui.Window.prototype.setDimensions = function ( dim ) {
var height,
win = this,
styleObj = this.$frame[ 0 ].style;
// Calculate the height we need to set using the correct width
if ( dim.height === undefined ) {
this.withoutSizeTransitions( function () {
var oldWidth = styleObj.width;
win.$frame.css( 'width', dim.width || '' );
height = win.getContentHeight();
styleObj.width = oldWidth;
} );
} else {
height = dim.height;
}
this.$frame.css( {
width: dim.width || '',
minWidth: dim.minWidth || '',
maxWidth: dim.maxWidth || '',
height: height || '',
minHeight: dim.minHeight || '',
maxHeight: dim.maxHeight || ''
} );
return this;
};
/**
* Initialize window contents.
*
* Before the window is opened for the first time, #initialize is called so that content that
* persists between openings can be added to the window.
*
* To set up a window with new content each time the window opens, use #getSetupProcess.
*
* @throws {Error} An error is thrown if the window is not attached to a window manager
* @chainable
* @return {OO.ui.Window} The window, for chaining
*/
OO.ui.Window.prototype.initialize = function () {
if ( !this.manager ) {
throw new Error( 'Cannot initialize window, must be attached to a manager' );
}
// Properties
this.$head = $( '<div>' );
this.$body = $( '<div>' );
this.$foot = $( '<div>' );
this.$document = $( this.getElementDocument() );
// Events
this.$element.on( 'mousedown', this.onMouseDown.bind( this ) );
// Initialization
this.$head.addClass( 'oo-ui-window-head' );
this.$body.addClass( 'oo-ui-window-body' );
this.$foot.addClass( 'oo-ui-window-foot' );
this.$content.append( this.$head, this.$body, this.$foot );
return this;
};
/**
* Called when someone tries to focus the hidden element at the end of the dialog.
* Sends focus back to the start of the dialog.
*
* @param {jQuery.Event} event Focus event
*/
OO.ui.Window.prototype.onFocusTrapFocused = function ( event ) {
var backwards = this.$focusTrapBefore.is( event.target ),
element = OO.ui.findFocusable( this.$content, backwards );
if ( element ) {
// There's a focusable element inside the content, at the front or
// back depending on which focus trap we hit; select it.
element.focus();
} else {
// There's nothing focusable inside the content. As a fallback,
// this.$content is focusable, and focusing it will keep our focus
// properly trapped. It's not a *meaningful* focus, since it's just
// the content-div for the Window, but it's better than letting focus
// escape into the page.
this.$content.trigger( 'focus' );
}
};
/**
* Open the window.
*
* This method is a wrapper around a call to the window
* manager’s {@link OO.ui.WindowManager#openWindow openWindow} method.
*
* To customize the window each time it opens, use #getSetupProcess or #getReadyProcess.
*
* @param {Object} [data] Window opening data
* @return {OO.ui.WindowInstance} See OO.ui.WindowManager#openWindow
* @throws {Error} An error is thrown if the window is not attached to a window manager
*/
OO.ui.Window.prototype.open = function ( data ) {
if ( !this.manager ) {
throw new Error( 'Cannot open window, must be attached to a manager' );
}
return this.manager.openWindow( this, data );
};
/**
* Close the window.
*
* This method is a wrapper around a call to the window
* manager’s {@link OO.ui.WindowManager#closeWindow closeWindow} method.
*
* The window's #getHoldProcess and #getTeardownProcess methods are called during the closing
* phase of the window’s lifecycle and can be used to specify closing behavior each time
* the window closes.
*
* @param {Object} [data] Window closing data
* @return {OO.ui.WindowInstance} See OO.ui.WindowManager#closeWindow
* @throws {Error} An error is thrown if the window is not attached to a window manager
*/
OO.ui.Window.prototype.close = function ( data ) {
if ( !this.manager ) {
throw new Error( 'Cannot close window, must be attached to a manager' );
}
return this.manager.closeWindow( this, data );
};
/**
* Setup window.
*
* This is called by OO.ui.WindowManager during window opening (before the animation), and should
* not be called directly by other systems.
*
* @param {Object} [data] Window opening data
* @return {jQuery.Promise} Promise resolved when window is setup
*/
OO.ui.Window.prototype.setup = function ( data ) {
var win = this;
this.toggle( true );
this.focusTrapHandler = OO.ui.bind( this.onFocusTrapFocused, this );
this.$focusTraps.on( 'focus', this.focusTrapHandler );
return this.getSetupProcess( data ).execute().then( function () {
win.updateSize();
// Force redraw by asking the browser to measure the elements' widths
win.$element.addClass( 'oo-ui-window-active oo-ui-window-setup' ).width();
win.$content.addClass( 'oo-ui-window-content-setup' ).width();
} );
};
/**
* Ready window.
*
* This is called by OO.ui.WindowManager during window opening (after the animation), and should not
* be called directly by other systems.
*
* @param {Object} [data] Window opening data
* @return {jQuery.Promise} Promise resolved when window is ready
*/
OO.ui.Window.prototype.ready = function ( data ) {
var win = this;
this.$content.trigger( 'focus' );
return this.getReadyProcess( data ).execute().then( function () {
// Force redraw by asking the browser to measure the elements' widths
win.$element.addClass( 'oo-ui-window-ready' ).width();
win.$content.addClass( 'oo-ui-window-content-ready' ).width();
} );
};
/**
* Hold window.
*
* This is called by OO.ui.WindowManager during window closing (before the animation), and should
* not be called directly by other systems.
*
* @param {Object} [data] Window closing data
* @return {jQuery.Promise} Promise resolved when window is held
*/
OO.ui.Window.prototype.hold = function ( data ) {
var win = this;
return this.getHoldProcess( data ).execute().then( function () {
// Get the focused element within the window's content
var $focus = win.$content.find(
OO.ui.Element.static.getDocument( win.$content ).activeElement
);
// Blur the focused element
if ( $focus.length ) {
$focus[ 0 ].blur();
}
// Force redraw by asking the browser to measure the elements' widths
win.$element.removeClass( 'oo-ui-window-ready oo-ui-window-setup' ).width();
win.$content.removeClass( 'oo-ui-window-content-ready oo-ui-window-content-setup' ).width();
} );
};
/**
* Teardown window.
*
* This is called by OO.ui.WindowManager during window closing (after the animation), and should not
* be called directly by other systems.
*
* @param {Object} [data] Window closing data
* @return {jQuery.Promise} Promise resolved when window is torn down
*/
OO.ui.Window.prototype.teardown = function ( data ) {
var win = this;
return this.getTeardownProcess( data ).execute().then( function () {
// Force redraw by asking the browser to measure the elements' widths
win.$element.removeClass( 'oo-ui-window-active' ).width();
win.$focusTraps.off( 'focus', win.focusTrapHandler );
win.toggle( false );
} );
};
/**
* The Dialog class serves as the base class for the other types of dialogs.
* Unless extended to include controls, the rendered dialog box is a simple window
* that users can close by hitting the Escape key. Dialog windows are used with OO.ui.WindowManager,
* which opens, closes, and controls the presentation of the window. See the
* [OOUI documentation on MediaWiki] [1] for more information.
*
* @example
* // A simple dialog window.
* function MyDialog( config ) {
* MyDialog.super.call( this, config );
* }
* OO.inheritClass( MyDialog, OO.ui.Dialog );
* MyDialog.static.name = 'myDialog';
* MyDialog.prototype.initialize = function () {
* MyDialog.super.prototype.initialize.call( this );
* this.content = new OO.ui.PanelLayout( { padded: true, expanded: false } );
* this.content.$element.append( '<p>A simple dialog window. Press Escape key to ' +
* 'close.</p>' );
* this.$body.append( this.content.$element );
* };
* MyDialog.prototype.getBodyHeight = function () {
* return this.content.$element.outerHeight( true );
* };
* var myDialog = new MyDialog( {
* size: 'medium'
* } );
* // Create and append a window manager, which opens and closes the window.
* var windowManager = new OO.ui.WindowManager();
* $( document.body ).append( windowManager.$element );
* windowManager.addWindows( [ myDialog ] );
* // Open the window!
* windowManager.openWindow( myDialog );
*
* [1]: https://www.mediawiki.org/wiki/OOUI/Windows/Dialogs
*
* @abstract
* @class
* @extends OO.ui.Window
* @mixins OO.ui.mixin.PendingElement
*
* @constructor
* @param {Object} [config] Configuration options
*/
OO.ui.Dialog = function OoUiDialog( config ) {
// Parent constructor
OO.ui.Dialog.super.call( this, config );
// Mixin constructors
OO.ui.mixin.PendingElement.call( this );
// Properties
this.actions = new OO.ui.ActionSet();
this.attachedActions = [];
this.currentAction = null;
this.onDialogKeyDownHandler = this.onDialogKeyDown.bind( this );
// Events
this.actions.connect( this, {
click: 'onActionClick',
change: 'onActionsChange'
} );
// Initialization
this.$element
.addClass( 'oo-ui-dialog' )
.attr( 'role', 'dialog' );
};
/* Setup */
OO.inheritClass( OO.ui.Dialog, OO.ui.Window );
OO.mixinClass( OO.ui.Dialog, OO.ui.mixin.PendingElement );
/* Static Properties */
/**
* Symbolic name of dialog.
*
* The dialog class must have a symbolic name in order to be registered with OO.Factory.
* Please see the [OOUI documentation on MediaWiki] [3] for more information.
*
* [3]: https://www.mediawiki.org/wiki/OOUI/Windows/Window_managers
*
* @abstract
* @static
* @inheritable
* @property {string}
*/
OO.ui.Dialog.static.name = '';
/**
* The dialog title.
*
* The title can be specified as a plaintext string, a {@link OO.ui.mixin.LabelElement Label} node,
* or a function that will produce a Label node or string. The title can also be specified with data
* passed to the constructor (see #getSetupProcess). In this case, the static value will be
* overridden.
*
* @abstract
* @static
* @inheritable
* @property {jQuery|string|Function}
*/
OO.ui.Dialog.static.title = '';
/**
* An array of configured {@link OO.ui.ActionWidget action widgets}.
*
* Actions can also be specified with data passed to the constructor (see #getSetupProcess). In this
* case, the static value will be overridden.
*
* [2]: https://www.mediawiki.org/wiki/OOUI/Windows/Process_Dialogs#Action_sets
*
* @static
* @inheritable
* @property {Object[]}
*/
OO.ui.Dialog.static.actions = [];
/**
* Close the dialog when the Escape key is pressed.
*
* @static
* @abstract
* @inheritable
* @property {boolean}
*/
OO.ui.Dialog.static.escapable = true;
/* Methods */
/**
* Handle frame document key down events.
*
* @private
* @param {jQuery.Event} e Key down event
*/
OO.ui.Dialog.prototype.onDialogKeyDown = function ( e ) {
var actions;
if ( e.which === OO.ui.Keys.ESCAPE && this.constructor.static.escapable ) {
this.executeAction( '' );
e.preventDefault();
e.stopPropagation();
} else if ( e.which === OO.ui.Keys.ENTER && ( e.ctrlKey || e.metaKey ) ) {
actions = this.actions.get( { flags: 'primary', visible: true, disabled: false } );
if ( actions.length > 0 ) {
this.executeAction( actions[ 0 ].getAction() );
e.preventDefault();
e.stopPropagation();
}
}
};
/**
* Handle action click events.
*
* @private
* @param {OO.ui.ActionWidget} action Action that was clicked
*/
OO.ui.Dialog.prototype.onActionClick = function ( action ) {
if ( !this.isPending() ) {
this.executeAction( action.getAction() );
}
};
/**
* Handle actions change event.
*
* @private
*/
OO.ui.Dialog.prototype.onActionsChange = function () {
this.detachActions();
if ( !this.isClosing() ) {
this.attachActions();
if ( !this.isOpening() ) {
// If the dialog is currently opening, this will be called automatically soon.
this.updateSize();
}
}
};
/**
* Get the set of actions used by the dialog.
*
* @return {OO.ui.ActionSet}
*/
OO.ui.Dialog.prototype.getActions = function () {
return this.actions;
};
/**
* Get a process for taking action.
*
* When you override this method, you can create a new OO.ui.Process and return it, or add
* additional accept steps to the process the parent method provides using the
* {@link OO.ui.Process#first 'first'} and {@link OO.ui.Process#next 'next'} methods of
* OO.ui.Process.
*
* @param {string} [action] Symbolic name of action
* @return {OO.ui.Process} Action process
*/
OO.ui.Dialog.prototype.getActionProcess = function ( action ) {
return new OO.ui.Process()
.next( function () {
if ( !action ) {
// An empty action always closes the dialog without data, which should always be
// safe and make no changes
this.close();
}
}, this );
};
/**
* @inheritdoc
*
* @param {Object} [data] Dialog opening data
* @param {jQuery|string|Function|null} [data.title] Dialog title, omit to use
* the {@link #static-title static title}
* @param {Object[]} [data.actions] List of configuration options for each
* {@link OO.ui.ActionWidget action widget}, omit to use {@link #static-actions static actions}.
*/
OO.ui.Dialog.prototype.getSetupProcess = function ( data ) {
data = data || {};
// Parent method
return OO.ui.Dialog.super.prototype.getSetupProcess.call( this, data )
.next( function () {
var config = this.constructor.static,
actions = data.actions !== undefined ? data.actions : config.actions,
title = data.title !== undefined ? data.title : config.title;
this.title.setLabel( title ).setTitle( title );
this.actions.add( this.getActionWidgets( actions ) );
this.$element.on( 'keydown', this.onDialogKeyDownHandler );
}, this );
};
/**
* @inheritdoc
*/
OO.ui.Dialog.prototype.getTeardownProcess = function ( data ) {
// Parent method
return OO.ui.Dialog.super.prototype.getTeardownProcess.call( this, data )
.first( function () {
this.$element.off( 'keydown', this.onDialogKeyDownHandler );
this.actions.clear();
this.currentAction = null;
}, this );
};
/**
* @inheritdoc
*/
OO.ui.Dialog.prototype.initialize = function () {
// Parent method
OO.ui.Dialog.super.prototype.initialize.call( this );
// Properties
this.title = new OO.ui.LabelWidget();
// Initialization
this.$content.addClass( 'oo-ui-dialog-content' );
this.$element.attr( 'aria-labelledby', this.title.getElementId() );
this.setPendingElement( this.$head );
};
/**
* Get action widgets from a list of configs
*
* @param {Object[]} actions Action widget configs
* @return {OO.ui.ActionWidget[]} Action widgets
*/
OO.ui.Dialog.prototype.getActionWidgets = function ( actions ) {
var i, len, widgets = [];
for ( i = 0, len = actions.length; i < len; i++ ) {
widgets.push( this.getActionWidget( actions[ i ] ) );
}
return widgets;
};
/**
* Get action widget from config
*
* Override this method to change the action widget class used.
*
* @param {Object} config Action widget config
* @return {OO.ui.ActionWidget} Action widget
*/
OO.ui.Dialog.prototype.getActionWidget = function ( config ) {
return new OO.ui.ActionWidget( this.getActionWidgetConfig( config ) );
};
/**
* Get action widget config
*
* Override this method to modify the action widget config
*
* @param {Object} config Initial action widget config
* @return {Object} Action widget config
*/
OO.ui.Dialog.prototype.getActionWidgetConfig = function ( config ) {
return config;
};
/**
* Attach action actions.
*
* @protected
*/
OO.ui.Dialog.prototype.attachActions = function () {
// Remember the list of potentially attached actions
this.attachedActions = this.actions.get();
};
/**
* Detach action actions.
*
* @protected
* @chainable
* @return {OO.ui.Dialog} The dialog, for chaining
*/
OO.ui.Dialog.prototype.detachActions = function () {
var i, len;
// Detach all actions that may have been previously attached
for ( i = 0, len = this.attachedActions.length; i < len; i++ ) {
this.attachedActions[ i ].$element.detach();
}
this.attachedActions = [];
return this;
};
/**
* Execute an action.
*
* @param {string} action Symbolic name of action to execute
* @return {jQuery.Promise} Promise resolved when action completes, rejected if it fails
*/
OO.ui.Dialog.prototype.executeAction = function ( action ) {
this.pushPending();
this.currentAction = action;
return this.getActionProcess( action ).execute()
.always( this.popPending.bind( this ) );
};
/**
* MessageDialogs display a confirmation or alert message. By default, the rendered dialog box
* consists of a header that contains the dialog title, a body with the message, and a footer that
* contains any {@link OO.ui.ActionWidget action widgets}. The MessageDialog class is the only type
* of {@link OO.ui.Dialog dialog} that is usually instantiated directly.
*
* There are two basic types of message dialogs, confirmation and alert:
*
* - **confirmation**: the dialog title describes what a progressive action will do and the message
* provides more details about the consequences.
* - **alert**: the dialog title describes which event occurred and the message provides more
* information about why the event occurred.
*
* The MessageDialog class specifies two actions: ‘accept’, the primary
* action (e.g., ‘ok’) and ‘reject,’ the safe action (e.g., ‘cancel’). Both will close the window,
* passing along the selected action.
*
* For more information and examples, please see the [OOUI documentation on MediaWiki][1].
*
* @example
* // Example: Creating and opening a message dialog window.
* var messageDialog = new OO.ui.MessageDialog();
*
* // Create and append a window manager.
* var windowManager = new OO.ui.WindowManager();
* $( document.body ).append( windowManager.$element );
* windowManager.addWindows( [ messageDialog ] );
* // Open the window.
* windowManager.openWindow( messageDialog, {
* title: 'Basic message dialog',
* message: 'This is the message'
* } );
*
* [1]: https://www.mediawiki.org/wiki/OOUI/Windows/Message_Dialogs
*
* @class
* @extends OO.ui.Dialog
*
* @constructor
* @param {Object} [config] Configuration options
*/
OO.ui.MessageDialog = function OoUiMessageDialog( config ) {
// Parent constructor
OO.ui.MessageDialog.super.call( this, config );
// Properties
this.verticalActionLayout = null;
// Initialization
this.$element.addClass( 'oo-ui-messageDialog' );
};
/* Setup */
OO.inheritClass( OO.ui.MessageDialog, OO.ui.Dialog );
/* Static Properties */
/**
* @static
* @inheritdoc
*/
OO.ui.MessageDialog.static.name = 'message';
/**
* @static
* @inheritdoc
*/
OO.ui.MessageDialog.static.size = 'small';
/**
* Dialog title.
*
* The title of a confirmation dialog describes what a progressive action will do. The
* title of an alert dialog describes which event occurred.
*
* @static
* @inheritable
* @property {jQuery|string|Function|null}
*/
OO.ui.MessageDialog.static.title = null;
/**
* The message displayed in the dialog body.
*
* A confirmation message describes the consequences of a progressive action. An alert
* message describes why an event occurred.
*
* @static
* @inheritable
* @property {jQuery|string|Function|null}
*/
OO.ui.MessageDialog.static.message = null;
/**
* @static
* @inheritdoc
*/
OO.ui.MessageDialog.static.actions = [
// Note that OO.ui.alert() and OO.ui.confirm() rely on these.
{ action: 'accept', label: OO.ui.deferMsg( 'ooui-dialog-message-accept' ), flags: 'primary' },
{ action: 'reject', label: OO.ui.deferMsg( 'ooui-dialog-message-reject' ), flags: 'safe' }
];
/* Methods */
/**
* Toggle action layout between vertical and horizontal.
*
* @private
* @param {boolean} [value] Layout actions vertically, omit to toggle
* @chainable
* @return {OO.ui.MessageDialog} The dialog, for chaining
*/
OO.ui.MessageDialog.prototype.toggleVerticalActionLayout = function ( value ) {
value = value === undefined ? !this.verticalActionLayout : !!value;
if ( value !== this.verticalActionLayout ) {
this.verticalActionLayout = value;
this.$actions
.toggleClass( 'oo-ui-messageDialog-actions-vertical', value )
.toggleClass( 'oo-ui-messageDialog-actions-horizontal', !value );
}
return this;
};
/**
* @inheritdoc
*/
OO.ui.MessageDialog.prototype.getActionProcess = function ( action ) {
if ( action ) {
return new OO.ui.Process( function () {
this.close( { action: action } );
}, this );
}
return OO.ui.MessageDialog.super.prototype.getActionProcess.call( this, action );
};
/**
* @inheritdoc
*
* @param {Object} [data] Dialog opening data
* @param {jQuery|string|Function|null} [data.title] Description of the action being confirmed
* @param {jQuery|string|Function|null} [data.message] Description of the action's consequence
* @param {string} [data.size] Symbolic name of the dialog size, see OO.ui.Window
* @param {Object[]} [data.actions] List of OO.ui.ActionOptionWidget configuration options for each
* action item
*/
OO.ui.MessageDialog.prototype.getSetupProcess = function ( data ) {
data = data || {};
// Parent method
return OO.ui.MessageDialog.super.prototype.getSetupProcess.call( this, data )
.next( function () {
this.title.setLabel(
data.title !== undefined ? data.title : this.constructor.static.title
);
this.message.setLabel(
data.message !== undefined ? data.message : this.constructor.static.message
);
this.size = data.size !== undefined ? data.size : this.constructor.static.size;
}, this );
};
/**
* @inheritdoc
*/
OO.ui.MessageDialog.prototype.getReadyProcess = function ( data ) {
data = data || {};
// Parent method
return OO.ui.MessageDialog.super.prototype.getReadyProcess.call( this, data )
.next( function () {
// Focus the primary action button
var actions = this.actions.get();
actions = actions.filter( function ( action ) {
return action.getFlags().indexOf( 'primary' ) > -1;
} );
if ( actions.length > 0 ) {
actions[ 0 ].focus();
}
}, this );
};
/**
* @inheritdoc
*/
OO.ui.MessageDialog.prototype.getBodyHeight = function () {
var bodyHeight, oldOverflow,
$scrollable = this.container.$element;
oldOverflow = $scrollable[ 0 ].style.overflow;
$scrollable[ 0 ].style.overflow = 'hidden';
OO.ui.Element.static.reconsiderScrollbars( $scrollable[ 0 ] );
bodyHeight = this.text.$element.outerHeight( true );
$scrollable[ 0 ].style.overflow = oldOverflow;
return bodyHeight;
};
/**
* @inheritdoc
*/
OO.ui.MessageDialog.prototype.setDimensions = function ( dim ) {
var
dialog = this,
$scrollable = this.container.$element;
OO.ui.MessageDialog.super.prototype.setDimensions.call( this, dim );
// Twiddle the overflow property, otherwise an unnecessary scrollbar will be produced.
// Need to do it after transition completes (250ms), add 50ms just in case.
setTimeout( function () {
var oldOverflow = $scrollable[ 0 ].style.overflow,
activeElement = document.activeElement;
$scrollable[ 0 ].style.overflow = 'hidden';
OO.ui.Element.static.reconsiderScrollbars( $scrollable[ 0 ] );
// Check reconsiderScrollbars didn't destroy our focus, as we
// are doing this after the ready process.
if ( activeElement && activeElement !== document.activeElement && activeElement.focus ) {
activeElement.focus();
}
$scrollable[ 0 ].style.overflow = oldOverflow;
}, 300 );
dialog.fitActions();
// Wait for CSS transition to finish and do it again :(
setTimeout( function () {
dialog.fitActions();
}, 300 );
return this;
};
/**
* @inheritdoc
*/
OO.ui.MessageDialog.prototype.initialize = function () {
// Parent method
OO.ui.MessageDialog.super.prototype.initialize.call( this );
// Properties
this.$actions = $( '<div>' );
this.container = new OO.ui.PanelLayout( {
scrollable: true, classes: [ 'oo-ui-messageDialog-container' ]
} );
this.text = new OO.ui.PanelLayout( {
padded: true, expanded: false, classes: [ 'oo-ui-messageDialog-text' ]
} );
this.message = new OO.ui.LabelWidget( {
classes: [ 'oo-ui-messageDialog-message' ]
} );
// Initialization
this.title.$element.addClass( 'oo-ui-messageDialog-title' );
this.$content.addClass( 'oo-ui-messageDialog-content' );
this.container.$element.append( this.text.$element );
this.text.$element.append( this.title.$element, this.message.$element );
this.$body.append( this.container.$element );
this.$actions.addClass( 'oo-ui-messageDialog-actions' );
this.$foot.append( this.$actions );
};
/**
* @inheritdoc
*/
OO.ui.MessageDialog.prototype.getActionWidgetConfig = function ( config ) {
// Force unframed
return $.extend( {}, config, { framed: false } );
};
/**
* @inheritdoc
*/
OO.ui.MessageDialog.prototype.attachActions = function () {
var i, len, special, others;
// Parent method
OO.ui.MessageDialog.super.prototype.attachActions.call( this );
special = this.actions.getSpecial();
others = this.actions.getOthers();
if ( special.safe ) {
this.$actions.append( special.safe.$element );
special.safe.toggleFramed( true );
}
for ( i = 0, len = others.length; i < len; i++ ) {
this.$actions.append( others[ i ].$element );
others[ i ].toggleFramed( true );
}
if ( special.primary ) {
this.$actions.append( special.primary.$element );
special.primary.toggleFramed( true );
}
};
/**
* Fit action actions into columns or rows.
*
* Columns will be used if all labels can fit without overflow, otherwise rows will be used.
*
* @private
*/
OO.ui.MessageDialog.prototype.fitActions = function () {
var i, len, action,
previous = this.verticalActionLayout,
actions = this.actions.get();
// Detect clipping
this.toggleVerticalActionLayout( false );
for ( i = 0, len = actions.length; i < len; i++ ) {
action = actions[ i ];
if ( action.$element[ 0 ].scrollWidth > action.$element[ 0 ].clientWidth ) {
this.toggleVerticalActionLayout( true );
break;
}
}
// Move the body out of the way of the foot
this.$body.css( 'bottom', this.$foot.outerHeight( true ) );
if ( this.verticalActionLayout !== previous ) {
// We changed the layout, window height might need to be updated.
this.updateSize();
}
};
/**
* ProcessDialog windows encapsulate a {@link OO.ui.Process process} and all of the code necessary
* to complete it. If the process terminates with an error, a customizable {@link OO.ui.Error error
* interface} alerts users to the trouble, permitting the user to dismiss the error and try again
* when relevant. The ProcessDialog class is always extended and customized with the actions and
* content required for each process.
*
* The process dialog box consists of a header that visually represents the ‘working’ state of long
* processes with an animation. The header contains the dialog title as well as
* two {@link OO.ui.ActionWidget action widgets}: a ‘safe’ action on the left (e.g., ‘Cancel’) and
* a ‘primary’ action on the right (e.g., ‘Done’).
*
* Like other windows, the process dialog is managed by a
* {@link OO.ui.WindowManager window manager}.
* Please see the [OOUI documentation on MediaWiki][1] for more information and examples.
*
* @example
* // Example: Creating and opening a process dialog window.
* function MyProcessDialog( config ) {
* MyProcessDialog.super.call( this, config );
* }
* OO.inheritClass( MyProcessDialog, OO.ui.ProcessDialog );
*
* MyProcessDialog.static.name = 'myProcessDialog';
* MyProcessDialog.static.title = 'Process dialog';
* MyProcessDialog.static.actions = [
* { action: 'save', label: 'Done', flags: 'primary' },
* { label: 'Cancel', flags: 'safe' }
* ];
*
* MyProcessDialog.prototype.initialize = function () {
* MyProcessDialog.super.prototype.initialize.apply( this, arguments );
* this.content = new OO.ui.PanelLayout( { padded: true, expanded: false } );
* this.content.$element.append( '<p>This is a process dialog window. The header ' +
* 'contains the title and two buttons: \'Cancel\' (a safe action) on the left and ' +
* '\'Done\' (a primary action) on the right.</p>' );
* this.$body.append( this.content.$element );
* };
* MyProcessDialog.prototype.getActionProcess = function ( action ) {
* var dialog = this;
* if ( action ) {
* return new OO.ui.Process( function () {
* dialog.close( { action: action } );
* } );
* }
* return MyProcessDialog.super.prototype.getActionProcess.call( this, action );
* };
*
* var windowManager = new OO.ui.WindowManager();
* $( document.body ).append( windowManager.$element );
*
* var dialog = new MyProcessDialog();
* windowManager.addWindows( [ dialog ] );
* windowManager.openWindow( dialog );
*
* [1]: https://www.mediawiki.org/wiki/OOUI/Windows/Process_Dialogs
*
* @abstract
* @class
* @extends OO.ui.Dialog
*
* @constructor
* @param {Object} [config] Configuration options
*/
OO.ui.ProcessDialog = function OoUiProcessDialog( config ) {
// Parent constructor
OO.ui.ProcessDialog.super.call( this, config );
// Properties
this.fitOnOpen = false;
// Initialization
this.$element.addClass( 'oo-ui-processDialog' );
if ( OO.ui.isMobile() ) {
this.$element.addClass( 'oo-ui-isMobile' );
}
};
/* Setup */
OO.inheritClass( OO.ui.ProcessDialog, OO.ui.Dialog );
/* Methods */
/**
* Handle dismiss button click events.
*
* Hides errors.
*
* @private
*/
OO.ui.ProcessDialog.prototype.onDismissErrorButtonClick = function () {
this.hideErrors();
};
/**
* Handle retry button click events.
*
* Hides errors and then tries again.
*
* @private
*/
OO.ui.ProcessDialog.prototype.onRetryButtonClick = function () {
this.hideErrors();
this.executeAction( this.currentAction );
};
/**
* @inheritdoc
*/
OO.ui.ProcessDialog.prototype.initialize = function () {
// Parent method
OO.ui.ProcessDialog.super.prototype.initialize.call( this );
// Properties
this.$navigation = $( '<div>' );
this.$location = $( '<div>' );
this.$safeActions = $( '<div>' );
this.$primaryActions = $( '<div>' );
this.$otherActions = $( '<div>' );
this.dismissButton = new OO.ui.ButtonWidget( {
label: OO.ui.msg( 'ooui-dialog-process-dismiss' )
} );
this.retryButton = new OO.ui.ButtonWidget();
this.$errors = $( '<div>' );
this.$errorsTitle = $( '<div>' );
// Events
this.dismissButton.connect( this, {
click: 'onDismissErrorButtonClick'
} );
this.retryButton.connect( this, {
click: 'onRetryButtonClick'
} );
this.title.connect( this, {
labelChange: 'fitLabel'
} );
// Initialization
this.title.$element.addClass( 'oo-ui-processDialog-title' );
this.$location
.append( this.title.$element )
.addClass( 'oo-ui-processDialog-location' );
this.$safeActions.addClass( 'oo-ui-processDialog-actions-safe' );
this.$primaryActions.addClass( 'oo-ui-processDialog-actions-primary' );
this.$otherActions.addClass( 'oo-ui-processDialog-actions-other' );
this.$errorsTitle
.addClass( 'oo-ui-processDialog-errors-title' )
.text( OO.ui.msg( 'ooui-dialog-process-error' ) );
this.$errors
.addClass( 'oo-ui-processDialog-errors oo-ui-element-hidden' )
.append(
this.$errorsTitle,
$( '<div>' ).addClass( 'oo-ui-processDialog-errors-actions' ).append(
this.dismissButton.$element, this.retryButton.$element
)
);
this.$content
.addClass( 'oo-ui-processDialog-content' )
.append( this.$errors );
this.$navigation
.addClass( 'oo-ui-processDialog-navigation' )
// Note: Order of appends below is important. These are in the order
// we want tab to go through them. Display-order is handled entirely
// by CSS absolute-positioning. As such, primary actions like "done"
// should go first.
.append( this.$primaryActions, this.$location, this.$safeActions );
this.$head.append( this.$navigation );
this.$foot.append( this.$otherActions );
};
/**
* @inheritdoc
*/
OO.ui.ProcessDialog.prototype.getActionWidgetConfig = function ( config ) {
function checkFlag( flag ) {
return config.flags === flag ||
( Array.isArray( config.flags ) && config.flags.indexOf( flag ) !== -1 );
}
config = $.extend( { framed: true }, config );
if ( checkFlag( 'close' ) ) {
// Change close buttons to icon only.
$.extend( config, {
icon: 'close',
invisibleLabel: true
} );
} else if ( checkFlag( 'back' ) ) {
// Change back buttons to icon only.
$.extend( config, {
icon: 'previous',
invisibleLabel: true
} );
}
return config;
};
/**
* @inheritdoc
*/
OO.ui.ProcessDialog.prototype.attachActions = function () {
var i, len, other, special, others;
// Parent method
OO.ui.ProcessDialog.super.prototype.attachActions.call( this );
special = this.actions.getSpecial();
others = this.actions.getOthers();
if ( special.primary ) {
this.$primaryActions.append( special.primary.$element );
}
for ( i = 0, len = others.length; i < len; i++ ) {
other = others[ i ];
this.$otherActions.append( other.$element );
}
if ( special.safe ) {
this.$safeActions.append( special.safe.$element );
}
};
/**
* @inheritdoc
*/
OO.ui.ProcessDialog.prototype.executeAction = function ( action ) {
var dialog = this;
return OO.ui.ProcessDialog.super.prototype.executeAction.call( this, action )
.fail( function ( errors ) {
dialog.showErrors( errors || [] );
} );
};
/**
* @inheritdoc
*/
OO.ui.ProcessDialog.prototype.setDimensions = function () {
var dialog = this;
// Parent method
OO.ui.ProcessDialog.super.prototype.setDimensions.apply( this, arguments );
this.fitLabel();
// If there are many actions, they might be shown on multiple lines. Their layout can change
// when resizing the dialog and when changing the actions. Adjust the height of the footer to
// fit them.
dialog.$body.css( 'bottom', dialog.$foot.outerHeight( true ) );
// Wait for CSS transition to finish and do it again :(
setTimeout( function () {
dialog.$body.css( 'bottom', dialog.$foot.outerHeight( true ) );
}, 300 );
};
/**
* Fit label between actions.
*
* @private
* @chainable
* @return {OO.ui.MessageDialog} The dialog, for chaining
*/
OO.ui.ProcessDialog.prototype.fitLabel = function () {
var safeWidth, primaryWidth, biggerWidth, labelWidth, navigationWidth, leftWidth, rightWidth,
size = this.getSizeProperties();
if ( typeof size.width !== 'number' ) {
if ( this.isOpened() ) {
navigationWidth = this.$head.width() - 20;
} else if ( this.isOpening() ) {
if ( !this.fitOnOpen ) {
// Size is relative and the dialog isn't open yet, so wait.
// FIXME: This should ideally be handled by setup somehow.
this.manager.lifecycle.opened.done( this.fitLabel.bind( this ) );
this.fitOnOpen = true;
}
return;
} else {
return;
}
} else {
navigationWidth = size.width - 20;
}
safeWidth = this.$safeActions.width();
primaryWidth = this.$primaryActions.width();
biggerWidth = Math.max( safeWidth, primaryWidth );
labelWidth = this.title.$element.width();
if ( !OO.ui.isMobile() && 2 * biggerWidth + labelWidth < navigationWidth ) {
// We have enough space to center the label
leftWidth = rightWidth = biggerWidth;
} else {
// Let's hope we at least have enough space not to overlap, because we can't wrap
// the label.
if ( this.getDir() === 'ltr' ) {
leftWidth = safeWidth;
rightWidth = primaryWidth;
} else {
leftWidth = primaryWidth;
rightWidth = safeWidth;
}
}
this.$location.css( { paddingLeft: leftWidth, paddingRight: rightWidth } );
return this;
};
/**
* Handle errors that occurred during accept or reject processes.
*
* @private
* @param {OO.ui.Error[]|OO.ui.Error} errors Errors to be handled
*/
OO.ui.ProcessDialog.prototype.showErrors = function ( errors ) {
var i, len, actions,
items = [],
abilities = {},
recoverable = true,
warning = false;
if ( errors instanceof OO.ui.Error ) {
errors = [ errors ];
}
for ( i = 0, len = errors.length; i < len; i++ ) {
if ( !errors[ i ].isRecoverable() ) {
recoverable = false;
}
if ( errors[ i ].isWarning() ) {
warning = true;
}
items.push( new OO.ui.MessageWidget( {
type: 'error',
label: errors[ i ].getMessage()
} ).$element[ 0 ] );
}
this.$errorItems = $( items );
if ( recoverable ) {
abilities[ this.currentAction ] = true;
// Copy the flags from the first matching action.
actions = this.actions.get( { actions: this.currentAction } );
if ( actions.length ) {
this.retryButton.clearFlags().setFlags( actions[ 0 ].getFlags() );
}
} else {
abilities[ this.currentAction ] = false;
this.actions.setAbilities( abilities );
}
if ( warning ) {
this.retryButton.setLabel( OO.ui.msg( 'ooui-dialog-process-continue' ) );
} else {
this.retryButton.setLabel( OO.ui.msg( 'ooui-dialog-process-retry' ) );
}
this.retryButton.toggle( recoverable );
this.$errorsTitle.after( this.$errorItems );
this.$errors.removeClass( 'oo-ui-element-hidden' ).scrollTop( 0 );
};
/**
* Hide errors.
*
* @private
*/
OO.ui.ProcessDialog.prototype.hideErrors = function () {
this.$errors.addClass( 'oo-ui-element-hidden' );
if ( this.$errorItems ) {
this.$errorItems.remove();
this.$errorItems = null;
}
};
/**
* @inheritdoc
*/
OO.ui.ProcessDialog.prototype.getTeardownProcess = function ( data ) {
// Parent method
return OO.ui.ProcessDialog.super.prototype.getTeardownProcess.call( this, data )
.first( function () {
// Make sure to hide errors.
this.hideErrors();
this.fitOnOpen = false;
}, this );
};
/**
* @class OO.ui
*/
/**
* Lazy-initialize and return a global OO.ui.WindowManager instance, used by OO.ui.alert and
* OO.ui.confirm.
*
* @private
* @return {OO.ui.WindowManager}
*/
OO.ui.getWindowManager = function () {
if ( !OO.ui.windowManager ) {
OO.ui.windowManager = new OO.ui.WindowManager();
$( document.body ).append( OO.ui.windowManager.$element );
OO.ui.windowManager.addWindows( [ new OO.ui.MessageDialog() ] );
}
return OO.ui.windowManager;
};
/**
* Display a quick modal alert dialog, using a OO.ui.MessageDialog. While the dialog is open, the
* rest of the page will be dimmed out and the user won't be able to interact with it. The dialog
* has only one action button, labelled "OK", clicking it will simply close the dialog.
*
* A window manager is created automatically when this function is called for the first time.
*
* @example
* OO.ui.alert( 'Something happened!' ).done( function () {
* console.log( 'User closed the dialog.' );
* } );
*
* OO.ui.alert( 'Something larger happened!', { size: 'large' } );
*
* @param {jQuery|string} text Message text to display
* @param {Object} [options] Additional options, see OO.ui.MessageDialog#getSetupProcess
* @return {jQuery.Promise} Promise resolved when the user closes the dialog
*/
OO.ui.alert = function ( text, options ) {
return OO.ui.getWindowManager().openWindow( 'message', $.extend( {
message: text,
actions: [ OO.ui.MessageDialog.static.actions[ 0 ] ]
}, options ) ).closed.then( function () {
return undefined;
} );
};
/**
* Display a quick modal confirmation dialog, using a OO.ui.MessageDialog. While the dialog is open,
* the rest of the page will be dimmed out and the user won't be able to interact with it. The
* dialog has two action buttons, one to confirm an operation (labelled "OK") and one to cancel it
* (labelled "Cancel").
*
* A window manager is created automatically when this function is called for the first time.
*
* @example
* OO.ui.confirm( 'Are you sure?' ).done( function ( confirmed ) {
* if ( confirmed ) {
* console.log( 'User clicked "OK"!' );
* } else {
* console.log( 'User clicked "Cancel" or closed the dialog.' );
* }
* } );
*
* @param {jQuery|string} text Message text to display
* @param {Object} [options] Additional options, see OO.ui.MessageDialog#getSetupProcess
* @return {jQuery.Promise} Promise resolved when the user closes the dialog. If the user chose to
* confirm, the promise will resolve to boolean `true`; otherwise, it will resolve to boolean
* `false`.
*/
OO.ui.confirm = function ( text, options ) {
return OO.ui.getWindowManager().openWindow( 'message', $.extend( {
message: text
}, options ) ).closed.then( function ( data ) {
return !!( data && data.action === 'accept' );
} );
};
/**
* Display a quick modal prompt dialog, using a OO.ui.MessageDialog. While the dialog is open,
* the rest of the page will be dimmed out and the user won't be able to interact with it. The
* dialog has a text input widget and two action buttons, one to confirm an operation
* (labelled "OK") and one to cancel it (labelled "Cancel").
*
* A window manager is created automatically when this function is called for the first time.
*
* @example
* OO.ui.prompt( 'Choose a line to go to', {
* textInput: { placeholder: 'Line number' }
* } ).done( function ( result ) {
* if ( result !== null ) {
* console.log( 'User typed "' + result + '" then clicked "OK".' );
* } else {
* console.log( 'User clicked "Cancel" or closed the dialog.' );
* }
* } );
*
* @param {jQuery|string} text Message text to display
* @param {Object} [options] Additional options, see OO.ui.MessageDialog#getSetupProcess
* @param {Object} [options.textInput] Additional options for text input widget,
* see OO.ui.TextInputWidget
* @return {jQuery.Promise} Promise resolved when the user closes the dialog. If the user chose to
* confirm, the promise will resolve with the value of the text input widget; otherwise, it will
* resolve to `null`.
*/
OO.ui.prompt = function ( text, options ) {
var instance,
manager = OO.ui.getWindowManager(),
textInput = new OO.ui.TextInputWidget( ( options && options.textInput ) || {} ),
textField = new OO.ui.FieldLayout( textInput, {
align: 'top',
label: text
} );
instance = manager.openWindow( 'message', $.extend( {
message: textField.$element
}, options ) );
// TODO: This is a little hacky, and could be done by extending MessageDialog instead.
instance.opened.then( function () {
textInput.on( 'enter', function () {
manager.getCurrentWindow().close( { action: 'accept' } );
} );
textInput.focus();
} );
return instance.closed.then( function ( data ) {
return data && data.action === 'accept' ? textInput.getValue() : null;
} );
};
}( OO ) );
//# sourceMappingURL=oojs-ui-windows.js.map.json | cdnjs/cdnjs | ajax/libs/oojs-ui/0.40.3/oojs-ui-windows.js | JavaScript | mit | 117,418 |
'use strict';
/* global angular */
(function() {
var aDashboard = angular.module('aDashboard');
aDashboard.controller('ADashboardController', function( $scope, $rootScope, tradelistFactory, $timeout) {
$scope.subState = $scope.$parent;
$scope.accountValue;
$scope.avgWin;
$scope.avgLoss;
$scope.avgTradeSize;
$scope.$on('tradeActionUpdated', function(event, args) {
var tradelist = args.tradelist;
calculateValue( tradelist );
$scope.avgWin = calculateAvgWin( tradelist ).avg;
$scope.winCount = calculateAvgWin( tradelist ).count;
$scope.avgLoss = calculateAvgLoss( tradelist ).avg;
$scope.lossCount = calculateAvgLoss( tradelist ).count;
calculateAvgTradeSize( tradelist );
});
var getTradelist = function() {
tradelistFactory.getTradelist()
.then(function(tradelist) {
});
};
getTradelist();
function calculateValue( tradelist ){
var sum = 0;
tradelist.forEach(function(entry) {
if( entry.tradeValue ){
sum += Number(entry.tradeValue);
}
});
$scope.accountValue = sum;
};
function calculateAvgWin( tradelist ){
var sum = 0;
var count = 0;
tradelist.forEach(function(entry) {
if( entry.tradeValue > 0 ){
++count;
sum += Number(entry.tradeValue);
}
});
return {avg: (sum / count).toFixed(2), count: count};
};
function calculateAvgLoss( tradelist ){
var sum = 0;
var count = 0;
tradelist.forEach(function(entry) {
if( entry.tradeValue < 0 ){
++count
sum += Number(entry.tradeValue);
}
});
console.log('sum: ', sum);
return {avg: (sum / count).toFixed(2), count: count};
};
function calculateAvgTradeSize( tradelist ){
var actionCount = 0;
var sum = 0;
tradelist.forEach(function(entry) {
var actions = entry.actions;
actions.forEach(function(action) {
if( action.price && action.quantity ){
++actionCount;
sum = sum + (Math.abs(action.price * action.quantity));
}
});
});
if( actionCount == 0 ){
actionCount = 1;
}
$scope.avgTradeSize = (sum / actionCount).toFixed(2);
};
});
})();
| LAzzam2/tradeTracker-client | app/common-components/directives/a-dashboard/a-dashboard_controller.js | JavaScript | mit | 2,143 |
'use strict';
// MODULES //
var isArrayLike = require( 'validate.io-array-like' ),
isTypedArrayLike = require( 'validate.io-typed-array-like' ),
deepSet = require( 'utils-deep-set' ).factory,
deepGet = require( 'utils-deep-get' ).factory;
// FUNCTIONS
var POW = require( './number.js' );
// POWER //
/**
* FUNCTION: power( arr, y, path[, sep] )
* Computes an element-wise power or each element and deep sets the input array.
*
* @param {Array} arr - input array
* @param {Number[]|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|Number} y - either an array of equal length or a scalar
* @param {String} path - key path used when deep getting and setting
* @param {String} [sep] - key path separator
* @returns {Array} input array
*/
function power( x, y, path, sep ) {
var len = x.length,
opts = {},
dget,
dset,
v, i;
if ( arguments.length > 3 ) {
opts.sep = sep;
}
if ( len ) {
dget = deepGet( path, opts );
dset = deepSet( path, opts );
if ( isTypedArrayLike( y ) ) {
for ( i = 0; i < len; i++ ) {
v = dget( x[ i ] );
if ( typeof v === 'number' ) {
dset( x[ i ], POW( v, y[ i ] ) );
} else {
dset( x[ i ], NaN );
}
}
} else if ( isArrayLike( y ) ) {
for ( i = 0; i < len; i++ ) {
v = dget( x[ i ] );
if ( typeof v === 'number' && typeof y[ i ] === 'number' ) {
dset( x[ i ], POW( v, y[ i ] ) );
} else {
dset( x[ i ], NaN );
}
}
} else {
if ( typeof y === 'number' ) {
for ( i = 0; i < len; i++ ) {
v = dget( x[ i ] );
if ( typeof v === 'number' ) {
dset( x[ i ], POW( v, y ) );
} else {
dset( x[ i ], NaN );
}
}
} else {
for ( i = 0; i < len; i++ ) {
dset( x[ i ], NaN );
}
}
}
}
return x;
} // end FUNCTION power()
// EXPORTS //
module.exports = power;
| compute-io/power | lib/deepset.js | JavaScript | mit | 1,889 |
'use strict';
function getReferenceMatrix (matrix, direction) {
return matrix.unflatten().rows.sort((r1, r2) => {
return (r1[1] > r2[1] ? 1 : r1[1] < r2[1] ? -1 : 0) * (direction === 'desc' ? -1 : 1);
});
}
function simpleSort (matrix, direction) {
const referenceMatrix = getReferenceMatrix(matrix, direction);
return matrix.clone({
axes: [
Object.assign({}, matrix.axes[0], {values: referenceMatrix.map(r => r[0])})
],
data: referenceMatrix.map(r => r[1])
});
}
function complexSort () {//matrix, direction, strategy, dimension) {
// const referenceMatrix = getReferenceMatrix(matrix.reduce(strategy, dimension), direction);
}
module.exports.ascending = function (strategy, dimension) {
if (this.dimension === 1) {
return simpleSort(this, 'asc');
} else if (this.dimension === 2) {
throw new Error('Cannot sort tables of dimension greater than 1. It\'s on the todo list though!');
return complexSort(this, 'asc', strategy, dimension);
} else {
throw new Error('Cannot sort tables of dimesnion greater than 2');
}
}
module.exports.descending = function (strategy, dimension) {
if (this.dimension === 1) {
return simpleSort(this, 'desc');
} else if (this.dimension === 2) {
throw new Error('Cannot sort tables of dimension greater than 1. It\'s on the todo list though!');
return complexSort(this, 'desc', strategy, dimension);
} else {
throw new Error('Cannot sort tables of dimesnion greater than 2');
}
}
function getReferenceMatrix (matrix, direction) {
return matrix.unflatten().rows.sort((r1, r2) => {
return (r1[1] > r2[1] ? 1 : r1[1] < r2[1] ? -1 : 0) * (direction === 'desc' ? -1 : 1);
});
}
function simpleSort (matrix, direction) {
const referenceMatrix = getReferenceMatrix(matrix, direction);
return matrix.clone({
axes: [
Object.assign({}, matrix.axes[0], {values: referenceMatrix.map(r => r[0])})
],
data: referenceMatrix.map(r => r[1])
});
}
module.exports.property = function (prop) {
const order = [].slice.call(arguments, 1);
const dimension = this.getAxis(prop);
if (dimension === -1) {
throw new Error(`Attempting to do a custom sort on the property ${prop}, which doesn't exist`);
}
const originalValues = this.axes.find(a => a.property === prop).values;
// this makes it easier to put the not found items last as the order
// will go n = first, n-1 = second, ... , 0 = last, -1 = not found
// we simply exchange 1 and -1 in the function below :o
order.reverse();
const orderedValues = originalValues.slice().sort((v1, v2) => {
const i1 = order.indexOf(v1);
const i2 = order.indexOf(v2);
return i1 > i2 ? -1 : i1 < i2 ? 1 : 0;
});
const mapper = originalValues.map(v => orderedValues.indexOf(v))
const newAxes = this.axes.slice();
newAxes[dimension] = Object.assign({}, this.axes[dimension], {
values: orderedValues
});
return this.clone({
axes: newAxes,
data: Object.keys(this.data).reduce((obj, k) => {
const coords = k.split(',');
coords[dimension] = mapper[coords[dimension]];
obj[coords.join(',')] = this.data[k];
return obj;
}, {})
});
}
| Financial-Times/keen-query | lib/post-processing/sort.js | JavaScript | mit | 3,082 |
import watch from 'gulp-watch';
import browserSync from 'browser-sync';
import path from 'path';
/**
* Gulp task to watch files
* @return {function} Function task
*/
export default function watchFilesTask() {
const config = this.config;
const runSequence = require('run-sequence').use(this.gulp);
return () => {
if (config.entryHTML) {
watch(
path.join(
config.basePath,
config.browsersync.server.baseDir,
config.entryHTML
),
() => {
runSequence('build', browserSync.reload);
}
);
}
if (config.postcss) {
watch(path.join(config.sourcePath, '**/*.{css,scss,less}'), () => {
runSequence('postcss');
});
}
if (config.customWatch) {
if (typeof config.customWatch === 'function') {
config.customWatch(config, watch, browserSync);
} else {
watch(config.customWatch, () => {
runSequence('build', browserSync.reload);
});
}
}
};
}
| geut/gulp-appfy-tasks | src/tasks/watch-files.js | JavaScript | mit | 1,211 |
module.exports={A:{A:{"2":"K C G E B A WB"},B:{"2":"D","388":"u Y I M H"},C:{"1":"0 1 2 3 4 5 6 7 R S T U V W X w Z a b c d e f L h i j k l m n o p q r s t y v","2":"UB z F J K C G E B A D u Y I M H N O P Q SB RB"},D:{"1":"0 1 2 3 4 5 6 7 e f L h i j k l m n o p q r s t y v GB g DB VB EB","2":"F J K C G E B A D u Y I M H N O P Q R S T U","132":"V W X w Z a b c d"},E:{"1":"E B A KB LB MB","2":"F J K C FB AB HB","388":"G JB","514":"IB"},F:{"1":"R S T U V W X w Z a b c d e f L h i j k l m n o p q r s t","2":"8 9 E A D NB OB PB QB TB x","132":"I M H N O P Q"},G:{"1":"A bB cB dB eB","2":"AB CB BB XB YB ZB","388":"G aB"},H:{"2":"fB"},I:{"1":"g kB lB","2":"z F gB hB iB jB BB"},J:{"2":"C B"},K:{"1":"L","2":"8 9 B A D x"},L:{"1":"g"},M:{"1":"v"},N:{"2":"B A"},O:{"1":"mB"},P:{"1":"F J"},Q:{"1":"nB"},R:{"1":"oB"}},B:1,C:"HTML templates"};
| Montana-Studio/PI_Landing | node_modules/caniuse-lite/data/features/template.js | JavaScript | mit | 840 |
// load package date-util
require('../libs/sugar-date')
module.exports = (pluginContext) => {
return {
respondsTo: (query) => {
return true
},
search: (query = '', env = {}) => {
// check if timestamp given
let isTimestamp = !isNaN(parseFloat(query)) && isFinite(query);
// default settings
let outputFormat = env['outputFormat'] || '{full}';
let timestampUnit = 'seconds';
// override timestamp unit
if (env['timestampUnit'] && env['timestampUnit'] == 'milliseconds') {
timestampUnit = 'milliseconds';
}
// check if string or timestamp is given
if (!isTimestamp) {
// handle timestamp unit
if (timestampUnit == 'seconds') {
// timestamp in seconds
outputFormat = '{X}';
} else {
// timestamp in milliseconds
outputFormat = '{x}';
}
} else {
// parse query
query = parseFloat(query);
// convert given timestamp in seconds to milliseconds
if (timestampUnit == 'seconds') {
query *= 1000;
}
}
// create Sugar Date
var sugarDate = Sugar.Date.create(query);
// check if valid date
if (!Sugar.Date.isValid(sugarDate)) {
return Promise.reject();
}
// set result value
const value = Sugar.Date.format(sugarDate, outputFormat);
// set result subtitle
const subtitle = `Select to copy ` + (isTimestamp ? `the formatted date` : `the timestamp in ${timestampUnit}`) + `.`;
// return results
return new Promise((resolve, reject) => {
resolve([
{
id: 'zazu-utime',
icon: 'fa-clock-o',
title: value,
subtitle: subtitle,
value: value,
}
])
})
}
}
}
| puyt/zazu-utime | src/utime.js | JavaScript | mit | 2,252 |
'use strict';
describe('Directive: cssCode', function () {
// load the directive's module and view
beforeEach(module('googleWebfontsHelperApp'));
beforeEach(module('app/cssCode/cssCode.html'));
var element, scope;
beforeEach(inject(function ($rootScope) {
scope = $rootScope.$new();
}));
it('should make hidden element visible', inject(function ($compile) {
element = angular.element('<css-code></css-code>');
element = $compile(element)(scope);
scope.$apply();
expect(element.text()).toBe('this is the cssCode directive');
}));
}); | majodev/google-webfonts-helper | client/app/cssCode/cssCode.directive.spec.js | JavaScript | mit | 573 |
var assert = require('assert');
var keys = require("cmd/common/keys/user.js");
var userKeysNock = require('test/fixtures/user/fixture_user_keys');
module.exports = {
setUp : function(cb){
return cb();
},
'list keys' : function(cb){
keys({ _ : ['list'] }, function(err, list){
assert.equal(err, null, err);
assert.ok(list);
assert.equal(list.list.length, 1);
return cb();
});
},
'create keys' : function(cb){
keys({ _ : ['add'] }, function(err){
assert.ok(!err, err);
keys({ _ : ['add', 'UserKey'] }, function(err, key){
assert.equal(err, null, err);
assert.ok(key.apiKey);
assert.ok(key.apiKey.label);
assert.ok(key.apiKey.key);
return cb();
});
});
},
'revoke keys' : function(cb){
keys.skipPrompt = true;
keys({ _ : ['delete'] }, function(err){
assert.ok(err);
keys({ _ : ['delete', 'UserKey'] }, function(err, key){
assert.equal(err, null, err);
assert.ok(key.apiKey);
assert.ok(key.apiKey.label);
assert.ok(key.apiKey.key);
return cb();
});
});
},
'update keys' : function (cb) {
keys.skipPrompt = true;
keys({ _ : ['update'] }, function(err){
assert.ok(err);
keys({ _ : ['update', 'UserKey', 'UserKey-Updated'] }, function(err, key){
assert.ok(!err, err);
assert.ok(key.apiKey);
assert.ok(key.apiKey.label);
assert.equal('UserKey-Updated', key.apiKey.label);
keys({ _ : ['update', '1239jncjjcd'] }, function(err){
assert.ok(err);
return cb();
});
});
});
},
'target keys' : function(cb){
var key_val = "pviryBwt22iZ0iInufMYBuVV";
keys({ _ : ['target', 'UserKey'] }, function(err, r){
assert.equal(err, null, err);
assert.equal(r, key_val);
keys({ _ : ['target'] }, function(err, r){
assert.equal(err, null);
assert.equal(r, key_val);
return cb();
});
});
},
tearDown : function(cb){
userKeysNock.done();
return cb();
}
};
| shannonmpoole/fh-fhc | test/unit/legacy/test_user_keys.js | JavaScript | mit | 2,115 |
module.exports = {
audioFilter: require('./audioFilter'),
destination: require('./destination'),
filename: require('./filename'),
multer: require('./multer')
}
| lighting-perspectives/jams | server/middlewares/sample/index.js | JavaScript | mit | 168 |
import * as types from 'constants/ActionTypes'
import jsCookie from 'js-cookie'
import history from 'history'
export const setUser = (user) => (dispatch) => {
dispatch({
type: types.SET_USER,
payload: { ...user }
})
}
| oct16/Blog-FE | src/actions/user.js | JavaScript | mit | 230 |
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.1-master-f6dedff
*/
(function( window, angular, undefined ){
"use strict";
/**
* @ngdoc module
* @name material.components.bottomSheet
* @description
* BottomSheet
*/
MdBottomSheetDirective['$inject'] = ["$mdBottomSheet"];
MdBottomSheetProvider['$inject'] = ["$$interimElementProvider"];
angular
.module('material.components.bottomSheet', [
'material.core',
'material.components.backdrop'
])
.directive('mdBottomSheet', MdBottomSheetDirective)
.provider('$mdBottomSheet', MdBottomSheetProvider);
/* ngInject */
function MdBottomSheetDirective($mdBottomSheet) {
return {
restrict: 'E',
link : function postLink(scope, element) {
element.addClass('_md'); // private md component indicator for styling
// When navigation force destroys an interimElement, then
// listen and $destroy() that interim instance...
scope.$on('$destroy', function() {
$mdBottomSheet.destroy();
});
}
};
}
/**
* @ngdoc service
* @name $mdBottomSheet
* @module material.components.bottomSheet
*
* @description
* `$mdBottomSheet` opens a bottom sheet over the app and provides a simple promise API.
*
* ## Restrictions
*
* - The bottom sheet's template must have an outer `<md-bottom-sheet>` element.
* - Add the `md-grid` class to the bottom sheet for a grid layout.
* - Add the `md-list` class to the bottom sheet for a list layout.
*
* @usage
* <hljs lang="html">
* <div ng-controller="MyController">
* <md-button ng-click="openBottomSheet()">
* Open a Bottom Sheet!
* </md-button>
* </div>
* </hljs>
* <hljs lang="js">
* var app = angular.module('app', ['ngMaterial']);
* app.controller('MyController', function($scope, $mdBottomSheet) {
* $scope.openBottomSheet = function() {
* $mdBottomSheet.show({
* template: '<md-bottom-sheet>Hello!</md-bottom-sheet>'
* });
* };
* });
* </hljs>
*/
/**
* @ngdoc method
* @name $mdBottomSheet#show
*
* @description
* Show a bottom sheet with the specified options.
*
* @param {object} options An options object, with the following properties:
*
* - `templateUrl` - `{string=}`: The url of an html template file that will
* be used as the content of the bottom sheet. Restrictions: the template must
* have an outer `md-bottom-sheet` element.
* - `template` - `{string=}`: Same as templateUrl, except this is an actual
* template string.
* - `scope` - `{object=}`: the scope to link the template / controller to. If none is specified, it will create a new child scope.
* This scope will be destroyed when the bottom sheet is removed unless `preserveScope` is set to true.
* - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed. Default is false
* - `controller` - `{string=}`: The controller to associate with this bottom sheet.
* - `locals` - `{string=}`: An object containing key/value pairs. The keys will
* be used as names of values to inject into the controller. For example,
* `locals: {three: 3}` would inject `three` into the controller with the value
* of 3.
* - `clickOutsideToClose` - `{boolean=}`: Whether the user can click outside the bottom sheet to
* close it. Default true.
* - `bindToController` - `{boolean=}`: When set to true, the locals will be bound to the controller instance.
* - `disableBackdrop` - `{boolean=}`: When set to true, the bottomsheet will not show a backdrop.
* - `escapeToClose` - `{boolean=}`: Whether the user can press escape to close the bottom sheet.
* Default true.
* - `resolve` - `{object=}`: Similar to locals, except it takes promises as values
* and the bottom sheet will not open until the promises resolve.
* - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.
* - `parent` - `{element=}`: The element to append the bottom sheet to. The `parent` may be a `function`, `string`,
* `object`, or null. Defaults to appending to the body of the root element (or the root element) of the application.
* e.g. angular.element(document.getElementById('content')) or "#content"
* - `disableParentScroll` - `{boolean=}`: Whether to disable scrolling while the bottom sheet is open.
* Default true.
*
* @returns {promise} A promise that can be resolved with `$mdBottomSheet.hide()` or
* rejected with `$mdBottomSheet.cancel()`.
*/
/**
* @ngdoc method
* @name $mdBottomSheet#hide
*
* @description
* Hide the existing bottom sheet and resolve the promise returned from
* `$mdBottomSheet.show()`. This call will close the most recently opened/current bottomsheet (if any).
*
* @param {*=} response An argument for the resolved promise.
*
*/
/**
* @ngdoc method
* @name $mdBottomSheet#cancel
*
* @description
* Hide the existing bottom sheet and reject the promise returned from
* `$mdBottomSheet.show()`.
*
* @param {*=} response An argument for the rejected promise.
*
*/
function MdBottomSheetProvider($$interimElementProvider) {
// how fast we need to flick down to close the sheet, pixels/ms
bottomSheetDefaults['$inject'] = ["$animate", "$mdConstant", "$mdUtil", "$mdTheming", "$mdBottomSheet", "$rootElement", "$mdGesture", "$log"];
var CLOSING_VELOCITY = 0.5;
var PADDING = 80; // same as css
return $$interimElementProvider('$mdBottomSheet')
.setDefaults({
methods: ['disableParentScroll', 'escapeToClose', 'clickOutsideToClose'],
options: bottomSheetDefaults
});
/* ngInject */
function bottomSheetDefaults($animate, $mdConstant, $mdUtil, $mdTheming, $mdBottomSheet, $rootElement,
$mdGesture, $log) {
var backdrop;
return {
themable: true,
onShow: onShow,
onRemove: onRemove,
disableBackdrop: false,
escapeToClose: true,
clickOutsideToClose: true,
disableParentScroll: true
};
function onShow(scope, element, options, controller) {
element = $mdUtil.extractElementByName(element, 'md-bottom-sheet');
// prevent tab focus or click focus on the bottom-sheet container
element.attr('tabindex',"-1");
// Once the md-bottom-sheet has `ng-cloak` applied on his template the opening animation will not work properly.
// This is a very common problem, so we have to notify the developer about this.
if (element.hasClass('ng-cloak')) {
var message = '$mdBottomSheet: using `<md-bottom-sheet ng-cloak >` will affect the bottom-sheet opening animations.';
$log.warn( message, element[0] );
}
if (!options.disableBackdrop) {
// Add a backdrop that will close on click
backdrop = $mdUtil.createBackdrop(scope, "md-bottom-sheet-backdrop md-opaque");
// Prevent mouse focus on backdrop; ONLY programatic focus allowed.
// This allows clicks on backdrop to propogate to the $rootElement and
// ESC key events to be detected properly.
backdrop[0].tabIndex = -1;
if (options.clickOutsideToClose) {
backdrop.on('click', function() {
$mdUtil.nextTick($mdBottomSheet.cancel,true);
});
}
$mdTheming.inherit(backdrop, options.parent);
$animate.enter(backdrop, options.parent, null);
}
var bottomSheet = new BottomSheet(element, options.parent);
options.bottomSheet = bottomSheet;
$mdTheming.inherit(bottomSheet.element, options.parent);
if (options.disableParentScroll) {
options.restoreScroll = $mdUtil.disableScrollAround(bottomSheet.element, options.parent);
}
return $animate.enter(bottomSheet.element, options.parent, backdrop)
.then(function() {
var focusable = $mdUtil.findFocusTarget(element) || angular.element(
element[0].querySelector('button') ||
element[0].querySelector('a') ||
element[0].querySelector($mdUtil.prefixer('ng-click', true))
) || backdrop;
if (options.escapeToClose) {
options.rootElementKeyupCallback = function(e) {
if (e.keyCode === $mdConstant.KEY_CODE.ESCAPE) {
$mdUtil.nextTick($mdBottomSheet.cancel,true);
}
};
$rootElement.on('keyup', options.rootElementKeyupCallback);
focusable && focusable.focus();
}
});
}
function onRemove(scope, element, options) {
var bottomSheet = options.bottomSheet;
if (!options.disableBackdrop) $animate.leave(backdrop);
return $animate.leave(bottomSheet.element).then(function() {
if (options.disableParentScroll) {
options.restoreScroll();
delete options.restoreScroll;
}
bottomSheet.cleanup();
});
}
/**
* BottomSheet class to apply bottom-sheet behavior to an element
*/
function BottomSheet(element, parent) {
var deregister = $mdGesture.register(parent, 'drag', { horizontal: false });
parent.on('$md.dragstart', onDragStart)
.on('$md.drag', onDrag)
.on('$md.dragend', onDragEnd);
return {
element: element,
cleanup: function cleanup() {
deregister();
parent.off('$md.dragstart', onDragStart);
parent.off('$md.drag', onDrag);
parent.off('$md.dragend', onDragEnd);
}
};
function onDragStart(ev) {
// Disable transitions on transform so that it feels fast
element.css($mdConstant.CSS.TRANSITION_DURATION, '0ms');
}
function onDrag(ev) {
var transform = ev.pointer.distanceY;
if (transform < 5) {
// Slow down drag when trying to drag up, and stop after PADDING
transform = Math.max(-PADDING, transform / 2);
}
element.css($mdConstant.CSS.TRANSFORM, 'translate3d(0,' + (PADDING + transform) + 'px,0)');
}
function onDragEnd(ev) {
if (ev.pointer.distanceY > 0 &&
(ev.pointer.distanceY > 20 || Math.abs(ev.pointer.velocityY) > CLOSING_VELOCITY)) {
var distanceRemaining = element.prop('offsetHeight') - ev.pointer.distanceY;
var transitionDuration = Math.min(distanceRemaining / ev.pointer.velocityY * 0.75, 500);
element.css($mdConstant.CSS.TRANSITION_DURATION, transitionDuration + 'ms');
$mdUtil.nextTick($mdBottomSheet.cancel,true);
} else {
element.css($mdConstant.CSS.TRANSITION_DURATION, '');
element.css($mdConstant.CSS.TRANSFORM, '');
}
}
}
}
}
})(window, window.angular); | ohmygodvt95/wevivu | vendor/assets/components/angular-material/modules/js/bottomSheet/bottomSheet.js | JavaScript | mit | 10,698 |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var emblaCarousel_cjs=require("./embla-carousel.cjs.js"),react=require("react"),canUseDOM=!("undefined"==typeof window||!window.document);function useEmblaCarousel(e){var r=react.useState(),a=r[0],t=r[1],c=react.createRef();return react.useEffect(function(){canUseDOM&&null!=c&&c.current&&t(emblaCarousel_cjs(c.current,e))},[c,e]),react.useEffect(function(){return function(){return null==a?void 0:a.destroy()}},[]),[react.useCallback(function(e){var r=e.htmlTagName,a=void 0===r?"div":r,t=e.className,u=e.children;return react.createElement(a,{className:t,ref:c,style:{overflow:"hidden"}},u)},[]),a]}exports.useEmblaCarousel=useEmblaCarousel; | cdnjs/cdnjs | ajax/libs/embla-carousel/3.0.7/react.cjs.min.js | JavaScript | mit | 711 |
var scp;
var cal_color;
$(document).ready(function(){
scp = angular.element('.main').scope();
$("#div_point").toggle();
//Set default values
cal_color = defaults.cal_color;
//Setup plugins
$("#cal_color").spectrum({
preferredFormat: "hex",
showInput: true,
color: cal_color,
change: setColor,
showButtons: false
});
//Show modal
$('.reveal-modal').css('max-height', $('html').height() - 110 + 'px');
$('#config_modal').reveal();
});
// Reset max-height after window resize
$(window).resize(function() {
$('.reveal-modal').css('max-height', $('html').height() - 110 + 'px');
});
function setColor(color){
//Color picker callback
if(this.id === "cal_color") cal_color = color;
}
function setup(){
//Setup environment before start
$('body').css("background-color", cal_color);
//Update model
$('#cal_color').trigger('input');
//Animate description and target
setTimeout(function() {
$("#div_text" ).fadeOut( "slow", function() {
$( "#div_point" ).fadeIn( "slow", startCalibration);
});
}, 2000);
}
function closeCallback(){
//Configuration modal close callback
$(".main").css("cursor","none");
setup();
}
function calibrationFinished(){
$(".main").css("cursor","pointer");
$("#text").html("Calibration completed");
$( "#div_point" ).fadeOut( "slow", function(){
$("#div_text" ).fadeIn( "slow", function() {
setTimeout(function() {
window.history.back();
}, 2500);
});
});
}
function startCalibration(){
scp.makeRequest();
}
| centosGit/ICA-SVP_WebClient | app/js/partials/svp_cal.js | JavaScript | mit | 1,529 |
/**
* @license Highstock JS v8.0.3 (2020-03-06)
* @module highcharts/indicators/wma
* @requires highcharts
* @requires highcharts/modules/stock
*
* Indicator series type for Highstock
*
* (c) 2010-2019 Kacper Madej
*
* License: www.highcharts.com/license
*/
'use strict';
import '../../indicators/wma.src.js';
| cdnjs/cdnjs | ajax/libs/highcharts/8.0.3/es-modules/masters/indicators/wma.src.js | JavaScript | mit | 321 |
/*
Highcharts JS v9.3.3 (2022-02-01)
(c) 2009-2021 Sebastian Bochan, Rafal Sebestjanski
License: www.highcharts.com/license
*/
'use strict';(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/dumbbell",["highcharts"],function(n){a(n);a.Highcharts=n;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function n(a,g,h,k){a.hasOwnProperty(g)||(a[g]=k.apply(null,h))}a=a?a._modules:{};n(a,"Series/AreaRange/AreaRangePoint.js",[a["Series/Area/AreaSeries.js"],a["Core/Series/Point.js"],a["Core/Utilities.js"]],
function(a,g,h){var k=this&&this.__extends||function(){var a=function(e,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(a,d){for(var b in d)d.hasOwnProperty(b)&&(a[b]=d[b])};return a(e,d)};return function(e,d){function b(){this.constructor=e}a(e,d);e.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)}}(),m=g.prototype,r=h.defined,c=h.isNumber;return function(a){function e(){var d=null!==a&&a.apply(this,arguments)||this;d.high=void 0;
d.low=void 0;d.options=void 0;d.plotHigh=void 0;d.plotLow=void 0;d.plotHighX=void 0;d.plotLowX=void 0;d.plotX=void 0;d.series=void 0;return d}k(e,a);e.prototype.setState=function(){var a=this.state,b=this.series,e=b.chart.polar;r(this.plotHigh)||(this.plotHigh=b.yAxis.toPixels(this.high,!0));r(this.plotLow)||(this.plotLow=this.plotY=b.yAxis.toPixels(this.low,!0));b.stateMarkerGraphic&&(b.lowerStateMarkerGraphic=b.stateMarkerGraphic,b.stateMarkerGraphic=b.upperStateMarkerGraphic);this.graphic=this.upperGraphic;
this.plotY=this.plotHigh;e&&(this.plotX=this.plotHighX);m.setState.apply(this,arguments);this.state=a;this.plotY=this.plotLow;this.graphic=this.lowerGraphic;e&&(this.plotX=this.plotLowX);b.stateMarkerGraphic&&(b.upperStateMarkerGraphic=b.stateMarkerGraphic,b.stateMarkerGraphic=b.lowerStateMarkerGraphic,b.lowerStateMarkerGraphic=void 0);m.setState.apply(this,arguments)};e.prototype.haloPath=function(){var a=this.series.chart.polar,b=[];this.plotY=this.plotLow;a&&(this.plotX=this.plotLowX);this.isInside&&
(b=m.haloPath.apply(this,arguments));this.plotY=this.plotHigh;a&&(this.plotX=this.plotHighX);this.isTopInside&&(b=b.concat(m.haloPath.apply(this,arguments)));return b};e.prototype.isValid=function(){return c(this.low)&&c(this.high)};return e}(a.prototype.pointClass)});n(a,"Series/Dumbbell/DumbbellPoint.js",[a["Series/AreaRange/AreaRangePoint.js"],a["Core/Utilities.js"]],function(a,g){var h=this&&this.__extends||function(){var a=function(c,l){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&
function(a,d){a.__proto__=d}||function(a,d){for(var b in d)d.hasOwnProperty(b)&&(a[b]=d[b])};return a(c,l)};return function(c,l){function e(){this.constructor=c}a(c,l);c.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}}(),k=g.extend,m=g.pick;g=function(a){function c(){var c=null!==a&&a.apply(this,arguments)||this;c.series=void 0;c.options=void 0;c.connector=void 0;c.pointWidth=void 0;return c}h(c,a);c.prototype.setState=function(){var a=this.series,c=a.chart,d=a.options.marker,
b=this.options,g=m(b.lowColor,a.options.lowColor,b.color,this.zone&&this.zone.color,this.color,a.color),h="attr";this.pointSetState.apply(this,arguments);this.state||(h="animate",this.lowerGraphic&&!c.styledMode&&(this.lowerGraphic.attr({fill:g}),this.upperGraphic&&(c={y:this.y,zone:this.zone},this.y=this.high,this.zone=this.zone?this.getZone():void 0,d=m(this.marker?this.marker.fillColor:void 0,d?d.fillColor:void 0,b.color,this.zone?this.zone.color:void 0,this.color),this.upperGraphic.attr({fill:d}),
k(this,c))));this.connector[h](a.getConnectorAttribs(this))};c.prototype.destroy=function(){this.graphic||(this.graphic=this.connector,this.connector=void 0);return a.prototype.destroy.call(this)};return c}(a);k(g.prototype,{pointSetState:a.prototype.setState});return g});n(a,"Series/Dumbbell/DumbbellSeries.js",[a["Series/Column/ColumnSeries.js"],a["Series/Dumbbell/DumbbellPoint.js"],a["Core/Globals.js"],a["Core/Series/Series.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Renderer/SVG/SVGRenderer.js"],
a["Core/Utilities.js"]],function(a,g,h,k,m,n,c){var l=this&&this.__extends||function(){var a=function(b,f){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,f){a.__proto__=f}||function(a,f){for(var b in f)f.hasOwnProperty(b)&&(a[b]=f[b])};return a(b,f)};return function(b,f){function d(){this.constructor=b}a(b,f);b.prototype=null===f?Object.create(f):(d.prototype=f.prototype,new d)}}(),e=a.prototype;h=h.noop;var d=k.prototype;k=m.seriesTypes;var b=k.arearange;k=k.columnrange.prototype;
var t=b.prototype,r=c.extend,u=c.merge,p=c.pick;c=function(a){function c(){var f=null!==a&&a.apply(this,arguments)||this;f.data=void 0;f.options=void 0;f.points=void 0;f.columnMetrics=void 0;return f}l(c,a);c.prototype.getConnectorAttribs=function(a){var b=this.chart,f=a.options,c=this.options,d=this.xAxis,e=this.yAxis,g=p(f.connectorWidth,c.connectorWidth),h=p(f.connectorColor,c.connectorColor,f.color,a.zone?a.zone.color:void 0,a.color),k=p(c.states&&c.states.hover&&c.states.hover.connectorWidthPlus,
1),m=p(f.dashStyle,c.dashStyle),l=p(a.plotLow,a.plotY),q=e.toPixels(c.threshold||0,!0);q=p(a.plotHigh,b.inverted?e.len-q:q);a.state&&(g+=k);0>l?l=0:l>=e.len&&(l=e.len);0>q?q=0:q>=e.len&&(q=e.len);if(0>a.plotX||a.plotX>d.len)g=0;a.upperGraphic&&(d={y:a.y,zone:a.zone},a.y=a.high,a.zone=a.zone?a.getZone():void 0,h=p(f.connectorColor,c.connectorColor,f.color,a.zone?a.zone.color:void 0,a.color),r(a,d));a={d:n.prototype.crispLine([["M",a.plotX,l],["L",a.plotX,q]],g,"ceil")};b.styledMode||(a.stroke=h,a["stroke-width"]=
g,m&&(a.dashstyle=m));return a};c.prototype.drawConnector=function(a){var b=p(this.options.animationLimit,250);b=a.connector&&this.chart.pointCount<b?"animate":"attr";a.connector||(a.connector=this.chart.renderer.path().addClass("highcharts-lollipop-stem").attr({zIndex:-1}).add(this.markerGroup));a.connector[b](this.getConnectorAttribs(a))};c.prototype.getColumnMetrics=function(){var a=e.getColumnMetrics.apply(this,arguments);a.offset+=a.width/2;return a};c.prototype.translate=function(){this.setShapeArgs.apply(this);
this.translatePoint.apply(this,arguments);this.points.forEach(function(a){var b=a.shapeArgs,c=a.pointWidth;a.plotX=b.x;b.x=a.plotX-c/2;a.tooltipPos=null});this.columnMetrics.offset-=this.columnMetrics.width/2};c.prototype.drawPoints=function(){var a=this.chart,b=this.points.length,c=this.lowColor=this.options.lowColor,d=0;for(this.seriesDrawPoints.apply(this,arguments);d<b;){var e=this.points[d];this.drawConnector(e);e.upperGraphic&&(e.upperGraphic.element.point=e,e.upperGraphic.addClass("highcharts-lollipop-high"));
e.connector.element.point=e;if(e.lowerGraphic){var g=e.zone&&e.zone.color;g=p(e.options.lowColor,c,e.options.color,g,e.color,this.color);a.styledMode||e.lowerGraphic.attr({fill:g});e.lowerGraphic.addClass("highcharts-lollipop-low")}d++}};c.prototype.markerAttribs=function(){var a=t.markerAttribs.apply(this,arguments);a.x=Math.floor(a.x||0);a.y=Math.floor(a.y||0);return a};c.prototype.pointAttribs=function(a,b){var c=d.pointAttribs.apply(this,arguments);"hover"===b&&delete c.fill;return c};c.defaultOptions=
u(b.defaultOptions,{trackByArea:!1,fillColor:"none",lineWidth:0,pointRange:1,connectorWidth:1,stickyTracking:!1,groupPadding:.2,crisp:!1,pointPadding:.1,lowColor:"#333333",states:{hover:{lineWidthPlus:0,connectorWidthPlus:1,halo:!1}}});return c}(b);r(c.prototype,{crispCol:e.crispCol,drawGraph:h,drawTracker:a.prototype.drawTracker,pointClass:g,setShapeArgs:k.translate,seriesDrawPoints:t.drawPoints,trackerGroups:["group","markerGroup","dataLabelsGroup"],translatePoint:t.translate});m.registerSeriesType("dumbbell",
c);"";return c});n(a,"masters/modules/dumbbell.src.js",[],function(){})});
//# sourceMappingURL=dumbbell.js.map | cdnjs/cdnjs | ajax/libs/highcharts/9.3.3/modules/dumbbell.js | JavaScript | mit | 7,915 |
Subsets and Splits