text
stringlengths 2
1.05M
|
|---|
// Copyright (c) 2021 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import styled from 'styled-components';
import MouseEventHandler from './mouse-event';
const StyledSlider = styled.div`
position: relative;
background-color: ${props =>
props.active ? props.theme.sliderBarHoverColor : props.theme.sliderBarColor};
${props => `${props.vertical ? 'width' : 'height'}: ${props.theme.sliderBarHeight}px`};
border-radius: ${props => props.theme.sliderBarRadius};
:hover {
cursor: pointer;
}
`;
function nope() {}
export default class SliderBarHandle extends Component {
static propTypes = {
width: PropTypes.number,
left: PropTypes.string,
sliderBarListener: PropTypes.func,
enableBarDrag: PropTypes.bool,
vertical: PropTypes.bool
};
static defaultProps = {
sliderBarListener: nope,
enableBarDrag: false,
vertical: false
};
constructor(props) {
super(props);
this.mouseEvent = new MouseEventHandler({
vertical: props.vertical,
valueListener: props.sliderBarListener,
toggleMouseOver: this.toggleMouseOver,
track: props.track,
setAnchor: props.setAnchor
});
}
state = {mouseOver: false};
toggleMouseOver = () => {
this.setState({mouseOver: !this.state.mouseOver});
};
render() {
const {width, v0Left} = this.props;
const style = this.props.vertical
? {
height: `${width}%`,
bottom: `${-100 + width + v0Left}%`
}
: {
width: `${width}%`,
left: `${v0Left}%`
};
return (
<StyledSlider
active={this.state.mouseOver}
className={classnames('kg-range-slider__bar', {
'kg-range-slider__bar--active': this.state.mouseOver
})}
style={style}
onMouseDown={this.props.enableBarDrag ? this.mouseEvent.handleMouseDown : nope}
onTouchStart={this.props.enableBarDrag ? this.mouseEvent.handleTouchStart : nope}
/>
);
}
}
|
"use strict";
var express=require('express');
var app=express();
app.get('/', (req, res) => {
res.send('Hola Mundo!Mi aplicación esta funcionando!')
});
app.listen(3000,function(){
console.log("Funciona!Mi aplicación esta escuchando en el puerto 3000!")
});
|
const k = require("kleur");
/**
* @param {string} msg Error message
* @param {Error} [err] Error instance
* @param {boolean} [fatal=false] Exits with code 1 if set to true
*/
function error(msg, err, fatal = false)
{
console.error("\n");
console.error(k.red(msg));
console.error(err);
fatal && process.exit(1);
}
module.exports = error;
|
(function () {
var codesample = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var window$$1 = {};
var global$2 = window$$1;
var _self = typeof window$$1 !== 'undefined' ? window$$1 : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : {};
var Prism = function () {
var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i;
var _ = _self.Prism = {
util: {
encode: function (tokens) {
if (tokens instanceof Token) {
return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);
} else if (_.util.type(tokens) === 'Array') {
return tokens.map(_.util.encode);
} else {
return tokens.replace(/&/g, '&').replace(/</g, '<').replace(/\u00a0/g, ' ');
}
},
type: function (o) {
return Object.prototype.toString.call(o).match(/\[object (\w+)\]/)[1];
},
clone: function (o) {
var type = _.util.type(o);
switch (type) {
case 'Object':
var clone = {};
for (var key in o) {
if (o.hasOwnProperty(key)) {
clone[key] = _.util.clone(o[key]);
}
}
return clone;
case 'Array':
return o.map && o.map(function (v) {
return _.util.clone(v);
});
}
return o;
}
},
languages: {
extend: function (id, redef) {
var lang = _.util.clone(_.languages[id]);
for (var key in redef) {
lang[key] = redef[key];
}
return lang;
},
insertBefore: function (inside, before, insert, root) {
root = root || _.languages;
var grammar = root[inside];
if (arguments.length === 2) {
insert = arguments[1];
for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
grammar[newToken] = insert[newToken];
}
}
return grammar;
}
var ret = {};
for (var token in grammar) {
if (grammar.hasOwnProperty(token)) {
if (token === before) {
for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
ret[newToken] = insert[newToken];
}
}
}
ret[token] = grammar[token];
}
}
_.languages.DFS(_.languages, function (key, value) {
if (value === root[inside] && key !== inside) {
this[key] = ret;
}
});
return root[inside] = ret;
},
DFS: function (o, callback, type) {
for (var i in o) {
if (o.hasOwnProperty(i)) {
callback.call(o, i, o[i], type || i);
if (_.util.type(o[i]) === 'Object') {
_.languages.DFS(o[i], callback);
} else if (_.util.type(o[i]) === 'Array') {
_.languages.DFS(o[i], callback, i);
}
}
}
}
},
plugins: {},
highlightAll: function (async, callback) {
var elements = document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');
for (var i = 0, element = void 0; element = elements[i++];) {
_.highlightElement(element, async === true, callback);
}
},
highlightElement: function (element, async, callback) {
var language, grammar, parent$$1 = element;
while (parent$$1 && !lang.test(parent$$1.className)) {
parent$$1 = parent$$1.parentNode;
}
if (parent$$1) {
language = (parent$$1.className.match(lang) || [
,
''
])[1];
grammar = _.languages[language];
}
element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
parent$$1 = element.parentNode;
if (/pre/i.test(parent$$1.nodeName)) {
parent$$1.className = parent$$1.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
}
var code = element.textContent;
var env = {
element: element,
language: language,
grammar: grammar,
code: code
};
if (!code || !grammar) {
_.hooks.run('complete', env);
return;
}
_.hooks.run('before-highlight', env);
if (async && _self.Worker) {
var worker = new Worker(_.filename);
worker.onmessage = function (evt) {
env.highlightedCode = evt.data;
_.hooks.run('before-insert', env);
env.element.innerHTML = env.highlightedCode;
if (callback) {
callback.call(env.element);
}
_.hooks.run('after-highlight', env);
_.hooks.run('complete', env);
};
worker.postMessage(JSON.stringify({
language: env.language,
code: env.code,
immediateClose: true
}));
} else {
env.highlightedCode = _.highlight(env.code, env.grammar, env.language);
_.hooks.run('before-insert', env);
env.element.innerHTML = env.highlightedCode;
if (callback) {
callback.call(element);
}
_.hooks.run('after-highlight', env);
_.hooks.run('complete', env);
}
},
highlight: function (text, grammar, language) {
var tokens = _.tokenize(text, grammar);
return Token.stringify(_.util.encode(tokens), language);
},
tokenize: function (text, grammar, language) {
var Token = _.Token;
var strarr = [text];
var rest = grammar.rest;
if (rest) {
for (var token in rest) {
grammar[token] = rest[token];
}
delete grammar.rest;
}
tokenloop:
for (var token in grammar) {
if (!grammar.hasOwnProperty(token) || !grammar[token]) {
continue;
}
var patterns = grammar[token];
patterns = _.util.type(patterns) === 'Array' ? patterns : [patterns];
for (var j = 0; j < patterns.length; ++j) {
var pattern = patterns[j];
var inside = pattern.inside;
var lookbehind = !!pattern.lookbehind;
var lookbehindLength = 0;
var alias = pattern.alias;
pattern = pattern.pattern || pattern;
for (var i = 0; i < strarr.length; i++) {
var str = strarr[i];
if (strarr.length > text.length) {
break tokenloop;
}
if (str instanceof Token) {
continue;
}
pattern.lastIndex = 0;
var match = pattern.exec(str);
if (match) {
if (lookbehind) {
lookbehindLength = match[1].length;
}
var from = match.index - 1 + lookbehindLength;
match = match[0].slice(lookbehindLength);
var len = match.length, to = from + len, before = str.slice(0, from + 1), after = str.slice(to + 1);
var args = [
i,
1
];
if (before) {
args.push(before);
}
var wrapped = new Token(token, inside ? _.tokenize(match, inside) : match, alias);
args.push(wrapped);
if (after) {
args.push(after);
}
Array.prototype.splice.apply(strarr, args);
}
}
}
}
return strarr;
},
hooks: {
all: {},
add: function (name$$1, callback) {
var hooks = _.hooks.all;
hooks[name$$1] = hooks[name$$1] || [];
hooks[name$$1].push(callback);
},
run: function (name$$1, env) {
var callbacks = _.hooks.all[name$$1];
if (!callbacks || !callbacks.length) {
return;
}
for (var i = 0, callback = void 0; callback = callbacks[i++];) {
callback(env);
}
}
}
};
var Token = _.Token = function (type, content, alias) {
this.type = type;
this.content = content;
this.alias = alias;
};
Token.stringify = function (o, language, parent$$1) {
if (typeof o === 'string') {
return o;
}
if (_.util.type(o) === 'Array') {
return o.map(function (element) {
return Token.stringify(element, language, o);
}).join('');
}
var env = {
type: o.type,
content: Token.stringify(o.content, language, parent$$1),
tag: 'span',
classes: [
'token',
o.type
],
attributes: {},
language: language,
parent: parent$$1
};
if (env.type === 'comment') {
env.attributes.spellcheck = 'true';
}
if (o.alias) {
var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias];
Array.prototype.push.apply(env.classes, aliases);
}
_.hooks.run('wrap', env);
var attributes = '';
for (var name$$1 in env.attributes) {
attributes += (attributes ? ' ' : '') + name$$1 + '="' + (env.attributes[name$$1] || '') + '"';
}
return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + '</' + env.tag + '>';
};
if (!_self.document) {
if (!_self.addEventListener) {
return _self.Prism;
}
_self.addEventListener('message', function (evt) {
var message = JSON.parse(evt.data), lang = message.language, code = message.code, immediateClose = message.immediateClose;
_self.postMessage(_.highlight(code, _.languages[lang], lang));
if (immediateClose) {
_self.close();
}
}, false);
return _self.Prism;
}
}();
if (typeof global$2 !== 'undefined') {
global$2.Prism = Prism;
}
Prism.languages.markup = {
comment: /<!--[\w\W]*?-->/,
prolog: /<\?[\w\W]+?\?>/,
doctype: /<!DOCTYPE[\w\W]+?>/,
cdata: /<!\[CDATA\[[\w\W]*?]]>/i,
tag: {
pattern: /<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,
inside: {
'tag': {
pattern: /^<\/?[^\s>\/]+/i,
inside: {
punctuation: /^<\/?/,
namespace: /^[^\s>\/:]+:/
}
},
'attr-value': {
pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,
inside: { punctuation: /[=>"']/ }
},
'punctuation': /\/?>/,
'attr-name': {
pattern: /[^\s>\/]+/,
inside: { namespace: /^[^\s>\/:]+:/ }
}
}
},
entity: /&#?[\da-z]{1,8};/i
};
Prism.hooks.add('wrap', function (env) {
if (env.type === 'entity') {
env.attributes.title = env.content.replace(/&/, '&');
}
});
Prism.languages.xml = Prism.languages.markup;
Prism.languages.html = Prism.languages.markup;
Prism.languages.mathml = Prism.languages.markup;
Prism.languages.svg = Prism.languages.markup;
Prism.languages.css = {
comment: /\/\*[\w\W]*?\*\//,
atrule: {
pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i,
inside: { rule: /@[\w-]+/ }
},
url: /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
selector: /[^\{\}\s][^\{\};]*?(?=\s*\{)/,
string: /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,
property: /(\b|\B)[\w-]+(?=\s*:)/i,
important: /\B!important\b/i,
function: /[-a-z0-9]+(?=\()/i,
punctuation: /[(){};:]/
};
Prism.languages.css.atrule.inside.rest = Prism.util.clone(Prism.languages.css);
if (Prism.languages.markup) {
Prism.languages.insertBefore('markup', 'tag', {
style: {
pattern: /<style[\w\W]*?>[\w\W]*?<\/style>/i,
inside: {
tag: {
pattern: /<style[\w\W]*?>|<\/style>/i,
inside: Prism.languages.markup.tag.inside
},
rest: Prism.languages.css
},
alias: 'language-css'
}
});
Prism.languages.insertBefore('inside', 'attr-value', {
'style-attr': {
pattern: /\s*style=("|').*?\1/i,
inside: {
'attr-name': {
pattern: /^\s*style/i,
inside: Prism.languages.markup.tag.inside
},
'punctuation': /^\s*=\s*['"]|['"]\s*$/,
'attr-value': {
pattern: /.+/i,
inside: Prism.languages.css
}
},
alias: 'language-css'
}
}, Prism.languages.markup.tag);
}
Prism.languages.clike = {
'comment': [
{
pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
lookbehind: true
},
{
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: true
}
],
'string': /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
'class-name': {
pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,
lookbehind: true,
inside: { punctuation: /(\.|\\)/ }
},
'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
'boolean': /\b(true|false)\b/,
'function': /[a-z0-9_]+(?=\()/i,
'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,
'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
'punctuation': /[{}[\];(),.:]/
};
Prism.languages.javascript = Prism.languages.extend('clike', {
keyword: /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,
number: /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,
function: /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i
});
Prism.languages.insertBefore('javascript', 'keyword', {
regex: {
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,
lookbehind: true
}
});
Prism.languages.insertBefore('javascript', 'class-name', {
'template-string': {
pattern: /`(?:\\`|\\?[^`])*`/,
inside: {
interpolation: {
pattern: /\$\{[^}]+\}/,
inside: {
'interpolation-punctuation': {
pattern: /^\$\{|\}$/,
alias: 'punctuation'
},
'rest': Prism.languages.javascript
}
},
string: /[\s\S]+/
}
}
});
if (Prism.languages.markup) {
Prism.languages.insertBefore('markup', 'tag', {
script: {
pattern: /<script[\w\W]*?>[\w\W]*?<\/script>/i,
inside: {
tag: {
pattern: /<script[\w\W]*?>|<\/script>/i,
inside: Prism.languages.markup.tag.inside
},
rest: Prism.languages.javascript
},
alias: 'language-javascript'
}
});
}
Prism.languages.js = Prism.languages.javascript;
Prism.languages.c = Prism.languages.extend('clike', {
keyword: /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
operator: /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
number: /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i
});
Prism.languages.insertBefore('c', 'string', {
macro: {
pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
lookbehind: true,
alias: 'property',
inside: {
string: {
pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,
lookbehind: true
}
}
}
});
delete Prism.languages.c['class-name'];
delete Prism.languages.c.boolean;
Prism.languages.csharp = Prism.languages.extend('clike', {
keyword: /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,
string: [
/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,
/("|')(\\?.)*?\1/
],
number: /\b-?(0x[\da-f]+|\d*\.?\d+)\b/i
});
Prism.languages.insertBefore('csharp', 'keyword', {
preprocessor: {
pattern: /(^\s*)#.*/m,
lookbehind: true
}
});
Prism.languages.cpp = Prism.languages.extend('c', {
keyword: /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,
boolean: /\b(true|false)\b/,
operator: /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/
});
Prism.languages.insertBefore('cpp', 'keyword', {
'class-name': {
pattern: /(class\s+)[a-z0-9_]+/i,
lookbehind: true
}
});
Prism.languages.java = Prism.languages.extend('clike', {
keyword: /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,
number: /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,
operator: {
pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,
lookbehind: true
}
});
Prism.languages.php = Prism.languages.extend('clike', {
keyword: /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,
constant: /\b[A-Z0-9_]{2,}\b/,
comment: {
pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,
lookbehind: true
}
});
Prism.languages.insertBefore('php', 'class-name', {
'shell-comment': {
pattern: /(^|[^\\])#.*/,
lookbehind: true,
alias: 'comment'
}
});
Prism.languages.insertBefore('php', 'keyword', {
delimiter: /\?>|<\?(?:php)?/i,
variable: /\$\w+\b/i,
package: {
pattern: /(\\|namespace\s+|use\s+)[\w\\]+/,
lookbehind: true,
inside: { punctuation: /\\/ }
}
});
Prism.languages.insertBefore('php', 'operator', {
property: {
pattern: /(->)[\w]+/,
lookbehind: true
}
});
if (Prism.languages.markup) {
Prism.hooks.add('before-highlight', function (env) {
if (env.language !== 'php') {
return;
}
env.tokenStack = [];
env.backupCode = env.code;
env.code = env.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig, function (match) {
env.tokenStack.push(match);
return '{{{PHP' + env.tokenStack.length + '}}}';
});
});
Prism.hooks.add('before-insert', function (env) {
if (env.language === 'php') {
env.code = env.backupCode;
delete env.backupCode;
}
});
Prism.hooks.add('after-highlight', function (env) {
if (env.language !== 'php') {
return;
}
for (var i = 0, t = void 0; t = env.tokenStack[i]; i++) {
env.highlightedCode = env.highlightedCode.replace('{{{PHP' + (i + 1) + '}}}', Prism.highlight(t, env.grammar, 'php').replace(/\$/g, '$$$$'));
}
env.element.innerHTML = env.highlightedCode;
});
Prism.hooks.add('wrap', function (env) {
if (env.language === 'php' && env.type === 'markup') {
env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, '<span class="token php">$1</span>');
}
});
Prism.languages.insertBefore('php', 'comment', {
markup: {
pattern: /<[^?]\/?(.*?)>/,
inside: Prism.languages.markup
},
php: /\{\{\{PHP[0-9]+\}\}\}/
});
}
Prism.languages.python = {
'comment': {
pattern: /(^|[^\\])#.*/,
lookbehind: true
},
'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,
'function': {
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,
lookbehind: true
},
'class-name': {
pattern: /(\bclass\s+)[a-z0-9_]+/i,
lookbehind: true
},
'keyword': /\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,
'boolean': /\b(?:True|False)\b/,
'number': /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,
'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,
'punctuation': /[{}[\];(),.:]/
};
(function (Prism) {
Prism.languages.ruby = Prism.languages.extend('clike', {
comment: /#(?!\{[^\r\n]*?\}).*/,
keyword: /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/
});
var interpolation = {
pattern: /#\{[^}]+\}/,
inside: {
delimiter: {
pattern: /^#\{|\}$/,
alias: 'tag'
},
rest: Prism.util.clone(Prism.languages.ruby)
}
};
Prism.languages.insertBefore('ruby', 'keyword', {
regex: [
{
pattern: /%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,
lookbehind: true
}
],
variable: /[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,
symbol: /:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/
});
Prism.languages.insertBefore('ruby', 'number', {
builtin: /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
constant: /\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/
});
Prism.languages.ruby.string = [
{
pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,
inside: { interpolation: interpolation }
},
{
pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,
inside: { interpolation: interpolation }
},
{
pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,
inside: { interpolation: interpolation }
},
{
pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,
inside: { interpolation: interpolation }
},
{
pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,
inside: { interpolation: interpolation }
},
{
pattern: /("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,
inside: { interpolation: interpolation }
}
];
}(Prism));
function isCodeSample(elm) {
return elm && elm.nodeName === 'PRE' && elm.className.indexOf('language-') !== -1;
}
function trimArg(predicateFn) {
return function (arg1, arg2) {
return predicateFn(arg2);
};
}
var Utils = {
isCodeSample: isCodeSample,
trimArg: trimArg
};
var constant = function (value) {
return function () {
return value;
};
};
var never = constant(false);
var always = constant(true);
var never$1 = never;
var always$1 = always;
var none = function () {
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call$$1 = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var noop$$1 = function () {
};
var nul = function () {
return null;
};
var undef = function () {
return undefined;
};
var me = {
fold: function (n, s) {
return n();
},
is: never$1,
isSome: never$1,
isNone: always$1,
getOr: id,
getOrThunk: call$$1,
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
},
getOrNull: nul,
getOrUndefined: undef,
or: id,
orThunk: call$$1,
map: none,
ap: none,
each: noop$$1,
bind: none,
flatten: none,
exists: never$1,
forall: always$1,
filter: none,
equals: eq,
equals_: eq,
toArray: function () {
return [];
},
toString: constant('none()')
};
if (Object.freeze)
Object.freeze(me);
return me;
}();
var some = function (a) {
var constant_a = function () {
return a;
};
var self = function () {
return me;
};
var map = function (f) {
return some(f(a));
};
var bind = function (f) {
return f(a);
};
var me = {
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always$1,
isNone: never$1,
getOr: constant_a,
getOrThunk: constant_a,
getOrDie: constant_a,
getOrNull: constant_a,
getOrUndefined: constant_a,
or: self,
orThunk: self,
map: map,
ap: function (optfab) {
return optfab.fold(none, function (fab) {
return some(fab(a));
});
},
each: function (f) {
f(a);
},
bind: bind,
flatten: constant_a,
exists: bind,
forall: bind,
filter: function (f) {
return f(a) ? me : NONE;
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never$1, function (b) {
return elementEq(a, b);
});
},
toArray: function () {
return [a];
},
toString: function () {
return 'some(' + a + ')';
}
};
return me;
};
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
some: some,
none: none,
from: from
};
var getSelectedCodeSample = function (editor) {
var node = editor.selection ? editor.selection.getNode() : null;
if (Utils.isCodeSample(node)) {
return Option.some(node);
}
return Option.none();
};
var insertCodeSample = function (editor, language, code) {
editor.undoManager.transact(function () {
var node = getSelectedCodeSample(editor);
code = global$1.DOM.encode(code);
return node.fold(function () {
editor.insertContent('<pre id="__new" class="language-' + language + '">' + code + '</pre>');
editor.selection.select(editor.$('#__new').removeAttr('id')[0]);
}, function (n) {
editor.dom.setAttrib(n, 'class', 'language-' + language);
n.innerHTML = code;
Prism.highlightElement(n);
editor.selection.select(n);
});
});
};
var getCurrentCode = function (editor) {
var node = getSelectedCodeSample(editor);
return node.fold(function () {
return '';
}, function (n) {
return n.textContent;
});
};
var CodeSample = {
getSelectedCodeSample: getSelectedCodeSample,
insertCodeSample: insertCodeSample,
getCurrentCode: getCurrentCode
};
var getLanguages = function (editor) {
return editor.settings.codesample_languages;
};
var Settings = { getLanguages: getLanguages };
var getLanguages$1 = function (editor) {
var defaultLanguages = [
{
text: 'HTML/XML',
value: 'markup'
},
{
text: 'JavaScript',
value: 'javascript'
},
{
text: 'CSS',
value: 'css'
},
{
text: 'PHP',
value: 'php'
},
{
text: 'Ruby',
value: 'ruby'
},
{
text: 'Python',
value: 'python'
},
{
text: 'Java',
value: 'java'
},
{
text: 'C',
value: 'c'
},
{
text: 'C#',
value: 'csharp'
},
{
text: 'C++',
value: 'cpp'
}
];
var customLanguages = Settings.getLanguages(editor);
return customLanguages ? customLanguages : defaultLanguages;
};
var getCurrentLanguage = function (editor, fallback) {
var node = CodeSample.getSelectedCodeSample(editor);
return node.fold(function () {
return fallback;
}, function (n) {
var matches = n.className.match(/language-(\w+)/);
return matches ? matches[1] : fallback;
});
};
var Languages = {
getLanguages: getLanguages$1,
getCurrentLanguage: getCurrentLanguage
};
var typeOf = function (x) {
if (x === null)
return 'null';
var t = typeof x;
if (t === 'object' && Array.prototype.isPrototypeOf(x))
return 'array';
if (t === 'object' && String.prototype.isPrototypeOf(x))
return 'string';
return t;
};
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var isFunction = isType('function');
var slice = Array.prototype.slice;
var head = function (xs) {
return xs.length === 0 ? Option.none() : Option.some(xs[0]);
};
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
return slice.call(x);
};
var open = function (editor) {
var languages = Languages.getLanguages(editor);
var defaultLanguage = head(languages).fold(function () {
return '';
}, function (l) {
return l.value;
});
var currentLanguage = Languages.getCurrentLanguage(editor, defaultLanguage);
var currentCode = CodeSample.getCurrentCode(editor);
editor.windowManager.open({
title: 'Insert/Edit Code Sample',
size: 'large',
body: {
type: 'panel',
items: [
{
type: 'selectbox',
name: 'language',
label: 'Language',
items: languages
},
{
type: 'textarea',
name: 'code',
flex: true,
label: 'Code view'
}
]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Save',
primary: true
}
],
initialData: {
language: currentLanguage,
code: currentCode
},
onSubmit: function (api) {
var data = api.getData();
CodeSample.insertCodeSample(editor, data.language, data.code);
api.close();
}
});
};
var Dialog = { open: open };
var register = function (editor) {
editor.addCommand('codesample', function () {
var node = editor.selection.getNode();
if (editor.selection.isCollapsed() || Utils.isCodeSample(node)) {
Dialog.open(editor);
} else {
editor.formatter.toggle('code');
}
});
};
var Commands = { register: register };
var setup = function (editor) {
var $ = editor.$;
editor.on('PreProcess', function (e) {
$('pre[contenteditable=false]', e.node).filter(Utils.trimArg(Utils.isCodeSample)).each(function (idx, elm) {
var $elm = $(elm), code = elm.textContent;
$elm.attr('class', $.trim($elm.attr('class')));
$elm.removeAttr('contentEditable');
$elm.empty().append($('<code></code>').each(function () {
this.textContent = code;
}));
});
});
editor.on('SetContent', function () {
var unprocessedCodeSamples = $('pre').filter(Utils.trimArg(Utils.isCodeSample)).filter(function (idx, elm) {
return elm.contentEditable !== 'false';
});
if (unprocessedCodeSamples.length) {
editor.undoManager.transact(function () {
unprocessedCodeSamples.each(function (idx, elm) {
$(elm).find('br').each(function (idx, elm) {
elm.parentNode.replaceChild(editor.getDoc().createTextNode('\n'), elm);
});
elm.contentEditable = false;
elm.innerHTML = editor.dom.encode(elm.textContent);
Prism.highlightElement(elm);
elm.className = $.trim(elm.className);
});
});
}
});
};
var FilterContent = { setup: setup };
var register$1 = function (editor) {
editor.ui.registry.addButton('codesample', {
icon: 'code-sample',
tooltip: 'Insert/edit code sample',
onAction: function () {
return Dialog.open(editor);
}
});
editor.ui.registry.addMenuItem('codesample', {
text: 'Code sample...',
icon: 'code-sample',
onAction: function () {
return Dialog.open(editor);
}
});
};
var Buttons = { register: register$1 };
global.add('codesample', function (editor, pluginUrl) {
FilterContent.setup(editor);
Buttons.register(editor);
Commands.register(editor);
editor.on('dblclick', function (ev) {
if (Utils.isCodeSample(ev.target)) {
Dialog.open(editor);
}
});
});
function Plugin () {
}
return Plugin;
}());
})();
|
'use strict';
const Q = require('./lib/server.js');
Q.start();
const db = new Q('database');
db.monitorEvents('create');
db.monitorEvents('read');
db.monitorEvents('update');
db.monitorEvents('delete');
|
const workerTemplate = require('./worker');
module.exports = workerTemplate;
|
/*
* LibGuides: Customize breadcrumb links
* - Change URL in .attr() and string in .text() to match group
* - Paste this code code between script tags in group level "Custom JS/CSS Code" area
*
*/
$(document).ready(function(){
// Remove link back to UAL main page
$('#s-lib-bc-list li:first-child').remove();
// Rewrite LibGuides link to point to group guides page
$('#s-lib-bc-list a[href="http://libguides.library.arizona.edu"]')
.attr('href','http://libguides.library.arizona.edu/ahsl')
.text('AHSL Guides');
});
|
/**
* # Waiting Room settings
* Copyright(c) 2021 Stefano Balietti <ste@nodegame.org>
* MIT Licensed
*
* Waiting Room settings.
*
* http://nodegame.org
* ---
*/
module.exports = {
/**
* ## EXECUTION_MODE
*
* Sets the execution mode of the waiting room
*
* Different modes might have different default values, and need
* different settings.
*
* Available modes:
*
* - `TIMEOUT`, waits until the time is up, then it checks
* whether enough players are connected to start the game.
* - `WAIT_FOR_N_PLAYERS`, the game starts right away as soon as
* the desired number of connected players is reached.
* - `WAIT_FOR_DISPATCH`, the game starts when it receives a
* command to dispatch from the monitor.
*/
EXECUTION_MODE: 'WAIT_FOR_N_PLAYERS',
/**
* ## GROUP_SIZE (number)
*
* The size of each group dispatched by the waiting room
*/
GROUP_SIZE: 1,
/**
* ## POOL_SIZE (number) Optional
*
* If set, waits until POOL_SIZE clients are connected to dispatch a group
*
* Must be >= GROUP_SIZE.
*
* Default: GROUP_SIZE
*/
// POOL_SIZE: 2,
/**
* ## N_GAMES (number) Optional
*
* Number of games to dispatch
*
* If set, waiting room will be closed after N_GAMES have been dispatched
*
* Default: undefined, no limit.
*/
// N_GAMES: 1,
/**
* ## MAX_WAIT_TIME (number) Optional
*
* Maximum waiting time in milliseconds in the waiting room
*
* After the max waiting time expired clients are disconnected
*/
// MAX_WAIT_TIME: 90000,
/**
* ## START_DATE (string|object) Optional
*
* Time and date of the start of the game.
*
* Overrides `MAX_WAIT_TIME`.
*
* Accepted values: any valid argument to `Date` constructor.
*/
// START_DATE: 'December 31, {YEAR} 12:00:00',
// START_DATE: new Date().getTime() + 30000,
/**
* ## CHOSEN_TREATMENT (string|function)
*
* The treatment assigned to every new group
*
* It can be the name of a treatment (string), or any valid value:
*
* - "treatment_rotate": rotates the treatments (to offset set
* ROTATION_OFFSET != 0).
* - "treatment_random": picks a random treatment each time.
* - undefined: defaults to "treatment_random".
* - function: a callback returning the name of the treatment:
*
* function(treatments, roomCounter, groupIdx, dispatchCounter) {
* return treatments[dispatchCounter % treatments.length];
* }
*/
CHOSEN_TREATMENT: function(treatments, roomCounter,
groupIdx, dispatchCounter) {
// - treatments: array of available treatments.
// - roomCounter: total number of room created (it is initialized to
// the last created room as loaded in the data folder).
// - groupIdx: zero-based group index within same dispatch
// (when POOL_SIZE > GROUP_SIZE).
// - dispatchCounter: total number of dispatch calls (a dispatch can
// send players to an existing room, so it may
// differ from roomCounter).
// console.log(roomCounter, batchCounter, dispatchCounter);
return treatments[roomCounter % treatments.length];
},
/**
* ## ROTATION_OFFSET (integer > 0) Optional
*
* Offsets the rotation when CHOSEN_TREATMENT = "treatment_rotate"
*
* Default: 0.
*
* @see CHOSEN_TREATMENT
*/
// ROTATION_OFFSET: 0,
/**
* ## PLAYER_SORTING
*
* Sorts the order of players before dispatching them
*
* Sorting takes place only if:
*
* - the number of connected players > GROUP_SIZE,
* - PLAYER_GROUPING is undefined
*
* Accepted values:
*
* - 'timesNotSelected': (default) gives priority to players that
* have not been selected by a previous call to dispatch
* - undefined: rollback to default choice
* - null: no sorting (players are anyway randomly shuffled).
* - function: a comparator function implementing a criteria
* for sorting two objects. E.g:
*
* function timesNotSelected(a, b) {
* if ((a.timesNotSelected || 0) < b.timesNotSelected) {
* return -1;
* }
* else if ((a.timesNotSelected || 0) > b.timesNotSelected) {
* return 1;
* }
* return 0;
* }
*/
// PLAYER_SORTING: 'timesNotSelected'
/**
* ## PLAYER_GROUPING
*
* Creates groups of players to be assigned to treatments
*
* This method is alternative to "sorting" and will be invoked only
* if the number of connected players > GROUP_SIZE
*
* @param {PlayerList} pList The list of players to group
* @param {number} nGroups The number of groups requested by current
* dispatch
*
* @return {array} An array of nGroups arrays of player objects
*/
// PLAYER_GROUPING: function(pList, nGroups) {
// return [ [ pl1, pl2 ] [ pl3, pl4 ] ];
// }
/**
* ## ON_TIMEOUT (function) Optional
*
* A callback function to be executed on the client when wait time expires
*/
// ON_TIMEOUT: function() {
// console.log('I am timed out!');
// },
/**
* ## ON_TIMEOUT_SERVER (function) Optional
*
* A callback function to be executed on the server when wait time expires
*
* The context of execution is WaitingRoom.
*
* If return value is FALSE, the client is not disposed.
*/
// ON_TIMEOUT_SERVER: function(client) {
// console.log('*** I am timed out! ', client.id);
// }
/**
* ## ON_OPEN (function) Optional
*
* Callback to be executed when the waiting room becomes "open"
*
* Receives as first parameter the waiting room object itself.
*/
// ON_OPEN: null;
/**
* ### WaitingRoom.ON_CLOSE (function) Optional
*
* Callback to be executed when the waiting room becomes "close"
*
* Receives as first parameter the waiting room object itself.
*/
// ON_CLOSE: null;
/**
* ## ON_CONNECT (function) Optional
*
* Callback to be executed when a player connects
*
* Receives as first parameter the waiting room object itself and as
* second parameter the connecting client.
*/
// ON_CONNECT: function(waitRoom, player) {
// // Auto play with bots on connect of a human player.
// if (player.clientType === 'bot') return;
// waitRoom.dispatchWithBots();
// },
/**
* ## ON_DISCONNECT (function) Optional
*
* Callback to be executed when a player disconnects
*
* Receives as first parameter the waiting room object itself.
*/
// ON_DISCONNECT: null;
/**
* ## ON_INIT (function) Optional
*
* Callback to be executed after the settings have been parsed
*
* Receives as first parameter the waiting room object itself.
*/
// ON_INIT: null;
/**
* ## ON_DISPATCH (function) Optional
*
* Callback to be executed just before starting dispatching
*
* Receives as first parameter the waiting room object itself,
* and the options of the dispatch call as second parameter.
*/
// ON_DISPATCH: null;
/**
* ## ON_DISPATCHED (function) Optional
*
* Callback to be executed at the end of a dispatch call
*
* Receives as first parameter the waiting room object itself,
* and the options of the dispatch call as second parameter.
*/
// ON_DISPATCHED: null;
/**
* ## ON_FAILED_DISPATCH (function) Optional
*
* Callback to be executed if a dispatch attempt failed
*
* Receives as first parameter the waiting room object itself,
* the options of the dispatch call as second parameter, and
* optionally the error message as third parameter.
*/
// ON_FAILED_DISPATCH: null;
/**
* ## DISPATCH_TO_SAME_ROOM (boolean) Optional
*
* If TRUE, every new group will be added to the same game room
*
* A new game room will be created for the first dispatch, and
* reused for all successive groups. Default, FALSE.
*
* Notice: the game must support adding players while it is running.
*
* Default: FALSE
*
* @see WaitingRoom.lastGameRoom
*/
DISPATCH_TO_SAME_ROOM: true,
/**
* ## PING_BEFORE_DISPATCH (boolean) Optional
*
* If TRUE, all players are pinged before a dispatch
*
* Non-responding clients are disconnected.
*
* If only one player is needed and mode is 'WAIT_FOR_N_PLAYERS',
* pinging is skipped.
*
* Default: TRUE
*
* @see WaitingRoom.dispatch
*/
// PING_BEFORE_DISPATCH: true,
/**
* ## PING_MAX_REPLY_TIME (number > 0) Optional
*
* The number of milliseconds to wait for a reply from a PING
*
* Default: 3000
*
* @see PING_BEFORE_DISPATCH
*/
// PING_MAX_REPLY_TIME: 3000,
/**
* ## PING_DISPATCH_ANYWAY (boolean) Optional
*
* If TRUE, dispatch continues even if disconnections occur during PING
*
* Default: FALSE
*
* @see PING_BEFORE_DISPATCH
* @see PING_MAX_REPLY_TIME
*/
// PING_DISPATCH_ANYWAY: false,
/**
* ## logicPath (string) Optional
*
* If set, a custom implementation of the wait room will be used
*
* @see wait.room.js (nodegame-server)
*/
// logicPath: 'path/to/a/wait.room.js',
/**
* ## DISCONNECT_IF_NOT_SELECTED (boolean) Optional
*
* Disconnect a client if not selected for a game when dispatching
*
* Default: false
*/
// DISCONNECT_IF_NOT_SELECTED: true,
/**
* ## NOTIFY_INTERVAL (integer > 0) Optional
*
* The number of milliseconds to wait to send a player-update message
*
* Default: 200
*
* @see WaitingRoom.notifyPlayerUpdate
*/
// NOTIFY_INTERVAL: 200,
/**
* ## PAGE_TITLE (object) Optional
*
* Sets the page title, optionally adds to page
*
* An object containing the title, and a flag if the same text should
* be added in a H1 element at the top of the page.
*
* Default: { title: 'Welcome!', addToBody: true }
*/
// PAGE_TITLE: { title: 'Welcome!', addToBody: true },
/** ### TEXTS
*
* Collections of texts displayed when given events occurs
*
* Each item can be a string, or function returning a string; the function
* receives two input parameters: the instance of the widget and an object
* with extra information (depending on the event).
*
* @see WaitingRoom.texts
*/
TEXTS: {
/**
* #### blinkTitle
*
* Blinks the title of the tab to signal the beginning of the game
*
* False will not blink.
*/
// blinkTitle: 'Custom string: Game Starts!',
/**
* #### disconnect
*
* Disconnected from waiting room
*/
// disconnect: 'Custom string: YOU HAVE BEEN DISCONNECTED!',
/**
* #### waitedTooLong
*
* The MAX_WAIT_TIME countdown expired
*/
// waitedTooLong: 'Custom string: YOU WAITED TOO LONG!',
/**
* #### notEnoughPlayers
*
* There are not enough players to start a game
*/
// notEnoughPlayers: 'Custom string: NOT ENOUGH PLAYERS!',
/**
* #### roomClosed
*
* A player tries to connect, but the waiting room has been closed
*/
// roomClosed: 'Custom string: ROOM CLOSED! CANNOT ENTER!',
/**
* #### tooManyPlayers
*
* Currently there are more players than needed by the game
*/
// tooManyPlayers: 'Custom string: TOO MANY PLAYERS!',
/**
* #### notSelectedClosed
*
* Player has not been selected, and cannot participate in other games
*/
// notSelectedClosed: 'Custom string: NOT SELECTED CLOSED!',
/**
* #### notSelectedOpen
*
* Player has not been selected, but can still participate in new games
*/
// notSelectedOpen: 'Custom string: NOT SELECTED OPEN!',
/**
* #### exitCode
*
* Player disconnected, and an exit code might have been provided
*/
// exitCode: 'Custom string: EXIT CODE TEXT',
},
/** ### SOUNDS
*
* Collections of sounds played when given events occurs
*
* Each item can be a string, or function returning a string; the function
* receives two input parameters: the instance of the widget and an object
* with extra information (depending on the event).
*
* @see WaitingRoom.sounds
*/
SOUNDS: {
/**
* ## dispatch
*
* Notifies players that a game is about to be dispatched
*
* If TRUE, plays default sound, if string plays the file sound
* located at the specified uri.
*/
dispatch: false
},
/** ### ALLOW_PLAY_WITH_BOTS
*
* Allows a player to request to start the game immediately with bots
*
* A button is added to the interface.
*/
ALLOW_PLAY_WITH_BOTS: true,
/** ### ALLOW_SELECT_TREATMENT
*
* Allows a player to select the treatment for the game
*
* This option requires `ALLOW_PLAY_WITH_BOTS` to be TRUE.
*
* A button is added to the interface.
*/
ALLOW_SELECT_TREATMENT: true
};
|
/**
* This unit is part of the "finaljs" Framework
*
* finaljs game development framework v_$version$
* copyright (c) 2014 Torsten Spaete
*/
"use strict";
final.module("final.ui.Control", ["final.Vec2", "final.Vec2Pool", "final.math", "final.collision.Intersections", "final.ui.State", "final.input.MouseButton"],
function (final, Vec2, Vec2Pool, math, Intersections, State, MouseButton) {
function Control(mng, pos, ext) {
this.mng = mng;
this.pos = pos || new Vec2();
this.ext = ext || new Vec2();
this.state = State.Enabled;
this.lastPointState = {left: false};
this.enabled = true;
this.visible = true;
this.childs = [];
this.click = function (self) {
};
}
Control.prototype.addChild = function (component) {
this.childs.push(component);
};
Control.prototype.init = function (r) {
};
Control.prototype.draw = function (r, p, e) {
};
Control.prototype.drawChilds = function (r, p, e) {
var childPos = Vec2Pool.get();
for (var i = 0; i < this.childs.length; i++) {
var child = this.childs[i];
final.math.vec2Add(childPos, p, child.pos);
child.draw(r, childPos, child.ext);
}
};
Control.prototype.update = function (dt, p, e) {
var r = false;
if (this.visible) {
// Get mouse states
var touchEnabled = typeof this.mng.touch != "undefined" && this.mng.touch != null && this.mng.touch.enabled;
var pointPos = touchEnabled ? this.mng.touch.getPos() : this.mng.mouse.getPos();
var pressed = touchEnabled ? this.mng.touch.getState() : this.mng.mouse.isMouseDown(MouseButton.Left);
var isMouseOver = Intersections.isPointInAABB(pointPos, p, e);
if (isMouseOver) {
r = true;
}
if (this.enabled) {
// Update the component state.
if (isMouseOver && this.state != State.Pressed) {
this.state = State.Hover;
} else if (!isMouseOver && this.state != State.Pressed) {
this.state = State.Enabled;
}
// Check if the user holds down the button.
if (pressed && !this.lastPointState.left) {
if (isMouseOver) {
this.state = State.Pressed;
}
} else if (pressed && this.lastPointState.left) {
if (!isMouseOver) {
this.state = State.Enabled;
} else {
this.state = State.Pressed;
}
}
if (!pressed && this.lastPointState.left) {
if (isMouseOver) {
this.state = State.Hover;
this.click(this);
} else if (this.state == State.Pressed) {
this.state = State.Enabled;
}
}
this.lastPointState.left = pressed;
}
}
// Set disable state, when its disabled
if (!this.enabled && this.state != State.Disabled) {
this.state = State.Disabled;
}
// Update childs
var childPos = Vec2Pool.get();
for (var i = 0; i < this.childs.length; i++) {
var child = this.childs[i];
final.math.vec2Add(childPos, p, child.pos);
if (child.update(dt, childPos, child.ext)) {
r = true;
}
}
return r;
};
return Control;
}
);
|
import React from 'react';
import {
StyleSheet,
Text,
View,
Animated,
} from 'react-native';
import {
Icon,
} from 'native-base';
import Button from './Button';
import { connect } from 'react-redux';
import { openDrawer } from '../../actions/drawer';
const DefaultTabBar = React.createClass({
propTypes: {
goToPage: React.PropTypes.func,
activeTab: React.PropTypes.number,
tabs: React.PropTypes.array,
backgroundColor: React.PropTypes.string,
activeTextColor: React.PropTypes.string,
inactiveTextColor: React.PropTypes.string,
textStyle: Text.propTypes.style,
tabStyle: View.propTypes.style,
renderTab: React.PropTypes.func,
underlineStyle: View.propTypes.style,
},
getDefaultProps() {
return {
activeTextColor: 'navy',
inactiveTextColor: 'black',
backgroundColor: null,
};
},
renderTabOption(name, page) {
},
renderTab(name, page, isTabActive, onPressHandler) {
const { activeTextColor, inactiveTextColor, textStyle, } = this.props;
const textColor = isTabActive ? activeTextColor : inactiveTextColor;
const fontWeight = isTabActive ? 'bold' : 'normal';
return <Button
style={{flex: 1, }}
key={name}
accessible={true}
accessibilityLabel={name}
accessibilityTraits='button'
onPress={() => onPressHandler(page)}
>
<View style={[styles.tab, this.props.tabStyle, ]}>
<Text style={[{color: textColor, fontWeight, }, textStyle, ]}>
{name}
</Text>
</View>
</Button>;
},
render() {
const containerWidth = this.props.containerWidth;
const numberOfTabs = this.props.tabs.length;
const tabUnderlineStyle = {
position: 'absolute',
width: containerWidth / numberOfTabs,
height: 4,
backgroundColor: 'navy',
bottom: 0,
};
const left = this.props.scrollValue.interpolate({
inputRange: [0, 1, ], outputRange: [0, containerWidth / numberOfTabs, ],
});
return (
<View style={[styles.tabs, {backgroundColor: this.props.backgroundColor, }, this.props.style, ]}>
<Button style={{flex: 0.2, paddingTop: 3, paddingLeft: 10}}>
<Icon name="ios-menu" onPress={() => this.props.openDrawer() }/>
</Button>
{this.props.tabs.map((name, page) => {
const isTabActive = this.props.activeTab === page;
const renderTab = this.props.renderTab || this.renderTab;
return renderTab(name, page, isTabActive, this.props.goToPage);
})}
<Button style={{flex: 0.2, paddingTop: 3, paddingRight: 10}}>
<Icon name="ios-swap" />
</Button>
{/*<Animated.View style={[tabUnderlineStyle, { left, }, this.props.underlineStyle, ]} />*/}
</View>
);
},
});
const styles = StyleSheet.create({
tab: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingBottom: 10,
},
tabs: {
height: 50,
flexDirection: 'row',
justifyContent: 'space-around',
borderWidth: 1,
borderTopWidth: 0,
borderLeftWidth: 0,
borderRightWidth: 0,
borderColor: '#ccc',
},
});
const mapDispatchToProps = dispatch => ({
openDrawer: () => dispatch(openDrawer()),
});
export default connect(null, mapDispatchToProps)(DefaultTabBar);
|
/* @generated */
// prettier-ignore
if (Intl.NumberFormat && typeof Intl.NumberFormat.__addLocaleData === 'function') {
Intl.NumberFormat.__addLocaleData({"data":{"es-CO":{"units":{"simple":{"degree":{"long":{"other":"{0} grados","one":"{0} grado"},"short":{"other":"{0}°"},"narrow":{"other":"{0}°"},"perUnit":{}},"hectare":{"long":{"other":"{0} hectáreas","one":"{0} hectárea"},"short":{"other":"{0} ha"},"narrow":{"other":"{0}ha"},"perUnit":{}},"acre":{"long":{"other":"{0} acres","one":"{0} acre"},"short":{"other":"{0} ac"},"narrow":{"other":"{0}ac"},"perUnit":{}},"percent":{"long":{"other":"{0} por ciento"},"short":{"other":"{0} %"},"narrow":{"other":"{0} %"},"perUnit":{}},"liter-per-kilometer":{"long":{"other":"{0} litros por kilómetro","one":"{0} litro por kilómetro"},"short":{"other":"{0} l/km"},"narrow":{"other":"{0} l/km"},"perUnit":{}},"mile-per-gallon":{"long":{"other":"{0} millas por galón","one":"{0} milla por galón"},"short":{"other":"{0} mi/gal"},"narrow":{"other":"{0} mi/gal"},"perUnit":{}},"petabyte":{"long":{"other":"{0} petabytes","one":"{0} petabyte"},"short":{"other":"{0} PB"},"narrow":{"other":"{0} PB"},"perUnit":{}},"terabyte":{"long":{"other":"{0} terabytes","one":"{0} terabyte"},"short":{"other":"{0} TB"},"narrow":{"other":"{0} TB"},"perUnit":{}},"terabit":{"long":{"other":"{0} terabits","one":"{0} terabit"},"short":{"other":"{0} Tb"},"narrow":{"other":"{0} Tb"},"perUnit":{}},"gigabyte":{"long":{"other":"{0} gigabytes","one":"{0} gigabyte"},"short":{"other":"{0} GB"},"narrow":{"other":"{0} GB"},"perUnit":{}},"gigabit":{"long":{"other":"{0} gigabits","one":"{0} gigabit"},"short":{"other":"{0} Gb"},"narrow":{"other":"{0} Gb"},"perUnit":{}},"megabyte":{"long":{"other":"{0} megabytes","one":"{0} megabyte"},"short":{"other":"{0} MB"},"narrow":{"other":"{0} MB"},"perUnit":{}},"megabit":{"long":{"other":"{0} megabits","one":"{0} megabit"},"short":{"other":"{0} Mb"},"narrow":{"other":"{0} Mb"},"perUnit":{}},"kilobyte":{"long":{"other":"{0} kilobytes","one":"{0} kilobyte"},"short":{"other":"{0} kB"},"narrow":{"other":"{0} kB"},"perUnit":{}},"kilobit":{"long":{"other":"{0} kilobits","one":"{0} kilobit"},"short":{"other":"{0} kb"},"narrow":{"other":"{0} kb"},"perUnit":{}},"byte":{"long":{"other":"{0} bytes","one":"{0} byte"},"short":{"other":"{0} B"},"narrow":{"other":"{0} B"},"perUnit":{}},"bit":{"long":{"other":"{0} bits","one":"{0} bit"},"short":{"other":"{0} b"},"narrow":{"other":"{0} b"},"perUnit":{}},"year":{"long":{"other":"{0} años","one":"{0} año"},"short":{"other":"{0} a."},"narrow":{"other":"{0} a."},"perUnit":{"long":"{0} por año","short":"{0}/año","narrow":"{0}/a"}},"month":{"long":{"other":"{0} meses","one":"{0} mes"},"short":{"other":"{0} meses","one":"{0} mes"},"narrow":{"other":"{0} meses","one":"{0} mes"},"perUnit":{"long":"{0}/mes","short":"{0}/mes","narrow":"{0}/m."}},"week":{"long":{"other":"{0} semanas","one":"{0} semana"},"short":{"other":"{0} sems.","one":"{0} sem."},"narrow":{"other":"{0} sems.","one":"{0} sem."},"perUnit":{"long":"{0}/sem.","short":"{0}/sem.","narrow":"{0}/sem."}},"day":{"long":{"other":"{0} días","one":"{0} día"},"short":{"other":"{0} días","one":"{0} día"},"narrow":{"other":"{0} días","one":"{0} día"},"perUnit":{"long":"{0} por día","short":"{0}/día","narrow":"{0}/d."}},"hour":{"long":{"other":"{0} horas","one":"{0} hora"},"short":{"other":"{0} h"},"narrow":{"other":"{0} h"},"perUnit":{"long":"{0} por hora","short":"{0}/h","narrow":"{0}/h"}},"minute":{"long":{"other":"{0} minutos","one":"{0} minuto"},"short":{"other":"{0} min"},"narrow":{"other":"{0} min"},"perUnit":{"long":"{0} por minuto","short":"{0}/min","narrow":"{0}/min"}},"second":{"long":{"other":"{0} segundos","one":"{0} segundo"},"short":{"other":"{0} s"},"narrow":{"other":"{0} s"},"perUnit":{"long":"{0} por segundo","short":"{0}/s","narrow":"{0}/s"}},"millisecond":{"long":{"other":"{0} milisegundos","one":"{0} milisegundo"},"short":{"other":"{0} ms"},"narrow":{"other":"{0} ms"},"perUnit":{}},"kilometer":{"long":{"other":"{0} kilómetros","one":"{0} kilómetro"},"short":{"other":"{0} km"},"narrow":{"other":"{0}km"},"perUnit":{"long":"{0} por kilómetro","short":"{0}/km","narrow":"{0}/km"}},"meter":{"long":{"other":"{0} metros","one":"{0} metro"},"short":{"other":"{0} m"},"narrow":{"other":"{0} m"},"perUnit":{"long":"{0} por metro","short":"{0}/m","narrow":"{0}/m"}},"centimeter":{"long":{"other":"{0} centímetros","one":"{0} centímetro"},"short":{"other":"{0} cm"},"narrow":{"other":"{0}cm"},"perUnit":{"long":"{0} por centímetro","short":"{0}/cm","narrow":"{0}/cm"}},"millimeter":{"long":{"other":"{0} milímetros","one":"{0} milímetro"},"short":{"other":"{0} mm"},"narrow":{"other":"{0}mm"},"perUnit":{}},"mile":{"long":{"other":"{0} millas","one":"{0} milla"},"short":{"other":"{0} mi"},"narrow":{"other":"{0}mi"},"perUnit":{}},"yard":{"long":{"other":"{0} yardas","one":"{0} yarda"},"short":{"other":"{0} yd"},"narrow":{"other":"{0}yd"},"perUnit":{}},"foot":{"long":{"other":"{0} pies","one":"{0} pie"},"short":{"other":"{0} ft"},"narrow":{"other":"{0}ft"},"perUnit":{"long":"{0} por pie","short":"{0}/ft","narrow":"{0}/ft"}},"inch":{"long":{"other":"{0} pulgadas","one":"{0} pulgada"},"short":{"other":"{0} in"},"narrow":{"other":"{0}in"},"perUnit":{"long":"{0} por pulgada","short":"{0}/in","narrow":"{0}/in"}},"mile-scandinavian":{"long":{"other":"{0} millas escandinavas","one":"{0} milla escandinava"},"short":{"other":"{0} mi esc."},"narrow":{"other":"{0}mi esc."},"perUnit":{}},"kilogram":{"long":{"other":"{0} kilogramos","one":"{0} kilogramo"},"short":{"other":"{0} kg"},"narrow":{"other":"{0}kg"},"perUnit":{"long":"{0} por kilogramo","short":"{0}/kg","narrow":"{0}/kg"}},"gram":{"long":{"other":"{0} gramos","one":"{0} gramo"},"short":{"other":"{0} g"},"narrow":{"other":"{0}g"},"perUnit":{"long":"{0} por gramo","short":"{0}/g","narrow":"{0}/g"}},"stone":{"long":{"other":"{0} stones","one":"{0} stone"},"short":{"other":"{0} st"},"narrow":{"other":"{0}st"},"perUnit":{}},"pound":{"long":{"other":"{0} libras","one":"{0} libra"},"short":{"other":"{0} lb"},"narrow":{"other":"{0}lb"},"perUnit":{"long":"{0} por libra","short":"{0}/lb","narrow":"{0}/lb"}},"ounce":{"long":{"other":"{0} onzas","one":"{0} onza"},"short":{"other":"{0} oz"},"narrow":{"other":"{0}oz"},"perUnit":{"long":"{0} por onza","short":"{0}/oz","narrow":"{0}/oz"}},"kilometer-per-hour":{"long":{"other":"{0} kilómetros por hora","one":"{0} kilómetro por hora"},"short":{"other":"{0} km/h"},"narrow":{"other":"{0}km/h"},"perUnit":{}},"meter-per-second":{"long":{"other":"{0} metros por segundo","one":"{0} metro por segundo"},"short":{"other":"{0} m/s"},"narrow":{"other":"{0}m/s"},"perUnit":{}},"mile-per-hour":{"long":{"other":"{0} millas por hora","one":"{0} milla por hora"},"short":{"other":"{0} mi/h"},"narrow":{"other":"{0}mi/h"},"perUnit":{}},"celsius":{"long":{"other":"{0} grados Celsius","one":"{0} grado Celsius"},"short":{"other":"{0} °C"},"narrow":{"other":"{0}°C"},"perUnit":{}},"fahrenheit":{"long":{"other":"{0} grados Fahrenheit","one":"{0} grado Fahrenheit"},"short":{"other":"{0} °F"},"narrow":{"other":"{0} °F"},"perUnit":{}},"liter":{"long":{"other":"{0} litros","one":"{0} litro"},"short":{"other":"{0} l"},"narrow":{"other":"{0}l"},"perUnit":{"long":"{0} por litro","short":"{0}/l","narrow":"{0}/l"}},"milliliter":{"long":{"other":"{0} mililitros","one":"{0} mililitro"},"short":{"other":"{0} ml"},"narrow":{"other":"{0} ml"},"perUnit":{}},"gallon":{"long":{"other":"{0} galones","one":"{0} galón"},"short":{"other":"{0} gal"},"narrow":{"other":"{0} gal"},"perUnit":{"long":"{0} por galón","short":"{0}/gal","narrow":"{0}/gal"}},"fluid-ounce":{"long":{"other":"{0} onzas fluidas","one":"{0} onza fluida"},"short":{"other":"{0} fl oz"},"narrow":{"other":"{0} fl oz"},"perUnit":{}}},"compound":{"per":{"long":"{0} por {1}","short":"{0}/{1}","narrow":"{0}/{1}"}}},"currencies":{"ADP":{"displayName":{"other":"pesetas andorranas","one":"peseta andorrana"},"symbol":"ADP","narrow":"ADP"},"AED":{"displayName":{"other":"dírhams de los Emiratos Árabes Unidos","one":"dírham de los Emiratos Árabes Unidos"},"symbol":"AED","narrow":"AED"},"AFA":{"displayName":{"other":"afgani (1927–2002)"},"symbol":"AFA","narrow":"AFA"},"AFN":{"displayName":{"other":"afganis","one":"afgani"},"symbol":"AFN","narrow":"AFN"},"ALK":{"displayName":{"other":"ALK"},"symbol":"ALK","narrow":"ALK"},"ALL":{"displayName":{"other":"lekes","one":"lek"},"symbol":"ALL","narrow":"ALL"},"AMD":{"displayName":{"other":"drams","one":"dram"},"symbol":"AMD","narrow":"AMD"},"ANG":{"displayName":{"other":"florines de las Antillas Neerlandesas","one":"florín de las Antillas Neerlandesas"},"symbol":"ANG","narrow":"ANG"},"AOA":{"displayName":{"other":"kuanzas","one":"kuanza"},"symbol":"AOA","narrow":"Kz"},"AOK":{"displayName":{"other":"kwanza angoleño (1977–1990)"},"symbol":"AOK","narrow":"AOK"},"AON":{"displayName":{"other":"nuevo kwanza angoleño (1990–2000)"},"symbol":"AON","narrow":"AON"},"AOR":{"displayName":{"other":"kwanza reajustado angoleño (1995–1999)"},"symbol":"AOR","narrow":"AOR"},"ARA":{"displayName":{"other":"australes argentinos","one":"austral argentino"},"symbol":"ARA","narrow":"ARA"},"ARL":{"displayName":{"other":"ARL"},"symbol":"ARL","narrow":"ARL"},"ARM":{"displayName":{"other":"ARM"},"symbol":"ARM","narrow":"ARM"},"ARP":{"displayName":{"other":"pesos argentinos (ARP)","one":"peso argentino (ARP)"},"symbol":"ARP","narrow":"ARP"},"ARS":{"displayName":{"other":"pesos argentinos","one":"peso argentino"},"symbol":"ARS","narrow":"$"},"ATS":{"displayName":{"other":"chelines austriacos","one":"chelín austriaco"},"symbol":"ATS","narrow":"ATS"},"AUD":{"displayName":{"other":"dólares australianos","one":"dólar australiano"},"symbol":"AUD","narrow":"$"},"AWG":{"displayName":{"other":"florines arubeños","one":"florín arubeño"},"symbol":"AWG","narrow":"AWG"},"AZM":{"displayName":{"other":"manat azerí (1993–2006)"},"symbol":"AZM","narrow":"AZM"},"AZN":{"displayName":{"other":"manat azerbaiyanos","one":"manat azerbaiyano"},"symbol":"AZN","narrow":"AZN"},"BAD":{"displayName":{"other":"dinares bosnios","one":"dinar bosnio"},"symbol":"BAD","narrow":"BAD"},"BAM":{"displayName":{"other":"marcos convertibles de Bosnia y Herzegovina","one":"marco convertible de Bosnia y Herzegovina"},"symbol":"BAM","narrow":"KM"},"BAN":{"displayName":{"other":"BAN"},"symbol":"BAN","narrow":"BAN"},"BBD":{"displayName":{"other":"dólares barbadenses","one":"dólar barbadense"},"symbol":"BBD","narrow":"$"},"BDT":{"displayName":{"other":"takas","one":"taka"},"symbol":"BDT","narrow":"৳"},"BEC":{"displayName":{"other":"francos belgas (convertibles)","one":"franco belga (convertible)"},"symbol":"BEC","narrow":"BEC"},"BEF":{"displayName":{"other":"francos belgas","one":"franco belga"},"symbol":"BEF","narrow":"BEF"},"BEL":{"displayName":{"other":"francos belgas (financieros)","one":"franco belga (financiero)"},"symbol":"BEL","narrow":"BEL"},"BGL":{"displayName":{"other":"leva fuertes búlgaros","one":"lev fuerte búlgaro"},"symbol":"BGL","narrow":"BGL"},"BGM":{"displayName":{"other":"BGM"},"symbol":"BGM","narrow":"BGM"},"BGN":{"displayName":{"other":"leva búlgaros","one":"lev búlgaro"},"symbol":"BGN","narrow":"BGN"},"BGO":{"displayName":{"other":"BGO"},"symbol":"BGO","narrow":"BGO"},"BHD":{"displayName":{"other":"dinares bahreiníes","one":"dinar bahreiní"},"symbol":"BHD","narrow":"BHD"},"BIF":{"displayName":{"other":"francos burundeses","one":"franco burundés"},"symbol":"BIF","narrow":"BIF"},"BMD":{"displayName":{"other":"dólares de Bermudas","one":"dólar de Bermudas"},"symbol":"BMD","narrow":"$"},"BND":{"displayName":{"other":"dólares bruneanos","one":"dólar bruneano"},"symbol":"BND","narrow":"$"},"BOB":{"displayName":{"other":"bolivianos","one":"boliviano"},"symbol":"BOB","narrow":"Bs"},"BOL":{"displayName":{"other":"BOL"},"symbol":"BOL","narrow":"BOL"},"BOP":{"displayName":{"other":"pesos bolivianos","one":"peso boliviano"},"symbol":"BOP","narrow":"BOP"},"BOV":{"displayName":{"other":"MVDOL bolivianos","one":"MVDOL boliviano"},"symbol":"BOV","narrow":"BOV"},"BRB":{"displayName":{"other":"nuevos cruzados brasileños (BRB)","one":"nuevo cruzado brasileño (BRB)"},"symbol":"BRB","narrow":"BRB"},"BRC":{"displayName":{"other":"cruzados brasileños","one":"cruzado brasileño"},"symbol":"BRC","narrow":"BRC"},"BRE":{"displayName":{"other":"cruceiros brasileños (BRE)","one":"cruceiro brasileño (BRE)"},"symbol":"BRE","narrow":"BRE"},"BRL":{"displayName":{"other":"reales brasileños","one":"real brasileño"},"symbol":"BRL","narrow":"R$"},"BRN":{"displayName":{"other":"nuevos cruzados brasileños","one":"nuevo cruzado brasileño"},"symbol":"BRN","narrow":"BRN"},"BRR":{"displayName":{"other":"cruceiros brasileños","one":"cruceiro brasileño"},"symbol":"BRR","narrow":"BRR"},"BRZ":{"displayName":{"other":"BRZ"},"symbol":"BRZ","narrow":"BRZ"},"BSD":{"displayName":{"other":"dólares bahameños","one":"dólar bahameño"},"symbol":"BSD","narrow":"$"},"BTN":{"displayName":{"other":"gultrums","one":"gultrum"},"symbol":"BTN","narrow":"BTN"},"BUK":{"displayName":{"other":"kyat birmanos","one":"kyat birmano"},"symbol":"BUK","narrow":"BUK"},"BWP":{"displayName":{"other":"pulas","one":"pula"},"symbol":"BWP","narrow":"P"},"BYB":{"displayName":{"other":"nuevos rublos bielorrusos","one":"nuevo rublo bielorruso"},"symbol":"BYB","narrow":"BYB"},"BYN":{"displayName":{"other":"rublos bielorrusos","one":"rublo bielorruso"},"symbol":"BYN","narrow":"р."},"BYR":{"displayName":{"other":"rublos bielorrusos (2000–2016)","one":"rublo bielorruso (2000–2016)"},"symbol":"BYR","narrow":"BYR"},"BZD":{"displayName":{"other":"dólares beliceños","one":"dólar beliceño"},"symbol":"BZD","narrow":"$"},"CAD":{"displayName":{"other":"dólares canadienses","one":"dólar canadiense"},"symbol":"CAD","narrow":"$"},"CDF":{"displayName":{"other":"francos congoleños","one":"franco congoleño"},"symbol":"CDF","narrow":"CDF"},"CHE":{"displayName":{"other":"euros WIR","one":"euro WIR"},"symbol":"CHE","narrow":"CHE"},"CHF":{"displayName":{"other":"francos suizos","one":"franco suizo"},"symbol":"CHF","narrow":"CHF"},"CHW":{"displayName":{"other":"francos WIR","one":"franco WIR"},"symbol":"CHW","narrow":"CHW"},"CLE":{"displayName":{"other":"CLE"},"symbol":"CLE","narrow":"CLE"},"CLF":{"displayName":{"other":"unidades de fomento chilenas","one":"unidad de fomento chilena"},"symbol":"CLF","narrow":"CLF"},"CLP":{"displayName":{"other":"pesos chilenos","one":"peso chileno"},"symbol":"CLP","narrow":"$"},"CNH":{"displayName":{"other":"yuan chino (extracontinental)"},"symbol":"CNH","narrow":"CNH"},"CNX":{"displayName":{"other":"CNX"},"symbol":"CNX","narrow":"CNX"},"CNY":{"displayName":{"other":"yuanes","one":"yuan"},"symbol":"CNY","narrow":"¥"},"COP":{"displayName":{"other":"pesos colombianos","one":"peso colombiano"},"symbol":"$","narrow":"$"},"COU":{"displayName":{"other":"unidades de valor reales","one":"unidad de valor real"},"symbol":"COU","narrow":"COU"},"CRC":{"displayName":{"other":"colones costarricenses","one":"colón costarricense"},"symbol":"CRC","narrow":"₡"},"CSD":{"displayName":{"other":"antiguos dinares serbios","one":"antiguo dinar serbio"},"symbol":"CSD","narrow":"CSD"},"CSK":{"displayName":{"other":"coronas fuertes checoslovacas","one":"corona fuerte checoslovaca"},"symbol":"CSK","narrow":"CSK"},"CUC":{"displayName":{"other":"pesos cubanos convertibles","one":"peso cubano convertible"},"symbol":"CUC","narrow":"$"},"CUP":{"displayName":{"other":"pesos cubanos","one":"peso cubano"},"symbol":"CUP","narrow":"$"},"CVE":{"displayName":{"other":"escudos de Cabo Verde","one":"escudo de Cabo Verde"},"symbol":"CVE","narrow":"CVE"},"CYP":{"displayName":{"other":"libras chipriotas","one":"libra chipriota"},"symbol":"CYP","narrow":"CYP"},"CZK":{"displayName":{"other":"coronas checas","one":"corona checa"},"symbol":"CZK","narrow":"Kč"},"DDM":{"displayName":{"other":"marcos de la República Democrática Alemana","one":"marco de la República Democrática Alemana"},"symbol":"DDM","narrow":"DDM"},"DEM":{"displayName":{"other":"marcos alemanes","one":"marco alemán"},"symbol":"DEM","narrow":"DEM"},"DJF":{"displayName":{"other":"francos yibutianos","one":"franco yibutiano"},"symbol":"DJF","narrow":"DJF"},"DKK":{"displayName":{"other":"coronas danesas","one":"corona danesa"},"symbol":"DKK","narrow":"kr"},"DOP":{"displayName":{"other":"pesos dominicanos","one":"peso dominicano"},"symbol":"DOP","narrow":"$"},"DZD":{"displayName":{"other":"dinares argelinos","one":"dinar argelino"},"symbol":"DZD","narrow":"DZD"},"ECS":{"displayName":{"other":"sucres ecuatorianos","one":"sucre ecuatoriano"},"symbol":"ECS","narrow":"ECS"},"ECV":{"displayName":{"other":"unidades de valor constante (UVC) ecuatorianas","one":"unidad de valor constante (UVC) ecuatoriana"},"symbol":"ECV","narrow":"ECV"},"EEK":{"displayName":{"other":"coronas estonias","one":"corona estonia"},"symbol":"EEK","narrow":"EEK"},"EGP":{"displayName":{"other":"libras egipcias","one":"libra egipcia"},"symbol":"EGP","narrow":"E£"},"ERN":{"displayName":{"other":"nakfas","one":"nakfa"},"symbol":"ERN","narrow":"ERN"},"ESA":{"displayName":{"other":"pesetas españolas (cuenta A)","one":"peseta española (cuenta A)"},"symbol":"ESA","narrow":"ESA"},"ESB":{"displayName":{"other":"pesetas españolas (cuenta convertible)","one":"peseta española (cuenta convertible)"},"symbol":"ESB","narrow":"ESB"},"ESP":{"displayName":{"other":"pesetas españolas","one":"peseta española"},"symbol":"₧","narrow":"₧"},"ETB":{"displayName":{"other":"bires","one":"bir"},"symbol":"ETB","narrow":"ETB"},"EUR":{"displayName":{"other":"euros","one":"euro"},"symbol":"EUR","narrow":"€"},"FIM":{"displayName":{"other":"marcos finlandeses","one":"marco finlandés"},"symbol":"FIM","narrow":"FIM"},"FJD":{"displayName":{"other":"dólares fiyianos","one":"dólar fiyiano"},"symbol":"FJD","narrow":"$"},"FKP":{"displayName":{"other":"libras malvinenses","one":"libra malvinense"},"symbol":"FKP","narrow":"FK£"},"FRF":{"displayName":{"other":"francos franceses","one":"franco francés"},"symbol":"FRF","narrow":"FRF"},"GBP":{"displayName":{"other":"libras esterlinas","one":"libra esterlina"},"symbol":"GBP","narrow":"£"},"GEK":{"displayName":{"other":"kupon larit georgiano"},"symbol":"GEK","narrow":"GEK"},"GEL":{"displayName":{"other":"laris","one":"lari"},"symbol":"GEL","narrow":"₾"},"GHC":{"displayName":{"other":"cedi ghanés (1979–2007)"},"symbol":"GHC","narrow":"GHC"},"GHS":{"displayName":{"other":"cedis","one":"cedi"},"symbol":"GHS","narrow":"GHS"},"GIP":{"displayName":{"other":"libras gibraltareñas","one":"libra gibraltareña"},"symbol":"GIP","narrow":"£"},"GMD":{"displayName":{"other":"dalasis","one":"dalasi"},"symbol":"GMD","narrow":"GMD"},"GNF":{"displayName":{"other":"francos guineanos","one":"franco guineano"},"symbol":"GNF","narrow":"FG"},"GNS":{"displayName":{"other":"syli guineano"},"symbol":"GNS","narrow":"GNS"},"GQE":{"displayName":{"other":"ekueles de Guinea Ecuatorial","one":"ekuele de Guinea Ecuatorial"},"symbol":"GQE","narrow":"GQE"},"GRD":{"displayName":{"other":"dracmas griegos","one":"dracma griego"},"symbol":"GRD","narrow":"GRD"},"GTQ":{"displayName":{"other":"quetzales guatemaltecos","one":"quetzal guatemalteco"},"symbol":"GTQ","narrow":"Q"},"GWE":{"displayName":{"other":"escudo de Guinea Portuguesa"},"symbol":"GWE","narrow":"GWE"},"GWP":{"displayName":{"other":"peso de Guinea-Bissáu"},"symbol":"GWP","narrow":"GWP"},"GYD":{"displayName":{"other":"dólares guyaneses","one":"dólar guyanés"},"symbol":"GYD","narrow":"$"},"HKD":{"displayName":{"other":"dólares hongkoneses","one":"dólar hongkonés"},"symbol":"HKD","narrow":"$"},"HNL":{"displayName":{"other":"lempiras hondureños","one":"lempira hondureño"},"symbol":"HNL","narrow":"L"},"HRD":{"displayName":{"other":"dinares croatas","one":"dinar croata"},"symbol":"HRD","narrow":"HRD"},"HRK":{"displayName":{"other":"kunas","one":"kuna"},"symbol":"HRK","narrow":"kn"},"HTG":{"displayName":{"other":"gourdes haitianos","one":"gourde haitiano"},"symbol":"HTG","narrow":"HTG"},"HUF":{"displayName":{"other":"forintos húngaros","one":"forinto húngaro"},"symbol":"HUF","narrow":"Ft"},"IDR":{"displayName":{"other":"rupias indonesias","one":"rupia indonesia"},"symbol":"IDR","narrow":"Rp"},"IEP":{"displayName":{"other":"libras irlandesas","one":"libra irlandesa"},"symbol":"IEP","narrow":"IEP"},"ILP":{"displayName":{"other":"libras israelíes","one":"libra israelí"},"symbol":"ILP","narrow":"ILP"},"ILR":{"displayName":{"other":"ILR"},"symbol":"ILR","narrow":"ILR"},"ILS":{"displayName":{"other":"nuevos séqueles israelíes","one":"nuevo séquel israelí"},"symbol":"ILS","narrow":"₪"},"INR":{"displayName":{"other":"rupias indias","one":"rupia india"},"symbol":"INR","narrow":"₹"},"IQD":{"displayName":{"other":"dinares iraquíes","one":"dinar iraquí"},"symbol":"IQD","narrow":"IQD"},"IRR":{"displayName":{"other":"riales iraníes","one":"rial iraní"},"symbol":"IRR","narrow":"IRR"},"ISJ":{"displayName":{"other":"ISJ"},"symbol":"ISJ","narrow":"ISJ"},"ISK":{"displayName":{"other":"coronas islandesas","one":"corona islandesa"},"symbol":"ISK","narrow":"kr"},"ITL":{"displayName":{"other":"liras italianas","one":"lira italiana"},"symbol":"ITL","narrow":"ITL"},"JMD":{"displayName":{"other":"dólares jamaicanos","one":"dólar jamaicano"},"symbol":"JMD","narrow":"$"},"JOD":{"displayName":{"other":"dinares jordanos","one":"dinar jordano"},"symbol":"JOD","narrow":"JOD"},"JPY":{"displayName":{"other":"yenes","one":"yen"},"symbol":"JPY","narrow":"¥"},"KES":{"displayName":{"other":"chelines kenianos","one":"chelín keniano"},"symbol":"KES","narrow":"KES"},"KGS":{"displayName":{"other":"soms","one":"som"},"symbol":"KGS","narrow":"KGS"},"KHR":{"displayName":{"other":"rieles","one":"riel"},"symbol":"KHR","narrow":"៛"},"KMF":{"displayName":{"other":"francos comorenses","one":"franco comorense"},"symbol":"KMF","narrow":"CF"},"KPW":{"displayName":{"other":"wons norcoreanos","one":"won norcoreano"},"symbol":"KPW","narrow":"₩"},"KRH":{"displayName":{"other":"KRH"},"symbol":"KRH","narrow":"KRH"},"KRO":{"displayName":{"other":"KRO"},"symbol":"KRO","narrow":"KRO"},"KRW":{"displayName":{"other":"wons surcoreanos","one":"won surcoreano"},"symbol":"KRW","narrow":"₩"},"KWD":{"displayName":{"other":"dinares kuwaitíes","one":"dinar kuwaití"},"symbol":"KWD","narrow":"KWD"},"KYD":{"displayName":{"other":"dólares de las Islas Caimán","one":"dólar de las Islas Caimán"},"symbol":"KYD","narrow":"$"},"KZT":{"displayName":{"other":"tenges kazakos","one":"tenge kazako"},"symbol":"KZT","narrow":"₸"},"LAK":{"displayName":{"other":"kips","one":"kip"},"symbol":"LAK","narrow":"₭"},"LBP":{"displayName":{"other":"libras libanesas","one":"libra libanesa"},"symbol":"LBP","narrow":"L£"},"LKR":{"displayName":{"other":"rupias esrilanquesas","one":"rupia esrilanquesa"},"symbol":"LKR","narrow":"Rs"},"LRD":{"displayName":{"other":"dólares liberianos","one":"dólar liberiano"},"symbol":"LRD","narrow":"$"},"LSL":{"displayName":{"other":"loti lesothense"},"symbol":"LSL","narrow":"LSL"},"LTL":{"displayName":{"other":"litas lituanas","one":"litas lituana"},"symbol":"LTL","narrow":"Lt"},"LTT":{"displayName":{"other":"talonas lituanas","one":"talonas lituana"},"symbol":"LTT","narrow":"LTT"},"LUC":{"displayName":{"other":"francos convertibles luxemburgueses","one":"franco convertible luxemburgués"},"symbol":"LUC","narrow":"LUC"},"LUF":{"displayName":{"other":"francos luxemburgueses","one":"franco luxemburgués"},"symbol":"LUF","narrow":"LUF"},"LUL":{"displayName":{"other":"francos financieros luxemburgueses","one":"franco financiero luxemburgués"},"symbol":"LUL","narrow":"LUL"},"LVL":{"displayName":{"other":"lats letónes","one":"lats letón"},"symbol":"LVL","narrow":"Ls"},"LVR":{"displayName":{"other":"rublos letones","one":"rublo letón"},"symbol":"LVR","narrow":"LVR"},"LYD":{"displayName":{"other":"dinares libios","one":"dinar libio"},"symbol":"LYD","narrow":"LYD"},"MAD":{"displayName":{"other":"dírhams marroquíes","one":"dírham marroquí"},"symbol":"MAD","narrow":"MAD"},"MAF":{"displayName":{"other":"francos marroquíes","one":"franco marroquí"},"symbol":"MAF","narrow":"MAF"},"MCF":{"displayName":{"other":"MCF"},"symbol":"MCF","narrow":"MCF"},"MDC":{"displayName":{"other":"MDC"},"symbol":"MDC","narrow":"MDC"},"MDL":{"displayName":{"other":"lei moldavos","one":"leu moldavo"},"symbol":"MDL","narrow":"MDL"},"MGA":{"displayName":{"other":"ariaris","one":"ariari"},"symbol":"MGA","narrow":"Ar"},"MGF":{"displayName":{"other":"franco malgache"},"symbol":"MGF","narrow":"MGF"},"MKD":{"displayName":{"other":"dinares macedonios","one":"dinar macedonio"},"symbol":"MKD","narrow":"MKD"},"MKN":{"displayName":{"other":"MKN"},"symbol":"MKN","narrow":"MKN"},"MLF":{"displayName":{"other":"franco malí"},"symbol":"MLF","narrow":"MLF"},"MMK":{"displayName":{"other":"kiats","one":"kiat"},"symbol":"MMK","narrow":"K"},"MNT":{"displayName":{"other":"tugriks","one":"tugrik"},"symbol":"MNT","narrow":"₮"},"MOP":{"displayName":{"other":"patacas de Macao","one":"pataca de Macao"},"symbol":"MOP","narrow":"MOP"},"MRO":{"displayName":{"other":"uguiyas (1973–2017)","one":"uguiya (1973–2017)"},"symbol":"MRO","narrow":"MRO"},"MRU":{"displayName":{"other":"uguiyas","one":"uguiya"},"symbol":"MRU","narrow":"MRU"},"MTL":{"displayName":{"other":"liras maltesas","one":"lira maltesa"},"symbol":"MTL","narrow":"MTL"},"MTP":{"displayName":{"other":"libras maltesas","one":"libra maltesa"},"symbol":"MTP","narrow":"MTP"},"MUR":{"displayName":{"other":"rupias mauricianas","one":"rupia mauriciana"},"symbol":"MUR","narrow":"Rs"},"MVP":{"displayName":{"other":"MVP"},"symbol":"MVP","narrow":"MVP"},"MVR":{"displayName":{"other":"rufiyas","one":"rufiya"},"symbol":"MVR","narrow":"MVR"},"MWK":{"displayName":{"other":"kwachas malauís","one":"kwacha malauí"},"symbol":"MWK","narrow":"MWK"},"MXN":{"displayName":{"other":"pesos mexicanos","one":"peso mexicano"},"symbol":"MXN","narrow":"$"},"MXP":{"displayName":{"other":"pesos de plata mexicanos (MXP)","one":"peso de plata mexicano (MXP)"},"symbol":"MXP","narrow":"MXP"},"MXV":{"displayName":{"other":"unidades de inversión (UDI) mexicanas","one":"unidad de inversión (UDI) mexicana"},"symbol":"MXV","narrow":"MXV"},"MYR":{"displayName":{"other":"ringits","one":"ringit"},"symbol":"MYR","narrow":"RM"},"MZE":{"displayName":{"other":"escudos mozambiqueños","one":"escudo mozambiqueño"},"symbol":"MZE","narrow":"MZE"},"MZM":{"displayName":{"other":"antiguo metical mozambiqueño"},"symbol":"MZM","narrow":"MZM"},"MZN":{"displayName":{"other":"meticales","one":"metical"},"symbol":"MZN","narrow":"MZN"},"NAD":{"displayName":{"other":"dólares namibios","one":"dólar namibio"},"symbol":"NAD","narrow":"$"},"NGN":{"displayName":{"other":"nairas","one":"naira"},"symbol":"NGN","narrow":"₦"},"NIC":{"displayName":{"other":"córdobas nicaragüenses (1988–1991)","one":"córdoba nicaragüense (1988–1991)"},"symbol":"NIC","narrow":"NIC"},"NIO":{"displayName":{"other":"córdobas nicaragüenses","one":"córdoba nicaragüense"},"symbol":"NIO","narrow":"C$"},"NLG":{"displayName":{"other":"florines neerlandeses","one":"florín neerlandés"},"symbol":"NLG","narrow":"NLG"},"NOK":{"displayName":{"other":"coronas noruegas","one":"corona noruega"},"symbol":"NOK","narrow":"kr"},"NPR":{"displayName":{"other":"rupias nepalíes","one":"rupia nepalí"},"symbol":"NPR","narrow":"Rs"},"NZD":{"displayName":{"other":"dólares neozelandeses","one":"dólar neozelandés"},"symbol":"NZD","narrow":"$"},"OMR":{"displayName":{"other":"riales omaníes","one":"rial omaní"},"symbol":"OMR","narrow":"OMR"},"PAB":{"displayName":{"other":"balboas panameños","one":"balboa panameño"},"symbol":"PAB","narrow":"PAB"},"PEI":{"displayName":{"other":"intis peruanos","one":"inti peruano"},"symbol":"PEI","narrow":"PEI"},"PEN":{"displayName":{"other":"soles peruanos","one":"sol peruano"},"symbol":"PEN","narrow":"PEN"},"PES":{"displayName":{"other":"soles peruanos (1863–1965)","one":"sol peruano (1863–1965)"},"symbol":"PES","narrow":"PES"},"PGK":{"displayName":{"other":"kinas","one":"kina"},"symbol":"PGK","narrow":"PGK"},"PHP":{"displayName":{"other":"pesos filipinos","one":"peso filipino"},"symbol":"PHP","narrow":"₱"},"PKR":{"displayName":{"other":"rupias pakistaníes","one":"rupia pakistaní"},"symbol":"PKR","narrow":"Rs"},"PLN":{"displayName":{"other":"eslotis","one":"esloti"},"symbol":"PLN","narrow":"zł"},"PLZ":{"displayName":{"other":"zlotys polacos (PLZ)","one":"zloty polaco (PLZ)"},"symbol":"PLZ","narrow":"PLZ"},"PTE":{"displayName":{"other":"escudos portugueses","one":"escudo portugués"},"symbol":"PTE","narrow":"PTE"},"PYG":{"displayName":{"other":"guaraníes paraguayos","one":"guaraní paraguayo"},"symbol":"PYG","narrow":"₲"},"QAR":{"displayName":{"other":"riales cataríes","one":"rial catarí"},"symbol":"QAR","narrow":"QAR"},"RHD":{"displayName":{"other":"dólar rodesiano"},"symbol":"RHD","narrow":"RHD"},"ROL":{"displayName":{"other":"antiguos lei rumanos","one":"antiguo leu rumano"},"symbol":"ROL","narrow":"ROL"},"RON":{"displayName":{"other":"lei rumanos","one":"leu rumano"},"symbol":"RON","narrow":"L"},"RSD":{"displayName":{"other":"dinares serbios","one":"dinar serbio"},"symbol":"RSD","narrow":"RSD"},"RUB":{"displayName":{"other":"rublos rusos","one":"rublo ruso"},"symbol":"RUB","narrow":"₽"},"RUR":{"displayName":{"other":"rublos rusos (RUR)","one":"rublo ruso (RUR)"},"symbol":"RUR","narrow":"р."},"RWF":{"displayName":{"other":"francos ruandeses","one":"franco ruandés"},"symbol":"RWF","narrow":"RF"},"SAR":{"displayName":{"other":"riales saudíes","one":"rial saudí"},"symbol":"SAR","narrow":"SAR"},"SBD":{"displayName":{"other":"dólares salomonenses","one":"dólar salomonense"},"symbol":"SBD","narrow":"$"},"SCR":{"displayName":{"other":"rupias seychellenses","one":"rupia seychellense"},"symbol":"SCR","narrow":"SCR"},"SDD":{"displayName":{"other":"dinares sudaneses","one":"dinar sudanés"},"symbol":"SDD","narrow":"SDD"},"SDG":{"displayName":{"other":"libras sudanesas","one":"libra sudanesa"},"symbol":"SDG","narrow":"SDG"},"SDP":{"displayName":{"other":"libras sudanesas antiguas","one":"libra sudanesa antigua"},"symbol":"SDP","narrow":"SDP"},"SEK":{"displayName":{"other":"coronas suecas","one":"corona sueca"},"symbol":"SEK","narrow":"kr"},"SGD":{"displayName":{"other":"dólares singapurenses","one":"dólar singapurense"},"symbol":"SGD","narrow":"$"},"SHP":{"displayName":{"other":"libras de Santa Elena","one":"libra de Santa Elena"},"symbol":"SHP","narrow":"£"},"SIT":{"displayName":{"other":"tólares eslovenos","one":"tólar esloveno"},"symbol":"SIT","narrow":"SIT"},"SKK":{"displayName":{"other":"coronas eslovacas","one":"corona eslovaca"},"symbol":"SKK","narrow":"SKK"},"SLL":{"displayName":{"other":"leonas","one":"leona"},"symbol":"SLL","narrow":"SLL"},"SOS":{"displayName":{"other":"chelines somalíes","one":"chelín somalí"},"symbol":"SOS","narrow":"SOS"},"SRD":{"displayName":{"other":"dólares surinameses","one":"dólar surinamés"},"symbol":"SRD","narrow":"$"},"SRG":{"displayName":{"other":"florín surinamés"},"symbol":"SRG","narrow":"SRG"},"SSP":{"displayName":{"other":"libras sursudanesas","one":"libra sursudanesa"},"symbol":"SSP","narrow":"SD£"},"STD":{"displayName":{"other":"dobras (1977–2017)","one":"dobra (1977–2017)"},"symbol":"STD","narrow":"STD"},"STN":{"displayName":{"other":"dobras","one":"dobra"},"symbol":"STN","narrow":"Db"},"SUR":{"displayName":{"other":"rublos soviéticos","one":"rublo soviético"},"symbol":"SUR","narrow":"SUR"},"SVC":{"displayName":{"other":"colones salvadoreños","one":"colón salvadoreño"},"symbol":"SVC","narrow":"SVC"},"SYP":{"displayName":{"other":"libras sirias","one":"libra siria"},"symbol":"SYP","narrow":"S£"},"SZL":{"displayName":{"other":"lilangenis","one":"lilangeni"},"symbol":"SZL","narrow":"SZL"},"THB":{"displayName":{"other":"bahts tailandeses","one":"baht tailandes"},"symbol":"THB","narrow":"฿"},"TJR":{"displayName":{"other":"rublo tayiko"},"symbol":"TJR","narrow":"TJR"},"TJS":{"displayName":{"other":"somonis tayikos","one":"somoni tayiko"},"symbol":"TJS","narrow":"TJS"},"TMM":{"displayName":{"other":"manats turcomanos (1993–2009)","one":"manat turcomano (1993–2009)"},"symbol":"TMM","narrow":"TMM"},"TMT":{"displayName":{"other":"manat turcomanos","one":"manat turcomano"},"symbol":"TMT","narrow":"TMT"},"TND":{"displayName":{"other":"dinares tunecinos","one":"dinar tunecino"},"symbol":"TND","narrow":"TND"},"TOP":{"displayName":{"other":"paangas","one":"paanga"},"symbol":"TOP","narrow":"T$"},"TPE":{"displayName":{"other":"escudo timorense"},"symbol":"TPE","narrow":"TPE"},"TRL":{"displayName":{"other":"liras turcas (1922–2005)","one":"lira turca (1922–2005)"},"symbol":"TRL","narrow":"TRL"},"TRY":{"displayName":{"other":"liras turcas","one":"lira turca"},"symbol":"TRY","narrow":"₺"},"TTD":{"displayName":{"other":"dólares de Trinidad y Tobago","one":"dólar de Trinidad y Tobago"},"symbol":"TTD","narrow":"$"},"TWD":{"displayName":{"other":"nuevos dólares taiwaneses","one":"nuevo dólar taiwanés"},"symbol":"TWD","narrow":"NT$"},"TZS":{"displayName":{"other":"chelines tanzanos","one":"chelín tanzano"},"symbol":"TZS","narrow":"TZS"},"UAH":{"displayName":{"other":"grivnas","one":"grivna"},"symbol":"UAH","narrow":"₴"},"UAK":{"displayName":{"other":"karbovanets ucranianos","one":"karbovanet ucraniano"},"symbol":"UAK","narrow":"UAK"},"UGS":{"displayName":{"other":"chelín ugandés (1966–1987)"},"symbol":"UGS","narrow":"UGS"},"UGX":{"displayName":{"other":"chelines ugandeses","one":"chelín ugandés"},"symbol":"UGX","narrow":"UGX"},"USD":{"displayName":{"other":"dólares estadounidenses","one":"dólar estadounidense"},"symbol":"US$","narrow":"$"},"USN":{"displayName":{"other":"dólares estadounidenses (día siguiente)","one":"dólar estadounidense (día siguiente)"},"symbol":"USN","narrow":"USN"},"USS":{"displayName":{"other":"dólares estadounidenses (mismo día)","one":"dólar estadounidense (mismo día)"},"symbol":"USS","narrow":"USS"},"UYI":{"displayName":{"other":"pesos uruguayos en unidades indexadas","one":"peso uruguayo en unidades indexadas"},"symbol":"UYI","narrow":"UYI"},"UYP":{"displayName":{"other":"pesos uruguayos (UYP)","one":"peso uruguayo (UYP)"},"symbol":"UYP","narrow":"UYP"},"UYU":{"displayName":{"other":"pesos uruguayos","one":"peso uruguayo"},"symbol":"UYU","narrow":"$"},"UYW":{"displayName":{"other":"unidades previsionales uruguayos","one":"unidad previsional uruguayo"},"symbol":"UYW","narrow":"UYW"},"UZS":{"displayName":{"other":"soms uzbekos","one":"som uzbeko"},"symbol":"UZS","narrow":"UZS"},"VEB":{"displayName":{"other":"bolívares venezolanos (1871–2008)","one":"bolívar venezolano (1871–2008)"},"symbol":"VEB","narrow":"VEB"},"VEF":{"displayName":{"other":"bolívares venezolanos (2008–2018)","one":"bolívar venezolano (2008–2018)"},"symbol":"VEF","narrow":"BsF"},"VES":{"displayName":{"other":"bolívares venezolanos","one":"bolívar venezolano"},"symbol":"VES","narrow":"VES"},"VND":{"displayName":{"other":"dongs","one":"dong"},"symbol":"VND","narrow":"₫"},"VNN":{"displayName":{"other":"VNN"},"symbol":"VNN","narrow":"VNN"},"VUV":{"displayName":{"other":"vatus","one":"vatu"},"symbol":"VUV","narrow":"VUV"},"WST":{"displayName":{"other":"talas","one":"tala"},"symbol":"WST","narrow":"WST"},"XAF":{"displayName":{"other":"francos CFA de África Central","one":"franco CFA de África Central"},"symbol":"XAF","narrow":"XAF"},"XAG":{"displayName":{"other":"plata"},"symbol":"XAG","narrow":"XAG"},"XAU":{"displayName":{"other":"oro"},"symbol":"XAU","narrow":"XAU"},"XBA":{"displayName":{"other":"unidades compuestas europeas","one":"unidad compuesta europea"},"symbol":"XBA","narrow":"XBA"},"XBB":{"displayName":{"other":"unidades monetarias europeas","one":"unidad monetaria europea"},"symbol":"XBB","narrow":"XBB"},"XBC":{"displayName":{"other":"unidades de cuenta europeas (XBC)","one":"unidad de cuenta europea (XBC)"},"symbol":"XBC","narrow":"XBC"},"XBD":{"displayName":{"other":"unidades de cuenta europeas (XBD)","one":"unidad de cuenta europea (XBD)"},"symbol":"XBD","narrow":"XBD"},"XCD":{"displayName":{"other":"dólares del Caribe Oriental","one":"dólar del Caribe Oriental"},"symbol":"XCD","narrow":"$"},"XDR":{"displayName":{"other":"derechos especiales de giro"},"symbol":"XDR","narrow":"XDR"},"XEU":{"displayName":{"other":"unidades de moneda europeas","one":"unidad de moneda europea"},"symbol":"XEU","narrow":"XEU"},"XFO":{"displayName":{"other":"francos oro franceses","one":"franco oro francés"},"symbol":"XFO","narrow":"XFO"},"XFU":{"displayName":{"other":"francos UIC franceses","one":"franco UIC francés"},"symbol":"XFU","narrow":"XFU"},"XOF":{"displayName":{"other":"francos CFA de África Occidental","one":"franco CFA de África Occidental"},"symbol":"XOF","narrow":"XOF"},"XPD":{"displayName":{"other":"paladio"},"symbol":"XPD","narrow":"XPD"},"XPF":{"displayName":{"other":"francos CFP","one":"franco CFP"},"symbol":"CFPF","narrow":"CFPF"},"XPT":{"displayName":{"other":"platino"},"symbol":"XPT","narrow":"XPT"},"XRE":{"displayName":{"other":"fondos RINET"},"symbol":"XRE","narrow":"XRE"},"XSU":{"displayName":{"other":"XSU"},"symbol":"XSU","narrow":"XSU"},"XTS":{"displayName":{"other":"código reservado para pruebas"},"symbol":"XTS","narrow":"XTS"},"XUA":{"displayName":{"other":"XUA"},"symbol":"XUA","narrow":"XUA"},"XXX":{"displayName":{"other":"(moneda desconocida)","one":"(unidad de moneda desconocida)"},"symbol":"¤","narrow":"¤"},"YDD":{"displayName":{"other":"dinar yemení"},"symbol":"YDD","narrow":"YDD"},"YER":{"displayName":{"other":"riales yemeníes","one":"rial yemení"},"symbol":"YER","narrow":"YER"},"YUD":{"displayName":{"other":"dinar fuerte yugoslavo"},"symbol":"YUD","narrow":"YUD"},"YUM":{"displayName":{"other":"super dinar yugoslavo"},"symbol":"YUM","narrow":"YUM"},"YUN":{"displayName":{"other":"dinares convertibles yugoslavos","one":"dinar convertible yugoslavo"},"symbol":"YUN","narrow":"YUN"},"YUR":{"displayName":{"other":"YUR"},"symbol":"YUR","narrow":"YUR"},"ZAL":{"displayName":{"other":"rand sudafricano (financiero)"},"symbol":"ZAL","narrow":"ZAL"},"ZAR":{"displayName":{"other":"rands","one":"rand"},"symbol":"ZAR","narrow":"R"},"ZMK":{"displayName":{"other":"kwachas zambianos (1968–2012)","one":"kwacha zambiano (1968–2012)"},"symbol":"ZMK","narrow":"ZMK"},"ZMW":{"displayName":{"other":"kuachas zambianos","one":"kuacha zambiano"},"symbol":"ZMW","narrow":"ZK"},"ZRN":{"displayName":{"other":"nuevo zaire zaireño"},"symbol":"ZRN","narrow":"ZRN"},"ZRZ":{"displayName":{"other":"zaire zaireño"},"symbol":"ZRZ","narrow":"ZRZ"},"ZWD":{"displayName":{"other":"dólar de Zimbabue"},"symbol":"ZWD","narrow":"ZWD"},"ZWL":{"displayName":{"other":"dólar zimbabuense"},"symbol":"ZWL","narrow":"ZWL"},"ZWR":{"displayName":{"other":"ZWR"},"symbol":"ZWR","narrow":"ZWR"}},"numbers":{"nu":["latn"],"symbols":{"latn":{"decimal":",","group":".","list":";","percentSign":"%","plusSign":"+","minusSign":"-","exponential":"E","superscriptingExponent":"×","perMille":"‰","infinity":"∞","nan":"NaN","timeSeparator":":"}},"percent":{"latn":"#,##0 %"},"decimal":{"latn":{"standard":"#,##0.###","long":{"1000":{"other":"0 mil"},"10000":{"other":"00 mil"},"100000":{"other":"000 mil"},"1000000":{"other":"0 millones","one":"0 millón"},"10000000":{"other":"00 millones"},"100000000":{"other":"000 millones"},"1000000000":{"other":"0 mil millones"},"10000000000":{"other":"00 mil millones"},"100000000000":{"other":"000 mil millones"},"1000000000000":{"other":"0 billón"},"10000000000000":{"other":"00 billones"},"100000000000000":{"other":"000 billones"}},"short":{"1000":{"other":"0 K"},"10000":{"other":"00 k"},"100000":{"other":"000 k"},"1000000":{"other":"0 M"},"10000000":{"other":"00 M"},"100000000":{"other":"000 M"},"1000000000":{"other":"0000 M"},"10000000000":{"other":"00 mil M"},"100000000000":{"other":"000 mil M"},"1000000000000":{"other":"0 B"},"10000000000000":{"other":"00 B"},"100000000000000":{"other":"000 B"}}}},"currency":{"latn":{"currencySpacing":{"beforeInsertBetween":" ","afterInsertBetween":" "},"standard":"¤ #,##0.00","accounting":"¤#,##0.00","unitPattern":"{0} {1}","short":{"1000":{"other":"¤0 K"},"10000":{"other":"¤00 K"},"100000":{"other":"¤000 K"},"1000000":{"other":"¤0 M"},"10000000":{"other":"¤00 M"},"100000000":{"other":"¤000 M"},"1000000000":{"other":"¤0000 M"},"10000000000":{"other":"¤00 MRD"},"100000000000":{"other":"¤000 MRD"},"1000000000000":{"other":"¤0 B"},"10000000000000":{"other":"¤00 B"},"100000000000000":{"other":"¤000 B"}}}}},"nu":["latn"]}},"availableLocales":["es-CO"]}
)
}
|
"use strict";
exports.__esModule = true;
exports.FormNext = void 0;
var _react = _interopRequireDefault(require("react"));
var _StyledIcon = require("../StyledIcon");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var FormNext = function FormNext(props) {
return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
viewBox: "0 0 24 24",
a11yTitle: "FormNext"
}, props), _react["default"].createElement("polyline", {
fill: "none",
stroke: "#000",
strokeWidth: "2",
points: "9 6 15 12 9 18"
}));
};
exports.FormNext = FormNext;
|
var NAVTREEINDEX1 =
{
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#a9612886859ce095984cc3e36cf960afa":[1,0,0,0,0,3,1,8],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#a97e5908970ea5986824d8876cf009b22":[1,0,0,0,0,3,1,1],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#aaeeb880ab20c8551f495a9512a97897b":[1,0,0,0,0,3,1,26],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#ab8df253b4b2a78001b72f85910a5cf3d":[1,0,0,0,0,3,1,15],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#ac74a15339cf15b1cd30849a59a5dcbb4":[1,0,0,0,0,3,1,13],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#acd2c56060084e5f5afc89dea75754285":[1,0,0,0,0,3,1,25],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#ad79dcc9e334fd1bdd3a6808ca5d9fc91":[1,0,0,0,0,3,1,0],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#adcd16084608ff29a016dcc956747efbf":[1,0,0,0,0,3,1,22],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#af29f5939d1a8a854296248342ec3c263":[1,0,0,0,0,3,1,20],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#af30623552d46220699b27bd5def35a7e":[1,0,0,0,0,3,1,6],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#af75af44cf231fff982390b92ebba8083":[1,0,0,0,0,3,1,10],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#afbe839467fcb114d4a3cdaefbb6b6ba1":[1,0,0,0,0,3,1,14],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_built_in_exceptions.html#aff519bcdfac7c26aa2f2b701b833241c":[1,0,0,0,0,3,1,4],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html":[1,0,0,0,0,3,3],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#a0533f50bc1d5eeda3af6913da4780929":[1,0,0,0,0,3,3,9],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#a0ef311e3cfcbe40813feb685acff3c54":[1,0,0,0,0,3,3,7],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#a39ffbaee578c519162828b2ed7586336":[1,0,0,0,0,3,3,3],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#a5234b1fa9ca65dcd5fd7cf8ea3956286":[1,0,0,0,0,3,3,4],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#a6268b54e987b3177a4e2145b182c7082":[1,0,0,0,0,3,3,6],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#a64b49f9ec3d0a52cef26d1c14b11f2f6":[1,0,0,0,0,3,3,0],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#a825a29ebe51c76fb3f5f34019179a0bf":[1,0,0,0,0,3,3,2],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#a89e2e8f3de9caeafeb13f66b6f63a714":[1,0,0,0,0,3,3,10],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#aba256380915e0f1d55a69c8e259315d8":[1,0,0,0,0,3,3,5],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#ad0f2e309b475b9b9125be5ad4d8c179a":[1,0,0,0,0,3,3,8],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_command_syntax_exception.html#aee7facb76b51238f711351ba3c4dd781":[1,0,0,0,0,3,3,1],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic2_command_exception_type.html":[1,0,0,0,0,3,4],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic2_command_exception_type.html#a3865c874f3ea23fb7c5d346f9a00d0de":[1,0,0,0,0,3,4,2],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic2_command_exception_type.html#aa244c8f8d83446e789a3902e495a3bda":[1,0,0,0,0,3,4,3],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic2_command_exception_type.html#af377c1d95080a6266f2107c990e964c1":[1,0,0,0,0,3,4,1],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic3_command_exception_type.html":[1,0,0,0,0,3,5],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic3_command_exception_type.html#a4f6ff8dc99fae2255ee636dc7c967c25":[1,0,0,0,0,3,5,3],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic3_command_exception_type.html#a5996c468f00415ad9295b53eab263968":[1,0,0,0,0,3,5,2],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic3_command_exception_type.html#ad7e72bdf46d89fef13ad9f7d5bea7c67":[1,0,0,0,0,3,5,1],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic4_command_exception_type.html":[1,0,0,0,0,3,6],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic4_command_exception_type.html#a18e871b04bee82edeaf3981492f23c1d":[1,0,0,0,0,3,6,1],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic4_command_exception_type.html#a51ff8bad7a1e8b8ab48bb624546eeeea":[1,0,0,0,0,3,6,2],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic4_command_exception_type.html#ab4f5c1d745391fa4df66388e3ae50b5f":[1,0,0,0,0,3,6,3],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic_command_exception_type.html":[1,0,0,0,0,3,7],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic_command_exception_type.html#a0d6e16174caebb68a735c7faf880587c":[1,0,0,0,0,3,7,2],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic_command_exception_type.html#aba47106c5aebba0a1ff8149ccda4d476":[1,0,0,0,0,3,7,1],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic_command_exception_type.html#ae8b06a489d458c0380d2364529fd6916":[1,0,0,0,0,3,7,0],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic_n_command_exception_type.html":[1,0,0,0,0,3,8],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic_n_command_exception_type.html#a22997d3f9b323fdad6738172a12eae28":[1,0,0,0,0,3,8,1],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic_n_command_exception_type.html#a340bc32e899317cf1b1d1851b953ac54":[1,0,0,0,0,3,8,2],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_dynamic_n_command_exception_type.html#ad2cbc4348b90fc2757b8fbca82880a3f":[1,0,0,0,0,3,8,3],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_simple_command_exception_type.html":[1,0,0,0,0,3,9],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_simple_command_exception_type.html#a1468b6f2d3220a731da3dca57c9a0bfd":[1,0,0,0,0,3,9,0],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_simple_command_exception_type.html#a454fffd6293dd55fcc51442f6c2e46a7":[1,0,0,0,0,3,9,1],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_simple_command_exception_type.html#a9713c519e4542e7860513cd3598614b5":[1,0,0,0,0,3,9,3],
"classcom_1_1mojang_1_1brigadier_1_1exceptions_1_1_simple_command_exception_type.html#aaebc2d965e515b35e6a127d32afe735c":[1,0,0,0,0,3,9,2],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_integer_suggestion.html":[1,0,0,0,0,4,0],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_integer_suggestion.html#a45e747d2f95b42831613df04a173255b":[1,0,0,0,0,4,0,6],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_integer_suggestion.html#a472a485afb14d38783085d7a72317d70":[1,0,0,0,0,4,0,4],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_integer_suggestion.html#a81b444850586a0170ded5b01c46be4c7":[1,0,0,0,0,4,0,1],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_integer_suggestion.html#ad7fa07a618e2eed8489e504ed4766fbd":[1,0,0,0,0,4,0,7],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_integer_suggestion.html#adc8e485e3cbc88d5a669c6bb207e5efd":[1,0,0,0,0,4,0,2],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_integer_suggestion.html#af37ff0f2b520ad2178644a1e7cb8ab2c":[1,0,0,0,0,4,0,3],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_integer_suggestion.html#af40ed3242d8d1a5e510b321570157e28":[1,0,0,0,0,4,0,5],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_integer_suggestion.html#af6133b9d9befafbf87493269a78df792":[1,0,0,0,0,4,0,0],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html":[1,0,0,0,0,4,1],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#a01575cad29a8c32a269a692ead5f1961":[1,0,0,0,0,4,1,1],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#a13506a971d067ec70de55c6c16dd2d7a":[1,0,0,0,0,4,1,2],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#a6626519f81e6aabb0746a701fea245c5":[1,0,0,0,0,4,1,4],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#a6c29fc347ad568a456c7b9c2e3d2f068":[1,0,0,0,0,4,1,6],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#a7310bd6a0529b1d9c78a1b3b19a5f3ff":[1,0,0,0,0,4,1,3],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#a9c3591715af023142d4fa1c23e3c7df3":[1,0,0,0,0,4,1,5],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#aaa647175743d13c84390a49d6b2ef49c":[1,0,0,0,0,4,1,0],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#ac79afc2654c177efbf531575aca78eef":[1,0,0,0,0,4,1,7],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#ac8ac4133e880bcfbf152fe489d81e320":[1,0,0,0,0,4,1,10],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#ae688951525965e9b59d9d85230add6dd":[1,0,0,0,0,4,1,9],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#aec61be3c1c8fb6191f72f3e6d48ac029":[1,0,0,0,0,4,1,11],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestion.html#af806790efee7ea3ce16fa892c416b63c":[1,0,0,0,0,4,1,8],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html":[1,0,0,0,0,4,3],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#a011bfcc0a4c5c43cca9f4393c8be6821":[1,0,0,0,0,4,3,6],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#a2e8df714a143d64daa4801af2d436a6c":[1,0,0,0,0,4,3,2],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#a463e22736e119294b97361673ad8c593":[1,0,0,0,0,4,3,4],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#a5c6689607e152ec13d94b8ece354e380":[1,0,0,0,0,4,3,1],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#a8b42970c9bcb836c7fbd856fa0b6a9b2":[1,0,0,0,0,4,3,3],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#a92e7c74ad0dd0c4f99ac0ec7eefa3eec":[1,0,0,0,0,4,3,5],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#aa09f939dbc91a33185bc4aee12d567de":[1,0,0,0,0,4,3,7],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#ac2637244d45b08458a9417d99df4116d":[1,0,0,0,0,4,3,9],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#ace6815dacc67fb529e6b4d63e6b0ee56":[1,0,0,0,0,4,3,8],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions.html#af4a47201c609d67417dadc33f2856e88":[1,0,0,0,0,4,3,0],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html":[1,0,0,0,0,4,4],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a1ba9fc5ed17e6079cf4bd84edf3b91a0":[1,0,0,0,0,4,4,5],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a50281ae316e3c01e918877ec21de1323":[1,0,0,0,0,4,4,4],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a51143c3d2decbb1d70de6abee83d4f89":[1,0,0,0,0,4,4,3],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a541fa4f4f29eef925a247fa3299153bc":[1,0,0,0,0,4,4,0],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a5dcbe7bac7777884baa631b44a572faa":[1,0,0,0,0,4,4,10],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a6c158ee32828d29688174233b6f6d9ee":[1,0,0,0,0,4,4,2],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a6f32248cd41f9566bad6dbcf50e7bddc":[1,0,0,0,0,4,4,8],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a7d3bff5e1525a9c31e14cc111bb88ecd":[1,0,0,0,0,4,4,7],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a8d01d687baf2ff05232372958153e48a":[1,0,0,0,0,4,4,9],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#a962e6bcbc2f6f2c802df5e01d9f3e220":[1,0,0,0,0,4,4,1],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#aaa7047fdf1e7e850dd7c564209f11621":[1,0,0,0,0,4,4,12],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#ac4143ce355db0157a60ce6189c94f06c":[1,0,0,0,0,4,4,11],
"classcom_1_1mojang_1_1brigadier_1_1suggestion_1_1_suggestions_builder.html#aed645546bcd4980ca3dd457da89374ee":[1,0,0,0,0,4,4,6],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html":[1,0,0,0,0,5,0],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a01bb560a325acdc270c25df44b014d73":[1,0,0,0,0,5,0,7],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a21b93f08b9ff8a45bb19cf48daf02738":[1,0,0,0,0,5,0,13],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a30759f0c3a54a07214b6559506b6b950":[1,0,0,0,0,5,0,2],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a35e975dc87c4589c4d4e3cb17e37fae2":[1,0,0,0,0,5,0,9],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a382c8b3a08276aab33ee9b2e7a2c3734":[1,0,0,0,0,5,0,10],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a513b5edad6d66a2458fc55fa5f544850":[1,0,0,0,0,5,0,11],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a52e44bf7cd1d3def8fec65c9596b52db":[1,0,0,0,0,5,0,8],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a61fb295a75d68adb63f2359e7fe389da":[1,0,0,0,0,5,0,1],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a646780f7b8e55ff55da354a5dffe9ffa":[1,0,0,0,0,5,0,5],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a6ec292c65dd154b0c6c74b97cfde64df":[1,0,0,0,0,5,0,4],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a7e698c584bcf28bd80f25a350eda1737":[1,0,0,0,0,5,0,12],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a80aafbe283624d22971d4fdaf086ebee":[1,0,0,0,0,5,0,3],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#a8ecc2fd08f412739d4c6348806ff0f22":[1,0,0,0,0,5,0,6],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_argument_command_node.html#ae274d0504e7be2135878672bf20fbdc8":[1,0,0,0,0,5,0,0],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html":[1,0,0,0,0,5,1],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a1eca3b41c3b1c776ef8bb3156130949b":[1,0,0,0,0,5,1,21],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a351de90d7eaac3fa329a0615a11dd348":[1,0,0,0,0,5,1,19],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a40869c0f87264413208ad1119f32f055":[1,0,0,0,0,5,1,0],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a56a9832082abca83e51b87cdc4f64e04":[1,0,0,0,0,5,1,22],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a699828668e970e477991208cd5e74634":[1,0,0,0,0,5,1,12],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a6ec0fc503cc0a62c6b3dbba12ef41c13":[1,0,0,0,0,5,1,13],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a720e0cfe35d5e7788f4636b73ea93fa4":[1,0,0,0,0,5,1,7],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a74c24a1bdba6f773f768e8f8d75dd654":[1,0,0,0,0,5,1,5],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a7d697d9f6d61686529499415e51031ea":[1,0,0,0,0,5,1,16],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a83f615ccea233eb9642e34a949256ef7":[1,0,0,0,0,5,1,4],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#a8a3cfe9177bf476996497c696f57b0e7":[1,0,0,0,0,5,1,14],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#aa7a6326938609854466d2320faacaac7":[1,0,0,0,0,5,1,3],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#aa9165f37a032b65528fcde6bb7f6f8d4":[1,0,0,0,0,5,1,11],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#ac4a6f9c8b501465217bd352d653d7539":[1,0,0,0,0,5,1,6],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#acd5f042039c8253a7007316c0eb3a618":[1,0,0,0,0,5,1,9],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#ace9e8fb3890f9639b0d6c1e159cdfb1a":[1,0,0,0,0,5,1,15],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#ad046050eed92f3560aaa7304dff72025":[1,0,0,0,0,5,1,1],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#ad542ff69983a03d8efe59e6fb530ce5f":[1,0,0,0,0,5,1,8],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#ad9c734606deaaf1da08aa1479a795153":[1,0,0,0,0,5,1,10],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#ada85bee27df90c95429503814db9fea7":[1,0,0,0,0,5,1,2],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#adb2365ae320b15fc6f6ef7840042c95f":[1,0,0,0,0,5,1,17],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#ae896e51d707e753851a6b1803c34f743":[1,0,0,0,0,5,1,18],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_command_node.html#af06cb38e7e526cff0f01d442a810bef9":[1,0,0,0,0,5,1,20],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html":[1,0,0,0,0,5,2],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#a1a93cf9aa54dac3fa53c21e65dae1efd":[1,0,0,0,0,5,2,3],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#a2274531613367c6fc6da0d9fab2d0148":[1,0,0,0,0,5,2,8],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#a39a44688ec12964b0545c7fc03f914cd":[1,0,0,0,0,5,2,10],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#a3d4eacfd45ef7891008c31e48b01f947":[1,0,0,0,0,5,2,1],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#a558533d7daf126da959fad70570bbeff":[1,0,0,0,0,5,2,11],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#a6279ab5fd31b17530a5bacf4ebc67372":[1,0,0,0,0,5,2,0],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#a6c92de1ff639d96ded00bef849af2bad":[1,0,0,0,0,5,2,4],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#a7362d58f0a7e4c49a9f13793fead0dfa":[1,0,0,0,0,5,2,6],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#acaf4a435a0d94b579fb9923f9c43329c":[1,0,0,0,0,5,2,5],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#ad45b037a1f6daf37b1a9ad1c99465704":[1,0,0,0,0,5,2,2],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#ad8177d526a56a07dcee997385f3e549a":[1,0,0,0,0,5,2,9],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#af432b760eb8ad4e49afa6f819d10c980":[1,0,0,0,0,5,2,12],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_literal_command_node.html#af6e97c5ce1331f96a1840f645eaf94f4":[1,0,0,0,0,5,2,7],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html":[1,0,0,0,0,5,3],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#a25f72a59078406ed93e8971e7cf8cc61":[1,0,0,0,0,5,3,8],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#a2f928d4935b753d22ed3e9abc7425e73":[1,0,0,0,0,5,3,9],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#a3992ae98f7d8a3d2a13d2e3acae96767":[1,0,0,0,0,5,3,1],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#a8ab82522ff7d270b82b5bf3362a74b6a":[1,0,0,0,0,5,3,0],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#a91e980b0d72dd5a1b2ab1506e92d87a6":[1,0,0,0,0,5,3,4],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#aa23fed25f5902814d8306012616b69f9":[1,0,0,0,0,5,3,7],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#aaa3c3f0942ddb5e64936dd1a46d4ef52":[1,0,0,0,0,5,3,6],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#acd3487d327422ab59fe62a3d8988a753":[1,0,0,0,0,5,3,5],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#aea803e0b19170e620624e0be31e73050":[1,0,0,0,0,5,3,3],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#af489a7b1e880c408c10d0738ea7ea933":[1,0,0,0,0,5,3,10],
"classcom_1_1mojang_1_1brigadier_1_1tree_1_1_root_command_node.html#af72819e66d4fefcd67f8f6f31868145d":[1,0,0,0,0,5,3,2],
"classdev_1_1jorel_1_1commandapi_1_1_brigadier.html":[1,0,1,0,0,5],
"classdev_1_1jorel_1_1commandapi_1_1_brigadier.html#a2933a6e94c391cfecf4b66bde5a71b2f":[1,0,1,0,0,5,4],
"classdev_1_1jorel_1_1commandapi_1_1_brigadier.html#a5ae09ba80b8efd0e748cb23527c6aceb":[1,0,1,0,0,5,1],
"classdev_1_1jorel_1_1commandapi_1_1_brigadier.html#a7816218443f565bed63ac6b49760371a":[1,0,1,0,0,5,7],
"classdev_1_1jorel_1_1commandapi_1_1_brigadier.html#a841d52013abd1e60e3d35bdeac181a5c":[1,0,1,0,0,5,5],
"classdev_1_1jorel_1_1commandapi_1_1_brigadier.html#ab72ddbae05f10e441453ca2b5803aa8a":[1,0,1,0,0,5,3],
"classdev_1_1jorel_1_1commandapi_1_1_brigadier.html#ae58271fd8274048d3f82b1acec598636":[1,0,1,0,0,5,2],
"classdev_1_1jorel_1_1commandapi_1_1_brigadier.html#aee61e8e704b8dc3bf99244f8cc42ad98":[1,0,1,0,0,5,0],
"classdev_1_1jorel_1_1commandapi_1_1_brigadier.html#afe49f5c6dced980b6e4a8a519b86e7bb":[1,0,1,0,0,5,6],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html":[1,0,1,0,0,6],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#a0fbec78135f7187645851ee4e12a74f3":[1,0,1,0,0,6,9],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#a10b6668a659eb55d995e450a07a41d05":[1,0,1,0,0,6,6],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#a386654d2b9a36d863263c6def5430845":[1,0,1,0,0,6,3],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#a492dcfa8422d9dee82d4afcac4646454":[1,0,1,0,0,6,0],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#a80ab6ea5bb0ee168e1b8ad7199b9af46":[1,0,1,0,0,6,2],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#a99b3b35daa96cb9781ead26a7729cd5e":[1,0,1,0,0,6,5],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#aba5625d16830784a80f5971915892173":[1,0,1,0,0,6,7],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#abaaeec30c996adb7a07999cbee39bfa7":[1,0,1,0,0,6,4],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#acea9f164361b1e4ec98520436685f591":[1,0,1,0,0,6,1],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#ad451a2cce6533da8ea8b25a20db0dd19":[1,0,1,0,0,6,10],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i.html#af80c6e832cee1fd3e8e7e5ef52f98fb5":[1,0,1,0,0,6,8],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html":[1,0,1,0,0,7],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a033601a13a33850155442c39c6437f67":[1,0,1,0,0,7,11],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a1420bbc4c0704fec184c77dfecdb07a3":[1,0,1,0,0,7,5],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a18c2bd5a4dd36b39bd49806579f1eced":[1,0,1,0,0,7,34],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a19269b7ad0a9a3c252d48d35bbe5a14f":[1,0,1,0,0,7,37],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a1cba278fc6461a025fc632b09d32c8cc":[1,0,1,0,0,7,21],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a1f9b85df336213b1b3c343985615b708":[1,0,1,0,0,7,3],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a2c22694dfd827d0183f21692a3322bde":[1,0,1,0,0,7,2],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a2c37999d136ec5ef56eb1549c133e393":[1,0,1,0,0,7,36],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a2fc1456d2c70c38c9153bf689ef5033e":[1,0,1,0,0,7,25],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a32eb9837cdd5d0aedc0d931301311958":[1,0,1,0,0,7,15],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a3531dbfd340f8194c89574ea5fee106f":[1,0,1,0,0,7,12],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a3d305f937aee495e95a387de0787e297":[1,0,1,0,0,7,18],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a4964121c94c4786ecb26e45b13f1ca78":[1,0,1,0,0,7,30],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a4fbefdb297567ab226da9e11642f9a08":[1,0,1,0,0,7,22],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a5231b4dae198d8954befc95bea391e55":[1,0,1,0,0,7,32],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a52e20728e6560f3f933d78f1328ee1fa":[1,0,1,0,0,7,17],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a56fd6c1a70cbcecdc0fcb8c58fd79150":[1,0,1,0,0,7,23],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a5cbaf45347d32ee2ac76fbcd24ab5470":[1,0,1,0,0,7,14],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a6430d473e2e743fa2410e700e5decad0":[1,0,1,0,0,7,0],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a65b8521ebeb5458da320f3d51e389e39":[1,0,1,0,0,7,24],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a7400574193ea9eb73e1d3d43b52dad37":[1,0,1,0,0,7,28],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a77a998fb100b2c0f566a940c76b37b80":[1,0,1,0,0,7,7],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a85bb6e227a1d1d201548c19e8dffc94a":[1,0,1,0,0,7,10],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a8bd559b3ede4461f6de92d448e3acf7b":[1,0,1,0,0,7,6],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a8df57e3ec273deddd1bfddc5035ddb75":[1,0,1,0,0,7,9],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#a93b02402bc3c84af5f523cb620c17447":[1,0,1,0,0,7,19],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#aab54379b8326bdcc0d82a558ee3089fa":[1,0,1,0,0,7,1],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#ab427d7a54c012243de232d1219b6b3fa":[1,0,1,0,0,7,8],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#ab61d5a85cad1aa649490afae0fd31d47":[1,0,1,0,0,7,27],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#ab8797e088e5674ec769b76e089ee6ed8":[1,0,1,0,0,7,33],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#ac74ce78dbe30d5dd4c95c241e950b05d":[1,0,1,0,0,7,4],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#ad0b8b38fb5fd66c24e34861869b6a8f0":[1,0,1,0,0,7,31],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#ad373c8c5eb7377e71ee34207ff262ff8":[1,0,1,0,0,7,13],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#ad8cde78c7184574b0f77135a20f23857":[1,0,1,0,0,7,16],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#ae5a4bf1048697f05ab049a7875b95538":[1,0,1,0,0,7,35],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#ae96b5e2ad2f71bc1cdd15ca223095919":[1,0,1,0,0,7,38],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#aee7e8be51b146b2d3bac68612684bb8c":[1,0,1,0,0,7,26],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#aef2bbaaef06330e8bafbb5424cbfd6d9":[1,0,1,0,0,7,29],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_command.html#af10331d0d959e2e6c01d9af81e2f6f61":[1,0,1,0,0,7,20],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_handler.html":[1,0,1,0,0,8],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_handler.html#a2bd4e2c6f39c28e0ff581b9364a1aa01":[1,0,1,0,0,8,2],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_handler.html#a8f21a4e8fec1297ff259df57e01265e6":[1,0,1,0,0,8,1],
"classdev_1_1jorel_1_1commandapi_1_1_command_a_p_i_handler.html#af97b5fe94c3644242586c62d144a0455":[1,0,1,0,0,8,0],
"classdev_1_1jorel_1_1commandapi_1_1_command_permission.html":[1,0,1,0,0,9],
"classdev_1_1jorel_1_1commandapi_1_1_command_permission.html#a06ad29ef4670e4d520ae4f2bb452b2ba":[1,0,1,0,0,9,4],
"classdev_1_1jorel_1_1commandapi_1_1_command_permission.html#a23e33384d0a953e0b44799f6d5f1c34b":[1,0,1,0,0,9,1],
"classdev_1_1jorel_1_1commandapi_1_1_command_permission.html#a52b96b0e42edef36463700e626d0ce20":[1,0,1,0,0,9,2],
"classdev_1_1jorel_1_1commandapi_1_1_command_permission.html#aae111c318e46d67d06b2613fc642da2b":[1,0,1,0,0,9,3],
"classdev_1_1jorel_1_1commandapi_1_1_command_permission.html#ac2dd9b644e4bf1477d7bab7fdd3512ab":[1,0,1,0,0,9,0],
"classdev_1_1jorel_1_1commandapi_1_1_converter.html":[1,0,1,0,0,10],
"classdev_1_1jorel_1_1commandapi_1_1_converter.html#a55bcd57c4152d5e4734ca37cce6abfba":[1,0,1,0,0,10,0],
"classdev_1_1jorel_1_1commandapi_1_1_converter.html#a60b8acab9e4e3ab362253dc17d99126f":[1,0,1,0,0,10,2],
"classdev_1_1jorel_1_1commandapi_1_1_converter.html#a969a754d618725c3a4dc98a8a13ed7b9":[1,0,1,0,0,10,3],
"classdev_1_1jorel_1_1commandapi_1_1_converter.html#af173562630c14caa18c08ff864241b55":[1,0,1,0,0,10,1],
"classdev_1_1jorel_1_1commandapi_1_1_string_tooltip.html":[1,0,1,0,0,12],
"classdev_1_1jorel_1_1commandapi_1_1_string_tooltip.html#a1183715f87c70def147d25e33bad16e0":[1,0,1,0,0,12,3],
"classdev_1_1jorel_1_1commandapi_1_1_string_tooltip.html#a561e104ee768ac9c672227188aa738c8":[1,0,1,0,0,12,2],
"classdev_1_1jorel_1_1commandapi_1_1_string_tooltip.html#a6189f95a0967d30c2a0b5f97549cc871":[1,0,1,0,0,12,1],
"classdev_1_1jorel_1_1commandapi_1_1_string_tooltip.html#ae0357c216f882cb438aefb2abbaa9ef8":[1,0,1,0,0,12,0],
"classdev_1_1jorel_1_1commandapi_1_1_tooltip.html":[1,0,1,0,0,13],
"classdev_1_1jorel_1_1commandapi_1_1_tooltip.html#a13d427aedb1d7cfa373643e50c25dbbd":[1,0,1,0,0,13,2],
"classdev_1_1jorel_1_1commandapi_1_1_tooltip.html#a2accbbb3fa1e1a33960d5e81587db210":[1,0,1,0,0,13,1],
"classdev_1_1jorel_1_1commandapi_1_1_tooltip.html#ad4152218f2942896639d125a26383b42":[1,0,1,0,0,13,3],
"classdev_1_1jorel_1_1commandapi_1_1_tooltip.html#afcb296987c41c438fac52733e5795796":[1,0,1,0,0,13,0],
"classdev_1_1jorel_1_1commandapi_1_1annotations_1_1_annotations.html":[1,0,1,0,0,0,2],
"classdev_1_1jorel_1_1commandapi_1_1annotations_1_1_annotations.html#a1da5c40ea3bfdbd7d6f5ab53d204b08e":[1,0,1,0,0,0,2,1]
};
|
import React, { useContext } from 'react';
import { Route, Redirect } from 'react-router-dom';
import UserContext from '../Contexts/userContext';
export const PrivateRoute = ({component: Component, ...rest}) => {
const UserData = useContext(UserContext)
return (
<Route {...rest} render={props => (
UserData.isUserLogedIn ?
<Component {...props} />
: <Redirect to="/login" />
)} />
);
};
export const PublicRoute = ({component: Component, restricted, ...rest}) => {
const UserData = useContext(UserContext)
return (
<Route {...rest} render={props => (
UserData.isUserLogedIn && restricted ?
<Redirect to="/" />
: <Component {...props} />
)} />
);
};
|
'use strict'
const userNameInput = document.getElementById('user-name');
const assessmentButton=document.getElementById('assessment');
const resultDivided=document.getElementById('result-area');
const tweetDivided=document.getElementById('tweet-area');
/**
* remove all child element of specified parent one
* @param {HTMLElement} element Htmlの要素
*/
function removeAllChildren(element){
while(element.firstChild){
// unless child element exists, remove it
element.removeChild(element.firstChild);
}
}
userNameInput.onkeydown = (event) => {
if (event.key === 'Enter') {
// TODO ボタンのonclick() 処理を呼び出す
assessmentButton.onclick();
}
};
assessmentButton.onclick = function buttonOnClick(){
const userName=userNameInput.value;
// End process when input name is null
if(userName.length===0){
return;
}
// to do create result-area
removeAllChildren(resultDivided);
const header=document.createElement('h3');
header.innerText='result';
resultDivided.appendChild(header);
const paragraph=document.createElement('p')
const result=assessment(userName);
paragraph.innerText=result;
resultDivided.appendChild(paragraph);
// to do create tweet-area
removeAllChildren(tweetDivided);
const anchor=document.createElement('a');
const hrefValue='https://twitter.com/intent/tweet?button_hashtag='
// クエリが日本語だった場合URIエンコードが必要
+ encodeURIComponent('yourGoodAssessment') + '&ref_src=twsrc%5Etfw';
anchor.setAttribute('href',hrefValue);
anchor.className='twitter-hashtag-button';
anchor.setAttribute('data-text', result);
anchor.innerText='Tweet #yourGoodAssessment';
tweetDivided.appendChild(anchor);
const srcValue='https://platform.twitter.com/widgets.js';
const script=document.createElement('script');
script.setAttribute('src',srcValue);
tweetDivided.appendChild(script);
}
const answers=[
'{userName}のいいところは声です。{userName}の特徴的な声は皆を惹きつけ、心に残ります。',
'{userName}のいいところはまなざしです。{userName}に見つめられた人は、気になって仕方がないでしょう。',
'{userName}のいいところは情熱です。{userName}の情熱に周りの人は感化されます。',
'{userName}のいいところは厳しさです。{userName}の厳しさがものごとをいつも成功に導きます。',
'{userName}のいいところは知識です。博識な{userName}を多くの人が頼りにしています。',
'{userName}のいいところはユニークさです。{userName}だけのその特徴が皆を楽しくさせます。',
'{userName}のいいところは用心深さです。{userName}の洞察に、多くの人が助けられます。',
'{userName}のいいところは見た目です。内側から溢れ出る{userName}の良さに皆が気を惹かれます。',
'{userName}のいいところは決断力です。{userName}がする決断にいつも助けられる人がいます。',
'{userName}のいいところは思いやりです。{userName}に気をかけてもらった多くの人が感謝しています。',
'{userName}のいいところは感受性です。{userName}が感じたことに皆が共感し、わかりあうことができます。',
'{userName}のいいところは節度です。強引すぎない{userName}の考えに皆が感謝しています。',
'{userName}のいいところは好奇心です。新しいことに向かっていく{userName}の心構えが多くの人に魅力的に映ります。',
'{userName}のいいところは気配りです。{userName}の配慮が多くの人を救っています。',
'{userName}のいいところはその全てです。ありのままの{userName}自身がいいところなのです。',
'{userName}のいいところは自制心です。やばいと思ったときにしっかりと衝動を抑えられる{userName}が皆から評価されています。',
'{userName}のいいところは優しさです。あなたの優しい雰囲気や立ち振る舞いに多くの人が癒やされています。'
];
/**
* 名前の文字列を渡すと診断結果を返す関数
* @param{string}userName ユーザーの名前
* @return {string}診断結果
*/
function assessment(userName){
//to do 診断結果処理を実装する
let sumOfCharCode=0;
for(let i=0; i<userName.length; i++){
sumOfCharCode=sumOfCharCode + userName.charCodeAt(i);
}
const index=sumOfCharCode % answers.length;
let result=answers[index];
result = result.replace(/\{userName\}/g, userName);
return result;
}
// console.log(assessment('abc'));
// console.log(assessment('def'));
// console.log(assessment('abc'));
// テストコード
console.assert(
assessment('abc') === assessment('abc'),
'入力が同じ名前なら同じ診断結果を出力する処理が正しくありません'
);
|
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
// Workaround for allowing target="_blank" in HTML sanitizer
// see https://code.google.com/p/google-caja/issues/detail?can=2&q=&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary&groupby=&sort=&id=1296
if (typeof html4 !== 'undefined') {
html4.ATTRIBS['a::target'] = 0;
html4.ATTRIBS['source::src'] = 0;
html4.ATTRIBS['video::src'] = 0;
// Would be nice for tooltips but probably a security risk...
//html4.ATTRIBS["video::autoplay"] = 0;
//html4.ATTRIBS["video::autobuffer"] = 0;
}
// Shim for missing toISOString in older versions of IE
// See https://stackoverflow.com/questions/12907862
if (!Date.prototype.toISOString) {
(function () {
function pad(number) {
var r = String(number);
if (r.length === 1) {
r = '0' + r;
}
return r;
};
Date.prototype.toISOString = function () {
return this.getUTCFullYear()
+ '-' + pad(this.getUTCMonth() + 1)
+ '-' + pad(this.getUTCDate())
+ 'T' + pad(this.getUTCHours())
+ ':' + pad(this.getUTCMinutes())
+ ':' + pad(this.getUTCSeconds())
+ '.' + String((this.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
+ 'Z';
};
}());
}
// Shim for Date.now()
if (!Date.now) {
Date.now = function () {
return new Date().getTime();
};
}
// Changes default colors
/**
* Measurements Units
*/
mxConstants.POINTS = 1;
mxConstants.MILLIMETERS = 2;
mxConstants.INCHES = 3;
/**
* This ratio is with page scale 1
*/
mxConstants.PIXELS_PER_MM = 3.937;
mxConstants.PIXELS_PER_INCH = 100;
mxConstants.SHADOW_OPACITY = 0.25;
mxConstants.SHADOWCOLOR = '#000000';
mxConstants.VML_SHADOWCOLOR = '#d0d0d0';
mxGraph.prototype.pageBreakColor = '#c0c0c0';
mxGraph.prototype.pageScale = 1;
// Letter page format is default in US, Canada and Mexico
(function () {
try {
if (navigator != null && navigator.language != null) {
var lang = navigator.language.toLowerCase();
mxGraph.prototype.pageFormat = (lang === 'en-us' || lang === 'en-ca' || lang === 'es-mx') ?
mxConstants.PAGE_FORMAT_LETTER_PORTRAIT : mxConstants.PAGE_FORMAT_A4_PORTRAIT;
}
} catch (e) {
// ignore
}
})();
// Matches label positions of mxGraph 1.x
mxText.prototype.baseSpacingTop = 5;
mxText.prototype.baseSpacingBottom = 1;
// Keeps edges between relative child cells inside parent
mxGraphModel.prototype.ignoreRelativeEdgeParent = false;
// Defines grid properties
mxGraphView.prototype.gridImage = (mxClient.IS_SVG) ? 'data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=' :
IMAGE_PATH + '/grid.gif';
mxGraphView.prototype.gridSteps = 4;
mxGraphView.prototype.minGridSize = 4;
// UrlParams is null in embed mode
mxGraphView.prototype.gridColor = '#e0e0e0';
//Units
mxGraphView.prototype.unit = mxConstants.POINTS;
mxGraphView.prototype.setUnit = function (unit) {
if (this.unit != unit) {
this.unit = unit;
this.fireEvent(new mxEventObject('unitChanged', 'unit', unit));
}
};
// Alternative text for unsupported foreignObjects
mxSvgCanvas2D.prototype.foAltText = '[Not supported by viewer]';
// Hook for custom constraints
mxShape.prototype.getConstraints = function (style, w, h) {
return null;
};
/**
* Constructs a new graph instance. Note that the constructor does not take a
* container because the graph instance is needed for creating the UI, which
* in turn will create the container for the graph. Hence, the container is
* assigned later in EditorUi.
*/
/**
* Defines graph class.
* @param container {HTMLElement}
* @param model {mxGraphModel}
* @param renderHint {string}
* @param stylesheet {mxStylesheet}
* @param themes {object}
* @param standalone {boolean}
* @extends {mxGraph}
* @class
*/
Graph = function (container, model, renderHint, stylesheet, themes, standalone) {
mxGraph.call(this, container, model, renderHint, stylesheet);
/**
* @type {Object}
*/
this.themes = themes || this.defaultThemes;
/**
* @type {{}}
*/
this.currentEdgeStyle = mxUtils.clone(this.defaultEdgeStyle);
/**
* @type {{}}
*/
this.currentVertexStyle = mxUtils.clone(this.defaultVertexStyle);
/**
* @type {boolean}
*/
this.standalone = (standalone != null) ? standalone : false;
// Sets the base domain URL and domain path URL for relative links.
var b = this.baseUrl;
var p = b.indexOf('//');
this.domainUrl = '';
this.domainPathUrl = '';
if (p > 0) {
var d = b.indexOf('/', p + 2);
if (d > 0) {
this.domainUrl = b.substring(0, d);
}
d = b.lastIndexOf('/');
if (d > 0) {
this.domainPathUrl = b.substring(0, d + 1);
}
}
// Adds support for HTML labels via style. Note: Currently, only the Java
// backend supports HTML labels but CSS support is limited to the following:
// http://docs.oracle.com/javase/6/docs/api/index.html?javax/swing/text/html/CSS.html
// TODO: Wrap should not affect isHtmlLabel output (should be handled later)
this.isHtmlLabel = function (cell) {
var state = this.view.getState(cell);
var style = (state != null) ? state.style : this.getCellStyle(cell);
return (style != null) ? (style['html'] == '1' || style[mxConstants.STYLE_WHITE_SPACE] == 'wrap') : false;
};
// Implements a listener for hover and click handling on edges
if (this.edgeMode) {
var start = {
point: null,
event: null,
state: null,
handle: null,
selected: false,
};
// Uses this event to process mouseDown to check the selection state before it is changed
this.addListener(mxEvent.FIRE_MOUSE_EVENT, mxUtils.bind(this, function (sender, evt) {
if (evt.getProperty('eventName') == 'mouseDown' && this.isEnabled()) {
var me = evt.getProperty('event');
if (!mxEvent.isControlDown(me.getEvent()) && !mxEvent.isShiftDown(me.getEvent())) {
var state = me.getState();
if (state != null) {
// Checks if state was removed in call to stopEditing above
if (this.model.isEdge(state.cell)) {
start.point = new mxPoint(me.getGraphX(), me.getGraphY());
start.selected = this.isCellSelected(state.cell);
start.state = state;
start.event = me;
if (state.text != null && state.text.boundingBox != null &&
mxUtils.contains(state.text.boundingBox, me.getGraphX(), me.getGraphY())) {
start.handle = mxEvent.LABEL_HANDLE;
} else {
var handler = this.selectionCellsHandler.getHandler(state.cell);
if (handler != null && handler.bends != null && handler.bends.length > 0) {
start.handle = handler.getHandleForEvent(me);
}
}
}
}
}
}
}));
var mouseDown = null;
this.addMouseListener(
{
mouseDown: function (sender, me) {
},
mouseMove: mxUtils.bind(this, function (sender, me) {
// Checks if any other handler is active
var handlerMap = this.selectionCellsHandler.handlers.map;
for (var key in handlerMap) {
if (handlerMap[key].index != null) {
return;
}
}
if (this.isEnabled() && !this.panningHandler.isActive() && !mxEvent.isControlDown(me.getEvent()) &&
!mxEvent.isShiftDown(me.getEvent()) && !mxEvent.isAltDown(me.getEvent())) {
var tol = this.tolerance;
if (start.point != null && start.state != null && start.event != null) {
var state = start.state;
if (Math.abs(start.point.x - me.getGraphX()) > tol ||
Math.abs(start.point.y - me.getGraphY()) > tol) {
// Lazy selection for edges inside groups
if (!this.isCellSelected(state.cell)) {
this.setSelectionCell(state.cell);
}
var handler = this.selectionCellsHandler.getHandler(state.cell);
if (handler != null && handler.bends != null && handler.bends.length > 0) {
var handle = handler.getHandleForEvent(start.event);
var edgeStyle = this.view.getEdgeStyle(state);
var entity = edgeStyle == mxEdgeStyle.EntityRelation;
// Handles special case where label was clicked on unselected edge in which
// case the label will be moved regardless of the handle that is returned
if (!start.selected && start.handle == mxEvent.LABEL_HANDLE) {
handle = start.handle;
}
if (!entity || handle == 0 || handle == handler.bends.length - 1 || handle == mxEvent.LABEL_HANDLE) {
// Source or target handle or connected for direct handle access or orthogonal line
// with just two points where the central handle is moved regardless of mouse position
if (handle == mxEvent.LABEL_HANDLE || handle == 0 || state.visibleSourceState != null ||
handle == handler.bends.length - 1 || state.visibleTargetState != null) {
if (!entity && handle != mxEvent.LABEL_HANDLE) {
var pts = state.absolutePoints;
// Default case where handles are at corner points handles
// drag of corner as drag of existing point
if (pts != null && ((edgeStyle == null && handle == null) ||
edgeStyle == mxEdgeStyle.OrthConnector)) {
// Does not use handles if they were not initially visible
handle = start.handle;
if (handle == null) {
var box = new mxRectangle(start.point.x, start.point.y);
box.grow(mxEdgeHandler.prototype.handleImage.width / 2);
if (mxUtils.contains(box, pts[0].x, pts[0].y)) {
// Moves source terminal handle
handle = 0;
} else if (mxUtils.contains(box, pts[pts.length - 1].x, pts[pts.length - 1].y)) {
// Moves target terminal handle
handle = handler.bends.length - 1;
} else {
// Checks if edge has no bends
var nobends = edgeStyle != null && (pts.length == 2 || (pts.length == 3 &&
((Math.round(pts[0].x - pts[1].x) == 0 && Math.round(pts[1].x - pts[2].x) == 0) ||
(Math.round(pts[0].y - pts[1].y) == 0 && Math.round(pts[1].y - pts[2].y) == 0))));
if (nobends) {
// Moves central handle for straight orthogonal edges
handle = 2;
} else {
// Finds and moves vertical or horizontal segment
handle = mxUtils.findNearestSegment(state, start.point.x, start.point.y);
// Converts segment to virtual handle index
if (edgeStyle == null) {
handle = mxEvent.VIRTUAL_HANDLE - handle;
}
// Maps segment to handle
else {
handle += 1;
}
}
}
}
}
// Creates a new waypoint and starts moving it
if (handle == null) {
handle = mxEvent.VIRTUAL_HANDLE;
}
}
handler.start(me.getGraphX(), me.getGraphX(), handle);
start.state = null;
start.event = null;
start.point = null;
start.handle = null;
start.selected = false;
me.consume();
// Removes preview rectangle in graph handler
this.graphHandler.reset();
}
} else if (entity && (state.visibleSourceState != null || state.visibleTargetState != null)) {
// Disables moves on entity to make it consistent
this.graphHandler.reset();
me.consume();
}
}
}
} else {
// Updates cursor for unselected edges under the mouse
var state = me.getState();
if (state != null) {
// Checks if state was removed in call to stopEditing above
if (this.model.isEdge(state.cell)) {
var cursor = null;
var pts = state.absolutePoints;
if (pts != null) {
var box = new mxRectangle(me.getGraphX(), me.getGraphY());
box.grow(mxEdgeHandler.prototype.handleImage.width / 2);
if (state.text != null && state.text.boundingBox != null &&
mxUtils.contains(state.text.boundingBox, me.getGraphX(), me.getGraphY())) {
cursor = 'move';
} else if (mxUtils.contains(box, pts[0].x, pts[0].y) ||
mxUtils.contains(box, pts[pts.length - 1].x, pts[pts.length - 1].y)) {
cursor = 'pointer';
} else if (state.visibleSourceState != null || state.visibleTargetState != null) {
// Moving is not allowed for entity relation but still indicate hover state
var tmp = this.view.getEdgeStyle(state);
cursor = 'crosshair';
if (tmp != mxEdgeStyle.EntityRelation && this.isOrthogonal(state)) {
var idx = mxUtils.findNearestSegment(state, me.getGraphX(), me.getGraphY());
if (idx < pts.length - 1 && idx >= 0) {
cursor = (Math.round(pts[idx].x - pts[idx + 1].x) == 0) ?
'col-resize' : 'row-resize';
}
}
}
}
if (cursor != null) {
state.setCursor(cursor);
}
}
}
}
}
}),
mouseUp: mxUtils.bind(this, function (sender, me) {
start.state = null;
start.event = null;
start.point = null;
start.handle = null;
}),
});
}
// HTML entities are displayed as plain text in wrapped plain text labels
this.cellRenderer.getLabelValue = function (state) {
var result = mxCellRenderer.prototype.getLabelValue.apply(this, arguments);
if (state.view.graph.isHtmlLabel(state.cell)) {
if (state.style['html'] != 1) {
result = mxUtils.htmlEntities(result, false);
} else {
result = state.view.graph.sanitizeHtml(result);
}
}
return result;
};
// All code below not available and not needed in embed mode
if (typeof mxVertexHandler !== 'undefined') {
this.setConnectable(true);
this.setDropEnabled(true);
this.setPanning(true);
this.setTooltips(true);
this.setAllowLoops(true);
this.allowAutoPanning = true;
this.resetEdgesOnConnect = false;
this.constrainChildren = false;
this.constrainRelativeChildren = true;
// Do not scroll after moving cells
this.graphHandler.scrollOnMove = false;
this.graphHandler.scaleGrid = true;
// Disables cloning of connection sources by default
this.connectionHandler.setCreateTarget(false);
this.connectionHandler.insertBeforeSource = true;
// Disables built-in connection starts
this.connectionHandler.isValidSource = function (cell, me) {
return false;
};
// Sets the style to be used when an elbow edge is double clicked
this.alternateEdgeStyle = 'vertical';
if (stylesheet == null) {
this.loadStylesheet();
}
// Adds page centers to the guides for moving cells
var graphHandlerGetGuideStates = this.graphHandler.getGuideStates;
this.graphHandler.getGuideStates = function () {
var result = graphHandlerGetGuideStates.apply(this, arguments);
// Create virtual cell state for page centers
if (this.graph.pageVisible) {
var guides = [];
var pf = this.graph.pageFormat;
var ps = this.graph.pageScale;
var pw = pf.width * ps;
var ph = pf.height * ps;
var t = this.graph.view.translate;
var s = this.graph.view.scale;
var layout = this.graph.getPageLayout();
for (var i = 0; i < layout.width; i++) {
guides.push(new mxRectangle(((layout.x + i) * pw + t.x) * s,
(layout.y * ph + t.y) * s, pw * s, ph * s));
}
for (var j = 0; j < layout.height; j++) {
guides.push(new mxRectangle((layout.x * pw + t.x) * s,
((layout.y + j) * ph + t.y) * s, pw * s, ph * s));
}
// Page center guides have predence over normal guides
result = guides.concat(result);
}
return result;
};
// Overrides zIndex for dragElement
mxDragSource.prototype.dragElementZIndex = mxPopupMenu.prototype.zIndex;
// Overrides color for virtual guides for page centers
mxGuide.prototype.getGuideColor = function (state, horizontal) {
return (state.cell == null) ? '#ffa500' /* orange */ : mxConstants.GUIDE_COLOR;
};
// Changes color of move preview for black backgrounds
this.graphHandler.createPreviewShape = function (bounds) {
this.previewColor = (this.graph.background == '#000000') ? '#ffffff' : mxGraphHandler.prototype.previewColor;
return mxGraphHandler.prototype.createPreviewShape.apply(this, arguments);
};
// Handles parts of cells by checking if part=1 is in the style and returning the parent
// if the parent is not already in the list of cells. container style is used to disable
// step into swimlanes and dropTarget style is used to disable acting as a drop target.
// LATER: Handle recursive parts
this.graphHandler.getCells = function (initialCell) {
var cells = mxGraphHandler.prototype.getCells.apply(this, arguments);
var newCells = [];
for (var i = 0; i < cells.length; i++) {
var state = this.graph.view.getState(cells[i]);
var style = (state != null) ? state.style : this.graph.getCellStyle(cells[i]);
if (mxUtils.getValue(style, 'part', '0') == '1') {
var parent = this.graph.model.getParent(cells[i]);
if (this.graph.model.isVertex(parent) && mxUtils.indexOf(cells, parent) < 0) {
newCells.push(parent);
}
} else {
newCells.push(cells[i]);
}
}
return newCells;
};
// Handles parts of cells when cloning the source for new connections
this.connectionHandler.createTargetVertex = function (evt, source) {
var state = this.graph.view.getState(source);
var style = (state != null) ? state.style : this.graph.getCellStyle(source);
if (mxUtils.getValue(style, 'part', false)) {
var parent = this.graph.model.getParent(source);
if (this.graph.model.isVertex(parent)) {
source = parent;
}
}
return mxConnectionHandler.prototype.createTargetVertex.apply(this, arguments);
};
var rubberband = new mxRubberband(this);
this.getRubberband = function () {
return rubberband;
};
// Timer-based activation of outline connect in connection handler
var startTime = new Date().getTime();
var timeOnTarget = 0;
var connectionHandlerMouseMove = this.connectionHandler.mouseMove;
this.connectionHandler.mouseMove = function () {
var prev = this.currentState;
connectionHandlerMouseMove.apply(this, arguments);
if (prev != this.currentState) {
startTime = new Date().getTime();
timeOnTarget = 0;
} else {
timeOnTarget = new Date().getTime() - startTime;
}
};
// Activates outline connect after 1500ms with touch event or if alt is pressed inside the shape
// outlineConnect=0 is a custom style that means do not connect to strokes inside the shape,
// or in other words, connect to the shape's perimeter if the highlight is under the mouse
// (the name is because the highlight, including all strokes, is called outline in the code)
var connectionHandleIsOutlineConnectEvent = this.connectionHandler.isOutlineConnectEvent;
this.connectionHandler.isOutlineConnectEvent = function (me) {
return (this.currentState != null && me.getState() == this.currentState && timeOnTarget > 2000) ||
((this.currentState == null || mxUtils.getValue(this.currentState.style, 'outlineConnect', '1') != '0') &&
connectionHandleIsOutlineConnectEvent.apply(this, arguments));
};
// Adds shift+click to toggle selection state
var isToggleEvent = this.isToggleEvent;
this.isToggleEvent = function (evt) {
return isToggleEvent.apply(this, arguments) || (!mxClient.IS_CHROMEOS && mxEvent.isShiftDown(evt));
};
// Workaround for Firefox where first mouse down is received
// after tap and hold if scrollbars are visible, which means
// start rubberband immediately if no cell is under mouse.
var isForceRubberBandEvent = rubberband.isForceRubberbandEvent;
rubberband.isForceRubberbandEvent = function (me) {
return isForceRubberBandEvent.apply(this, arguments) ||
(mxClient.IS_CHROMEOS && mxEvent.isShiftDown(me.getEvent())) ||
(mxUtils.hasScrollbars(this.graph.container) && mxClient.IS_FF &&
mxClient.IS_WIN && me.getState() == null && mxEvent.isTouchEvent(me.getEvent()));
};
// Shows hand cursor while panning
var prevCursor = null;
this.panningHandler.addListener(mxEvent.PAN_START, mxUtils.bind(this, function () {
if (this.isEnabled()) {
prevCursor = this.container.style.cursor;
this.container.style.cursor = 'move';
}
}));
this.panningHandler.addListener(mxEvent.PAN_END, mxUtils.bind(this, function () {
if (this.isEnabled()) {
this.container.style.cursor = prevCursor;
}
}));
this.popupMenuHandler.autoExpand = true;
this.popupMenuHandler.isSelectOnPopup = function (me) {
return mxEvent.isMouseEvent(me.getEvent());
};
// Handles links if graph is read-only or cell is locked
var click = this.click;
this.click = function (me) {
var locked = me.state == null && me.sourceState != null && this.isCellLocked(me.sourceState.cell);
if ((!this.isEnabled() || locked) && !me.isConsumed()) {
var cell = (locked) ? me.sourceState.cell : me.getCell();
if (cell != null) {
var link = this.getLinkForCell(cell);
if (link != null) {
if (this.isCustomLink(link)) {
this.customLinkClicked(link);
} else {
this.openLink(link);
}
}
}
if (this.isEnabled() && locked) {
this.clearSelection();
}
} else {
return click.apply(this, arguments);
}
};
// Redirects tooltips for locked cells
this.tooltipHandler.getStateForEvent = function (me) {
return me.sourceState;
};
// Redirects cursor for locked cells
var getCursorForMouseEvent = this.getCursorForMouseEvent;
this.getCursorForMouseEvent = function (me) {
var locked = me.state == null && me.sourceState != null && this.isCellLocked(me.sourceState.cell);
return this.getCursorForCell((locked) ? me.sourceState.cell : me.getCell());
};
// Shows pointer cursor for clickable cells with links
// ie. if the graph is disabled and cells cannot be selected
var getCursorForCell = this.getCursorForCell;
this.getCursorForCell = function (cell) {
if (!this.isEnabled() || this.isCellLocked(cell)) {
var link = this.getLinkForCell(cell);
if (link != null) {
return 'pointer';
} else if (this.isCellLocked(cell)) {
return 'default';
}
}
return getCursorForCell.apply(this, arguments);
};
// Changes rubberband selection to be recursive
this.selectRegion = function (rect, evt) {
var cells = this.getAllCells(rect.x, rect.y, rect.width, rect.height);
this.selectCellsForEvent(cells, evt);
return cells;
};
// Recursive implementation for rubberband selection
this.getAllCells = function (x, y, width, height, parent, result) {
result = (result != null) ? result : [];
if (width > 0 || height > 0) {
var model = this.getModel();
var right = x + width;
var bottom = y + height;
if (parent == null) {
parent = this.getCurrentRoot();
if (parent == null) {
parent = model.getRoot();
}
}
if (parent != null) {
var childCount = model.getChildCount(parent);
for (var i = 0; i < childCount; i++) {
var cell = model.getChildAt(parent, i);
var state = this.view.getState(cell);
if (state != null && this.isCellVisible(cell) && mxUtils.getValue(state.style, 'locked', '0') != '1') {
var deg = mxUtils.getValue(state.style, mxConstants.STYLE_ROTATION) || 0;
var box = state;
if (deg != 0) {
box = mxUtils.getBoundingBox(box, deg);
}
if ((model.isEdge(cell) || model.isVertex(cell)) &&
box.x >= x && box.y + box.height <= bottom &&
box.y >= y && box.x + box.width <= right) {
result.push(cell);
}
this.getAllCells(x, y, width, height, cell, result);
}
}
}
}
return result;
};
// Never removes cells from parents that are being moved
var graphHandlerShouldRemoveCellsFromParent = this.graphHandler.shouldRemoveCellsFromParent;
this.graphHandler.shouldRemoveCellsFromParent = function (parent, cells, evt) {
if (this.graph.isCellSelected(parent)) {
return false;
}
return graphHandlerShouldRemoveCellsFromParent.apply(this, arguments);
};
// Unlocks all cells
this.isCellLocked = function (cell) {
var pState = this.view.getState(cell);
while (pState != null) {
if (mxUtils.getValue(pState.style, 'locked', '0') == '1') {
return true;
}
pState = this.view.getState(this.model.getParent(pState.cell));
}
return false;
};
var tapAndHoldSelection = null;
// Uses this event to process mouseDown to check the selection state before it is changed
this.addListener(mxEvent.FIRE_MOUSE_EVENT, mxUtils.bind(this, function (sender, evt) {
if (evt.getProperty('eventName') == 'mouseDown') {
var me = evt.getProperty('event');
var state = me.getState();
if (state != null && !this.isSelectionEmpty() && !this.isCellSelected(state.cell)) {
tapAndHoldSelection = this.getSelectionCells();
} else {
tapAndHoldSelection = null;
}
}
}));
// Tap and hold on background starts rubberband for multiple selected
// cells the cell associated with the event is deselected
this.addListener(mxEvent.TAP_AND_HOLD, mxUtils.bind(this, function (sender, evt) {
if (!mxEvent.isMultiTouchEvent(evt)) {
var me = evt.getProperty('event');
var cell = evt.getProperty('cell');
if (cell == null) {
var pt = mxUtils.convertPoint(this.container,
mxEvent.getClientX(me), mxEvent.getClientY(me));
rubberband.start(pt.x, pt.y);
} else if (tapAndHoldSelection != null) {
this.addSelectionCells(tapAndHoldSelection);
} else if (this.getSelectionCount() > 1 && this.isCellSelected(cell)) {
this.removeSelectionCell(cell);
}
// Blocks further processing of the event
tapAndHoldSelection = null;
evt.consume();
}
}));
// On connect the target is selected and we clone the cell of the preview edge for insert
this.connectionHandler.selectCells = function (edge, target) {
this.graph.setSelectionCell(target || edge);
};
// Shows connection points only if cell not selected
this.connectionHandler.constraintHandler.isStateIgnored = function (state, source) {
return source && state.view.graph.isCellSelected(state.cell);
};
// Updates constraint handler if the selection changes
this.selectionModel.addListener(mxEvent.CHANGE, mxUtils.bind(this, function () {
var ch = this.connectionHandler.constraintHandler;
if (ch.currentFocus != null && ch.isStateIgnored(ch.currentFocus, true)) {
ch.currentFocus = null;
ch.constraints = null;
ch.destroyIcons();
}
ch.destroyFocusHighlight();
}));
// Initializes touch interface
if (Graph.touchStyle) {
this.initTouch();
}
/**
* Adds locking
*/
var graphUpdateMouseEvent = this.updateMouseEvent;
this.updateMouseEvent = function (me) {
me = graphUpdateMouseEvent.apply(this, arguments);
if (me.state != null && this.isCellLocked(me.getCell())) {
me.state = null;
}
return me;
};
}
//Create a unique offset object for each graph instance.
this.currentTranslate = new mxPoint(0, 0);
};
/**
* Specifies if the touch UI should be used (cannot detect touch in FF so always on for Windows/Linux)
*/
Graph.touchStyle = mxClient.IS_TOUCH || (mxClient.IS_FF && mxClient.IS_WIN) || navigator.maxTouchPoints > 0 ||
navigator.msMaxTouchPoints > 0 || window.urlParams == null || urlParams['touch'] == '1';
/**
* Shortcut for capability check.
*/
Graph.fileSupport = window.File != null && window.FileReader != null && window.FileList != null &&
(window.urlParams == null || urlParams['filesupport'] != '0');
/**
* Default size for line jumps.
*/
Graph.lineJumpsEnabled = true;
/**
* Default size for line jumps.
*/
Graph.defaultJumpSize = 6;
/**
* Helper function for creating SVG data URI.
*/
Graph.createSvgImage = function (w, h, data) {
var tmp = unescape(encodeURIComponent(
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">' +
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="' + w + 'px" height="' + h + 'px" ' +
'version="1.1">' + data + '</svg>'));
return new mxImage('data:image/svg+xml;base64,' + ((window.btoa) ? btoa(tmp) : Base64.encode(tmp, true)), w, h);
};
/**
* Removes all illegal control characters with ASCII code <32 except TAB, LF
* and CR.
*/
Graph.zapGremlins = function (text) {
var checked = [];
for (var i = 0; i < text.length; i++) {
var code = text.charCodeAt(i);
// Removes all control chars except TAB, LF and CR
if ((code >= 32 || code == 9 || code == 10 || code == 13) &&
code != 0xFFFF && code != 0xFFFE) {
checked.push(text.charAt(i));
}
}
return checked.join('');
};
/**
* Turns the given string into an array.
*/
Graph.stringToBytes = function (str) {
var arr = new Array(str.length);
for (var i = 0; i < str.length; i++) {
arr[i] = str.charCodeAt(i);
}
return arr;
};
/**
* Turns the given array into a string.
*/
Graph.bytesToString = function (arr) {
var result = new Array(arr.length);
for (var i = 0; i < arr.length; i++) {
result[i] = String.fromCharCode(arr[i]);
}
return result.join('');
};
/**
* Returns a base64 encoded version of the compressed outer XML of the given node.
*/
Graph.compressNode = function (node) {
return Graph.compress(Graph.zapGremlins(mxUtils.getXml(node)));
};
/**
* Returns a base64 encoded version of the compressed string.
*/
Graph.compress = function (data, deflate) {
if (data == null || data.length == 0 || typeof (pako) === 'undefined') {
return data;
} else {
var tmp = Graph.bytesToString((deflate) ? pako.deflate(encodeURIComponent(data)) :
pako.deflateRaw(encodeURIComponent(data)));
return (window.btoa) ? btoa(tmp) : Base64.encode(tmp, true);
}
};
/**
* Returns a decompressed version of the base64 encoded string.
*/
Graph.decompress = function (data, inflate) {
if (data == null || data.length == 0 || typeof (pako) === 'undefined') {
return data;
} else {
var tmp = (window.atob) ? atob(data) : Base64.decode(data, true);
return Graph.zapGremlins(decodeURIComponent(
Graph.bytesToString((inflate) ? pako.inflate(tmp) :
pako.inflateRaw(tmp))));
}
};
/**
* Graph inherits from mxGraph.
*/
mxUtils.extend(Graph, mxGraph);
/**
* Allows all values in fit.
* @type {number}
*/
Graph.prototype.minFitScale = null;
/**
* Allows all values in fit.
* @type {number}
*/
Graph.prototype.maxFitScale = null;
/**
* Sets the policy for links. Possible values are "self" to replace any framesets,
* "blank" to load the URL in <linkTarget> and "auto" (default).
* @type {string}
*/
Graph.prototype.linkPolicy = (urlParams['target'] == 'frame') ? 'blank' : (urlParams['target'] || 'auto');
/**
* Target for links that open in a new window. Default is _blank.
* @type {string}
*/
Graph.prototype.linkTarget = (urlParams['target'] == 'frame') ? '_self' : '_blank';
/**
* Value to the rel attribute of links. Default is 'nofollow noopener noreferrer'.
* NOTE: There are security implications when this is changed and if noopener is removed,
* then <openLink> must be overridden to allow for the opener to be set by default.
*/
Graph.prototype.linkRelation = 'nofollow noopener noreferrer';
/**
* Scrollbars are enabled on non-touch devices (not including Firefox because touch events
* cannot be detected in Firefox, see above).
*/
Graph.prototype.defaultScrollbars = !mxClient.IS_IOS;
/**
* Specifies if the page should be visible for new files. Default is true.
*/
Graph.prototype.defaultPageVisible = true;
/**
* Specifies if the app should run in chromeless mode. Default is false.
* This default is only used if the contructor argument is null.
*/
Graph.prototype.lightbox = false;
/**
*
*/
Graph.prototype.defaultPageBackgroundColor = '#ffffff';
/**
*
*/
Graph.prototype.defaultPageBorderColor = '#ffffff';
/**
* Specifies the size of the size for "tiles" to be used for a graph with
* scrollbars but no visible background page. A good value is large
* enough to reduce the number of repaints that is caused for auto-
* translation, which depends on this value, and small enough to give
* a small empty buffer around the graph. Default is 400x400.
*/
Graph.prototype.scrollTileSize = new mxRectangle(0, 0, 400, 400);
/**
* Overrides the background color and paints a transparent background.
*/
Graph.prototype.transparentBackground = true;
/**
* Sets global constants.
*/
Graph.prototype.selectParentAfterDelete = false;
/**
* Sets the default target for all links in cells.
*/
Graph.prototype.defaultEdgeLength = 80;
/**
* Disables move of bends/segments without selecting.
*/
Graph.prototype.edgeMode = false;
/**
* Allows all values in fit.
*/
Graph.prototype.connectionArrowsEnabled = true;
/**
* Specifies the regular expression for matching placeholders.
*/
Graph.prototype.placeholderPattern = new RegExp('%(date\{.*\}|[^%^\{^\}]+)%', 'g');
/**
* Specifies the regular expression for matching placeholders.
*/
Graph.prototype.absoluteUrlPattern = new RegExp('^(?:[a-z]+:)?//', 'i');
/**
* Specifies the default name for the theme. Default is 'default'.
*/
Graph.prototype.defaultThemeName = 'default';
/**
* Specifies the default name for the theme. Default is 'default'.
*/
Graph.prototype.defaultThemes = {};
/**
* Base URL for relative links.
*/
Graph.prototype.baseUrl = (urlParams['base'] != null) ?
decodeURIComponent(urlParams['base']) :
(((window != window.top) ? document.referrer :
document.location.toString()).split('#')[0]);
/**
* Specifies if the label should be edited after an insert.
*/
Graph.prototype.editAfterInsert = false;
/**
* Defines the built-in properties to be ignored in tooltips.
*/
Graph.prototype.builtInProperties = ['label', 'tooltip', 'placeholders', 'placeholder'];
/**
* Defines if the graph is part of an EditorUi. If this is false the graph can
* be used in an EditorUi instance but will not have a UI added, functions
* overridden or event handlers added.
*/
Graph.prototype.standalone = false;
/**
* Installs child layout styles.
*/
Graph.prototype.init = function (container) {
mxGraph.prototype.init.apply(this, arguments);
// Intercepts links with no target attribute and opens in new window
this.cellRenderer.initializeLabel = function (state, shape) {
mxCellRenderer.prototype.initializeLabel.apply(this, arguments);
// Checks tolerance for clicks on links
var tol = state.view.graph.tolerance;
var handleClick = true;
var first = null;
var down = mxUtils.bind(this, function (evt) {
handleClick = true;
first = new mxPoint(mxEvent.getClientX(evt), mxEvent.getClientY(evt));
});
var move = mxUtils.bind(this, function (evt) {
handleClick = handleClick && first != null &&
Math.abs(first.x - mxEvent.getClientX(evt)) < tol &&
Math.abs(first.y - mxEvent.getClientY(evt)) < tol;
});
var up = mxUtils.bind(this, function (evt) {
if (handleClick) {
var elt = mxEvent.getSource(evt);
while (elt != null && elt != shape.node) {
if (elt.nodeName.toLowerCase() == 'a') {
state.view.graph.labelLinkClicked(state, elt, evt);
break;
}
elt = elt.parentNode;
}
}
});
mxEvent.addGestureListeners(shape.node, down, move, up);
mxEvent.addListener(shape.node, 'click', function (evt) {
mxEvent.consume(evt);
});
};
this.initLayoutManager();
};
/**
* Implements zoom and offset via CSS transforms. This is currently only used
* in read-only as there are fewer issues with the mxCellState not being scaled
* and translated.
*
* KNOWN ISSUES TO FIX:
* - Apply CSS transforms to HTML labels in IE11
*/
(function () {
/**
* Uses CSS transforms for scale and translate.
*/
Graph.prototype.useCssTransforms = false;
/**
* Contains the scale.
*/
Graph.prototype.currentScale = 1;
/**
* Contains the offset.
*/
Graph.prototype.currentTranslate = new mxPoint(0, 0);
/**
* Only foreignObject supported for now (no IE11).
*/
Graph.prototype.isCssTransformsSupported = function () {
return this.dialect == mxConstants.DIALECT_SVG && !mxClient.NO_FO;
};
/**
* Function: getCellAt
*
* Needs to modify original method for recursive call.
*/
Graph.prototype.getCellAt = function (x, y, parent, vertices, edges, ignoreFn) {
if (this.useCssTransforms) {
x = x / this.currentScale - this.currentTranslate.x;
y = y / this.currentScale - this.currentTranslate.y;
}
return this.getScaledCellAt.apply(this, arguments);
};
/**
* Function: getScaledCellAt
*
* Overridden for recursion.
*/
Graph.prototype.getScaledCellAt = function (x, y, parent, vertices, edges, ignoreFn) {
vertices = (vertices != null) ? vertices : true;
edges = (edges != null) ? edges : true;
if (parent == null) {
parent = this.getCurrentRoot();
if (parent == null) {
parent = this.getModel().getRoot();
}
}
if (parent != null) {
var childCount = this.model.getChildCount(parent);
for (var i = childCount - 1; i >= 0; i--) {
var cell = this.model.getChildAt(parent, i);
var result = this.getScaledCellAt(x, y, cell, vertices, edges, ignoreFn);
if (result != null) {
return result;
} else if (this.isCellVisible(cell) && (edges && this.model.isEdge(cell) ||
vertices && this.model.isVertex(cell))) {
var state = this.view.getState(cell);
if (state != null && (ignoreFn == null || !ignoreFn(state, x, y)) &&
this.intersects(state, x, y)) {
return cell;
}
}
}
}
return null;
};
/**
* Function: repaint
*
* Updates the highlight after a change of the model or view.
*/
mxCellHighlight.prototype.getStrokeWidth = function (state) {
var s = this.strokeWidth;
if (this.graph.useCssTransforms) {
s /= this.graph.currentScale;
}
return s;
};
/**
* Function: getGraphBounds
*
* Overrides getGraphBounds to use bounding box from SVG.
*/
mxGraphView.prototype.getGraphBounds = function () {
var b = this.graphBounds;
if (this.graph.useCssTransforms) {
var t = this.graph.currentTranslate;
var s = this.graph.currentScale;
b = new mxRectangle(
(b.x + t.x) * s, (b.y + t.y) * s,
b.width * s, b.height * s);
}
return b;
};
/**
* Function: viewStateChanged
*
* Overrides to bypass full cell tree validation.
* TODO: Check if this improves performance
*/
mxGraphView.prototype.viewStateChanged = function () {
if (this.graph.useCssTransforms) {
this.validate();
this.graph.sizeDidChange();
} else {
this.revalidate();
this.graph.sizeDidChange();
}
};
/**
* Function: validate
*
* Overrides validate to normalize validation view state and pass
* current state to CSS transform.
*/
var graphViewValidate = mxGraphView.prototype.validate;
mxGraphView.prototype.validate = function (cell) {
if (this.graph.useCssTransforms) {
this.graph.currentScale = this.scale;
this.graph.currentTranslate.x = this.translate.x;
this.graph.currentTranslate.y = this.translate.y;
this.scale = 1;
this.translate.x = 0;
this.translate.y = 0;
}
graphViewValidate.apply(this, arguments);
if (this.graph.useCssTransforms) {
this.graph.updateCssTransform();
this.scale = this.graph.currentScale;
this.translate.x = this.graph.currentTranslate.x;
this.translate.y = this.graph.currentTranslate.y;
}
};
/**
* Function: updateCssTransform
*
* Zooms out of the graph by <zoomFactor>.
*/
Graph.prototype.updateCssTransform = function () {
var temp = this.view.getDrawPane();
if (temp != null) {
var g = temp.parentNode;
if (!this.useCssTransforms) {
g.removeAttribute('transformOrigin');
g.removeAttribute('transform');
} else {
var prev = g.getAttribute('transform');
g.setAttribute('transformOrigin', '0 0');
g.setAttribute('transform', 'scale(' + this.currentScale + ',' + this.currentScale + ')' +
'translate(' + this.currentTranslate.x + ',' + this.currentTranslate.y + ')');
// Applies workarounds only if translate has changed
if (prev != g.getAttribute('transform')) {
try {
// Applies transform to labels outside of the SVG DOM
// Excluded via isCssTransformsSupported
// if (mxClient.NO_FO)
// {
// var transform = 'scale(' + this.currentScale + ')' + 'translate(' +
// this.currentTranslate.x + 'px,' + this.currentTranslate.y + 'px)';
//
// this.view.states.visit(mxUtils.bind(this, function(cell, state)
// {
// if (state.text != null && state.text.node != null)
// {
// // Stores initial CSS transform that is used for the label alignment
// if (state.text.originalTransform == null)
// {
// state.text.originalTransform = state.text.node.style.transform;
// }
//
// state.text.node.style.transform = transform + state.text.originalTransform;
// }
// }));
// }
// Workaround for https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4320441/
if (mxClient.IS_EDGE) {
// Recommended workaround is to do this on all
// foreignObjects, but this seems to be faster
var val = g.style.display;
g.style.display = 'none';
g.getBBox();
g.style.display = val;
}
} catch (e) {
// ignore
}
}
}
}
};
var graphViewValidateBackgroundPage = mxGraphView.prototype.validateBackgroundPage;
mxGraphView.prototype.validateBackgroundPage = function () {
var useCssTranforms = this.graph.useCssTransforms, scale = this.scale,
translate = this.translate;
if (useCssTranforms) {
this.scale = this.graph.currentScale;
this.translate = this.graph.currentTranslate;
}
graphViewValidateBackgroundPage.apply(this, arguments);
if (useCssTranforms) {
this.scale = scale;
this.translate = translate;
}
};
var graphUpdatePageBreaks = mxGraph.prototype.updatePageBreaks;
mxGraph.prototype.updatePageBreaks = function (visible, width, height) {
var useCssTranforms = this.useCssTransforms, scale = this.view.scale,
translate = this.view.translate;
if (useCssTranforms) {
this.view.scale = 1;
this.view.translate = new mxPoint(0, 0);
this.useCssTransforms = false;
}
graphUpdatePageBreaks.apply(this, arguments);
if (useCssTranforms) {
this.view.scale = scale;
this.view.translate = translate;
this.useCssTransforms = true;
}
};
})();
/**
* Sets the XML node for the current diagram.
*/
Graph.prototype.isLightboxView = function () {
return this.lightbox;
};
/**
* Sets the XML node for the current diagram.
*/
Graph.prototype.isViewer = function () {
return false;
};
/**
* Installs automatic layout via styles
*/
Graph.prototype.labelLinkClicked = function (state, elt, evt) {
var href = elt.getAttribute('href');
if (href != null && !this.isCustomLink(href) && (mxEvent.isLeftMouseButton(evt) &&
!mxEvent.isPopupTrigger(evt)) || mxEvent.isTouchEvent(evt)) {
if (!this.isEnabled() || this.isCellLocked(state.cell)) {
var target = this.isBlankLink(href) ? this.linkTarget : '_top';
this.openLink(this.getAbsoluteUrl(href), target);
}
mxEvent.consume(evt);
}
};
/**
* Returns the size of the page format scaled with the page size.
*/
Graph.prototype.openLink = function (href, target, allowOpener) {
var result = window;
try {
// Workaround for blocking in same iframe
if (target == '_self' && window != window.top) {
window.location.href = href;
} else {
// Avoids page reload for anchors (workaround for IE but used everywhere)
if (href.substring(0, this.baseUrl.length) == this.baseUrl &&
href.charAt(this.baseUrl.length) == '#' &&
target == '_top' && window == window.top) {
var hash = href.split('#')[1];
// Forces navigation if on same hash
if (window.location.hash == '#' + hash) {
window.location.hash = '';
}
window.location.hash = hash;
} else {
result = window.open(href, target);
if (result != null && !allowOpener) {
result.opener = null;
}
}
}
} catch (e) {
// ignores permission denied
}
return result;
};
/**
* Adds support for page links.
*/
Graph.prototype.getLinkTitle = function (href) {
return href.substring(href.lastIndexOf('/') + 1);
};
/**
* Adds support for page links.
*/
Graph.prototype.isCustomLink = function (href) {
return href.substring(0, 5) == 'data:';
};
/**
* Adds support for page links.
*/
Graph.prototype.customLinkClicked = function (link) {
return false;
};
/**
* Returns true if the fiven href references an external protocol that
* should never open in a new window. Default returns true for mailto.
*/
Graph.prototype.isExternalProtocol = function (href) {
return href.substring(0, 7) === 'mailto:';
};
/**
* Hook for links to open in same window. Default returns true for anchors,
* links to same domain or if target == 'self' in the config.
*/
Graph.prototype.isBlankLink = function (href) {
return !this.isExternalProtocol(href) &&
(this.linkPolicy === 'blank' ||
(this.linkPolicy !== 'self' &&
!this.isRelativeUrl(href) &&
href.substring(0, this.domainUrl.length) !== this.domainUrl));
};
/**
*
*/
Graph.prototype.isRelativeUrl = function (url) {
return url != null && !this.absoluteUrlPattern.test(url) &&
url.substring(0, 5) !== 'data:' &&
!this.isExternalProtocol(url);
};
/**
*
*/
Graph.prototype.getAbsoluteUrl = function (url) {
if (url != null && this.isRelativeUrl(url)) {
if (url.charAt(0) == '#') {
url = this.baseUrl + url;
} else if (url.charAt(0) == '/') {
url = this.domainUrl + url;
} else {
url = this.domainPathUrl + url;
}
}
return url;
};
/**
* Installs automatic layout via styles
*/
Graph.prototype.initLayoutManager = function () {
this.layoutManager = new mxLayoutManager(this);
this.layoutManager.getLayout = function (cell) {
// Workaround for possible invalid style after change and before view validation
var style = this.graph.getCellStyle(cell);
if (style != null) {
if (style['childLayout'] == 'stackLayout') {
var stackLayout = new mxStackLayout(this.graph, true);
stackLayout.resizeParentMax = mxUtils.getValue(style, 'resizeParentMax', '1') == '1';
stackLayout.horizontal = mxUtils.getValue(style, 'horizontalStack', '1') == '1';
stackLayout.resizeParent = mxUtils.getValue(style, 'resizeParent', '1') == '1';
stackLayout.resizeLast = mxUtils.getValue(style, 'resizeLast', '0') == '1';
stackLayout.spacing = style['stackSpacing'] || stackLayout.spacing;
stackLayout.border = style['stackBorder'] || stackLayout.border;
stackLayout.marginLeft = style['marginLeft'] || 0;
stackLayout.marginRight = style['marginRight'] || 0;
stackLayout.marginTop = style['marginTop'] || 0;
stackLayout.marginBottom = style['marginBottom'] || 0;
stackLayout.fill = true;
return stackLayout;
} else if (style['childLayout'] == 'treeLayout') {
var treeLayout = new mxCompactTreeLayout(this.graph);
treeLayout.horizontal = mxUtils.getValue(style, 'horizontalTree', '1') == '1';
treeLayout.resizeParent = mxUtils.getValue(style, 'resizeParent', '1') == '1';
treeLayout.groupPadding = mxUtils.getValue(style, 'parentPadding', 20);
treeLayout.levelDistance = mxUtils.getValue(style, 'treeLevelDistance', 30);
treeLayout.maintainParentLocation = true;
treeLayout.edgeRouting = false;
treeLayout.resetEdges = false;
return treeLayout;
} else if (style['childLayout'] == 'flowLayout') {
var flowLayout = new mxHierarchicalLayout(this.graph, mxUtils.getValue(style,
'flowOrientation', mxConstants.DIRECTION_EAST));
flowLayout.resizeParent = mxUtils.getValue(style, 'resizeParent', '1') == '1';
flowLayout.parentBorder = mxUtils.getValue(style, 'parentPadding', 20);
flowLayout.maintainParentLocation = true;
// Special undocumented styles for changing the hierarchical
flowLayout.intraCellSpacing = mxUtils.getValue(style, 'intraCellSpacing', mxHierarchicalLayout.prototype.intraCellSpacing);
flowLayout.interRankCellSpacing = mxUtils.getValue(style, 'interRankCellSpacing', mxHierarchicalLayout.prototype.interRankCellSpacing);
flowLayout.interHierarchySpacing = mxUtils.getValue(style, 'interHierarchySpacing', mxHierarchicalLayout.prototype.interHierarchySpacing);
flowLayout.parallelEdgeSpacing = mxUtils.getValue(style, 'parallelEdgeSpacing', mxHierarchicalLayout.prototype.parallelEdgeSpacing);
return flowLayout;
}
}
return null;
};
};
/**
* Returns the size of the page format scaled with the page size.
*/
Graph.prototype.getPageSize = function () {
return (this.pageVisible) ? new mxRectangle(0, 0, this.pageFormat.width * this.pageScale,
this.pageFormat.height * this.pageScale) : this.scrollTileSize;
};
/**
* Returns a rectangle describing the position and count of the
* background pages, where x and y are the position of the top,
* left page and width and height are the vertical and horizontal
* page count.
*/
Graph.prototype.getPageLayout = function () {
var size = this.getPageSize();
var bounds = this.getGraphBounds();
if (bounds.width == 0 || bounds.height == 0) {
return new mxRectangle(0, 0, 1, 1);
} else {
// Computes untransformed graph bounds
var x = Math.ceil(bounds.x / this.view.scale - this.view.translate.x);
var y = Math.ceil(bounds.y / this.view.scale - this.view.translate.y);
var w = Math.floor(bounds.width / this.view.scale);
var h = Math.floor(bounds.height / this.view.scale);
var x0 = Math.floor(x / size.width);
var y0 = Math.floor(y / size.height);
var w0 = Math.ceil((x + w) / size.width) - x0;
var h0 = Math.ceil((y + h) / size.height) - y0;
return new mxRectangle(x0, y0, w0, h0);
}
};
/**
* Sanitizes the given HTML markup.
*/
Graph.prototype.sanitizeHtml = function (value, editing) {
// Uses https://code.google.com/p/google-caja/wiki/JsHtmlSanitizer
// NOTE: Original minimized sanitizer was modified to support
// data URIs for images, mailto and special data:-links.
// LATER: Add MathML to whitelisted tags
function urlX(link) {
if (link != null && link.toString().toLowerCase().substring(0, 11) !== 'javascript:') {
return link;
}
return null;
};
function idX(id) {
return id;
};
return html_sanitize(value, urlX, idX);
};
/**
* Revalidates all cells with placeholders in the current graph model.
*/
Graph.prototype.updatePlaceholders = function () {
var model = this.model;
var validate = false;
for (var key in this.model.cells) {
var cell = this.model.cells[key];
if (this.isReplacePlaceholders(cell)) {
this.view.invalidate(cell, false, false);
validate = true;
}
}
if (validate) {
this.view.validate();
}
};
/**
* Adds support for placeholders in labels.
*/
Graph.prototype.isReplacePlaceholders = function (cell) {
return cell.value != null && typeof (cell.value) == 'object' &&
cell.value.getAttribute('placeholders') == '1';
};
/**
* Returns true if the given mouse wheel event should be used for zooming. This
* is invoked if no dialogs are showing and returns true with Alt or Control
* (except macOS) is pressed.
*/
Graph.prototype.isZoomWheelEvent = function (evt) {
return mxEvent.isAltDown(evt) || (mxEvent.isMetaDown(evt) && mxClient.IS_MAC) ||
(mxEvent.isControlDown(evt) && !mxClient.IS_MAC);
};
/**
* Adds Alt+click to select cells behind cells (Shift+Click on Chrome OS).
*/
Graph.prototype.isTransparentClickEvent = function (evt) {
return mxEvent.isAltDown(evt) || (mxClient.IS_CHROMEOS && mxEvent.isShiftDown(evt));
};
/**
* Adds ctrl+shift+connect to disable connections.
*/
Graph.prototype.isIgnoreTerminalEvent = function (evt) {
return mxEvent.isShiftDown(evt) && mxEvent.isControlDown(evt);
};
/**
* Adds support for placeholders in labels.
*/
Graph.prototype.isSplitTarget = function (target, cells, evt) {
return !this.model.isEdge(cells[0]) &&
!mxEvent.isAltDown(evt) && !mxEvent.isShiftDown(evt) &&
mxGraph.prototype.isSplitTarget.apply(this, arguments);
};
/**
* Adds support for placeholders in labels.
*/
Graph.prototype.getLabel = function (cell) {
var result = mxGraph.prototype.getLabel.apply(this, arguments);
if (result != null && this.isReplacePlaceholders(cell) && cell.getAttribute('placeholder') == null) {
result = this.replacePlaceholders(cell, result);
}
return result;
};
/**
* Adds labelMovable style.
*/
Graph.prototype.isLabelMovable = function (cell) {
var state = this.view.getState(cell);
var style = (state != null) ? state.style : this.getCellStyle(cell);
return !this.isCellLocked(cell) &&
((this.model.isEdge(cell) && this.edgeLabelsMovable) ||
(this.model.isVertex(cell) && (this.vertexLabelsMovable ||
mxUtils.getValue(style, 'labelMovable', '0') == '1')));
};
/**
* Adds event if grid size is changed.
* @param value {number}
*/
Graph.prototype.setGridSize = function (value) {
this.gridSize = value;
this.fireEvent(new mxEventObject('gridSizeChanged'));
};
/**
* Private helper method.
*/
Graph.prototype.getGlobalVariable = function (name) {
var val = null;
if (name == 'date') {
val = new Date().toLocaleDateString();
} else if (name == 'time') {
val = new Date().toLocaleTimeString();
} else if (name == 'timestamp') {
val = new Date().toLocaleString();
} else if (name.substring(0, 5) == 'date{') {
var fmt = name.substring(5, name.length - 1);
val = this.formatDate(new Date(), fmt);
}
return val;
};
/**
* Formats a date, see http://blog.stevenlevithan.com/archives/date-time-format
*/
Graph.prototype.formatDate = function (date, mask, utc) {
// LATER: Cache regexs
if (this.dateFormatCache == null) {
this.dateFormatCache = {
i18n: {
dayNames: [
'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday',
],
monthNames: [
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December',
],
},
masks: {
'default': 'ddd mmm dd yyyy HH:MM:ss',
shortDate: 'm/d/yy',
mediumDate: 'mmm d, yyyy',
longDate: 'mmmm d, yyyy',
fullDate: 'dddd, mmmm d, yyyy',
shortTime: 'h:MM TT',
mediumTime: 'h:MM:ss TT',
longTime: 'h:MM:ss TT Z',
isoDate: 'yyyy-mm-dd',
isoTime: 'HH:MM:ss',
isoDateTime: 'yyyy-mm-dd\'T\'HH:MM:ss',
isoUtcDateTime: 'UTC:yyyy-mm-dd\'T\'HH:MM:ss\'Z\'',
},
};
}
var dF = this.dateFormatCache;
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
timezoneClip = /[^-+\dA-Z]/g,
pad = function (val, len) {
val = String(val);
len = len || 2;
while (val.length < len) val = '0' + val;
return val;
};
// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
if (arguments.length == 1 && Object.prototype.toString.call(date) == '[object String]' && !/\d/.test(date)) {
mask = date;
date = undefined;
}
// Passing date through Date applies Date.parse, if necessary
date = date ? new Date(date) : new Date;
if (isNaN(date)) throw SyntaxError('invalid date');
mask = String(dF.masks[mask] || mask || dF.masks['default']);
// Allow setting the utc argument via the mask
if (mask.slice(0, 4) == 'UTC:') {
mask = mask.slice(4);
utc = true;
}
var _ = utc ? 'getUTC' : 'get',
d = date[_ + 'Date'](),
D = date[_ + 'Day'](),
m = date[_ + 'Month'](),
y = date[_ + 'FullYear'](),
H = date[_ + 'Hours'](),
M = date[_ + 'Minutes'](),
s = date[_ + 'Seconds'](),
L = date[_ + 'Milliseconds'](),
o = utc ? 0 : date.getTimezoneOffset(),
flags = {
d: d,
dd: pad(d),
ddd: dF.i18n.dayNames[D],
dddd: dF.i18n.dayNames[D + 7],
m: m + 1,
mm: pad(m + 1),
mmm: dF.i18n.monthNames[m],
mmmm: dF.i18n.monthNames[m + 12],
yy: String(y).slice(2),
yyyy: y,
h: H % 12 || 12,
hh: pad(H % 12 || 12),
H: H,
HH: pad(H),
M: M,
MM: pad(M),
s: s,
ss: pad(s),
l: pad(L, 3),
L: pad(L > 99 ? Math.round(L / 10) : L),
t: H < 12 ? 'a' : 'p',
tt: H < 12 ? 'am' : 'pm',
T: H < 12 ? 'A' : 'P',
TT: H < 12 ? 'AM' : 'PM',
Z: utc ? 'UTC' : (String(date).match(timezone) || ['']).pop().replace(timezoneClip, ''),
o: (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
S: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10],
};
return mask.replace(token, function ($0) {
return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
});
};
/**
*
*/
Graph.prototype.createLayersDialog = function () {
var div = document.createElement('div');
div.style.position = 'absolute';
var model = this.getModel();
var childCount = model.getChildCount(model.root);
for (var i = 0; i < childCount; i++) {
(mxUtils.bind(this, function (layer) {
var span = document.createElement('div');
span.style.overflow = 'hidden';
span.style.textOverflow = 'ellipsis';
span.style.padding = '2px';
span.style.whiteSpace = 'nowrap';
var cb = document.createElement('input');
cb.style.display = 'inline-block';
cb.setAttribute('type', 'checkbox');
if (model.isVisible(layer)) {
cb.setAttribute('checked', 'checked');
cb.defaultChecked = true;
}
span.appendChild(cb);
var title = this.convertValueToString(layer) || (mxResources.get('background') || 'Background');
span.setAttribute('title', title);
mxUtils.write(span, title);
div.appendChild(span);
mxEvent.addListener(cb, 'click', function () {
if (cb.getAttribute('checked') != null) {
cb.removeAttribute('checked');
} else {
cb.setAttribute('checked', 'checked');
}
model.setVisible(layer, cb.checked);
});
})(model.getChildAt(model.root, i)));
}
return div;
};
/**
* Private helper method.
*/
Graph.prototype.replacePlaceholders = function (cell, str) {
var result = [];
if (str != null) {
var last = 0;
while (match = this.placeholderPattern.exec(str)) {
var val = match[0];
if (val.length > 2 && val != '%label%' && val != '%tooltip%') {
var tmp = null;
if (match.index > last && str.charAt(match.index - 1) == '%') {
tmp = val.substring(1);
} else {
var name = val.substring(1, val.length - 1);
// Workaround for invalid char for getting attribute in older versions of IE
if (name.indexOf('{') < 0) {
var current = cell;
while (tmp == null && current != null) {
if (current.value != null && typeof (current.value) == 'object') {
tmp = (current.hasAttribute(name)) ? ((current.getAttribute(name) != null) ?
current.getAttribute(name) : '') : null;
}
current = this.model.getParent(current);
}
}
if (tmp == null) {
tmp = this.getGlobalVariable(name);
}
}
result.push(str.substring(last, match.index) + ((tmp != null) ? tmp : val));
last = match.index + val.length;
}
}
result.push(str.substring(last));
}
return result.join('');
};
/**
* Resolves the given cells in the model and selects them.
*/
Graph.prototype.restoreSelection = function (cells) {
if (cells != null && cells.length > 0) {
var temp = [];
for (var i = 0; i < cells.length; i++) {
var newCell = this.model.getCell(cells[i].id);
if (newCell != null) {
temp.push(newCell);
}
}
this.setSelectionCells(temp);
} else {
this.clearSelection();
}
};
/**
* Selects cells for connect vertex return value.
*/
Graph.prototype.selectCellsForConnectVertex = function (cells, evt, hoverIcons) {
// Selects only target vertex if one exists
if (cells.length == 2 && this.model.isVertex(cells[1])) {
this.setSelectionCell(cells[1]);
if (hoverIcons != null) {
// Adds hover icons to new target vertex for touch devices
if (mxEvent.isTouchEvent(evt)) {
hoverIcons.update(hoverIcons.getState(this.view.getState(cells[1])));
} else {
// Hides hover icons after click with mouse
hoverIcons.reset();
}
}
this.scrollCellToVisible(cells[1]);
} else {
this.setSelectionCells(cells);
}
};
/**
* Adds a connection to the given vertex.
*/
Graph.prototype.connectVertex = function (source, direction, length, evt, forceClone, ignoreCellAt) {
// Ignores relative edge labels
if (source.geometry.relative && this.model.isEdge(source.parent)) {
return [];
}
ignoreCellAt = (ignoreCellAt) ? ignoreCellAt : false;
var pt = (source.geometry.relative && source.parent.geometry != null) ?
new mxPoint(source.parent.geometry.width * source.geometry.x, source.parent.geometry.height * source.geometry.y) :
new mxPoint(source.geometry.x, source.geometry.y);
if (direction == mxConstants.DIRECTION_NORTH) {
pt.x += source.geometry.width / 2;
pt.y -= length;
} else if (direction == mxConstants.DIRECTION_SOUTH) {
pt.x += source.geometry.width / 2;
pt.y += source.geometry.height + length;
} else if (direction == mxConstants.DIRECTION_WEST) {
pt.x -= length;
pt.y += source.geometry.height / 2;
} else {
pt.x += source.geometry.width + length;
pt.y += source.geometry.height / 2;
}
var parentState = this.view.getState(this.model.getParent(source));
var s = this.view.scale;
var t = this.view.translate;
var dx = t.x * s;
var dy = t.y * s;
if (parentState != null && this.model.isVertex(parentState.cell)) {
dx = parentState.x;
dy = parentState.y;
}
// Workaround for relative child cells
if (this.model.isVertex(source.parent) && source.geometry.relative) {
pt.x += source.parent.geometry.x;
pt.y += source.parent.geometry.y;
}
// Checks actual end point of edge for target cell
var target = (ignoreCellAt || (mxEvent.isControlDown(evt) && !forceClone)) ?
null : this.getCellAt(dx + pt.x * s, dy + pt.y * s);
if (this.model.isAncestor(target, source)) {
target = null;
}
// Checks if target or ancestor is locked
var temp = target;
while (temp != null) {
if (this.isCellLocked(temp)) {
target = null;
break;
}
temp = this.model.getParent(temp);
}
// Checks if source and target intersect
if (target != null) {
var sourceState = this.view.getState(source);
var targetState = this.view.getState(target);
if (sourceState != null && targetState != null && mxUtils.intersects(sourceState, targetState)) {
target = null;
}
}
var duplicate = !mxEvent.isShiftDown(evt) || forceClone;
if (duplicate) {
if (direction == mxConstants.DIRECTION_NORTH) {
pt.y -= source.geometry.height / 2;
} else if (direction == mxConstants.DIRECTION_SOUTH) {
pt.y += source.geometry.height / 2;
} else if (direction == mxConstants.DIRECTION_WEST) {
pt.x -= source.geometry.width / 2;
} else {
pt.x += source.geometry.width / 2;
}
}
// Uses connectable parent vertex if one exists
if (target != null && !this.isCellConnectable(target)) {
var parent = this.getModel().getParent(target);
if (this.getModel().isVertex(parent) && this.isCellConnectable(parent)) {
target = parent;
}
}
if (target == source || this.model.isEdge(target) || !this.isCellConnectable(target)) {
target = null;
}
var result = [];
this.model.beginUpdate();
try {
var realTarget = target;
if (realTarget == null && duplicate) {
// Handles relative children
var cellToClone = source;
var geo = this.getCellGeometry(source);
while (geo != null && geo.relative) {
cellToClone = this.getModel().getParent(cellToClone);
geo = this.getCellGeometry(cellToClone);
}
// Handle consistuents for cloning
var state = this.view.getState(cellToClone);
var style = (state != null) ? state.style : this.getCellStyle(cellToClone);
if (mxUtils.getValue(style, 'part', false)) {
var tmpParent = this.model.getParent(cellToClone);
if (this.model.isVertex(tmpParent)) {
cellToClone = tmpParent;
}
}
realTarget = this.duplicateCells([cellToClone], false)[0];
var geo = this.getCellGeometry(realTarget);
if (geo != null) {
geo.x = pt.x - geo.width / 2;
geo.y = pt.y - geo.height / 2;
}
}
// Never connects children in stack layouts
var layout = null;
if (this.layoutManager != null) {
layout = this.layoutManager.getLayout(this.model.getParent(source));
}
var edge = ((mxEvent.isControlDown(evt) && duplicate) || (target == null && layout != null && layout.constructor == mxStackLayout)) ? null :
this.insertEdge(this.model.getParent(source), null, '', source, realTarget, this.createCurrentEdgeStyle());
// Inserts edge before source
if (edge != null && this.connectionHandler.insertBeforeSource) {
var index = null;
var tmp = source;
while (tmp.parent != null && tmp.geometry != null &&
tmp.geometry.relative && tmp.parent != edge.parent) {
tmp = this.model.getParent(tmp);
}
if (tmp != null && tmp.parent != null && tmp.parent == edge.parent) {
var index = tmp.parent.getIndex(tmp);
this.model.add(tmp.parent, edge, index);
}
}
// Special case: Click on west icon puts clone before cell
if (target == null && realTarget != null && layout != null && source.parent != null &&
layout.constructor == mxStackLayout && direction == mxConstants.DIRECTION_WEST) {
var index = source.parent.getIndex(source);
this.model.add(source.parent, realTarget, index);
}
if (edge != null) {
result.push(edge);
}
if (target == null && realTarget != null) {
result.push(realTarget);
}
if (realTarget == null && edge != null) {
edge.geometry.setTerminalPoint(pt, false);
}
if (edge != null) {
this.fireEvent(new mxEventObject('cellsInserted', 'cells', [edge]));
}
} finally {
this.model.endUpdate();
}
return result;
};
/**
* Returns all labels in the diagram as a string.
*/
Graph.prototype.getIndexableText = function () {
var tmp = document.createElement('div');
var labels = [];
var label = '';
for (var key in this.model.cells) {
var cell = this.model.cells[key];
if (this.model.isVertex(cell) || this.model.isEdge(cell)) {
if (this.isHtmlLabel(cell)) {
tmp.innerHTML = this.getLabel(cell);
label = mxUtils.extractTextWithWhitespace([tmp]);
} else {
label = this.getLabel(cell);
}
label = mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g, ' '));
if (label.length > 0) {
labels.push(label);
}
}
}
return labels.join(' ');
};
/**
* Returns the label for the given cell.
*/
Graph.prototype.convertValueToString = function (cell) {
if (cell.value != null && typeof (cell.value) == 'object') {
if (this.isReplacePlaceholders(cell) && cell.getAttribute('placeholder') != null) {
var name = cell.getAttribute('placeholder');
var current = cell;
var result = null;
while (result == null && current != null) {
if (current.value != null && typeof (current.value) == 'object') {
result = (current.hasAttribute(name)) ? ((current.getAttribute(name) != null) ?
current.getAttribute(name) : '') : null;
}
current = this.model.getParent(current);
}
return result || '';
} else {
return cell.value.getAttribute('label') || '';
}
}
return mxGraph.prototype.convertValueToString.apply(this, arguments);
};
/**
* Returns the link for the given cell.
*/
Graph.prototype.getLinksForState = function (state) {
if (state != null && state.text != null && state.text.node != null) {
return state.text.node.getElementsByTagName('a');
}
return null;
};
/**
* Returns the link for the given cell.
*/
Graph.prototype.getLinkForCell = function (cell) {
if (cell.value != null && typeof (cell.value) == 'object') {
var link = cell.value.getAttribute('link');
// Removes links with leading javascript: protocol
// TODO: Check more possible attack vectors
if (link != null && link.toLowerCase().substring(0, 11) === 'javascript:') {
link = link.substring(11);
}
return link;
}
return null;
};
/**
* Overrides label orientation for collapsed swimlanes inside stack.
*/
Graph.prototype.getCellStyle = function (cell) {
var style = mxGraph.prototype.getCellStyle.apply(this, arguments);
if (cell != null && this.layoutManager != null) {
var parent = this.model.getParent(cell);
if (this.model.isVertex(parent) && this.isCellCollapsed(cell)) {
var layout = this.layoutManager.getLayout(parent);
if (layout != null && layout.constructor == mxStackLayout) {
style[mxConstants.STYLE_HORIZONTAL] = !layout.horizontal;
}
}
}
return style;
};
/**
* Disables alternate width persistence for stack layout parents
*/
Graph.prototype.updateAlternateBounds = function (cell, geo, willCollapse) {
if (cell != null && geo != null && this.layoutManager != null && geo.alternateBounds != null) {
var layout = this.layoutManager.getLayout(this.model.getParent(cell));
if (layout != null && layout.constructor == mxStackLayout) {
if (layout.horizontal) {
geo.alternateBounds.height = 0;
} else {
geo.alternateBounds.width = 0;
}
}
}
mxGraph.prototype.updateAlternateBounds.apply(this, arguments);
};
/**
* Adds Shift+collapse/expand and size management for folding inside stack
*/
Graph.prototype.isMoveCellsEvent = function (evt) {
return mxEvent.isShiftDown(evt);
};
/**
* Adds Shift+collapse/expand and size management for folding inside stack
*/
Graph.prototype.foldCells = function (collapse, recurse, cells, checkFoldable, evt) {
recurse = (recurse != null) ? recurse : false;
if (cells == null) {
cells = this.getFoldableCells(this.getSelectionCells(), collapse);
}
if (cells != null) {
this.model.beginUpdate();
try {
mxGraph.prototype.foldCells.apply(this, arguments);
// Resizes all parent stacks if alt is not pressed
if (this.layoutManager != null) {
for (var i = 0; i < cells.length; i++) {
var state = this.view.getState(cells[i]);
var geo = this.getCellGeometry(cells[i]);
if (state != null && geo != null) {
var dx = Math.round(geo.width - state.width / this.view.scale);
var dy = Math.round(geo.height - state.height / this.view.scale);
if (dy != 0 || dx != 0) {
var parent = this.model.getParent(cells[i]);
var layout = this.layoutManager.getLayout(parent);
if (layout == null) {
// Moves cells to the right and down after collapse/expand
if (evt != null && this.isMoveCellsEvent(evt)) {
this.moveSiblings(state, parent, dx, dy);
}
} else if ((evt == null || !mxEvent.isAltDown(evt)) && layout.constructor == mxStackLayout && !layout.resizeLast) {
this.resizeParentStacks(parent, layout, dx, dy);
}
}
}
}
}
} finally {
this.model.endUpdate();
}
// Selects cells after folding
if (this.isEnabled()) {
this.setSelectionCells(cells);
}
}
};
/**
* Overrides label orientation for collapsed swimlanes inside stack.
*/
Graph.prototype.moveSiblings = function (state, parent, dx, dy) {
this.model.beginUpdate();
try {
var cells = this.getCellsBeyond(state.x, state.y, parent, true, true);
for (var i = 0; i < cells.length; i++) {
if (cells[i] != state.cell) {
var tmp = this.view.getState(cells[i]);
var geo = this.getCellGeometry(cells[i]);
if (tmp != null && geo != null) {
geo = geo.clone();
geo.translate(Math.round(dx * Math.max(0, Math.min(1, (tmp.x - state.x) / state.width))),
Math.round(dy * Math.max(0, Math.min(1, (tmp.y - state.y) / state.height))));
this.model.setGeometry(cells[i], geo);
}
}
}
} finally {
this.model.endUpdate();
}
};
/**
* Overrides label orientation for collapsed swimlanes inside stack.
*/
Graph.prototype.resizeParentStacks = function (parent, layout, dx, dy) {
if (this.layoutManager != null && layout != null && layout.constructor == mxStackLayout && !layout.resizeLast) {
this.model.beginUpdate();
try {
var dir = layout.horizontal;
// Bubble resize up for all parent stack layouts with same orientation
while (parent != null && layout != null && layout.constructor == mxStackLayout &&
layout.horizontal == dir && !layout.resizeLast) {
var pgeo = this.getCellGeometry(parent);
var pstate = this.view.getState(parent);
if (pstate != null && pgeo != null) {
pgeo = pgeo.clone();
if (layout.horizontal) {
pgeo.width += dx + Math.min(0, pstate.width / this.view.scale - pgeo.width);
} else {
pgeo.height += dy + Math.min(0, pstate.height / this.view.scale - pgeo.height);
}
this.model.setGeometry(parent, pgeo);
}
parent = this.model.getParent(parent);
layout = this.layoutManager.getLayout(parent);
}
} finally {
this.model.endUpdate();
}
}
};
/**
* Disables drill-down for non-swimlanes.
*/
Graph.prototype.isContainer = function (cell) {
var state = this.view.getState(cell);
var style = (state != null) ? state.style : this.getCellStyle(cell);
if (this.isSwimlane(cell)) {
return style['container'] != '0';
} else {
return style['container'] == '1';
}
};
/**
* Adds a connectable style.
*/
Graph.prototype.isCellConnectable = function (cell) {
var state = this.view.getState(cell);
var style = (state != null) ? state.style : this.getCellStyle(cell);
return (style != null && style['connectable'] != null) ? style['connectable'] != '0' :
mxGraph.prototype.isCellConnectable.apply(this, arguments);
};
/**
* Function: selectAll
*
* Selects all children of the given parent cell or the children of the
* default parent if no parent is specified. To select leaf vertices and/or
* edges use <selectCells>.
*
* Parameters:
*
* parent - Optional <mxCell> whose children should be selected.
* Default is <defaultParent>.
*/
Graph.prototype.selectAll = function (parent) {
parent = parent || this.getDefaultParent();
if (!this.isCellLocked(parent)) {
mxGraph.prototype.selectAll.apply(this, arguments);
}
};
/**
* Function: selectCells
*
* Selects all vertices and/or edges depending on the given boolean
* arguments recursively, starting at the given parent or the default
* parent if no parent is specified. Use <selectAll> to select all cells.
* For vertices, only cells with no children are selected.
*
* Parameters:
*
* vertices - Boolean indicating if vertices should be selected.
* edges - Boolean indicating if edges should be selected.
* parent - Optional <mxCell> that acts as the root of the recursion.
* Default is <defaultParent>.
*/
Graph.prototype.selectCells = function (vertices, edges, parent) {
parent = parent || this.getDefaultParent();
if (!this.isCellLocked(parent)) {
mxGraph.prototype.selectCells.apply(this, arguments);
}
};
/**
* Function: getSwimlaneAt
*
* Returns the bottom-most swimlane that intersects the given point (x, y)
* in the cell hierarchy that starts at the given parent.
*
* Parameters:
*
* x - X-coordinate of the location to be checked.
* y - Y-coordinate of the location to be checked.
* parent - <mxCell> that should be used as the root of the recursion.
* Default is <defaultParent>.
*/
Graph.prototype.getSwimlaneAt = function (x, y, parent) {
parent = parent || this.getDefaultParent();
if (!this.isCellLocked(parent)) {
return mxGraph.prototype.getSwimlaneAt.apply(this, arguments);
}
return null;
};
/**
* Disables folding for non-swimlanes.
*/
Graph.prototype.isCellFoldable = function (cell) {
var state = this.view.getState(cell);
var style = (state != null) ? state.style : this.getCellStyle(cell);
return this.foldingEnabled && (style['treeFolding'] == '1' ||
(!this.isCellLocked(cell) &&
((this.isContainer(cell) && style['collapsible'] != '0') ||
(!this.isContainer(cell) && style['collapsible'] == '1'))));
};
/**
* Stops all interactions and clears the selection.
*/
Graph.prototype.reset = function () {
if (this.isEditing()) {
this.stopEditing(true);
}
this.escape();
if (!this.isSelectionEmpty()) {
this.clearSelection();
}
};
/**
* Overridden to limit zoom to 1% - 16.000%.
*/
Graph.prototype.zoom = function (factor, center) {
factor = Math.max(0.01, Math.min(this.view.scale * factor, 160)) / this.view.scale;
mxGraph.prototype.zoom.apply(this, arguments);
};
/**
* Function: zoomIn
*
* Zooms into the graph by <zoomFactor>.
*/
Graph.prototype.zoomIn = function () {
// Switches to 1% zoom steps below 15%
if (this.view.scale < 0.15) {
this.zoom((this.view.scale + 0.01) / this.view.scale);
} else {
// Uses to 5% zoom steps for better grid rendering in webkit
// and to avoid rounding errors for zoom steps
this.zoom((Math.round(this.view.scale * this.zoomFactor * 20) / 20) / this.view.scale);
}
};
/**
* Function: zoomOut
*
* Zooms out of the graph by <zoomFactor>.
*/
Graph.prototype.zoomOut = function () {
// Switches to 1% zoom steps below 15%
if (this.view.scale <= 0.15) {
this.zoom((this.view.scale - 0.01) / this.view.scale);
} else {
// Uses to 5% zoom steps for better grid rendering in webkit
// and to avoid rounding errors for zoom steps
this.zoom((Math.round(this.view.scale * (1 / this.zoomFactor) * 20) / 20) / this.view.scale);
}
};
/**
* Overrides tooltips to show custom tooltip or metadata.
*/
Graph.prototype.getTooltipForCell = function (cell) {
var tip = '';
if (mxUtils.isNode(cell.value)) {
var tmp = cell.value.getAttribute('tooltip');
if (tmp != null) {
if (tmp != null && this.isReplacePlaceholders(cell)) {
tmp = this.replacePlaceholders(cell, tmp);
}
tip = this.sanitizeHtml(tmp);
} else {
var ignored = this.builtInProperties;
var attrs = cell.value.attributes;
var temp = [];
// Hides links in edit mode
if (this.isEnabled()) {
ignored.push('link');
}
for (var i = 0; i < attrs.length; i++) {
if (mxUtils.indexOf(ignored, attrs[i].nodeName) < 0 && attrs[i].nodeValue.length > 0) {
temp.push({name: attrs[i].nodeName, value: attrs[i].nodeValue});
}
}
// Sorts by name
temp.sort(function (a, b) {
if (a.name < b.name) {
return -1;
} else if (a.name > b.name) {
return 1;
} else {
return 0;
}
});
for (var i = 0; i < temp.length; i++) {
if (temp[i].name != 'link' || !this.isCustomLink(temp[i].value)) {
tip += ((temp[i].name != 'link') ? '<b>' + temp[i].name + ':</b> ' : '') +
mxUtils.htmlEntities(temp[i].value) + '\n';
}
}
if (tip.length > 0) {
tip = tip.substring(0, tip.length - 1);
if (mxClient.IS_SVG) {
tip = '<div style="max-width:360px;">' + tip + '</div>';
}
}
}
}
return tip;
};
/**
* Turns the given string into an array.
*/
Graph.prototype.stringToBytes = function (str) {
return Graph.stringToBytes(str);
};
/**
* Turns the given array into a string.
*/
Graph.prototype.bytesToString = function (arr) {
return Graph.bytesToString(arr);
};
/**
* Returns a base64 encoded version of the compressed outer XML of the given node.
*/
Graph.prototype.compressNode = function (node) {
return Graph.compressNode(node);
};
/**
* Returns a base64 encoded version of the compressed string.
*/
Graph.prototype.compress = function (data, deflate) {
return Graph.compress(data, deflate);
};
/**
* Returns a decompressed version of the base64 encoded string.
*/
Graph.prototype.decompress = function (data, inflate) {
return Graph.decompress(data, inflate);
};
/**
* Redirects to Graph.zapGremlins.
*/
Graph.prototype.zapGremlins = function (text) {
return Graph.zapGremlins(text);
};
/**
* Hover icons are used for hover, vertex handler and drag from sidebar.
* @class
*/
HoverIcons = function (graph) {
this.graph = graph;
this.init();
};
/**
* Up arrow.
*/
HoverIcons.prototype.arrowSpacing = 2;
/**
* Delay to switch to another state for overlapping bbox. Default is 500ms.
*/
HoverIcons.prototype.updateDelay = 500;
/**
* Delay to switch between states. Default is 140ms.
*/
HoverIcons.prototype.activationDelay = 140;
/**
* Up arrow.
*/
HoverIcons.prototype.currentState = null;
/**
* Up arrow.
*/
HoverIcons.prototype.activeArrow = null;
/**
* Up arrow.
*/
HoverIcons.prototype.inactiveOpacity = 15;
/**
* Up arrow.
*/
HoverIcons.prototype.cssCursor = 'copy';
/**
* Whether to hide arrows that collide with vertices.
* LATER: Add keyboard override, touch support.
*/
HoverIcons.prototype.checkCollisions = true;
/**
* Up arrow.
*/
HoverIcons.prototype.arrowFill = '#29b6f2';
/**
* Up arrow.
*/
HoverIcons.prototype.triangleUp = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/triangle-up.png', 26, 14) :
Graph.createSvgImage(18, 28, '<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" ' +
'stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '"/>');
/**
* Right arrow.
*/
HoverIcons.prototype.triangleRight = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/triangle-right.png', 14, 26) :
Graph.createSvgImage(26, 18, '<path d="m 1 6 L 14 6 L 14 1 L 26 9 L 14 18 L 14 12 L 1 12 z" ' +
'stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '"/>');
/**
* Down arrow.
*/
HoverIcons.prototype.triangleDown = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/triangle-down.png', 26, 14) :
Graph.createSvgImage(18, 26, '<path d="m 6 1 L 6 14 L 1 14 L 9 26 L 18 14 L 12 14 L 12 1 z" ' +
'stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '"/>');
/**
* Left arrow.
*/
HoverIcons.prototype.triangleLeft = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/triangle-left.png', 14, 26) :
Graph.createSvgImage(28, 18, '<path d="m 1 9 L 12 1 L 12 6 L 26 6 L 26 12 L 12 12 L 12 18 z" ' +
'stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '"/>');
/**
* Round target.
*/
HoverIcons.prototype.roundDrop = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/round-drop.png', 26, 26) :
Graph.createSvgImage(26, 26, '<circle cx="13" cy="13" r="12" ' +
'stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '"/>');
/**
* Refresh target.
*/
HoverIcons.prototype.refreshTarget = new mxImage((mxClient.IS_SVG) ? 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDQxNERDRTU1QjY1MTFFNDkzNTRFQTVEMTdGMTdBQjciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDQxNERDRTY1QjY1MTFFNDkzNTRFQTVEMTdGMTdBQjciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0NDE0RENFMzVCNjUxMUU0OTM1NEVBNUQxN0YxN0FCNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0NDE0RENFNDVCNjUxMUU0OTM1NEVBNUQxN0YxN0FCNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsvuX50AAANaSURBVHja7FjRZ1tRGD9ZJ1NCyIQSwrivI4Q8hCpjlFDyFEoYfSp9Ko1QWnmo0If+BSXkIfo0QirTMUpeGo2EPfWllFYjZMLKLDJn53d3biU337m5J223bPbxk5t7v+/c3/2+73znO8fDOWezKM/YjMpz68Lj8ejY+QTeCCwLxOS9qPxtyN+6wAeBTwJ31CCO0cJDjXBGBN4LfIepSwykTUT1bgpuib0SONIgo8KRHOtRiCFcvUcgZeGrHPNBxLIyFPyRgTGz0xLbegJCdmzpElue5KlAIMDX19d5uVzm5+fnfDAYmMA17uEZdOx2Yvb/sHlu2S0xwymn5ufneTab5b1ej08S6EAXNrDd2dnhiUTim21MvMtwQ6yiIrWwsMDPzs64rsBmf3/fvM7n89TYlUnEllSkQqEQv7q64g+Vk5MTVXosORErU0Zer5f0FEIlw2N6MxwO82QyaXql2+2SxDqdjopYWUUsqEp45IldqtWq6UWVh/1+P7+8vCTJ4QMUJSRIEXuneoH96w8PDyeWAnhSJfCqwm6NIlaklFdXV0cGhRcQ2mlJQXK5nMq2YPEZbnteU1U2lUqN/D84OGD9fl+5fgnSrFarsUwmw0qlEru4uBjTicViTk3Cr27HSnxR+Doyz0ZE1CAWiUTusbu7y9rttlZv5fP5WDQavYfIMba4uEipfhF8XtqJoZXx/uH+sC/4vPg7OljZZQbsCmLtYzc3N6zRaJhotVrmfx0xDINtbm6athYUeXpHdbBNaqZUKpWxWXV7e2vex+xaWVnhc3NzjrPUXgexyCt0m67LBV7uJMITjqRE4o8tZeg8FPpFitgapYxiOC0poFgsji1jKNo6BZZckrAGUtJsNk1vqAihCBcKhTE7hNWhqw2qFnGy5UFOUYJVIJ1OjzSE+BCEilon0URavRmBqnbbQ00AXbm+vnZc9O1tj72OnQoc2+cwygRkb2+P1et17ZoEm3g87lRmjgWZ00kbXkNuse6/Bu2wlegIxfb2tuvWGroO4bO2c4bbzUh60mxDXm1sbJhhxkQYnhS4h2fUZoRAWnf7lv8N27f8P7Xhnekjgpk+VKGOoQbsiY+hhhtF3YO7twIJ+ULvUGv+GQ2fQEvWxI/THNx5/p/BaspPAQYAqStgiSQwCDoAAAAASUVORK5CYII=' :
IMAGE_PATH + '/refresh.png', 38, 38);
/**
* Tolerance for hover icon clicks.
*/
HoverIcons.prototype.tolerance = (mxClient.IS_TOUCH) ? 6 : 0;
/**
*
*/
HoverIcons.prototype.init = function () {
this.arrowUp = this.createArrow(this.triangleUp, mxResources.get('plusTooltip'));
this.arrowRight = this.createArrow(this.triangleRight, mxResources.get('plusTooltip'));
this.arrowDown = this.createArrow(this.triangleDown, mxResources.get('plusTooltip'));
this.arrowLeft = this.createArrow(this.triangleLeft, mxResources.get('plusTooltip'));
this.elts = [this.arrowUp, this.arrowRight, this.arrowDown, this.arrowLeft];
this.repaintHandler = mxUtils.bind(this, function () {
this.repaint();
});
this.graph.selectionModel.addListener(mxEvent.CHANGE, this.repaintHandler);
this.graph.model.addListener(mxEvent.CHANGE, this.repaintHandler);
this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE, this.repaintHandler);
this.graph.view.addListener(mxEvent.TRANSLATE, this.repaintHandler);
this.graph.view.addListener(mxEvent.SCALE, this.repaintHandler);
this.graph.view.addListener(mxEvent.DOWN, this.repaintHandler);
this.graph.view.addListener(mxEvent.UP, this.repaintHandler);
this.graph.addListener(mxEvent.ROOT, this.repaintHandler);
// Resets the mouse point on escape
this.graph.addListener(mxEvent.ESCAPE, mxUtils.bind(this, function () {
this.mouseDownPoint = null;
}));
// Removes hover icons if mouse leaves the container
mxEvent.addListener(this.graph.container, 'mouseleave', mxUtils.bind(this, function (evt) {
// Workaround for IE11 firing mouseleave for touch in diagram
if (evt.relatedTarget != null && mxEvent.getSource(evt) == this.graph.container) {
this.setDisplay('none');
}
}));
// Resets current state when in-place editor starts
this.graph.addListener(mxEvent.START_EDITING, mxUtils.bind(this, function (evt) {
this.reset();
}));
// Resets current state after update of selection state for touch events
var graphClick = this.graph.click;
this.graph.click = mxUtils.bind(this, function (me) {
graphClick.apply(this.graph, arguments);
if (this.currentState != null && !this.graph.isCellSelected(this.currentState.cell) &&
mxEvent.isTouchEvent(me.getEvent()) && !this.graph.model.isVertex(me.getCell())) {
this.reset();
}
});
// Checks if connection handler was active in mouse move
// as workaround for possible double connection inserted
var connectionHandlerActive = false;
// Implements a listener for hover and click handling
this.graph.addMouseListener(
{
mouseDown: mxUtils.bind(this, function (sender, me) {
connectionHandlerActive = false;
var evt = me.getEvent();
if (this.isResetEvent(evt)) {
this.reset();
} else if (!this.isActive()) {
var state = this.getState(me.getState());
if (state != null || !mxEvent.isTouchEvent(evt)) {
this.update(state);
}
}
this.setDisplay('none');
}),
mouseMove: mxUtils.bind(this, function (sender, me) {
var evt = me.getEvent();
if (this.isResetEvent(evt)) {
this.reset();
} else if (!this.graph.isMouseDown && !mxEvent.isTouchEvent(evt)) {
this.update(this.getState(me.getState()),
me.getGraphX(), me.getGraphY());
}
if (this.graph.connectionHandler != null &&
this.graph.connectionHandler.shape != null) {
connectionHandlerActive = true;
}
}),
mouseUp: mxUtils.bind(this, function (sender, me) {
var evt = me.getEvent();
var pt = mxUtils.convertPoint(this.graph.container,
mxEvent.getClientX(evt), mxEvent.getClientY(evt));
if (this.isResetEvent(evt)) {
this.reset();
} else if (this.isActive() && !connectionHandlerActive &&
this.mouseDownPoint != null) {
this.click(this.currentState, this.getDirection(), me);
} else if (this.isActive()) {
// Selects target vertex after drag and clone if not only new edge was inserted
if (this.graph.getSelectionCount() != 1 || !this.graph.model.isEdge(
this.graph.getSelectionCell())) {
this.update(this.getState(this.graph.view.getState(
this.graph.getCellAt(me.getGraphX(), me.getGraphY()))));
} else {
this.reset();
}
} else if (mxEvent.isTouchEvent(evt) || (this.bbox != null &&
mxUtils.contains(this.bbox, me.getGraphX(), me.getGraphY()))) {
// Shows existing hover icons if inside bounding box
this.setDisplay('');
this.repaint();
} else if (!mxEvent.isTouchEvent(evt)) {
this.reset();
}
connectionHandlerActive = false;
this.resetActiveArrow();
}),
});
};
/**
*
*/
HoverIcons.prototype.isResetEvent = function (evt, allowShift) {
return mxEvent.isAltDown(evt) || (this.activeArrow == null && mxEvent.isShiftDown(evt)) ||
mxEvent.isMetaDown(evt) || (mxEvent.isPopupTrigger(evt) && !mxEvent.isControlDown(evt));
};
/**
*
*/
HoverIcons.prototype.createArrow = function (img, tooltip) {
var arrow = null;
if (mxClient.IS_IE && !mxClient.IS_SVG) {
// Workaround for PNG images in IE6
if (mxClient.IS_IE6 && document.compatMode != 'CSS1Compat') {
arrow = document.createElement(mxClient.VML_PREFIX + ':image');
arrow.setAttribute('src', img.src);
arrow.style.borderStyle = 'none';
} else {
arrow = document.createElement('div');
arrow.style.backgroundImage = 'url(' + img.src + ')';
arrow.style.backgroundPosition = 'center';
arrow.style.backgroundRepeat = 'no-repeat';
}
arrow.style.width = (img.width + 4) + 'px';
arrow.style.height = (img.height + 4) + 'px';
arrow.style.display = (mxClient.IS_QUIRKS) ? 'inline' : 'inline-block';
} else {
arrow = mxUtils.createImage(img.src);
arrow.style.width = img.width + 'px';
arrow.style.height = img.height + 'px';
arrow.style.padding = this.tolerance + 'px';
}
if (tooltip != null) {
arrow.setAttribute('title', tooltip);
}
arrow.style.position = 'absolute';
arrow.style.cursor = this.cssCursor;
mxEvent.addGestureListeners(arrow, mxUtils.bind(this, function (evt) {
if (this.currentState != null && !this.isResetEvent(evt)) {
this.mouseDownPoint = mxUtils.convertPoint(this.graph.container,
mxEvent.getClientX(evt), mxEvent.getClientY(evt));
this.drag(evt, this.mouseDownPoint.x, this.mouseDownPoint.y);
this.activeArrow = arrow;
this.setDisplay('none');
mxEvent.consume(evt);
}
}));
// Captures mouse events as events on graph
mxEvent.redirectMouseEvents(arrow, this.graph, this.currentState);
mxEvent.addListener(arrow, 'mouseenter', mxUtils.bind(this, function (evt) {
// Workaround for Firefox firing mouseenter on touchend
if (mxEvent.isMouseEvent(evt)) {
if (this.activeArrow != null && this.activeArrow != arrow) {
mxUtils.setOpacity(this.activeArrow, this.inactiveOpacity);
}
this.graph.connectionHandler.constraintHandler.reset();
mxUtils.setOpacity(arrow, 100);
this.activeArrow = arrow;
}
}));
mxEvent.addListener(arrow, 'mouseleave', mxUtils.bind(this, function (evt) {
// Workaround for IE11 firing this event on touch
if (!this.graph.isMouseDown) {
this.resetActiveArrow();
}
}));
return arrow;
};
/**
*
*/
HoverIcons.prototype.resetActiveArrow = function () {
if (this.activeArrow != null) {
mxUtils.setOpacity(this.activeArrow, this.inactiveOpacity);
this.activeArrow = null;
}
};
/**
*
*/
HoverIcons.prototype.getDirection = function () {
var dir = mxConstants.DIRECTION_EAST;
if (this.activeArrow == this.arrowUp) {
dir = mxConstants.DIRECTION_NORTH;
} else if (this.activeArrow == this.arrowDown) {
dir = mxConstants.DIRECTION_SOUTH;
} else if (this.activeArrow == this.arrowLeft) {
dir = mxConstants.DIRECTION_WEST;
}
return dir;
};
/**
*
*/
HoverIcons.prototype.visitNodes = function (visitor) {
for (var i = 0; i < this.elts.length; i++) {
if (this.elts[i] != null) {
visitor(this.elts[i]);
}
}
};
/**
*
*/
HoverIcons.prototype.removeNodes = function () {
this.visitNodes(function (elt) {
if (elt.parentNode != null) {
elt.parentNode.removeChild(elt);
}
});
};
/**
*
*/
HoverIcons.prototype.setDisplay = function (display) {
this.visitNodes(function (elt) {
elt.style.display = display;
});
};
/**
*
*/
HoverIcons.prototype.isActive = function () {
return this.activeArrow != null && this.currentState != null;
};
/**
*
*/
HoverIcons.prototype.drag = function (evt, x, y) {
this.graph.popupMenuHandler.hideMenu();
this.graph.stopEditing(false);
// Checks if state was removed in call to stopEditing above
if (this.currentState != null) {
this.graph.connectionHandler.start(this.currentState, x, y);
this.graph.isMouseTrigger = mxEvent.isMouseEvent(evt);
this.graph.isMouseDown = true;
// Hides handles for selection cell
var handler = this.graph.selectionCellsHandler.getHandler(this.currentState.cell);
if (handler != null) {
handler.setHandlesVisible(false);
}
// Ctrl+shift drag sets source constraint
var es = this.graph.connectionHandler.edgeState;
if (evt != null && mxEvent.isShiftDown(evt) && mxEvent.isControlDown(evt) && es != null &&
mxUtils.getValue(es.style, mxConstants.STYLE_EDGE, null) === 'orthogonalEdgeStyle') {
var direction = this.getDirection();
es.cell.style = mxUtils.setStyle(es.cell.style, 'sourcePortConstraint', direction);
es.style['sourcePortConstraint'] = direction;
}
}
};
/**
*
*/
HoverIcons.prototype.getStateAt = function (state, x, y) {
return this.graph.view.getState(this.graph.getCellAt(x, y));
};
/**
*
*/
HoverIcons.prototype.click = function (state, dir, me) {
var evt = me.getEvent();
var x = me.getGraphX();
var y = me.getGraphY();
var tmp = this.getStateAt(state, x, y);
if (tmp != null && this.graph.model.isEdge(tmp.cell) && !mxEvent.isControlDown(evt) &&
(tmp.getVisibleTerminalState(true) == state || tmp.getVisibleTerminalState(false) == state)) {
this.graph.setSelectionCell(tmp.cell);
this.reset();
} else if (state != null) {
var cells = this.graph.connectVertex(state.cell, dir, this.graph.defaultEdgeLength, evt);
this.graph.selectCellsForConnectVertex(cells, evt, this);
// Selects only target vertex if one exists
if (cells.length == 2 && this.graph.model.isVertex(cells[1])) {
this.graph.setSelectionCell(cells[1]);
// Adds hover icons to new target vertex for touch devices
if (mxEvent.isTouchEvent(evt)) {
this.update(this.getState(this.graph.view.getState(cells[1])));
} else {
// Hides hover icons after click with mouse
this.reset();
}
this.graph.scrollCellToVisible(cells[1]);
} else {
this.graph.setSelectionCells(cells);
}
}
me.consume();
};
/**
*
*/
HoverIcons.prototype.reset = function (clearTimeout) {
clearTimeout = (clearTimeout == null) ? true : clearTimeout;
if (clearTimeout && this.updateThread != null) {
window.clearTimeout(this.updateThread);
}
this.mouseDownPoint = null;
this.currentState = null;
this.activeArrow = null;
this.removeNodes();
this.bbox = null;
};
/**
*
*/
HoverIcons.prototype.repaint = function () {
this.bbox = null;
if (this.currentState != null) {
// Checks if cell was deleted
this.currentState = this.getState(this.currentState);
// Cell was deleted
if (this.currentState != null &&
this.graph.model.isVertex(this.currentState.cell) &&
this.graph.isCellConnectable(this.currentState.cell)) {
var bds = mxRectangle.fromRectangle(this.currentState);
// Uses outer bounding box to take rotation into account
if (this.currentState.shape != null && this.currentState.shape.boundingBox != null) {
bds = mxRectangle.fromRectangle(this.currentState.shape.boundingBox);
}
bds.grow(this.graph.tolerance);
bds.grow(this.arrowSpacing);
var handler = this.graph.selectionCellsHandler.getHandler(this.currentState.cell);
if (handler != null) {
bds.x -= handler.horizontalOffset / 2;
bds.y -= handler.verticalOffset / 2;
bds.width += handler.horizontalOffset;
bds.height += handler.verticalOffset;
// Adds bounding box of rotation handle to avoid overlap
if (handler.rotationShape != null && handler.rotationShape.node != null &&
handler.rotationShape.node.style.visibility != 'hidden' &&
handler.rotationShape.node.style.display != 'none' &&
handler.rotationShape.boundingBox != null) {
bds.add(handler.rotationShape.boundingBox);
}
}
this.arrowUp.style.left = Math.round(this.currentState.getCenterX() - this.triangleUp.width / 2 - this.tolerance) + 'px';
this.arrowUp.style.top = Math.round(bds.y - this.triangleUp.height - this.tolerance) + 'px';
mxUtils.setOpacity(this.arrowUp, this.inactiveOpacity);
this.arrowRight.style.left = Math.round(bds.x + bds.width - this.tolerance) + 'px';
this.arrowRight.style.top = Math.round(this.currentState.getCenterY() - this.triangleRight.height / 2 - this.tolerance) + 'px';
mxUtils.setOpacity(this.arrowRight, this.inactiveOpacity);
this.arrowDown.style.left = this.arrowUp.style.left;
this.arrowDown.style.top = Math.round(bds.y + bds.height - this.tolerance) + 'px';
mxUtils.setOpacity(this.arrowDown, this.inactiveOpacity);
this.arrowLeft.style.left = Math.round(bds.x - this.triangleLeft.width - this.tolerance) + 'px';
this.arrowLeft.style.top = this.arrowRight.style.top;
mxUtils.setOpacity(this.arrowLeft, this.inactiveOpacity);
if (this.checkCollisions) {
var right = this.graph.getCellAt(bds.x + bds.width +
this.triangleRight.width / 2, this.currentState.getCenterY());
var left = this.graph.getCellAt(bds.x - this.triangleLeft.width / 2, this.currentState.getCenterY());
var top = this.graph.getCellAt(this.currentState.getCenterX(), bds.y - this.triangleUp.height / 2);
var bottom = this.graph.getCellAt(this.currentState.getCenterX(), bds.y + bds.height + this.triangleDown.height / 2);
// Shows hover icons large cell is behind all directions of current cell
if (right != null && right == left && left == top && top == bottom) {
right = null;
left = null;
top = null;
bottom = null;
}
var currentGeo = this.graph.getCellGeometry(this.currentState.cell);
var checkCollision = mxUtils.bind(this, function (cell, arrow) {
var geo = this.graph.model.isVertex(cell) && this.graph.getCellGeometry(cell);
// Ignores collision if vertex is more than 3 times the size of this vertex
if (cell != null && !this.graph.model.isAncestor(cell, this.currentState.cell) &&
(geo == null || currentGeo == null || (geo.height < 6 * currentGeo.height &&
geo.width < 6 * currentGeo.width))) {
arrow.style.visibility = 'hidden';
} else {
arrow.style.visibility = 'visible';
}
});
checkCollision(right, this.arrowRight);
checkCollision(left, this.arrowLeft);
checkCollision(top, this.arrowUp);
checkCollision(bottom, this.arrowDown);
} else {
this.arrowLeft.style.visibility = 'visible';
this.arrowRight.style.visibility = 'visible';
this.arrowUp.style.visibility = 'visible';
this.arrowDown.style.visibility = 'visible';
}
if (this.graph.tooltipHandler.isEnabled()) {
this.arrowLeft.setAttribute('title', mxResources.get('plusTooltip'));
this.arrowRight.setAttribute('title', mxResources.get('plusTooltip'));
this.arrowUp.setAttribute('title', mxResources.get('plusTooltip'));
this.arrowDown.setAttribute('title', mxResources.get('plusTooltip'));
} else {
this.arrowLeft.removeAttribute('title');
this.arrowRight.removeAttribute('title');
this.arrowUp.removeAttribute('title');
this.arrowDown.removeAttribute('title');
}
} else {
this.reset();
}
// Updates bounding box
if (this.currentState != null) {
this.bbox = this.computeBoundingBox();
// Adds tolerance for hover
if (this.bbox != null) {
this.bbox.grow(10);
}
}
}
};
/**
*
*/
HoverIcons.prototype.computeBoundingBox = function () {
var bbox = (!this.graph.model.isEdge(this.currentState.cell)) ? mxRectangle.fromRectangle(this.currentState) : null;
this.visitNodes(function (elt) {
if (elt.parentNode != null) {
var tmp = new mxRectangle(elt.offsetLeft, elt.offsetTop, elt.offsetWidth, elt.offsetHeight);
if (bbox == null) {
bbox = tmp;
} else {
bbox.add(tmp);
}
}
});
return bbox;
};
/**
*
*/
HoverIcons.prototype.getState = function (state) {
if (state != null) {
var cell = state.cell;
if (!this.graph.getModel().contains(cell)) {
state = null;
} else {
// Uses connectable parent vertex if child is not connectable
if (this.graph.getModel().isVertex(cell) && !this.graph.isCellConnectable(cell)) {
var parent = this.graph.getModel().getParent(cell);
if (this.graph.getModel().isVertex(parent) && this.graph.isCellConnectable(parent)) {
cell = parent;
}
}
// Ignores locked cells and edges
if (this.graph.isCellLocked(cell) || this.graph.model.isEdge(cell)) {
cell = null;
}
state = this.graph.view.getState(cell);
if (state != null && state.style == null) {
state = null;
}
}
}
return state;
};
/**
*
*/
HoverIcons.prototype.update = function (state, x, y) {
if (!this.graph.connectionArrowsEnabled || (state != null &&
mxUtils.getValue(state.style, 'allowArrows', '1') == '0')) {
this.reset();
} else {
if (state != null && state.cell.geometry != null && state.cell.geometry.relative &&
this.graph.model.isEdge(state.cell.parent)) {
state = null;
}
var timeOnTarget = null;
// Time on target
if (this.prev != state || this.isActive()) {
this.startTime = new Date().getTime();
this.prev = state;
timeOnTarget = 0;
if (this.updateThread != null) {
window.clearTimeout(this.updateThread);
}
if (state != null) {
// Starts timer to update current state with no mouse events
this.updateThread = window.setTimeout(mxUtils.bind(this, function () {
if (!this.isActive() && !this.graph.isMouseDown &&
!this.graph.panningHandler.isActive()) {
this.prev = state;
this.update(state, x, y);
}
}), this.updateDelay + 10);
}
} else if (this.startTime != null) {
timeOnTarget = new Date().getTime() - this.startTime;
}
this.setDisplay('');
if (this.currentState != null && this.currentState != state && timeOnTarget < this.activationDelay &&
this.bbox != null && !mxUtils.contains(this.bbox, x, y)) {
this.reset(false);
} else if (this.currentState != null || timeOnTarget > this.activationDelay) {
if (this.currentState != state && ((timeOnTarget > this.updateDelay && state != null) ||
this.bbox == null || x == null || y == null || !mxUtils.contains(this.bbox, x, y))) {
if (state != null && this.graph.isEnabled()) {
this.removeNodes();
this.setCurrentState(state);
this.repaint();
// Resets connection points on other focused cells
if (this.graph.connectionHandler.constraintHandler.currentFocus != state) {
this.graph.connectionHandler.constraintHandler.reset();
}
} else {
this.reset();
}
}
}
}
};
/**
*
*/
HoverIcons.prototype.setCurrentState = function (state) {
if (state.style['portConstraint'] != 'eastwest') {
this.graph.container.appendChild(this.arrowUp);
this.graph.container.appendChild(this.arrowDown);
}
this.graph.container.appendChild(this.arrowRight);
this.graph.container.appendChild(this.arrowLeft);
this.currentState = state;
};
(function () {
/**
* Reset the list of processed edges.
*/
var mxGraphViewResetValidationState = mxGraphView.prototype.resetValidationState;
mxGraphView.prototype.resetValidationState = function () {
mxGraphViewResetValidationState.apply(this, arguments);
this.validEdges = [];
};
/**
* Updates jumps for valid edges and repaints if needed.
*/
var mxGraphViewValidateCellState = mxGraphView.prototype.validateCellState;
mxGraphView.prototype.validateCellState = function (cell, recurse) {
recurse = (recurse != null) ? recurse : true;
var state = this.getState(cell);
// Forces repaint if jumps change on a valid edge
if (state != null && recurse && this.graph.model.isEdge(state.cell) &&
state.style != null && state.style[mxConstants.STYLE_CURVED] != 1 &&
!state.invalid && this.updateLineJumps(state)) {
this.graph.cellRenderer.redraw(state, false, this.isRendering());
}
state = mxGraphViewValidateCellState.apply(this, arguments);
// Adds to the list of edges that may intersect with later edges
if (state != null && recurse && this.graph.model.isEdge(state.cell) &&
state.style != null && state.style[mxConstants.STYLE_CURVED] != 1) {
// LATER: Reuse jumps for valid edges
this.validEdges.push(state);
}
return state;
};
/**
* Forces repaint if routed points have changed.
*/
var mxCellRendererIsShapeInvalid = mxCellRenderer.prototype.isShapeInvalid;
mxCellRenderer.prototype.isShapeInvalid = function (state, shape) {
return mxCellRendererIsShapeInvalid.apply(this, arguments) ||
(state.routedPoints != null && shape.routedPoints != null &&
!mxUtils.equalPoints(shape.routedPoints, state.routedPoints));
};
/**
* Updates jumps for invalid edges.
*/
var mxGraphViewUpdateCellState = mxGraphView.prototype.updateCellState;
mxGraphView.prototype.updateCellState = function (state) {
mxGraphViewUpdateCellState.apply(this, arguments);
// Updates jumps on invalid edge before repaint
if (this.graph.model.isEdge(state.cell) &&
state.style[mxConstants.STYLE_CURVED] != 1) {
this.updateLineJumps(state);
}
};
/**
* Updates the jumps between given state and processed edges.
*/
mxGraphView.prototype.updateLineJumps = function (state) {
var pts = state.absolutePoints;
if (Graph.lineJumpsEnabled) {
var changed = state.routedPoints != null;
var actual = null;
if (pts != null && this.validEdges != null &&
mxUtils.getValue(state.style, 'jumpStyle', 'none') !== 'none') {
var thresh = 0.5 * this.scale;
changed = false;
actual = [];
// Type 0 means normal waypoint, 1 means jump
function addPoint(type, x, y) {
var rpt = new mxPoint(x, y);
rpt.type = type;
actual.push(rpt);
var curr = (state.routedPoints != null) ? state.routedPoints[actual.length - 1] : null;
return curr == null || curr.type != type || curr.x != x || curr.y != y;
};
for (var i = 0; i < pts.length - 1; i++) {
var p1 = pts[i + 1];
var p0 = pts[i];
var list = [];
// Ignores waypoints on straight segments
var pn = pts[i + 2];
while (i < pts.length - 2 &&
mxUtils.ptSegDistSq(p0.x, p0.y, pn.x, pn.y,
p1.x, p1.y) < 1 * this.scale * this.scale) {
p1 = pn;
i++;
pn = pts[i + 2];
}
changed = addPoint(0, p0.x, p0.y) || changed;
// Processes all previous edges
for (var e = 0; e < this.validEdges.length; e++) {
var state2 = this.validEdges[e];
var pts2 = state2.absolutePoints;
if (pts2 != null && mxUtils.intersects(state, state2) && state2.style['noJump'] != '1') {
// Compares each segment of the edge with the current segment
for (var j = 0; j < pts2.length - 1; j++) {
var p3 = pts2[j + 1];
var p2 = pts2[j];
// Ignores waypoints on straight segments
pn = pts2[j + 2];
while (j < pts2.length - 2 &&
mxUtils.ptSegDistSq(p2.x, p2.y, pn.x, pn.y,
p3.x, p3.y) < 1 * this.scale * this.scale) {
p3 = pn;
j++;
pn = pts2[j + 2];
}
var pt = mxUtils.intersection(p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);
// Handles intersection between two segments
if (pt != null && (Math.abs(pt.x - p0.x) > thresh ||
Math.abs(pt.y - p0.y) > thresh) &&
(Math.abs(pt.x - p1.x) > thresh ||
Math.abs(pt.y - p1.y) > thresh) &&
(Math.abs(pt.x - p2.x) > thresh ||
Math.abs(pt.y - p2.y) > thresh) &&
(Math.abs(pt.x - p3.x) > thresh ||
Math.abs(pt.y - p3.y) > thresh)) {
var dx = pt.x - p0.x;
var dy = pt.y - p0.y;
var temp = {distSq: dx * dx + dy * dy, x: pt.x, y: pt.y};
// Intersections must be ordered by distance from start of segment
for (var t = 0; t < list.length; t++) {
if (list[t].distSq > temp.distSq) {
list.splice(t, 0, temp);
temp = null;
break;
}
}
// Ignores multiple intersections at segment joint
if (temp != null && (list.length == 0 ||
list[list.length - 1].x !== temp.x ||
list[list.length - 1].y !== temp.y)) {
list.push(temp);
}
}
}
}
}
// Adds ordered intersections to routed points
for (var j = 0; j < list.length; j++) {
changed = addPoint(1, list[j].x, list[j].y) || changed;
}
}
var pt = pts[pts.length - 1];
changed = addPoint(0, pt.x, pt.y) || changed;
}
state.routedPoints = actual;
return changed;
} else {
return false;
}
};
/**
* Overrides painting the actual shape for taking into account jump style.
*/
var mxConnectorPaintLine = mxConnector.prototype.paintLine;
mxConnector.prototype.paintLine = function (c, absPts, rounded) {
// Required for checking dirty state
this.routedPoints = (this.state != null) ? this.state.routedPoints : null;
if (this.outline || this.state == null || this.style == null ||
this.state.routedPoints == null || this.state.routedPoints.length == 0) {
mxConnectorPaintLine.apply(this, arguments);
} else {
var arcSize = mxUtils.getValue(this.style, mxConstants.STYLE_ARCSIZE,
mxConstants.LINE_ARCSIZE) / 2;
var size = (parseInt(mxUtils.getValue(this.style, 'jumpSize',
Graph.defaultJumpSize)) - 2) / 2 + this.strokewidth;
var style = mxUtils.getValue(this.style, 'jumpStyle', 'none');
var f = Editor.jumpSizeRatio;
var moveTo = true;
var last = null;
var len = null;
var pts = [];
var n = null;
c.begin();
for (var i = 0; i < this.state.routedPoints.length; i++) {
var rpt = this.state.routedPoints[i];
var pt = new mxPoint(rpt.x / this.scale, rpt.y / this.scale);
// Takes first and last point from passed-in array
if (i == 0) {
pt = absPts[0];
} else if (i == this.state.routedPoints.length - 1) {
pt = absPts[absPts.length - 1];
}
var done = false;
// Type 1 is an intersection
if (last != null && rpt.type == 1) {
// Checks if next/previous points are too close
var next = this.state.routedPoints[i + 1];
var dx = next.x / this.scale - pt.x;
var dy = next.y / this.scale - pt.y;
var dist = dx * dx + dy * dy;
if (n == null) {
n = new mxPoint(pt.x - last.x, pt.y - last.y);
len = Math.sqrt(n.x * n.x + n.y * n.y);
if (len > 0) {
n.x = n.x * size / len;
n.y = n.y * size / len;
} else {
n = null;
}
}
if (dist > size * size && len > 0) {
var dx = last.x - pt.x;
var dy = last.y - pt.y;
var dist = dx * dx + dy * dy;
if (dist > size * size) {
var p0 = new mxPoint(pt.x - n.x, pt.y - n.y);
var p1 = new mxPoint(pt.x + n.x, pt.y + n.y);
pts.push(p0);
this.addPoints(c, pts, rounded, arcSize, false, null, moveTo);
var f = (Math.round(n.x) < 0 || (Math.round(n.x) == 0
&& Math.round(n.y) <= 0)) ? 1 : -1;
moveTo = false;
if (style == 'sharp') {
c.lineTo(p0.x - n.y * f, p0.y + n.x * f);
c.lineTo(p1.x - n.y * f, p1.y + n.x * f);
c.lineTo(p1.x, p1.y);
} else if (style == 'arc') {
f *= 1.3;
c.curveTo(p0.x - n.y * f, p0.y + n.x * f,
p1.x - n.y * f, p1.y + n.x * f,
p1.x, p1.y);
} else {
c.moveTo(p1.x, p1.y);
moveTo = true;
}
pts = [p1];
done = true;
}
}
} else {
n = null;
}
if (!done) {
pts.push(pt);
last = pt;
}
}
this.addPoints(c, pts, rounded, arcSize, false, null, moveTo);
c.stroke();
}
};
/**
* Adds support for snapToPoint style.
*/
var mxGraphViewUpdateFloatingTerminalPoint = mxGraphView.prototype.updateFloatingTerminalPoint;
mxGraphView.prototype.updateFloatingTerminalPoint = function (edge, start, end, source) {
if (start != null && edge != null &&
(start.style['snapToPoint'] == '1' ||
edge.style['snapToPoint'] == '1')) {
start = this.getTerminalPort(edge, start, source);
var next = this.getNextPoint(edge, end, source);
var orth = this.graph.isOrthogonal(edge);
var alpha = mxUtils.toRadians(Number(start.style[mxConstants.STYLE_ROTATION] || '0'));
var center = new mxPoint(start.getCenterX(), start.getCenterY());
if (alpha != 0) {
var cos = Math.cos(-alpha);
var sin = Math.sin(-alpha);
next = mxUtils.getRotatedPoint(next, cos, sin, center);
}
var border = parseFloat(edge.style[mxConstants.STYLE_PERIMETER_SPACING] || 0);
border += parseFloat(edge.style[(source) ?
mxConstants.STYLE_SOURCE_PERIMETER_SPACING :
mxConstants.STYLE_TARGET_PERIMETER_SPACING] || 0);
var pt = this.getPerimeterPoint(start, next, alpha == 0 && orth, border);
if (alpha != 0) {
var cos = Math.cos(alpha);
var sin = Math.sin(alpha);
pt = mxUtils.getRotatedPoint(pt, cos, sin, center);
}
edge.setAbsoluteTerminalPoint(this.snapToAnchorPoint(edge, start, end, source, pt), source);
} else {
mxGraphViewUpdateFloatingTerminalPoint.apply(this, arguments);
}
};
mxGraphView.prototype.snapToAnchorPoint = function (edge, start, end, source, pt) {
if (start != null && edge != null) {
var constraints = this.graph.getAllConnectionConstraints(start);
var nearest = null;
var dist = null;
if (constraints != null) {
for (var i = 0; i < constraints.length; i++) {
var cp = this.graph.getConnectionPoint(start, constraints[i]);
if (cp != null) {
var tmp = (cp.x - pt.x) * (cp.x - pt.x) + (cp.y - pt.y) * (cp.y - pt.y);
if (dist == null || tmp < dist) {
nearest = cp;
dist = tmp;
}
}
}
}
if (nearest != null) {
pt = nearest;
}
}
return pt;
};
/**
* Adds support for placeholders in text elements of shapes.
*/
var mxStencilEvaluateTextAttribute = mxStencil.prototype.evaluateTextAttribute;
mxStencil.prototype.evaluateTextAttribute = function (node, attribute, shape) {
var result = mxStencilEvaluateTextAttribute.apply(this, arguments);
var placeholders = node.getAttribute('placeholders');
if (placeholders == '1' && shape.state != null) {
result = shape.state.view.graph.replacePlaceholders(shape.state.cell, result);
}
return result;
};
/**
* Adds custom stencils defined via shape=stencil(value) style. The value is a base64 encoded, compressed and
* URL encoded XML definition of the shape according to the stencil definition language of mxGraph.
*
* Needs to be in this file to make sure its part of the embed client code. Also the check for ZLib is
* different than for the Editor code.
*/
var mxCellRendererCreateShape = mxCellRenderer.prototype.createShape;
mxCellRenderer.prototype.createShape = function (state) {
if (state.style != null && typeof (pako) !== 'undefined') {
var shape = mxUtils.getValue(state.style, mxConstants.STYLE_SHAPE, null);
// Extracts and decodes stencil XML if shape has the form shape=stencil(value)
if (shape != null && typeof shape === 'string' && shape.substring(0, 8) == 'stencil(') {
try {
var stencil = shape.substring(8, shape.length - 1);
var doc = mxUtils.parseXml(Graph.decompress(stencil));
return new mxShape(new mxStencil(doc.documentElement));
} catch (e) {
if (window.console != null) {
console.log('Error in shape: ' + e);
}
}
}
}
return mxCellRendererCreateShape.apply(this, arguments);
};
})();
/**
* Overrides stencil registry for dynamic loading of stencils.
*/
/**
* Maps from library names to an array of Javascript filenames,
* which are synchronously loaded. Currently only stencil files
* (.xml) and JS files (.js) are supported.
* IMPORTANT: For embedded diagrams to work entries must also
* be added in EmbedServlet.java.
*/
mxStencilRegistry.libraries = {};
/**
* Global switch to disable dynamic loading.
*/
mxStencilRegistry.dynamicLoading = true;
/**
* Global switch to disable eval for JS (preload all JS instead).
*/
mxStencilRegistry.allowEval = true;
/**
* Stores all package names that have been dynamically loaded.
* Each package is only loaded once.
*/
mxStencilRegistry.packages = [];
// Extends the default stencil registry to add dynamic loading
mxStencilRegistry.getStencil = function (name) {
var result = mxStencilRegistry.stencils[name];
if (result == null && mxCellRenderer.defaultShapes[name] == null && mxStencilRegistry.dynamicLoading) {
var basename = mxStencilRegistry.getBasenameForStencil(name);
// Loads stencil files and tries again
if (basename != null) {
var libs = mxStencilRegistry.libraries[basename];
if (libs != null) {
if (mxStencilRegistry.packages[basename] == null) {
for (var i = 0; i < libs.length; i++) {
var fname = libs[i];
if (fname.toLowerCase().substring(fname.length - 4, fname.length) == '.xml') {
mxStencilRegistry.loadStencilSet(fname, null);
} else if (fname.toLowerCase().substring(fname.length - 3, fname.length) == '.js') {
try {
if (mxStencilRegistry.allowEval) {
var req = mxUtils.load(fname);
if (req != null && req.getStatus() >= 200 && req.getStatus() <= 299) {
eval.call(window, req.getText());
}
}
} catch (e) {
if (window.console != null) {
console.log('error in getStencil:', fname, e);
}
}
} else {
// FIXME: This does not yet work as the loading is triggered after
// the shape was used in the graph, at which point the keys have
// typically been translated in the calling method.
//mxResources.add(fname);
}
}
mxStencilRegistry.packages[basename] = 1;
}
} else {
// Replaces '_-_' with '_'
basename = basename.replace('_-_', '_');
mxStencilRegistry.loadStencilSet(STENCIL_PATH + '/' + basename + '.xml', null);
}
result = mxStencilRegistry.stencils[name];
}
}
return result;
};
// Returns the basename for the given stencil or null if no file must be
// loaded to render the given stencil.
mxStencilRegistry.getBasenameForStencil = function (name) {
var tmp = null;
if (name != null && typeof name === 'string') {
var parts = name.split('.');
if (parts.length > 0 && parts[0] == 'mxgraph') {
tmp = parts[1];
for (var i = 2; i < parts.length - 1; i++) {
tmp += '/' + parts[i];
}
}
}
return tmp;
};
// Loads the given stencil set
mxStencilRegistry.loadStencilSet = function (stencilFile, postStencilLoad, force, async) {
force = (force != null) ? force : false;
// Uses additional cache for detecting previous load attempts
var xmlDoc = mxStencilRegistry.packages[stencilFile];
if (force || xmlDoc == null) {
var install = false;
if (xmlDoc == null) {
try {
if (async) {
mxStencilRegistry.loadStencil(stencilFile, mxUtils.bind(this, function (xmlDoc2) {
if (xmlDoc2 != null && xmlDoc2.documentElement != null) {
mxStencilRegistry.packages[stencilFile] = xmlDoc2;
install = true;
mxStencilRegistry.parseStencilSet(xmlDoc2.documentElement, postStencilLoad, install);
}
}));
return;
} else {
xmlDoc = mxStencilRegistry.loadStencil(stencilFile);
mxStencilRegistry.packages[stencilFile] = xmlDoc;
install = true;
}
} catch (e) {
if (window.console != null) {
console.log('error in loadStencilSet:', stencilFile, e);
}
}
}
if (xmlDoc != null && xmlDoc.documentElement != null) {
mxStencilRegistry.parseStencilSet(xmlDoc.documentElement, postStencilLoad, install);
}
}
};
// Loads the given stencil XML file.
mxStencilRegistry.loadStencil = function (filename, fn) {
if (fn != null) {
var req = mxUtils.get(filename, mxUtils.bind(this, function (req) {
fn((req.getStatus() >= 200 && req.getStatus() <= 299) ? req.getXml() : null);
}));
} else {
return mxUtils.load(filename).getXml();
}
};
// Takes array of strings
mxStencilRegistry.parseStencilSets = function (stencils) {
for (var i = 0; i < stencils.length; i++) {
mxStencilRegistry.parseStencilSet(mxUtils.parseXml(stencils[i]).documentElement);
}
};
// Parses the given stencil set
mxStencilRegistry.parseStencilSet = function (root, postStencilLoad, install) {
if (root.nodeName == 'stencils') {
var shapes = root.firstChild;
while (shapes != null) {
if (shapes.nodeName == 'shapes') {
mxStencilRegistry.parseStencilSet(shapes, postStencilLoad, install);
}
shapes = shapes.nextSibling;
}
} else {
install = (install != null) ? install : true;
var shape = root.firstChild;
var packageName = '';
var name = root.getAttribute('name');
if (name != null) {
packageName = name + '.';
}
while (shape != null) {
if (shape.nodeType == mxConstants.NODETYPE_ELEMENT) {
name = shape.getAttribute('name');
if (name != null) {
packageName = packageName.toLowerCase();
var stencilName = name.replace(/ /g, '_');
if (install) {
mxStencilRegistry.addStencil(packageName + stencilName.toLowerCase(), new mxStencil(shape));
}
if (postStencilLoad != null) {
var w = shape.getAttribute('w');
var h = shape.getAttribute('h');
w = (w == null) ? 80 : parseInt(w, 10);
h = (h == null) ? 80 : parseInt(h, 10);
postStencilLoad(packageName, stencilName, name, w, h);
}
}
}
shape = shape.nextSibling;
}
}
};
/**
* These overrides are only added if mxVertexHandler is defined (ie. not in embedded graph)
*/
if (typeof mxVertexHandler != 'undefined') {
(function () {
// Sets colors for handles
mxConstants.HANDLE_FILLCOLOR = '#29b6f2';
mxConstants.HANDLE_STROKECOLOR = '#0088cf';
mxConstants.VERTEX_SELECTION_COLOR = '#00a8ff';
mxConstants.OUTLINE_COLOR = '#00a8ff';
mxConstants.OUTLINE_HANDLE_FILLCOLOR = '#99ccff';
mxConstants.OUTLINE_HANDLE_STROKECOLOR = '#00a8ff';
mxConstants.CONNECT_HANDLE_FILLCOLOR = '#cee7ff';
mxConstants.EDGE_SELECTION_COLOR = '#00a8ff';
mxConstants.DEFAULT_VALID_COLOR = '#00a8ff';
mxConstants.LABEL_HANDLE_FILLCOLOR = '#cee7ff';
mxConstants.GUIDE_COLOR = '#0088cf';
mxConstants.HIGHLIGHT_OPACITY = 30;
mxConstants.HIGHLIGHT_SIZE = 5;
// Enables snapping to off-grid terminals for edge waypoints
mxEdgeHandler.prototype.snapToTerminals = true;
// Enables guides
mxGraphHandler.prototype.guidesEnabled = true;
// Removes parents where all child cells are moved out
mxGraphHandler.prototype.removeEmptyParents = true;
// Enables fading of rubberband
mxRubberband.prototype.fadeOut = true;
// Alt-move disables guides
mxGuide.prototype.isEnabledForEvent = function (evt) {
return !mxEvent.isAltDown(evt);
};
// Extends connection handler to enable ctrl+drag for cloning source cell
// since copyOnConnect is now disabled by default
var mxConnectionHandlerCreateTarget = mxConnectionHandler.prototype.isCreateTarget;
mxConnectionHandler.prototype.isCreateTarget = function (evt) {
return mxEvent.isControlDown(evt) || mxConnectionHandlerCreateTarget.apply(this, arguments);
};
// Overrides highlight shape for connection points
mxConstraintHandler.prototype.createHighlightShape = function () {
var hl = new mxEllipse(null, this.highlightColor, this.highlightColor, 0);
hl.opacity = mxConstants.HIGHLIGHT_OPACITY;
return hl;
};
// Overrides edge preview to use current edge shape and default style
mxConnectionHandler.prototype.livePreview = true;
mxConnectionHandler.prototype.cursor = 'crosshair';
// Uses current edge style for connect preview
mxConnectionHandler.prototype.createEdgeState = function (me) {
var style = this.graph.createCurrentEdgeStyle();
var edge = this.graph.createEdge(null, null, null, null, null, style);
var state = new mxCellState(this.graph.view, edge, this.graph.getCellStyle(edge));
for (var key in this.graph.currentEdgeStyle) {
state.style[key] = this.graph.currentEdgeStyle[key];
}
return state;
};
// Overrides dashed state with current edge style
var connectionHandlerCreateShape = mxConnectionHandler.prototype.createShape;
mxConnectionHandler.prototype.createShape = function () {
var shape = connectionHandlerCreateShape.apply(this, arguments);
shape.isDashed = this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED] == '1';
return shape;
};
// Overrides live preview to keep current style
mxConnectionHandler.prototype.updatePreview = function (valid) {
// do not change color of preview
};
// Overrides connection handler to ignore edges instead of not allowing connections
var mxConnectionHandlerCreateMarker = mxConnectionHandler.prototype.createMarker;
mxConnectionHandler.prototype.createMarker = function () {
var marker = mxConnectionHandlerCreateMarker.apply(this, arguments);
var markerGetCell = marker.getCell;
marker.getCell = mxUtils.bind(this, function (me) {
var result = markerGetCell.apply(this, arguments);
this.error = null;
return result;
});
return marker;
};
/**
* Function: isCellLocked
*
* Returns true if the given cell does not allow new connections to be created.
* This implementation returns false.
*/
mxConnectionHandler.prototype.isCellEnabled = function (cell) {
return !this.graph.isCellLocked(cell);
};
/**
*
*/
Graph.prototype.defaultVertexStyle = {};
/**
* Contains the default style for edges.
*/
Graph.prototype.defaultEdgeStyle = {
'edgeStyle': 'orthogonalEdgeStyle', 'rounded': '0',
'jettySize': 'auto', 'orthogonalLoop': '1',
};
/**
* Returns the current edge style as a string.
*/
Graph.prototype.createCurrentEdgeStyle = function () {
var style = 'edgeStyle=' + (this.currentEdgeStyle['edgeStyle'] || 'none') + ';';
if (this.currentEdgeStyle['shape'] != null) {
style += 'shape=' + this.currentEdgeStyle['shape'] + ';';
}
if (this.currentEdgeStyle['curved'] != null) {
style += 'curved=' + this.currentEdgeStyle['curved'] + ';';
}
if (this.currentEdgeStyle['rounded'] != null) {
style += 'rounded=' + this.currentEdgeStyle['rounded'] + ';';
}
if (this.currentEdgeStyle['comic'] != null) {
style += 'comic=' + this.currentEdgeStyle['comic'] + ';';
}
if (this.currentEdgeStyle['jumpStyle'] != null) {
style += 'jumpStyle=' + this.currentEdgeStyle['jumpStyle'] + ';';
}
if (this.currentEdgeStyle['jumpSize'] != null) {
style += 'jumpSize=' + this.currentEdgeStyle['jumpSize'] + ';';
}
// Overrides the global default to match the default edge style
if (this.currentEdgeStyle['orthogonalLoop'] != null) {
style += 'orthogonalLoop=' + this.currentEdgeStyle['orthogonalLoop'] + ';';
} else if (Graph.prototype.defaultEdgeStyle['orthogonalLoop'] != null) {
style += 'orthogonalLoop=' + Graph.prototype.defaultEdgeStyle['orthogonalLoop'] + ';';
}
// Overrides the global default to match the default edge style
if (this.currentEdgeStyle['jettySize'] != null) {
style += 'jettySize=' + this.currentEdgeStyle['jettySize'] + ';';
} else if (Graph.prototype.defaultEdgeStyle['jettySize'] != null) {
style += 'jettySize=' + Graph.prototype.defaultEdgeStyle['jettySize'] + ';';
}
// Special logic for custom property of elbowEdgeStyle
if (this.currentEdgeStyle['edgeStyle'] == 'elbowEdgeStyle' && this.currentEdgeStyle['elbow'] != null) {
style += 'elbow=' + this.currentEdgeStyle['elbow'] + ';';
}
if (this.currentEdgeStyle['html'] != null) {
style += 'html=' + this.currentEdgeStyle['html'] + ';';
} else {
style += 'html=1;';
}
return style;
};
/**
* Hook for subclassers.
*/
Graph.prototype.getPagePadding = function () {
return new mxPoint(0, 0);
};
/**
* Loads the stylesheet for this graph.
*/
Graph.prototype.loadStylesheet = function () {
var node = (this.themes != null) ? this.themes[this.defaultThemeName] :
(!mxStyleRegistry.dynamicLoading) ? null :
mxUtils.load(STYLE_PATH + '/default.xml').getDocumentElement();
if (node != null) {
var dec = new mxCodec(node.ownerDocument);
dec.decode(node, this.getStylesheet());
}
};
/**
* Creates lookup from object IDs to cell IDs.
*/
Graph.prototype.createCellLookup = function (cells, lookup) {
lookup = (lookup != null) ? lookup : new Object();
for (var i = 0; i < cells.length; i++) {
var cell = cells[i];
lookup[mxObjectIdentity.get(cell)] = cell.getId();
var childCount = this.model.getChildCount(cell);
for (var j = 0; j < childCount; j++) {
this.createCellLookup([this.model.getChildAt(cell, j)], lookup);
}
}
return lookup;
};
/**
* Creates lookup from original to cloned cell IDs where mapping is
* the mapping used in cloneCells and lookup is a mapping from
* object IDs to cell IDs.
*/
Graph.prototype.createCellMapping = function (mapping, lookup, cellMapping) {
cellMapping = (cellMapping != null) ? cellMapping : new Object();
for (var objectId in mapping) {
var cellId = lookup[objectId];
if (cellMapping[cellId] == null) {
// Uses empty string if clone ID was null which means
// the cell was cloned but not inserted into the model.
cellMapping[cellId] = mapping[objectId].getId() || '';
}
}
return cellMapping;
};
/**
*
*/
Graph.prototype.importGraphModel = function (node, dx, dy, crop) {
dx = (dx != null) ? dx : 0;
dy = (dy != null) ? dy : 0;
var codec = new mxCodec(node.ownerDocument);
var tempModel = new mxGraphModel();
codec.decode(node, tempModel);
var cells = [];
// Clones cells to remove invalid edges
var cloneMap = new Object();
var cellMapping = new Object();
var layers = tempModel.getChildren(this.cloneCell(tempModel.root,
this.isCloneInvalidEdges(), cloneMap));
if (layers != null) {
// Creates lookup from object IDs to cell IDs
var lookup = this.createCellLookup([tempModel.root]);
// Uses copy as layers are removed from array inside loop
layers = layers.slice();
this.model.beginUpdate();
try {
// Merges into unlocked current layer if one layer is pasted
if (layers.length == 1 && !this.isCellLocked(this.getDefaultParent())) {
cells = this.moveCells(tempModel.getChildren(layers[0]),
dx, dy, false, this.getDefaultParent());
// Imported default default parent maps to local default parent
cellMapping[tempModel.getChildAt(tempModel.root, 0).getId()] =
this.getDefaultParent().getId();
} else {
for (var i = 0; i < layers.length; i++) {
cells = cells.concat(this.model.getChildren(this.moveCells(
[layers[i]], dx, dy, false, this.model.getRoot())[0]));
}
}
// Adds mapping for all cloned entries from imported to local cell ID
this.createCellMapping(cloneMap, lookup, cellMapping);
this.updateCustomLinks(cellMapping, cells);
if (crop) {
if (this.isGridEnabled()) {
dx = this.snap(dx);
dy = this.snap(dy);
}
var bounds = this.getBoundingBoxFromGeometry(cells, true);
if (bounds != null) {
this.moveCells(cells, dx - bounds.x, dy - bounds.y);
}
}
} finally {
this.model.endUpdate();
}
}
return cells;
};
/**
* Translates this point by the given vector.
*
* @param {number} dx X-coordinate of the translation.
* @param {number} dy Y-coordinate of the translation.
*/
Graph.prototype.encodeCells = function (cells) {
var cloneMap = new Object();
var clones = this.cloneCells(cells, null, cloneMap);
// Creates a dictionary for fast lookups
var dict = new mxDictionary();
for (var i = 0; i < cells.length; i++) {
dict.put(cells[i], true);
}
// Checks for orphaned relative children and makes absolute
for (var i = 0; i < clones.length; i++) {
var state = this.view.getState(cells[i]);
if (state != null) {
var geo = this.getCellGeometry(clones[i]);
if (geo != null && geo.relative && !this.model.isEdge(cells[i]) &&
!dict.get(this.model.getParent(cells[i]))) {
geo.relative = false;
geo.x = state.x / state.view.scale - state.view.translate.x;
geo.y = state.y / state.view.scale - state.view.translate.y;
}
}
}
var codec = new mxCodec();
var model = new mxGraphModel();
var parent = model.getChildAt(model.getRoot(), 0);
for (var i = 0; i < clones.length; i++) {
model.add(parent, clones[i]);
}
this.updateCustomLinks(this.createCellMapping(cloneMap,
this.createCellLookup(cells)), clones);
return codec.encode(model);
};
/**
* Overrides cloning cells in moveCells.
*/
var graphMoveCells = Graph.prototype.moveCells;
Graph.prototype.moveCells = function (cells, dx, dy, clone, target, evt, mapping) {
mapping = (mapping != null) ? mapping : new Object();
var result = graphMoveCells.apply(this, arguments);
if (clone) {
this.updateCustomLinks(this.createCellMapping(mapping,
this.createCellLookup(cells)), result);
}
return result;
};
/**
* Updates cells IDs for custom links in the given cells.
*/
Graph.prototype.updateCustomLinks = function (mapping, cells) {
for (var i = 0; i < cells.length; i++) {
if (cells[i] != null) {
this.updateCustomLinksForCell(mapping, cells[i]);
}
}
};
/**
* Updates cell IDs in custom links on the given cell and its label.
*/
Graph.prototype.updateCustomLinksForCell = function (mapping, cell) {
// Hook for subclassers
};
/**
* Overrides method to provide connection constraints for shapes.
*/
Graph.prototype.getAllConnectionConstraints = function (terminal, source) {
if (terminal != null) {
var constraints = mxUtils.getValue(terminal.style, 'points', null);
if (constraints != null) {
// Requires an array of arrays with x, y (0..1), an optional
// [perimeter (0 or 1), dx, and dy] eg. points=[[0,0,1,-10,10],[0,1,0],[1,1]]
var result = [];
try {
var c = JSON.parse(constraints);
for (var i = 0; i < c.length; i++) {
var tmp = c[i];
result.push(new mxConnectionConstraint(new mxPoint(tmp[0], tmp[1]), (tmp.length > 2) ? tmp[2] != '0' : true,
null, (tmp.length > 3) ? tmp[3] : 0, (tmp.length > 4) ? tmp[4] : 0));
}
} catch (e) {
// ignore
}
return result;
} else if (terminal.shape != null && terminal.shape.bounds != null) {
var dir = terminal.shape.direction;
var bounds = terminal.shape.bounds;
var scale = terminal.shape.scale;
var w = bounds.width / scale;
var h = bounds.height / scale;
if (dir == mxConstants.DIRECTION_NORTH || dir == mxConstants.DIRECTION_SOUTH) {
var tmp = w;
w = h;
h = tmp;
}
constraints = terminal.shape.getConstraints(terminal.style, w, h);
if (constraints != null) {
return constraints;
} else if (terminal.shape.stencil != null && terminal.shape.stencil.constraints != null) {
return terminal.shape.stencil.constraints;
} else if (terminal.shape.constraints != null) {
return terminal.shape.constraints;
}
}
}
return null;
};
/**
* Inverts the elbow edge style without removing existing styles.
*/
Graph.prototype.flipEdge = function (edge) {
if (edge != null) {
var state = this.view.getState(edge);
var style = (state != null) ? state.style : this.getCellStyle(edge);
if (style != null) {
var elbow = mxUtils.getValue(style, mxConstants.STYLE_ELBOW,
mxConstants.ELBOW_HORIZONTAL);
var value = (elbow == mxConstants.ELBOW_HORIZONTAL) ?
mxConstants.ELBOW_VERTICAL : mxConstants.ELBOW_HORIZONTAL;
this.setCellStyles(mxConstants.STYLE_ELBOW, value, [edge]);
}
}
};
/**
* Disables drill-down for non-swimlanes.
*/
Graph.prototype.isValidRoot = function (cell) {
// Counts non-relative children
var childCount = this.model.getChildCount(cell);
var realChildCount = 0;
for (var i = 0; i < childCount; i++) {
var child = this.model.getChildAt(cell, i);
if (this.model.isVertex(child)) {
var geometry = this.getCellGeometry(child);
if (geometry != null && !geometry.relative) {
realChildCount++;
}
}
}
return realChildCount > 0 || this.isContainer(cell);
};
/**
* Disables drill-down for non-swimlanes.
*/
Graph.prototype.isValidDropTarget = function (cell) {
var state = this.view.getState(cell);
var style = (state != null) ? state.style : this.getCellStyle(cell);
return mxUtils.getValue(style, 'part', '0') != '1' && (this.isContainer(cell) ||
(mxGraph.prototype.isValidDropTarget.apply(this, arguments) &&
mxUtils.getValue(style, 'dropTarget', '1') != '0'));
};
/**
* Overrides createGroupCell to set the group style for new groups to 'group'.
*/
Graph.prototype.createGroupCell = function () {
var group = mxGraph.prototype.createGroupCell.apply(this, arguments);
group.setStyle('group');
return group;
};
/**
* Disables extending parents with stack layouts on add
*/
Graph.prototype.isExtendParentsOnAdd = function (cell) {
var result = mxGraph.prototype.isExtendParentsOnAdd.apply(this, arguments);
if (result && cell != null && this.layoutManager != null) {
var parent = this.model.getParent(cell);
if (parent != null) {
var layout = this.layoutManager.getLayout(parent);
if (layout != null && layout.constructor == mxStackLayout) {
result = false;
}
}
}
return result;
};
/**
* Overrides autosize to add a border.
*/
Graph.prototype.getPreferredSizeForCell = function (cell) {
var result = mxGraph.prototype.getPreferredSizeForCell.apply(this, arguments);
// Adds buffer
if (result != null) {
result.width += 10;
result.height += 4;
if (this.gridEnabled) {
result.width = this.snap(result.width);
result.height = this.snap(result.height);
}
}
return result;
};
/**
* Turns the given cells and returns the changed cells.
*/
Graph.prototype.turnShapes = function (cells) {
var model = this.getModel();
var select = [];
model.beginUpdate();
try {
for (var i = 0; i < cells.length; i++) {
var cell = cells[i];
if (model.isEdge(cell)) {
var src = model.getTerminal(cell, true);
var trg = model.getTerminal(cell, false);
model.setTerminal(cell, trg, true);
model.setTerminal(cell, src, false);
var geo = model.getGeometry(cell);
if (geo != null) {
geo = geo.clone();
if (geo.points != null) {
geo.points.reverse();
}
var sp = geo.getTerminalPoint(true);
var tp = geo.getTerminalPoint(false);
geo.setTerminalPoint(sp, false);
geo.setTerminalPoint(tp, true);
model.setGeometry(cell, geo);
// Inverts constraints
var edgeState = this.view.getState(cell);
var sourceState = this.view.getState(src);
var targetState = this.view.getState(trg);
if (edgeState != null) {
var sc = (sourceState != null) ? this.getConnectionConstraint(edgeState, sourceState, true) : null;
var tc = (targetState != null) ? this.getConnectionConstraint(edgeState, targetState, false) : null;
this.setConnectionConstraint(cell, src, true, tc);
this.setConnectionConstraint(cell, trg, false, sc);
}
select.push(cell);
}
} else if (model.isVertex(cell)) {
var geo = this.getCellGeometry(cell);
if (geo != null) {
// Rotates the size and position in the geometry
geo = geo.clone();
geo.x += geo.width / 2 - geo.height / 2;
geo.y += geo.height / 2 - geo.width / 2;
var tmp = geo.width;
geo.width = geo.height;
geo.height = tmp;
model.setGeometry(cell, geo);
// Reads the current direction and advances by 90 degrees
var state = this.view.getState(cell);
if (state != null) {
var dir = state.style[mxConstants.STYLE_DIRECTION] || 'east'/*default*/;
if (dir == 'east') {
dir = 'south';
} else if (dir == 'south') {
dir = 'west';
} else if (dir == 'west') {
dir = 'north';
} else if (dir == 'north') {
dir = 'east';
}
this.setCellStyles(mxConstants.STYLE_DIRECTION, dir, [cell]);
}
select.push(cell);
}
}
}
} finally {
model.endUpdate();
}
return select;
};
/**
* Returns true if the given stencil contains any placeholder text.
*/
Graph.prototype.stencilHasPlaceholders = function (stencil) {
if (stencil != null && stencil.fgNode != null) {
var node = stencil.fgNode.firstChild;
while (node != null) {
if (node.nodeName == 'text' && node.getAttribute('placeholders') == '1') {
return true;
}
node = node.nextSibling;
}
}
return false;
};
/**
* Updates the child cells with placeholders if metadata of a cell has changed.
*/
Graph.prototype.processChange = function (change) {
mxGraph.prototype.processChange.apply(this, arguments);
if (change instanceof mxValueChange && change.cell != null &&
change.cell.value != null && typeof (change.cell.value) == 'object') {
// Invalidates all descendants with placeholders
var desc = this.model.getDescendants(change.cell);
// LATER: Check if only label or tooltip have changed
if (desc.length > 0) {
for (var i = 0; i < desc.length; i++) {
var state = this.view.getState(desc[i]);
if (state != null && state.shape != null && state.shape.stencil != null &&
this.stencilHasPlaceholders(state.shape.stencil)) {
this.removeStateForCell(desc[i]);
} else if (this.isReplacePlaceholders(desc[i])) {
this.view.invalidate(desc[i], false, false);
}
}
}
}
};
/**
* Replaces the given element with a span.
*/
Graph.prototype.replaceElement = function (elt, tagName) {
var span = elt.ownerDocument.createElement((tagName != null) ? tagName : 'span');
var attributes = Array.prototype.slice.call(elt.attributes);
while (attr = attributes.pop()) {
span.setAttribute(attr.nodeName, attr.nodeValue);
}
span.innerHTML = elt.innerHTML;
elt.parentNode.replaceChild(span, elt);
};
/**
*
*/
Graph.prototype.processElements = function (elt, fn) {
var elts = elt.getElementsByTagName('*');
for (var i = 0; i < elts.length; i++) {
fn(elts[i]);
}
};
/**
* Handles label changes for XML user objects.
*/
Graph.prototype.updateLabelElements = function (cells, fn, tagName) {
cells = (cells != null) ? cells : this.getSelectionCells();
var div = document.createElement('div');
for (var i = 0; i < cells.length; i++) {
// Changes font tags inside HTML labels
if (this.isHtmlLabel(cells[i])) {
var label = this.convertValueToString(cells[i]);
if (label != null && label.length > 0) {
div.innerHTML = label;
var elts = div.getElementsByTagName((tagName != null) ? tagName : '*');
for (var j = 0; j < elts.length; j++) {
fn(elts[j]);
}
if (div.innerHTML != label) {
this.cellLabelChanged(cells[i], div.innerHTML);
}
}
}
}
};
/**
* Handles label changes for XML user objects.
*/
Graph.prototype.cellLabelChanged = function (cell, value, autoSize) {
// Removes all illegal control characters in user input
value = Graph.zapGremlins(value);
this.model.beginUpdate();
try {
if (cell.value != null && typeof cell.value == 'object') {
if (this.isReplacePlaceholders(cell) &&
cell.getAttribute('placeholder') != null) {
// LATER: Handle delete, name change
var name = cell.getAttribute('placeholder');
var current = cell;
while (current != null) {
if (current == this.model.getRoot() || (current.value != null &&
typeof (current.value) == 'object' && current.hasAttribute(name))) {
this.setAttributeForCell(current, name, value);
break;
}
current = this.model.getParent(current);
}
}
var tmp = cell.value.cloneNode(true);
tmp.setAttribute('label', value);
value = tmp;
}
mxGraph.prototype.cellLabelChanged.apply(this, arguments);
} finally {
this.model.endUpdate();
}
};
/**
* Removes transparent empty groups if all children are removed.
*/
Graph.prototype.cellsRemoved = function (cells) {
if (cells != null) {
var dict = new mxDictionary();
for (var i = 0; i < cells.length; i++) {
dict.put(cells[i], true);
}
// LATER: Recurse up the cell hierarchy
var parents = [];
for (var i = 0; i < cells.length; i++) {
var parent = this.model.getParent(cells[i]);
if (parent != null && !dict.get(parent)) {
dict.put(parent, true);
parents.push(parent);
}
}
for (var i = 0; i < parents.length; i++) {
var state = this.view.getState(parents[i]);
if (state != null && (this.model.isEdge(state.cell) || this.model.isVertex(state.cell)) && this.isCellDeletable(state.cell)) {
var stroke = mxUtils.getValue(state.style, mxConstants.STYLE_STROKECOLOR, mxConstants.NONE);
var fill = mxUtils.getValue(state.style, mxConstants.STYLE_FILLCOLOR, mxConstants.NONE);
if (stroke == mxConstants.NONE && fill == mxConstants.NONE) {
var allChildren = true;
for (var j = 0; j < this.model.getChildCount(state.cell) && allChildren; j++) {
if (!dict.get(this.model.getChildAt(state.cell, j))) {
allChildren = false;
}
}
if (allChildren) {
cells.push(state.cell);
}
}
}
}
}
mxGraph.prototype.cellsRemoved.apply(this, arguments);
};
/**
* Overrides ungroup to check if group should be removed.
*/
Graph.prototype.removeCellsAfterUngroup = function (cells) {
var cellsToRemove = [];
for (var i = 0; i < cells.length; i++) {
if (this.isCellDeletable(cells[i])) {
var state = this.view.getState(cells[i]);
if (state != null) {
var stroke = mxUtils.getValue(state.style, mxConstants.STYLE_STROKECOLOR, mxConstants.NONE);
var fill = mxUtils.getValue(state.style, mxConstants.STYLE_FILLCOLOR, mxConstants.NONE);
if (stroke == mxConstants.NONE && fill == mxConstants.NONE) {
cellsToRemove.push(cells[i]);
}
}
}
}
cells = cellsToRemove;
mxGraph.prototype.removeCellsAfterUngroup.apply(this, arguments);
};
/**
* Sets the link for the given cell.
*/
Graph.prototype.setLinkForCell = function (cell, link) {
this.setAttributeForCell(cell, 'link', link);
};
/**
* Sets the link for the given cell.
*/
Graph.prototype.setTooltipForCell = function (cell, link) {
this.setAttributeForCell(cell, 'tooltip', link);
};
/**
* Returns the cells in the model (or given array) that have all of the
* given tags in their tags property.
*/
Graph.prototype.getAttributeForCell = function (cell, attributeName, defaultValue) {
return (cell.value != null && typeof cell.value === 'object') ?
(cell.value.getAttribute(attributeName) || defaultValue) :
defaultValue;
};
/**
* Sets the link for the given cell.
*/
Graph.prototype.setAttributeForCell = function (cell, attributeName, attributeValue) {
var value = null;
if (cell.value != null && typeof (cell.value) == 'object') {
value = cell.value.cloneNode(true);
} else {
var doc = mxUtils.createXmlDocument();
value = doc.createElement('UserObject');
value.setAttribute('label', cell.value || '');
}
if (attributeValue != null) {
value.setAttribute(attributeName, attributeValue);
} else {
value.removeAttribute(attributeName);
}
this.model.setValue(cell, value);
};
/**
* Overridden to stop moving edge labels between cells.
*/
Graph.prototype.getDropTarget = function (cells, evt, cell, clone) {
var model = this.getModel();
// Disables drop into group if alt is pressed
if (mxEvent.isAltDown(evt)) {
return null;
}
// Disables dragging edge labels out of edges
for (var i = 0; i < cells.length; i++) {
if (this.model.isEdge(this.model.getParent(cells[i]))) {
return null;
}
}
return mxGraph.prototype.getDropTarget.apply(this, arguments);
};
/**
* Overrides double click handling to avoid accidental inserts of new labels in dblClick below.
*/
Graph.prototype.click = function (me) {
mxGraph.prototype.click.call(this, me);
// Stores state and source for checking in dblClick
this.firstClickState = me.getState();
this.firstClickSource = me.getSource();
};
/**
* Overrides double click handling to add the tolerance and inserting text.
*/
Graph.prototype.dblClick = function (evt, cell) {
if (this.isEnabled()) {
var pt = mxUtils.convertPoint(this.container, mxEvent.getClientX(evt), mxEvent.getClientY(evt));
// Automatically adds new child cells to edges on double click
if (evt != null && !this.model.isVertex(cell)) {
var state = (this.model.isEdge(cell)) ? this.view.getState(cell) : null;
var src = mxEvent.getSource(evt);
if ((this.firstClickState == state && this.firstClickSource == src) &&
(state == null || (state.text == null || state.text.node == null ||
state.text.boundingBox == null || (!mxUtils.contains(state.text.boundingBox,
pt.x, pt.y) && !mxUtils.isAncestorNode(state.text.node, mxEvent.getSource(evt))))) &&
((state == null && !this.isCellLocked(this.getDefaultParent())) ||
(state != null && !this.isCellLocked(state.cell))) &&
(state != null || (mxClient.IS_VML && src == this.view.getCanvas()) ||
(mxClient.IS_SVG && src == this.view.getCanvas().ownerSVGElement))) {
cell = this.addText(pt.x, pt.y, state);
}
}
mxGraph.prototype.dblClick.call(this, evt, cell);
}
};
/**
* Returns a point that specifies the location for inserting cells.
*/
Graph.prototype.getInsertPoint = function () {
var gs = this.getGridSize();
var dx = this.container.scrollLeft / this.view.scale - this.view.translate.x;
var dy = this.container.scrollTop / this.view.scale - this.view.translate.y;
if (this.pageVisible) {
var layout = this.getPageLayout();
var page = this.getPageSize();
dx = Math.max(dx, layout.x * page.width);
dy = Math.max(dy, layout.y * page.height);
}
return new mxPoint(this.snap(dx + gs), this.snap(dy + gs));
};
/**
*
*/
Graph.prototype.getFreeInsertPoint = function () {
var view = this.view;
var bds = this.getGraphBounds();
var pt = this.getInsertPoint();
// Places at same x-coord and 2 grid sizes below existing graph
var x = this.snap(Math.round(Math.max(pt.x, bds.x / view.scale - view.translate.x +
((bds.width == 0) ? 2 * this.gridSize : 0))));
var y = this.snap(Math.round(Math.max(pt.y, (bds.y + bds.height) / view.scale - view.translate.y +
2 * this.gridSize)));
return new mxPoint(x, y);
};
/**
* Hook for subclassers to return true if the current insert point was defined
* using a mouse hover event.
*/
Graph.prototype.isMouseInsertPoint = function () {
return false;
};
/**
* Adds a new label at the given position and returns the new cell. State is
* an optional edge state to be used as the parent for the label. Vertices
* are not allowed currently as states.
*/
Graph.prototype.addText = function (x, y, state) {
// Creates a new edge label with a predefined text
var label = new mxCell();
label.value = 'Text';
label.style = 'text;html=1;resizable=0;points=[];';
label.geometry = new mxGeometry(0, 0, 0, 0);
label.vertex = true;
if (state != null) {
label.style += 'align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;';
label.geometry.relative = true;
label.connectable = false;
// Resets the relative location stored inside the geometry
var pt2 = this.view.getRelativePoint(state, x, y);
label.geometry.x = Math.round(pt2.x * 10000) / 10000;
label.geometry.y = Math.round(pt2.y);
// Resets the offset inside the geometry to find the offset from the resulting point
label.geometry.offset = new mxPoint(0, 0);
pt2 = this.view.getPoint(state, label.geometry);
var scale = this.view.scale;
label.geometry.offset = new mxPoint(Math.round((x - pt2.x) / scale), Math.round((y - pt2.y) / scale));
} else {
label.style += 'autosize=1;align=left;verticalAlign=top;spacingTop=-4;';
var tr = this.view.translate;
label.geometry.width = 40;
label.geometry.height = 20;
label.geometry.x = Math.round(x / this.view.scale) - tr.x;
label.geometry.y = Math.round(y / this.view.scale) - tr.y;
}
this.getModel().beginUpdate();
try {
this.addCells([label], (state != null) ? state.cell : null);
this.fireEvent(new mxEventObject('textInserted', 'cells', [label]));
// Updates size of text after possible change of style via event
this.autoSizeCell(label);
} finally {
this.getModel().endUpdate();
}
return label;
};
/**
* Adds a handler for clicking on shapes with links. This replaces all links in labels.
*/
Graph.prototype.addClickHandler = function (highlight, beforeClick, onClick) {
// Replaces links in labels for consistent right-clicks
var checkLinks = mxUtils.bind(this, function () {
var links = this.container.getElementsByTagName('a');
if (links != null) {
for (var i = 0; i < links.length; i++) {
var href = this.getAbsoluteUrl(links[i].getAttribute('href'));
if (href != null) {
links[i].setAttribute('rel', this.linkRelation);
links[i].setAttribute('href', href);
if (beforeClick != null) {
mxEvent.addGestureListeners(links[i], null, null, beforeClick);
}
}
}
}
});
this.model.addListener(mxEvent.CHANGE, checkLinks);
checkLinks();
var cursor = this.container.style.cursor;
var tol = this.getTolerance();
var graph = this;
var mouseListener =
{
currentState: null,
currentLink: null,
highlight: (highlight != null && highlight != '' && highlight != mxConstants.NONE) ?
new mxCellHighlight(graph, highlight, 4) : null,
startX: 0,
startY: 0,
scrollLeft: 0,
scrollTop: 0,
updateCurrentState: function (me) {
var tmp = me.sourceState;
// Gets topmost intersecting cell with link
if (tmp == null || graph.getLinkForCell(tmp.cell) == null) {
var cell = graph.getCellAt(me.getGraphX(), me.getGraphY(), null, null, null, function (state, x, y) {
return graph.getLinkForCell(state.cell) == null;
});
tmp = graph.view.getState(cell);
}
if (tmp != this.currentState) {
if (this.currentState != null) {
this.clear();
}
this.currentState = tmp;
if (this.currentState != null) {
this.activate(this.currentState);
}
}
},
mouseDown: function (sender, me) {
this.startX = me.getGraphX();
this.startY = me.getGraphY();
this.scrollLeft = graph.container.scrollLeft;
this.scrollTop = graph.container.scrollTop;
if (this.currentLink == null && graph.container.style.overflow == 'auto') {
graph.container.style.cursor = 'move';
}
this.updateCurrentState(me);
},
mouseMove: function (sender, me) {
if (graph.isMouseDown) {
if (this.currentLink != null) {
var dx = Math.abs(this.startX - me.getGraphX());
var dy = Math.abs(this.startY - me.getGraphY());
if (dx > tol || dy > tol) {
this.clear();
}
}
} else {
// Checks for parent link
var linkNode = me.getSource();
while (linkNode != null && linkNode.nodeName.toLowerCase() != 'a') {
linkNode = linkNode.parentNode;
}
if (linkNode != null) {
this.clear();
} else {
if (graph.tooltipHandler != null && this.currentLink != null && this.currentState != null) {
graph.tooltipHandler.reset(me, true, this.currentState);
}
if (this.currentState != null && (me.getState() == this.currentState || me.sourceState == null) &&
graph.intersects(this.currentState, me.getGraphX(), me.getGraphY())) {
return;
}
this.updateCurrentState(me);
}
}
},
mouseUp: function (sender, me) {
var source = me.getSource();
var evt = me.getEvent();
// Checks for parent link
var linkNode = source;
while (linkNode != null && linkNode.nodeName.toLowerCase() != 'a') {
linkNode = linkNode.parentNode;
}
// Ignores clicks on links and collapse/expand icon
if (linkNode == null &&
(((Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
(me.sourceState == null || !me.isSource(me.sourceState.control))) &&
(((mxEvent.isLeftMouseButton(evt) || mxEvent.isMiddleMouseButton(evt)) &&
!mxEvent.isPopupTrigger(evt)) || mxEvent.isTouchEvent(evt)))) {
if (this.currentLink != null) {
var blank = graph.isBlankLink(this.currentLink);
if ((this.currentLink.substring(0, 5) === 'data:' ||
!blank) && beforeClick != null) {
beforeClick(evt, this.currentLink);
}
if (!mxEvent.isConsumed(evt)) {
var target = (mxEvent.isMiddleMouseButton(evt)) ? '_blank' :
((blank) ? graph.linkTarget : '_top');
graph.openLink(this.currentLink, target);
me.consume();
}
} else if (onClick != null && !me.isConsumed() &&
(Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
(Math.abs(this.startX - me.getGraphX()) < tol &&
Math.abs(this.startY - me.getGraphY()) < tol)) {
onClick(me.getEvent());
}
}
this.clear();
},
activate: function (state) {
this.currentLink = graph.getAbsoluteUrl(graph.getLinkForCell(state.cell));
if (this.currentLink != null) {
graph.container.style.cursor = 'pointer';
if (this.highlight != null) {
this.highlight.highlight(state);
}
}
},
clear: function () {
if (graph.container != null) {
graph.container.style.cursor = cursor;
}
this.currentState = null;
this.currentLink = null;
if (this.highlight != null) {
this.highlight.hide();
}
if (graph.tooltipHandler != null) {
graph.tooltipHandler.hide();
}
},
};
// Ignores built-in click handling
graph.click = function (me) {
};
graph.addMouseListener(mouseListener);
mxEvent.addListener(document, 'mouseleave', function (evt) {
mouseListener.clear();
});
};
/**
* Duplicates the given cells and returns the duplicates.
*/
Graph.prototype.duplicateCells = function (cells, append) {
cells = (cells != null) ? cells : this.getSelectionCells();
append = (append != null) ? append : true;
cells = this.model.getTopmostCells(cells);
var model = this.getModel();
var s = this.gridSize;
var select = [];
model.beginUpdate();
try {
var clones = this.cloneCells(cells, false, null, true);
for (var i = 0; i < cells.length; i++) {
var parent = model.getParent(cells[i]);
var child = this.moveCells([clones[i]], s, s, false)[0];
select.push(child);
if (append) {
model.add(parent, clones[i]);
} else {
// Maintains child index by inserting after clone in parent
var index = parent.getIndex(cells[i]);
model.add(parent, clones[i], index + 1);
}
}
} finally {
model.endUpdate();
}
return select;
};
/**
* Inserts the given image at the cursor in a content editable text box using
* the insertimage command on the document instance.
*/
Graph.prototype.insertImage = function (newValue, w, h) {
// To find the new image, we create a list of all existing links first
if (newValue != null && this.cellEditor.textarea != null) {
var tmp = this.cellEditor.textarea.getElementsByTagName('img');
var oldImages = [];
for (var i = 0; i < tmp.length; i++) {
oldImages.push(tmp[i]);
}
// LATER: Fix inserting link/image in IE8/quirks after focus lost
document.execCommand('insertimage', false, newValue);
// Sets size of new image
var newImages = this.cellEditor.textarea.getElementsByTagName('img');
if (newImages.length == oldImages.length + 1) {
// Inverse order in favor of appended images
for (var i = newImages.length - 1; i >= 0; i--) {
if (i == 0 || newImages[i] != oldImages[i - 1]) {
// Workaround for lost styles during undo and redo is using attributes
newImages[i].setAttribute('width', w);
newImages[i].setAttribute('height', h);
break;
}
}
}
}
};
/**
* Inserts the given image at the cursor in a content editable text box using
* the insertimage command on the document instance.
*/
Graph.prototype.insertLink = function (value) {
if (this.cellEditor.textarea != null) {
if (value.length == 0) {
document.execCommand('unlink', false);
} else if (mxClient.IS_FF) {
// Workaround for Firefox that adds a new link and removes
// the href from the inner link if its parent is a span is
// to remove all inner links inside the new outer link
var tmp = this.cellEditor.textarea.getElementsByTagName('a');
var oldLinks = [];
for (var i = 0; i < tmp.length; i++) {
oldLinks.push(tmp[i]);
}
document.execCommand('createlink', false, mxUtils.trim(value));
// Finds the new link element
var newLinks = this.cellEditor.textarea.getElementsByTagName('a');
if (newLinks.length == oldLinks.length + 1) {
// Inverse order in favor of appended links
for (var i = newLinks.length - 1; i >= 0; i--) {
if (newLinks[i] != oldLinks[i - 1]) {
// Removes all inner links from the new link and
// moves the children to the inner link parent
var tmp = newLinks[i].getElementsByTagName('a');
while (tmp.length > 0) {
var parent = tmp[0].parentNode;
while (tmp[0].firstChild != null) {
parent.insertBefore(tmp[0].firstChild, tmp[0]);
}
parent.removeChild(tmp[0]);
}
break;
}
}
}
} else {
// LATER: Fix inserting link/image in IE8/quirks after focus lost
document.execCommand('createlink', false, mxUtils.trim(value));
}
}
};
/**
*
* @param cell
* @returns {Boolean}
*/
Graph.prototype.isCellResizable = function (cell) {
var result = mxGraph.prototype.isCellResizable.apply(this, arguments);
var state = this.view.getState(cell);
var style = (state != null) ? state.style : this.getCellStyle(cell);
return result || (mxUtils.getValue(style, mxConstants.STYLE_RESIZABLE, '1') != '0' &&
style[mxConstants.STYLE_WHITE_SPACE] == 'wrap');
};
/**
* Function: distributeCells
*
* Distribuets the centers of the given cells equally along the available
* horizontal or vertical space.
*
* Parameters:
*
* horizontal - Boolean that specifies the direction of the distribution.
* cells - Optional array of <mxCells> to be distributed. Edges are ignored.
*/
Graph.prototype.distributeCells = function (horizontal, cells) {
if (cells == null) {
cells = this.getSelectionCells();
}
if (cells != null && cells.length > 1) {
var vertices = [];
var max = null;
var min = null;
for (var i = 0; i < cells.length; i++) {
if (this.getModel().isVertex(cells[i])) {
var state = this.view.getState(cells[i]);
if (state != null) {
var tmp = (horizontal) ? state.getCenterX() : state.getCenterY();
max = (max != null) ? Math.max(max, tmp) : tmp;
min = (min != null) ? Math.min(min, tmp) : tmp;
vertices.push(state);
}
}
}
if (vertices.length > 2) {
vertices.sort(function (a, b) {
return (horizontal) ? a.x - b.x : a.y - b.y;
});
var t = this.view.translate;
var s = this.view.scale;
min = min / s - ((horizontal) ? t.x : t.y);
max = max / s - ((horizontal) ? t.x : t.y);
this.getModel().beginUpdate();
try {
var dt = (max - min) / (vertices.length - 1);
var t0 = min;
for (var i = 1; i < vertices.length - 1; i++) {
var pstate = this.view.getState(this.model.getParent(vertices[i].cell));
var geo = this.getCellGeometry(vertices[i].cell);
t0 += dt;
if (geo != null && pstate != null) {
geo = geo.clone();
if (horizontal) {
geo.x = Math.round(t0 - geo.width / 2) - pstate.origin.x;
} else {
geo.y = Math.round(t0 - geo.height / 2) - pstate.origin.y;
}
this.getModel().setGeometry(vertices[i].cell, geo);
}
}
} finally {
this.getModel().endUpdate();
}
}
}
return cells;
};
/**
* Adds meta-drag an Mac.
* @param evt
* @returns boolean
*/
Graph.prototype.isCloneEvent = function (evt) {
return (mxClient.IS_MAC && mxEvent.isMetaDown(evt)) || mxEvent.isControlDown(evt);
};
/**
* Translates this point by the given vector.
*
* @param {number} dx X-coordinate of the translation.
* @param {number} dy Y-coordinate of the translation.
*/
Graph.prototype.createSvgImageExport = function () {
var exp = new mxImageExport();
// Adds hyperlinks (experimental)
exp.getLinkForCellState = mxUtils.bind(this, function (state, canvas) {
return this.getLinkForCell(state.cell);
});
return exp;
};
/**
* Translates this point by the given vector.
*
* @param {number} dx X-coordinate of the translation.
* @param {number} dy Y-coordinate of the translation.
*/
Graph.prototype.getSvg = function (background, scale, border, nocrop, crisp,
ignoreSelection, showText, imgExport, linkTarget, hasShadow) {
//Disable Css Transforms if it is used
var origUseCssTrans = this.useCssTransforms;
if (origUseCssTrans) {
this.useCssTransforms = false;
this.view.revalidate();
this.sizeDidChange();
}
try {
scale = (scale != null) ? scale : 1;
border = (border != null) ? border : 0;
crisp = (crisp != null) ? crisp : true;
ignoreSelection = (ignoreSelection != null) ? ignoreSelection : true;
showText = (showText != null) ? showText : true;
var bounds = (ignoreSelection || nocrop) ?
this.getGraphBounds() : this.getBoundingBox(this.getSelectionCells());
if (bounds == null) {
throw Error(mxResources.get('drawingEmpty'));
}
var vs = this.view.scale;
// Prepares SVG document that holds the output
var svgDoc = mxUtils.createXmlDocument();
var root = (svgDoc.createElementNS != null) ?
svgDoc.createElementNS(mxConstants.NS_SVG, 'svg') : svgDoc.createElement('svg');
if (background != null) {
if (root.style != null) {
root.style.backgroundColor = background;
} else {
root.setAttribute('style', 'background-color:' + background);
}
}
if (svgDoc.createElementNS == null) {
root.setAttribute('xmlns', mxConstants.NS_SVG);
root.setAttribute('xmlns:xlink', mxConstants.NS_XLINK);
} else {
// KNOWN: Ignored in IE9-11, adds namespace for each image element instead. No workaround.
root.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xlink', mxConstants.NS_XLINK);
}
var s = scale / vs;
var w = Math.max(1, Math.ceil(bounds.width * s) + 2 * border) + ((hasShadow) ? 5 : 0);
var h = Math.max(1, Math.ceil(bounds.height * s) + 2 * border) + ((hasShadow) ? 5 : 0);
root.setAttribute('version', '1.1');
root.setAttribute('width', w + 'px');
root.setAttribute('height', h + 'px');
root.setAttribute('viewBox', ((crisp) ? '-0.5 -0.5' : '0 0') + ' ' + w + ' ' + h);
svgDoc.appendChild(root);
// Renders graph. Offset will be multiplied with state's scale when painting state.
// TextOffset only seems to affect FF output but used everywhere for consistency.
var group = (svgDoc.createElementNS != null) ?
svgDoc.createElementNS(mxConstants.NS_SVG, 'g') : svgDoc.createElement('g');
root.appendChild(group);
var svgCanvas = this.createSvgCanvas(group);
svgCanvas.foOffset = (crisp) ? -0.5 : 0;
svgCanvas.textOffset = (crisp) ? -0.5 : 0;
svgCanvas.imageOffset = (crisp) ? -0.5 : 0;
svgCanvas.translate(Math.floor((border / scale - bounds.x) / vs),
Math.floor((border / scale - bounds.y) / vs));
// Convert HTML entities
var htmlConverter = document.createElement('textarea');
// Adds simple text fallback for viewers with no support for foreignObjects
var createAlternateContent = svgCanvas.createAlternateContent;
svgCanvas.createAlternateContent = function (fo, x, y, w, h, str, align, valign, wrap, format, overflow, clip, rotation) {
var s = this.state;
// Assumes a max character width of 0.2em
if (this.foAltText != null && (w == 0 || (s.fontSize != 0 && str.length < (w * 5) / s.fontSize))) {
var alt = this.createElement('text');
alt.setAttribute('x', Math.round(w / 2));
alt.setAttribute('y', Math.round((h + s.fontSize) / 2));
alt.setAttribute('fill', s.fontColor || 'black');
alt.setAttribute('text-anchor', 'middle');
alt.setAttribute('font-size', Math.round(s.fontSize) + 'px');
alt.setAttribute('font-family', s.fontFamily);
if ((s.fontStyle & mxConstants.FONT_BOLD) == mxConstants.FONT_BOLD) {
alt.setAttribute('font-weight', 'bold');
}
if ((s.fontStyle & mxConstants.FONT_ITALIC) == mxConstants.FONT_ITALIC) {
alt.setAttribute('font-style', 'italic');
}
if ((s.fontStyle & mxConstants.FONT_UNDERLINE) == mxConstants.FONT_UNDERLINE) {
alt.setAttribute('text-decoration', 'underline');
}
try {
htmlConverter.innerHTML = str;
alt.textContent = htmlConverter.value;
return alt;
} catch (e) {
return createAlternateContent.apply(this, arguments);
}
} else {
return createAlternateContent.apply(this, arguments);
}
};
// Paints background image
var bgImg = this.backgroundImage;
if (bgImg != null) {
var s2 = vs / scale;
var tr = this.view.translate;
var tmp = new mxRectangle(tr.x * s2, tr.y * s2, bgImg.width * s2, bgImg.height * s2);
// Checks if visible
if (mxUtils.intersects(bounds, tmp)) {
svgCanvas.image(tr.x, tr.y, bgImg.width, bgImg.height, bgImg.src, true);
}
}
svgCanvas.scale(s);
svgCanvas.textEnabled = showText;
imgExport = (imgExport != null) ? imgExport : this.createSvgImageExport();
var imgExportDrawCellState = imgExport.drawCellState;
// Ignores custom links
var imgExportGetLinkForCellState = imgExport.getLinkForCellState;
imgExport.getLinkForCellState = function (state, canvas) {
var result = imgExportGetLinkForCellState.apply(this, arguments);
return (result != null && !state.view.graph.isCustomLink(result)) ? result : null;
};
// Implements ignoreSelection flag
imgExport.drawCellState = function (state, canvas) {
var graph = state.view.graph;
var selected = graph.isCellSelected(state.cell);
var parent = graph.model.getParent(state.cell);
// Checks if parent cell is selected
while (!ignoreSelection && !selected && parent != null) {
selected = graph.isCellSelected(parent);
parent = graph.model.getParent(parent);
}
if (ignoreSelection || selected) {
imgExportDrawCellState.apply(this, arguments);
}
};
imgExport.drawState(this.getView().getState(this.model.root), svgCanvas);
this.updateSvgLinks(root, linkTarget, true);
return root;
} finally {
if (origUseCssTrans) {
this.useCssTransforms = true;
this.view.revalidate();
this.sizeDidChange();
}
}
};
/**
* Hook for creating the canvas used in getSvg.
*/
Graph.prototype.updateSvgLinks = function (node, target, removeCustom) {
var links = node.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
var href = links[i].getAttribute('href');
if (href == null) {
href = links[i].getAttribute('xlink:href');
}
if (href != null) {
if (target != null && /^https?:\/\//.test(href)) {
links[i].setAttribute('target', target);
} else if (removeCustom && this.isCustomLink(href)) {
links[i].setAttribute('href', 'javascript:void(0);');
}
}
}
};
/**
* Hook for creating the canvas used in getSvg.
*/
Graph.prototype.createSvgCanvas = function (node) {
return new mxSvgCanvas2D(node);
};
/**
* Returns the first ancestor of the current selection with the given name.
*/
Graph.prototype.getSelectedElement = function () {
var node = null;
if (window.getSelection) {
var sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
var range = sel.getRangeAt(0);
node = range.commonAncestorContainer;
}
} else if (document.selection) {
node = document.selection.createRange().parentElement();
}
return node;
};
/**
* Returns the first ancestor of the current selection with the given name.
*/
Graph.prototype.getParentByName = function (node, name, stopAt) {
while (node != null) {
if (node.nodeName == name) {
return node;
}
if (node == stopAt) {
return null;
}
node = node.parentNode;
}
return node;
};
/**
* Returns the first ancestor of the current selection with the given name.
*/
Graph.prototype.getParentByNames = function (node, names, stopAt) {
while (node != null) {
if (mxUtils.indexOf(names, node.nodeName) >= 0) {
return node;
}
if (node == stopAt) {
return null;
}
node = node.parentNode;
}
return node;
};
/**
* Selects the given node.
*/
Graph.prototype.selectNode = function (node) {
var sel = null;
// IE9 and non-IE
if (window.getSelection) {
sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
var range = document.createRange();
range.selectNode(node);
sel.removeAllRanges();
sel.addRange(range);
}
}
// IE < 9
else if ((sel = document.selection) && sel.type != 'Control') {
var originalRange = sel.createRange();
originalRange.collapse(true);
var range = sel.createRange();
range.setEndPoint('StartToStart', originalRange);
range.select();
}
};
/**
* Inserts a new row into the given table.
*/
Graph.prototype.insertRow = function (table, index) {
var bd = table.tBodies[0];
var cells = bd.rows[0].cells;
var cols = 0;
// Counts columns including colspans
for (var i = 0; i < cells.length; i++) {
var colspan = cells[i].getAttribute('colspan');
cols += (colspan != null) ? parseInt(colspan) : 1;
}
var row = bd.insertRow(index);
for (var i = 0; i < cols; i++) {
mxUtils.br(row.insertCell(-1));
}
return row.cells[0];
};
/**
* Deletes the given column.
*/
Graph.prototype.deleteRow = function (table, index) {
table.tBodies[0].deleteRow(index);
};
/**
* Deletes the given column.
*/
Graph.prototype.insertColumn = function (table, index) {
var hd = table.tHead;
if (hd != null) {
// TODO: use colIndex
for (var h = 0; h < hd.rows.length; h++) {
var th = document.createElement('th');
hd.rows[h].appendChild(th);
mxUtils.br(th);
}
}
var bd = table.tBodies[0];
for (var i = 0; i < bd.rows.length; i++) {
var cell = bd.rows[i].insertCell(index);
mxUtils.br(cell);
}
return bd.rows[0].cells[(index >= 0) ? index : bd.rows[0].cells.length - 1];
};
/**
* Deletes the given column.
*/
Graph.prototype.deleteColumn = function (table, index) {
if (index >= 0) {
var bd = table.tBodies[0];
var rows = bd.rows;
for (var i = 0; i < rows.length; i++) {
if (rows[i].cells.length > index) {
rows[i].deleteCell(index);
}
}
}
};
/**
* Inserts the given HTML at the caret position (no undo).
*/
Graph.prototype.pasteHtmlAtCaret = function (html) {
var sel, range;
// IE9 and non-IE
if (window.getSelection) {
sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0);
range.deleteContents();
// Range.createContextualFragment() would be useful here but is
// only relatively recently standardized and is not supported in
// some browsers (IE9, for one)
var el = document.createElement('div');
el.innerHTML = html;
var frag = document.createDocumentFragment(), node;
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node);
}
range.insertNode(frag);
}
}
// IE < 9
else if ((sel = document.selection) && sel.type != 'Control') {
// FIXME: Does not work if selection is empty
sel.createRange().pasteHTML(html);
}
};
/**
* Creates an anchor elements for handling the given link in the
* hint that is shown when the cell is selected.
*/
Graph.prototype.createLinkForHint = function (link, label) {
link = (link != null) ? link : 'javascript:void(0);';
if (label == null || label.length == 0) {
if (this.isCustomLink(link)) {
label = this.getLinkTitle(link);
} else {
label = link;
}
}
// Helper function to shorten strings
function short(str, max) {
if (str.length > max) {
str = str.substring(0, Math.round(max / 2)) + '...' +
str.substring(str.length - Math.round(max / 4));
}
return str;
};
var a = document.createElement('a');
a.setAttribute('rel', this.linkRelation);
a.setAttribute('href', this.getAbsoluteUrl(link));
a.setAttribute('title', short((this.isCustomLink(link)) ?
this.getLinkTitle(link) : link, 80));
if (this.linkTarget != null) {
a.setAttribute('target', this.linkTarget);
}
// Adds shortened label to link
mxUtils.write(a, short(label, 40));
// Handles custom links
if (this.isCustomLink(link)) {
mxEvent.addListener(a, 'click', mxUtils.bind(this, function (evt) {
this.customLinkClicked(link);
mxEvent.consume(evt);
}));
}
return a;
};
/**
* Customized graph for touch devices.
*/
Graph.prototype.initTouch = function () {
// Disables new connections via "hotspot"
this.connectionHandler.marker.isEnabled = function () {
return this.graph.connectionHandler.first != null;
};
// Hides menu when editing starts
this.addListener(mxEvent.START_EDITING, function (sender, evt) {
this.popupMenuHandler.hideMenu();
});
// Adds custom hit detection if native hit detection found no cell
var graphUpdateMouseEvent = this.updateMouseEvent;
this.updateMouseEvent = function (me) {
me = graphUpdateMouseEvent.apply(this, arguments);
if (mxEvent.isTouchEvent(me.getEvent()) && me.getState() == null) {
var cell = this.getCellAt(me.graphX, me.graphY);
if (cell != null && this.isSwimlane(cell) && this.hitsSwimlaneContent(cell, me.graphX, me.graphY)) {
cell = null;
} else {
me.state = this.view.getState(cell);
if (me.state != null && me.state.shape != null) {
this.container.style.cursor = me.state.shape.node.style.cursor;
}
}
}
if (me.getState() == null && this.isEnabled()) {
this.container.style.cursor = 'default';
}
return me;
};
// Context menu trigger implementation depending on current selection state
// combined with support for normal popup trigger.
var cellSelected = false;
var selectionEmpty = false;
var menuShowing = false;
var oldFireMouseEvent = this.fireMouseEvent;
this.fireMouseEvent = function (evtName, me, sender) {
if (evtName == mxEvent.MOUSE_DOWN) {
// For hit detection on edges
me = this.updateMouseEvent(me);
cellSelected = this.isCellSelected(me.getCell());
selectionEmpty = this.isSelectionEmpty();
menuShowing = this.popupMenuHandler.isMenuShowing();
}
oldFireMouseEvent.apply(this, arguments);
};
// Shows popup menu if cell was selected or selection was empty and background was clicked
// FIXME: Conflicts with mxPopupMenuHandler.prototype.getCellForPopupEvent in Editor.js by
// selecting parent for selected children in groups before this check can be made.
this.popupMenuHandler.mouseUp = mxUtils.bind(this, function (sender, me) {
this.popupMenuHandler.popupTrigger = !this.isEditing() && this.isEnabled() &&
(me.getState() == null || !me.isSource(me.getState().control)) &&
(this.popupMenuHandler.popupTrigger || (!menuShowing && !mxEvent.isMouseEvent(me.getEvent()) &&
((selectionEmpty && me.getCell() == null && this.isSelectionEmpty()) ||
(cellSelected && this.isCellSelected(me.getCell())))));
mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler, arguments);
});
};
/**
* HTML in-place editor
*/
mxCellEditor.prototype.isContentEditing = function () {
var state = this.graph.view.getState(this.editingCell);
return state != null && state.style['html'] == 1;
};
/**
* Returns true if all selected text is inside a table element.
*/
mxCellEditor.prototype.isTableSelected = function () {
return this.graph.getParentByName(
this.graph.getSelectedElement(),
'TABLE', this.textarea) != null;
};
/**
* Sets the alignment of the current selected cell. This sets the
* alignment in the cell style, removes all alignment within the
* text and invokes the built-in alignment function.
*
* Only the built-in function is invoked if shift is pressed or
* if table cells are selected and shift is not pressed.
*/
mxCellEditor.prototype.alignText = function (align, evt) {
if (!this.isTableSelected() == (evt == null || !mxEvent.isShiftDown(evt))) {
this.graph.cellEditor.setAlign(align);
this.graph.processElements(this.textarea, function (elt) {
elt.removeAttribute('align');
elt.style.textAlign = null;
});
}
document.execCommand('justify' + align.toLowerCase(), false, null);
};
/**
* Creates the keyboard event handler for the current graph and history.
*/
mxCellEditor.prototype.saveSelection = function () {
if (window.getSelection) {
var sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
var ranges = [];
for (var i = 0, len = sel.rangeCount; i < len; ++i) {
ranges.push(sel.getRangeAt(i));
}
return ranges;
}
} else if (document.selection && document.selection.createRange) {
return document.selection.createRange();
}
return null;
};
/**
* Creates the keyboard event handler for the current graph and history.
*/
mxCellEditor.prototype.restoreSelection = function (savedSel) {
try {
if (savedSel) {
if (window.getSelection) {
sel = window.getSelection();
sel.removeAllRanges();
for (var i = 0, len = savedSel.length; i < len; ++i) {
sel.addRange(savedSel[i]);
}
} else if (document.selection && savedSel.select) {
savedSel.select();
}
}
} catch (e) {
// ignore
}
};
/**
* Handling of special nl2Br style for not converting newlines to breaks in HTML labels.
* NOTE: Since it's easier to set this when the label is created we assume that it does
* not change during the lifetime of the mxText instance.
*/
var mxCellRendererInitializeLabel = mxCellRenderer.prototype.initializeLabel;
mxCellRenderer.prototype.initializeLabel = function (state) {
if (state.text != null) {
state.text.replaceLinefeeds = mxUtils.getValue(state.style, 'nl2Br', '1') != '0';
}
mxCellRendererInitializeLabel.apply(this, arguments);
};
var mxConstraintHandlerUpdate = mxConstraintHandler.prototype.update;
mxConstraintHandler.prototype.update = function (me, source) {
if (this.isKeepFocusEvent(me) || !mxEvent.isAltDown(me.getEvent())) {
mxConstraintHandlerUpdate.apply(this, arguments);
} else {
this.reset();
}
};
/**
* No dashed shapes.
*/
mxGuide.prototype.createGuideShape = function (horizontal) {
var guide = new mxPolyline([], mxConstants.GUIDE_COLOR, mxConstants.GUIDE_STROKEWIDTH);
return guide;
};
/**
* HTML in-place editor
*/
mxCellEditor.prototype.escapeCancelsEditing = false;
var mxCellEditorStartEditing = mxCellEditor.prototype.startEditing;
mxCellEditor.prototype.startEditing = function (cell, trigger) {
mxCellEditorStartEditing.apply(this, arguments);
// Overrides class in case of HTML content to add
// dashed borders for divs and table cells
var state = this.graph.view.getState(cell);
if (state != null && state.style['html'] == 1) {
this.textarea.className = 'mxCellEditor geContentEditable';
} else {
this.textarea.className = 'mxCellEditor mxPlainTextEditor';
}
// Toggles markup vs wysiwyg mode
this.codeViewMode = false;
// Stores current selection range when switching between markup and code
this.switchSelectionState = null;
// Selects editing cell
this.graph.setSelectionCell(cell);
// Enables focus outline for edges and edge labels
var parent = this.graph.getModel().getParent(cell);
var geo = this.graph.getCellGeometry(cell);
if ((this.graph.getModel().isEdge(parent) && geo != null && geo.relative) ||
this.graph.getModel().isEdge(cell)) {
// Quirks does not support outline at all so use border instead
if (mxClient.IS_QUIRKS) {
this.textarea.style.border = 'gray dotted 1px';
}
// IE>8 and FF on Windows uses outline default of none
else if (mxClient.IS_IE || mxClient.IS_IE11 || (mxClient.IS_FF && mxClient.IS_WIN)) {
this.textarea.style.outline = 'gray dotted 1px';
} else {
this.textarea.style.outline = '';
}
} else if (mxClient.IS_QUIRKS) {
this.textarea.style.outline = 'none';
this.textarea.style.border = '';
}
};
/**
* HTML in-place editor
*/
var cellEditorInstallListeners = mxCellEditor.prototype.installListeners;
mxCellEditor.prototype.installListeners = function (elt) {
cellEditorInstallListeners.apply(this, arguments);
// Adds a reference from the clone to the original node, recursively
function reference(node, clone) {
clone.originalNode = node;
node = node.firstChild;
var child = clone.firstChild;
while (node != null && child != null) {
reference(node, child);
node = node.nextSibling;
child = child.nextSibling;
}
return clone;
};
// Checks the given node for new nodes, recursively
function checkNode(node, clone) {
if (node != null) {
if (clone.originalNode != node) {
cleanNode(node);
} else {
node = node.firstChild;
clone = clone.firstChild;
while (node != null) {
var nextNode = node.nextSibling;
if (clone == null) {
cleanNode(node);
} else {
checkNode(node, clone);
clone = clone.nextSibling;
}
node = nextNode;
}
}
}
};
// Removes unused DOM nodes and attributes, recursively
function cleanNode(node) {
var child = node.firstChild;
while (child != null) {
var next = child.nextSibling;
cleanNode(child);
child = next;
}
if ((node.nodeType != 1 || (node.nodeName !== 'BR' && node.firstChild == null)) &&
(node.nodeType != 3 || mxUtils.trim(mxUtils.getTextContent(node)).length == 0)) {
node.parentNode.removeChild(node);
} else {
// Removes linefeeds
if (node.nodeType == 3) {
mxUtils.setTextContent(node, mxUtils.getTextContent(node).replace(/\n|\r/g, ''));
}
// Removes CSS classes and styles (for Word and Excel)
if (node.nodeType == 1) {
node.removeAttribute('style');
node.removeAttribute('class');
node.removeAttribute('width');
node.removeAttribute('cellpadding');
node.removeAttribute('cellspacing');
node.removeAttribute('border');
}
}
};
// Handles paste from Word, Excel etc by removing styles, classnames and unused nodes
// LATER: Fix undo/redo for paste
if (!mxClient.IS_QUIRKS && document.documentMode !== 7 && document.documentMode !== 8) {
mxEvent.addListener(this.textarea, 'paste', mxUtils.bind(this, function (evt) {
var clone = reference(this.textarea, this.textarea.cloneNode(true));
window.setTimeout(mxUtils.bind(this, function () {
// Paste from Word or Excel
if (this.textarea != null &&
(this.textarea.innerHTML.indexOf('<o:OfficeDocumentSettings>') >= 0 ||
this.textarea.innerHTML.indexOf('<!--[if !mso]>') >= 0)) {
checkNode(this.textarea, clone);
}
}), 0);
}));
}
};
mxCellEditor.prototype.toggleViewMode = function () {
var state = this.graph.view.getState(this.editingCell);
if (state != null) {
var nl2Br = state != null && mxUtils.getValue(state.style, 'nl2Br', '1') != '0';
var tmp = this.saveSelection();
if (!this.codeViewMode) {
// Clears the initial empty label on the first keystroke
if (this.clearOnChange && this.textarea.innerHTML == this.getEmptyLabelText()) {
this.clearOnChange = false;
this.textarea.innerHTML = '';
}
// Removes newlines from HTML and converts breaks to newlines
// to match the HTML output in plain text
var content = mxUtils.htmlEntities(this.textarea.innerHTML);
// Workaround for trailing line breaks being ignored in the editor
if (!mxClient.IS_QUIRKS && document.documentMode != 8) {
content = mxUtils.replaceTrailingNewlines(content, '<div><br></div>');
}
content = this.graph.sanitizeHtml((nl2Br) ? content.replace(/\n/g, '').replace(/<br\s*.?>/g, '<br>') : content, true);
this.textarea.className = 'mxCellEditor mxPlainTextEditor';
var size = mxConstants.DEFAULT_FONTSIZE;
this.textarea.style.lineHeight = (mxConstants.ABSOLUTE_LINE_HEIGHT) ? Math.round(size * mxConstants.LINE_HEIGHT) + 'px' : mxConstants.LINE_HEIGHT;
this.textarea.style.fontSize = Math.round(size) + 'px';
this.textarea.style.textDecoration = '';
this.textarea.style.fontWeight = 'normal';
this.textarea.style.fontStyle = '';
this.textarea.style.fontFamily = mxConstants.DEFAULT_FONTFAMILY;
this.textarea.style.textAlign = 'left';
// Adds padding to make cursor visible with borders
this.textarea.style.padding = '2px';
if (this.textarea.innerHTML != content) {
this.textarea.innerHTML = content;
}
this.codeViewMode = true;
} else {
var content = mxUtils.extractTextWithWhitespace(this.textarea.childNodes);
// Strips trailing line break
if (content.length > 0 && content.charAt(content.length - 1) == '\n') {
content = content.substring(0, content.length - 1);
}
content = this.graph.sanitizeHtml((nl2Br) ? content.replace(/\n/g, '<br/>') : content, true);
this.textarea.className = 'mxCellEditor geContentEditable';
var size = mxUtils.getValue(state.style, mxConstants.STYLE_FONTSIZE, mxConstants.DEFAULT_FONTSIZE);
var family = mxUtils.getValue(state.style, mxConstants.STYLE_FONTFAMILY, mxConstants.DEFAULT_FONTFAMILY);
var align = mxUtils.getValue(state.style, mxConstants.STYLE_ALIGN, mxConstants.ALIGN_LEFT);
var bold = (mxUtils.getValue(state.style, mxConstants.STYLE_FONTSTYLE, 0) &
mxConstants.FONT_BOLD) == mxConstants.FONT_BOLD;
var italic = (mxUtils.getValue(state.style, mxConstants.STYLE_FONTSTYLE, 0) &
mxConstants.FONT_ITALIC) == mxConstants.FONT_ITALIC;
var uline = (mxUtils.getValue(state.style, mxConstants.STYLE_FONTSTYLE, 0) &
mxConstants.FONT_UNDERLINE) == mxConstants.FONT_UNDERLINE;
this.textarea.style.lineHeight = (mxConstants.ABSOLUTE_LINE_HEIGHT) ? Math.round(size * mxConstants.LINE_HEIGHT) + 'px' : mxConstants.LINE_HEIGHT;
this.textarea.style.fontSize = Math.round(size) + 'px';
this.textarea.style.textDecoration = (uline) ? 'underline' : '';
this.textarea.style.fontWeight = (bold) ? 'bold' : 'normal';
this.textarea.style.fontStyle = (italic) ? 'italic' : '';
this.textarea.style.fontFamily = family;
this.textarea.style.textAlign = align;
this.textarea.style.padding = '0px';
if (this.textarea.innerHTML != content) {
this.textarea.innerHTML = content;
if (this.textarea.innerHTML.length == 0) {
this.textarea.innerHTML = this.getEmptyLabelText();
this.clearOnChange = this.textarea.innerHTML.length > 0;
}
}
this.codeViewMode = false;
}
this.textarea.focus();
if (this.switchSelectionState != null) {
this.restoreSelection(this.switchSelectionState);
}
this.switchSelectionState = tmp;
this.resize();
}
};
var mxCellEditorResize = mxCellEditor.prototype.resize;
mxCellEditor.prototype.resize = function (state, trigger) {
if (this.textarea != null) {
var state = this.graph.getView().getState(this.editingCell);
if (this.codeViewMode && state != null) {
var scale = state.view.scale;
this.bounds = mxRectangle.fromRectangle(state);
// General placement of code editor if cell has no size
// LATER: Fix HTML editor bounds for edge labels
if (this.bounds.width == 0 && this.bounds.height == 0) {
this.bounds.width = 160 * scale;
this.bounds.height = 60 * scale;
var m = (state.text != null) ? state.text.margin : null;
if (m == null) {
m = mxUtils.getAlignmentAsPoint(mxUtils.getValue(state.style, mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER),
mxUtils.getValue(state.style, mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_MIDDLE));
}
this.bounds.x += m.x * this.bounds.width;
this.bounds.y += m.y * this.bounds.height;
}
this.textarea.style.width = Math.round((this.bounds.width - 4) / scale) + 'px';
this.textarea.style.height = Math.round((this.bounds.height - 4) / scale) + 'px';
this.textarea.style.overflow = 'auto';
// Adds scrollbar offset if visible
if (this.textarea.clientHeight < this.textarea.offsetHeight) {
this.textarea.style.height = Math.round((this.bounds.height / scale)) + (this.textarea.offsetHeight - this.textarea.clientHeight) + 'px';
this.bounds.height = parseInt(this.textarea.style.height) * scale;
}
if (this.textarea.clientWidth < this.textarea.offsetWidth) {
this.textarea.style.width = Math.round((this.bounds.width / scale)) + (this.textarea.offsetWidth - this.textarea.clientWidth) + 'px';
this.bounds.width = parseInt(this.textarea.style.width) * scale;
}
this.textarea.style.left = Math.round(this.bounds.x) + 'px';
this.textarea.style.top = Math.round(this.bounds.y) + 'px';
if (mxClient.IS_VML) {
this.textarea.style.zoom = scale;
} else {
mxUtils.setPrefixedStyle(this.textarea.style, 'transform', 'scale(' + scale + ',' + scale + ')');
}
} else {
this.textarea.style.height = '';
this.textarea.style.overflow = '';
mxCellEditorResize.apply(this, arguments);
}
}
};
mxCellEditorGetInitialValue = mxCellEditor.prototype.getInitialValue;
mxCellEditor.prototype.getInitialValue = function (state, trigger) {
if (mxUtils.getValue(state.style, 'html', '0') == '0') {
return mxCellEditorGetInitialValue.apply(this, arguments);
} else {
var result = this.graph.getEditingValue(state.cell, trigger);
if (mxUtils.getValue(state.style, 'nl2Br', '1') == '1') {
result = result.replace(/\n/g, '<br/>');
}
result = this.graph.sanitizeHtml(result, true);
return result;
}
};
mxCellEditorGetCurrentValue = mxCellEditor.prototype.getCurrentValue;
mxCellEditor.prototype.getCurrentValue = function (state) {
if (mxUtils.getValue(state.style, 'html', '0') == '0') {
return mxCellEditorGetCurrentValue.apply(this, arguments);
} else {
var result = this.graph.sanitizeHtml(this.textarea.innerHTML, true);
if (mxUtils.getValue(state.style, 'nl2Br', '1') == '1') {
result = result.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
} else {
result = result.replace(/\r\n/g, '').replace(/\n/g, '');
}
return result;
}
};
var mxCellEditorStopEditing = mxCellEditor.prototype.stopEditing;
mxCellEditor.prototype.stopEditing = function (cancel) {
// Restores default view mode before applying value
if (this.codeViewMode) {
this.toggleViewMode();
}
mxCellEditorStopEditing.apply(this, arguments);
// Tries to move focus back to container after editing if possible
this.focusContainer();
};
mxCellEditor.prototype.focusContainer = function () {
try {
this.graph.container.focus();
} catch (e) {
// ignore
}
};
var mxCellEditorApplyValue = mxCellEditor.prototype.applyValue;
mxCellEditor.prototype.applyValue = function (state, value) {
// Removes empty relative child labels in edges
this.graph.getModel().beginUpdate();
try {
mxCellEditorApplyValue.apply(this, arguments);
if (this.graph.isCellDeletable(state.cell) && this.graph.model.getChildCount(state.cell) == 0) {
var stroke = mxUtils.getValue(state.style, mxConstants.STYLE_STROKECOLOR, mxConstants.NONE);
var fill = mxUtils.getValue(state.style, mxConstants.STYLE_FILLCOLOR, mxConstants.NONE);
if (value == '' && stroke == mxConstants.NONE && fill == mxConstants.NONE) {
this.graph.removeCells([state.cell], false);
}
}
} finally {
this.graph.getModel().endUpdate();
}
};
/**
* Returns the background color to be used for the editing box. This returns
* the label background for edge labels and null for all other cases.
*/
mxCellEditor.prototype.getBackgroundColor = function (state) {
var color = mxUtils.getValue(state.style, mxConstants.STYLE_LABEL_BACKGROUNDCOLOR, null);
if ((color == null || color == mxConstants.NONE) &&
(state.cell.geometry != null && state.cell.geometry.width > 0) &&
(mxUtils.getValue(state.style, mxConstants.STYLE_ROTATION, 0) != 0 ||
mxUtils.getValue(state.style, mxConstants.STYLE_HORIZONTAL, 1) == 0)) {
color = mxUtils.getValue(state.style, mxConstants.STYLE_FILLCOLOR, null);
}
if (color == mxConstants.NONE) {
color = null;
}
return color;
};
mxCellEditor.prototype.getMinimumSize = function (state) {
var scale = this.graph.getView().scale;
return new mxRectangle(0, 0, (state.text == null) ? 30 : state.text.size * scale + 20, 30);
};
// Hold alt to ignore drop target
var mxGraphHandlerMoveCells = mxGraphHandler.prototype.moveCells;
mxGraphHandler.prototype.moveCells = function (cells, dx, dy, clone, target, evt) {
if (mxEvent.isAltDown(evt)) {
target = null;
}
mxGraphHandlerMoveCells.apply(this, arguments);
};
/**
* Hints on handlers
*/
function createHint() {
var hint = document.createElement('div');
hint.className = 'geHint';
hint.style.whiteSpace = 'nowrap';
hint.style.position = 'absolute';
return hint;
};
/**
* Format pixels in the given unit
*/
function formatHintText(pixels, unit) {
switch (unit) {
case mxConstants.POINTS:
return pixels;
case mxConstants.MILLIMETERS:
return (pixels / mxConstants.PIXELS_PER_MM).toFixed(1);
case mxConstants.INCHES:
return (pixels / mxConstants.PIXELS_PER_INCH).toFixed(2);
}
};
mxGraphView.prototype.formatUnitText = function (pixels) {
return pixels ? formatHintText(pixels, this.unit) : pixels;
};
/**
* Updates the hint for the current operation.
*/
mxGraphHandler.prototype.updateHint = function (me) {
if (this.shape != null) {
if (this.hint == null) {
this.hint = createHint();
this.graph.container.appendChild(this.hint);
}
var t = this.graph.view.translate;
var s = this.graph.view.scale;
var x = this.roundLength((this.bounds.x + this.currentDx) / s - t.x);
var y = this.roundLength((this.bounds.y + this.currentDy) / s - t.y);
var unit = this.graph.view.unit;
this.hint.innerHTML = formatHintText(x, unit) + ', ' + formatHintText(y, unit);
this.hint.style.left = (this.shape.bounds.x + Math.round((this.shape.bounds.width - this.hint.clientWidth) / 2)) + 'px';
this.hint.style.top = (this.shape.bounds.y + this.shape.bounds.height + 12) + 'px';
}
};
/**
* Updates the hint for the current operation.
*/
mxGraphHandler.prototype.removeHint = function () {
if (this.hint != null) {
this.hint.parentNode.removeChild(this.hint);
this.hint = null;
}
};
/**
* Enables recursive resize for groups.
*/
mxVertexHandler.prototype.isRecursiveResize = function (state, me) {
return !this.graph.isSwimlane(state.cell) && this.graph.model.getChildCount(state.cell) > 0 &&
!mxEvent.isControlDown(me.getEvent()) && !this.graph.isCellCollapsed(state.cell) &&
mxUtils.getValue(state.style, 'recursiveResize', '1') == '1' &&
mxUtils.getValue(state.style, 'childLayout', null) == null;
};
/**
* Enables centered resize events.
*/
mxVertexHandler.prototype.isCenteredEvent = function (state, me) {
return (!(!this.graph.isSwimlane(state.cell) && this.graph.model.getChildCount(state.cell) > 0 &&
!this.graph.isCellCollapsed(state.cell) &&
mxUtils.getValue(state.style, 'recursiveResize', '1') == '1' &&
mxUtils.getValue(state.style, 'childLayout', null) == null) &&
mxEvent.isControlDown(me.getEvent())) ||
mxEvent.isMetaDown(me.getEvent());
};
var vertexHandlerGetHandlePadding = mxVertexHandler.prototype.getHandlePadding;
mxVertexHandler.prototype.getHandlePadding = function () {
var result = new mxPoint(0, 0);
var tol = this.tolerance;
if (this.graph.cellEditor.getEditingCell() == this.state.cell &&
this.sizers != null && this.sizers.length > 0 && this.sizers[0] != null) {
tol /= 2;
result.x = this.sizers[0].bounds.width + tol;
result.y = this.sizers[0].bounds.height + tol;
} else {
result = vertexHandlerGetHandlePadding.apply(this, arguments);
}
return result;
};
/**
* Updates the hint for the current operation.
*/
mxVertexHandler.prototype.updateHint = function (me) {
if (this.index != mxEvent.LABEL_HANDLE) {
if (this.hint == null) {
this.hint = createHint();
this.state.view.graph.container.appendChild(this.hint);
}
if (this.index == mxEvent.ROTATION_HANDLE) {
this.hint.innerHTML = this.currentAlpha + '°';
} else {
var s = this.state.view.scale;
var unit = this.state.view.unit;
this.hint.innerHTML = formatHintText(this.roundLength(this.bounds.width / s), unit) + ' x ' +
formatHintText(this.roundLength(this.bounds.height / s), unit);
}
var rot = (this.currentAlpha != null) ? this.currentAlpha : this.state.style[mxConstants.STYLE_ROTATION] || '0';
var bb = mxUtils.getBoundingBox(this.bounds, rot);
if (bb == null) {
bb = this.bounds;
}
this.hint.style.left = bb.x + Math.round((bb.width - this.hint.clientWidth) / 2) + 'px';
this.hint.style.top = (bb.y + bb.height + 12) + 'px';
if (this.linkHint != null) {
this.linkHint.style.display = 'none';
}
}
};
/**
* Updates the hint for the current operation.
*/
mxVertexHandler.prototype.removeHint = function () {
mxGraphHandler.prototype.removeHint.apply(this, arguments);
if (this.linkHint != null) {
this.linkHint.style.display = '';
}
};
/**
* Updates the hint for the current operation.
*/
mxEdgeHandler.prototype.updateHint = function (me, point) {
if (this.hint == null) {
this.hint = createHint();
this.state.view.graph.container.appendChild(this.hint);
}
var t = this.graph.view.translate;
var s = this.graph.view.scale;
var x = this.roundLength(point.x / s - t.x);
var y = this.roundLength(point.y / s - t.y);
var unit = this.graph.view.unit;
this.hint.innerHTML = formatHintText(x, unit) + ', ' + formatHintText(y, unit);
this.hint.style.visibility = 'visible';
if (this.isSource || this.isTarget) {
if (this.constraintHandler.currentConstraint != null &&
this.constraintHandler.currentFocus != null) {
var pt = this.constraintHandler.currentConstraint.point;
this.hint.innerHTML = '[' + Math.round(pt.x * 100) + '%, ' + Math.round(pt.y * 100) + '%]';
} else if (this.marker.hasValidState()) {
this.hint.style.visibility = 'hidden';
}
}
this.hint.style.left = Math.round(me.getGraphX() - this.hint.clientWidth / 2) + 'px';
this.hint.style.top = (Math.max(me.getGraphY(), point.y) + this.state.view.graph.gridSize) + 'px';
if (this.linkHint != null) {
this.linkHint.style.display = 'none';
}
};
/**
* Updates the hint for the current operation.
*/
mxEdgeHandler.prototype.removeHint = mxVertexHandler.prototype.removeHint;
/**
* Defines the handles for the UI. Uses data-URIs to speed-up loading time where supported.
*/
// TODO: Increase handle padding
HoverIcons.prototype.mainHandle = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/handle-main.png', 17, 17) :
Graph.createSvgImage(18, 18, '<circle cx="9" cy="9" r="5" stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '" stroke-width="1"/>');
HoverIcons.prototype.secondaryHandle = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/handle-secondary.png', 17, 17) :
Graph.createSvgImage(16, 16, '<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');
HoverIcons.prototype.fixedHandle = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/handle-fixed.png', 17, 17) :
Graph.createSvgImage(18, 18, '<circle cx="9" cy="9" r="5" stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '" stroke-width="1"/><path d="m 7 7 L 11 11 M 7 11 L 11 7" stroke="#fff"/>');
HoverIcons.prototype.terminalHandle = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/handle-terminal.png', 17, 17) :
Graph.createSvgImage(18, 18, '<circle cx="9" cy="9" r="5" stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '" stroke-width="1"/><circle cx="9" cy="9" r="2" stroke="#fff" fill="transparent"/>');
HoverIcons.prototype.rotationHandle = new mxImage((mxClient.IS_SVG) ? 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAYAAACkCdXRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAA6ZJREFUeNqM001IY1cUB/D/fYmm2sbR2lC1zYlgoRG6MpEyBlpxM9iFIGKFIm3s0lCKjOByhCLZCFqLBF1YFVJdSRbdFHRhBbULtRuFVBTzYRpJgo2mY5OX5N9Fo2TG+eiFA/dd3vvd8+65ByTxshARTdf1JySp6/oTEdFe9T5eg5lIcnBwkCSZyWS+exX40oyur68/KxaLf5Okw+H4X+A9JBaLfUySZ2dnnJqaosPhIAACeC34DJRKpb7IZrMcHx+nwWCgUopGo/EOKwf9fn/1CzERUevr6+9ls1mOjIwQAH0+H4PBIKPR6D2ofAQCgToRUeVYJUkuLy8TANfW1kiS8/PzCy84Mw4MDBAAZ2dnmc/nub+/X0MSEBF1cHDwMJVKsaGhgV6vl+l0mqOjo1+KyKfl1dze3l4NBoM/PZ+diFSLiIKIGBOJxA9bW1sEwNXVVSaTyQMRaRaRxrOzs+9J8ujoaE5EPhQRq67rcZ/PRwD0+/3Udf03EdEgIqZisZibnJykwWDg4eEhd3Z2xkXELCJvPpdBrYjUiEhL+Xo4HH4sIhUaAKNSqiIcDsNkMqG+vh6RSOQQQM7tdhsAQCkFAHC73UUATxcWFqypVApmsxnDw8OwWq2TADQNgAYAFosF+XweyWQSdru9BUBxcXFRB/4rEgDcPouIIx6P4+bmBi0tLSCpAzBqAIqnp6c/dnZ2IpfLYXNzE62traMADACKNputpr+/v8lms9UAKAAwiMjXe3t7KBQKqKurQy6Xi6K0i2l6evpROp1mbW0t29vbGY/Hb8/IVIqq2zlJXl1dsaOjg2azmefn5wwEAl+JSBVExCgi75PkzMwMlVJsbGxkIpFgPp8PX15ePopEIs3JZPITXdf/iEajbGpqolKKExMT1HWdHo/nIxGpgIgoEXnQ3d39kCTHxsYIgC6Xi3NzcwyHw8xkMozFYlxaWmJbWxuVUuzt7WUul6PX6/1cRN4WEe2uA0SkaWVl5XGpRVhdXU0A1DSNlZWVdz3qdDrZ09PDWCzG4+Pjn0XEWvp9KJKw2WwKwBsA3gHQHAqFfr24uMDGxgZ2d3cRiUQAAHa7HU6nE319fTg5Ofmlq6vrGwB/AngaCoWK6rbsNptNA1AJoA7Aux6Pp3NoaMhjsVg+QNmIRqO/u1yubwFEASRKUAEA7rASqABUAKgC8KAUb5XWCOAfAFcA/gJwDSB7C93DylCtdM8qABhLc5TumV6KQigUeubjfwcAHkQJ94ndWeYAAAAASUVORK5CYII=' :
IMAGE_PATH + '/handle-rotate.png', 19, 21);
if (mxClient.IS_SVG) {
mxConstraintHandler.prototype.pointImage = Graph.createSvgImage(5, 5, '<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="' + HoverIcons.prototype.arrowFill + '"/>');
}
mxVertexHandler.prototype.handleImage = HoverIcons.prototype.mainHandle;
mxVertexHandler.prototype.secondaryHandleImage = HoverIcons.prototype.secondaryHandle;
mxEdgeHandler.prototype.handleImage = HoverIcons.prototype.mainHandle;
mxEdgeHandler.prototype.terminalHandleImage = HoverIcons.prototype.terminalHandle;
mxEdgeHandler.prototype.fixedHandleImage = HoverIcons.prototype.fixedHandle;
mxEdgeHandler.prototype.labelHandleImage = HoverIcons.prototype.secondaryHandle;
mxOutline.prototype.sizerImage = HoverIcons.prototype.mainHandle;
if (window.Sidebar != null) {
Sidebar.prototype.triangleUp = HoverIcons.prototype.triangleUp;
Sidebar.prototype.triangleRight = HoverIcons.prototype.triangleRight;
Sidebar.prototype.triangleDown = HoverIcons.prototype.triangleDown;
Sidebar.prototype.triangleLeft = HoverIcons.prototype.triangleLeft;
Sidebar.prototype.refreshTarget = HoverIcons.prototype.refreshTarget;
Sidebar.prototype.roundDrop = HoverIcons.prototype.roundDrop;
}
// Pre-fetches images (only needed for non data-uris)
if (!mxClient.IS_SVG) {
new Image().src = HoverIcons.prototype.mainHandle.src;
new Image().src = HoverIcons.prototype.fixedHandle.src;
new Image().src = HoverIcons.prototype.terminalHandle.src;
new Image().src = HoverIcons.prototype.secondaryHandle.src;
new Image().src = HoverIcons.prototype.rotationHandle.src;
new Image().src = HoverIcons.prototype.triangleUp.src;
new Image().src = HoverIcons.prototype.triangleRight.src;
new Image().src = HoverIcons.prototype.triangleDown.src;
new Image().src = HoverIcons.prototype.triangleLeft.src;
new Image().src = HoverIcons.prototype.refreshTarget.src;
new Image().src = HoverIcons.prototype.roundDrop.src;
}
// Adds rotation handle and live preview
mxVertexHandler.prototype.rotationEnabled = true;
mxVertexHandler.prototype.manageSizers = true;
mxVertexHandler.prototype.livePreview = true;
// Increases default rubberband opacity (default is 20)
mxRubberband.prototype.defaultOpacity = 30;
// Enables connections along the outline, virtual waypoints, parent highlight etc
mxConnectionHandler.prototype.outlineConnect = true;
mxCellHighlight.prototype.keepOnTop = true;
mxVertexHandler.prototype.parentHighlightEnabled = true;
mxVertexHandler.prototype.rotationHandleVSpacing = -20;
mxEdgeHandler.prototype.parentHighlightEnabled = true;
mxEdgeHandler.prototype.dblClickRemoveEnabled = true;
mxEdgeHandler.prototype.straightRemoveEnabled = true;
mxEdgeHandler.prototype.virtualBendsEnabled = true;
mxEdgeHandler.prototype.mergeRemoveEnabled = true;
mxEdgeHandler.prototype.manageLabelHandle = true;
mxEdgeHandler.prototype.outlineConnect = true;
// Disables adding waypoints if shift is pressed
mxEdgeHandler.prototype.isAddVirtualBendEvent = function (me) {
return !mxEvent.isShiftDown(me.getEvent());
};
// Disables custom handles if shift is pressed
mxEdgeHandler.prototype.isCustomHandleEvent = function (me) {
return !mxEvent.isShiftDown(me.getEvent());
};
/**
* Implements touch style
*/
if (Graph.touchStyle) {
// Larger tolerance for real touch devices
if (mxClient.IS_TOUCH || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0) {
mxShape.prototype.svgStrokeTolerance = 18;
mxVertexHandler.prototype.tolerance = 12;
mxEdgeHandler.prototype.tolerance = 12;
Graph.prototype.tolerance = 12;
mxVertexHandler.prototype.rotationHandleVSpacing = -24;
// Implements a smaller tolerance for mouse events and a larger tolerance for touch
// events on touch devices. The default tolerance (4px) is used for mouse events.
mxConstraintHandler.prototype.getTolerance = function (me) {
return (mxEvent.isMouseEvent(me.getEvent())) ? 4 : this.graph.getTolerance();
};
}
// One finger pans (no rubberband selection) must start regardless of mouse button
mxPanningHandler.prototype.isPanningTrigger = function (me) {
var evt = me.getEvent();
return (me.getState() == null && !mxEvent.isMouseEvent(evt)) ||
(mxEvent.isPopupTrigger(evt) && (me.getState() == null ||
mxEvent.isControlDown(evt) || mxEvent.isShiftDown(evt)));
};
// Don't clear selection if multiple cells selected
var graphHandlerMouseDown = mxGraphHandler.prototype.mouseDown;
mxGraphHandler.prototype.mouseDown = function (sender, me) {
graphHandlerMouseDown.apply(this, arguments);
if (mxEvent.isTouchEvent(me.getEvent()) && this.graph.isCellSelected(me.getCell()) &&
this.graph.getSelectionCount() > 1) {
this.delayedSelection = false;
}
};
} else {
// Removes ctrl+shift as panning trigger for space splitting
mxPanningHandler.prototype.isPanningTrigger = function (me) {
var evt = me.getEvent();
return (mxEvent.isLeftMouseButton(evt) && ((this.useLeftButtonForPanning &&
me.getState() == null) || (mxEvent.isControlDown(evt) &&
!mxEvent.isShiftDown(evt)))) || (this.usePopupTrigger &&
mxEvent.isPopupTrigger(evt));
};
}
// Overrides/extends rubberband for space handling with Ctrl+Shift(+Alt) drag ("scissors tool")
mxRubberband.prototype.isSpaceEvent = function (me) {
return this.graph.isEnabled() && !this.graph.isCellLocked(this.graph.getDefaultParent()) &&
mxEvent.isControlDown(me.getEvent()) && mxEvent.isShiftDown(me.getEvent());
};
// Handles moving of cells in both half panes
mxRubberband.prototype.mouseUp = function (sender, me) {
var execute = this.div != null && this.div.style.display != 'none';
var x0 = null;
var y0 = null;
var dx = null;
var dy = null;
if (this.first != null && this.currentX != null && this.currentY != null) {
x0 = this.first.x;
y0 = this.first.y;
dx = (this.currentX - x0) / this.graph.view.scale;
dy = (this.currentY - y0) / this.graph.view.scale;
if (!mxEvent.isAltDown(me.getEvent())) {
dx = this.graph.snap(dx);
dy = this.graph.snap(dy);
if (!this.graph.isGridEnabled()) {
if (Math.abs(dx) < this.graph.tolerance) {
dx = 0;
}
if (Math.abs(dy) < this.graph.tolerance) {
dy = 0;
}
}
}
}
this.reset();
if (execute) {
if (mxEvent.isAltDown(me.getEvent()) && this.graph.isToggleEvent(me.getEvent())) {
var rect = new mxRectangle(this.x, this.y, this.width, this.height);
var cells = this.graph.getCells(rect.x, rect.y, rect.width, rect.height);
this.graph.removeSelectionCells(cells);
} else if (this.isSpaceEvent(me)) {
this.graph.model.beginUpdate();
try {
var cells = this.graph.getCellsBeyond(x0, y0, this.graph.getDefaultParent(), true, true);
for (var i = 0; i < cells.length; i++) {
if (this.graph.isCellMovable(cells[i])) {
var tmp = this.graph.view.getState(cells[i]);
var geo = this.graph.getCellGeometry(cells[i]);
if (tmp != null && geo != null) {
geo = geo.clone();
geo.translate(dx, dy);
this.graph.model.setGeometry(cells[i], geo);
}
}
}
} finally {
this.graph.model.endUpdate();
}
} else {
var rect = new mxRectangle(this.x, this.y, this.width, this.height);
this.graph.selectRegion(rect, me.getEvent());
}
me.consume();
}
};
// Handles preview for creating/removing space in diagram
mxRubberband.prototype.mouseMove = function (sender, me) {
if (!me.isConsumed() && this.first != null) {
var origin = mxUtils.getScrollOrigin(this.graph.container);
var offset = mxUtils.getOffset(this.graph.container);
origin.x -= offset.x;
origin.y -= offset.y;
var x = me.getX() + origin.x;
var y = me.getY() + origin.y;
var dx = this.first.x - x;
var dy = this.first.y - y;
var tol = this.graph.tolerance;
if (this.div != null || Math.abs(dx) > tol || Math.abs(dy) > tol) {
if (this.div == null) {
this.div = this.createShape();
}
// Clears selection while rubberbanding. This is required because
// the event is not consumed in mouseDown.
mxUtils.clearSelection();
this.update(x, y);
if (this.isSpaceEvent(me)) {
var right = this.x + this.width;
var bottom = this.y + this.height;
var scale = this.graph.view.scale;
if (!mxEvent.isAltDown(me.getEvent())) {
this.width = this.graph.snap(this.width / scale) * scale;
this.height = this.graph.snap(this.height / scale) * scale;
if (!this.graph.isGridEnabled()) {
if (this.width < this.graph.tolerance) {
this.width = 0;
}
if (this.height < this.graph.tolerance) {
this.height = 0;
}
}
if (this.x < this.first.x) {
this.x = right - this.width;
}
if (this.y < this.first.y) {
this.y = bottom - this.height;
}
}
this.div.style.borderStyle = 'dashed';
this.div.style.backgroundColor = 'white';
this.div.style.left = this.x + 'px';
this.div.style.top = this.y + 'px';
this.div.style.width = Math.max(0, this.width) + 'px';
this.div.style.height = this.graph.container.clientHeight + 'px';
this.div.style.borderWidth = (this.width <= 0) ? '0px 1px 0px 0px' : '0px 1px 0px 1px';
if (this.secondDiv == null) {
this.secondDiv = this.div.cloneNode(true);
this.div.parentNode.appendChild(this.secondDiv);
}
this.secondDiv.style.left = this.x + 'px';
this.secondDiv.style.top = this.y + 'px';
this.secondDiv.style.width = this.graph.container.clientWidth + 'px';
this.secondDiv.style.height = Math.max(0, this.height) + 'px';
this.secondDiv.style.borderWidth = (this.height <= 0) ? '1px 0px 0px 0px' : '1px 0px 1px 0px';
} else {
// Hides second div and restores style
this.div.style.backgroundColor = '';
this.div.style.borderWidth = '';
this.div.style.borderStyle = '';
if (this.secondDiv != null) {
this.secondDiv.parentNode.removeChild(this.secondDiv);
this.secondDiv = null;
}
}
me.consume();
}
}
};
// Removes preview
var mxRubberbandReset = mxRubberband.prototype.reset;
mxRubberband.prototype.reset = function () {
if (this.secondDiv != null) {
this.secondDiv.parentNode.removeChild(this.secondDiv);
this.secondDiv = null;
}
mxRubberbandReset.apply(this, arguments);
};
// Timer-based activation of outline connect in connection handler
var startTime = new Date().getTime();
var timeOnTarget = 0;
var mxEdgeHandlerUpdatePreviewState = mxEdgeHandler.prototype.updatePreviewState;
mxEdgeHandler.prototype.updatePreviewState = function (edge, point, terminalState, me) {
mxEdgeHandlerUpdatePreviewState.apply(this, arguments);
if (terminalState != this.currentTerminalState) {
startTime = new Date().getTime();
timeOnTarget = 0;
} else {
timeOnTarget = new Date().getTime() - startTime;
}
this.currentTerminalState = terminalState;
};
// Timer-based outline connect
var mxEdgeHandlerIsOutlineConnectEvent = mxEdgeHandler.prototype.isOutlineConnectEvent;
mxEdgeHandler.prototype.isOutlineConnectEvent = function (me) {
return (this.currentTerminalState != null && me.getState() == this.currentTerminalState && timeOnTarget > 2000) ||
((this.currentTerminalState == null || mxUtils.getValue(this.currentTerminalState.style, 'outlineConnect', '1') != '0') &&
mxEdgeHandlerIsOutlineConnectEvent.apply(this, arguments));
};
// Disables custom handles if shift is pressed
mxVertexHandler.prototype.isCustomHandleEvent = function (me) {
return !mxEvent.isShiftDown(me.getEvent());
};
// Shows secondary handle for fixed connection points
mxEdgeHandler.prototype.createHandleShape = function (index, virtual) {
var source = index != null && index == 0;
var terminalState = this.state.getVisibleTerminalState(source);
var c = (index != null && (index == 0 || index >= this.state.absolutePoints.length - 1 ||
(this.constructor == mxElbowEdgeHandler && index == 2))) ?
this.graph.getConnectionConstraint(this.state, terminalState, source) : null;
var pt = (c != null) ? this.graph.getConnectionPoint(this.state.getVisibleTerminalState(source), c) : null;
var img = (pt != null) ? this.fixedHandleImage : ((c != null && terminalState != null) ?
this.terminalHandleImage : this.handleImage);
if (img != null) {
var shape = new mxImageShape(new mxRectangle(0, 0, img.width, img.height), img.src);
// Allows HTML rendering of the images
shape.preserveImageAspect = false;
return shape;
} else {
var s = mxConstants.HANDLE_SIZE;
if (this.preferHtml) {
s -= 1;
}
return new mxRectangleShape(new mxRectangle(0, 0, s, s), mxConstants.HANDLE_FILLCOLOR, mxConstants.HANDLE_STROKECOLOR);
}
};
var vertexHandlerCreateSizerShape = mxVertexHandler.prototype.createSizerShape;
mxVertexHandler.prototype.createSizerShape = function (bounds, index, fillColor) {
this.handleImage = (index == mxEvent.ROTATION_HANDLE) ? HoverIcons.prototype.rotationHandle : (index == mxEvent.LABEL_HANDLE) ? this.secondaryHandleImage : this.handleImage;
return vertexHandlerCreateSizerShape.apply(this, arguments);
};
// Special case for single edge label handle moving in which case the text bounding box is used
var mxGraphHandlerGetBoundingBox = mxGraphHandler.prototype.getBoundingBox;
mxGraphHandler.prototype.getBoundingBox = function (cells) {
if (cells != null && cells.length == 1) {
var model = this.graph.getModel();
var parent = model.getParent(cells[0]);
var geo = this.graph.getCellGeometry(cells[0]);
if (model.isEdge(parent) && geo != null && geo.relative) {
var state = this.graph.view.getState(cells[0]);
if (state != null && state.width < 2 && state.height < 2 && state.text != null && state.text.boundingBox != null) {
return mxRectangle.fromRectangle(state.text.boundingBox);
}
}
}
return mxGraphHandlerGetBoundingBox.apply(this, arguments);
};
// Uses text bounding box for edge labels
var mxVertexHandlerGetSelectionBounds = mxVertexHandler.prototype.getSelectionBounds;
mxVertexHandler.prototype.getSelectionBounds = function (state) {
var model = this.graph.getModel();
var parent = model.getParent(state.cell);
var geo = this.graph.getCellGeometry(state.cell);
if (model.isEdge(parent) && geo != null && geo.relative && state.width < 2 && state.height < 2 && state.text != null && state.text.boundingBox != null) {
var bbox = state.text.unrotatedBoundingBox || state.text.boundingBox;
return new mxRectangle(Math.round(bbox.x), Math.round(bbox.y), Math.round(bbox.width), Math.round(bbox.height));
} else {
return mxVertexHandlerGetSelectionBounds.apply(this, arguments);
}
};
// Redirects moving of edge labels to mxGraphHandler by not starting here.
// This will use the move preview of mxGraphHandler (see above).
var mxVertexHandlerMouseDown = mxVertexHandler.prototype.mouseDown;
mxVertexHandler.prototype.mouseDown = function (sender, me) {
var model = this.graph.getModel();
var parent = model.getParent(this.state.cell);
var geo = this.graph.getCellGeometry(this.state.cell);
// Lets rotation events through
var handle = this.getHandleForEvent(me);
if (handle == mxEvent.ROTATION_HANDLE || !model.isEdge(parent) || geo == null || !geo.relative ||
this.state == null || this.state.width >= 2 || this.state.height >= 2) {
mxVertexHandlerMouseDown.apply(this, arguments);
}
};
// Shows rotation handle for edge labels.
mxVertexHandler.prototype.isRotationHandleVisible = function () {
return this.graph.isEnabled() && this.rotationEnabled && this.graph.isCellRotatable(this.state.cell) &&
(mxGraphHandler.prototype.maxCells <= 0 || this.graph.getSelectionCount() < mxGraphHandler.prototype.maxCells);
};
// Invokes turn on single click on rotation handle
mxVertexHandler.prototype.rotateClick = function () {
this.state.view.graph.turnShapes([this.state.cell]);
};
var vertexHandlerMouseMove = mxVertexHandler.prototype.mouseMove;
// Workaround for "isConsumed not defined" in MS Edge is to use arguments
mxVertexHandler.prototype.mouseMove = function (sender, me) {
vertexHandlerMouseMove.apply(this, arguments);
if (this.graph.graphHandler.first != null) {
if (this.rotationShape != null && this.rotationShape.node != null) {
this.rotationShape.node.style.display = 'none';
}
}
};
var vertexHandlerMouseUp = mxVertexHandler.prototype.mouseUp;
mxVertexHandler.prototype.mouseUp = function (sender, me) {
vertexHandlerMouseUp.apply(this, arguments);
// Shows rotation handle only if one vertex is selected
if (this.rotationShape != null && this.rotationShape.node != null) {
this.rotationShape.node.style.display = (this.graph.getSelectionCount() == 1) ? '' : 'none';
}
};
var vertexHandlerInit = mxVertexHandler.prototype.init;
mxVertexHandler.prototype.init = function () {
vertexHandlerInit.apply(this, arguments);
var redraw = false;
if (this.rotationShape != null) {
this.rotationShape.node.setAttribute('title', mxResources.get('rotateTooltip'));
}
var update = mxUtils.bind(this, function () {
// Shows rotation handle only if one vertex is selected
if (this.rotationShape != null && this.rotationShape.node != null) {
this.rotationShape.node.style.display = (this.graph.getSelectionCount() == 1) ? '' : 'none';
}
if (this.specialHandle != null) {
this.specialHandle.node.style.display = (this.graph.isEnabled() && this.graph.getSelectionCount() < this.graph.graphHandler.maxCells) ? '' : 'none';
}
this.redrawHandles();
});
this.changeHandler = mxUtils.bind(this, function (sender, evt) {
this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),
this.graph.getLinksForState(this.state));
update();
});
this.graph.getSelectionModel().addListener(mxEvent.CHANGE, this.changeHandler);
this.graph.getModel().addListener(mxEvent.CHANGE, this.changeHandler);
// Repaint needed when editing stops and no change event is fired
this.editingHandler = mxUtils.bind(this, function (sender, evt) {
this.redrawHandles();
});
this.graph.addListener(mxEvent.EDITING_STOPPED, this.editingHandler);
var link = this.graph.getLinkForCell(this.state.cell);
var links = this.graph.getLinksForState(this.state);
this.updateLinkHint(link, links);
if (link != null || (links != null && links.length > 0)) {
redraw = true;
}
if (redraw) {
this.redrawHandles();
}
};
mxVertexHandler.prototype.updateLinkHint = function (link, links) {
if ((link == null && (links == null || links.length == 0)) ||
this.graph.getSelectionCount() > 1) {
if (this.linkHint != null) {
this.linkHint.parentNode.removeChild(this.linkHint);
this.linkHint = null;
}
} else if (link != null || (links != null && links.length > 0)) {
if (this.linkHint == null) {
this.linkHint = createHint();
this.linkHint.style.padding = '6px 8px 6px 8px';
this.linkHint.style.opacity = '1';
this.linkHint.style.filter = '';
this.graph.container.appendChild(this.linkHint);
}
this.linkHint.innerHTML = '';
if (link != null) {
this.linkHint.appendChild(this.graph.createLinkForHint(link));
if (this.graph.isEnabled() && typeof this.graph.editLink === 'function') {
var changeLink = document.createElement('img');
changeLink.setAttribute('src', Editor.editImage);
changeLink.setAttribute('title', mxResources.get('editLink'));
changeLink.setAttribute('width', '11');
changeLink.setAttribute('height', '11');
changeLink.style.marginLeft = '10px';
changeLink.style.marginBottom = '-1px';
changeLink.style.cursor = 'pointer';
this.linkHint.appendChild(changeLink);
mxEvent.addListener(changeLink, 'click', mxUtils.bind(this, function (evt) {
this.graph.setSelectionCell(this.state.cell);
this.graph.editLink();
mxEvent.consume(evt);
}));
var removeLink = document.createElement('img');
removeLink.setAttribute('src', Dialog.prototype.clearImage);
removeLink.setAttribute('title', mxResources.get('removeIt', [mxResources.get('link')]));
removeLink.setAttribute('width', '13');
removeLink.setAttribute('height', '10');
removeLink.style.marginLeft = '4px';
removeLink.style.marginBottom = '-1px';
removeLink.style.cursor = 'pointer';
this.linkHint.appendChild(removeLink);
mxEvent.addListener(removeLink, 'click', mxUtils.bind(this, function (evt) {
this.graph.setLinkForCell(this.state.cell, null);
mxEvent.consume(evt);
}));
}
}
if (links != null) {
for (var i = 0; i < links.length; i++) {
var div = document.createElement('div');
div.style.marginTop = (link != null || i > 0) ? '6px' : '0px';
div.appendChild(this.graph.createLinkForHint(
links[i].getAttribute('href'),
mxUtils.getTextContent(links[i])));
this.linkHint.appendChild(div);
}
}
}
};
mxEdgeHandler.prototype.updateLinkHint = mxVertexHandler.prototype.updateLinkHint;
var edgeHandlerInit = mxEdgeHandler.prototype.init;
mxEdgeHandler.prototype.init = function () {
edgeHandlerInit.apply(this, arguments);
// Disables connection points
this.constraintHandler.isEnabled = mxUtils.bind(this, function () {
return this.state.view.graph.connectionHandler.isEnabled();
});
var update = mxUtils.bind(this, function () {
if (this.linkHint != null) {
this.linkHint.style.display = (this.graph.getSelectionCount() == 1) ? '' : 'none';
}
if (this.labelShape != null) {
this.labelShape.node.style.display = (this.graph.isEnabled() && this.graph.getSelectionCount() < this.graph.graphHandler.maxCells) ? '' : 'none';
}
});
this.changeHandler = mxUtils.bind(this, function (sender, evt) {
this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),
this.graph.getLinksForState(this.state));
update();
this.redrawHandles();
});
this.graph.getSelectionModel().addListener(mxEvent.CHANGE, this.changeHandler);
this.graph.getModel().addListener(mxEvent.CHANGE, this.changeHandler);
var link = this.graph.getLinkForCell(this.state.cell);
var links = this.graph.getLinksForState(this.state);
if (link != null || (links != null && links.length > 0)) {
this.updateLinkHint(link, links);
this.redrawHandles();
}
};
// Disables connection points
var connectionHandlerInit = mxConnectionHandler.prototype.init;
mxConnectionHandler.prototype.init = function () {
connectionHandlerInit.apply(this, arguments);
this.constraintHandler.isEnabled = mxUtils.bind(this, function () {
return this.graph.connectionHandler.isEnabled();
});
};
var vertexHandlerRedrawHandles = mxVertexHandler.prototype.redrawHandles;
mxVertexHandler.prototype.redrawHandles = function () {
vertexHandlerRedrawHandles.apply(this);
if (this.state != null && this.linkHint != null) {
var c = new mxPoint(this.state.getCenterX(), this.state.getCenterY());
var tmp = new mxRectangle(this.state.x, this.state.y - 22, this.state.width + 24, this.state.height + 22);
var bb = mxUtils.getBoundingBox(tmp, this.state.style[mxConstants.STYLE_ROTATION] || '0', c);
var rs = (bb != null) ? mxUtils.getBoundingBox(this.state,
this.state.style[mxConstants.STYLE_ROTATION] || '0') : this.state;
var tb = (this.state.text != null) ? this.state.text.boundingBox : null;
if (bb == null) {
bb = this.state;
}
var b = bb.y + bb.height;
if (tb != null) {
b = Math.max(b, tb.y + tb.height);
}
this.linkHint.style.left = Math.max(0, Math.round(rs.x + (rs.width - this.linkHint.clientWidth) / 2)) + 'px';
this.linkHint.style.top = Math.round(b + this.verticalOffset / 2 + 6 +
this.state.view.graph.tolerance) + 'px';
}
};
var vertexHandlerReset = mxVertexHandler.prototype.reset;
mxVertexHandler.prototype.reset = function () {
vertexHandlerReset.apply(this, arguments);
// Shows rotation handle only if one vertex is selected
if (this.rotationShape != null && this.rotationShape.node != null) {
this.rotationShape.node.style.display = (this.graph.getSelectionCount() == 1) ? '' : 'none';
}
};
var vertexHandlerDestroy = mxVertexHandler.prototype.destroy;
mxVertexHandler.prototype.destroy = function () {
vertexHandlerDestroy.apply(this, arguments);
if (this.linkHint != null) {
this.linkHint.parentNode.removeChild(this.linkHint);
this.linkHint = null;
}
if (this.changeHandler != null) {
this.graph.getSelectionModel().removeListener(this.changeHandler);
this.graph.getModel().removeListener(this.changeHandler);
this.changeHandler = null;
}
if (this.editingHandler != null) {
this.graph.removeListener(this.editingHandler);
this.editingHandler = null;
}
};
var edgeHandlerRedrawHandles = mxEdgeHandler.prototype.redrawHandles;
mxEdgeHandler.prototype.redrawHandles = function () {
// Workaround for special case where handler
// is reset before this which leads to a NPE
if (this.marker != null) {
edgeHandlerRedrawHandles.apply(this);
if (this.state != null && this.linkHint != null) {
var b = this.state;
if (this.state.text != null && this.state.text.bounds != null) {
b = new mxRectangle(b.x, b.y, b.width, b.height);
b.add(this.state.text.bounds);
}
this.linkHint.style.left = Math.max(0, Math.round(b.x + (b.width - this.linkHint.clientWidth) / 2)) + 'px';
this.linkHint.style.top = Math.round(b.y + b.height + 6 + this.state.view.graph.tolerance) + 'px';
}
}
};
var edgeHandlerReset = mxEdgeHandler.prototype.reset;
mxEdgeHandler.prototype.reset = function () {
edgeHandlerReset.apply(this, arguments);
if (this.linkHint != null) {
this.linkHint.style.visibility = '';
}
};
var edgeHandlerDestroy = mxEdgeHandler.prototype.destroy;
mxEdgeHandler.prototype.destroy = function () {
edgeHandlerDestroy.apply(this, arguments);
if (this.linkHint != null) {
this.linkHint.parentNode.removeChild(this.linkHint);
this.linkHint = null;
}
if (this.changeHandler != null) {
this.graph.getModel().removeListener(this.changeHandler);
this.graph.getSelectionModel().removeListener(this.changeHandler);
this.changeHandler = null;
}
};
})();
}
|
var scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;
function flushPromises() {
return new Promise(function(resolve) {
scheduler(resolve);
});
}
module.exports = flushPromises;
|
import { EventEmitter } from 'events'
import mockFs from 'mock-fs'
import * as zip from '../src/helpers/zip'
import * as upload from '../src/helpers/upload'
import deploy from '../src/main'
const emitter = new EventEmitter()
const mockFileTree = {
'/templates': {
project_1: { int_foo: {}, int_bar: {} },
project_2: { int_hello: {}, int_world: {} }
}
}
describe('deploy', () => {
it('should throw an exception if missed "apiKey" property', async () => {
const check = deploy({})
await expect(check).rejects.toThrowError('Missing "API Key"')
})
it('should throw an exception if missed "apiExchange" property', async () => {
const check = deploy({ apiKey: 'test' })
await expect(check).rejects.toThrowError('Missing "API Exchange"')
})
it('should throw an exception if missed "sourcePath" property', async () => {
const check = deploy({
apiKey: 'test',
apiExchange: 'test'
})
await expect(check).rejects.toThrowError('Missing "Source Path"')
})
it('should throw an exception if source path folder does not exist', async () => {
// setup
mockFs(mockFileTree)
// work
const check = deploy({
apiKey: 'test',
apiExchange: 'test',
sourcePath: { source: '/templates/project_fail' }
})
mockFs.restore()
// assertions
await expect(check).rejects.toThrowError('Source path is not a directory')
})
it('should upload storeden template successfully', async () => {
// setup
mockFs(mockFileTree)
zip.default = jest
.fn()
.mockImplementation(() => Promise.resolve('/tmp/archive.zip'))
upload.default = jest.fn().mockImplementation(() => Promise.resolve(true))
// work
const result = await deploy({
apiKey: 'test',
apiExchange: 'test',
sourcePath: { source: '/templates/project_1' },
emitter
})
mockFs.restore()
// assertions
expect(result).toEqual(true)
})
})
|
module.exports = function (ctx) {
const Q = require('q'),
path = require('path'),
fs = require('fs'),
cp = require('child_process'),
os = require('os'),
ifaces = os.networkInterfaces(),
spawn = cp.spawn,
exec = cp.exec,
pRoot = ctx.opts.projectRoot,
nodeModulesPath = path.resolve(pRoot, 'node_modules/'),
wwwFolder = path.resolve(pRoot, 'www/'),
staticFolder = path.resolve(pRoot, 'src/static'),
targetStaticFolder = path.resolve(wwwFolder, 'static/'),
manifestFileSrcPath = path.resolve(pRoot, 'src/manifest.json'),
manifestFileCopyPath = path.resolve(wwwFolder, 'manifest.json'),
webpackPath = path.resolve(nodeModulesPath, '.bin/webpack'),
epipeBombPath = path.resolve(nodeModulesPath, '.bin/epipebomb'),
webpackDevServerPath = path.resolve(nodeModulesPath, '.bin/webpack-dev-server'),
packageJsonPath = path.resolve(__dirname, '../package.json'),
packageJson = require(packageJsonPath)
function getRouterIpAddr () {
for (let key in ifaces) {
if (ifaces.hasOwnProperty(key)) {
for (let ipInfoKey in ifaces[key]) {
if (ifaces[key].hasOwnProperty(ipInfoKey)) {
let ipInfo = ifaces[key][ipInfoKey]
if (ipInfo.family === 'IPv4' && !ipInfo.internal)
return ipInfo.address
}
}
}
}
return '127.0.0.1'
}
const sys = {
toKebabCase (txt) {
return txt.replace(/(\s)+/g, '-').replace(/[A-Z]/g, function (t) {
return t.toLowerCase()
})
},
checkPackageName () {
if (typeof packageJson.name === 'undefined' || packageJson.name === '') {
packageJson.name = 'hello-world'
} else if (/\s/g.test(packageJson.name)) {
packageJson.name = sys.toKebabCase(packageJson.name)
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson), 'utf-8')
}
},
deleteFolderRecursive (path, doNotDeleteSelf = false) {
if (fs.existsSync(path)) {
fs.readdirSync(path).forEach((file) => {
let curPath = path + '/' + file
if (fs.lstatSync(curPath).isDirectory())
sys.deleteFolderRecursive(curPath);
else
fs.unlinkSync(curPath)
})
if (!doNotDeleteSelf)
fs.rmdirSync(path)
}
},
cleanWww () {
let wwwDir = path.resolve(__dirname, '../www/')
sys.deleteFolderRecursive(wwwDir, true)
},
checkManifestFile () {
if (fs.existsSync(manifestFileSrcPath)) {
console.log('Manifest.json found in src folder. Copying...')
fs.writeFileSync(manifestFileCopyPath, fs.readFileSync(manifestFileSrcPath))
}
},
checkNodeModules () {
let defer = new Q.defer()
console.log('Checking is node modules installed...')
if (!fs.existsSync(nodeModulesPath) || !fs.existsSync(path.resolve(nodeModulesPath, 'cheerio/'))) {
console.log('Node modules not found. Installing...')
exec('npm i', { cwd: pRoot, maxBuffer: 1024 * 1024 * 5 }, (error) => {
if (error) {
console.error(`Error happened when npm install: ${error}`);
defer.reject(new Error(`Error happened when npm install: ${error}`))
}
console.log('Node modules installed successfully!')
defer.resolve()
})
}
else {
console.log('Node modules already installed.')
defer.resolve()
}
return defer.promise
},
makeNonDevServerChanges () {
let defer = new Q.defer(),
cheerio = require('cheerio'),
configFile = path.resolve(__dirname, '../config.xml'),
conf = cheerio.load(fs.readFileSync(configFile), { xmlMode: true })
if (conf('allow-navigation').length > 0) {
let target = conf('allow-navigation')
if (target.attr('data-href') !== '') {
target.attr('href', target.attr('data-href'))
target.removeAttr('data-href')
}
}
fs.writeFileSync(configFile, conf.html(), 'utf-8')
sys.cleanWww()
defer.resolve()
return defer.promise
},
makeDevServerChanges () {
let defer = new Q.defer(),
configFile = path.resolve(__dirname, '../config.xml'),
srcFile = path.resolve(__dirname, '../webpack/dev_helpers/device_router.html'),
targetFile = path.resolve(wwwFolder, 'index.html'),
defaultCsp = `default-src *; script-src 'self' data: 'unsafe-inline' 'unsafe-eval' http://127.0.0.1:8081 http://LOCIP:8081; object-src 'self' data: http://127.0.0.1:8081 http://LOCIP:8081; style-src 'self' 'unsafe-inline' data: ; img-src *; media-src 'self' data: http://127.0.0.1:8081 http://LOCIP:8081; frame-src 'self' data: http://127.0.0.1:8081 http://LOCIP:8081; font-src *; connect-src 'self' data: http://127.0.0.1:8081 http://LOCIP:8081`,
cheerio = require('cheerio'),
$ = cheerio.load(fs.readFileSync(srcFile, 'utf-8')),
conf = cheerio.load(fs.readFileSync(configFile), { xmlMode: true })
sys.cleanWww()
$('head').prepend(`<meta http-equiv="content-security-policy" content="${defaultCsp.replace(/LOCIP/g, getRouterIpAddr())}">`)
$('body').prepend(`<script>const localServerIp = '${getRouterIpAddr()}'</script>`).append(`<script src="cordova.js"></script>`)
fs.writeFileSync(targetFile, $.html())
if (conf('allow-navigation').length === 0)
conf('widget').append('<allow-navigation href="*" />')
else {
let target = conf('allow-navigation')
if (target.attr('href') !== '*')
target.attr('data-href', target.attr('href')).attr('href', '*')
}
fs.writeFileSync(configFile, conf.html(), 'utf-8')
sys.deleteFolderRecursive(targetStaticFolder, true)
sys.copyRecursiveSync(staticFolder, targetStaticFolder)
sys.watchStaticFolder()
defer.resolve()
return defer.promise
},
startWebpackBuild (isRelease) {
let defer = new Q.defer()
console.log('Starting webpack build...')
let wpPath = webpackPath + (os.platform() === 'win32' ? '.cmd' : '')
exec(`"${wpPath}"` + (isRelease ? ' --env.release' : ''), { cwd: pRoot, maxBuffer: 1024 * 1024 * 5 }, (error, log) => {
if (error) {
console.error(`Error happened when webpack build: ${error}`);
defer.reject(new Error(`Error happened when webpack build: ${error}`))
}
console.log(`Webpack log: ${log}`);
sys.deleteFolderRecursive(targetStaticFolder, true)
sys.copyRecursiveSync(staticFolder, targetStaticFolder)
sys.checkManifestFile()
console.log('Webpack build completed to www folder successfully!')
defer.resolve()
})
return defer.promise
},
startWebpackDevServer (platform) {
let defer = new Q.defer(),
outText = '',
isResultFound = false,
args = [`"${webpackDevServerPath}"`, '--hot', '--inline', '--env.devserver', '--' + platform, `--public ${getRouterIpAddr()}:8081`, '--env.devserver'],
run = epipeBombPath
if (os.platform() === 'win32') {
args = ['--hot', '--inline', '--env.devserver', '--' + platform, `--public ${getRouterIpAddr()}:8081`, '--env.devserver']
run = `"${webpackDevServerPath}.cmd"`
}
let devServerSpawn = spawn(run, args, {
shell: true,
cwd: pRoot,
stdio: [process.stdin, 'pipe', process.stderr]
})
devServerSpawn.on('error', (err) => {
console.log('Failed to start webpack dev server!')
console.log(err)
defer.reject(err)
})
devServerSpawn.stdout.on('data', (data) => {
process.stdout.write(data)
if (!isResultFound) {
outText += data
if (outText.indexOf('bundle is now VALID.') > -1 || outText.indexOf('Compiled successfully.') > -1 || outText.indexOf('Compiled with warnings') > -1) {
isResultFound = true
outText = ''
defer.resolve()
}
}
})
return defer.promise
},
emptyDefer () {
let defer = new Q.defer()
defer.resolve()
return defer.promise
},
checkOption (name) {
return (
typeof ctx.opts !== 'undefined' &&
typeof ctx.opts.options !== 'undefined' &&
typeof ctx.opts.options[name] !== 'undefined' &&
ctx.opts.options[name] === true
)
},
checkArgv (name) {
return (
typeof ctx.opts !== 'undefined' &&
typeof ctx.opts.options !== 'undefined' &&
typeof ctx.opts.options.argv !== 'undefined' &&
(
Array.isArray(ctx.opts.options.argv) &&
ctx.opts.options.argv.indexOf(name) > -1 ||
ctx.opts.options.argv[name] === true
)
)
},
isFoundInCmdline (cmdCommand) {
return (
ctx.cmdLine.indexOf(`cordova ${cmdCommand}`) > -1 ||
ctx.cmdLine.indexOf(`phonegap ${cmdCommand}`) > -1
)
},
deleteFolderRecursive (path, doNotDeleteSelf = false) {
if (fs.existsSync(path)) {
fs.readdirSync(path).forEach((file) => {
let curPath = path + '/' + file
if (fs.lstatSync(curPath).isDirectory())
sys.deleteFolderRecursive(curPath);
else
fs.unlinkSync(curPath)
})
if (!doNotDeleteSelf)
fs.rmdirSync(path)
}
},
copyRecursiveSync (src, dest) {
let exists = fs.existsSync(src),
stats = exists && fs.statSync(src),
isDirectory = exists && stats.isDirectory()
if (exists && isDirectory) {
if (!fs.existsSync(dest))
fs.mkdirSync(dest)
fs.readdirSync(src).forEach((childItemName) => {
sys.copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName))
})
} else
fs.linkSync(src, dest)
},
createFile (p) {
let rel = path.relative('./src/static/', p)
sys.copyFile(p, path.resolve(targetStaticFolder, rel));
console.log(`${p} created`)
},
addUpdate (p) {
let rel = path.relative('./src/static/', p)
console.log(`${p} copied to ${path.resolve(targetStaticFolder, rel)}`)
},
addDir (p) {
let rel = path.relative('./src/static/', p)
fs.mkdir(path.resolve(targetStaticFolder, rel), () => {
console.log(`Found ${p} folder. Created to ${path.resolve(targetStaticFolder, rel)}`)
})
},
delete (p) {
let rel = path.relative('./src/static/', p)
fs.access(path.resolve(targetStaticFolder, rel), fs.constants.W_OK, (err) => {
if (!err) {
fs.unlink(path.resolve(targetStaticFolder, rel), () => {
console.log(`${path.resolve(targetStaticFolder, rel)} deleted.`)
})
} else {
console.log(`${path.resolve(targetStaticFolder, rel)} not deleted.`)
}
})
},
copyFile (source, target, cb) {
let cbCalled = false
let rd = fs.createReadStream(source)
rd.on("error", done)
let wr = fs.createWriteStream(target)
wr.on("error", done)
wr.on("close", done)
rd.pipe(wr)
function done (err) {
if (!cbCalled && typeof cb === 'function') {
cb(err)
cbCalled = true
}
}
},
watchStaticFolder () {
if (fs.existsSync(staticFolder)) {
const chokidar = require('chokidar'),
watcher = chokidar.watch(staticFolder, {
persistent: true
})
watcher.on('ready', () => {
console.log('Watcher ready!')
watcher
.on('add', sys.createFile)
.on('change', sys.addUpdate)
.on('unlink', sys.delete)
.on('addDir', sys.addDir)
.on('unlinkDir', sys.delete)
})
}
}
}
let deferral = new Q.defer(),
isBuild = sys.isFoundInCmdline('build'),
isRun = sys.isFoundInCmdline('run'),
isEmulate = sys.isFoundInCmdline('emulate'),
isPrepare = sys.isFoundInCmdline('prepare'),
isServe = sys.isFoundInCmdline('serve'),
isLiveReload = sys.checkArgv('--live-reload') || sys.checkArgv('--lr') || sys.checkArgv('lr') || sys.checkArgv('live-reload'),
isNoBuild = sys.checkOption('no-build'),
isRelease = sys.checkOption('release')
if (ctx.opts.platforms.length === 0 && !isPrepare) {
console.log('Update happened. Skipping...')
deferral.resolve()
}
else {
console.log('Before deploy hook started...')
// if package name contains space characters, we'll convert it to kebab case. Required for npm install command to work.
sys.checkPackageName()
sys.checkNodeModules()
.then(() => {
if (isBuild || ((isRun || isEmulate || isPrepare) && !isLiveReload && !isNoBuild)) {
return sys.makeNonDevServerChanges().then(() => sys.startWebpackBuild(isRelease))
} else if (isServe || (isRun || isEmulate) && isLiveReload) {
return sys.makeDevServerChanges().then(() => sys.startWebpackDevServer(ctx.opts.platforms[0]))
}
else
return sys.emptyDefer()
})
.then(() => {
console.log('Cordova hook completed. Resuming to run your cordova command...')
deferral.resolve()
})
.catch((err) => {
console.log('Error happened on main chain:')
console.log(err)
deferral.reject(err)
})
.done()
}
return deferral.promise
}
|
/*
* Copyright 2016 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Test for password sign in handler.
*/
goog.provide('firebaseui.auth.widget.handler.PasswordSignInTest');
goog.setTestOnly('firebaseui.auth.widget.handler.PasswordSignInTest');
goog.require('firebaseui.auth.AuthUIError');
goog.require('firebaseui.auth.widget.handler.common');
goog.require('firebaseui.auth.widget.handler.handlePasswordRecovery');
goog.require('firebaseui.auth.widget.handler.handlePasswordSignIn');
goog.require('firebaseui.auth.widget.handler.handleSignIn');
goog.require('firebaseui.auth.widget.handler.testHelper');
goog.require('goog.Promise');
goog.require('goog.dom');
goog.require('goog.dom.forms');
goog.require('goog.testing.events');
goog.require('goog.testing.recordFunction');
function testHandlePasswordSignIn() {
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
goog.dom.forms.setValue(getPasswordElement(), '123');
submitForm();
testAuth.assertSignInWithEmailAndPassword(
[passwordAccount.getEmail(), '123'],
function() {
testAuth.setUser({
'email': passwordAccount.getEmail(),
'displayName': passwordAccount.getDisplayName()
});
return testAuth.currentUser;
});
// Sign out from internal instance and then sign in with passed credential to
// external instance.
return testAuth.process().then(function() {
testAuth.assertSignOut([]);
return testAuth.process();
}).then(function() {
externalAuth.setUser(testAuth.currentUser);
// Confirm password credential passed and signed in with.
var cred = new firebase.auth.EmailAuthProvider.credential(
passwordAccount.getEmail(), '123');
externalAuth.assertSignInWithCredential([cred], externalAuth.currentUser);
return externalAuth.process();
}).then(function() {
testUtil.assertGoTo('http://localhost/home');
});
}
function testHandlePasswordSignIn_upgradeAnonymous_successfulSignIn() {
testStubs.replace(
firebaseui.auth.log,
'error',
goog.testing.recordFunction());
var expectedCredential = firebase.auth.EmailAuthProvider.credential(
passwordAccount.getEmail(), '123');
// Expected FirebaseUI error.
var expectedMergeError = new firebaseui.auth.AuthUIError(
firebaseui.auth.AuthUIError.Error.MERGE_CONFLICT,
null,
expectedCredential);
app.updateConfig('autoUpgradeAnonymousUsers', true);
// Simulate anonymous user externally signed in.
externalAuth.setUser(anonymousUser);
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
goog.dom.forms.setValue(getPasswordElement(), '123');
submitForm();
testAuth.assertSignInWithEmailAndPassword(
[passwordAccount.getEmail(), '123'],
function() {
// Set non-anonymous user on internal Auth instance.
testAuth.setUser({
'email': passwordAccount.getEmail(),
'displayName': passwordAccount.getDisplayName()
});
return testAuth.currentUser;
});
// Sign out from internal instance and then sign in with passed credential to
// external instance.
return testAuth.process().then(function() {
externalAuth.runAuthChangeHandler();
// signOut user on temp instance.
testAuth.assertSignOut([]);
return testAuth.process();
}).then(function() {
mockClock.tick();
// No error message should be displayed in console.
/** @suppress {missingRequire} */
assertEquals(0, firebaseui.auth.log.error.getCallCount());
// No info bar should be displayed.
assertNoInfoBarMessage();
// UI should be disposed.
assertComponentDisposed();
// signInFailure should be triggered with expected FirebaseUI error.
assertSignInFailure(expectedMergeError);
});
}
function testHandlePasswordSignIn_upgradeAnonymous_wrongPassword() {
var error = {'code': 'auth/wrong-password'};
var expectedCredential = firebase.auth.EmailAuthProvider.credential(
passwordAccount.getEmail(), '123');
// Expected FirebaseUI error.
var expectedMergeError = new firebaseui.auth.AuthUIError(
firebaseui.auth.AuthUIError.Error.MERGE_CONFLICT,
null,
expectedCredential);
app.updateConfig('autoUpgradeAnonymousUsers', true);
// Simulate anonymous user externally signed in.
externalAuth.setUser(anonymousUser);
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
goog.dom.forms.setValue(getPasswordElement(), '321');
submitForm();
// Simulate wrong password on sign-in.
testAuth.assertSignInWithEmailAndPassword(
[passwordAccount.getEmail(), '321'],
null,
error);
return testAuth.process().then(function() {
// Password sign-in page should be displayed with info bar message.
assertPasswordSignInPage();
assertEquals(
firebaseui.auth.widget.handler.common.getErrorMessage(error),
getPasswordErrorMessage());
// Try the correct password.
goog.dom.forms.setValue(getPasswordElement(), '123');
submitForm();
testAuth.assertSignInWithEmailAndPassword(
[passwordAccount.getEmail(), '123'],
function() {
// Set non-anonymous user on internal Auth instance.
testAuth.setUser({
'email': passwordAccount.getEmail(),
'displayName': passwordAccount.getDisplayName()
});
return testAuth.currentUser;
});
return testAuth.process();
}).then(function() {
externalAuth.runAuthChangeHandler();
// signOut user on temp instance.
testAuth.assertSignOut([]);
return testAuth.process();
}).then(function() {
// No info bar should be displayed.
assertNoInfoBarMessage();
// UI should be disposed.
assertComponentDisposed();
// signInFailure should be triggered with expected FirebaseUI error.
assertSignInFailure(expectedMergeError);
});
}
function testHandlePasswordSignIn_reset() {
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
// Reset the current rendered widget page.
app.getAuth().assertSignOut([]);
app.reset();
// Container should be cleared.
assertComponentDisposed();
}
function testHandlePasswordSignIn_signInCallback() {
// Provide a sign in success callback.
app.setConfig({
'callbacks': {
'signInSuccess': signInSuccessCallback(false)
}
});
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
goog.dom.forms.setValue(getPasswordElement(), '123');
submitForm();
testAuth.assertSignInWithEmailAndPassword(
[passwordAccount.getEmail(), '123'],
function() {
testAuth.setUser({
'email': passwordAccount.getEmail(),
'displayName': passwordAccount.getDisplayName()
});
return testAuth.currentUser;
});
// Sign out from internal instance and then sign in with passed credential to
// external instance.
return testAuth.process().then(function() {
testAuth.assertSignOut([]);
return testAuth.process();
}).then(function() {
externalAuth.setUser(testAuth.currentUser);
// Confirm password credential passed and signed in with.
var cred = new firebase.auth.EmailAuthProvider.credential(
passwordAccount.getEmail(), '123');
externalAuth.assertSignInWithCredential([cred], externalAuth.currentUser);
return externalAuth.process();
}).then(function() {
testAuth.assertSignOut([]);
// SignInCallback is called. No password credential is passed.
assertSignInSuccessCallbackInvoked(
externalAuth.currentUser, null, undefined);
// Container should be cleared.
assertComponentDisposed();
});
}
function testHandlePasswordSignIn_forgotPassword() {
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
goog.testing.events.fireClickSequence(
goog.dom.getElementByClass('firebaseui-id-secondary-link', container));
assertPasswordRecoveryPage();
}
function testHandlePasswordSignIn_wrongPassword() {
var error = {'code': 'auth/wrong-password'};
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
return goog.Promise.resolve()
.then(function() {
// Try an incorrect password.
goog.dom.forms.setValue(getPasswordElement(), '321');
submitForm();
testAuth.assertSignInWithEmailAndPassword(
[passwordAccount.getEmail(), '321'], null, error);
return testAuth.process();
})
.then(function() {
assertPasswordSignInPage();
assertEquals(
firebaseui.auth.widget.handler.common.getErrorMessage(error),
getPasswordErrorMessage());
// Try the correct password.
goog.dom.forms.setValue(getPasswordElement(), '123');
submitForm();
testAuth.assertSignInWithEmailAndPassword(
[passwordAccount.getEmail(), '123'],
function() {
testAuth.setUser({
'email': passwordAccount.getEmail(),
'displayName': passwordAccount.getDisplayName()
});
return testAuth.currentUser;
});
return testAuth.process();
}).then(function() {
// Sign out from internal instance and then sign in with passed
// credential to external instance.
testAuth.assertSignOut([]);
return testAuth.process();
}).then(function() {
externalAuth.setUser(testAuth.currentUser);
// Confirm correct password credential passed and signed in with.
var cred = new firebase.auth.EmailAuthProvider.credential(
passwordAccount.getEmail(), '123');
externalAuth.assertSignInWithCredential(
[cred], externalAuth.currentUser);
return externalAuth.process();
}).then(function() {
testUtil.assertGoTo('http://localhost/home');
});
}
function testHandlePasswordSignIn_otherError() {
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
goog.dom.forms.setValue(getPasswordElement(), '123');
submitForm();
testAuth.assertSignInWithEmailAndPassword(
[federatedAccount.getEmail(), '123'], null, internalError);
return testAuth.process().then(function() {
assertPasswordSignInPage();
assertInfoBarMessage(
firebaseui.auth.widget.handler.common.getErrorMessage(internalError));
});
}
function testHandlePasswordSignIn_emailEmpty() {
firebaseui.auth.widget.handler.handlePasswordSignIn(app, container);
assertPasswordSignInPage();
goog.dom.forms.setValue(getPasswordElement(), '123');
submitForm();
// No submission without email.
assertPasswordSignInPage();
}
function testHandlePasswordSignIn_emailInvalid() {
firebaseui.auth.widget.handler.handlePasswordSignIn(app, container, 'user@');
assertPasswordSignInPage();
goog.dom.forms.setValue(getPasswordElement(), '123');
submitForm();
// No submission with invalid email.
assertPasswordSignInPage();
}
function testHandlePasswordSignIn_passwordEmpty() {
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
submitForm();
// No submission without password.
assertPasswordSignInPage();
}
function testHandlePasswordSignIn_inProcessing() {
firebaseui.auth.widget.handler.handlePasswordSignIn(
app, container, passwordAccount.getEmail());
assertPasswordSignInPage();
return goog.Promise.resolve()
.then(function() {
goog.dom.forms.setValue(getPasswordElement(), '123');
submitForm();
delayForBusyIndicatorAndAssertIndicatorShown();
// Click submit again.
submitForm();
// Only one request sent.
testAuth.assertSignInWithEmailAndPassword(
[passwordAccount.getEmail(), '123'], null, internalError);
return testAuth.process();
})
.then(function() {
assertBusyIndicatorHidden();
// Submit again.
submitForm();
testAuth.assertSignInWithEmailAndPassword(
[passwordAccount.getEmail(), '123'],
function() {
testAuth.setUser({
'email': passwordAccount.getEmail(),
'displayName': passwordAccount.getDisplayName()
});
return testAuth.currentUser;
});
return testAuth.process();
}).then(function() {
// Sign out from internal instance and then sign in with passed
// credential to external instance.
testAuth.assertSignOut([]);
return testAuth.process();
}).then(function() {
externalAuth.setUser(testAuth.currentUser);
// Confirm correct password credential passed and signed in with.
var cred = new firebase.auth.EmailAuthProvider.credential(
passwordAccount.getEmail(), '123');
externalAuth.assertSignInWithCredential(
[cred], externalAuth.currentUser);
return externalAuth.process();
}).then(function() {
testUtil.assertGoTo('http://localhost/home');
});
}
|
/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
module.exports = function (RED) {
"use strict";
const Api = require('../fission/api');
const Common = require('../fission/common');
const api = new Api.Api(Api.InClusterConfig);
function FissionRedis(n) {
RED.nodes.createNode(this, n);
const funcname = 'std-redis-cmd';
const node = this;
node.instancename = n.instancename;
node.command = n.command;
node.aliveRequests = 0;
node.on('input', function (msg) {
const instancename = node.instancename || msg.instancename;
const command = node.command || msg.command;
if (!instancename || !command) {
return;
}
node.aliveRequests += 1;
node.status({fill: "green", shape: "ring", text: `running ${node.aliveRequests} reqs`, running: true});
api.invokeFunction(funcname, 'POST', {}, {},
{instancename, command, payload: msg.payload}).then((response) => {
node.log(response);
node.aliveRequests -= 1;
if (node.aliveRequests === 0) {
node.status({});
} else {
node.status({
fill: "green", shape: "ring", text: `running ${node.aliveRequests} reqs`,
running: node.aliveRequests > 0
});
}
Common.fillMsg(msg, response);
node.send([msg, null]);
}).catch((err) => {
node.aliveRequests -= 1;
node.status({fill: "red", shape: "dot", text: "an invocation failed", running: node.aliveRequests > 0});
node.error(`invoke fission func [${funcname}] failed, with error: ${err}`);
Common.fillMsg(msg, err.response);
node.send([null, msg]);
});
})
}
RED.nodes.registerType("fission-redis", FissionRedis);
};
|
import{r as t,e as i,f as a,c as n,i as e,h as r,H as o,g as s}from"./p-8dbe4215.js";import{s as l}from"./p-70b25770.js";const d=class{constructor(a){t(this,a),this.bkkrPaginator=i(this,"bkkrPaginator",7),this.bkkrPageSizeChanged=i(this,"bkkrPageSizeChanged",7),this.thrPx=0,this.thrPc=0,this.didFire=!1,this.isBusy=!1,this.isLoading=!1,this.threshold="15%",this.page=1,this.infinite=!1,this.toolbar=!0,this.position="bottom",this.arrowIcon="chevron",this.statusText="/",this.loadingType="ambient",this.loadingSpinner="crescent",this.disabled=!1,this.routerDirection="forward",this.onScroll=()=>{const t=this.scrollEl;if(!t||!this.canStart())return 1;const i=t.scrollTop,a=t.offsetHeight,n=0!==this.thrPc?a*this.thrPc:this.thrPx;if(("bottom"===this.position?t.scrollHeight-i-n-a:i-n)<0){if(!this.didFire)return this.isLoading=!0,this.didFire=!0,this.page+=1,this.bkkrPaginator.emit(),3}else this.didFire=!1;return 4},this.handleClick=(t,i)=>{t.preventDefault(),this.changeIndex(i)},this.handleLenghtChange=t=>{this.lenght=t.detail.value,this.page*this.lenght>this.items&&(this.page=Math.ceil(this.items/this.lenght)),this.bkkrPageSizeChanged.emit()}}thresholdChanged(){const t=this.threshold;t.lastIndexOf("%")>-1?(this.thrPx=0,this.thrPc=parseFloat(t)/100):(this.thrPx=parseFloat(t),this.thrPc=0)}itemsChanged(){a(this)}pageChanged(){a(this)}infiniteChanged(){const t=this.infinite&&!this.disabled;t||(this.isLoading=!1,this.isBusy=!1),this.enableScrollEvents(t)}disabledChanged(){this.disabled&&(this.isLoading=!1,this.isBusy=!1,this.infinite=!1)}async connectedCallback(){const t=this.el.closest("bkkr-content");t?(this.scrollEl=await t.getScrollElement(),this.thresholdChanged(),this.infiniteChanged(),this.disabledChanged(),"top"===this.position&&n((()=>{this.scrollEl&&(this.scrollEl.scrollTop=this.scrollEl.scrollHeight-this.scrollEl.clientHeight)}))):console.error("<bkkr-paginator> must be used inside an <bkkr-content>")}onResize(){a(this)}disconnectedCallback(){this.enableScrollEvents(!1),this.scrollEl=void 0}changeIndex(t){this.isLoading||(this.isLoading=!0,this.page=t,this.bkkrPaginator.emit())}async complete(){const t=this.scrollEl;if(this.isLoading&&t&&(this.isLoading=!1,"top"===this.position)){this.isBusy=!0;const i=t.scrollHeight-t.scrollTop;requestAnimationFrame((()=>{e((()=>{const a=t.scrollHeight-i;requestAnimationFrame((()=>{n((()=>{t.scrollTop=a,this.isBusy=!1}))}))}))}))}}canStart(){return!(this.disabled||this.isBusy||!this.scrollEl||this.isLoading||!this.infinite)}enableScrollEvents(t){this.scrollEl&&(t?this.scrollEl.addEventListener("scroll",this.onScroll):this.scrollEl.removeEventListener("scroll",this.onScroll))}render(){const{disabled:t,infinite:i,items:a,href:n,lenght:e,page:s,isLoading:d,loadingType:p,loadingSpinner:c,loadingText:b,toolbar:h,arrowIcon:m,statusText:k,handleClick:f}=this,u=window.innerWidth<768,w=i?1:s*e-(e-1),v=Math.min(s*e,a),x=Math.ceil(a/e),y=w>1,z=v<a,C=[];let j=!1;for(let t=1;t<=x;t++)1===t||t===x||t>=s-1&&t<s+2?(C.push({index:t,label:t,selected:t===s||null}),j=!1):!j&&t>1&&(t>=s-1||t<s+2)&&(C.push({index:null,label:"..."}),j=!0);return r(o,{class:{"paginator-loading":d,"paginator-enabled":!t,"paginator-infinite":i,["paginator-loading-"+p]:!0}},r("div",{class:"paginator-content"},r("slot",null)),"spinner"===p&&r("div",{class:"paginator-loading-content"},c&&r("div",{class:"paginator-loading-spinner"},r("bkkr-spinner",{type:c})),b&&r("div",{class:"paginator-loading-text",innerHTML:l(b)})),h&&!i&&r("nav",{class:"paginator-toolbar"},!u&&r("div",{class:"paginator-toolbar-fragment"},r("small",{class:"paginator-statustext"},w," - ",v," ",k," ",a),r("bkkr-select",{value:15,search:!1,interface:"popover",onBkkrChange:t=>this.handleLenghtChange(t)},r("bkkr-select-option",{value:15},"15"),r("bkkr-select-option",{value:30},"30"),r("bkkr-select-option",{value:50},"50"))),r("div",{class:"paginator-toolbar-fragment justify-content-center justify-content-md-end"},r("bkkr-button",{fill:"clear",color:"primary",href:void 0!==n?n+(s-1):null,disabled:!y,onClick:t=>this.handleClick(t,s-1)},r("bkkr-icon",{name:m+"-left"})),C.map((t=>g(t,{href:n,handleClick:f}))),r("bkkr-button",{fill:"clear",color:"primary",href:void 0!==n?n+(s+1):null,disabled:!z,onClick:t=>this.handleClick(t,s+1)},r("bkkr-icon",{name:m+"-right"})))))}get el(){return s(this)}static get watchers(){return{threshold:["thresholdChanged"],lenght:["itemsChanged"],page:["pageChanged"],infinite:["infiniteChanged"],disabled:["disabledChanged"]}}},g=(t,{href:i,handleClick:a})=>{if(!(window.innerWidth<768)||t.selected)return r("bkkr-button",{href:i&&t.index?i+t.index:null,onClick:i=>a(i,t.index),fill:t.selected?"solid":"clear",color:"primary",disabled:null===t.index},t.label)};d.style='.paginator-enabled{--padding-top:0;--padding-start:0;--padding-end:0;--padding-bottom:0;--toolbar-padding-top:var(--bkkr-spacer, 16px);--toolbar-padding-start:0;--toolbar-padding-end:0;--toolbar-padding-bottom:0;display:block}.paginator-infinite.paginator-enabled{min-height:84px}.paginator-content{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.paginator-content{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.paginator-loading-ambient .paginator-content{--background:radial-gradient(var(--color-base, var(--color-primary, #3880ff))), radial-gradient(var(--color-base, var(--color-primary, #3880ff))), radial-gradient(var(--color-base, var(--color-primary, #3880ff))), radial-gradient(var(--color-base, var(--color-primary, #3880ff)));--border-radius:0.75em;border-radius:var(--border-radius);position:relative;overflow:hidden}.paginator-loading-ambient .paginator-content::before{top:0;left:50%;position:absolute;width:100%;height:100%;-webkit-transform-origin:center top;transform-origin:center top;-webkit-transition:0.2s opacity cubic-bezier(0.32, 0.72, 0, 1);transition:0.2s opacity cubic-bezier(0.32, 0.72, 0, 1);background-image:var(--background);background-repeat:no-repeat;background-position:0 0, 100% 0, 100% 100%, 0 100%;background-size:50% 50%, 50% 50%;content:"";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-2;-webkit-animation-name:shimmer;animation-name:shimmer;-webkit-animation-duration:5s;animation-duration:5s;-webkit-animation-timing-function:cubic-bezier(0.32, 0.72, 0, 1);animation-timing-function:cubic-bezier(0.32, 0.72, 0, 1);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-play-state:paused;animation-play-state:paused;pointer-events:none}.paginator-loading-ambient .paginator-content::after{border-radius:var(--border-radius);top:50%;left:50%;position:absolute;width:100%;height:100%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);-webkit-transition:0.2s height cubic-bezier(0.32, 0.72, 0, 1), 0.2s -webkit-transform cubic-bezier(0.32, 0.72, 0, 1);transition:0.2s height cubic-bezier(0.32, 0.72, 0, 1), 0.2s -webkit-transform cubic-bezier(0.32, 0.72, 0, 1);transition:0.2s transform cubic-bezier(0.32, 0.72, 0, 1), 0.2s height cubic-bezier(0.32, 0.72, 0, 1);transition:0.2s transform cubic-bezier(0.32, 0.72, 0, 1), 0.2s height cubic-bezier(0.32, 0.72, 0, 1), 0.2s -webkit-transform cubic-bezier(0.32, 0.72, 0, 1);background:var(--bkkr-background-color, #fff);-webkit-filter:blur(10px);filter:blur(10px);content:"";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1;pointer-events:none}@-webkit-keyframes shimmer{0%{-webkit-transform:translate(-50%, 100%) scale(1, 0);transform:translate(-50%, 100%) scale(1, 0);opacity:0}50%{-webkit-transform:translate(-50%, 0%) scale(1, 1);transform:translate(-50%, 0%) scale(1, 1);opacity:1}100%{-webkit-transform:translate(-50%, 0%) scale(1, 1);transform:translate(-50%, 0%) scale(1, 1);opacity:0}}@keyframes shimmer{0%{-webkit-transform:translate(-50%, 100%) scale(1, 0);transform:translate(-50%, 100%) scale(1, 0);opacity:0}50%{-webkit-transform:translate(-50%, 0%) scale(1, 1);transform:translate(-50%, 0%) scale(1, 1);opacity:1}100%{-webkit-transform:translate(-50%, 0%) scale(1, 1);transform:translate(-50%, 0%) scale(1, 1);opacity:0}}.paginator-loading-content{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%;min-height:84px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.paginator-loading-text{margin-left:32px;margin-right:32px;margin-top:4px;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.paginator-loading-text{margin-left:unset;margin-right:unset;-webkit-margin-start:32px;margin-inline-start:32px;-webkit-margin-end:32px;margin-inline-end:32px}}.paginator-loading>.paginator-content::before{opacity:1;-webkit-animation-play-state:running;animation-play-state:running}.paginator-loading>.paginator-content::after{width:calc(100% - 12px);height:calc(100% - 12px)}.paginator-loading>.paginator-loading-content{display:-ms-flexbox;display:flex}.paginator-toolbar{margin-left:0;margin-right:-0.9em;margin-top:0;margin-bottom:0;padding-left:var(--toolbar-padding-start);padding-right:var(--toolbar-padding-end);padding-top:var(--toolbar-padding-top);padding-bottom:var(--toolbar-padding-bottom);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.paginator-toolbar{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:-0.9em;margin-inline-end:-0.9em}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.paginator-toolbar{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--toolbar-padding-start);padding-inline-start:var(--toolbar-padding-start);-webkit-padding-end:var(--toolbar-padding-end);padding-inline-end:var(--toolbar-padding-end)}}.paginator-toolbar bkkr-select{min-width:60px;font-size:0.875em}.paginator-toolbar-fragment{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%}.paginator-toolbar-fragment bkkr-button{min-width:2.8em}.paginator-toolbar-fragment .paginator-statustext{padding-right:var(--bkkr-spacer, 16px);position:relative}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.paginator-toolbar-fragment .paginator-statustext{padding-right:unset;-webkit-padding-end:var(--bkkr-spacer, 16px);padding-inline-end:var(--bkkr-spacer, 16px)}}.paginator-toolbar-fragment .paginator-statustext:after{top:0;right:0;position:absolute;width:0.55px;height:100%;background-color:var(--bkkr-border, rgba(var(--bkkr-text-color-rgb, 0, 0, 0), 0.1));content:""}';export{d as bkkr_paginator}
|
/* eslint-disable no-unused-expressions */
// eslint-disable-next-line import/no-extraneous-dependencies
const resizeTo = require('terra-toolkit/lib/nightwatch/responsive-helpers').resizeTo;
module.exports = resizeTo(['medium'], {
'Displays a default dynamic-grid': (browser) => {
browser
.url(`${browser.launchUrl}/#/raw/tests/dynamic-grid/default-dynamic-grid`)
.expect.element('#defaultDynamicGrid').to.be.present;
browser.expect.element('#defaultDynamicGrid').to.have.css('display').which.matches(/^(-ms-)?grid$/);
browser.expect.element('#defaultDynamicGrid').to.have.css('grid-gap');
browser.expect.element('#defaultDynamicGrid').to.have.css('grid-template-columns');
browser.expect.element('#defaultDynamicGrid').to.have.css('grid-template-rows');
browser.expect.element('#region1').to.have.css('grid-row-start');
browser.expect.element('#region1').to.have.css('grid-column-start');
browser.expect.element('#region1').text.to.equal('R1');
browser.expect.element('#region2').to.have.css('grid-row-start');
browser.expect.element('#region2').to.have.css('grid-column-start');
browser.expect.element('#region2').text.to.equal('R2');
},
});
|
import React, { Component } from 'react';
import axios from 'axios';
class SignUp extends Component {
state = {
username: '',
password: '',
department: ''
};
handleChange = e => {
const { name, value } = e.target;
this.setState({ [name]: value });
};
handleSubmit = e => {
e.preventDefault();
axios
.post('http://localhost:5000/api/register', this.state)
.then(res => {
localStorage.setItem('jwt', res.data.token);
this.props.history.push('/login');
})
.catch(err => {
console.log('Error', err);
});
this.setState({
username: '',
password: '',
department: ''
});
};
render() {
return (
<div>
<h2>Register</h2>
<form onSubmit={this.handleSubmit}>
<label htmlFor="uname">
<b>Username</b>
</label>
<input
type="text"
placeholder="Enter Username"
name="username"
onChange={this.handleChange}
value={this.state.username}
required
/>
<label htmlFor="pwd">
<b>Password</b>
</label>
<input
type="password"
placeholder="Enter Password"
name="password"
onChange={this.handleChange}
value={this.state.password}
required
/>
<label htmlFor="dpt">
<b>Department</b>
</label>
<input
type="text"
placeholder="Enter Department"
name="department"
onChange={this.handleChange}
value={this.state.department}
required
/>
<button type="submit">Sign Up</button>
</form>
</div>
);
}
}
export default SignUp;
|
// JavaScript Document
var staffList="";
$(document).ready(function () {
var slectionId='';
$("input[name=rdSelection]:radio").change(function () {
if ($("#rdSelection1").attr("checked")) {
slectionId=$("#rdSelection1").val();
document.getElementById("divDept").style.display = "block";
document.getElementById("divJobtitle").style.display = "None";
document.getElementById("divSpec").style.display = "None";
// $('#drpLocation').empty();
// $('#drpLocation').val("");
}
else {
slectionId=$("#rdSelection2").val();
document.getElementById("divDept").style.display = "None";
document.getElementById("divJobtitle").style.display = "block";
document.getElementById("divSpec").style.display = "block";
getAlllocation();
}
/*$(function() {
$( "#dvdate" ).datepicker({
firstDay: 1 });
});*/
})
//*****************change date or time*************//
$(".shiftclassConflict").change(function () {
clearStaffSelect();
})
});
function getAlllocation()
{
var formData = new FormData();
formData.append('deptNo' , 0),
$.ajax({
url: baseURL+"Shiftscont/getallLocation",
type: "POST",
data: formData,
processData: false,
contentType: false,
error: function(xhr, status, error) {
alert(xhr.responseText);
},
beforeSend: function(){},
complete: function(){},
success: function(returndb){
// $('#drpLocation').empty();
// $("#drpLocation").html(returndb);
}
});//END $.ajax
}
function editshift(){
var action = $("#hdnaction").val();
if (action!="updateShift")
if (!validateStaffselect())
return;
if ( !$("#drpLocation").valid() )
valid = false;
var formData = new FormData();
formData.append('rdShifttype' , 1);
formData.append('hdnshiftId' , $("#hdnshiftId").val());
formData.append('drpLocation' , $("#drpLocation").val());
formData.append('drpFromdate' , $("#drpFromdate").val());
formData.append('drpTodate' , $("#drpTodate").val());
formData.append('txtStart' , $("#txtStart").val());
formData.append('txtEnd' , $("#txtEnd").val());
formData.append('rdStatus' , $("input[name=rdStatus]:checked").val());
formData.append('drplstBreak' , $("#drplstBreak").val());
formData.append('chbxIsspecial' , $("#chbxIsspecial").val());
formData.append('ckbNotification' , $("#ckbNotification").val());
formData.append('staffList' , staffList);
$.ajax({
url: baseURL+"Shiftscont/"+action ,
type: "POST",
data: formData,
processData: false,
contentType: false,
error: function(xhr, status, error) {
//var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
},
beforeSend: function(){},
complete: function(){},
success: function(returndb){
var success = $('.alert-success', $("#shiftForm"));
success.show();
Metronic.scrollTo(success, -200);
clearShiftForm();
$("#shift_body").html(returndb);
}
});//END $.ajax
}
function deleteShift(i)
{
var x='';
var r = confirm('This record will be deleted. Do you want to continue?');
if (r == true) {
x =1;
} else {
x = 0;
}
if(x==1)
{
var shiftId=i;
$.ajax({
url: baseURL+"Shiftscont/deleteShift",
type: "POST",
data: {shiftId:shiftId},
error: function(xhr, status, error) {
//var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
},
beforeSend: function(){},
complete: function(){},
success: function(returndb){
clearShiftForm();
var success = $('.alert-success', $("#shiftForm"));
success.show();
$("#shift_body").html(returndb);
}
});//END $.ajax
}
}
function updateShift(i)
{
getAlllocation();
$("#hdnshiftId").val(i);
var shiftid=$("#hdnshiftId").val();
//alert(shiftid);
$("#hdnaction").val('updateShift');
var locationId=$("#tdlocation"+i).attr('data-loid');
//alert(locationId);
var deptId=$("#tdDepartment"+i).attr('data-loid');
//alert(deptId);
//$("#drpLocation")='';
$("#drpLocation").val(locationId);
$('#drpFromdate').datepicker('setDate', $("#tdstart_date"+i).html());
//$("#drpFromdate").val($("#tdstart_date"+i).html());
$('#drpTodate').datepicker('setDate', $("#tdend_date"+i).html());
/*$("#drpFromdate").val($("#tdstart_date"+i).html());
$("#drpTodate").val($("#tdend_date"+i).html());*/
$('#txtStart').timepicker('setTime',$("#tdstart_Time"+i).html());
// $("#txtStart").val($("#tdstart_Time"+i).html());
$('#txtStart').timepicker('setTime',$("#tdstart_Time"+i).html());
$('#txtEnd').timepicker('setTime',$("#tdend_Time"+i).html());
// $("#txtEnd").val($("#tdend_Time"+i).html());
$("#rdStatus").val($("#tdlocation"+i).html());
var statusId=$("#tdrdStatus"+i).attr('data-stid');
var Isspecial=$("#tdSpecial_shift"+i).html();
if (Isspecial==1)
{
$('#chbxIsspecial').attr('checked', true);
$("#chbxIsspecial").parent().addClass('checked');
}
else
{ $('#chbxIsspecial').attr('checked', false);
$("#chbxIsspecial").parent().removeClass('checked');
}
if (statusId==1)
{
$("#rdStatus1").parent().addClass('checked');
$("#rdStatus2").parent().removeClass('checked');
}
else
{
$("#rdStatus2").parent().addClass('checked');
$("#rdStatus1").parent().removeClass('checked');
}
//$("#txtstaffName").val($("#tdstaff"+i).html());
/*document.getElementById("divSelect").style.display = "None";
document.getElementById("divUser").style.display = "None";
document.getElementById("divDept").style.display = "None";
document.getElementById("divJobtitle").style.display = "None";
document.getElementById("divSpec").style.display = "None";
document.getElementById("dvstaffname").style.display = "block"; */
Metronic.scrollTo($('#shiftForm'), -100);
}
function clearStaffSelect()
{
$("#my_multi_select1").html('');
$("#my_multi_select1").multiSelect('refresh');
staffList="";
if ($("#rdSelection1").attr("checked")) {
/*$('#drpLocation').empty();
$('#drpLocation').val("");
*///alert('shift');
}
var ddldept=document.getElementById('drplstDept');
ddldept.options[0].selected = true;
var ddlJobtitle=document.getElementById('drplstJobtitle');
ddlJobtitle.options[0].selected = true;
var ddlSpec=document.getElementById('drplstSpec');
ddlSpec.options[0].selected = true;
}
function clearShiftForm()
{
$("#hdnshiftId").val("");
$("#hdnaction").val('addshift');
//$('#drpLocation').empty();
$('#drpLocation').val("");
$("#drplstBreak").val("");
$("#drpFromdate").datepicker("setDate", new Date());
$("#drpTodate").datepicker("setDate", new Date());
$('#txtStart').timepicker('setTime', new Date());
$('#txtEnd').timepicker('setTime', new Date());
$("#txtstaffName").val("");
document.getElementById("divUser").style.display = "block";
document.getElementById("divDept").style.display = "block";
document.getElementById("divSelect").style.display = "block";
document.getElementById("dvstaffname").style.display = "None";
document.getElementById("divJobtitle").style.display = "None";
document.getElementById("divSpec").style.display = "None";
var ddlbreak=document.getElementById('drplstBreak');
ddlbreak.options[0].selected = true;
clearStaffSelect();
}
function drpdeptChange()
{
$("#my_multi_select1").html('');
$("#my_multi_select1").multiSelect('refresh');
//$('#drpLocation').empty();
//$('#drpLocation').val("");
if (!validateShift())
{
clearStaffSelect()
return;
}
if ($("#drplstDept").val()!='')
{
var formData = new FormData();
formData.append('drpFromdate' , $("#drpFromdate").val());
formData.append('drpTodate' , $("#drpTodate").val());
formData.append('txtStart' , $("#txtStart").val());
formData.append('txtEnd' , $("#txtEnd").val());
formData.append('deptNo' , $("#drplstDept").val()),
$.ajax({
url: baseURL+"Shiftscont/getUserByDept",
type: "POST",
data: formData,
processData: false,
contentType: false,
error: function(xhr, status, error) {
alert(xhr.responseText);
},
beforeSend: function(){},
complete: function(){},
success: function(returndb){
var retdb=returndb.split('@@');
var stafflist=retdb[0];
var location=retdb[1];
document.getElementById("divUser").style.display = "block";
document.getElementById("dvstaffname").style.display = "None";
/*alert(stafflist);
alert(location);
*/
$("#my_multi_select1").html(stafflist);
$("#my_multi_select1").multiSelect('refresh');
// $('#drpLocation').empty();
// $("#drpLocation").html(location);
}
});//END $.ajax
}
}
function drpJobtitleChange()
{
if (!validateShift())
{
clearStaffSelect()
return;
}
if ($("#drplstJobtitle").val()!='')
{
var formData = new FormData();
formData.append('drpFromdate' , $("#drpFromdate").val());
formData.append('drpTodate' , $("#drpTodate").val());
formData.append('txtStart' , $("#txtStart").val());
formData.append('txtEnd' , $("#txtEnd").val());
formData.append('JobTitelId' , $("#drplstJobtitle").val());
$.ajax({
url: baseURL+"Shiftscont/getUserByJobtitle",
type: "POST",
data: formData,
processData: false,
contentType: false,
error: function(xhr, status, error) {
//var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
},
beforeSend: function(){},
complete: function(){},
success: function(returndb){
document.getElementById("divUser").style.display = "block";
document.getElementById("dvstaffname").style.display = "None";
$("#my_multi_select1").html(returndb);
$("#my_multi_select1").multiSelect('refresh');
/* $('#drpLocation').empty();
$("#drpLocation").html(location);*/
}
});//END $.ajax
}
}
function drpSpecChange()
{
if (!validateShift())
{
clearStaffSelect()
return;
}
if ($("#drplstSpec").val()!='' && $("#drplstJobtitle").val()!='' )
{
var formData = new FormData();
formData.append('drpFromdate' , $("#drpFromdate").val());
formData.append('drpTodate' , $("#drpTodate").val());
formData.append('txtStart' , $("#txtStart").val());
formData.append('txtEnd' , $("#txtEnd").val());
formData.append('JobTitelId' , $("#drplstJobtitle").val());
formData.append('specId' , $("#drplstSpec").val());
$.ajax({
url: baseURL+"Shiftscont/getUserBySpec",
type: "POST",
data: formData,
processData: false,
contentType: false,
error: function(xhr, status, error) {
//var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
},
beforeSend: function(){},
complete: function(){},
success: function(returndb){
document.getElementById("divUser").style.display = "block";
document.getElementById("dvstaffname").style.display = "None";
$("#my_multi_select1").html(returndb);
$("#my_multi_select1").multiSelect('refresh');
/* $('#drpLocation').empty();
$("#drpLocation").html(location);*/
}
});//END $.ajax
}
}
//**********Get week number************//
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
function getweekNumber(stratdate,enddate) {
var date1 = new Date(stratdate);
var date2 = new Date(enddate);
var timeDiff = Math.abs(date2.getTime() - date1.getTime());
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)) +1;
//alert("diffDays "+diffDays);
if (diffDays > 7)
return false;
else
{
if (date1.getDay() == 2 && diffDays > 6) // Tuseday
return false;
else if (date1.getDay() == 3 && diffDays > 5) // Wednesday
return false;
else if (date1.getDay() == 4 && diffDays > 4) // Thersday
return false;
else if (date1.getDay() == 5 && diffDays > 3) // Friday
return false;
else if (date1.getDay() == 6 && diffDays > 2) // Saterday
return false;
else if (date1.getDay() == 0 && diffDays > 1) // Sunday
return false;
}
return true;
/*var dateParts = date.split("-");
var year= dateParts[0];
var month=dateParts[1] ;
var day=dateParts[2];
alert("day :"+day+" month: "+month+ " year :"+year);
*/
/* var when = new Date(year,month,day);
var newYear = new Date(year,0,1);
var offset = 7 + 1 - newYear.getDay();
if (offset == 8) offset = 1;
var daynum = ((Date.UTC(y2k(year),when.getMonth(),when.getDate(),0,0,0) - Date.UTC(y2k(year),0,1,0,0,0)) /1000/60/60/24) + 1;
var weeknum = Math.floor((daynum-offset+7)/7);
if (weeknum == 0) {
year--;
var prevNewYear = new Date(year,0,1);
var prevOffset = 7 + 1 - prevNewYear.getDay();
if (prevOffset == 2 || prevOffset == 8) weeknum = 53; else weeknum = 52;
}
*/ //return weeknum;
/* var dateParts = date.split("-");
var year= dateParts[0];
var month=dateParts[1] ;
var day=dateParts[2];
//var dateOfEnd = new Date(dateParts[0], (dateParts[1] - 1), dateParts[2]);
alert("day :"+day+" month: "+month+ " year :"+year);
function serial(days) { return 86400000*days; }
function dateserial(year,month,day) { return (new Date(year,month-1,day).valueOf()); }
function weekday(date) { return (new Date(date)).getDay()+1; }
function yearserial(date) { return (new Date(date)).getFullYear(); }
var date = year instanceof Date ? year.valueOf() : typeof year === "string" ? new Date(year).valueOf() : dateserial(year,month,day),
date2 = dateserial(yearserial(date - serial(weekday(date-serial(1))) + serial(4)),1,3);
return ~~((date - date2 + serial(weekday(date2) + 5))/ serial(7));*/
}
//**********/getweek number************//
//****************timeoff Validation
var ShiftFormValidation = function () {
var handleValidation = function() {
var form = $('#shiftForm');
var errormsg = $('.alert-danger', form);
var successmsg = $('.alert-success', form);
jQuery.validator.addMethod("checkWeekNumber", function(value, element) {
return getweekNumber($("#drpFromdate").val(),$("#drpTodate").val());
}, "* must select one week duration ");
jQuery.validator.addMethod("multiSelectRequired", function(value, element) {
var count = $(element).find('option:selected').length;
return count > 0;
}, "* must select at least one staff");
jQuery.validator.addMethod("greaterThanStartdate", function(value, element) {
return Date.parse($('#drpTodate').val())>=Date.parse($('#drpFromdate').val()) ;
}, "* End date must be greater than Start date");
jQuery.validator.addMethod("greaterThanStarttime", function(value, element) {
var start_time = $("#txtStart").val();
var end_time = $("#txtEnd").val();
//convert both time into timestamp
var stt = new Date("November 13, 2015 " + start_time);
stt = stt.getTime();
var endt = new Date("November 13, 2015 " + end_time);
endt = endt.getTime();
return endt>stt ;
}, "* End time must be greater than Start time");
form.validate({
errorElement: 'span', //default input error message container
errorClass: 'help-block help-block-error', // default input error message class
focusInvalid: false, // do not focus the last invalid input
ignore: "", // validate all fields including form hidden input
rules: {
drpLocation: {
required: true
},
drpFromdate: {
required: true,
date:{
max: 'drpTodate',
}
},
drpTodate: {
required:true,
greaterThanStartdate:true,
checkWeekNumber:true
},
txtStart: {
required: true
},
txtEnd: {
required: true,
greaterThanStarttime:true
},
drplstBreak: {
required:true
}
},
messages: { // custom messages for radio buttons and checkboxes
drpLocation: {
required: "Please enter the location"
},
drpFromdate: {
required: "Please enter valid start date"
},
drpTodate: {
required: "Please enter valid end date",
greaterThanStartdate:"Please enter valid end date",
checkWeekNumber:"End date should be at same week duration"
},
txtStart: {
required: "Please enter valid start time",
}
,
txtEnd: {
required: "Please enter valid end time",
greaterThanStarttime:"Please enter valid end time"
},
drplstBreak: {
required: "Please select break time of shift"
}
},
errorPlacement: function (error, element) { // render error placement for each input type
if (element.attr("data-error-container")) {
error.appendTo(element.attr("data-error-container"));
} else if (element.parent(".input-group").size() > 0) {
error.insertAfter(element.parent(".input-group"));
} else if (element.parents('.radio-list').size() > 0) {
error.appendTo(element.parents('.radio-list').attr("data-error-container"));
} else if (element.parents('.radio-inline').size() > 0) {
error.appendTo(element.parents('.radio-inline').attr("data-error-container"));
} else if (element.parents('.checkbox-list').size() > 0) {
error.appendTo(element.parents('.checkbox-list').attr("data-error-container"));
} else if (element.parents('.checkbox-inline').size() > 0) {
error.appendTo(element.parents('.checkbox-inline').attr("data-error-container"));
} else {
error.insertAfter(element); // for other inputs, just perform default behavior
}
},
invalidHandler: function (event, validator) { //display error alert on form submit
successmsg.hide();
errormsg.show();
$('#spnMsg').text('Please check the entered fields ,there is some errors');
Metronic.scrollTo(errormsg, -200);
},
highlight: function (element) { // hightlight error inputs
$(element)
.closest('.form-group').addClass('has-error'); // set error class to the control group
},
unhighlight: function (element) { // revert the change done by hightlight
$(element)
.closest('.form-group').removeClass('has-error'); // set error class to the control group
},
success: function (label) {
label
.closest('.form-group').removeClass('has-error'); // set success class to the control group
},
submitHandler: function (form) {
errormsg.hide();
editshift();
//form[0].submit(); // submit the form
}
});
}
return {
//main function to initiate the module
init: function () {
handleValidation();
}
};
}();
function validateStaffselect()
{
var error = $('#dvStaffMsg');
var valid = true;
if ( staffList=='' )
valid = false;
else
valid = true;
if(!valid)
{
error.show();
Metronic.scrollTo(error, -200);
}
else
{
error.hide();
}
return valid;
}
function validateShift()
{
var error = $('#dvDeptMsg');
var valid = true;
if ( !$("#drpFromdate").valid() )
valid = false;
if ( !$("#drpTodate").valid() )
valid = false;
if ( !$("#txtStart").valid() )
valid = false;
if ( !$("#txtEnd").valid() )
valid = false;
/*if ( !$("#drpLocation").valid() )
valid = false;
*/
if(!valid)
{
error.show();
Metronic.scrollTo(error, -200);
}
else
{
error.hide();
}
return valid;
}
var ShiftComponentsDropdowns = function () {
var handleMultiSelect = function () {
$('#my_multi_select1').multiSelect({
selectableOptgroup: true,
afterSelect: function(values){
/*var txt = $("#my_multi_select1 option[value='"+values+"']").text();
$("#my_multi_select1 option[value='"+values+"']").html('6666');
//var selectedValue=$('#my_multi_select1').multiSelect('select', String);
alert(txt);
var avlHr =txt.split('|');
alert(avlHr);*/
if (staffList=='')
staffList=values;
else
staffList=staffList+','+values;
},
afterDeselect: function(values){
//alert("values is "+values);
var staffID =staffList.split(',');
var newstafflist="";
for ( var i = 0; i < staffID.length; i++ )
{
if (staffID[i]==values)
{
// alert("staffID["+i+"]"+staffID[i])
}
else
{
if (newstafflist=='')
newstafflist=staffID[i];
else
newstafflist=newstafflist+','+staffID[i];
}
}
staffList=newstafflist;
},
selectableHeader: "<div class='btn-danger' align='center'><b> Verfügbar </b></div>",
selectionHeader: "<div class='btn-success' align='center'><b> Ausgewählt </b></div>"
});
}
return {
//main function to initiate the module
init: function () {
handleMultiSelect();
}
};
}();
|
/** **
* Tests
*
*
** */
process.env.TZ = 'America/San_Francisco';
const assert = require('assert');
const vows = require('vows');
const _ = require('underscore');
const ical = require('../node-ical');
const moment = require('moment-timezone');
vows
.describe('node-ical')
.addBatch({
'when parsing test1.ics (node conferences schedule from lanyrd.com, modified)': {
topic() {
return ical.parseFile('./test/test1.ics');
},
'we get 9 events'(topic) {
const events = _.select(_.values(topic), x => {
return x.type === 'VEVENT';
});
assert.equal(events.length, 9);
},
'event 47f6e': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === '47f6ea3f28af2986a2192fa39a91fa7d60d26b76';
})[0];
},
'is in fort lauderdale'(topic) {
assert.equal(topic.location, 'Fort Lauderdale, United States');
},
'starts Tue, 29 Nov 2011'(topic) {
assert.equal(topic.start.toDateString(), new Date(2011, 10, 29).toDateString());
},
'datetype is date'(topic) {
assert.equal(topic.datetype, 'date');
}
},
'event 480a': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === '480a3ad48af5ed8965241f14920f90524f533c18';
})[0];
},
'has a summary (invalid colon handling tolerance)'(topic) {
assert.equal(topic.summary, '[Async]: Everything Express');
},
'has a date only start datetime'(topic) {
assert.equal(topic.start.dateOnly, true);
},
'has a date only end datetime'(topic) {
assert.equal(topic.end.dateOnly, true);
}
},
'event d4c8': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === 'd4c826dfb701f611416d69b4df81caf9ff80b03a';
})[0];
},
'has a start datetime'(topic) {
assert.equal(topic.start.toDateString(), new Date(Date.UTC(2011, 2, 12, 20, 0, 0)).toDateString());
},
'datetype is date-time'(topic) {
assert.equal(topic.datetype, 'date-time');
}
},
'event sdfkf09fsd0 (Invalid Date)': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === 'sdfkf09fsd0';
})[0];
},
'has a start datetime'(topic) {
assert.equal(topic.start, 'Next Year');
}
}
},
'with test2.ics (testing ical features)': {
topic() {
return ical.parseFile('./test/test2.ics');
},
'todo item uid4@host1.com': {
topic(items) {
return _.find(items, object => {
return object.uid === 'uid4@host1.com';
});
},
'is a VTODO'(topic) {
assert.equal(topic.type, 'VTODO');
}
},
vfreebusy: {
topic(events) {
return _.select(_.values(events), x => {
return x.type === 'VFREEBUSY';
})[0];
},
'has a URL'(topic) {
assert.equal(topic.url, 'http://www.host.com/calendar/busytime/jsmith.ifb');
}
},
'vfreebusy first freebusy': {
topic(events) {
return _.select(_.values(events), x => {
return x.type === 'VFREEBUSY';
})[0].freebusy[0];
},
'has undefined type defaulting to busy'(topic) {
assert.equal(topic.type, 'BUSY');
},
'has an start datetime'(topic) {
assert.equal(topic.start.getFullYear(), 1998);
assert.equal(topic.start.getUTCMonth(), 2);
assert.equal(topic.start.getUTCDate(), 14);
assert.equal(topic.start.getUTCHours(), 23);
assert.equal(topic.start.getUTCMinutes(), 30);
},
'has an end datetime'(topic) {
assert.equal(topic.end.getFullYear(), 1998);
assert.equal(topic.end.getUTCMonth(), 2);
assert.equal(topic.end.getUTCDate(), 15);
assert.equal(topic.end.getUTCHours(), 0);
assert.equal(topic.end.getUTCMinutes(), 30);
}
},
'tzid parsing': {
topic(events) {
return _.find(events, object => {
return object.uid === 'EC9439B1-FF65-11D6-9973-003065F99D04';
});
},
'tzid offset correctly applied'(event) {
const start = new Date('2002-10-28T22:00:00.000Z');
assert.equal(event.start.valueOf(), start.valueOf());
}
}
},
'with test3.ics (testing tvcountdown.com)': {
topic() {
return ical.parseFile('./test/test3.ics');
},
'event -83': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === '20110505T220000Z-83@tvcountdown.com';
})[0];
},
'has a start datetime'(topic) {
assert.equal(topic.start.getFullYear(), 2011);
assert.equal(topic.start.getMonth(), 4);
},
'has an end datetime'(topic) {
assert.equal(topic.end.getFullYear(), 2011);
assert.equal(topic.end.getMonth(), 4);
},
'datetype is date-time'(topic) {
assert.equal(topic.datetype, 'date-time');
}
}
},
'with test4.ics (testing tripit.com)': {
topic() {
return ical.parseFile('./test/test4.ics');
},
'event c32a5...': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === 'c32a5eaba2354bb29e012ec18da827db90550a3b@tripit.com';
})[0];
},
'has a start datetime'(topic) {
assert.equal(topic.start.getFullYear(), 2011);
assert.equal(topic.start.getMonth(), 9);
assert.equal(topic.start.getDate(), 11);
},
'has a summary'(topic) {
// Escaped commas and semicolons should be replaced
assert.equal(topic.summary, 'South San Francisco, CA, October 2011;');
},
'has a description'(topic) {
const desired =
'John Doe is in South San Francisco, CA from Oct 11 ' +
'to Oct 13, 2011\nView and/or edit details in TripIt : http://www.tripit.c' +
'om/trip/show/id/23710889\nTripIt - organize your travel at http://www.trip' +
'it.com\n';
assert.equal(topic.description, desired);
},
'has a geolocation'(topic) {
assert.ok(topic.geo, 'no geo param');
assert.equal(topic.geo.lat, 37.654656);
assert.equal(topic.geo.lon, -122.40775);
},
'has transparency'(topic) {
assert.equal(topic.transparency, 'TRANSPARENT');
}
}
},
'with test5.ics (testing meetup.com)': {
topic() {
return ical.parseFile('./test/test5.ics');
},
'event nsmxnyppbfc@meetup.com': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === 'event_nsmxnyppbfc@meetup.com';
})[0];
},
'has a start'(topic) {
assert.equal(topic.start.tz, 'America/Phoenix');
assert.equal(topic.start.toISOString(), new Date(Date.UTC(2011, 10, 10, 2, 0, 0)).toISOString());
}
}
},
'with test6.ics (testing assembly.org)': {
topic() {
return ical.parseFile('./test/test6.ics');
},
'event with no ID': {
topic(events) {
return _.select(_.values(events), x => {
return x.summary === 'foobar Summer 2011 starts!';
})[0];
},
'has a start'(topic) {
assert.equal(topic.start.toISOString(), new Date(2011, 7, 4, 0, 0, 0).toISOString());
}
},
'event with rrule': {
topic(events) {
return _.select(_.values(events), x => {
return x.summary === 'foobarTV broadcast starts';
})[0];
},
'Has an RRULE'(topic) {
assert.notEqual(topic.rrule, undefined);
},
'RRule text'(topic) {
assert.equal(topic.rrule.toText(), 'every 5 weeks on Monday, Friday until January 30, 2013');
}
}
},
'with test7.ics (testing dtstart of rrule)': {
topic() {
return ical.parseFile('./test/test7.ics');
},
'recurring yearly event (14 july)': {
topic(events) {
const ev = _.values(events)[0];
return ev.rrule.between(new Date(2013, 0, 1), new Date(2014, 0, 1));
},
'dt start well set'(topic) {
assert.equal(topic[0].toDateString(), new Date(2013, 6, 14).toDateString());
}
}
},
'with test 8.ics (VTODO completion)': {
topic() {
return ical.parseFile('./test/test8.ics');
},
'grabbing VTODO task': {
topic(topic) {
return _.values(topic)[0];
},
'task completed'(task) {
assert.equal(task.completion, 100);
assert.equal(task.completed.toISOString(), new Date(2013, 6, 16, 10, 57, 45).toISOString());
}
}
},
'with test 9.ics (VEVENT with VALARM)': {
topic() {
return ical.parseFile('./test/test9.ics');
},
'grabbing VEVENT task': {
topic(topic) {
return _.values(topic)[0];
},
'task completed'(task) {
assert.equal(task.summary, 'Event with an alarm');
}
}
},
'with test 11.ics (VEVENT with custom properties)': {
topic() {
return ical.parseFile('./test10.ics');
},
'grabbing custom properties': {
topic() {}
}
},
'with test10.ics': {
topic() {
return ical.parseFile('./test/test10.ics');
},
'when categories present': {
topic(t) {
return _.values(t)[0];
},
'should be a list'(event) {
assert(event.categories instanceof [].constructor);
},
'should contain individual category values'(event) {
assert.deepEqual(event.categories, ['cat1', 'cat2', 'cat3']);
}
},
'when categories present with trailing whitespace': {
topic(t) {
return _.values(t)[1];
},
'should contain individual category values without whitespace'(event) {
assert.deepEqual(event.categories, ['cat1', 'cat2', 'cat3']);
}
},
'when categories present but empty': {
topic(t) {
return _.values(t)[2];
},
'should be an empty list'(event) {
assert.deepEqual(event.categories, []);
}
},
'when categories present but singular': {
topic(t) {
return _.values(t)[3];
},
'should be a list of single item'(event) {
assert.deepEqual(event.categories, ['lonely-cat']);
}
},
'when categories present on multiple lines': {
topic(t) {
return _.values(t)[4];
},
'should contain the category values in an array'(event) {
assert.deepEqual(event.categories, ['cat1', 'cat2', 'cat3']);
}
}
},
'with test11.ics (testing zimbra freebusy)': {
topic() {
return ical.parseFile('./test/test11.ics');
},
'freebusy params': {
topic(events) {
return _.values(events)[0];
},
'has a URL'(topic) {
assert.equal(topic.url, 'http://mail.example.com/yvr-2a@example.com/20140416');
},
'has an ORGANIZER'(topic) {
assert.equal(topic.organizer, 'mailto:yvr-2a@example.com');
},
'has an start datetime'(topic) {
assert.equal(topic.start.getFullYear(), 2014);
assert.equal(topic.start.getMonth(), 3);
},
'has an end datetime'(topic) {
assert.equal(topic.end.getFullYear(), 2014);
assert.equal(topic.end.getMonth(), 6);
}
},
'freebusy busy events': {
topic(events) {
return _.select(_.values(events)[0].freebusy, x => {
return x.type === 'BUSY';
})[0];
},
'has an start datetime'(topic) {
assert.equal(topic.start.getFullYear(), 2014);
assert.equal(topic.start.getMonth(), 3);
assert.equal(topic.start.getUTCHours(), 15);
assert.equal(topic.start.getUTCMinutes(), 15);
},
'has an end datetime'(topic) {
assert.equal(topic.end.getFullYear(), 2014);
assert.equal(topic.end.getMonth(), 3);
assert.equal(topic.end.getUTCHours(), 19);
assert.equal(topic.end.getUTCMinutes(), 0);
}
}
},
'with test12.ics (testing recurrences and exdates)': {
topic() {
return ical.parseFile('./test/test12.ics');
},
'event with rrule': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === '0000001';
})[0];
},
'Has an RRULE'(topic) {
assert.notEqual(topic.rrule, undefined);
},
'Has summary Treasure Hunting'(topic) {
assert.equal(topic.summary, 'Treasure Hunting');
},
'Has two EXDATES'(topic) {
assert.notEqual(topic.exdate, undefined);
assert.notEqual(
topic.exdate[new Date(Date.UTC(2015, 6, 8, 19, 0, 0)).toISOString().slice(0, 10)],
undefined
);
assert.notEqual(
topic.exdate[new Date(Date.UTC(2015, 6, 10, 19, 0, 0)).toISOString().slice(0, 10)],
undefined
);
},
'Has a RECURRENCE-ID override'(topic) {
assert.notEqual(topic.recurrences, undefined);
assert.notEqual(
topic.recurrences[new Date(Date.UTC(2015, 6, 7, 19, 0, 0)).toISOString().slice(0, 10)],
undefined
);
assert.equal(
topic.recurrences[new Date(Date.UTC(2015, 6, 7, 19, 0, 0)).toISOString().slice(0, 10)].summary,
'More Treasure Hunting'
);
}
}
},
'with test13.ics (testing recurrence-id before rrule)': {
topic() {
return ical.parseFile('./test/test13.ics');
},
'event with rrule': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === '6m2q7kb2l02798oagemrcgm6pk@google.com';
})[0];
},
'Has an RRULE'(topic) {
assert.notEqual(topic.rrule, undefined);
},
'Has summary "repeated"'(topic) {
assert.equal(topic.summary, 'repeated');
},
'Has a RECURRENCE-ID override'(topic) {
assert.notEqual(topic.recurrences, undefined);
assert.notEqual(
topic.recurrences[new Date(Date.UTC(2016, 7, 26, 11, 0, 0)).toISOString().slice(0, 10)],
undefined
);
assert.equal(
topic.recurrences[new Date(Date.UTC(2016, 7, 26, 11, 0, 0)).toISOString().slice(0, 10)].summary,
'bla bla'
);
}
}
},
'with test14.ics (testing comma-separated exdates)': {
topic() {
return ical.parseFile('./test/test14.ics');
},
'event with comma-separated exdate': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === '98765432-ABCD-DCBB-999A-987765432123';
})[0];
},
'Has summary "Example of comma-separated exdates"'(topic) {
assert.equal(topic.summary, 'Example of comma-separated exdates');
},
'Has four comma-separated EXDATES'(topic) {
assert.notEqual(topic.exdate, undefined);
// Verify the four comma-separated EXDATES are there
assert.notEqual(topic.exdate[new Date(2017, 6, 6, 12, 0, 0).toISOString().slice(0, 10)], undefined);
assert.notEqual(topic.exdate[new Date(2017, 6, 17, 12, 0, 0).toISOString().slice(0, 10)], undefined);
assert.notEqual(topic.exdate[new Date(2017, 6, 20, 12, 0, 0).toISOString().slice(0, 10)], undefined);
assert.notEqual(topic.exdate[new Date(2017, 7, 3, 12, 0, 0).toISOString().slice(0, 10)], undefined);
// Verify an arbitrary date isn't there
assert.equal(topic.exdate[new Date(2017, 4, 5, 12, 0, 0).toISOString().slice(0, 10)], undefined);
}
}
},
'with test14.ics (testing exdates with bad times)': {
topic() {
return ical.parseFile('./test/test14.ics');
},
'event with exdates with bad times': {
topic(events) {
return _.select(_.values(events), x => {
return x.uid === '1234567-ABCD-ABCD-ABCD-123456789012';
})[0];
},
'Has summary "Example of exdate with bad times"'(topic) {
assert.equal(topic.summary, 'Example of exdate with bad times');
},
'Has two EXDATES even though they have bad times'(topic) {
assert.notEqual(topic.exdate, undefined);
// Verify the two EXDATES are there, even though they have bad times
assert.notEqual(topic.exdate[new Date(2017, 11, 18, 12, 0, 0).toISOString().slice(0, 10)], undefined);
assert.notEqual(topic.exdate[new Date(2017, 11, 19, 12, 0, 0).toISOString().slice(0, 10)], undefined);
}
}
},
'with test15.ics (testing Microsoft Exchange Server 2010 with timezones)': {
topic() {
return ical.parseFile('./test/test15.ics');
},
'event with start and end including timezones': {
topic(events) {
return _.select(_.values(events), x => {
return (
x.uid ===
'040000008200E00074C5B7101A82E00800000000C9AB6E5A6AFED401000000000000000010000000C55132227F0F0948A7D58F6190A3AEF9'
);
})[0];
},
'has a start'(topic) {
assert.equal(topic.start.tz, '(UTC+07:00) Bangkok, Hanoi, Jakarta');
assert.equal(topic.end.toISOString().slice(0, 8), new Date(Date.UTC(2019, 3, 30, 9, 0, 0)).toISOString().slice(0, 8));
assert.equal(topic.end.tz, '(UTC+07:00) Bangkok, Hanoi, Jakarta');
assert.equal(topic.end.toISOString().slice(0, 8), new Date(2019, 3, 30, 5, 0, 0).toISOString().slice(0, 8));
}
}
},
'with test16.ics (testing quoted parameter values)': {
topic() {
return ical.parseFile('./test/test16.ics');
},
'quoted params': {
topic(events) {
return _.values(events)[0];
},
'is quoted'(topic) {
assert.notEqual(topic.start.tz, undefined);
}
}
},
'with test17.ics (testing for non-stringified start/end time)': {
topic() {
return ical.parseFile('./test/test17.ics');
},
'stringified params': {
topic(events) {
return _.values(events)[0];
},
'is not string'(topic) {
assert.notEqual(typeof topic.start, 'string');
assert.notEqual(typeof topic.end, 'string');
}
}
},
'with ms_timezones.ics (testing time conversions)': {
'topic'() {
return ical.parseFile('./test/ms_timezones.ics');
},
'event with time in CET': {
'topic'(events) {
return _.select(_.values(events), x => {
return x.summary === 'Log Yesterday\'s Jira time';
})[0];
},
'Has summary \'Log Yesterday\'s Jira time\''(topic) {
assert.equal(topic.summary, 'Log Yesterday\'s Jira time');
},
'Has proper start and end dates and times'(topic) {
// DTSTART;TZID=W. Europe Standard Time:20200609T090000
assert.equal(topic.start.getFullYear(), 2020);
assert.equal(topic.start.getMonth(), 5);
assert.equal(topic.start.getUTCHours(), 7);
assert.equal(topic.start.getUTCMinutes(), 0);
// DTEND;TZID=W. Europe Standard Time:20200609T093000
assert.equal(topic.end.getFullYear(), 2020);
assert.equal(topic.end.getMonth(), 5);
assert.equal(topic.end.getUTCHours(), 7);
assert.equal(topic.end.getUTCMinutes(), 30);
}
}
},
'with bad_ms_tz.ics (testing for unexpected ms timezone)': {
topic() {
return ical.parseFile('./test/bad_ms_tz.ics');
},
'event with bad TZ': {
'topic'(events) {
return _.select(_.values(events), x => {
return x.summary === '[private]';
})[0];
},
'is not valid timezone'(topic) {
assert.equal(topic.start.tz, 'Customized Time Zone');
}
}
},
'with bad_ms_tz.ics (testing for old ms timezones before DST)': {
topic() {
return ical.parseFile('./test/Office-2012-owa.ics');
},
'event with old TZ': {
'topic'(events) {
return _.select(_.values(events), x => {
return x.summary === ' TEST';
})[0];
},
'is not valid timezone'(topic) {
assert.equal(topic.end.toISOString().slice(0, 8), new Date(Date.UTC(2020, 9, 28, 15, 0, 0)).toISOString().slice(0, 8));
}
}
},
'with bad_ms_tz.ics (testing for old ms timezones after DST )': {
topic() {
return ical.parseFile('./test/Office-2012-owa.ics');
},
'event with old TZ': {
'topic'(events) {
return _.select(_.values(events), x => {
return x.summary === ' TEST 3';
})[0];
},
'is not valid timezone'(topic) {
assert.equal(topic.end.toISOString().slice(0, 8), new Date(Date.UTC(2020, 10, 2, 20, 0, 0)).toISOString().slice(0, 8));
}
}
},
'bad rrule': {
topic() {
return ical.parseFile('./test/badRRULE.ics');
},
'is valid time': {
'topic'(events) {
return _.select(_.values(events), x => {
return x.summary === 'Academic Time';
})[0];
},
'is not valid date'(topic) {
assert.equal(topic.start.toISOString().slice(11), '15:50:00.000Z');
}
}
},
'with forward.ics (testing for full day forward of UTC )': {
topic() {
moment.tz.setDefault('Europe/Berlin');
return ical.parseFile('./test/test_with_forward_TZ.ics');
},
'event with east TZ': {
'topic'(events) {
return _.select(_.values(events), x => {
return x.summary === 'Fear TWD';
})[0];
},
'is not valid date'(topic) {
assert.equal(topic.start.toISOString().slice(11), '00:00:00.000Z');
}
}
},
'url request errors': {
topic() {
ical.fromURL('http://255.255.255.255/', {}, this.callback);
},
'are passed back to the callback'(err, result) {
assert.instanceOf(err, Error);
if (!err) {
console.log('>E:', err, result);
}
}
}
})
.export(module);
|
import { __assign } from "tslib";
import * as React from 'react';
import { StyledIconBase } from '../../StyledIconBase';
export var BarChartBox = React.forwardRef(function (props, ref) {
var attrs = {
"fill": "currentColor",
"xmlns": "http://www.w3.org/2000/svg",
};
return (React.createElement(StyledIconBase, __assign({ iconAttrs: attrs, iconVerticalAlign: "middle", iconViewBox: "0 0 24 24" }, props, { ref: ref }),
React.createElement("path", { fill: "none", d: "M0 0h24v24H0z", key: "k0" }),
React.createElement("path", { d: "M3 3h18a1 1 0 011 1v16a1 1 0 01-1 1H3a1 1 0 01-1-1V4a1 1 0 011-1zm1 2v14h16V5H4zm3 8h2v4H7v-4zm4-6h2v10h-2V7zm4 3h2v7h-2v-7z", key: "k1" })));
});
BarChartBox.displayName = 'BarChartBox';
export var BarChartBoxDimensions = { height: 24, width: 24 };
|
/*! Copyright Imperiojs */
!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r={},i=(n(52),n(51));n(82);var o=n(75);r.socket=o(),r.room=i("roomId"),r.nonce=i("nonce"),r.myID=null,r.otherIDs=null,r.webRTCSupport=n(14),r.webRTCConfiguration={iceServers:[{url:"stun:stun.l.google.com:19302"}]},r.connectionType=null,r.webRTCConnect=n(57),r.dataChannel=null,r.peerConnection=null,r.callbacks={},r.emitAcceleration=n(29),r.emitGeoLocation=n(31),r.emitGyroscope=n(32),r.emitRoomSetup=n(33),r.emitData=n(30),r.requestNonceTimeout=n(42),r.tapListener=n(49),r.geoLocationListener=n(45),r.accelerationListener=n(43),r.gyroscopeListener=n(46),r.listenerRoomSetup=n(47),r.dataListener=n(44),r.gesture=n(34);var s=["pan","pinch","press","pressUp","rotate","swipe"];s.forEach(function(e){var t=e+"Listener";r[t]=function(t){r.callbacks[e]=t,r.socket.on(e,function(e){t&&t(e)})}}),r.roomUpdate=n(53),r.nonceTimeoutUpdate=n(48),window.imperio=r},function(e,t){"use strict";var n=!0,r={disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(n=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},log:function(){if("object"==typeof window){if(n)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},extractVersion:function(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)},detectBrowser:function(){var e={};if(e.browser=null,e.version=null,e.minVersion=null,"undefined"==typeof window||!window.navigator)return e.browser="Not a browser.",e;if(navigator.mozGetUserMedia)e.browser="firefox",e.version=this.extractVersion(navigator.userAgent,/Firefox\/([0-9]+)\./,1),e.minVersion=31;else if(navigator.webkitGetUserMedia)if(window.webkitRTCPeerConnection)e.browser="chrome",e.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/([0-9]+)\./,2),e.minVersion=38;else{if(!navigator.userAgent.match(/Version\/(\d+).(\d+)/))return e.browser="Unsupported webkit-based browser with GUM support but no WebRTC support.",e;e.browser="safari",e.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/([0-9]+)\./,1),e.minVersion=602}else{if(!navigator.mediaDevices||!navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))return e.browser="Not a supported browser.",e;e.browser="edge",e.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2),e.minVersion=10547}return e.version<e.minVersion&&r.log("Browser: "+e.browser+" Version: "+e.version+" < minimum supported version: "+e.minVersion+"\n some things might not work!"),e}};e.exports={log:r.log,disableLog:r.disableLog,browserDetails:r.detectBrowser(),extractVersion:r.extractVersion}},function(e,t,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function i(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0,o=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))}),e.splice(o,0,r),e}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(n){}}function a(){var e;try{e=t.storage.debug}catch(n){}return e}function c(){try{return window.localStorage}catch(e){}}t=e.exports=n(61),t.log=o,t.formatArgs=i,t.save=s,t.load=a,t.useColors=r,t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){return JSON.stringify(e)},t.enable(a())},function(e,t,n){(function(e){function r(e,n){var r="b"+t.packets[e.type]+e.data.data;return n(r)}function i(e,n,r){if(!n)return t.encodeBase64Packet(e,r);var i=e.data,o=new Uint8Array(i),s=new Uint8Array(1+i.byteLength);s[0]=g[e.type];for(var a=0;a<o.length;a++)s[a+1]=o[a];return r(s.buffer)}function o(e,n,r){if(!n)return t.encodeBase64Packet(e,r);var i=new FileReader;return i.onload=function(){e.data=i.result,t.encodePacket(e,n,!0,r)},i.readAsArrayBuffer(e.data)}function s(e,n,r){if(!n)return t.encodeBase64Packet(e,r);if(v)return o(e,n,r);var i=new Uint8Array(1);i[0]=g[e.type];var s=new w([i.buffer,e.data]);return r(s)}function a(e,t,n){for(var r=new Array(e.length),i=l(e.length,n),o=function(e,n,i){t(n,function(t,n){r[e]=n,i(t,r)})},s=0;s<e.length;s++)o(s,e[s],i)}var c=n(68),p=n(69),u=n(28),h=n(59),l=n(27),f=n(80),d=navigator.userAgent.match(/Android/i),m=/PhantomJS/i.test(navigator.userAgent),v=d||m;t.protocol=3;var g=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},y=c(g),b={type:"error",data:"parser error"},w=n(60);t.encodePacket=function(t,n,o,a){"function"==typeof n&&(a=n,n=!1),"function"==typeof o&&(a=o,o=null);var c=void 0===t.data?void 0:t.data.buffer||t.data;if(e.ArrayBuffer&&c instanceof ArrayBuffer)return i(t,n,a);if(w&&c instanceof e.Blob)return s(t,n,a);if(c&&c.base64)return r(t,a);var p=g[t.type];return void 0!==t.data&&(p+=o?f.encode(String(t.data)):String(t.data)),a(""+p)},t.encodeBase64Packet=function(n,r){var i="b"+t.packets[n.type];if(w&&n.data instanceof e.Blob){var o=new FileReader;return o.onload=function(){var e=o.result.split(",")[1];r(i+e)},o.readAsDataURL(n.data)}var s;try{s=String.fromCharCode.apply(null,new Uint8Array(n.data))}catch(a){for(var c=new Uint8Array(n.data),p=new Array(c.length),u=0;u<c.length;u++)p[u]=c[u];s=String.fromCharCode.apply(null,p)}return i+=e.btoa(s),r(i)},t.decodePacket=function(e,n,r){if("string"==typeof e||void 0===e){if("b"==e.charAt(0))return t.decodeBase64Packet(e.substr(1),n);if(r)try{e=f.decode(e)}catch(i){return b}var o=e.charAt(0);return Number(o)==o&&y[o]?e.length>1?{type:y[o],data:e.substring(1)}:{type:y[o]}:b}var s=new Uint8Array(e),o=s[0],a=u(e,1);return w&&"blob"===n&&(a=new w([a])),{type:y[o],data:a}},t.decodeBase64Packet=function(t,n){var r=y[t.charAt(0)];if(!e.ArrayBuffer)return{type:r,data:{base64:!0,data:t.substr(1)}};var i=h.decode(t.substr(1));return"blob"===n&&w&&(i=new w([i])),{type:r,data:i}},t.encodePayload=function(e,n,r){function i(e){return e.length+":"+e}function o(e,r){t.encodePacket(e,!!s&&n,!0,function(e){r(null,i(e))})}"function"==typeof n&&(r=n,n=null);var s=p(e);return n&&s?w&&!v?t.encodePayloadAsBlob(e,r):t.encodePayloadAsArrayBuffer(e,r):e.length?void a(e,o,function(e,t){return r(t.join(""))}):r("0:")},t.decodePayload=function(e,n,r){if("string"!=typeof e)return t.decodePayloadAsBinary(e,n,r);"function"==typeof n&&(r=n,n=null);var i;if(""==e)return r(b,0,1);for(var o,s,a="",c=0,p=e.length;c<p;c++){var u=e.charAt(c);if(":"!=u)a+=u;else{if(""==a||a!=(o=Number(a)))return r(b,0,1);if(s=e.substr(c+1,o),a!=s.length)return r(b,0,1);if(s.length){if(i=t.decodePacket(s,n,!0),b.type==i.type&&b.data==i.data)return r(b,0,1);var h=r(i,c+o,p);if(!1===h)return}c+=o,a=""}}return""!=a?r(b,0,1):void 0},t.encodePayloadAsArrayBuffer=function(e,n){function r(e,n){t.encodePacket(e,!0,!0,function(e){return n(null,e)})}return e.length?void a(e,r,function(e,t){var r=t.reduce(function(e,t){var n;return n="string"==typeof t?t.length:t.byteLength,e+n.toString().length+n+2},0),i=new Uint8Array(r),o=0;return t.forEach(function(e){var t="string"==typeof e,n=e;if(t){for(var r=new Uint8Array(e.length),s=0;s<e.length;s++)r[s]=e.charCodeAt(s);n=r.buffer}t?i[o++]=0:i[o++]=1;for(var a=n.byteLength.toString(),s=0;s<a.length;s++)i[o++]=parseInt(a[s]);i[o++]=255;for(var r=new Uint8Array(n),s=0;s<r.length;s++)i[o++]=r[s]}),n(i.buffer)}):n(new ArrayBuffer(0))},t.encodePayloadAsBlob=function(e,n){function r(e,n){t.encodePacket(e,!0,!0,function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);e=r.buffer,t[0]=0}for(var o=e instanceof ArrayBuffer?e.byteLength:e.size,s=o.toString(),a=new Uint8Array(s.length+1),i=0;i<s.length;i++)a[i]=parseInt(s[i]);if(a[s.length]=255,w){var c=new w([t.buffer,a.buffer,e]);n(null,c)}})}a(e,r,function(e,t){return n(new w(t))})},t.decodePayloadAsBinary=function(e,n,r){"function"==typeof n&&(r=n,n=null);for(var i=e,o=[],s=!1;i.byteLength>0;){for(var a=new Uint8Array(i),c=0===a[0],p="",h=1;255!=a[h];h++){if(p.length>310){s=!0;break}p+=a[h]}if(s)return r(b,0,1);i=u(i,2+p.length),p=parseInt(p);var l=u(i,0,p);if(c)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(f){var d=new Uint8Array(l);l="";for(var h=0;h<d.length;h++)l+=String.fromCharCode(d[h])}o.push(l),i=u(i,p)}var m=o.length;o.forEach(function(e,i){r(t.decodePacket(e,n,!0),i,m)})}}).call(t,function(){return this}())},function(e,t){function n(e){if(e)return r(e)}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}e.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t){e.exports=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e,t){"use strict";e.exports=function(e){return console.log(e.toString(),e)}},function(e,t,n){function r(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders}var i=n(3),o=n(4);e.exports=r,o(r.prototype),r.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},r.prototype.open=function(){return"closed"!=this.readyState&&""!=this.readyState||(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return"opening"!=this.readyState&&"open"!=this.readyState||(this.doClose(),this.onClose()),this},r.prototype.send=function(e){if("open"!=this.readyState)throw new Error("Transport not open");this.write(e)},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(e){var t=i.decodePacket(e,this.socket.binaryType);this.onPacket(t)},r.prototype.onPacket=function(e){this.emit("packet",e)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(e,t,n){var r=n(71);e.exports=function(e){var t=e.xdomain,n=e.xscheme,i=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||r))return new XMLHttpRequest}catch(o){}try{if("undefined"!=typeof XDomainRequest&&!n&&i)return new XDomainRequest}catch(o){}if(!t)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(o){}}},function(e,t){t.encode=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},t.decode=function(e){for(var t={},n=e.split("&"),r=0,i=n.length;r<i;r++){var o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}},function(e,t,n){function r(){}function i(e){var n="",r=!1;return n+=e.type,t.BINARY_EVENT!=e.type&&t.BINARY_ACK!=e.type||(n+=e.attachments,n+="-"),e.nsp&&"/"!=e.nsp&&(r=!0,n+=e.nsp),null!=e.id&&(r&&(n+=",",r=!1),n+=e.id),null!=e.data&&(r&&(n+=","),n+=h.stringify(e.data)),u("encoded %j as %s",e,n),n}function o(e,t){function n(e){var n=f.deconstructPacket(e),r=i(n.packet),o=n.buffers;o.unshift(r),t(o)}f.removeBlobs(e,n)}function s(){this.reconstructor=null}function a(e){var n={},r=0;if(n.type=Number(e.charAt(0)),null==t.types[n.type])return p();if(t.BINARY_EVENT==n.type||t.BINARY_ACK==n.type){for(var i="";"-"!=e.charAt(++r)&&(i+=e.charAt(r),r!=e.length););if(i!=Number(i)||"-"!=e.charAt(r))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"==e.charAt(r+1))for(n.nsp="";++r;){var o=e.charAt(r);if(","==o)break;if(n.nsp+=o,r==e.length)break}else n.nsp="/";var s=e.charAt(r+1);if(""!==s&&Number(s)==s){for(n.id="";++r;){var o=e.charAt(r);if(null==o||Number(o)!=o){--r;break}if(n.id+=e.charAt(r),r==e.length)break}n.id=Number(n.id)}if(e.charAt(++r))try{n.data=h.parse(e.substr(r))}catch(a){return p()}return u("decoded %s as %j",e,n),n}function c(e){this.reconPack=e,this.buffers=[]}function p(e){return{type:t.ERROR,data:"parser error"}}var u=n(2)("socket.io-parser"),h=n(78),l=(n(6),n(4)),f=n(77),d=n(24);t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=r,t.Decoder=s,r.prototype.encode=function(e,n){if(u("encoding packet %j",e),t.BINARY_EVENT==e.type||t.BINARY_ACK==e.type)o(e,n);else{var r=i(e);n([r])}},l(s.prototype),s.prototype.add=function(e){var n;if("string"==typeof e)n=a(e),t.BINARY_EVENT==n.type||t.BINARY_ACK==n.type?(this.reconstructor=new c(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!d(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,this.emit("decoded",n))}},s.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},c.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length==this.reconPack.attachments){var t=f.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},c.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(e,t,n){"use strict";var r=n(13),i=n(7),o=function(e){imperio.peerConnection.setLocalDescription(e,function(){r(imperio.peerConnection.localDescription)},i)};e.exports=o},function(e,t){"use strict";var n=function(e){console.log("Client sending message: "+e),imperio.socket.emit("message",e,imperio.room)};e.exports=n},function(e,t){"use strict";var n=window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,r=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia;e.exports=!!n&&!!r},function(e,t){var n=[].slice;e.exports=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}},function(e,t,n){(function(e){function r(t){var n,r=!1,a=!1,c=!1!==t.jsonp;if(e.location){var p="https:"==location.protocol,u=location.port;u||(u=p?443:80),r=t.hostname!=location.hostname||u!=t.port,a=t.secure!=p}if(t.xdomain=r,t.xscheme=a,n=new i(t),"open"in n&&!t.forceJSONP)return new o(t);if(!c)throw new Error("JSONP disabled");return new s(t)}var i=n(9),o=n(66),s=n(65),a=n(67);t.polling=r,t.websocket=a}).call(t,function(){return this}())},function(e,t,n){function r(e){var t=e&&e.forceBase64;u&&!t||(this.supportsBinary=!1),i.call(this,e)}var i=n(8),o=n(10),s=n(3),a=n(5),c=n(26),p=n(2)("engine.io-client:polling");e.exports=r;var u=function(){var e=n(9),t=new e({xdomain:!1});return null!=t.responseType}();a(r,i),r.prototype.name="polling",r.prototype.doOpen=function(){this.poll()},r.prototype.pause=function(e){function t(){p("paused"),n.readyState="paused",e()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(p("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){p("pre-pause polling complete"),--r||t()})),this.writable||(p("we are currently writing - waiting to pause"),r++,this.once("drain",function(){p("pre-pause writing complete"),--r||t()}))}else t()},r.prototype.poll=function(){p("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},r.prototype.onData=function(e){var t=this;p("polling got data %s",e);var n=function(e,n,r){return"opening"==t.readyState&&t.onOpen(),"close"==e.type?(t.onClose(),!1):void t.onPacket(e)};s.decodePayload(e,this.socket.binaryType,n),"closed"!=this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():p('ignoring poll - transport state "%s"',this.readyState))},r.prototype.doClose=function(){function e(){p("writing close packet"),t.write([{type:"close"}])}var t=this;"open"==this.readyState?(p("transport open - closing"),e()):(p("transport not open - deferring close"),this.once("open",e))},r.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")},t=this;s.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,n)})},r.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";!1!==this.timestampRequests&&(e[this.timestampParam]=c()),this.supportsBinary||e.sid||(e.b64=1),e=o.encode(e),this.port&&("https"==t&&443!=this.port||"http"==t&&80!=this.port)&&(n=":"+this.port),e.length&&(e="?"+e);var r=this.hostname.indexOf(":")!==-1;return t+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+e}},function(e,t){var n=[].indexOf;e.exports=function(e,t){if(n)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}},function(e,t){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var t=e,i=e.indexOf("["),o=e.indexOf("]");i!=-1&&o!=-1&&(e=e.substring(0,i)+e.substring(i,o).replace(/:/g,";")+e.substring(o,e.length));for(var s=n.exec(e||""),a={},c=14;c--;)a[r[c]]=s[c]||"";return i!=-1&&o!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(e,t,n){function r(e,t){return this instanceof r?(e&&"object"==typeof e&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new l({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[],this.encoder=new a.Encoder,this.decoder=new a.Decoder,this.autoConnect=t.autoConnect!==!1,void(this.autoConnect&&this.open())):new r(e,t)}var i=n(62),o=n(22),s=n(23),a=n(11),c=n(21),p=n(15),u=n(2)("socket.io-client:manager"),h=n(18),l=n(58),f=Object.prototype.hasOwnProperty;e.exports=r,r.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var e in this.nsps)f.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},r.prototype.updateSocketIds=function(){for(var e in this.nsps)f.call(this.nsps,e)&&(this.nsps[e].id=this.engine.id)},s(r.prototype),r.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},r.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},r.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},r.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},r.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},r.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},r.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},r.prototype.open=r.prototype.connect=function(e){if(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;u("opening %s",this.uri),this.engine=i(this.uri,this.opts);var t=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var r=c(t,"open",function(){n.onopen(),e&&e()}),o=c(t,"error",function(t){if(u("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}else n.maybeReconnectOnOpen()});if(!1!==this._timeout){var s=this._timeout;u("connect attempt will timeout after %d",s);var a=setTimeout(function(){u("connect attempt timed out after %d",s),r.destroy(),t.close(),t.emit("error","timeout"),n.emitAll("connect_timeout",s)},s);this.subs.push({destroy:function(){clearTimeout(a)}})}return this.subs.push(r),this.subs.push(o),this},r.prototype.onopen=function(){u("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(c(e,"data",p(this,"ondata"))),this.subs.push(c(e,"ping",p(this,"onping"))),this.subs.push(c(e,"pong",p(this,"onpong"))),this.subs.push(c(e,"error",p(this,"onerror"))),this.subs.push(c(e,"close",p(this,"onclose"))),this.subs.push(c(this.decoder,"decoded",p(this,"ondecoded")))},r.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},r.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},r.prototype.ondata=function(e){this.decoder.add(e)},r.prototype.ondecoded=function(e){this.emit("packet",e)},r.prototype.onerror=function(e){u("error",e),this.emitAll("error",e)},r.prototype.socket=function(e){function t(){~h(r.connecting,n)||r.connecting.push(n)}var n=this.nsps[e];if(!n){n=new o(this,e),this.nsps[e]=n;var r=this;n.on("connecting",t),n.on("connect",function(){n.id=r.engine.id}),this.autoConnect&&t()}return n},r.prototype.destroy=function(e){var t=h(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},r.prototype.packet=function(e){u("writing packet %j",e);var t=this;t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,function(n){for(var r=0;r<n.length;r++)t.engine.write(n[r],e.options);t.encoding=!1,t.processPacketQueue()}))},r.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},r.prototype.cleanup=function(){u("cleanup");for(var e;e=this.subs.shift();)e.destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){u("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"==this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(e){u("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();u("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout(function(){e.skipReconnect||(u("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open(function(t){t?(u("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(u("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},r.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},function(e,t){function n(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}e.exports=n},function(e,t,n){function r(e,t){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.io.autoConnect&&this.open()}var i=n(11),o=n(23),s=n(79),a=n(21),c=n(15),p=n(2)("socket.io-client:socket"),u=n(70);e.exports=t=r;var h={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},l=o.prototype.emit;o(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[a(e,"open",c(this,"onopen")),a(e,"packet",c(this,"onpacket")),a(e,"close",c(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"==this.io.readyState&&this.onopen(),this.emit("connecting"),this)},r.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},r.prototype.emit=function(e){if(h.hasOwnProperty(e))return l.apply(this,arguments),this;var t=s(arguments),n=i.EVENT;u(t)&&(n=i.BINARY_EVENT);var r={type:n,data:t};return r.options={},r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(p("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),delete this.flags,this},r.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},r.prototype.onopen=function(){p("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:i.CONNECT})},r.prototype.onclose=function(e){p("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},r.prototype.onpacket=function(e){if(e.nsp==this.nsp)switch(e.type){case i.CONNECT:this.onconnect();break;case i.EVENT:this.onevent(e);break;case i.BINARY_EVENT:this.onevent(e);break;case i.ACK:this.onack(e);break;case i.BINARY_ACK:this.onack(e);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",e.data)}},r.prototype.onevent=function(e){var t=e.data||[];p("emitting event %j",t),null!=e.id&&(p("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?l.apply(this,t):this.receiveBuffer.push(t)},r.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var r=s(arguments);p("sending ack %j",r);var o=u(r)?i.BINARY_ACK:i.ACK;t.packet({type:o,id:e,data:r})}}},r.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(p("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):p("bad ack %s",e.id)},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)l.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},r.prototype.ondisconnect=function(){p("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},r.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},r.prototype.close=r.prototype.disconnect=function(){return this.connected&&(p("performing disconnect (%s)",this.nsp),this.packet({type:i.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},r.prototype.compress=function(e){return this.flags=this.flags||{},this.flags.compress=e,this}},function(e,t){function n(e){if(e)return r(e)}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}e.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t){(function(t){function n(e){return t.Buffer&&t.Buffer.isBuffer(e)||t.ArrayBuffer&&e instanceof ArrayBuffer}e.exports=n}).call(t,function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";function n(e){var t="";do t=s[e%a]+t,e=Math.floor(e/a);while(e>0);return t}function r(e){var t=0;for(u=0;u<e.length;u++)t=t*a+c[e.charAt(u)];return t}function i(){var e=n(+new Date);return e!==o?(p=0,o=e):e+"."+n(p++)}for(var o,s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),a=64,c={},p=0,u=0;u<a;u++)c[s[u]]=u;i.encode=n,i.decode=r,e.exports=i},function(e,t){function n(e,t,n){function i(e,r){if(i.count<=0)throw new Error("after called too many times");--i.count,e?(o=!0,t(e),t=n):0!==i.count||o||t(null,r)}var o=!1;return n=n||r,i.count=e,0===e?t():i}function r(){}e.exports=n},function(e,t){e.exports=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(t<0&&(t+=r),n<0&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var i=new Uint8Array(e),o=new Uint8Array(n-t),s=t,a=0;s<n;s++,a++)o[a]=i[s];return o.buffer}},function(e,t){"use strict";var n={},r=function(e){var t=imperio.callbacks.gravityLocal,n=imperio.callbacks.gravityModify,r=e.accelerationIncludingGravity.x,i=e.accelerationIncludingGravity.y,o=e.accelerationIncludingGravity.z,s={x:r,y:i,z:o};n&&(s=n(s));var a={data:s,type:"acceleration"};"webRTC"===imperio.connectionType?imperio.dataChannel.send(JSON.stringify(a)):imperio.socket.emit("acceleration",imperio.room,s),
t&&t(s)};n.gravity=function(e,t){imperio.callbacks.gravityLocal=e,imperio.callbacks.gravityModify=t,window.addEventListener("devicemotion",r)},n.removeGravity=function(){delete imperio.callbacks.gravityLocal,delete imperio.callbacks.gravityModify,window.removeEventListener("devicemotion",r)};var i=function(e){var t=imperio.callbacks.noGravityLocal,n=imperio.callbacks.noGravityModify,r=e.acceleration.x,i=e.acceleration.y,o=e.acceleration.z,s={x:r,y:i,z:o};n&&(s=n(s));var a={data:s,type:"acceleration"};"webRTC"===imperio.connectionType?imperio.dataChannel.send(JSON.stringify(a)):imperio.socket.emit("acceleration",imperio.room,s),t&&t(s)};n.noGravity=function(e,t){imperio.callbacks.noGravityLocal=e,imperio.callbacks.noGravityModify=t,window.addEventListener("devicemotion",i)},n.removeNoGravity=function(){delete imperio.callbacks.noGravityLocal,delete imperio.callbacks.noGravityModify,window.removeEventListener("devicemotion",i)},e.exports=n},function(e,t){"use strict";var n=function(e,t){if("webRTC"===imperio.connectionType){var n={data:t,type:"data"};imperio.dataChannel.send(JSON.stringify(n))}else imperio.socket.emit("data",imperio.room,t);e&&e(t)};e.exports=n},function(e,t){"use strict";var n=function(e,t){return navigator.geolocation?void navigator.geolocation.getCurrentPosition(function(n){var r=n;t&&(r=t(r));var i={data:r,type:"geoLocation"};"webRTC"===imperio.connectionType?imperio.dataChannel.send(JSON.stringify(i)):imperio.socket.emit("geoLocation",imperio.room,r),e&&e(r)}):void console.log("This browser does not support Geolocation")};e.exports=n},function(e,t){"use strict";var n={},r=function(e){var t=imperio.callbacks.gyroLocal,n=imperio.callbacks.gyroModify,r=e.alpha,i=e.beta,o=e.gamma,s={alpha:r,beta:i,gamma:o};n&&(s=n(s));var a={data:s,type:"gyroscope"};"webRTC"===imperio.connectionType?imperio.dataChannel.send(JSON.stringify(a)):imperio.socket.emit("gyroscope",imperio.room,s),t&&t(s)};n.start=function(e,t){imperio.callbacks.gyroLocal=e,imperio.callbacks.gyroModify=t,window.addEventListener("deviceorientation",r)},n.remove=function(e,t){imperio.callbacks.gyroLocal=e,imperio.callbacks.gyroModify=t,window.removeEventListener("deviceorientation",r)},e.exports=n},function(e,t){"use strict";var n=function(e){imperio.socket.on("connect",function(){if(imperio.connectionType="sockets",imperio.room){var t={room:imperio.room,id:imperio.socket.id,role:"emitter"};imperio.socket.emit("createRoom",t)}e&&e(imperio.socket)})};e.exports=n},function(e,t,n){"use strict";var r=n(35),i=n(36),o=n(37),s=n(38),a=n(39),c=n(40),p=n(41),u=function(e,t,n,u){"pan"===e&&r(t,n,u),"pinch"===e&&i(t,n,u),"press"===e&&o(t,n,u),"pressUp"===e&&s(t,n,u),"rotate"===e&&a(t,n,u),"swipe"===e&&c(t,n,u),"tap"===e&&p(t,n,u)};e.exports=u},function(e,t){"use strict";var n=function(e,t,n){var r=new Hammer(e),i=["pan","panstart","panend"];i.forEach(function(e){r.on(e,function(r){if(r.start=e.indexOf("start")>-1,r.end=e.indexOf("end")>-1,n&&(r=n(r)),"webRTC"===imperio.connectionType){var i={};i.data=r,i.type="pan",imperio.dataChannel.send(JSON.stringify(i))}else imperio.socket.emit("pan",imperio.room,r);t&&t(r)})})};e.exports=n},function(e,t){"use strict";var n=function(e,t,n){var r=new Hammer(e),i=["pinch","pinchstart","pinchend"];r.get("pinch").set({enable:!0}),i.forEach(function(e){r.on(e,function(r){if(r.start=e.indexOf("start")>-1,r.end=e.indexOf("end")>-1,n&&(r=n(r)),"webRTC"===imperio.connectionType){var i={};i.data=r,i.type="pinch",imperio.dataChannel.send(JSON.stringify(i))}else imperio.socket.emit("pinch",imperio.room,r);t&&t(r)})})};e.exports=n},function(e,t){"use strict";var n=function(e,t,n){var r=new Hammer(e);r.on("press",function(e){if(e.start=!0,e.end=!1,n&&(e=n(e)),"webRTC"===imperio.connectionType){var r={};r.data=e,r.type="press",imperio.dataChannel.send(JSON.stringify(r))}else imperio.socket.emit("press",imperio.room,e);t&&t(e)})};e.exports=n},function(e,t){"use strict";var n=function(e,t,n){var r=new Hammer(e);r.on("pressup",function(e){if(e.start=!1,e.end=!0,n&&(e=n(e)),"webRTC"===imperio.connectionType){var r={};r.data=e,r.type="pressUp",imperio.dataChannel.send(JSON.stringify(r))}else imperio.socket.emit("pressUp",imperio.room,e);t&&t(e)})};e.exports=n},function(e,t){"use strict";var n=function(e,t,n){var r=new Hammer(e),i=["rotate","rotatestart","rotateend"];r.get("rotate").set({enable:!0}),i.forEach(function(e){r.on(e,function(r){if(r.start=e.indexOf("start")>-1,r.end=e.indexOf("end")>-1,n&&(r=n(r)),"webRTC"===imperio.connectionType){var i={};i.data=r,i.type="rotate",imperio.dataChannel.send(JSON.stringify(i))}else imperio.socket.emit("rotate",imperio.room,r);t&&t(r)})})};e.exports=n},function(e,t){"use strict";var n=function(e,t,n){var r=new Hammer(e);r.on("swipe",function(e){if(e.start=!0,e.end=!0,n&&(e=n(e)),"webRTC"===imperio.connectionType){var r={};r.data=e,r.type="swipe",imperio.dataChannel.send(JSON.stringify(r))}else imperio.socket.emit("swipe",imperio.room,e);t&&t(e)})};e.exports=n},function(e,t){"use strict";var n=function(e,t,n){e.addEventListener("click",function(e){if(n&&(e=n(e)),"webRTC"===imperio.connectionType){var r={data:e,type:"tap"};imperio.dataChannel.send(JSON.stringify(r))}else imperio.socket.emit("tap",imperio.room,e);t&&t(e)})};e.exports=n},function(e,t){"use strict";var n=function(e){imperio.socket.emit("updateNonceTimeouts",imperio.room),e&&e()};e.exports=n},function(e,t){"use strict";var n=function(e){imperio.callbacks.acceleration=e,imperio.socket.on("acceleration",function(t){e&&e(t)})};e.exports=n},function(e,t){"use strict";var n=function(e){imperio.callbacks.data=e,imperio.socket.on("data",function(t){e&&e(t)})};e.exports=n},function(e,t){"use strict";var n=function(e){imperio.callbacks.geoLocation=e,imperio.socket.on("geoLocation",function(t){e&&e(t)})};e.exports=n},function(e,t){"use strict";var n=function(e){imperio.callbacks.gyroscope=e,imperio.socket.on("gyroscope",function(t){e&&e(t)})};e.exports=n},function(e,t){"use strict";var n=function(e){imperio.socket.on("connect",function(){if(imperio.connectionType="sockets",imperio.room){var t={room:imperio.room,id:imperio.socket.id,role:"listener"};imperio.socket.emit("createRoom",t)}e&&e()})};e.exports=n},function(e,t){"use strict";var n=function(e){imperio.socket.on("updateNonceTimeouts",function(t){e&&e(t)})};e.exports=n},function(e,t){"use strict";var n=function(e){imperio.callbacks.tap=e,imperio.socket.on("tap",function(t){e&&e(t)})};e.exports=n},function(e,t,n){var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};!function(o,s){"use strict";var a=function(e){if("object"!==i(e.document))throw Error("Cookies.js requires a `window` with a `document` object");var t=function n(e,t,r){return 1===arguments.length?n.get(e):n.set(e,t,r)};return t._document=e.document,t._cacheKeyPrefix="cookey.",t._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC"),t.defaults={path:"/",secure:!1},t.get=function(e){return t._cachedDocumentCookie!==t._document.cookie&&t._renewCache(),e=t._cache[t._cacheKeyPrefix+e],e===s?s:decodeURIComponent(e)},t.set=function(e,n,r){return r=t._getExtendedOptions(r),r.expires=t._getExpiresDate(n===s?-1:r.expires),t._document.cookie=t._generateCookieString(e,n,r),t},t.expire=function(e,n){return t.set(e,s,n)},t._getExtendedOptions=function(e){return{path:e&&e.path||t.defaults.path,domain:e&&e.domain||t.defaults.domain,expires:e&&e.expires||t.defaults.expires,secure:e&&e.secure!==s?e.secure:t.defaults.secure}},t._isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},t._getExpiresDate=function(e,n){if(n=n||new Date,"number"==typeof e?e=1/0===e?t._maxExpireDate:new Date(n.getTime()+1e3*e):"string"==typeof e&&(e=new Date(e)),e&&!t._isValidDate(e))throw Error("`expires` parameter cannot be converted to a valid Date instance");return e},t._generateCookieString=function(e,t,n){return e=e.replace(/[^#$&+\^`|]/g,encodeURIComponent),e=e.replace(/\(/g,"%28").replace(/\)/g,"%29"),t=(t+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent),n=n||{},e=e+"="+t+(n.path?";path="+n.path:""),e+=n.domain?";domain="+n.domain:"",e+=n.expires?";expires="+n.expires.toUTCString():"",e+=n.secure?";secure":""},t._getCacheFromString=function(e){var n={};e=e?e.split("; "):[];for(var r=0;r<e.length;r++){var i=t._getKeyValuePairFromCookieString(e[r]);n[t._cacheKeyPrefix+i.key]===s&&(n[t._cacheKeyPrefix+i.key]=i.value)}return n},t._getKeyValuePairFromCookieString=function(e){var t,n=e.indexOf("="),n=0>n?e.length:n,r=e.substr(0,n);try{t=decodeURIComponent(r)}catch(i){console&&"function"==typeof console.error&&console.error('Could not decode cookie with key "'+r+'"',i)}return{key:t,value:e.substr(n+1)}},t._renewCache=function(){t._cache=t._getCacheFromString(t._document.cookie),t._cachedDocumentCookie=t._document.cookie},t._areEnabled=function(){var e="1"===t.set("cookies.js",1).get("cookies.js");return t.expire("cookies.js"),e},t.enabled=t._areEnabled(),t},c="object"===i(o.document)?a(o):a;r=function(){return c}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}("undefined"==typeof window?void 0:window)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){return s["default"].get(e)}var o=n(50),s=r(o);e.exports=i},function(e,t,n){var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};/*! Hammer.JS - v2.0.8 - 2016-04-23
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
!function(o,s,a,c){"use strict";function p(e,t,n){return setTimeout(d(e,n),t)}function u(e,t,n){return!!Array.isArray(e)&&(h(e,n[t],n),!0)}function h(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==c)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function l(e,t,n){var r="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=o.console&&(o.console.warn||o.console.log);return i&&i.call(o.console,r,n),e.apply(this,arguments)}}function f(e,t,n){var r,i=t.prototype;r=e.prototype=Object.create(i),r.constructor=e,r._super=i,n&&ve(r,n)}function d(e,t){return function(){return e.apply(t,arguments)}}function m(e,t){return("undefined"==typeof e?"undefined":i(e))==be?e.apply(t?t[0]||c:c,t):e}function v(e,t){return e===c?t:e}function g(e,t,n){h(C(t),function(t){e.addEventListener(t,n,!1)})}function y(e,t,n){h(C(t),function(t){e.removeEventListener(t,n,!1)})}function b(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function w(e,t){return e.indexOf(t)>-1}function C(e){return e.trim().split(/\s+/g)}function k(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function T(e){return Array.prototype.slice.call(e,0)}function S(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];k(i,s)<0&&r.push(e[o]),i[o]=s,o++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}function x(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),o=0;o<ge.length;){if(n=ge[o],r=n?n+i:t,r in e)return r;o++}return c}function E(){return xe++}function P(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||o}function R(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){m(e.options.enable,[e])&&n.handler(t)},this.init()}function O(e){var t,n=e.options.inputClass;return new(t=n?n:Re?G:Oe?X:Pe?Y:q)(e,D)}function D(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,o=t&Ie&&r-i===0,s=t&(Be|Ne)&&r-i===0;n.isFirst=!!o,n.isFinal=!!s,o&&(e.session={}),n.eventType=t,A(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function A(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=j(t)),i>1&&!n.firstMultiple?n.firstMultiple=j(t):1===i&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,a=s?s.center:o.center,c=t.center=I(r);t.timeStamp=ke(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=U(a,c),t.distance=N(a,c),_(n,t),t.offsetDirection=B(t.deltaX,t.deltaY);var p=L(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=p.x,t.overallVelocityY=p.y,t.overallVelocity=Ce(p.x)>Ce(p.y)?p.x:p.y,t.scale=s?F(s.pointers,r):1,t.rotation=s?z(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,M(n,t);var u=e.element;b(t.srcEvent.target,u)&&(u=t.srcEvent.target),t.target=u}function _(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==Ie&&o.eventType!==Be||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function M(e,t){var n,r,i,o,s=e.lastInterval||t,a=t.timeStamp-s.timeStamp;if(t.eventType!=Ne&&(a>je||s.velocity===c)){var p=t.deltaX-s.deltaX,u=t.deltaY-s.deltaY,h=L(a,p,u);r=h.x,i=h.y,n=Ce(h.x)>Ce(h.y)?h.x:h.y,o=B(p,u),e.lastInterval=t}else n=s.velocity,r=s.velocityX,i=s.velocityY,o=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=o}function j(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:we(e.pointers[n].clientX),clientY:we(e.pointers[n].clientY)},n++;return{timeStamp:ke(),pointers:t,center:I(t),deltaX:e.deltaX,deltaY:e.deltaY}}function I(e){var t=e.length;if(1===t)return{x:we(e[0].clientX),y:we(e[0].clientY)};for(var n=0,r=0,i=0;t>i;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:we(n/t),y:we(r/t)}}function L(e,t,n){return{x:t/e||0,y:n/e||0}}function B(e,t){return e===t?Ue:Ce(e)>=Ce(t)?0>e?ze:Fe:0>t?qe:Ge}function N(e,t,n){n||(n=Ve);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function U(e,t,n){n||(n=Ve);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}function z(e,t){return U(t[1],t[0],Ye)+U(e[1],e[0],Ye)}function F(e,t){return N(t[0],t[1],Ye)/N(e[0],e[1],Ye)}function q(){this.evEl=$e,this.evWin=Ke,this.pressed=!1,R.apply(this,arguments)}function G(){this.evEl=et,this.evWin=tt,R.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function H(){this.evTarget=rt,this.evWin=it,this.started=!1,R.apply(this,arguments)}function J(e,t){var n=T(e.touches),r=T(e.changedTouches);return t&(Be|Ne)&&(n=S(n.concat(r),"identifier",!0)),[n,r]}function X(){this.evTarget=st,this.targetIds={},R.apply(this,arguments)}function V(e,t){var n=T(e.touches),r=this.targetIds;if(t&(Ie|Le)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=T(e.changedTouches),a=[],c=this.target;if(o=n.filter(function(e){return b(e.target,c)}),t===Ie)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),t&(Be|Ne)&&delete r[s[i].identifier],i++;return a.length?[S(o.concat(a),"identifier",!0),a]:void 0}function Y(){R.apply(this,arguments);var e=d(this.handler,this);this.touch=new X(this.manager,e),this.mouse=new q(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function W(e,t){e&Ie?(this.primaryTouch=t.changedPointers[0].identifier,$.call(this,t)):e&(Be|Ne)&&$.call(this,t)}function $(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches,i=function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)};setTimeout(i,at)}}function K(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(ct>=o&&ct>=s)return!0}return!1}function Z(e,t){this.manager=e,this.set(t)}function Q(e){if(w(e,dt))return dt;var t=w(e,mt),n=w(e,vt);return t&&n?dt:t||n?t?mt:vt:w(e,ft)?ft:lt}function ee(){if(!ut)return!1;var e={},t=o.CSS&&o.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){e[n]=!t||o.CSS.supports("touch-action",n)}),e}function te(e){this.options=ve({},this.defaults,e||{}),this.id=E(),this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=yt,this.simultaneous={},this.requireFail=[]}function ne(e){return e&Tt?"cancel":e&Ct?"end":e&wt?"move":e&bt?"start":""}function re(e){return e==Ge?"down":e==qe?"up":e==ze?"left":e==Fe?"right":""}function ie(e,t){var n=t.manager;return n?n.get(e):e}function oe(){te.apply(this,arguments)}function se(){oe.apply(this,arguments),this.pX=null,this.pY=null}function ae(){oe.apply(this,arguments)}function ce(){te.apply(this,arguments),this._timer=null,this._input=null}function pe(){oe.apply(this,arguments)}function ue(){oe.apply(this,arguments)}function he(){te.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function le(e,t){return t=t||{},t.recognizers=v(t.recognizers,le.defaults.preset),new fe(e,t)}function fe(e,t){this.options=ve({},le.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=O(this),this.touchAction=new Z(this,this.options.touchAction),de(this,!0),h(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function de(e,t){var n=e.element;if(n.style){var r;h(e.options.cssProps,function(i,o){r=x(n.style,o),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||""}),t||(e.oldCssProps={})}}function me(e,t){var n=s.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var ve,ge=["","webkit","Moz","MS","ms","o"],ye=s.createElement("div"),be="function",we=Math.round,Ce=Math.abs,ke=Date.now;ve="function"!=typeof Object.assign?function(e){if(e===c||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==c&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}:Object.assign;var Te=l(function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===c)&&(e[r[i]]=t[r[i]]),i++;return e},"extend","Use `assign`."),Se=l(function(e,t){return Te(e,t,!0)},"merge","Use `assign`."),xe=1,Ee=/mobile|tablet|ip(ad|hone|od)|android/i,Pe="ontouchstart"in o,Re=x(o,"PointerEvent")!==c,Oe=Pe&&Ee.test(navigator.userAgent),De="touch",Ae="pen",_e="mouse",Me="kinect",je=25,Ie=1,Le=2,Be=4,Ne=8,Ue=1,ze=2,Fe=4,qe=8,Ge=16,He=ze|Fe,Je=qe|Ge,Xe=He|Je,Ve=["x","y"],Ye=["clientX","clientY"];R.prototype={handler:function(){},init:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(P(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(P(this.element),this.evWin,this.domHandler)}};var We={mousedown:Ie,mousemove:Le,mouseup:Be},$e="mousedown",Ke="mousemove mouseup";f(q,R,{handler:function(e){var t=We[e.type];t&Ie&&0===e.button&&(this.pressed=!0),t&Le&&1!==e.which&&(t=Be),this.pressed&&(t&Be&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:_e,srcEvent:e}))}});var Ze={pointerdown:Ie,pointermove:Le,pointerup:Be,pointercancel:Ne,pointerout:Ne},Qe={2:De,3:Ae,4:_e,5:Me},et="pointerdown",tt="pointermove pointerup pointercancel";o.MSPointerEvent&&!o.PointerEvent&&(et="MSPointerDown",tt="MSPointerMove MSPointerUp MSPointerCancel"),f(G,R,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Ze[r],o=Qe[e.pointerType]||e.pointerType,s=o==De,a=k(t,e.pointerId,"pointerId");i&Ie&&(0===e.button||s)?0>a&&(t.push(e),a=t.length-1):i&(Be|Ne)&&(n=!0),0>a||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var nt={touchstart:Ie,touchmove:Le,touchend:Be,touchcancel:Ne},rt="touchstart",it="touchstart touchmove touchend touchcancel";f(H,R,{handler:function(e){var t=nt[e.type];if(t===Ie&&(this.started=!0),this.started){var n=J.call(this,e,t);t&(Be|Ne)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:De,srcEvent:e})}}});var ot={touchstart:Ie,touchmove:Le,touchend:Be,touchcancel:Ne},st="touchstart touchmove touchend touchcancel";f(X,R,{handler:function(e){var t=ot[e.type],n=V.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:De,srcEvent:e})}});var at=2500,ct=25;f(Y,R,{handler:function(e,t,n){var r=n.pointerType==De,i=n.pointerType==_e;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)W.call(this,t,n);else if(i&&K.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pt=x(ye.style,"touchAction"),ut=pt!==c,ht="compute",lt="auto",ft="manipulation",dt="none",mt="pan-x",vt="pan-y",gt=ee();Z.prototype={set:function(e){e==ht&&(e=this.compute()),ut&&this.manager.element.style&>[e]&&(this.manager.element.style[pt]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return h(this.manager.recognizers,function(t){m(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),Q(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var r=this.actions,i=w(r,dt)&&!gt[dt],o=w(r,vt)&&!gt[vt],s=w(r,mt)&&!gt[mt];if(i){var a=1===e.pointers.length,c=e.distance<2,p=e.deltaTime<250;if(a&&c&&p)return}return s&&o?void 0:i||o&&n&He||s&&n&Je?this.preventSrc(t):void 0},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var yt=1,bt=2,wt=4,Ct=8,kt=Ct,Tt=16,St=32;te.prototype={defaults:{},set:function(e){return ve(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(u(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=ie(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return u(e,"dropRecognizeWith",this)?this:(e=ie(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(u(e,"requireFailure",this))return this;var t=this.requireFail;return e=ie(e,this),-1===k(t,e)&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(u(e,"dropRequireFailure",this))return this;e=ie(e,this);var t=k(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){n.manager.emit(t,e)}var n=this,r=this.state;Ct>r&&t(n.options.event+ne(r)),t(n.options.event),e.additionalEvent&&t(e.additionalEvent),r>=Ct&&t(n.options.event+ne(r))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=St)},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(St|yt)))return!1;e++}return!0},recognize:function(e){var t=ve({},e);return m(this.options.enable,[this,t])?(this.state&(kt|Tt|St)&&(this.state=yt),this.state=this.process(t),void(this.state&(bt|wt|Ct|Tt)&&this.tryEmit(t))):(this.reset(),void(this.state=St))},process:function(e){},getTouchAction:function(){},reset:function(){}},f(oe,te,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(bt|wt),i=this.attrTest(e);return r&&(n&Ne||!i)?t|Tt:r||i?n&Be?t|Ct:t&bt?t|wt:bt:St}}),f(se,oe,{defaults:{event:"pan",threshold:10,pointers:1,direction:Xe},getTouchAction:function(){var e=this.options.direction,t=[];return e&He&&t.push(vt),e&Je&&t.push(mt),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(t.direction&He?(i=0===o?Ue:0>o?ze:Fe,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?Ue:0>s?qe:Ge,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return oe.prototype.attrTest.call(this,e)&&(this.state&bt||!(this.state&bt)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=re(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),f(ae,oe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[dt]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&bt)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),f(ce,te,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[lt]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(Be|Ne)&&!i)this.reset();else if(e.eventType&Ie)this.reset(),this._timer=p(function(){this.state=kt,this.tryEmit()},t.time,this);else if(e.eventType&Be)return kt;return St},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===kt&&(e&&e.eventType&Be?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=ke(),this.manager.emit(this.options.event,this._input)))}}),f(pe,oe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[dt]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&bt)}}),f(ue,oe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:He|Je,pointers:1},getTouchAction:function(){return se.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(He|Je)?t=e.overallVelocity:n&He?t=e.overallVelocityX:n&Je&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&Ce(t)>this.options.velocity&&e.eventType&Be},emit:function(e){var t=re(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),f(he,te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ft]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&Ie&&0===this.count)return this.failTimeout();if(r&&i&&n){if(e.eventType!=Be)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||N(this.pCenter,e.center)<t.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e;var a=this.count%t.taps;if(0===a)return this.hasRequireFailures()?(this._timer=p(function(){this.state=kt,this.tryEmit()},t.interval,this),bt):kt}return St},failTimeout:function(){return this._timer=p(function(){this.state=St},this.options.interval,this),St},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==kt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),le.VERSION="2.0.8",le.defaults={domEvents:!1,touchAction:ht,enable:!0,inputTarget:null,inputClass:null,preset:[[pe,{enable:!1}],[ae,{enable:!1},["rotate"]],[ue,{direction:He}],[se,{direction:He},["swipe"]],[he],[he,{event:"doubletap",taps:2},["tap"]],[ce]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var xt=1,Et=2;fe.prototype={set:function(e){return ve(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?Et:xt},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&kt)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],t.stopped===Et||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&n.state&(bt|wt|Ct)&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof te)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(u(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(u(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=k(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==c&&t!==c){var n=this.handlers;return h(C(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==c){var n=this.handlers;return h(C(e),function(e){t?n[e]&&n[e].splice(k(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&me(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&de(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ve(le,{INPUT_START:Ie,INPUT_MOVE:Le,INPUT_END:Be,INPUT_CANCEL:Ne,STATE_POSSIBLE:yt,STATE_BEGAN:bt,STATE_CHANGED:wt,STATE_ENDED:Ct,STATE_RECOGNIZED:kt,STATE_CANCELLED:Tt,STATE_FAILED:St,DIRECTION_NONE:Ue,DIRECTION_LEFT:ze,DIRECTION_RIGHT:Fe,DIRECTION_UP:qe,DIRECTION_DOWN:Ge,DIRECTION_HORIZONTAL:He,DIRECTION_VERTICAL:Je,DIRECTION_ALL:Xe,Manager:fe,Input:R,TouchAction:Z,TouchInput:X,MouseInput:q,PointerEventInput:G,TouchMouseInput:Y,SingleTouchInput:H,Recognizer:te,AttrRecognizer:oe,Tap:he,Pan:se,Swipe:ue,Pinch:ae,Rotate:pe,Press:ce,on:g,off:y,each:h,merge:Se,extend:Te,assign:ve,inherit:f,bindFn:d,prefixed:x});var Pt="undefined"!=typeof o?o:"undefined"!=typeof self?self:{};Pt.Hammer=le,r=function(){return le}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}(window,document,"Hammer")},function(e,t){"use strict";var n=function(e){imperio.socket.on("updateRoomData",function(t){imperio.myID=imperio.socket.id,imperio.otherIDs=Object.keys(t.sockets).map(function(e){return e.substring(2)}).filter(function(e){return e!==imperio.myID}),e&&e(t)})};e.exports=n},function(e,t,n){"use strict";var r=n(13),i=n(7),o=n(55),s=n(12);e.exports=function(e,t){console.log("Creating Peer connection as initiator?",e,"config:",t),imperio.peerConnection=new RTCPeerConnection(t),imperio.peerConnection.onicecandidate=function(e){console.log("icecandidate event:",e),e.candidate?r({type:"candidate",label:e.candidate.sdpMLineIndex,id:e.candidate.sdpMid,candidate:e.candidate.candidate}):console.log("End of candidates.")},e?(console.log("Creating Data Channel"),imperio.dataChannel=imperio.peerConnection.createDataChannel("phone data",{ordered:!1,maxRetransmits:0}),o(),console.log("Creating an offer"),imperio.peerConnection.createOffer(s,i)):imperio.peerConnection.ondatachannel=function(e){console.log("ondatachannel:",e.channel),imperio.dataChannel=e.channel,o()}}},function(e,t){"use strict";var n=function(){imperio.dataChannel&&(imperio.dataChannel.onopen=function(){console.log("CHANNEL opened!!!"),imperio.connectionType="webRTC",imperio.dataChannel.onmessage=function(e){var t=JSON.parse(e.data),n=["acceleration","gyroscope","geoLocation","tap","pan","pinch","press","presUp","rotate","swipe","data"];n.forEach(function(e){t.type===e&&imperio.callbacks[e]&&imperio.callbacks[e](t.data)})}})};e.exports=n},function(e,t,n){"use strict";var r=n(7),i=n(12),o=function(e){"offer"===e.type?(console.log("Got offer. Sending answer to peer."),imperio.peerConnection.setRemoteDescription(new RTCSessionDescription(e),function(){},r),imperio.peerConnection.createAnswer(i,r)):"answer"===e.type?(console.log("Got answer."),imperio.peerConnection.setRemoteDescription(new RTCSessionDescription(e),function(){},r)):"candidate"===e.type&&(console.log("Setting candidate."),imperio.peerConnection.addIceCandidate(new RTCIceCandidate({candidate:e.candidate})))};e.exports=o},function(e,t,n){"use strict";var r=n(54),i=n(56),o=n(14),s=function(){o?(imperio.socket.on("created",function(e,t){console.log("Created room, "+e+" - my client ID is, "+t)}),imperio.socket.on("log",function(e){console.log.apply(console,e)}),imperio.socket.on("joined",function(e,t){console.log("This peer has joined room, "+e+", with client ID, "+t),r(!1,imperio.webRTCConfiguration)}),imperio.socket.on("ready",function(){console.log("Socket is ready"),r(!0,imperio.webRTCConfiguration)}),imperio.socket.on("message",function(e){console.log("Client received message: "+e),i(e)})):console.log("WebRTC is not supported, will continue using Sockets.")};e.exports=s},function(e,t){function n(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},function(e,t){!function(e){"use strict";t.encode=function(t){var n,r=new Uint8Array(t),i=r.length,o="";for(n=0;n<i;n+=3)o+=e[r[n]>>2],o+=e[(3&r[n])<<4|r[n+1]>>4],o+=e[(15&r[n+1])<<2|r[n+2]>>6],o+=e[63&r[n+2]];return i%3===2?o=o.substring(0,o.length-1)+"=":i%3===1&&(o=o.substring(0,o.length-2)+"=="),o},t.decode=function(t){var n,r,i,o,s,a=.75*t.length,c=t.length,p=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var u=new ArrayBuffer(a),h=new Uint8Array(u);for(n=0;n<c;n+=4)r=e.indexOf(t[n]),i=e.indexOf(t[n+1]),o=e.indexOf(t[n+2]),s=e.indexOf(t[n+3]),h[p++]=r<<2|i>>4,h[p++]=(15&i)<<4|o>>2,h[p++]=(3&o)<<6|63&s;return u}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},function(e,t){(function(t){function n(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.buffer instanceof ArrayBuffer){var r=n.buffer;if(n.byteLength!==r.byteLength){var i=new Uint8Array(n.byteLength);i.set(new Uint8Array(r,n.byteOffset,n.byteLength)),r=i.buffer}e[t]=r}}}function r(e,t){t=t||{};var r=new o;n(e);for(var i=0;i<e.length;i++)r.append(e[i]);return t.type?r.getBlob(t.type):r.getBlob()}function i(e,t){return n(e),new Blob(e,t||{})}var o=t.BlobBuilder||t.WebKitBlobBuilder||t.MSBlobBuilder||t.MozBlobBuilder,s=function(){try{var e=new Blob(["hi"]);return 2===e.size}catch(t){return!1}}(),a=s&&function(){try{var e=new Blob([new Uint8Array([1,2])]);return 2===e.size}catch(t){return!1}}(),c=o&&o.prototype.append&&o.prototype.getBlob;e.exports=function(){return s?a?t.Blob:i:c?r:void 0}()}).call(t,function(){return this}())},function(e,t,n){function r(){return t.colors[u++%t.colors.length]}function i(e){function n(){}function i(){var e=i,n=+new Date,o=n-(p||n);e.diff=o,e.prev=p,e.curr=n,p=n,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=r());var s=Array.prototype.slice.call(arguments);s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(n,r){if("%%"===n)return n;a++;var i=t.formatters[r];if("function"==typeof i){var o=s[a];n=i.call(e,o),s.splice(a,1),a--}return n}),"function"==typeof t.formatArgs&&(s=t.formatArgs.apply(e,s));var c=i.log||t.log||console.log.bind(console);c.apply(e,s)}n.enabled=!1,i.enabled=!0;var o=t.enabled(e)?i:n;return o.namespace=e,o}function o(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),r=n.length,i=0;i<r;i++)n[i]&&(e=n[i].replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function s(){t.enable("")}function a(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=i,t.coerce=c,t.disable=s,t.enable=o,t.enabled=a,t.humanize=n(72),t.names=[],t.skips=[],t.formatters={};var p,u=0},function(e,t,n){e.exports=n(63)},function(e,t,n){e.exports=n(64),e.exports.parser=n(3)},function(e,t,n){(function(t){function r(e,n){if(!(this instanceof r))return new r(e,n);n=n||{},e&&"object"==typeof e&&(n=e,e=null),e?(e=u(e),n.hostname=e.host,n.secure="https"==e.protocol||"wss"==e.protocol,n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=u(n.host).host),this.secure=null!=n.secure?n.secure:t.location&&"https:"==location.protocol,n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.agent=n.agent||!1,this.hostname=n.hostname||(t.location?location.hostname:"localhost"),this.port=n.port||(t.location&&location.port?location.port:this.secure?443:80),this.query=n.query||{},"string"==typeof this.query&&(this.query=l.decode(this.query)),this.upgrade=!1!==n.upgrade,this.path=(n.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!n.forceJSONP,this.jsonp=!1!==n.jsonp,this.forceBase64=!!n.forceBase64,this.enablesXDR=!!n.enablesXDR,this.timestampParam=n.timestampParam||"t",this.timestampRequests=n.timestampRequests,this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.policyPort=n.policyPort||843,this.rememberUpgrade=n.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=n.onlyBinaryUpgrades,this.perMessageDeflate=!1!==n.perMessageDeflate&&(n.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=n.pfx||null,this.key=n.key||null,this.passphrase=n.passphrase||null,this.cert=n.cert||null,this.ca=n.ca||null,this.ciphers=n.ciphers||null,this.rejectUnauthorized=void 0===n.rejectUnauthorized||n.rejectUnauthorized;var i="object"==typeof t&&t;i.global===i&&n.extraHeaders&&Object.keys(n.extraHeaders).length>0&&(this.extraHeaders=n.extraHeaders),this.open()}function i(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var o=n(16),s=n(4),a=n(2)("engine.io-client:socket"),c=n(18),p=n(3),u=n(19),h=n(73),l=n(10);e.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=p.protocol,r.Socket=r,r.Transport=n(8),r.transports=n(16),r.parser=n(3),r.prototype.createTransport=function(e){a('creating transport "%s"',e);var t=i(this.query);t.EIO=p.protocol,t.transport=e,this.id&&(t.sid=this.id);var n=new o[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders});return n},r.prototype.open=function(){var e;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1)e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(n){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},r.prototype.setTransport=function(e){a("setting transport %s",e.name);var t=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},r.prototype.probe=function(e){function t(){if(l.onlyBinaryUpgrades){var t=!this.supportsBinary&&l.transport.supportsBinary;h=h||t}h||(a('probe transport "%s" opened',e),u.send([{type:"ping",data:"probe"}]),u.once("packet",function(t){if(!h)if("pong"==t.type&&"probe"==t.data){if(a('probe transport "%s" pong',e),l.upgrading=!0,l.emit("upgrading",u),!u)return;r.priorWebsocketSuccess="websocket"==u.name,a('pausing current transport "%s"',l.transport.name),l.transport.pause(function(){h||"closed"!=l.readyState&&(a("changing transport and sending upgrade packet"),p(),l.setTransport(u),u.send([{type:"upgrade"}]),l.emit("upgrade",u),u=null,l.upgrading=!1,l.flush())})}else{a('probe transport "%s" failed',e);var n=new Error("probe error");n.transport=u.name,l.emit("upgradeError",n)}}))}function n(){h||(h=!0,p(),u.close(),u=null)}function i(t){var r=new Error("probe error: "+t);r.transport=u.name,n(),a('probe transport "%s" failed because of error: %s',e,t),l.emit("upgradeError",r)}function o(){i("transport closed")}function s(){i("socket closed")}function c(e){u&&e.name!=u.name&&(a('"%s" works - aborting "%s"',e.name,u.name),n())}function p(){u.removeListener("open",t),u.removeListener("error",i),u.removeListener("close",o),l.removeListener("close",s),l.removeListener("upgrading",c)}a('probing transport "%s"',e);var u=this.createTransport(e,{probe:1}),h=!1,l=this;r.priorWebsocketSuccess=!1,u.once("open",t),u.once("error",i),u.once("close",o),this.once("close",s),this.once("upgrading",c),u.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",
r.priorWebsocketSuccess="websocket"==this.transport.name,this.emit("open"),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},r.prototype.onPacket=function(e){if("opening"==this.readyState||"open"==this.readyState)switch(a('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(h(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else a('packet received with socket readyState "%s"',this.readyState)},r.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!=this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},r.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){"closed"!=t.readyState&&t.onClose("ping timeout")},e||t.pingInterval+t.pingTimeout)},r.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){a("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},r.prototype.ping=function(){var e=this;this.sendPacket("ping",function(){e.emit("ping")})},r.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},r.prototype.flush=function(){"closed"!=this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(a("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},r.prototype.write=r.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},r.prototype.sendPacket=function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"!=this.readyState&&"closed"!=this.readyState){n=n||{},n.compress=!1!==n.compress;var i={type:e,data:t,options:n};this.emit("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}},r.prototype.close=function(){function e(){r.onClose("forced close"),a("socket closing - telling transport to close"),r.transport.close()}function t(){r.removeListener("upgrade",t),r.removeListener("upgradeError",t),e()}function n(){r.once("upgrade",t),r.once("upgradeError",t)}if("opening"==this.readyState||"open"==this.readyState){this.readyState="closing";var r=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():e()}):this.upgrading?n():e()}return this},r.prototype.onError=function(e){a("socket error %j",e),r.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},r.prototype.onClose=function(e,t){if("opening"==this.readyState||"open"==this.readyState||"closing"==this.readyState){a('socket close with reason: "%s"',e);var n=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),n.writeBuffer=[],n.prevBufferLen=0}},r.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;n<r;n++)~c(this.transports,e[n])&&t.push(e[n]);return t}}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(){}function i(e){o.call(this,e),this.query=this.query||{},a||(t.___eio||(t.___eio=[]),a=t.___eio),this.index=a.length;var n=this;a.push(function(e){n.onData(e)}),this.query.j=this.index,t.document&&t.addEventListener&&t.addEventListener("beforeunload",function(){n.script&&(n.script.onerror=r)},!1)}var o=n(17),s=n(5);e.exports=i;var a,c=/\n/g,p=/\\n/g;s(i,o),i.prototype.supportsBinary=!1,i.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),o.prototype.doClose.call(this)},i.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t;var r="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);r&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},i.prototype.doWrite=function(e,t){function n(){r(),t()}function r(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(e){i.onError("jsonp polling iframe removal error",e)}try{var t='<iframe src="javascript:0" name="'+i.iframeId+'">';o=document.createElement(t)}catch(e){o=document.createElement("iframe"),o.name=i.iframeId,o.src="javascript:0"}o.id=i.iframeId,i.form.appendChild(o),i.iframe=o}var i=this;if(!this.form){var o,s=document.createElement("form"),a=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=u,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),r(),e=e.replace(p,"\\\n"),this.area.value=e.replace(c,"\\n");try{this.form.submit()}catch(h){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==i.iframe.readyState&&n()}:this.iframe.onload=n}}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(){}function i(e){if(c.call(this,e),t.location){var n="https:"==location.protocol,r=location.port;r||(r=n?443:80),this.xd=e.hostname!=t.location.hostname||r!=e.port,this.xs=e.secure!=n}else this.extraHeaders=e.extraHeaders}function o(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!=e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function s(){for(var e in o.requests)o.requests.hasOwnProperty(e)&&o.requests[e].abort()}var a=n(9),c=n(17),p=n(4),u=n(5),h=n(2)("engine.io-client:polling-xhr");e.exports=i,e.exports.Request=o,u(i,c),i.prototype.supportsBinary=!0,i.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.extraHeaders=this.extraHeaders,new o(e)},i.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,r=this.request({method:"POST",data:e,isBinary:n}),i=this;r.on("success",t),r.on("error",function(e){i.onError("xhr post error",e)}),this.sendXhr=r},i.prototype.doPoll=function(){h("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},p(o.prototype),o.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var n=this.xhr=new a(e),r=this;try{h("xhr open %s: %s",this.method,this.uri),n.open(this.method,this.uri,this.async);try{if(this.extraHeaders){n.setDisableHeaderCheck(!0);for(var i in this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this.extraHeaders[i])}}catch(s){}if(this.supportsBinary&&(n.responseType="arraybuffer"),"POST"==this.method)try{this.isBinary?n.setRequestHeader("Content-type","application/octet-stream"):n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(s){}"withCredentials"in n&&(n.withCredentials=!0),this.hasXDR()?(n.onload=function(){r.onLoad()},n.onerror=function(){r.onError(n.responseText)}):n.onreadystatechange=function(){4==n.readyState&&(200==n.status||1223==n.status?r.onLoad():setTimeout(function(){r.onError(n.status)},0))},h("xhr data %s",this.data),n.send(this.data)}catch(s){return void setTimeout(function(){r.onError(s)},0)}t.document&&(this.index=o.requestsCount++,o.requests[this.index]=this)},o.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},o.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},o.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},o.prototype.cleanup=function(e){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=r:this.xhr.onreadystatechange=r,e)try{this.xhr.abort()}catch(n){}t.document&&delete o.requests[this.index],this.xhr=null}},o.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(n){}if("application/octet-stream"===t)e=this.xhr.response;else if(this.supportsBinary)try{e=String.fromCharCode.apply(null,new Uint8Array(this.xhr.response))}catch(n){for(var r=new Uint8Array(this.xhr.response),i=[],o=0,s=r.length;o<s;o++)i.push(r[o]);e=String.fromCharCode.apply(null,i)}else e=this.xhr.responseText}catch(n){this.onError(n)}null!=e&&this.onData(e)},o.prototype.hasXDR=function(){return"undefined"!=typeof t.XDomainRequest&&!this.xs&&this.enablesXDR},o.prototype.abort=function(){this.cleanup()},t.document&&(o.requestsCount=0,o.requests={},t.attachEvent?t.attachEvent("onunload",s):t.addEventListener&&t.addEventListener("beforeunload",s,!1))}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(e){var t=e&&e.forceBase64;t&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,i.call(this,e)}var i=n(8),o=n(3),s=n(10),a=n(5),c=n(26),p=n(2)("engine.io-client:websocket"),u=t.WebSocket||t.MozWebSocket,h=u;if(!h&&"undefined"==typeof window)try{h=n(90)}catch(l){}e.exports=r,a(r,i),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=void 0,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.ws=u?new h(e):new h(e,t,n),void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="buffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(r.prototype.onData=function(e){var t=this;setTimeout(function(){i.prototype.onData.call(t,e)},0)}),r.prototype.write=function(e){function n(){r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0)}var r=this;this.writable=!1;for(var i=e.length,s=0,a=i;s<a;s++)!function(e){o.encodePacket(e,r.supportsBinary,function(o){if(!u){var s={};if(e.options&&(s.compress=e.options.compress),r.perMessageDeflate){var a="string"==typeof o?t.Buffer.byteLength(o):o.length;a<r.perMessageDeflate.threshold&&(s.compress=!1)}}try{u?r.ws.send(o):r.ws.send(o,s)}catch(c){p("websocket closed before onclose event")}--i||n()})}(e[s])},r.prototype.onClose=function(){i.prototype.onClose.call(this)},r.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()},r.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";this.port&&("wss"==t&&443!=this.port||"ws"==t&&80!=this.port)&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=c()),this.supportsBinary||(e.b64=1),e=s.encode(e),e.length&&(e="?"+e);var r=this.hostname.indexOf(":")!==-1;return t+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+e},r.prototype.check=function(){return!(!h||"__initialize"in h&&this.name===r.prototype.name)}}).call(t,function(){return this}())},function(e,t){e.exports=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t}},function(e,t,n){(function(t){function r(e){function n(e){if(!e)return!1;if(t.Buffer&&t.Buffer.isBuffer(e)||t.ArrayBuffer&&e instanceof ArrayBuffer||t.Blob&&e instanceof Blob||t.File&&e instanceof File)return!0;if(i(e)){for(var r=0;r<e.length;r++)if(n(e[r]))return!0}else if(e&&"object"==typeof e){e.toJSON&&(e=e.toJSON());for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&n(e[o]))return!0}return!1}return n(e)}var i=n(6);e.exports=r}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(e){function n(e){if(!e)return!1;if(t.Buffer&&t.Buffer.isBuffer&&t.Buffer.isBuffer(e)||t.ArrayBuffer&&e instanceof ArrayBuffer||t.Blob&&e instanceof Blob||t.File&&e instanceof File)return!0;if(i(e)){for(var r=0;r<e.length;r++)if(n(e[r]))return!0}else if(e&&"object"==typeof e){e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON());for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&n(e[o]))return!0}return!1}return n(e)}var i=n(6);e.exports=r}).call(t,function(){return this}())},function(e,t){try{e.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(n){e.exports=!1}},function(e,t){function n(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*u;case"days":case"day":case"d":return n*p;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function r(e){return e>=p?Math.round(e/p)+"d":e>=c?Math.round(e/c)+"h":e>=a?Math.round(e/a)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function i(e){return o(e,p,"day")||o(e,c,"hour")||o(e,a,"minute")||o(e,s,"second")||e+" ms"}function o(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var s=1e3,a=60*s,c=60*a,p=24*c,u=365.25*p;e.exports=function(e,t){return t=t||{},"string"==typeof e?n(e):t["long"]?i(e):r(e)}},function(e,t){(function(t){var n=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,o=/(?:^|:|,)(?:\s*\[)+/g,s=/^\s+/,a=/\s+$/;e.exports=function(e){return"string"==typeof e&&e?(e=e.replace(s,"").replace(a,""),t.JSON&&JSON.parse?JSON.parse(e):n.test(e.replace(r,"@").replace(i,"]").replace(o,""))?new Function("return "+e)():void 0):null}}).call(t,function(){return this}())},function(e,t){"use strict";var n={};n.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},n.splitSections=function(e){var t=e.split("\nm=");return t.map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},n.matchPrefix=function(e,t){return n.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},n.parseCandidate=function(e){var t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var n={foundation:t[0],component:t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1]}return n},n.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),"candidate:"+t.join(" ")},n.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.numChannels=3===t.length?parseInt(t[2],10):1,n},n.writeRtpMap=function(e){var t=e.payloadType;return void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType),"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==e.numChannels?"/"+e.numChannels:"")+"\r\n"},n.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),uri:t[1]}},n.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+" "+e.uri+"\r\n"},n.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)t=r[i].trim().split("="),n[t[0].trim()]=t[1];return n},n.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach(function(t){r.push(t+"="+e.parameters[t])}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},n.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},n.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},n.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},n.getDtlsParameters=function(e,t){var r=n.splitLines(e);r=r.concat(n.splitLines(t));var i=r.filter(function(e){return 0===e.indexOf("a=fingerprint:")})[0].substr(14),o={role:"auto",fingerprints:[{algorithm:i.split(" ")[0],value:i.split(" ")[1]}]};return o},n.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},n.getIceParameters=function(e,t){var r=n.splitLines(e);r=r.concat(n.splitLines(t));var i={usernameFragment:r.filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:r.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)};return i},n.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},n.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e),i=r[0].split(" "),o=3;o<i.length;o++){var s=i[o],a=n.matchPrefix(e,"a=rtpmap:"+s+" ")[0];if(a){var c=n.parseRtpMap(a),p=n.matchPrefix(e,"a=fmtp:"+s+" ");switch(c.parameters=p.length?n.parseFmtp(p[0]):{},c.rtcpFeedback=n.matchPrefix(e,"a=rtcp-fb:"+s+" ").map(n.parseRtcpFb),t.codecs.push(c),c.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(c.name.toUpperCase())}}}return n.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(n.parseExtmap(e))}),t},n.writeRtpDescription=function(e,t){var r="";return r+="m="+e+" ",r+=t.codecs.length>0?"9":"0",r+=" UDP/TLS/RTP/SAVPF ",r+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)}),r+="a=rtcp-mux\r\n"},n.parseRtpEncodingParameters=function(e){var t,r=[],i=n.parseRtpParameters(e),o=i.fecMechanisms.indexOf("RED")!==-1,s=i.fecMechanisms.indexOf("ULPFEC")!==-1,a=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=a.length>0&&a[0].ssrc,p=n.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.split(" ");return t.shift(),t.map(function(e){return parseInt(e,10)})});p.length>0&&p[0].length>1&&p[0][0]===c&&(t=p[0][1]),i.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{payloadType:e.payloadType,ssrc:t}};r.push(n),o&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:t,mechanism:s?"red+ulpfec":"red"},r.push(n))}}),0===r.length&&c&&r.push({ssrc:c});var u=n.matchPrefix(e,"b=");return u.length&&(0===u[0].indexOf("b=TIAS:")?u=parseInt(u[0].substr(7),10):0===u[0].indexOf("b=AS:")&&(u=parseInt(u[0].substr(5),10)),r.forEach(function(e){e.maxBitrate=u})),r},n.writeSessionBoilerplate=function(){return"v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(e,t,r,i){var o=n.writeRtpDescription(e.kind,t);if(o+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",o+=e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var s="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n"},n.getDirection=function(e,t){for(var r=n.splitLines(e),i=0;i<r.length;i++)switch(r[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[i].substr(2)}return t?n.getDirection(t):"sendrecv"},e.exports=n},function(e,t,n){function r(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r=i(e),o=r.source,p=r.id,u=r.path,h=c[p]&&u in c[p].nsps,l=t.forceNew||t["force new connection"]||!1===t.multiplex||h;return l?(a("ignoring socket cache for %s",o),n=s(o,t)):(c[p]||(a("new io instance for %s",o),c[p]=s(o,t)),n=c[p]),n.socket(r.path)}var i=n(76),o=n(11),s=n(20),a=n(2)("socket.io-client");e.exports=t=r;var c=t.managers={};t.protocol=o.protocol,t.connect=r,t.Manager=n(20),t.Socket=n(22)},function(e,t,n){(function(t){function r(e,n){var r=e,n=n||t.location;null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"==e.charAt(0)&&(e="/"==e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e="undefined"!=typeof n?n.protocol+"//"+e:"https://"+e),o("parse %s",e),r=i(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var s=r.host.indexOf(":")!==-1,a=s?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port,r.href=r.protocol+"://"+a+(n&&n.port==r.port?"":":"+r.port),r}var i=n(19),o=n(2)("socket.io-client:url");e.exports=r}).call(t,function(){return this}())},function(e,t,n){(function(e){var r=n(6),i=n(24);t.deconstructPacket=function(e){function t(e){if(!e)return e;if(i(e)){var o={_placeholder:!0,num:n.length};return n.push(e),o}if(r(e)){for(var s=new Array(e.length),a=0;a<e.length;a++)s[a]=t(e[a]);return s}if("object"==typeof e&&!(e instanceof Date)){var s={};for(var c in e)s[c]=t(e[c]);return s}return e}var n=[],o=e.data,s=e;return s.data=t(o),s.attachments=n.length,{packet:s,buffers:n}},t.reconstructPacket=function(e,t){function n(e){if(e&&e._placeholder){var i=t[e.num];return i}if(r(e)){for(var o=0;o<e.length;o++)e[o]=n(e[o]);return e}if(e&&"object"==typeof e){for(var s in e)e[s]=n(e[s]);return e}return e}return e.data=n(e.data),e.attachments=void 0,e},t.removeBlobs=function(t,n){function o(t,c,p){if(!t)return t;if(e.Blob&&t instanceof Blob||e.File&&t instanceof File){s++;var u=new FileReader;u.onload=function(){p?p[c]=this.result:a=this.result,--s||n(a)},u.readAsArrayBuffer(t)}else if(r(t))for(var h=0;h<t.length;h++)o(t[h],h,t);else if(t&&"object"==typeof t&&!i(t))for(var l in t)o(t[l],l,t)}var s=0,a=t;o(a),s||n(a)}}).call(t,function(){return this}())},function(e,t,n){var r;(function(e,i){(function(){function o(e,t){function n(e){if(n[e]!==v)return n[e];var o;if("bug-string-char-index"==e)o="a"!="a"[0];else if("json"==e)o=n("json-stringify")&&n("json-parse");else{var s,a='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var p=t.stringify,u="function"==typeof p&&b;if(u){(s=function(){return 1}).toJSON=s;try{u="0"===p(0)&&"0"===p(new r)&&'""'==p(new i)&&p(y)===v&&p(v)===v&&p()===v&&"1"===p(s)&&"[1]"==p([s])&&"[null]"==p([v])&&"null"==p(null)&&"[null,null,null]"==p([v,y,null])&&p({a:[s,!0,!1,null,"\0\b\n\f\r\t"]})==a&&"1"===p(null,s)&&"[\n 1,\n 2\n]"==p([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==p(new c((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==p(new c(864e13))&&'"-000001-01-01T00:00:00.000Z"'==p(new c((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==p(new c((-1)))}catch(h){u=!1}}o=u}if("json-parse"==e){var l=t.parse;if("function"==typeof l)try{if(0===l("0")&&!l(!1)){s=l(a);var f=5==s.a.length&&1===s.a[0];if(f){try{f=!l('"\t"')}catch(h){}if(f)try{f=1!==l("01")}catch(h){}if(f)try{f=1!==l("1.")}catch(h){}}}}catch(h){f=!1}o=f}}return n[e]=!!o}e||(e=p.Object()),t||(t=p.Object());var r=e.Number||p.Number,i=e.String||p.String,s=e.Object||p.Object,c=e.Date||p.Date,u=e.SyntaxError||p.SyntaxError,h=e.TypeError||p.TypeError,l=e.Math||p.Math,f=e.JSON||p.JSON;"object"==typeof f&&f&&(t.stringify=f.stringify,t.parse=f.parse);var d,m,v,g=s.prototype,y=g.toString,b=new c((-0xc782b5b800cec));try{b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}catch(w){}if(!n("json")){var C="[object Function]",k="[object Date]",T="[object Number]",S="[object String]",x="[object Array]",E="[object Boolean]",P=n("bug-string-char-index");if(!b)var R=l.floor,O=[0,31,59,90,120,151,181,212,243,273,304,334],D=function(e,t){return O[t]+365*(e-1970)+R((e-1969+(t=+(t>1)))/4)-R((e-1901+t)/100)+R((e-1601+t)/400)};if((d=g.hasOwnProperty)||(d=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=y?d=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,d=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,d.call(this,e)}),m=function(e,t){var n,r,i,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(i in r)d.call(r,i)&&o++;return n=r=null,o?m=2==o?function(e,t){var n,r={},i=y.call(e)==C;for(n in e)i&&"prototype"==n||d.call(r,n)||!(r[n]=1)||!d.call(e,n)||t(n)}:function(e,t){var n,r,i=y.call(e)==C;for(n in e)i&&"prototype"==n||!d.call(e,n)||(r="constructor"===n)||t(n);(r||d.call(e,n="constructor"))&&t(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],m=function(e,t){var n,i,o=y.call(e)==C,s=!o&&"function"!=typeof e.constructor&&a[typeof e.hasOwnProperty]&&e.hasOwnProperty||d;for(n in e)o&&"prototype"==n||!s.call(e,n)||t(n);for(i=r.length;n=r[--i];s.call(e,n)&&t(n));}),m(e,t)},!n("json-stringify")){var A={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},_="000000",M=function(e,t){return(_+(t||0)).slice(-e)},j="\\u00",I=function(e){for(var t='"',n=0,r=e.length,i=!P||r>10,o=i&&(P?e.split(""):e);n<r;n++){var s=e.charCodeAt(n);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=A[s];break;default:if(s<32){t+=j+M(2,s.toString(16));break}t+=i?o[n]:e.charAt(n)}}return t+'"'},L=function(e,t,n,r,i,o,s){var a,c,p,u,l,f,g,b,w,C,P,O,A,_,j,B;try{a=t[e]}catch(N){}if("object"==typeof a&&a)if(c=y.call(a),c!=k||d.call(a,"toJSON"))"function"==typeof a.toJSON&&(c!=T&&c!=S&&c!=x||d.call(a,"toJSON"))&&(a=a.toJSON(e));else if(a>-1/0&&a<1/0){if(D){for(l=R(a/864e5),p=R(l/365.2425)+1970-1;D(p+1,0)<=l;p++);for(u=R((l-D(p,0))/30.42);D(p,u+1)<=l;u++);l=1+l-D(p,u),f=(a%864e5+864e5)%864e5,g=R(f/36e5)%24,b=R(f/6e4)%60,w=R(f/1e3)%60,C=f%1e3}else p=a.getUTCFullYear(),u=a.getUTCMonth(),l=a.getUTCDate(),g=a.getUTCHours(),b=a.getUTCMinutes(),w=a.getUTCSeconds(),C=a.getUTCMilliseconds();a=(p<=0||p>=1e4?(p<0?"-":"+")+M(6,p<0?-p:p):M(4,p))+"-"+M(2,u+1)+"-"+M(2,l)+"T"+M(2,g)+":"+M(2,b)+":"+M(2,w)+"."+M(3,C)+"Z"}else a=null;if(n&&(a=n.call(t,e,a)),null===a)return"null";if(c=y.call(a),c==E)return""+a;if(c==T)return a>-1/0&&a<1/0?""+a:"null";if(c==S)return I(""+a);if("object"==typeof a){for(_=s.length;_--;)if(s[_]===a)throw h();if(s.push(a),P=[],j=o,o+=i,c==x){for(A=0,_=a.length;A<_;A++)O=L(A,a,n,r,i,o,s),P.push(O===v?"null":O);B=P.length?i?"[\n"+o+P.join(",\n"+o)+"\n"+j+"]":"["+P.join(",")+"]":"[]"}else m(r||a,function(e){var t=L(e,a,n,r,i,o,s);t!==v&&P.push(I(e)+":"+(i?" ":"")+t)}),B=P.length?i?"{\n"+o+P.join(",\n"+o)+"\n"+j+"}":"{"+P.join(",")+"}":"{}";return s.pop(),B}};t.stringify=function(e,t,n){var r,i,o,s;if(a[typeof t]&&t)if((s=y.call(t))==C)i=t;else if(s==x){o={};for(var c,p=0,u=t.length;p<u;c=t[p++],s=y.call(c),(s==S||s==T)&&(o[c]=1));}if(n)if((s=y.call(n))==T){if((n-=n%1)>0)for(r="",n>10&&(n=10);r.length<n;r+=" ");}else s==S&&(r=n.length<=10?n:n.slice(0,10));return L("",(c={},c[""]=e,c),i,o,r,"",[])}}if(!n("json-parse")){var B,N,U=i.fromCharCode,z={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},F=function(){throw B=N=null,u()},q=function(){for(var e,t,n,r,i,o=N,s=o.length;B<s;)switch(i=o.charCodeAt(B)){case 9:case 10:case 13:case 32:B++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=P?o.charAt(B):o[B],B++,e;case 34:for(e="@",B++;B<s;)if(i=o.charCodeAt(B),i<32)F();else if(92==i)switch(i=o.charCodeAt(++B)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=z[i],B++;break;case 117:for(t=++B,n=B+4;B<n;B++)i=o.charCodeAt(B),i>=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||F();e+=U("0x"+o.slice(t,B));break;default:F()}else{if(34==i)break;for(i=o.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=o.charCodeAt(++B);e+=o.slice(t,B)}if(34==o.charCodeAt(B))return B++,e;F();default:if(t=B,45==i&&(r=!0,i=o.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=o.charCodeAt(B+1),i>=48&&i<=57)&&F(),r=!1;B<s&&(i=o.charCodeAt(B),i>=48&&i<=57);B++);if(46==o.charCodeAt(B)){for(n=++B;n<s&&(i=o.charCodeAt(n),i>=48&&i<=57);n++);n==B&&F(),B=n}if(i=o.charCodeAt(B),101==i||69==i){for(i=o.charCodeAt(++B),43!=i&&45!=i||B++,n=B;n<s&&(i=o.charCodeAt(n),i>=48&&i<=57);n++);n==B&&F(),B=n}return+o.slice(t,B)}if(r&&F(),"true"==o.slice(B,B+4))return B+=4,!0;if("false"==o.slice(B,B+5))return B+=5,!1;if("null"==o.slice(B,B+4))return B+=4,null;F()}return"$"},G=function(e){var t,n;if("$"==e&&F(),"string"==typeof e){if("@"==(P?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=q(),"]"!=e;n||(n=!0))n&&(","==e?(e=q(),"]"==e&&F()):F()),","==e&&F(),t.push(G(e));return t}if("{"==e){for(t={};e=q(),"}"!=e;n||(n=!0))n&&(","==e?(e=q(),"}"==e&&F()):F()),","!=e&&"string"==typeof e&&"@"==(P?e.charAt(0):e[0])&&":"==q()||F(),t[e.slice(1)]=G(q());return t}F()}return e},H=function(e,t,n){var r=J(e,t,n);r===v?delete e[t]:e[t]=r},J=function(e,t,n){var r,i=e[t];if("object"==typeof i&&i)if(y.call(i)==x)for(r=i.length;r--;)H(i,r,n);else m(i,function(e){H(i,e,n)});return n.call(e,t,i)};t.parse=function(e,t){var n,r;return B=0,N=""+e,n=G(q()),
"$"!=q()&&F(),B=N=null,t&&y.call(t)==C?J((r={},r[""]=n,r),"",t):n}}}return t.runInContext=o,t}var s=n(81),a={"function":!0,object:!0},c=a[typeof t]&&t&&!t.nodeType&&t,p=a[typeof window]&&window||this,u=c&&a[typeof e]&&e&&!e.nodeType&&"object"==typeof i&&i;if(!u||u.global!==u&&u.window!==u&&u.self!==u||(p=u),c&&!s)o(p,c);else{var h=p.JSON,l=p.JSON3,f=!1,d=o(p,p.JSON3={noConflict:function(){return f||(f=!0,p.JSON=h,p.JSON3=l,h=l=null),d}});p.JSON={parse:d.parse,stringify:d.stringify}}s&&(r=function(){return d}.call(t,n,t,e),!(void 0!==r&&(e.exports=r)))}).call(this)}).call(t,n(25)(e),function(){return this}())},function(e,t){function n(e,t){var n=[];t=t||0;for(var r=t||0;r<e.length;r++)n[r-t]=e[r];return n}e.exports=n},function(e,t,n){var r;(function(e,i){!function(o){function s(e){for(var t,n,r=[],i=0,o=e.length;i<o;)t=e.charCodeAt(i++),t>=55296&&t<=56319&&i<o?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function a(e){for(var t,n=e.length,r=-1,i="";++r<n;)t=e[r],t>65535&&(t-=65536,i+=w(t>>>10&1023|55296),t=56320|1023&t),i+=w(t);return i}function c(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function p(e,t){return w(e>>t&63|128)}function u(e){if(0==(4294967168&e))return w(e);var t="";return 0==(4294965248&e)?t=w(e>>6&31|192):0==(4294901760&e)?(c(e),t=w(e>>12&15|224),t+=p(e,6)):0==(4292870144&e)&&(t=w(e>>18&7|240),t+=p(e,12),t+=p(e,6)),t+=w(63&e|128)}function h(e){for(var t,n=s(e),r=n.length,i=-1,o="";++i<r;)t=n[i],o+=u(t);return o}function l(){if(b>=y)throw Error("Invalid byte index");var e=255&g[b];if(b++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function f(){var e,t,n,r,i;if(b>y)throw Error("Invalid byte index");if(b==y)return!1;if(e=255&g[b],b++,0==(128&e))return e;if(192==(224&e)){var t=l();if(i=(31&e)<<6|t,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if(t=l(),n=l(),i=(15&e)<<12|t<<6|n,i>=2048)return c(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=l(),n=l(),r=l(),i=(15&e)<<18|t<<12|n<<6|r,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}function d(e){g=s(e),y=g.length,b=0;for(var t,n=[];(t=f())!==!1;)n.push(t);return a(n)}var m="object"==typeof t&&t,v=("object"==typeof e&&e&&e.exports==m&&e,"object"==typeof i&&i);v.global!==v&&v.window!==v||(o=v);var g,y,b,w=String.fromCharCode,C={version:"2.0.0",encode:h,decode:d};r=function(){return C}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}(this)}).call(t,n(25)(e),function(){return this}())},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,n){"use strict";!function(){var t=n(1).log,r=n(1).browserDetails;e.exports.browserDetails=r,e.exports.extractVersion=n(1).extractVersion,e.exports.disableLog=n(1).disableLog;var i=n(83)||null,o=n(85)||null,s=n(87)||null,a=n(89)||null;switch(r.browser){case"opera":case"chrome":if(!i||!i.shimPeerConnection)return void t("Chrome shim is not included in this adapter release.");t("adapter.js shimming chrome."),e.exports.browserShim=i,i.shimGetUserMedia(),i.shimMediaStream(),i.shimSourceObject(),i.shimPeerConnection(),i.shimOnTrack();break;case"firefox":if(!s||!s.shimPeerConnection)return void t("Firefox shim is not included in this adapter release.");t("adapter.js shimming firefox."),e.exports.browserShim=s,s.shimGetUserMedia(),s.shimSourceObject(),s.shimPeerConnection(),s.shimOnTrack();break;case"edge":if(!o||!o.shimPeerConnection)return void t("MS edge shim is not included in this adapter release.");t("adapter.js shimming edge."),e.exports.browserShim=o,o.shimGetUserMedia(),o.shimPeerConnection();break;case"safari":if(!a)return void t("Safari shim is not included in this adapter release.");t("adapter.js shimming safari."),e.exports.browserShim=a,a.shimGetUserMedia();break;default:t("Unsupported browser!")}}()},function(e,t,n){"use strict";var r=n(1).log,i=n(1).browserDetails,o={shimMediaStream:function(){window.MediaStream=window.MediaStream||window.webkitMediaStream},shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){var t=this;this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.addEventListener("addtrack",function(n){var r=new Event("track");r.track=n.track,r.receiver={track:n.track},r.streams=[e.stream],t.dispatchEvent(r)}),e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var t=this;return this._srcObject=e,this.src&&URL.revokeObjectURL(this.src),e?(this.src=URL.createObjectURL(e),e.addEventListener("addtrack",function(){t.src&&URL.revokeObjectURL(t.src),t.src=URL.createObjectURL(e)}),void e.addEventListener("removetrack",function(){t.src&&URL.revokeObjectURL(t.src),t.src=URL.createObjectURL(e)})):void(this.src="")}}))},shimPeerConnection:function(){window.RTCPeerConnection=function(e,t){r("PeerConnection"),e&&e.iceTransportPolicy&&(e.iceTransports=e.iceTransportPolicy);var n=new webkitRTCPeerConnection(e,t),i=n.getStats.bind(n);return n.getStats=function(e,t,n){var r=this,o=arguments;if(arguments.length>0&&"function"==typeof e)return i(e,t);var s=function(e){var t={},n=e.result();return n.forEach(function(e){var n={id:e.id,timestamp:e.timestamp,type:e.type};e.names().forEach(function(t){n[t]=e.stat(t)}),t[n.id]=n}),t},a=function(e,t){var n=new Map(Object.keys(e).map(function(t){return[t,e[t]]}));return t=t||e,Object.keys(t).forEach(function(e){n[e]=t[e]}),n};if(arguments.length>=2){var c=function(e){o[1](a(s(e)))};return i.apply(this,[c,arguments[0]])}return new Promise(function(t,n){1===o.length&&"object"==typeof e?i.apply(r,[function(e){t(a(s(e)))},n]):i.apply(r,[function(e){t(a(s(e),e.result()))},n])}).then(t,n)},n},window.RTCPeerConnection.prototype=webkitRTCPeerConnection.prototype,webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return webkitRTCPeerConnection.generateCertificate}}),["createOffer","createAnswer"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var n=1===arguments.length?arguments[0]:void 0;return new Promise(function(r,i){t.apply(e,[r,i,n])})}return t.apply(this,arguments)}}),i.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=arguments,n=this,r=new Promise(function(r,i){t.apply(n,[e[0],r,i])});return e.length<2?r:r.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)},["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}})},attachMediaStream:function(e,t){r("DEPRECATED, attachMediaStream will soon be removed."),i.version>=43?e.srcObject=t:"undefined"!=typeof e.src?e.src=URL.createObjectURL(t):r("Error attaching stream to element.")},reattachMediaStream:function(e,t){r("DEPRECATED, reattachMediaStream will soon be removed."),i.version>=43?e.srcObject=t.srcObject:e.src=t.src}};e.exports={shimMediaStream:o.shimMediaStream,shimOnTrack:o.shimOnTrack,shimSourceObject:o.shimSourceObject,shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:n(84),attachMediaStream:o.attachMediaStream,reattachMediaStream:o.reattachMediaStream}},function(e,t,n){"use strict";var r=n(1).log;e.exports=function(){var e=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var o={};"number"==typeof r.ideal?(o[i("min",n)]=r.ideal,t.optional.push(o),o={},o[i("max",n)]=r.ideal,t.optional.push(o)):(o[i("",n)]=r.ideal,t.optional.push(o))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},t=function(t,n){if(t=JSON.parse(JSON.stringify(t)),t&&t.audio&&(t.audio=e(t.audio)),t&&"object"==typeof t.video){var i=t.video.facingMode;if(i=i&&("object"==typeof i?i:{ideal:i}),i&&("user"===i.exact||"environment"===i.exact||"user"===i.ideal||"environment"===i.ideal)&&(!navigator.mediaDevices.getSupportedConstraints||!navigator.mediaDevices.getSupportedConstraints().facingMode)&&(delete t.video.facingMode,"environment"===i.exact||"environment"===i.ideal))return navigator.mediaDevices.enumerateDevices().then(function(o){o=o.filter(function(e){return"videoinput"===e.kind});var s=o.find(function(e){return e.label.toLowerCase().indexOf("back")!==-1})||o.length&&o[o.length-1];return s&&(t.video.deviceId=i.exact?{exact:s.deviceId}:{ideal:s.deviceId}),t.video=e(t.video),r("chrome: "+JSON.stringify(t)),n(t)});t.video=e(t.video)}return r("chrome: "+JSON.stringify(t)),n(t)},n=function(e){return{name:{PermissionDeniedError:"NotAllowedError",ConstraintNotSatisfiedError:"OverconstrainedError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},i=function(e,r,i){t(e,function(e){navigator.webkitGetUserMedia(e,r,function(e){i(n(e))})})};navigator.getUserMedia=i;var o=function(e){return new Promise(function(t,n){navigator.getUserMedia(e,t,n)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:o,enumerateDevices:function(){return new Promise(function(e){var t={audio:"audioinput",video:"videoinput"};return MediaStreamTrack.getSources(function(n){e(n.map(function(e){return{label:e.label,kind:t[e.kind],deviceId:e.id,groupId:""}}))})})}}),navigator.mediaDevices.getUserMedia){var s=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(e){return t(e,function(e){return s(e)["catch"](function(e){return Promise.reject(n(e))})})}}else navigator.mediaDevices.getUserMedia=function(e){return o(e)};"undefined"==typeof navigator.mediaDevices.addEventListener&&(navigator.mediaDevices.addEventListener=function(){r("Dummy mediaDevices.addEventListener called.")}),"undefined"==typeof navigator.mediaDevices.removeEventListener&&(navigator.mediaDevices.removeEventListener=function(){r("Dummy mediaDevices.removeEventListener called.")})}},function(e,t,n){"use strict";var r=n(74),i=n(1).log,o={shimPeerConnection:function(){window.RTCIceGatherer&&(window.RTCIceCandidate||(window.RTCIceCandidate=function(e){return e}),window.RTCSessionDescription||(window.RTCSessionDescription=function(e){return e})),window.RTCPeerConnection=function(e){var t=this,n=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){t[e]=n[e].bind(n)}),this.onicecandidate=null,this.onaddstream=null,this.ontrack=null,this.onremovestream=null,this.onsignalingstatechange=null,this.oniceconnectionstatechange=null,this.onnegotiationneeded=null,this.ondatachannel=null,this.localStreams=[],this.remoteStreams=[],this.getLocalStreams=function(){return t.localStreams},this.getRemoteStreams=function(){return t.remoteStreams},this.localDescription=new RTCSessionDescription({type:"",sdp:""}),this.remoteDescription=new RTCSessionDescription({type:"",sdp:""}),this.signalingState="stable",this.iceConnectionState="new",this.iceGatheringState="new",this.iceOptions={gatherPolicy:"all",iceServers:[]},e&&e.iceTransportPolicy)switch(e.iceTransportPolicy){case"all":case"relay":this.iceOptions.gatherPolicy=e.iceTransportPolicy;break;case"none":throw new TypeError('iceTransportPolicy "none" not supported')}if(this.usingBundle=e&&"max-bundle"===e.bundlePolicy,e&&e.iceServers){var r=JSON.parse(JSON.stringify(e.iceServers));this.iceOptions.iceServers=r.filter(function(e){if(e&&e.urls){var t=e.urls;return"string"==typeof t&&(t=[t]),t=t.filter(function(e){return 0===e.indexOf("turn:")&&e.indexOf("transport=udp")!==-1})[0],!!t}return!1})}this.transceivers=[],this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype._emitBufferedCandidates=function(){var e=this,t=r.splitSections(e.localDescription.sdp);this._localIceCandidatesBuffer.forEach(function(n){var r=!n.candidate||0===Object.keys(n.candidate).length;if(r)for(var i=1;i<t.length;i++)t[i].indexOf("\r\na=end-of-candidates\r\n")===-1&&(t[i]+="a=end-of-candidates\r\n");else n.candidate.candidate.indexOf("typ endOfCandidates")===-1&&(t[n.candidate.sdpMLineIndex+1]+="a="+n.candidate.candidate+"\r\n");if(e.localDescription.sdp=t.join(""),e.dispatchEvent(n),null!==e.onicecandidate&&e.onicecandidate(n),!n.candidate&&"complete"!==e.iceGatheringState){var o=e.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});o&&(e.iceGatheringState="complete")}}),this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype.addStream=function(e){this.localStreams.push(e.clone()),this._maybeFireNegotiationNeeded()},window.RTCPeerConnection.prototype.removeStream=function(e){var t=this.localStreams.indexOf(e);t>-1&&(this.localStreams.splice(t,1),this._maybeFireNegotiationNeeded())},window.RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},window.RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},window.RTCPeerConnection.prototype._getCommonCapabilities=function(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]};return e.codecs.forEach(function(e){for(var r=0;r<t.codecs.length;r++){var i=t.codecs[r];if(e.name.toLowerCase()===i.name.toLowerCase()&&e.clockRate===i.clockRate&&e.numChannels===i.numChannels){n.codecs.push(i);break}}}),e.headerExtensions.forEach(function(e){for(var r=0;r<t.headerExtensions.length;r++){var i=t.headerExtensions[r];if(e.uri===i.uri){n.headerExtensions.push(i);break}}}),n},window.RTCPeerConnection.prototype._createIceAndDtlsTransports=function(e,t){var n=this,i=new RTCIceGatherer(n.iceOptions),o=new RTCIceTransport(i);i.onlocalcandidate=function(s){var a=new Event("icecandidate");a.candidate={sdpMid:e,sdpMLineIndex:t};var c=s.candidate,p=!c||0===Object.keys(c).length;p?(void 0===i.state&&(i.state="completed"),a.candidate.candidate="candidate:1 1 udp 1 0.0.0.0 9 typ endOfCandidates"):(c.component="RTCP"===o.component?2:1,a.candidate.candidate=r.writeCandidate(c));var u=r.splitSections(n.localDescription.sdp);a.candidate.candidate.indexOf("typ endOfCandidates")===-1?u[a.candidate.sdpMLineIndex+1]+="a="+a.candidate.candidate+"\r\n":u[a.candidate.sdpMLineIndex+1]+="a=end-of-candidates\r\n",n.localDescription.sdp=u.join("");var h=n.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});switch(n.iceGatheringState){case"new":n._localIceCandidatesBuffer.push(a),p&&h&&n._localIceCandidatesBuffer.push(new Event("icecandidate"));break;case"gathering":n._emitBufferedCandidates(),n.dispatchEvent(a),null!==n.onicecandidate&&n.onicecandidate(a),h&&(n.dispatchEvent(new Event("icecandidate")),null!==n.onicecandidate&&n.onicecandidate(new Event("icecandidate")),n.iceGatheringState="complete");break;case"complete":}},o.onicestatechange=function(){n._updateConnectionState()};var s=new RTCDtlsTransport(o);return s.ondtlsstatechange=function(){n._updateConnectionState()},s.onerror=function(){s.state="failed",n._updateConnectionState()},{iceGatherer:i,iceTransport:o,dtlsTransport:s}},window.RTCPeerConnection.prototype._transceive=function(e,t,n){var i=this._getCommonCapabilities(e.localCapabilities,e.remoteCapabilities);t&&e.rtpSender&&(i.encodings=e.sendEncodingParameters,i.rtcp={cname:r.localCName},e.recvEncodingParameters.length&&(i.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(i)),n&&e.rtpReceiver&&(i.encodings=e.recvEncodingParameters,i.rtcp={cname:e.cname},e.sendEncodingParameters.length&&(i.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(i))},window.RTCPeerConnection.prototype.setLocalDescription=function(e){var t,n,i=this;if("offer"===e.type)this._pendingOffer&&(t=r.splitSections(e.sdp),n=t.shift(),t.forEach(function(e,t){var n=r.parseRtpParameters(e);i._pendingOffer[t].localCapabilities=n}),this.transceivers=this._pendingOffer,delete this._pendingOffer);else if("answer"===e.type){t=r.splitSections(i.remoteDescription.sdp),n=t.shift();var o=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach(function(e,t){var s=i.transceivers[t],a=s.iceGatherer,c=s.iceTransport,p=s.dtlsTransport,u=s.localCapabilities,h=s.remoteCapabilities,l="0"===e.split("\n",1)[0].split(" ",2)[1];if(!l){var f=r.getIceParameters(e,n);if(o){var d=r.matchPrefix(e,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});d.length&&c.setRemoteCandidates(d)}var m=r.getDtlsParameters(e,n);o&&(m.role="server"),i.usingBundle&&0!==t||(c.start(a,f,o?"controlling":"controlled"),p.start(m));var v=i._getCommonCapabilities(u,h);i._transceive(s,v.codecs.length>0,!1)}})}switch(this.localDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-local-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}var s=arguments.length>1&&"function"==typeof arguments[1];if(s){var a=arguments[1];window.setTimeout(function(){a(),"new"===i.iceGatheringState&&(i.iceGatheringState="gathering"),i._emitBufferedCandidates()},0)}var c=Promise.resolve();return c.then(function(){s||("new"===i.iceGatheringState&&(i.iceGatheringState="gathering"),window.setTimeout(i._emitBufferedCandidates.bind(i),500))}),c},window.RTCPeerConnection.prototype.setRemoteDescription=function(e){var t=this,n=new MediaStream,i=[],o=r.splitSections(e.sdp),s=o.shift(),a=r.matchPrefix(s,"a=ice-lite").length>0;switch(this.usingBundle=r.matchPrefix(s,"a=group:BUNDLE ").length>0,o.forEach(function(o,c){var p,u,h,l,f,d,m,v,g,y,b,w,C=r.splitLines(o),k=C[0].substr(2).split(" "),T=k[0],S="0"===k[1],x=r.getDirection(o,s),E=r.parseRtpParameters(o);S||(b=r.getIceParameters(o,s),w=r.getDtlsParameters(o,s),w.role="client"),v=r.parseRtpEncodingParameters(o);var P=r.matchPrefix(o,"a=mid:");P=P.length?P[0].substr(6):r.generateIdentifier();var R,O=r.matchPrefix(o,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];O&&(R=O.value);var D=r.matchPrefix(o,"a=end-of-candidates").length>0,A=r.matchPrefix(o,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});if("offer"!==e.type||S)"answer"!==e.type||S||(p=t.transceivers[c],u=p.iceGatherer,h=p.iceTransport,l=p.dtlsTransport,f=p.rtpSender,d=p.rtpReceiver,m=p.sendEncodingParameters,g=p.localCapabilities,t.transceivers[c].recvEncodingParameters=v,t.transceivers[c].remoteCapabilities=E,t.transceivers[c].cname=R,(a||D)&&A.length&&h.setRemoteCandidates(A),t.usingBundle&&0!==c||(h.start(u,b,"controlling"),l.start(w)),t._transceive(p,"sendrecv"===x||"recvonly"===x,"sendrecv"===x||"sendonly"===x),!d||"sendrecv"!==x&&"sendonly"!==x?delete p.rtpReceiver:(y=d.track,i.push([y,d]),n.addTrack(y)));else{var _=t.usingBundle&&c>0?{iceGatherer:t.transceivers[0].iceGatherer,iceTransport:t.transceivers[0].iceTransport,dtlsTransport:t.transceivers[0].dtlsTransport}:t._createIceAndDtlsTransports(P,c);if(D&&_.iceTransport.setRemoteCandidates(A),g=RTCRtpReceiver.getCapabilities(T),m=[{ssrc:1001*(2*c+2)}],d=new RTCRtpReceiver(_.dtlsTransport,T),y=d.track,i.push([y,d]),n.addTrack(y),t.localStreams.length>0&&t.localStreams[0].getTracks().length>=c){var M=t.localStreams[0].getTracks()[c];f=new RTCRtpSender(M,_.dtlsTransport)}t.transceivers[c]={iceGatherer:_.iceGatherer,iceTransport:_.iceTransport,dtlsTransport:_.dtlsTransport,localCapabilities:g,remoteCapabilities:E,rtpSender:f,rtpReceiver:d,kind:T,mid:P,cname:R,sendEncodingParameters:m,recvEncodingParameters:v},t._transceive(t.transceivers[c],!1,"sendrecv"===x||"sendonly"===x)}}),this.remoteDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-remote-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}return n.getTracks().length&&(t.remoteStreams.push(n),window.setTimeout(function(){var e=new Event("addstream");e.stream=n,t.dispatchEvent(e),null!==t.onaddstream&&window.setTimeout(function(){t.onaddstream(e)},0),i.forEach(function(r){var i=r[0],o=r[1],s=new Event("track");s.track=i,s.receiver=o,s.streams=[n],t.dispatchEvent(e),null!==t.ontrack&&window.setTimeout(function(){t.ontrack(s)},0)})},0)),arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._updateSignalingState("closed")},window.RTCPeerConnection.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this.dispatchEvent(t),null!==this.onsignalingstatechange&&this.onsignalingstatechange(t)},window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var e=new Event("negotiationneeded");this.dispatchEvent(e),null!==this.onnegotiationneeded&&this.onnegotiationneeded(e)},window.RTCPeerConnection.prototype._updateConnectionState=function(){var e,t=this,n={"new":0,closed:0,connecting:0,checking:0,connected:0,completed:0,failed:0};if(this.transceivers.forEach(function(e){n[e.iceTransport.state]++,n[e.dtlsTransport.state]++}),n.connected+=n.completed,e="new",n.failed>0?e="failed":n.connecting>0||n.checking>0?e="connecting":n.disconnected>0?e="disconnected":n["new"]>0?e="new":(n.connected>0||n.completed>0)&&(e="connected"),e!==t.iceConnectionState){t.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this.dispatchEvent(r),null!==this.oniceconnectionstatechange&&this.oniceconnectionstatechange(r)}},window.RTCPeerConnection.prototype.createOffer=function(){var e=this;if(this._pendingOffer)throw new Error("createOffer called while there is a pending offer.");var t;1===arguments.length&&"function"!=typeof arguments[0]?t=arguments[0]:3===arguments.length&&(t=arguments[2]);var n=[],i=0,o=0;if(this.localStreams.length&&(i=this.localStreams[0].getAudioTracks().length,o=this.localStreams[0].getVideoTracks().length),t){if(t.mandatory||t.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==t.offerToReceiveAudio&&(i=t.offerToReceiveAudio),void 0!==t.offerToReceiveVideo&&(o=t.offerToReceiveVideo)}for(this.localStreams.length&&this.localStreams[0].getTracks().forEach(function(e){n.push({kind:e.kind,track:e,wantReceive:"audio"===e.kind?i>0:o>0}),"audio"===e.kind?i--:"video"===e.kind&&o--});i>0||o>0;)i>0&&(n.push({kind:"audio",wantReceive:!0}),i--),o>0&&(n.push({kind:"video",wantReceive:!0}),o--);var s=r.writeSessionBoilerplate(),a=[];n.forEach(function(t,n){var i,o,s=t.track,c=t.kind,p=r.generateIdentifier(),u=e.usingBundle&&n>0?{iceGatherer:a[0].iceGatherer,iceTransport:a[0].iceTransport,dtlsTransport:a[0].dtlsTransport}:e._createIceAndDtlsTransports(p,n),h=RTCRtpSender.getCapabilities(c),l=[{ssrc:1001*(2*n+1)}];s&&(i=new RTCRtpSender(s,u.dtlsTransport)),t.wantReceive&&(o=new RTCRtpReceiver(u.dtlsTransport,c)),a[n]={iceGatherer:u.iceGatherer,iceTransport:u.iceTransport,dtlsTransport:u.dtlsTransport,localCapabilities:h,remoteCapabilities:null,rtpSender:i,rtpReceiver:o,kind:c,mid:p,sendEncodingParameters:l,recvEncodingParameters:null}}),this.usingBundle&&(s+="a=group:BUNDLE "+a.map(function(e){return e.mid}).join(" ")+"\r\n"),n.forEach(function(t,n){var i=a[n];s+=r.writeMediaSection(i,i.localCapabilities,"offer",e.localStreams[0])}),this._pendingOffer=a;var c=new RTCSessionDescription({type:"offer",sdp:s});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,c),Promise.resolve(c)},window.RTCPeerConnection.prototype.createAnswer=function(){var e=this,t=r.writeSessionBoilerplate();this.usingBundle&&(t+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),this.transceivers.forEach(function(n){var i=e._getCommonCapabilities(n.localCapabilities,n.remoteCapabilities);t+=r.writeMediaSection(n,i,"answer",e.localStreams[0])});var n=new RTCSessionDescription({type:"answer",sdp:t});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,n),Promise.resolve(n)},window.RTCPeerConnection.prototype.addIceCandidate=function(e){if(null===e)this.transceivers.forEach(function(e){e.iceTransport.addRemoteCandidate({})});else{var t=e.sdpMLineIndex;if(e.sdpMid)for(var n=0;n<this.transceivers.length;n++)if(this.transceivers[n].mid===e.sdpMid){t=n;break}var i=this.transceivers[t];if(i){var o=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===o.protocol&&0===o.port)return;if("1"!==o.component)return;"endOfCandidates"===o.type&&(o={}),i.iceTransport.addRemoteCandidate(o);var s=r.splitSections(this.remoteDescription.sdp);s[t+1]+=(o.type?e.candidate.trim():"a=end-of-candidates")+"\r\n",this.remoteDescription.sdp=s.join("")}}return arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.getStats=function(){var e=[];this.transceivers.forEach(function(t){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(n){t[n]&&e.push(t[n].getStats())})});var t=arguments.length>1&&"function"==typeof arguments[1]&&arguments[1];return new Promise(function(n){var r=new Map;Promise.all(e).then(function(e){e.forEach(function(e){Object.keys(e).forEach(function(t){r.set(t,e[t]),r[t]=e[t]})}),t&&window.setTimeout(t,0,r),n(r)})})}},attachMediaStream:function(e,t){i("DEPRECATED, attachMediaStream will soon be removed."),e.srcObject=t},reattachMediaStream:function(e,t){i("DEPRECATED, reattachMediaStream will soon be removed."),e.srcObject=t.srcObject}};e.exports={shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:n(86),attachMediaStream:o.attachMediaStream,reattachMediaStream:o.reattachMediaStream}},function(e,t){"use strict";e.exports=function(){var e=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}},t=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(n){return t(n)["catch"](function(t){return Promise.reject(e(t))})}}},function(e,t,n){"use strict";var r=n(1).log,i=n(1).browserDetails,o={shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(){if("object"==typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection)){window.RTCPeerConnection||(window.RTCPeerConnection=function(e,t){if(i.version<38&&e&&e.iceServers){for(var n=[],r=0;r<e.iceServers.length;r++){var o=e.iceServers[r];if(o.hasOwnProperty("urls"))for(var s=0;s<o.urls.length;s++){var a={url:o.urls[s]};0===o.urls[s].indexOf("turn")&&(a.username=o.username,a.credential=o.credential),n.push(a)}else n.push(e.iceServers[r])}e.iceServers=n}return new mozRTCPeerConnection(e,t)},window.RTCPeerConnection.prototype=mozRTCPeerConnection.prototype,mozRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return mozRTCPeerConnection.generateCertificate}}),window.RTCSessionDescription=mozRTCSessionDescription,window.RTCIceCandidate=mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=RTCPeerConnection.prototype[e];RTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)};var t=function(e){var t=new Map;return Object.keys(e).forEach(function(n){t.set(n,e[n]),t[n]=e[n]}),t},n=RTCPeerConnection.prototype.getStats;RTCPeerConnection.prototype.getStats=function(e,r,i){return n.apply(this,[e||null]).then(function(e){return t(e)}).then(r,i)}}},attachMediaStream:function(e,t){r("DEPRECATED, attachMediaStream will soon be removed."),e.srcObject=t},reattachMediaStream:function(e,t){r("DEPRECATED, reattachMediaStream will soon be removed."),e.srcObject=t.srcObject}};e.exports={shimOnTrack:o.shimOnTrack,shimSourceObject:o.shimSourceObject,shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:n(88),attachMediaStream:o.attachMediaStream,reattachMediaStream:o.reattachMediaStream}},function(e,t,n){"use strict";var r=n(1).log,i=n(1).browserDetails;e.exports=function(){var e=function(e){return{name:{SecurityError:"NotAllowedError",PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:{"The operation is insecure.":"The request is not allowed by the user agent or the platform in the current context."}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&": ")+this.message}}},t=function(t,n,o){var s=function(e){if("object"!=typeof e||e.require)return e;var t=[];return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r=e[n]="object"==typeof e[n]?e[n]:{ideal:e[n]};if(void 0===r.min&&void 0===r.max&&void 0===r.exact||t.push(n),void 0!==r.exact&&("number"==typeof r.exact?r.min=r.max=r.exact:e[n]=r.exact,delete r.exact),
void 0!==r.ideal){e.advanced=e.advanced||[];var i={};"number"==typeof r.ideal?i[n]={min:r.ideal,max:r.ideal}:i[n]=r.ideal,e.advanced.push(i),delete r.ideal,Object.keys(r).length||delete e[n]}}}),t.length&&(e.require=t),e};return t=JSON.parse(JSON.stringify(t)),i.version<38&&(r("spec: "+JSON.stringify(t)),t.audio&&(t.audio=s(t.audio)),t.video&&(t.video=s(t.video)),r("ff37: "+JSON.stringify(t))),navigator.mozGetUserMedia(t,n,function(t){o(e(t))})},n=function(e){return new Promise(function(n,r){t(e,n,r)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:n,addEventListener:function(){},removeEventListener:function(){}}),navigator.mediaDevices.enumerateDevices=navigator.mediaDevices.enumerateDevices||function(){return new Promise(function(e){var t=[{kind:"audioinput",deviceId:"default",label:"",groupId:""},{kind:"videoinput",deviceId:"default",label:"",groupId:""}];e(t)})},i.version<41){var o=navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);navigator.mediaDevices.enumerateDevices=function(){return o().then(void 0,function(e){if("NotFoundError"===e.name)return[];throw e})}}if(i.version<49){var s=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(t){return s(t)["catch"](function(t){return Promise.reject(e(t))})}}navigator.getUserMedia=function(e,n,r){return i.version<44?t(e,n,r):(console.warn("navigator.getUserMedia has been replaced by navigator.mediaDevices.getUserMedia"),void navigator.mediaDevices.getUserMedia(e).then(n,r))}}},function(e,t){"use strict";var n={shimGetUserMedia:function(){navigator.getUserMedia=navigator.webkitGetUserMedia}};e.exports={shimGetUserMedia:n.shimGetUserMedia}},function(e,t){}]);
//# sourceMappingURL=imperio.min.js.map
|
"use strict";
/**
* Geometry loader can be used to load geometry files.
*
* @class GeometryLoader
* @constructor
* @module Loaders
* @param {Object} manager
*/
function GeometryLoader(manager)
{
this.manager = (manager !== undefined) ? manager : THREE.DefaultLoadingManager;
this.geometryLoader = new THREE.JSONLoader();
this.bufferGeometryLoader = new THREE.BufferGeometryLoader();
}
/**
* Load geometry json file from URL.
*
* @method load
* @param {String} url
* @param {Function} onLoad
* @param {Function} onProgress
* @param {Function} onError
*/
GeometryLoader.prototype.load = function(url, onLoad, onProgress, onError)
{
var loader = new THREE.FileLoader(this.manager);
loader.load(url, function(text)
{
onLoad(self.parse(JSON.parse(text)));
}, onProgress, onError);
};
/**
* Parse geometry json.
*
* @method parse
* @param {Object} json
* @return {Geometry} Geometry loaded from json.
*/
GeometryLoader.prototype.parse = function(data)
{
var geometry;
switch(data.type)
{
case "PlaneGeometry":
case "PlaneBufferGeometry":
geometry = new THREE[data.type](data.width, data.height, data.widthSegments, data.heightSegments);
break;
case "BoxGeometry":
case "BoxBufferGeometry":
case "CubeGeometry":
geometry = new THREE[data.type](data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments);
break;
case "CircleGeometry":
case "CircleBufferGeometry":
geometry = new THREE[data.type](data.radius, data.segments, data.thetaStart, data.thetaLength);
break;
case "CylinderGeometry":
case "CylinderBufferGeometry":
geometry = new THREE[data.type](data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength);
break;
case "ConeGeometry":
case "ConeBufferGeometry":
geometry = new THREE[data.type](data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength);
break;
case "SphereGeometry":
case "SphereBufferGeometry":
geometry = new THREE[data.type](data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength);
break;
case "DodecahedronGeometry":
case "IcosahedronGeometry":
case "OctahedronGeometry":
case "TetrahedronGeometry":
case "DodecahedronBufferGeometry":
case "IcosahedronBufferGeometry":
case "OctahedronBufferGeometry":
case "TetrahedronBufferGeometry":
geometry = new THREE[data.type](data.radius, data.detail);
break;
case "PolyhedronGeometry":
case "PolyhedronBufferGeometry":
geometry = new THREE[data.type](data.radius, data.indices, data.radius, data.detail);
break;
case "RingGeometry":
case "RingBufferGeometry":
geometry = new THREE[data.type](data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength);
break;
case "TorusGeometry":
case "TorusBufferGeometry":
geometry = new THREE[data.type](data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc);
break;
case "TorusKnotGeometry":
case "TorusKnotBufferGeometry":
geometry = new THREE[data.type](data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q);
break;
case "LatheGeometry":
case "LatheBufferGeometry":
geometry = new THREE[data.type](data.points, data.segments, data.phiStart, data.phiLength);
break;
case "BufferGeometry":
geometry = this.bufferGeometryLoader.parse(data);
break;
case "Geometry":
geometry = this.geometryLoader.parse(data.data).geometry;
break;
default:
console.warn("GeometryLoader: Unsupported geometry type " + data.type);
geometry = new THREE.Geometry();
break;
}
geometry.uuid = data.uuid;
if(data.name !== undefined)
{
geometry.name = data.name;
}
else
{
geometry.name = "geometry";
}
return geometry;
};
|
const l=function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const o of t.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerpolicy&&(t.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?t.credentials="include":e.crossorigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function i(e){if(e.ep)return;e.ep=!0;const t=s(e);fetch(e.href,t)}};l();window.addEventListener("load",()=>{let r,n;const s=()=>{r=window.innerWidth,n=window.innerHeight;const e=()=>{r=window.innerWidth,n=window.innerHeight,console.log(r,n)};window.addEventListener("resize",e,!0);const t=o=>{(o.key==="f"||o.key==="F")&&document.body.requestFullscreen()};window.addEventListener("keydown",t,!0)},i=()=>{console.log("Hello World")};s(),i()});
|
const path = require(`path`)
const glob = require(`glob`)
const fs = require(`fs`)
const pkgs = glob.sync(`./@coursemaker/gatsby-theme-coursemaker`).map(p => p.replace(/^\./, `<rootDir>`))
module.exports = {
transform: {
"^.+\\.jsx?$": `<rootDir>/jest-preprocess.js`,
},
moduleNameMapper: {
".+\\.(css|styl|less|sass|scss)$": `identity-obj-proxy`,
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": `<rootDir>/@coursemaker/gatsby-theme-coursemaker/__mocks__/gatsby.js`,
},
testPathIgnorePatterns: [`<rootDir>/node_modules/`, `<rootDir>/.cache/`, `<rootDir>.*/public`,
`<rootDir>/@coursemaker/gatsby-theme-coursemaker/node_modules`, `<rootDir>/course_demo_site/`],
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
globals: {
__PATH_PREFIX__: ``,
},
testURL: `http://localhost`,
setupFiles: [`<rootDir>/loadershim.js`, `<rootDir>/@coursemaker/gatsby-theme-coursemaker/src/templates/__mocks__/react-router-dom.js`],
}
|
$(document).ready(function () {
$("#slider").bxSlider({
auto: true,
displaySlideQty: 1,
minSlides: 1,
maxSlides: 1,
slideWidth: 250,
slideMargin: 10,
randomStart: true,
captions: true,
pause: 3000,
pager: true,
pagerType: "short",
})(jQuery);
});
|
( function( $ ) {
"use strict";
var jvfrm_home_wgfi = function( o ) {
this.options = $.extend( true, {}, {
rating:{
container : '.javo-rating-registed-score'
, starOff : '../images/star-off-s.png'
, starOn : '../images/star-on-s.png'
, starHalf : '../images/star-half-s.png'
}
}, o );
if( ! window.__JAVO_WGFI__ ) {
window.__JAVO_WGFI__ = true;
this.init();
}
}
jvfrm_home_wgfi.prototype = {
constructor : jvfrm_home_wgfi
, init : function()
{
// Set Rating
this.setRating();
}
, setRating : function()
{
var opt = this.options.rating;
$( opt.container ).each( function( k, v)
{
$(this).raty({
starOff : opt.starOff
, starOn : opt.starOn
, starHalf : opt.starHalf
, half : true
, readOnly : true
, score : $(this).data('score')
}).css('width', '');
});
}
}
window.jvfrm_home_wgfi = jvfrm_home_wgfi;
} )( jQuery );
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from 'react';
import withIcon from '../withIcon';
function IconSearch(props) {
return React.createElement("svg", _extends({
viewBox: "0 0 24 24"
}, props), React.createElement("path", {
d: "M15.977 14.472h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0s.41-1.08 0-1.49zm-6 0c-2.49 0-4.5-2.01-4.5-4.5s2.01-4.5 4.5-4.5 4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5z"
}));
}
export default withIcon('IconSearch')(IconSearch);
|
import React from 'react';
import HeaderContainer from "./container";
const HeaderTwo = () => {
const openSideMenu = ()=>{
const sideMenuWrap = document.querySelector(".side-header");
const overlay = document.querySelector('.side-menu-overlay');
sideMenuWrap.classList.add('side-menu-open');
overlay.classList.add('overlay-show');
};
return (
<HeaderContainer classes={'d-lg-none'}>
<div className="header-logo mt-40 mb-40 col">
</div>
<div className="header-toggle-btn col">
<button className="side-header-toggle" onClick={()=> openSideMenu()}><span/></button>
</div>
</HeaderContainer>
);
};
export default HeaderTwo;
|
Nova.booting((Vue, router, store) => {
const listeners = []
function navigateToResource(event) {
const path = event.path || ( event.composedPath && event.composedPath() )
const intersectsWithIgnoredElements = path.some(path =>
path instanceof HTMLAnchorElement ||
path instanceof HTMLInputElement ||
path instanceof HTMLButtonElement ||
path instanceof SVGElement)
/**
* Avoid following click when clicking on A tags or when selecting text
*/
if (!intersectsWithIgnoredElements && window.getSelection().toString() === '') {
const selector = 'a[dusk$="-' + ( event.altKey ? 'edit' : 'view' ) + '-button"]'
const viewElement = this.parentNode.querySelector(selector)
if (viewElement) {
viewElement.click()
}
}
}
Nova.$on('resources-loaded', () => {
while (listeners.length) {
listeners.pop().removeEventListener('click', navigateToResource)
}
Vue.nextTick(() => {
const viewElement = document.querySelector('a[dusk$="-view-button"]')
if (viewElement) {
const columns = document.querySelectorAll('table[data-testid="resource-table"] tr[dusk$="-row"] td')
for (const column of columns) {
if (column.querySelector('.vue-js-switch') || column.querySelector('.trigger')) {
continue;
}
column.style.cursor = 'pointer'
column.addEventListener('click', navigateToResource)
listeners.push(column)
}
}
})
})
})
|
const set = require('regenerate')();set.addRange(0x531, 0x556).addRange(0x559, 0x58A).addRange(0x58D, 0x58F).addRange(0xFB13, 0xFB17);
module.exports = set;
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
require("../../../src/components/VColorPicker/VColorPickerSwatches.sass");
var _VIcon = _interopRequireDefault(require("../VIcon"));
var _colors = _interopRequireDefault(require("../../util/colors"));
var _util = require("./util");
var _helpers = require("../../util/helpers");
var _mixins = _interopRequireDefault(require("../../util/mixins"));
var _themeable = _interopRequireDefault(require("../../mixins/themeable"));
var _colorUtils = require("../../util/colorUtils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Styles
// Components
// Helpers
function parseDefaultColors(colors) {
return Object.keys(colors).map(function (key) {
var color = colors[key];
return color.base ? [color.base, color.darken4, color.darken3, color.darken2, color.darken1, color.lighten1, color.lighten2, color.lighten3, color.lighten4, color.lighten5] : [color.black, color.white, color.transparent];
});
}
var white = (0, _util.fromHex)('#FFFFFF').rgba;
var black = (0, _util.fromHex)('#000000').rgba;
var _default2 = (0, _mixins.default)(_themeable.default).extend({
name: 'v-color-picker-swatches',
props: {
swatches: {
type: Array,
default: function _default() {
return parseDefaultColors(_colors.default);
}
},
color: Object,
maxWidth: [Number, String],
maxHeight: [Number, String]
},
methods: {
genColor: function genColor(color) {
var _this = this;
var content = this.$createElement('div', {
style: {
background: color
}
}, [(0, _helpers.deepEqual)(this.color, (0, _util.parseColor)(color, null)) && this.$createElement(_VIcon.default, {
props: {
small: true,
dark: (0, _colorUtils.contrastRatio)(this.color.rgba, white) > 2 && this.color.alpha > 0.5,
light: (0, _colorUtils.contrastRatio)(this.color.rgba, black) > 2 && this.color.alpha > 0.5
}
}, '$success')]);
return this.$createElement('div', {
staticClass: 'v-color-picker__color',
on: {
// TODO: Less hacky way of catching transparent
click: function click() {
return _this.$emit('update:color', (0, _util.fromHex)(color === 'transparent' ? '#00000000' : color));
}
}
}, [content]);
},
genSwatches: function genSwatches() {
var _this2 = this;
return this.swatches.map(function (swatch) {
var colors = swatch.map(_this2.genColor);
return _this2.$createElement('div', {
staticClass: 'v-color-picker__swatch'
}, colors);
});
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-color-picker__swatches',
style: {
maxWidth: (0, _helpers.convertToUnit)(this.maxWidth),
maxHeight: (0, _helpers.convertToUnit)(this.maxHeight)
}
}, [this.$createElement('div', this.genSwatches())]);
}
});
exports.default = _default2;
//# sourceMappingURL=VColorPickerSwatches.js.map
|
// Regular expression that matches all symbols in the `Cuneiform` script as per Unicode v6.0.0:
/\uD809[\uDC00-\uDC62\uDC70-\uDC73]|\uD808[\uDC00-\uDF6E]/;
|
/*
* ! SAPUI5
(c) Copyright 2009-2020 SAP SE. All rights reserved
*/
sap.ui.define(["sap/ui/comp/designtime/smartform/GroupElement.designtime"],function(G){"use strict";return{name:{singular:"GROUP_CONTROL_NAME",plural:"GROUP_CONTROL_NAME_PLURAL"},isVisible:function(g){return g.isVisible();},aggregations:{title:{ignore:true},groupElements:{ignore:true},formElements:{domRef:":sap-domref",childNames:{singular:"FIELD_CONTROL_NAME",plural:"FIELD_CONTROL_NAME_PLURAL"},actions:{move:{changeType:"moveControls"},addODataProperty:{changeType:"addFields",filter:function(r,o){var i=r.getMetadata().getName()==="sap.ui.comp.smartform.SmartForm"?r.getIgnoredFields():"";return i.indexOf(o.name)===-1;}}}}},actions:{rename:{changeType:"renameGroup",isEnabled:function(g){return!g.getExpandable();},domRef:function(c){var t=c.getTitle&&c.getTitle();if(t&&t.getDomRef){return t.getDomRef();}else{return(c.getId()+"--title"?window.document.getElementById(c.getId()+"--title"):null);}}},remove:{changeType:"hideControl",getConfirmationText:function(g){var t=sap.ui.getCore().getLibraryResourceBundle("sap.ui.comp.designtime");var m=[];g.getGroupElements().forEach(function(o){if(o.getVisible()&&G.functions.hasMandatoryFields(o)){var s=o.getLabelText()||o.getId();m.push(s);}});if(m.length){var f="\n\u2003\u2003\u2022\u2004 ";var M="";m.forEach(function(o){M+=f+o;});return t.getText("GROUP_DESIGN_TIME_REMOVE_GROUP_WITH_MANDATORY_FIELDS_MESSAGE",M);}}}},properties:{useHorizontalLayout:{ignore:true},horizontalLayoutGroupElementMinWidth:{ignore:true},label:{ignore:false}}};},true);
|
"use strict";
/**
* @module botbuilder
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const transcriptLogger_1 = require("./transcriptLogger");
/**
* The memory transcript store stores transcripts in volatile memory in a Map.
* Because this uses an unbounded volitile dictionary this should only be used for unit tests or non-production environments.
*/
class MemoryTranscriptStore {
constructor() {
this.channels = new Map();
}
/**
* Log an activity to the transcript.
* @param activity Activity to log.
*/
logActivity(activity) {
if (!activity) {
throw new Error("activity cannot be null for logActivity()");
}
// get channel
let channel;
if (!this.channels.has(activity.channelId)) {
channel = new Map();
this.channels.set(activity.channelId, channel);
}
else {
channel = this.channels.get(activity.channelId);
}
// get conversation transcript
let transcript;
if (!channel.has(activity.conversation.id)) {
transcript = [];
channel.set(activity.conversation.id, transcript);
}
else {
transcript = channel.get(activity.conversation.id);
}
transcript.push(activity);
return Promise.resolve();
}
/**
* Get activities from the memory transcript store
* @param channelId Channel Id.
* @param conversationId Conversation Id.
* @param continuationToken Continuatuation token to page through results.
* @param startDate Earliest time to include.
*/
getTranscriptActivities(channelId, conversationId, continuationToken, startDate) {
if (!channelId)
throw new Error('Missing channelId');
if (!conversationId)
throw new Error('Missing conversationId');
let pagedResult = new transcriptLogger_1.PagedResult();
if (this.channels.has(channelId)) {
let channel = this.channels.get(channelId);
if (channel.has(conversationId)) {
let transcript = channel.get(conversationId);
if (continuationToken) {
pagedResult.items = transcript
.sort(timestampSorter)
.filter(a => !startDate || a.timestamp >= startDate)
.filter(skipWhileExpression(a => a.id !== continuationToken))
.slice(1, MemoryTranscriptStore.PageSize + 1);
}
else {
pagedResult.items = transcript
.sort(timestampSorter)
.filter(a => !startDate || a.timestamp >= startDate)
.slice(0, MemoryTranscriptStore.PageSize);
}
if (pagedResult.items.length == MemoryTranscriptStore.PageSize) {
pagedResult.continuationToken = pagedResult.items[pagedResult.items.length - 1].id;
}
}
}
return Promise.resolve(pagedResult);
}
/**
* List conversations in the channelId.
* @param channelId Channel Id.
* @param continuationToken Continuatuation token to page through results.
*/
listTranscripts(channelId, continuationToken) {
if (!channelId)
throw new Error('Missing channelId');
let pagedResult = new transcriptLogger_1.PagedResult();
if (this.channels.has(channelId)) {
let channel = this.channels.get(channelId);
if (continuationToken) {
pagedResult.items = Array.from(channel.entries()).map(kv => ({
channelId,
id: kv[0],
created: getDate(kv[1])
})).sort(createdSorter)
.filter(skipWhileExpression(a => a.id !== continuationToken))
.slice(1, MemoryTranscriptStore.PageSize + 1);
}
else {
pagedResult.items = Array.from(channel.entries()).map(kv => ({
channelId,
id: kv[0],
created: getDate(kv[1])
})).sort(createdSorter)
.slice(0, MemoryTranscriptStore.PageSize);
}
if (pagedResult.items.length == MemoryTranscriptStore.PageSize) {
pagedResult.continuationToken = pagedResult.items[pagedResult.items.length - 1].id;
}
}
return Promise.resolve(pagedResult);
}
/**
* Delete a specific conversation and all of it's activities.
* @param channelId Channel Id where conversation took place.
* @param conversationId Id of the conversation to delete.
*/
deleteTranscript(channelId, conversationId) {
if (!channelId)
throw new Error('Missing channelId');
if (!conversationId)
throw new Error('Missing conversationId');
if (this.channels.has(channelId)) {
var channel = this.channels.get(channelId);
if (channel.has(conversationId)) {
channel.delete(conversationId);
}
}
return Promise.resolve();
}
}
MemoryTranscriptStore.PageSize = 20;
exports.MemoryTranscriptStore = MemoryTranscriptStore;
/**
* @private
* @param a
* @param b
*/
const createdSorter = (a, b) => a.created.getTime() - b.created.getTime();
/**
* @private
* @param a
* @param b
*/
const timestampSorter = (a, b) => a.timestamp.getTime() - b.timestamp.getTime();
/**
* @private
* @param expression
*/
const skipWhileExpression = (expression) => {
let skipping = true;
return (item) => {
if (!skipping)
return true;
if (!expression(item)) {
skipping = false;
}
return !skipping;
};
};
/**
* @private
* @param activities
*/
const getDate = (activities) => {
if (activities && activities.length > 0) {
return activities[0].timestamp || new Date(0);
}
return new Date(0);
};
//# sourceMappingURL=memoryTranscriptStore.js.map
|
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var abstract_component_1 = require("./abstract-component");
var AbstractViewPort = (function (_super) {
__extends(AbstractViewPort, _super);
function AbstractViewPort() {
return _super !== null && _super.apply(this, arguments) || this;
}
AbstractViewPort.prototype.canActivate = function (params, routeConfig, navigationInstruction) {
return Promise.resolve(true);
};
AbstractViewPort.prototype.activate = function (params, routeConfig, navigationInstruction) {
return Promise.resolve();
};
AbstractViewPort.prototype.canDeactivate = function () {
return Promise.resolve(true);
};
AbstractViewPort.prototype.deactivate = function () {
return Promise.resolve();
};
return AbstractViewPort;
}(abstract_component_1.AbstractComponent));
exports.AbstractViewPort = AbstractViewPort;
//# sourceMappingURL=abstract-view-port.js.map
|
!function(){obj[1/0]=20}()
|
!function(t){t.fn.twentytwenty=function(e){e=t.extend({default_offset_pct:.5,orientation:"horizontal",before_label:"Before",after_label:"After",no_overlay:!1,move_slider_on_hover:!1,move_with_handle_only:!0,click_to_move:!1},e);return this.each(function(){var n=e.default_offset_pct,a=t(this),i=e.orientation,o="vertical"===i?"down":"left",s="vertical"===i?"up":"right";if(a.wrap("<div class='twentytwenty-wrapper twentytwenty-"+i+"'></div>"),!e.no_overlay){a.append("<div class='twentytwenty-overlay'></div>");var r=a.find(".twentytwenty-overlay");r.append("<div class='twentytwenty-before-label' data-content='"+e.before_label+"'></div>"),r.append("<div class='twentytwenty-after-label' data-content='"+e.after_label+"'></div>")}var c=a.find("img:first"),l=a.find("img:last");a.append("<div class='twentytwenty-handle'></div>");var d=a.find(".twentytwenty-handle");d.append("<span class='twentytwenty-"+o+"-arrow'></span>"),d.append("<span class='twentytwenty-"+s+"-arrow'></span>"),a.addClass("twentytwenty-container"),c.addClass("twentytwenty-before"),l.addClass("twentytwenty-after");var w=function(t){var e,n,o,s=(e=t,n=c.width(),o=c.height(),{w:n+"px",h:o+"px",cw:e*n+"px",ch:e*o+"px"});d.css("vertical"===i?"top":"left","vertical"===i?s.ch:s.cw),function(t){"vertical"===i?(c.css("clip","rect(0,"+t.w+","+t.ch+",0)"),l.css("clip","rect("+t.ch+","+t.w+","+t.h+",0)")):(c.css("clip","rect(0,"+t.cw+","+t.h+",0)"),l.css("clip","rect(0,"+t.w+","+t.h+","+t.cw+")")),a.css("height",t.h)}(s)},f=function(t,e){var n,a,o;return n="vertical"===i?(e-p)/h:(t-v)/y,a=0,o=1,Math.max(a,Math.min(o,n))};t(window).on("resize.twentytwenty",function(t){w(n)});var v=0,p=0,y=0,h=0,u=function(t){(t.distX>t.distY&&t.distX<-t.distY||t.distX<t.distY&&t.distX>-t.distY)&&"vertical"!==i?t.preventDefault():(t.distX<t.distY&&t.distX<-t.distY||t.distX>t.distY&&t.distX>-t.distY)&&"vertical"===i&&t.preventDefault(),a.addClass("active"),v=a.offset().left,p=a.offset().top,y=c.width(),h=c.height()},_=function(t){a.hasClass("active")&&(n=f(t.pageX,t.pageY),w(n))},m=function(){a.removeClass("active")},g=e.move_with_handle_only?d:a;g.on("movestart",u),g.on("move",_),g.on("moveend",m),e.move_slider_on_hover&&(a.on("mouseenter",u),a.on("mousemove",_),a.on("mouseleave",m)),d.on("touchmove",function(t){t.preventDefault()}),a.find("img").on("mousedown",function(t){t.preventDefault()}),e.click_to_move&&a.on("click",function(t){v=a.offset().left,p=a.offset().top,y=c.width(),h=c.height(),n=f(t.pageX,t.pageY),w(n)}),t(window).trigger("resize.twentytwenty")})}}(jQuery);
|
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { uploadClass } from '../styles'
import Progress from '../Progress'
import Spin from '../Spin'
import icons from '../icons'
import { ERROR, UPLOADING } from './request'
const SPIN = (
<span style={{ display: 'inline-block', marginRight: 8 }}>
<Spin size={10} name="ring" />
</span>
)
class File extends PureComponent {
constructor(props) {
super(props)
this.handleRemove = this.handleRemove.bind(this)
}
handleRemove() {
this.props.onRemove(this.props.id)
}
render() {
const { message, name, status, process } = this.props
const className = uploadClass('view-file', status === ERROR && 'error')
return (
<div className={className}>
<div className={uploadClass('text')}>
{status === UPLOADING && SPIN} {name} {message && <span>({message})</span>}
</div>
<a className={uploadClass('delete')} onClick={this.handleRemove}>
{icons.Close}
</a>
{status !== ERROR && (
<Progress
className={uploadClass('progress')}
background={process >= 0 ? '#e9ecef' : 'transparent'}
value={process}
strokeWidth={2}
/>
)}
</div>
)
}
}
File.propTypes = {
id: PropTypes.string,
message: PropTypes.string,
name: PropTypes.string,
onRemove: PropTypes.func,
process: PropTypes.number,
status: PropTypes.number,
}
export default File
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WriteFilePlugin = require('write-file-webpack-plugin');
const autoprefixer = require('autoprefixer');
const path = require('path');
module.exports = {
entry: {
app: './src/index.js',
404: './src/404.js'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
options: { minimize: true }
}
]
},
{
test: /\.(scss|css)$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader'
},
{
loader: 'postcss-loader',
options: {
autoprefixer: {
browsers: ['last 2 versions']
},
plugins: () => [autoprefixer]
}
},
{
loader: 'sass-loader'
}
]
}
]
},
plugins: [new MiniCssExtractPlugin(), new WriteFilePlugin()]
};
|
var class_tempo_test_1_1_test_ref_counted =
[
[ "TestRefCounted", "class_tempo_test_1_1_test_ref_counted.html#a249937e81d0ed10e75211d776cbd702e", null ],
[ "Destroy", "class_tempo_test_1_1_test_ref_counted.html#ada93c5e5180bfec8d9a99251d3049493", null ]
];
|
/*!
* tablesort v5.1.0 (2018-09-14)
* http://tristen.ca/tablesort/demo/
* Copyright (c) 2018 ; Licensed MIT
*/
!function(){var a=function(a){return a.replace(/[^\-?0-9.]/g,"")},b=function(a,b){return a=parseFloat(a),b=parseFloat(b),a=isNaN(a)?0:a,b=isNaN(b)?0:b,a-b};Tablesort.extend("number",function(a){return a.match(/^[-+]?[£\x24Û¢´€]?\d+\s*([,\.]\d{0,2})/)||a.match(/^[-+]?\d+\s*([,\.]\d{0,2})?[£\x24Û¢´€]/)||a.match(/^[-+]?(\d)*-?([,\.]){0,1}-?(\d)+([E,e][\-+][\d]+)?%?$/)},function(c,d){return c=a(c),d=a(d),b(d,c)})}();
|
var m = require('mithril');
module.exports = m.trust('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="24" height="24" viewBox="0 0 24.00 24.00" enable-background="new 0 0 24.00 24.00" xml:space="preserve"><path fill="#000000" fill-opacity="1" stroke-width="1.33333" stroke-linejoin="miter" d="M 3.16336,10L 12,21.4837L 2.31539,14.2956C 2.04758,14.0948 1.93601,13.7489 2.03644,13.4365L 3.16336,10 Z M 6.10887,3.17167C 5.98614,2.82581 5.49524,2.82581 5.3725,3.17167L 3.16336,10L 8.31809,10L 6.10887,3.17167 Z M 8.31809,10L 12,21.4837L 15.6819,10L 8.31809,10 Z M 21.9636,13.4365L 20.8367,10L 12,21.4837L 21.6846,14.2956C 21.9524,14.0948 22.064,13.7489 21.9636,13.4365 Z M 18.6275,3.17167C 18.5047,2.82581 18.0138,2.82581 17.8911,3.17167L 15.6819,10L 20.8367,10L 18.6275,3.17167 Z "/></svg>');
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
import React, { useState } from 'react';
import Box from '../Box';
var useHiddenState = function useHiddenState() {
var _useState = useState(false),
_useState2 = _slicedToArray(_useState, 2),
visible = _useState2[0],
setIsVisible = _useState2[1];
var toggle = function toggle() {
setIsVisible(!visible);
};
return {
visible: visible,
toggle: toggle
};
};
var Hidden = function Hidden(_ref) {
var children = _ref.children,
visible = _ref.visible;
return React.createElement(Box, {
display: !visible ? 'none' : null,
children: children
});
};
export { useHiddenState };
export default Hidden;
|
import dagre from 'dagre';
import debug from 'debug';
import { fromJS, Map as makeMap, Set as ImmSet } from 'immutable';
import { EDGE_ID_SEPARATOR } from '../constants/naming';
import { buildTopologyCacheId, updateNodeDegrees } from '../utils/topology-utils';
const log = debug('scope:nodes-layout');
const topologyCaches = {};
const DEFAULT_WIDTH = 800;
const DEFAULT_MARGINS = {top: 0, left: 0};
const DEFAULT_SCALE = val => val * 2;
const NODE_SIZE_FACTOR = 1;
const NODE_SEPARATION_FACTOR = 3.0;
const RANK_SEPARATION_FACTOR = 2.5;
let layoutRuns = 0;
let layoutRunsTrivial = 0;
function graphNodeId(id) {
return id.replace('.', '<DOT>');
}
function fromGraphNodeId(encodedId) {
return encodedId.replace('<DOT>', '.');
}
/**
* Layout engine runner
* After the layout engine run nodes and edges have x-y-coordinates. Engine is
* not run if the number of nodes is bigger than `MAX_NODES`.
* @param {Object} graph dagre graph instance
* @param {Map} imNodes new node set
* @param {Map} imEdges new edge set
* @param {Object} opts dimensions, scales, etc.
* @return {Object} Layout with nodes, edges, dimensions
*/
function runLayoutEngine(graph, imNodes, imEdges, opts) {
let nodes = imNodes;
let edges = imEdges;
const options = opts || {};
const scale = options.scale || DEFAULT_SCALE;
const ranksep = scale(RANK_SEPARATION_FACTOR);
const nodesep = scale(NODE_SEPARATION_FACTOR);
const nodeWidth = scale(NODE_SIZE_FACTOR);
const nodeHeight = scale(NODE_SIZE_FACTOR);
// configure node margins
graph.setGraph({
nodesep,
ranksep
});
// add nodes to the graph if not already there
nodes.forEach(node => {
const gNodeId = graphNodeId(node.get('id'));
if (!graph.hasNode(gNodeId)) {
graph.setNode(gNodeId, {
width: nodeWidth,
height: nodeHeight
});
}
});
// remove nodes that are no longer there or are 0-degree nodes
graph.nodes().forEach(gNodeId => {
const nodeId = fromGraphNodeId(gNodeId);
if (!nodes.has(nodeId) || nodes.get(nodeId).get('degree') === 0) {
graph.removeNode(gNodeId);
}
});
// add edges to the graph if not already there
edges.forEach(edge => {
const s = graphNodeId(edge.get('source'));
const t = graphNodeId(edge.get('target'));
if (!graph.hasEdge(s, t)) {
const virtualNodes = s === t ? 1 : 0;
graph.setEdge(s, t, {id: edge.get('id'), minlen: virtualNodes});
}
});
// remove edges that are no longer there
graph.edges().forEach(edgeObj => {
const edge = [fromGraphNodeId(edgeObj.v), fromGraphNodeId(edgeObj.w)];
const edgeId = edge.join(EDGE_ID_SEPARATOR);
if (!edges.has(edgeId)) {
graph.removeEdge(edgeObj.v, edgeObj.w);
}
});
dagre.layout(graph);
const layout = graph.graph();
// apply coordinates to nodes and edges
graph.nodes().forEach(gNodeId => {
const graphNode = graph.node(gNodeId);
const nodeId = fromGraphNodeId(gNodeId);
nodes = nodes.setIn([nodeId, 'x'], graphNode.x);
nodes = nodes.setIn([nodeId, 'y'], graphNode.y);
});
graph.edges().forEach(graphEdge => {
const graphEdgeMeta = graph.edge(graphEdge);
const edge = edges.get(graphEdgeMeta.id);
let points = fromJS(graphEdgeMeta.points);
// set beginning and end points to node coordinates to ignore node bounding box
const source = nodes.get(fromGraphNodeId(edge.get('source')));
const target = nodes.get(fromGraphNodeId(edge.get('target')));
points = points.mergeIn([0], {x: source.get('x'), y: source.get('y')});
points = points.mergeIn([points.size - 1], {x: target.get('x'), y: target.get('y')});
edges = edges.setIn([graphEdgeMeta.id, 'points'], points);
});
// return object with the width and height of layout
return {
width: layout.width,
height: layout.height,
nodes,
edges
};
}
/**
* Add coordinates to 0-degree nodes using a square layout
* Depending on the previous layout run's graph aspect ratio, the square will be
* placed on the right side or below the graph.
* @param {Object} layout Layout with nodes and edges
* @param {Object} opts Options with node distances
* @return {Object} modified layout
*/
function layoutSingleNodes(layout, opts) {
const result = Object.assign({}, layout);
const options = opts || {};
const margins = options.margins || DEFAULT_MARGINS;
const scale = options.scale || DEFAULT_SCALE;
const ranksep = scale(RANK_SEPARATION_FACTOR) / 2; // dagre splits it in half
const nodesep = scale(NODE_SEPARATION_FACTOR);
const nodeWidth = scale(NODE_SIZE_FACTOR);
const nodeHeight = scale(NODE_SIZE_FACTOR);
const aspectRatio = layout.height ? layout.width / layout.height : 1;
let nodes = layout.nodes;
// 0-degree nodes
const singleNodes = nodes.filter(node => node.get('degree') === 0);
if (singleNodes.size) {
let offsetX;
let offsetY;
const nonSingleNodes = nodes.filter(node => node.get('degree') !== 0);
if (nonSingleNodes.size > 0) {
if (aspectRatio < 1) {
log('laying out single nodes to the right', aspectRatio);
offsetX = nonSingleNodes.maxBy(node => node.get('x')).get('x');
offsetY = nonSingleNodes.minBy(node => node.get('y')).get('y');
if (offsetX) {
offsetX += nodeWidth + nodesep;
}
} else {
log('laying out single nodes below', aspectRatio);
offsetX = nonSingleNodes.minBy(node => node.get('x')).get('x');
offsetY = nonSingleNodes.maxBy(node => node.get('y')).get('y');
if (offsetY) {
offsetY += nodeHeight + ranksep;
}
}
}
// default margins
offsetX = offsetX || margins.left + nodeWidth / 2;
offsetY = offsetY || margins.top + nodeHeight / 2;
const columns = Math.ceil(Math.sqrt(singleNodes.size));
let row = 0;
let col = 0;
let singleX;
let singleY;
nodes = nodes.sortBy(node => node.get('rank')).map(node => {
if (singleNodes.has(node.get('id'))) {
if (col === columns) {
col = 0;
row++;
}
singleX = col * (nodesep + nodeWidth) + offsetX;
singleY = row * (ranksep + nodeHeight) + offsetY;
col++;
return node.merge({
x: singleX,
y: singleY
});
}
return node;
});
// adjust layout dimensions if graph is now bigger
result.width = Math.max(layout.width, singleX + nodeWidth / 2 + nodesep);
result.height = Math.max(layout.height, singleY + nodeHeight / 2 + ranksep);
result.nodes = nodes;
}
return result;
}
/**
* Shifts all coordinates of node and edge points to make the layout more centered
* @param {Object} layout Layout
* @param {Object} opts Options with width and margins
* @return {Object} modified layout
*/
function shiftLayoutToCenter(layout, opts) {
const result = Object.assign({}, layout);
const options = opts || {};
const margins = options.margins || DEFAULT_MARGINS;
const width = options.width || DEFAULT_WIDTH;
const height = options.height || width / 2;
let offsetX = 0 + margins.left;
let offsetY = 0 + margins.top;
if (layout.width < width) {
offsetX = (width - layout.width) / 2 + margins.left;
}
if (layout.height < height) {
offsetY = (height - layout.height) / 2 + margins.top;
}
result.nodes = layout.nodes.map(node => node.merge({
x: node.get('x') + offsetX,
y: node.get('y') + offsetY
}));
result.edges = layout.edges.map(edge => edge.update('points',
points => points.map(point => point.merge({
x: point.get('x') + offsetX,
y: point.get('y') + offsetY
}))
));
return result;
}
/**
* Adds `points` array to edge based on location of source and target
* @param {Map} edge new edge
* @param {Map} nodeCache all nodes
* @returns {Map} modified edge
*/
function setSimpleEdgePoints(edge, nodeCache) {
const source = nodeCache.get(edge.get('source'));
const target = nodeCache.get(edge.get('target'));
return edge.set('points', fromJS([
{x: source.get('x'), y: source.get('y')},
{x: target.get('x'), y: target.get('y')}
]));
}
/**
* Determine if nodes were added between node sets
* @param {Map} nodes new Map of nodes
* @param {Map} cache old Map of nodes
* @return {Boolean} True if nodes had node ids that are not in cache
*/
export function hasUnseenNodes(nodes, cache) {
const hasUnseen = nodes.size > cache.size
|| !ImmSet.fromKeys(nodes).isSubset(ImmSet.fromKeys(cache));
if (hasUnseen) {
log('unseen nodes:', ...ImmSet.fromKeys(nodes).subtract(ImmSet.fromKeys(cache)).toJS());
}
return hasUnseen;
}
/**
* Determine if edge has same endpoints in new nodes as well as in the nodeCache
* @param {Map} edge Edge with source and target
* @param {Map} nodes new node set
* @return {Boolean} True if old and new endpoints have same coordinates
*/
function hasSameEndpoints(cachedEdge, nodes) {
const oldPoints = cachedEdge.get('points');
const oldSourcePoint = oldPoints.first();
const oldTargetPoint = oldPoints.last();
const newSource = nodes.get(cachedEdge.get('source'));
const newTarget = nodes.get(cachedEdge.get('target'));
return (oldSourcePoint && oldTargetPoint && newSource && newTarget
&& oldSourcePoint.get('x') === newSource.get('x')
&& oldSourcePoint.get('y') === newSource.get('y')
&& oldTargetPoint.get('x') === newTarget.get('x')
&& oldTargetPoint.get('y') === newTarget.get('y'));
}
/**
* Clones a previous layout
* @param {Object} layout Layout object
* @param {Map} nodes new nodes
* @param {Map} edges new edges
* @return {Object} layout clone
*/
function cloneLayout(layout, nodes, edges) {
const clone = Object.assign({}, layout, {nodes, edges});
return clone;
}
/**
* Copies node properties from previous layout runs to new nodes.
* This assumes the cache has data for all new nodes.
* @param {Object} layout Layout
* @param {Object} nodeCache cache of all old nodes
* @param {Object} edgeCache cache of all old edges
* @return {Object} modified layout
*/
function copyLayoutProperties(layout, nodeCache, edgeCache) {
const result = Object.assign({}, layout);
result.nodes = layout.nodes.map(node => node.merge(nodeCache.get(node.get('id'))));
result.edges = layout.edges.map(edge => {
if (edgeCache.has(edge.get('id'))
&& hasSameEndpoints(edgeCache.get(edge.get('id')), result.nodes)) {
return edge.merge(edgeCache.get(edge.get('id')));
}
return setSimpleEdgePoints(edge, nodeCache);
});
return result;
}
/**
* Layout of nodes and edges
* If a previous layout was given and not too much changed, the previous layout
* is changed and returned. Otherwise does a new layout engine run.
* @param {Map} immNodes All nodes
* @param {Map} immEdges All edges
* @param {object} opts width, height, margins, etc...
* @return {object} graph object with nodes, edges, dimensions
*/
export function doLayout(immNodes, immEdges, opts) {
const options = opts || {};
const cacheId = buildTopologyCacheId(options.topologyId, options.topologyOptions);
// one engine and node and edge caches per topology, to keep renderings similar
if (!topologyCaches[cacheId]) {
topologyCaches[cacheId] = {
nodeCache: makeMap(),
edgeCache: makeMap(),
graph: new dagre.graphlib.Graph({})
};
}
const cache = topologyCaches[cacheId];
const cachedLayout = options.cachedLayout || cache.cachedLayout;
const nodeCache = options.nodeCache || cache.nodeCache;
const edgeCache = options.edgeCache || cache.edgeCache;
let layout;
++layoutRuns;
if (!options.forceRelayout && cachedLayout && nodeCache && edgeCache
&& !hasUnseenNodes(immNodes, nodeCache)) {
log('skip layout, trivial adjustment', ++layoutRunsTrivial, layoutRuns);
layout = cloneLayout(cachedLayout, immNodes, immEdges);
// copy old properties, works also if nodes get re-added
layout = copyLayoutProperties(layout, nodeCache, edgeCache);
} else {
const graph = cache.graph;
const nodesWithDegrees = updateNodeDegrees(immNodes, immEdges);
layout = runLayoutEngine(graph, nodesWithDegrees, immEdges, opts);
if (!layout) {
return layout;
}
layout = layoutSingleNodes(layout, opts);
layout = shiftLayoutToCenter(layout, opts);
}
// cache results
if (layout) {
cache.cachedLayout = layout;
cache.nodeCache = cache.nodeCache.merge(layout.nodes);
cache.edgeCache = cache.edgeCache.merge(layout.edges);
}
return layout;
}
|
import { NotImplementedError } from '../extensions/index.js';
export default function encodeLine(str) {
let res = '';
let counter = 1;
for (let i = 0; i < str.length; i++) {
if (str[i] === str[i + 1]) {
counter++;
} else if (counter === 1) {
res += `${str[i]}`;
} else {
res += `${counter}${str[i]}`;
counter = 1;
}
} return res;
}
|
import React, { useState, useEffect } from 'react';
import { BreadcrumbBack, FormInput, SingleDetail } from 'components';
import useStyles from './style';
import { Grid } from '@material-ui/core';
import contractor from 'apis/contractor';
import { useToasts } from 'react-toast-notifications';
const ContractorCreate = props => {
const { children, history } = props;
const classes = useStyles();
const { addToast } = useToasts()
const breadcrumb = ['Monitorowanie poziomu zapasów', 'Magazyny', 'Dodaj nowy/Edytuj'];
const [data, setData] = useState({});
const [error, setError] = useState({postal_code: false})
const handleValidate = () => {
if (!data.postal_code || !data.postal_code.match(/^[0-9][0-9]-[0-9][0-9][0-9]$/)) {
setData({ ...data, ['postal_code']: ''});
setError({...error, ['postal_code']: true});
return false;
} else {
setError({...error, ['postal_code']: false});
return true;
}
}
const handleSave = () => {
if (!handleValidate()) {
addToast('Wprowadzono błędny kod pocztowy', { appearance: 'error', autoDismissTimeout: 5000, autoDismiss: true })
} else
contractor
.create(data)
.then(response => {
if (response.code === 401) {
addToast(response.message, { appearance: 'error', autoDismissTimeout: 3000, autoDismiss: true })
setTimeout(function () { history.push('/login') }, 3000);
} else {
if (response.code === 200) {
addToast(response.message, { appearance: 'success', autoDismissTimeout: 1000, autoDismiss: true })
setTimeout(function () { history.push('/contractor') }, 1000);
} else {
addToast(response.message, { appearance: 'error', autoDismissTimeout: 3000, autoDismiss: true })
}
}
})
}
const handleChange = (name, value) => {
setData({ ...data, [name]: value });
}
return (
<>
<BreadcrumbBack list={breadcrumb} back_url="/contractor" />
<SingleDetail title="Dane dotyczące kontrahenta" handleSave={handleSave}>
<React.Fragment>
<FormInput title="Nazwa kontrahenta" name="name" type="input" value={data.name} handleChange={handleChange} />
<Grid container spacing={2}>
<Grid item xs={6}>
<FormInput title="Kod" name="code" type="input" value={data.code} handleChange={handleChange} />
</Grid>
<Grid item xs={6}>
<FormInput title="GLN" name="GLN" type="input" value={data.GLN} handleChange={handleChange} />
</Grid>
</Grid>
<FormInput title="Aktywny" name="active" type="check_box" value={data.active} handleChange={handleChange} />
<FormInput title="Dostawca" name="supplier" type="check_box" value={data.supplier} handleChange={handleChange} />
<FormInput title="Odbiorca" name="recipient" type="check_box" value={data.recipient} handleChange={handleChange} />
<Grid container spacing={2}>
<Grid item xs={5}>
<FormInput title="Ulica, numer budynku i lokalu" name="address" type="input" value={data.address} handleChange={handleChange} />
</Grid>
<Grid item xs={3}>
<FormInput title="Kod pocztowy" name="postal_code" type="postal_code" value={data.postal_code} error={error.postal_code} handleChange={handleChange} />
</Grid>
<Grid item xs={4}>
<FormInput title="Miejscowość" name="city" type="input" value={data.city} handleChange={handleChange} />
</Grid>
</Grid>
<Grid container spacing={2}>
<Grid item xs={6}>
<FormInput title="Czas realizacji zamówienia [dni]" name="order_fulfillment_time" type="number" value={data.order_fulfillment_time} handleChange={handleChange} />
</Grid>
<Grid item xs={6}>
<FormInput title="Odchylenie czasu realizacji [dni]" name="delivery_time_deviation" type="number" value={data.delivery_time_deviation} handleChange={handleChange} />
</Grid>
</Grid>
<Grid container spacing={2}>
<Grid item xs={6}>
<FormInput title="Minimalna wielkość zamówienia" name="minimum_order_quantity" type="number" value={data.minimum_order_quantity} handleChange={handleChange} />
</Grid>
<Grid item xs={6}>
<FormInput title="Minimalna wartość zamówienia [PLN] " name="minimum_order_value" type="number" value={data.minimum_order_value} handleChange={handleChange} />
</Grid>
</Grid>
<FormInput title="Opis" name="description" type="area" value={data.description} handleChange={handleChange} />
<FormInput title="Dostawca pokrywa koszt transportu" name="supplier_transport" type="check_box" value={data.supplier_transport} handleChange={handleChange} />
</React.Fragment>
</SingleDetail>
</>
);
};
export default ContractorCreate;
|
/*
* angular-ui-bootstrap
* http://angular-ui.github.io/bootstrap/
* Version: 1.0.3 - 2016-01-11
* License: MIT
*/angular.module("ui.bootstrap",["ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$injector",function(a,b){var c=b.has("$animateCss")?b.get("$animateCss"):null;return{link:function(b,d,e){function f(){d.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),c?c(d,{addClass:"in",easing:"ease",to:{height:d[0].scrollHeight+"px"}}).start()["finally"](g):a.addClass(d,"in",{to:{height:d[0].scrollHeight+"px"}}).then(g)}function g(){d.removeClass("collapsing").addClass("collapse").css({height:"auto"})}function h(){return d.hasClass("collapse")||d.hasClass("in")?(d.css({height:d[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),void(c?c(d,{removeClass:"in",to:{height:"0"}}).start()["finally"](i):a.removeClass(d,"in",{to:{height:"0"}}).then(i))):i()}function i(){d.css({height:"0"}),d.removeClass("collapsing").addClass("collapse")}b.$eval(e.uibCollapse)||d.addClass("in").addClass("collapse").css({height:"auto"}),b.$watch(e.uibCollapse,function(a){a?h():f()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(c){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.openClass=c.openClass||"panel-open",a.panelClass=c.panelClass||"panel-default",a.$watch("isOpen",function(c){b.toggleClass(a.openClass,!!c),c&&d.closeOthers(a)}),a.toggleOpen=function(b){a.isDisabled||b&&32!==b.which||(a.isOpen=!a.isOpen)}}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("uibAccordionTransclude",function(){return{require:"^uibAccordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.uibAccordionTransclude]},function(a){a&&(b.find("span").html(""),b.find("span").append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$attrs","$interpolate","$timeout",function(a,b,c,d){a.closeable=!!b.close;var e=angular.isDefined(b.dismissOnTimeout)?c(b.dismissOnTimeout)(a.$parent):null;e&&d(function(){a.close()},parseInt(e,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",templateUrl:function(a,b){return b.templateUrl||"uib/template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(a){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(b,c,d,e){var f=e[0],g=e[1],h=a(d.uibUncheckable);c.find("input").css({display:"none"}),g.$render=function(){c.toggleClass(f.activeClass,angular.equals(g.$modelValue,b.$eval(d.uibBtnRadio)))},c.on(f.toggleEvent,function(){if(!d.disabled){var a=c.hasClass(f.activeClass);(!a||angular.isDefined(d.uncheckable))&&b.$apply(function(){g.$setViewValue(a?null:b.$eval(d.uibBtnRadio)),g.$render()})}}),d.uibUncheckable&&b.$watch(h,function(a){d.$set("uncheckable",a?"":null)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){return angular.isDefined(b)?a.$eval(b):c}var h=d[0],i=d[1];b.find("input").css({display:"none"}),i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.on(h.toggleEvent,function(){c.disabled||a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(a,b,c,d,e){function f(){for(;s.length;)s.shift()}function g(a){if(angular.isUndefined(p[a].index))return p[a];for(var b=0,c=p.length;c>b;++b)if(p[b].index===a)return p[b]}function h(c,d,g){t||(angular.extend(c,{direction:g,active:!0}),angular.extend(o.currentSlide||{},{direction:g,active:!1}),e.enabled(b)&&!a.$currentTransition&&c.$element&&o.slides.length>1&&(c.$element.data(q,c.direction),o.currentSlide&&o.currentSlide.$element&&o.currentSlide.$element.data(q,c.direction),a.$currentTransition=!0,e.on("addClass",c.$element,function(b,c){if("close"===c&&(a.$currentTransition=null,e.off("addClass",b),s.length)){var d=s.pop(),g=a.indexOfSlide(d),i=g>o.getCurrentIndex()?"next":"prev";f(),h(d,g,i)}})),o.currentSlide=c,r=d,k())}function i(){m&&(c.cancel(m),m=null)}function j(b){b.length||(a.$currentTransition=null,f())}function k(){i();var b=+a.interval;!isNaN(b)&&b>0&&(m=c(l,b))}function l(){var b=+a.interval;n&&!isNaN(b)&&b>0&&p.length?a.next():a.pause()}var m,n,o=this,p=o.slides=a.slides=[],q="uib-slideDirection",r=-1,s=[];o.currentSlide=null;var t=!1;o.addSlide=function(b,c){b.$element=c,p.push(b),1===p.length||b.active?(a.$currentTransition&&(a.$currentTransition=null),o.select(p[p.length-1]),1===p.length&&a.play()):b.active=!1},o.getCurrentIndex=function(){return o.currentSlide&&angular.isDefined(o.currentSlide.index)?+o.currentSlide.index:r},o.next=a.next=function(){var b=(o.getCurrentIndex()+1)%p.length;return 0===b&&a.noWrap()?void a.pause():o.select(g(b),"next")},o.prev=a.prev=function(){var b=o.getCurrentIndex()-1<0?p.length-1:o.getCurrentIndex()-1;return a.noWrap()&&b===p.length-1?void a.pause():o.select(g(b),"prev")},o.removeSlide=function(a){angular.isDefined(a.index)&&p.sort(function(a,b){return+a.index>+b.index});var b=s.indexOf(a);-1!==b&&s.splice(b,1);var c=p.indexOf(a);p.splice(c,1),d(function(){p.length>0&&a.active?c>=p.length?o.select(p[c-1]):o.select(p[c]):r>c&&r--}),0===p.length&&(o.currentSlide=null,f())},o.select=a.select=function(b,c){var d=a.indexOfSlide(b);void 0===c&&(c=d>o.getCurrentIndex()?"next":"prev"),b&&b!==o.currentSlide&&!a.$currentTransition?h(b,d,c):b&&b!==o.currentSlide&&a.$currentTransition&&(s.push(b),b.active=!1)},a.indexOfSlide=function(a){return angular.isDefined(a.index)?+a.index:p.indexOf(a)},a.isActive=function(a){return o.currentSlide===a},a.pause=function(){a.noPause||(n=!1,i())},a.play=function(){n||(n=!0,k())},a.$on("$destroy",function(){t=!0,i()}),a.$watch("noTransition",function(a){e.enabled(b,!a)}),a.$watch("interval",k),a.$watchCollection("slides",j)}]).directive("uibCarousel",function(){return{transclude:!0,replace:!0,controller:"UibCarouselController",controllerAs:"carousel",templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/carousel.html"},scope:{interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}).directive("uibSlide",function(){return{require:"^uibCarousel",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/slide.html"},scope:{active:"=?",actual:"=?",index:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}).animation(".item",["$animateCss",function(a){function b(a,b,c){a.removeClass(b),c&&c()}var c="uib-slideDirection";return{beforeAddClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i+" "+h,f);return d.addClass(h),a(d,{addClass:i}).start().done(j),function(){g=!0}}f()},beforeRemoveClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i,f);return a(d,{addClass:i}).start().done(j),function(){g=!0}}f()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("uibDateParser",["$log","$locale","orderByFilter",function(a,b,c){function d(a){var b=[],d=a.split(""),e=a.indexOf("'");if(e>-1){var f=!1;a=a.split("");for(var g=e;g<a.length;g++)f?("'"===a[g]&&(g+1<a.length&&"'"===a[g+1]?(a[g+1]="$",d[g+1]=""):(d[g]="",f=!1)),a[g]="$"):"'"===a[g]&&(a[g]="$",d[g]="",f=!0);a=a.join("")}return angular.forEach(m,function(c){var e=a.indexOf(c.key);if(e>-1){a=a.split(""),d[e]="("+c.regex+")",a[e]="$";for(var f=e+1,g=e+c.key.length;g>f;f++)d[f]="",a[f]="$";a=a.join(""),b.push({index:e,apply:c.apply,matcher:c.regex})}}),{regex:new RegExp("^"+d.join("")+"$"),map:c(b,"index")}}function e(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}function f(a){return parseInt(a,10)}function g(a,b){return a&&b?k(a,b):a}function h(a,b){return a&&b?k(a,b,!0):a}function i(a,b){var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return isNaN(c)?b:c}function j(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function k(a,b,c){c=c?-1:1;var d=i(b,a.getTimezoneOffset());return j(a,c*(d-a.getTimezoneOffset()))}var l,m,n=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){l=b.id,this.parsers={},m=[{key:"yyyy",regex:"\\d{4}",apply:function(a){this.year=+a}},{key:"yy",regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},{key:"y",regex:"\\d{1,4}",apply:function(a){this.year=+a}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(a){this.month=a-1}},{key:"MMMM",regex:b.DATETIME_FORMATS.MONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.MONTH.indexOf(a)}},{key:"MMM",regex:b.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.SHORTMONTH.indexOf(a)}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},{key:"EEEE",regex:b.DATETIME_FORMATS.DAY.join("|")},{key:"EEE",regex:b.DATETIME_FORMATS.SHORTDAY.join("|")},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(a){this.hours=+a}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(a){this.hours=+a}},{key:"mm",regex:"[0-5][0-9]",apply:function(a){this.minutes=+a}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a}},{key:"ss",regex:"[0-5][0-9]",apply:function(a){this.seconds=+a}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a}},{key:"a",regex:b.DATETIME_FORMATS.AMPMS.join("|"),apply:function(a){12===this.hours&&(this.hours=0),"PM"===a&&(this.hours+=12)}},{key:"Z",regex:"[+-]\\d{4}",apply:function(a){var b=a.match(/([+-])(\d{2})(\d{2})/),c=b[1],d=b[2],e=b[3];this.hours+=f(c+d),this.minutes+=f(c+e)}},{key:"ww",regex:"[0-4][0-9]|5[0-3]"},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]"},{key:"GGGG",regex:b.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s")},{key:"GGG",regex:b.DATETIME_FORMATS.ERAS.join("|")},{key:"GG",regex:b.DATETIME_FORMATS.ERAS.join("|")},{key:"G",regex:b.DATETIME_FORMATS.ERAS.join("|")}]},this.init(),this.parse=function(c,f,g){if(!angular.isString(c)||!f)return c;f=b.DATETIME_FORMATS[f]||f,f=f.replace(n,"\\$&"),b.id!==l&&this.init(),this.parsers[f]||(this.parsers[f]=d(f));var h=this.parsers[f],i=h.regex,j=h.map,k=c.match(i),m=!1;if(k&&k.length){var o,p;angular.isDate(g)&&!isNaN(g.getTime())?o={year:g.getFullYear(),month:g.getMonth(),date:g.getDate(),hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()}:(g&&a.warn("dateparser:","baseDate is not a valid date"),o={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var q=1,r=k.length;r>q;q++){var s=j[q-1];"Z"===s.matcher&&(m=!0),s.apply&&s.apply.call(o,k[q])}var t=m?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,u=m?Date.prototype.setUTCHours:Date.prototype.setHours;return e(o.year,o.month,o.date)&&(!angular.isDate(g)||isNaN(g.getTime())||m?(p=new Date(0),t.call(p,o.year,o.month,o.date),u.call(p,o.hours||0,o.minutes||0,o.seconds||0,o.milliseconds||0)):(p=new Date(g),t.call(p,o.year,o.month,o.date),u.call(p,o.hours,o.minutes,o.seconds,o.milliseconds))),p}},this.toTimezone=g,this.fromTimezone=h,this.timezoneToOffset=i,this.addDateMinutes=j,this.convertTimezoneToLocal=k}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(a){var b=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,c=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(d,e){function f(a,b,c){i.push(a),j.push({scope:a,element:b}),o.forEach(function(b,c){g(b,a)}),a.$on("$destroy",h)}function g(b,d){var e=b.match(c),f=d.$eval(e[1]),g=e[2],h=k[b];if(!h){var i=function(b){var c=null;j.some(function(a){var d=a.scope.$eval(m);return d===b?(c=a,!0):void 0}),h.lastActivated!==c&&(h.lastActivated&&a.removeClass(h.lastActivated.element,f),c&&a.addClass(c.element,f),h.lastActivated=c)};k[b]=h={lastActivated:null,scope:d,watchFn:i,compareWithExp:g,watcher:d.$watch(g,i)}}h.watchFn(d.$eval(g))}function h(a){var b=a.targetScope,c=i.indexOf(b);if(i.splice(c,1),j.splice(c,1),i.length){var d=i[0];angular.forEach(k,function(a){a.scope===b&&(a.watcher=d.$watch(a.compareWithExp,a.watchFn),a.scope=d)})}else k={}}var i=[],j=[],k={},l=e.uibIsClass.match(b),m=l[2],n=l[1],o=n.split(",");return f}}}]),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(a,b){var c,d={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},e={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/};return{getRawNode:function(a){return a[0]||a},parseStyle:function(a){return a=parseFloat(a),isFinite(a)?a:0},offsetParent:function(c){function d(a){return"static"===(b.getComputedStyle(a).position||"static")}c=this.getRawNode(c);for(var e=c.offsetParent||a[0].documentElement;e&&e!==a[0].documentElement&&d(e);)e=e.offsetParent;return e||a[0].documentElement},scrollbarWidth:function(){if(angular.isUndefined(c)){var b=angular.element('<div style="position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll;"></div>');a.find("body").append(b),c=b[0].offsetWidth-b[0].clientWidth,c=isFinite(c)?c:0,b.remove()}return c},scrollParent:function(c,e){c=this.getRawNode(c);var f=e?d.hidden:d.normal,g=a[0].documentElement,h=b.getComputedStyle(c),i="absolute"===h.position,j=c.parentElement||g;if(j===g||"fixed"===h.position)return g;for(;j.parentElement&&j!==g;){var k=b.getComputedStyle(j);if(i&&"static"!==k.position&&(i=!1),!i&&f.test(k.overflow+k.overflowY+k.overflowX))break;j=j.parentElement}return j},position:function(c,d){c=this.getRawNode(c);var e=this.offset(c);if(d){var f=b.getComputedStyle(c);e.top-=this.parseStyle(f.marginTop),e.left-=this.parseStyle(f.marginLeft)}var g=this.offsetParent(c),h={top:0,left:0};return g!==a[0].documentElement&&(h=this.offset(g),h.top+=g.clientTop-g.scrollTop,h.left+=g.clientLeft-g.scrollLeft),{width:Math.round(angular.isNumber(e.width)?e.width:c.offsetWidth),height:Math.round(angular.isNumber(e.height)?e.height:c.offsetHeight),top:Math.round(e.top-h.top),left:Math.round(e.left-h.left)}},offset:function(c){c=this.getRawNode(c);var d=c.getBoundingClientRect();return{width:Math.round(angular.isNumber(d.width)?d.width:c.offsetWidth),height:Math.round(angular.isNumber(d.height)?d.height:c.offsetHeight),top:Math.round(d.top+(b.pageYOffset||a[0].documentElement.scrollTop)),left:Math.round(d.left+(b.pageXOffset||a[0].documentElement.scrollLeft))}},viewportOffset:function(c,d,e){c=this.getRawNode(c),e=e!==!1?!0:!1;var f=c.getBoundingClientRect(),g={top:0,left:0,bottom:0,right:0},h=d?a[0].documentElement:this.scrollParent(c),i=h.getBoundingClientRect();if(g.top=i.top+h.clientTop,g.left=i.left+h.clientLeft,h===a[0].documentElement&&(g.top+=b.pageYOffset,g.left+=b.pageXOffset),g.bottom=g.top+h.clientHeight,g.right=g.left+h.clientWidth,e){var j=b.getComputedStyle(h);g.top+=this.parseStyle(j.paddingTop),g.bottom-=this.parseStyle(j.paddingBottom),g.left+=this.parseStyle(j.paddingLeft),g.right-=this.parseStyle(j.paddingRight)}return{top:Math.round(f.top-g.top),bottom:Math.round(g.bottom-f.bottom),left:Math.round(f.left-g.left),right:Math.round(g.right-f.right)}},parsePlacement:function(a){var b=e.auto.test(a);return b&&(a=a.replace(e.auto,"")),a=a.split("-"),a[0]=a[0]||"top",e.primary.test(a[0])||(a[0]="top"),a[1]=a[1]||"center",e.secondary.test(a[1])||(a[1]="center"),b?a[2]=!0:a[2]=!1,a},positionElements:function(a,c,d,f){a=this.getRawNode(a),c=this.getRawNode(c);var g=angular.isDefined(c.offsetWidth)?c.offsetWidth:c.prop("offsetWidth"),h=angular.isDefined(c.offsetHeight)?c.offsetHeight:c.prop("offsetHeight");d=this.parsePlacement(d);var i=f?this.offset(a):this.position(a),j={top:0,left:0,placement:""};if(d[2]){var k=this.viewportOffset(a),l=b.getComputedStyle(c),m={width:g+Math.round(Math.abs(this.parseStyle(l.marginLeft)+this.parseStyle(l.marginRight))),height:h+Math.round(Math.abs(this.parseStyle(l.marginTop)+this.parseStyle(l.marginBottom)))};if(d[0]="top"===d[0]&&m.height>k.top&&m.height<=k.bottom?"bottom":"bottom"===d[0]&&m.height>k.bottom&&m.height<=k.top?"top":"left"===d[0]&&m.width>k.left&&m.width<=k.right?"right":"right"===d[0]&&m.width>k.right&&m.width<=k.left?"left":d[0],d[1]="top"===d[1]&&m.height-i.height>k.bottom&&m.height-i.height<=k.top?"bottom":"bottom"===d[1]&&m.height-i.height>k.top&&m.height-i.height<=k.bottom?"top":"left"===d[1]&&m.width-i.width>k.right&&m.width-i.width<=k.left?"right":"right"===d[1]&&m.width-i.width>k.left&&m.width-i.width<=k.right?"left":d[1],"center"===d[1])if(e.vertical.test(d[0])){var n=i.width/2-g/2;k.left+n<0&&m.width-i.width<=k.right?d[1]="left":k.right+n<0&&m.width-i.width<=k.left&&(d[1]="right")}else{var o=i.height/2-m.height/2;k.top+o<0&&m.height-i.height<=k.bottom?d[1]="top":k.bottom+o<0&&m.height-i.height<=k.top&&(d[1]="bottom")}}switch(d[0]){case"top":j.top=i.top-h;break;case"bottom":j.top=i.top+i.height;break;case"left":j.left=i.left-g;break;case"right":j.left=i.left+i.width}switch(d[1]){case"top":j.top=i.top;break;case"bottom":j.top=i.top+i.height-h;break;case"left":j.left=i.left;break;case"right":j.left=i.left+i.width-g;break;case"center":e.vertical.test(d[0])?j.left=i.left+i.width/2-g/2:j.top=i.top+i.height/2-h/2}return j.top=Math.round(j.top),j.left=Math.round(j.left),j.placement="center"===d[1]?d[0]:d[0]+"-"+d[1],j},positionArrow:function(a,c){a=this.getRawNode(a);var d=!0,f=a.querySelector(".tooltip-inner");if(f||(d=!1,f=a.querySelector(".popover-inner")),f){var g=d?a.querySelector(".tooltip-arrow"):a.querySelector(".arrow");if(g){if(c=this.parsePlacement(c),"center"===c[1])return void angular.element(g).css({top:"",bottom:"",right:"",left:"",margin:""});var h="border-"+c[0]+"-width",i=b.getComputedStyle(g)[h],j="border-";j+=e.vertical.test(c[0])?c[0]+"-"+c[1]:c[1]+"-"+c[0],j+="-radius";var k=b.getComputedStyle(d?f:a)[j],l={top:"auto",bottom:"auto",left:"auto",right:"auto",margin:0};switch(c[0]){case"top":l.bottom=d?"0":"-"+i;break;case"bottom":l.top=d?"0":"-"+i;break;case"left":l.right=d?"0":"-"+i;break;case"right":l.left=d?"0":"-"+i}l[c[1]]=k,angular.element(g).css(l)}}}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.position"]).value("$datepickerSuppressError",!1).constant("uibDatepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRows:4,yearColumns:5,minDate:null,maxDate:null,shortcutPropagation:!1,ngModelOptions:{}}).controller("UibDatepickerController",["$scope","$attrs","$parse","$interpolate","$log","dateFilter","uibDatepickerConfig","$datepickerSuppressError","uibDateParser",function(a,b,c,d,e,f,g,h,i){var j=this,k={$setViewValue:angular.noop},l={};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle"],function(c){j[c]=angular.isDefined(b[c])?d(b[c])(a.$parent):g[c]}),angular.forEach(["showWeeks","startingDay","yearRows","yearColumns","shortcutPropagation"],function(c){j[c]=angular.isDefined(b[c])?a.$parent.$eval(b[c]):g[c]}),angular.forEach(["minDate","maxDate"],function(c){b[c]?a.$parent.$watch(b[c],function(a){j[c]=a?angular.isDate(a)?i.fromTimezone(new Date(a),l.timezone):new Date(f(a,"medium")):null,j.refreshView()}):j[c]=g[c]?i.fromTimezone(new Date(g[c]),l.timezone):null}),angular.forEach(["minMode","maxMode"],function(c){b[c]?a.$parent.$watch(b[c],function(d){j[c]=a[c]=angular.isDefined(d)?d:b[c],("minMode"===c&&j.modes.indexOf(a.datepickerMode)<j.modes.indexOf(j[c])||"maxMode"===c&&j.modes.indexOf(a.datepickerMode)>j.modes.indexOf(j[c]))&&(a.datepickerMode=j[c])}):j[c]=a[c]=g[c]||null}),a.datepickerMode=a.datepickerMode||g.datepickerMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),angular.isDefined(b.initDate)?(this.activeDate=i.fromTimezone(a.$parent.$eval(b.initDate),l.timezone)||new Date,a.$parent.$watch(b.initDate,function(a){a&&(k.$isEmpty(k.$modelValue)||k.$invalid)&&(j.activeDate=i.fromTimezone(a,l.timezone),j.refreshView())})):this.activeDate=new Date,a.disabled=angular.isDefined(b.disabled)||!1,angular.isDefined(b.ngDisabled)&&a.$parent.$watch(b.ngDisabled,function(b){a.disabled=b,j.refreshView()}),a.isActive=function(b){return 0===j.compare(b.date,j.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){k=a,l=a.$options||g.ngModelOptions,k.$modelValue&&(this.activeDate=k.$modelValue),k.$render=function(){j.render()}},this.render=function(){if(k.$viewValue){var a=new Date(k.$viewValue),b=!isNaN(a);b?this.activeDate=i.fromTimezone(a,l.timezone):h||e.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){a.selectedDt=null,this._refreshView(),a.activeDt&&(a.activeDateId=a.activeDt.uid);var b=k.$viewValue?new Date(k.$viewValue):null;b=i.fromTimezone(b,l.timezone),k.$setValidity("dateDisabled",!b||this.element&&!this.isDisabled(b))}},this.createDateObject=function(b,c){var d=k.$viewValue?new Date(k.$viewValue):null;d=i.fromTimezone(d,l.timezone);var e={date:b,label:f(b,c.replace(/d!/,"dd")).replace(/M!/,"MM"),selected:d&&0===this.compare(b,d),disabled:this.isDisabled(b),current:0===this.compare(b,new Date),customClass:this.customClass(b)||null};return d&&0===this.compare(b,d)&&(a.selectedDt=e),j.activeDate&&0===this.compare(e.date,j.activeDate)&&(a.activeDt=e),e},this.isDisabled=function(c){return a.disabled||this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===j.minMode){var c=k.$viewValue?i.fromTimezone(new Date(k.$viewValue),l.timezone):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),c=i.toTimezone(c,l.timezone),k.$setViewValue(c),k.$render()}else j.activeDate=b,a.datepickerMode=j.modes[j.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=j.activeDate.getFullYear()+a*(j.step.years||0),c=j.activeDate.getMonth()+a*(j.step.months||0);j.activeDate.setFullYear(b,c,1),j.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===j.maxMode&&1===b||a.datepickerMode===j.minMode&&-1===b||(a.datepickerMode=j.modes[j.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var m=function(){j.element[0].focus()};a.$on("uib:datepicker.focus",m),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey&&!a.disabled)if(b.preventDefault(),j.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(j.isDisabled(j.activeDate))return;a.select(j.activeDate)}else!b.ctrlKey||"up"!==c&&"down"!==c?(j.handleKeyDown(c,b),j.refreshView()):a.toggleMode("up"===c?1:-1)}}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?f[b]:29}function e(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}var f=[31,28,31,30,31,30,31,31,30,31,30,31];this.step={months:1},this.element=b,this.init=function(b){angular.extend(b,this),a.showWeeks=b.showWeeks,b.refreshView()},this.getDates=function(a,b){for(var c,d=new Array(b),e=new Date(a),f=0;b>f;)c=new Date(e),d[f++]=c,e.setDate(e.getDate()+1);return d},this._refreshView=function(){var b=this.activeDate.getFullYear(),d=this.activeDate.getMonth(),f=new Date(this.activeDate);f.setFullYear(b,d,1);var g=this.startingDay-f.getDay(),h=g>0?7-g:-g,i=new Date(f);h>0&&i.setDate(-h+1);for(var j=this.getDates(i,42),k=0;42>k;k++)j[k]=angular.extend(this.createDateObject(j[k],this.formatDay),{secondary:j[k].getMonth()!==d,uid:a.uniqueId+"-"+k});a.labels=new Array(7);for(var l=0;7>l;l++)a.labels[l]={abbr:c(j[l].date,this.formatDayHeader),full:c(j[l].date,"EEEE")};if(a.title=c(this.activeDate,this.formatDayTitle),a.rows=this.split(j,7),a.showWeeks){a.weekNumbers=[];for(var m=(11-this.startingDay)%7,n=a.rows.length,o=0;n>o;o++)a.weekNumbers.push(e(a.rows[o][m].date))}},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth(),a.getDate()),d=new Date(b.getFullYear(),b.getMonth(),b.getDate());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getDate();if("left"===a)c-=1;else if("up"===a)c-=7;else if("right"===a)c+=1;else if("down"===a)c+=7;else if("pageup"===a||"pagedown"===a){var e=this.activeDate.getMonth()+("pageup"===a?-1:1);this.activeDate.setMonth(e,1),c=Math.min(d(this.activeDate.getFullYear(),this.activeDate.getMonth()),c)}else"home"===a?c=1:"end"===a&&(c=d(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(c)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(a,b,c){this.step={years:1},this.element=b,this.init=function(a){angular.extend(a,this),a.refreshView()},this._refreshView=function(){for(var b,d=new Array(12),e=this.activeDate.getFullYear(),f=0;12>f;f++)b=new Date(this.activeDate),b.setFullYear(e,f,1),d[f]=angular.extend(this.createDateObject(b,this.formatMonth),{uid:a.uniqueId+"-"+f});a.title=c(this.activeDate,this.formatMonthTitle),a.rows=this.split(d,3)},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth()),d=new Date(b.getFullYear(),b.getMonth());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getMonth();if("left"===a)c-=1;else if("up"===a)c-=3;else if("right"===a)c+=1;else if("down"===a)c+=3;else if("pageup"===a||"pagedown"===a){var d=this.activeDate.getFullYear()+("pageup"===a?-1:1);this.activeDate.setFullYear(d)}else"home"===a?c=0:"end"===a&&(c=11);this.activeDate.setMonth(c)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a){return parseInt((a-1)/f,10)*f+1}var e,f;this.element=b,this.yearpickerInit=function(){e=this.yearColumns,f=this.yearRows*e,this.step={years:f}},this._refreshView=function(){for(var b,c=new Array(f),g=0,h=d(this.activeDate.getFullYear());f>g;g++)b=new Date(this.activeDate),b.setFullYear(h+g,0,1),c[g]=angular.extend(this.createDateObject(b,this.formatYear),{uid:a.uniqueId+"-"+g});a.title=[c[0].label,c[f-1].label].join(" - "),a.rows=this.split(c,e),a.columns=e},this.compare=function(a,b){return a.getFullYear()-b.getFullYear()},this.handleKeyDown=function(a,b){var c=this.activeDate.getFullYear();"left"===a?c-=1:"up"===a?c-=e:"right"===a?c+=1:"down"===a?c+=e:"pageup"===a||"pagedown"===a?c+=("pageup"===a?-1:1)*f:"home"===a?c=d(this.activeDate.getFullYear()):"end"===a&&(c=d(this.activeDate.getFullYear())+f-1),this.activeDate.setFullYear(c)}}]).directive("uibDatepicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerMode:"=?",dateDisabled:"&",customClass:"&",shortcutPropagation:"&?"},require:["uibDatepicker","^ngModel"],controller:"UibDatepickerController",controllerAs:"datepicker",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}).directive("uibDaypicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],controller:"UibDaypickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibMonthpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],controller:"UibMonthpickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibYearpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],controller:"UibYearpickerController",link:function(a,b,c,d){var e=d[0];angular.extend(e,d[1]),e.yearpickerInit(),e.refreshView()}}}).constant("uibDatepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepicker/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0,onOpenFocus:!0,altInputFormats:[]}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$parse","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function o(b){var c=j.parse(b,t,a.date);if(isNaN(c))for(var d=0;d<E.length;d++)if(c=j.parse(b,E[d],a.date),!isNaN(c))return c;return c}function p(a){if(angular.isNumber(a)&&(a=new Date(a)),
!a)return null;if(angular.isDate(a)&&!isNaN(a))return a;if(angular.isString(a)){var b=o(a);if(!isNaN(b))return j.toTimezone(b,C.timezone)}return B.$options&&B.$options.allowInvalid?a:void 0}function q(a,b){var d=a||b;return c.ngRequired||d?(angular.isNumber(d)&&(d=new Date(d)),d?angular.isDate(d)&&!isNaN(d)?!0:angular.isString(d)?!isNaN(o(b)):!1:!0):!0}function r(c){if(a.isOpen||!a.disabled){var d=D[0],e=b[0].contains(c.target),f=void 0!==d.contains&&d.contains(c.target);!a.isOpen||e||f||a.$apply(function(){a.isOpen=!1})}}function s(c){27===c.which&&a.isOpen?(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!1}),b[0].focus()):40!==c.which||a.isOpen||(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!0}))}var t,u,v,w,x,y,z,A,B,C,D,E,F={},G=!1;a.watchData={},this.init=function(h){if(B=h,C=h.$options||m.ngModelOptions,u=angular.isDefined(c.closeOnDateSelection)?a.$parent.$eval(c.closeOnDateSelection):k.closeOnDateSelection,v=angular.isDefined(c.datepickerAppendToBody)?a.$parent.$eval(c.datepickerAppendToBody):k.appendToBody,w=angular.isDefined(c.onOpenFocus)?a.$parent.$eval(c.onOpenFocus):k.onOpenFocus,x=angular.isDefined(c.datepickerPopupTemplateUrl)?c.datepickerPopupTemplateUrl:k.datepickerPopupTemplateUrl,y=angular.isDefined(c.datepickerTemplateUrl)?c.datepickerTemplateUrl:k.datepickerTemplateUrl,E=angular.isDefined(c.altInputFormats)?a.$parent.$eval(c.altInputFormats):k.altInputFormats,a.showButtonBar=angular.isDefined(c.showButtonBar)?a.$parent.$eval(c.showButtonBar):k.showButtonBar,k.html5Types[c.type]?(t=k.html5Types[c.type],G=!0):(t=c.uibDatepickerPopup||k.datepickerPopup,c.$observe("uibDatepickerPopup",function(a,b){var c=a||k.datepickerPopup;if(c!==t&&(t=c,B.$modelValue=null,!t))throw new Error("uibDatepickerPopup must have a date format specified.")})),!t)throw new Error("uibDatepickerPopup must have a date format specified.");if(G&&c.uibDatepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");if(z=angular.element("<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>"),a.ngModelOptions=angular.copy(C),a.ngModelOptions.timezone=null,z.attr({"ng-model":"date","ng-model-options":"ngModelOptions","ng-change":"dateSelection(date)","template-url":x}),A=angular.element(z.children()[0]),A.attr("template-url",y),G&&"month"===c.type&&(A.attr("datepicker-mode",'"month"'),A.attr("min-mode","month")),c.datepickerOptions){var l=a.$parent.$eval(c.datepickerOptions);l&&l.initDate&&(a.initDate=j.fromTimezone(l.initDate,C.timezone),A.attr("init-date","initDate"),delete l.initDate),angular.forEach(l,function(a,b){A.attr(n(b),a)})}angular.forEach(["minMode","maxMode"],function(b){c[b]&&(a.$parent.$watch(function(){return c[b]},function(c){a.watchData[b]=c}),A.attr(n(b),"watchData."+b))}),angular.forEach(["datepickerMode","shortcutPropagation"],function(b){if(c[b]){var d=e(c[b]),f={get:function(){return d(a.$parent)}};if(A.attr(n(b),"watchData."+b),"datepickerMode"===b){var g=d.assign;f.set=function(b){g(a.$parent,b)}}Object.defineProperty(a.watchData,b,f)}}),angular.forEach(["minDate","maxDate","initDate"],function(b){if(c[b]){var d=e(c[b]);a.$parent.$watch(d,function(c){("minDate"===b||"maxDate"===b)&&(F[b]=angular.isDate(c)?j.fromTimezone(new Date(c),C.timezone):new Date(i(c,"medium"))),a.watchData[b]=F[b]||j.fromTimezone(new Date(c),C.timezone)}),A.attr(n(b),"watchData."+b)}}),c.dateDisabled&&A.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","showWeeks","startingDay","yearRows","yearColumns"],function(a){angular.isDefined(c[a])&&A.attr(n(a),c[a])}),c.customClass&&A.attr("custom-class","customClass({ date: date, mode: mode })"),G?B.$formatters.push(function(b){return a.date=j.fromTimezone(b,C.timezone),b}):(B.$$parserName="date",B.$validators.date=q,B.$parsers.unshift(p),B.$formatters.push(function(b){return B.$isEmpty(b)?(a.date=b,b):(a.date=j.fromTimezone(b,C.timezone),t=t.replace(/M!/,"MM").replace(/d!/,"dd"),i(a.date,t))})),B.$viewChangeListeners.push(function(){a.date=o(B.$viewValue)}),b.bind("keydown",s),D=d(z)(a),z.remove(),v?f.find("body").append(D):b.after(D),a.$on("$destroy",function(){a.isOpen===!0&&(g.$$phase||a.$apply(function(){a.isOpen=!1})),D.remove(),b.unbind("keydown",s),f.unbind("click",r)})},a.getText=function(b){return a[b+"Text"]||k[b+"Text"]},a.isDisabled=function(b){return"today"===b&&(b=new Date),a.watchData.minDate&&a.compare(b,F.minDate)<0||a.watchData.maxDate&&a.compare(b,F.maxDate)>0},a.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},a.dateSelection=function(c){angular.isDefined(c)&&(a.date=c);var d=a.date?i(a.date,t):null;b.val(d),B.$setViewValue(d),u&&(a.isOpen=!1,b[0].focus())},a.keydown=function(c){27===c.which&&(c.stopPropagation(),a.isOpen=!1,b[0].focus())},a.select=function(b){if("today"===b){var c=new Date;angular.isDate(a.date)?(b=new Date(a.date),b.setFullYear(c.getFullYear(),c.getMonth(),c.getDate())):b=new Date(c.setHours(0,0,0,0))}a.dateSelection(b)},a.close=function(){a.isOpen=!1,b[0].focus()},a.disabled=angular.isDefined(c.disabled)||!1,c.ngDisabled&&a.$parent.$watch(e(c.ngDisabled),function(b){a.disabled=b}),a.$watch("isOpen",function(c){c?a.disabled?a.isOpen=!1:(a.position=v?h.offset(b):h.position(b),a.position.top=a.position.top+b.prop("offsetHeight"),l(function(){w&&a.$broadcast("uib:datepicker.focus"),f.bind("click",r)},0,!1)):f.unbind("click",r)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&",customClass:"&"},link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibDatepickerPopupWrap",function(){return{replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(a){return function(b,c){var d;return function(){var e=this,f=Array.prototype.slice.call(arguments);d&&a.cancel(d),d=a(function(){b.apply(e,f)},c)}}}]),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b){c||(a.on("click",d),a.on("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b){c===b&&(c=null,a.off("click",d),a.off("keydown",e))};var d=function(a){if(c&&!(a&&"disabled"===c.getAutoClose()||a&&3===a.which)){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getDropdownElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which?(c.focusToggleElement(),d()):c.isKeynavEnabled()&&-1!==[38,40].indexOf(a.which)&&c.isOpen&&(a.preventDefault(),a.stopPropagation(),c.focusDropdownEntry(a.which))}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(a,b,c,d,e,f,g,h,i,j,k){var l,m,n=this,o=a.$new(),p=e.appendToOpenClass,q=e.openClass,r=angular.noop,s=c.onToggle?d(c.onToggle):angular.noop,t=!1,u=null,v=!1,w=i.find("body");b.addClass("dropdown"),this.init=function(){if(c.isOpen&&(m=d(c.isOpen),r=m.assign,a.$watch(m,function(a){o.isOpen=!!a})),angular.isDefined(c.dropdownAppendTo)){var e=d(c.dropdownAppendTo)(o);e&&(u=angular.element(e))}t=angular.isDefined(c.dropdownAppendToBody),v=angular.isDefined(c.keyboardNav),t&&!u&&(u=w),u&&n.dropdownMenu&&(u.append(n.dropdownMenu),b.on("$destroy",function(){n.dropdownMenu.remove()}))},this.toggle=function(a){return o.isOpen=arguments.length?!!a:!o.isOpen},this.isOpen=function(){return o.isOpen},o.getToggleElement=function(){return n.toggleElement},o.getAutoClose=function(){return c.autoClose||"always"},o.getElement=function(){return b},o.isKeynavEnabled=function(){return v},o.focusDropdownEntry=function(a){var c=n.dropdownMenu?angular.element(n.dropdownMenu).find("a"):b.find("ul").eq(0).find("a");switch(a){case 40:angular.isNumber(n.selectedOption)?n.selectedOption=n.selectedOption===c.length-1?n.selectedOption:n.selectedOption+1:n.selectedOption=0;break;case 38:angular.isNumber(n.selectedOption)?n.selectedOption=0===n.selectedOption?0:n.selectedOption-1:n.selectedOption=c.length-1}c[n.selectedOption].focus()},o.getDropdownElement=function(){return n.dropdownMenu},o.focusToggleElement=function(){n.toggleElement&&n.toggleElement[0].focus()},o.$watch("isOpen",function(c,d){if(u&&n.dropdownMenu){var e,i,m=h.positionElements(b,n.dropdownMenu,"bottom-left",!0);if(e={top:m.top+"px",display:c?"block":"none"},i=n.dropdownMenu.hasClass("dropdown-menu-right"),i?(e.left="auto",e.right=window.innerWidth-(m.left+b.prop("offsetWidth"))+"px"):(e.left=m.left+"px",e.right="auto"),!t){var v=h.offset(u);e.top=m.top-v.top+"px",i?e.right=window.innerWidth-(m.left-v.left+b.prop("offsetWidth"))+"px":e.left=m.left-v.left+"px"}n.dropdownMenu.css(e)}var w=u?u:b;if(g[c?"addClass":"removeClass"](w,u?p:q).then(function(){angular.isDefined(c)&&c!==d&&s(a,{open:!!c})}),c)n.dropdownMenuTemplateUrl&&k(n.dropdownMenuTemplateUrl).then(function(a){l=o.$new(),j(a.trim())(l,function(a){var b=a;n.dropdownMenu.replaceWith(b),n.dropdownMenu=b})}),o.focusToggleElement(),f.open(o);else{if(n.dropdownMenuTemplateUrl){l&&l.$destroy();var x=angular.element('<ul class="dropdown-menu"></ul>');n.dropdownMenu.replaceWith(x),n.dropdownMenu=x}f.close(o),n.selectedOption=null}angular.isFunction(r)&&r(a,c)}),a.$on("$locationChangeSuccess",function(){"disabled"!==o.getAutoClose()&&(o.isOpen=!1)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(a,b,c,d){d.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(a,b,c,d){if(d&&!angular.isDefined(c.dropdownNested)){b.addClass("dropdown-menu");var e=c.templateUrl;e&&(d.dropdownMenuTemplateUrl=e),d.dropdownMenu||(d.dropdownMenu=b)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(a,b,c,d){if(d){b.addClass("dropdown-toggle"),d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b===a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b===a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.stackedMap"]).factory("$$multiMap",function(){return{createNew:function(){var a={};return{entries:function(){return Object.keys(a).map(function(b){return{key:b,value:a[b]}})},get:function(b){return a[b]},hasKey:function(b){return!!a[b]},keys:function(){return Object.keys(a)},put:function(b,c){a[b]||(a[b]=[]),a[b].push(c)},remove:function(b,c){var d=a[b];if(d){var e=d.indexOf(c);-1!==e&&d.splice(e,1),d.length||delete a[b]}}}}}}).provider("$uibResolve",function(){var a=this;this.resolver=null,this.setResolver=function(a){this.resolver=a},this.$get=["$injector","$q",function(b,c){var d=a.resolver?b.get(a.resolver):null;return{resolve:function(a,e,f,g){if(d)return d.resolve(a,e,f,g);var h=[];return angular.forEach(a,function(a){angular.isFunction(a)||angular.isArray(a)?h.push(c.resolve(b.invoke(a))):angular.isString(a)?h.push(c.resolve(b.get(a))):h.push(c.resolve(a))}),c.all(h).then(function(b){var c={},d=0;return angular.forEach(a,function(a,e){c[e]=b[d++]}),c})}}}]}).directive("uibModalBackdrop",["$animateCss","$injector","$uibModalStack",function(a,b,c){function d(b,d,e){e.modalInClass&&(a(d,{addClass:e.modalInClass}).start(),b.$on(c.NOW_CLOSING_EVENT,function(c,f){var g=f();b.modalOptions.animation?a(d,{removeClass:e.modalInClass}).start().then(g):g()}))}return{replace:!0,templateUrl:"uib/template/modal/backdrop.html",compile:function(a,b){return a.addClass(b.backdropClass),d}}}]).directive("uibModalWindow",["$uibModalStack","$q","$animate","$animateCss","$document",function(a,b,c,d,e){return{scope:{index:"@"},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/modal/window.html"},link:function(f,g,h){g.addClass(h.windowClass||""),g.addClass(h.windowTopClass||""),f.size=h.size,f.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!==c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))},g.on("click",f.close),f.$isRendered=!0;var i=b.defer();h.$observe("modalRender",function(a){"true"===a&&i.resolve()}),i.promise.then(function(){var i=null;h.modalInClass&&(i=d(g,{addClass:h.modalInClass}).start(),f.$on(a.NOW_CLOSING_EVENT,function(a,b){var e=b();d?d(g,{removeClass:h.modalInClass}).start().then(e):c.removeClass(g,h.modalInClass).then(e)})),b.when(i).then(function(){if(!e[0].activeElement||!g[0].contains(e[0].activeElement)){var a=g[0].querySelector("[autofocus]");a?a.focus():g[0].focus()}});var j=a.getTop();j&&a.modalRendered(j.key)})}}}]).directive("uibModalAnimationClass",function(){return{compile:function(a,b){b.modalAnimation&&a.addClass(b.uibModalAnimationClass)}}}).directive("uibModalTransclude",function(){return{link:function(a,b,c,d,e){e(a.$parent,function(a){b.empty(),b.append(a)})}}}).factory("$uibModalStack",["$animate","$animateCss","$document","$compile","$rootScope","$q","$$multiMap","$$stackedMap",function(a,b,c,d,e,f,g,h){function i(){for(var a=-1,b=t.keys(),c=0;c<b.length;c++)t.get(b[c]).value.backdrop&&(a=c);return a}function j(a,b){var c=t.get(a).value,d=c.appendTo;t.remove(a),m(c.modalDomEl,c.modalScope,function(){var b=c.openedClass||s;u.remove(b,a),d.toggleClass(b,u.hasKey(b)),k(!0)}),l(),b&&b.focus?b.focus():d.focus&&d.focus()}function k(a){var b;t.length()>0&&(b=t.top().value,b.modalDomEl.toggleClass(b.windowTopClass||"",a))}function l(){if(p&&-1===i()){var a=q;m(p,q,function(){a=null}),p=void 0,q=void 0}}function m(a,c,d,e){function g(){g.done||(g.done=!0,b(a,{event:"leave"}).start().then(function(){a.remove(),e&&e.resolve()}),c.$destroy(),d&&d())}var h,i=null,j=function(){return h||(h=f.defer(),i=h.promise),function(){h.resolve()}};return c.$broadcast(v.NOW_CLOSING_EVENT,j),f.when(i).then(g)}function n(a){if(a.isDefaultPrevented())return a;var b=t.top();if(b)switch(a.which){case 27:b.value.keyboard&&(a.preventDefault(),e.$apply(function(){v.dismiss(b.key,"escape key press")}));break;case 9:v.loadFocusElementList(b);var c=!1;a.shiftKey?v.isFocusInFirstItem(a)&&(c=v.focusLastFocusableElement()):v.isFocusInLastItem(a)&&(c=v.focusFirstFocusableElement()),c&&(a.preventDefault(),a.stopPropagation())}}function o(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var p,q,r,s="modal-open",t=h.createNew(),u=g.createNew(),v={NOW_CLOSING_EVENT:"modal.stack.now-closing"},w=0,x="a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]";return e.$watch(i,function(a){q&&(q.index=a)}),c.on("keydown",n),e.$on("$destroy",function(){c.off("keydown",n)}),v.open=function(b,f){var g=c[0].activeElement,h=f.openedClass||s;k(!1),t.add(b,{deferred:f.deferred,renderDeferred:f.renderDeferred,closedDeferred:f.closedDeferred,modalScope:f.scope,backdrop:f.backdrop,keyboard:f.keyboard,openedClass:f.openedClass,windowTopClass:f.windowTopClass,animation:f.animation,appendTo:f.appendTo}),u.put(h,b);var j=f.appendTo,l=i();if(!j.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");l>=0&&!p&&(q=e.$new(!0),q.modalOptions=f,q.index=l,p=angular.element('<div uib-modal-backdrop="modal-backdrop"></div>'),p.attr("backdrop-class",f.backdropClass),f.animation&&p.attr("modal-animation","true"),d(p)(q),a.enter(p,j));var m=angular.element('<div uib-modal-window="modal-window"></div>');m.attr({"template-url":f.windowTemplateUrl,"window-class":f.windowClass,"window-top-class":f.windowTopClass,size:f.size,index:t.length()-1,animate:"animate"}).html(f.content),f.animation&&m.attr("modal-animation","true"),a.enter(m,j).then(function(){d(m)(f.scope),a.addClass(j,h)}),t.top().value.modalDomEl=m,t.top().value.modalOpener=g,v.clearFocusListCache()},v.close=function(a,b){var c=t.get(a);return c&&o(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),j(a,c.value.modalOpener),!0):!c},v.dismiss=function(a,b){var c=t.get(a);return c&&o(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),j(a,c.value.modalOpener),!0):!c},v.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},v.getTop=function(){return t.top()},v.modalRendered=function(a){var b=t.get(a);b&&b.value.renderDeferred.resolve()},v.focusFirstFocusableElement=function(){return r.length>0?(r[0].focus(),!0):!1},v.focusLastFocusableElement=function(){return r.length>0?(r[r.length-1].focus(),!0):!1},v.isFocusInFirstItem=function(a){return r.length>0?(a.target||a.srcElement)===r[0]:!1},v.isFocusInLastItem=function(a){return r.length>0?(a.target||a.srcElement)===r[r.length-1]:!1},v.clearFocusListCache=function(){r=[],w=0},v.loadFocusElementList=function(a){if((void 0===r||!r.length)&&a){var b=a.value.modalDomEl;b&&b.length&&(r=b[0].querySelectorAll(x))}},v}]).provider("$uibModal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?c.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(e){function j(){return r}var l=c.defer(),m=c.defer(),n=c.defer(),o=c.defer(),p={result:l.promise,opened:m.promise,closed:n.promise,rendered:o.promise,close:function(a){return h.close(p,a)},dismiss:function(a){return h.dismiss(p,a)}};if(e=angular.extend({},a.options,e),e.resolve=e.resolve||{},e.appendTo=e.appendTo||d.find("body").eq(0),!e.template&&!e.templateUrl)throw new Error("One of template or templateUrl options is required.");var q,r=c.all([i(e),g.resolve(e.resolve,{},null,null)]);return q=k=c.all([k]).then(j,j).then(function(a){var c=e.scope||b,d=c.$new();d.$close=p.close,d.$dismiss=p.dismiss,d.$on("$destroy",function(){d.$$uibDestructionScheduled||d.$dismiss("$uibUnscheduledDestruction")});var g,i={};e.controller&&(i.$scope=d,i.$uibModalInstance=p,angular.forEach(a[1],function(a,b){i[b]=a}),g=f(e.controller,i),e.controllerAs&&(e.bindToController&&(g.$close=d.$close,g.$dismiss=d.$dismiss,angular.extend(g,c)),d[e.controllerAs]=g)),h.open(p,{scope:d,deferred:l,renderDeferred:o,closedDeferred:n,content:a[0],animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowTopClass:e.windowTopClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,size:e.size,openedClass:e.openedClass,appendTo:e.appendTo}),m.resolve(!0)},function(a){m.reject(a),l.reject(a)})["finally"](function(){k===q&&(k=null)}),p},j}]};return a}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(a){return{create:function(b,c,d){b.setNumPages=d.numPages?a(d.numPages).assign:angular.noop,b.ngModelCtrl={$setViewValue:angular.noop},b.init=function(e,f){b.ngModelCtrl=e,b.config=f,e.$render=function(){b.render()},d.itemsPerPage?c.$parent.$watch(a(d.itemsPerPage),function(a){b.itemsPerPage=parseInt(a,10),c.totalPages=b.calculateTotalPages(),b.updatePage()}):b.itemsPerPage=f.itemsPerPage,c.$watch("totalItems",function(a,d){(angular.isDefined(a)||a!==d)&&(c.totalPages=b.calculateTotalPages(),b.updatePage())})},b.calculateTotalPages=function(){var a=b.itemsPerPage<1?1:Math.ceil(c.totalItems/b.itemsPerPage);return Math.max(a||0,1)},b.render=function(){c.page=parseInt(b.ngModelCtrl.$viewValue,10)||1},c.selectPage=function(a,d){d&&d.preventDefault();var e=!c.ngDisabled||!d;e&&c.page!==a&&a>0&&a<=c.totalPages&&(d&&d.target&&d.target.blur(),b.ngModelCtrl.$setViewValue(a),b.ngModelCtrl.$render())},c.getText=function(a){return c[a+"Text"]||b.config[a+"Text"]},c.noPrevious=function(){return 1===c.page},c.noNext=function(){return c.page===c.totalPages},b.updatePage=function(){b.setNumPages(c.$parent,c.totalPages),c.page>c.totalPages?c.selectPage(c.totalPages):b.ngModelCtrl.$render()}}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(a,b,c,d){a.align=angular.isDefined(b.align)?a.$parent.$eval(b.align):d.align,c.create(this,a,b)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(a){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],controller:"UibPagerController",controllerAs:"pager",templateUrl:function(a,b){return b.templateUrl||"uib/template/pager/pager.html"},replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&f.init(g,a)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(a,b,c,d,e){function f(a,b,c){return{number:a,text:b,active:c}}function g(a,b){var c=[],d=1,e=b,g=angular.isDefined(i)&&b>i;g&&(j?(d=Math.max(a-Math.floor(i/2),1),e=d+i-1,e>b&&(e=b,d=e-i+1)):(d=(Math.ceil(a/i)-1)*i+1,e=Math.min(d+i-1,b)));for(var h=d;e>=h;h++){var m=f(h,h,h===a);c.push(m)}if(g&&i>0&&(!j||k||l)){if(d>1){if(!l||d>3){var n=f(d-1,"...",!1);c.unshift(n)}if(l){if(3===d){var o=f(2,"2",!1);c.unshift(o)}var p=f(1,"1",!1);c.unshift(p)}}if(b>e){if(!l||b-2>e){var q=f(e+1,"...",!1);c.push(q)}if(l){if(e===b-2){var r=f(b-1,b-1,!1);c.push(r)}var s=f(b,b,!1);c.push(s)}}}return c}var h=this,i=angular.isDefined(b.maxSize)?a.$parent.$eval(b.maxSize):e.maxSize,j=angular.isDefined(b.rotate)?a.$parent.$eval(b.rotate):e.rotate,k=angular.isDefined(b.forceEllipses)?a.$parent.$eval(b.forceEllipses):e.forceEllipses,l=angular.isDefined(b.boundaryLinkNumbers)?a.$parent.$eval(b.boundaryLinkNumbers):e.boundaryLinkNumbers;a.boundaryLinks=angular.isDefined(b.boundaryLinks)?a.$parent.$eval(b.boundaryLinks):e.boundaryLinks,a.directionLinks=angular.isDefined(b.directionLinks)?a.$parent.$eval(b.directionLinks):e.directionLinks,d.create(this,a,b),b.maxSize&&a.$parent.$watch(c(b.maxSize),function(a){i=parseInt(a,10),h.render()});var m=this.render;this.render=function(){m(),a.page>0&&a.page<=a.totalPages&&(a.pages=g(a.page,a.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(a,b){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"uib/template/pagination/pagination.html"},replace:!0,link:function(a,c,d,e){var f=e[0],g=e[1];g&&f.init(g,b)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(e,f,g,h,i,j,k,l,m){function n(a){if(27===a.which){var b=o.top();b&&(b.value.close(),o.removeTop(),b=null)}}var o=m.createNew();return h.on("keypress",n),k.$on("$destroy",function(){h.off("keypress",n)}),function(e,k,m,n){function p(a){var b=(a||n.trigger||m).split(" "),d=b.map(function(a){return c[a]||a});return{show:b,hide:d}}n=angular.extend({},b,d,n);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="<div "+q+'-popup title="'+r+"title"+s+'" '+(n.useContentExp?'content-exp="contentExp()" ':'content="'+r+"content"+s+'" ')+'placement="'+r+"placement"+s+'" popup-class="'+r+"popupClass"+s+'" animation="animation" is-open="isOpen"origin-scope="origScope" style="visibility: hidden; display: block; top: -9999px; left: -9999px;"></div>';return{compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){M.isOpen?q():m()}function m(){(!L||a.$eval(d[k+"Enable"]))&&(u(),x(),M.popupDelay?G||(G=g(r,M.popupDelay,!1)):r())}function q(){s(),M.popupCloseDelay?H||(H=g(t,M.popupCloseDelay,!1)):t()}function r(){return s(),u(),M.content?(v(),void M.$evalAsync(function(){M.isOpen=!0,y(!0),R()})):angular.noop}function s(){G&&(g.cancel(G),G=null),I&&(g.cancel(I),I=null)}function t(){M&&M.$evalAsync(function(){M.isOpen=!1,y(!1),M.animation?F||(F=g(w,150,!1)):w()})}function u(){H&&(g.cancel(H),H=null),F&&(g.cancel(F),F=null)}function v(){D||(E=M.$new(),D=c(E,function(a){J?h.find("body").append(a):b.after(a)}),z())}function w(){s(),u(),A(),D&&(D.remove(),D=null),E&&(E.$destroy(),E=null)}function x(){M.title=d[k+"Title"],P?M.content=P(a):M.content=d[e],M.popupClass=d[k+"Class"],M.placement=angular.isDefined(d[k+"Placement"])?d[k+"Placement"]:n.placement;var b=parseInt(d[k+"PopupDelay"],10),c=parseInt(d[k+"PopupCloseDelay"],10);M.popupDelay=isNaN(b)?n.popupDelay:b,M.popupCloseDelay=isNaN(c)?n.popupCloseDelay:c}function y(b){O&&angular.isFunction(O.assign)&&O.assign(a,b)}function z(){Q.length=0,P?(Q.push(a.$watch(P,function(a){M.content=a,!a&&M.isOpen&&t()})),Q.push(E.$watch(function(){N||(N=!0,E.$$postDigest(function(){N=!1,M&&M.isOpen&&R()}))}))):Q.push(d.$observe(e,function(a){M.content=a,!a&&M.isOpen?t():R()})),Q.push(d.$observe(k+"Title",function(a){M.title=a,M.isOpen&&R()})),Q.push(d.$observe(k+"Placement",function(a){M.placement=a?a:n.placement,M.isOpen&&R()}))}function A(){Q.length&&(angular.forEach(Q,function(a){a()}),Q.length=0)}function B(a){M&&M.isOpen&&D&&(b[0].contains(a.target)||D[0].contains(a.target)||q())}function C(){var a=d[k+"Trigger"];S(),K=p(a),"none"!==K.show&&K.show.forEach(function(a,c){"outsideClick"===a?(b.on("click",j),h.on("click",B)):a===K.hide[c]?b.on(a,j):a&&(b.on(a,m),b.on(K.hide[c],q)),b.on("keypress",function(a){27===a.which&&q()})})}var D,E,F,G,H,I,J=angular.isDefined(n.appendToBody)?n.appendToBody:!1,K=p(void 0),L=angular.isDefined(d[k+"Enable"]),M=a.$new(!0),N=!1,O=angular.isDefined(d[k+"IsOpen"])?l(d[k+"IsOpen"]):!1,P=n.useContentExp?l(d[e]):!1,Q=[],R=function(){D&&D.html()&&(I||(I=g(function(){D.css({top:0,left:0});var a=i.positionElements(b,D,M.placement,J);D.css({top:a.top+"px",left:a.left+"px",visibility:"visible"}),n.placementClassPrefix&&D.removeClass("top bottom left right"),D.removeClass(n.placementClassPrefix+"top "+n.placementClassPrefix+"top-left "+n.placementClassPrefix+"top-right "+n.placementClassPrefix+"bottom "+n.placementClassPrefix+"bottom-left "+n.placementClassPrefix+"bottom-right "+n.placementClassPrefix+"left "+n.placementClassPrefix+"left-top "+n.placementClassPrefix+"left-bottom "+n.placementClassPrefix+"right "+n.placementClassPrefix+"right-top "+n.placementClassPrefix+"right-bottom");var c=a.placement.split("-");D.addClass(c[0],n.placementClassPrefix+a.placement),i.positionArrow(D,a.placement),I=null},0,!1)))};M.origScope=a,M.isOpen=!1,o.add(M,{close:t}),M.contentExp=function(){return M.content},d.$observe("disabled",function(a){a&&s(),a&&M.isOpen&&t()}),O&&a.$watch(O,function(a){M&&!a===M.isOpen&&j()});var S=function(){K.show.forEach(function(a){"outsideClick"===a?b.off("click",j):(b.off(a,m),b.off(a,j))}),K.hide.forEach(function(a){"outsideClick"===a?h.off("click",B):b.off(a,q)})};C();var T=a.$eval(d[k+"Animation"]);M.animation=angular.isDefined(T)?!!T:n.animation;var U,V=k+"AppendToBody";U=V in d&&void 0===d[V]?!0:a.$eval(d[V]),J=angular.isDefined(U)?U:J,J&&a.$on("$locationChangeSuccess",function(){M.isOpen&&t()}),a.$on("$destroy",function(){S(),w(),o.remove(M),M=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.uibTooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("uibTooltipClasses",["$uibPosition",function(a){return{restrict:"A",link:function(b,c,d){if(b.placement){var e=a.parsePlacement(b.placement);c.addClass(e[0])}else c.addClass("top");b.popupClass&&c.addClass(b.popupClass),b.animation()&&c.addClass(d.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(a){return a("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(a){return a("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(a){return a("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{replace:!0,scope:{title:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(a){return a("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",title:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(a){return a("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{replace:!0,scope:{title:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(a){
return a("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(a.max)?a.max:c.max,this.addBar=function(b,c,f){e||c.css({transition:"none"}),this.bars.push(b),b.max=a.max,b.title=f&&angular.isDefined(f.title)?f.title:"progressbar",b.$watch("value",function(a){b.recalculatePercentage()}),b.recalculatePercentage=function(){var a=d.bars.reduce(function(a,b){return b.percent=+(100*b.value/b.max).toFixed(2),a+b.percent},0);a>100&&(b.percent-=a-100)},b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1),this.bars.forEach(function(a){a.recalculatePercentage()})},a.$watch("max",function(b){d.bars.forEach(function(b){b.max=a.max,b.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{max:"=?"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b,c)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",max:"=?",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]),{title:c.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(d.$viewValue===b?0:b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect(),a.selectCalled=!1)}),a.active=!0,a.selectCalled||(a.onSelect(),a.selectCalled=!0)},b.addTab=function(a){c.push(a),1===c.length&&a.active!==!1?a.active=!0:a.active?b.select(a):a.active=!1},b.removeTab=function(a){var e=c.indexOf(a);if(a.active&&c.length>1&&!d){var f=e===c.length-1?e-1:e+1;b.select(c[f])}c.splice(e,1)};var d;a.$on("$destroy",function(){d=!0})}]).directive("uibTabset",function(){return{transclude:!0,replace:!0,scope:{type:"@"},controller:"UibTabsetController",templateUrl:"uib/template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("uibTab",["$parse",function(a){return{require:"^uibTabset",replace:!0,templateUrl:"uib/template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},controllerAs:"tab",link:function(b,c,d,e,f){b.$watch("active",function(a){a&&e.select(b)}),b.disabled=!1,d.disable&&b.$parent.$watch(a(d.disable),function(a){b.disabled=!!a}),b.select=function(){b.disabled||(b.active=!0)},e.addTab(b),b.$on("$destroy",function(){e.removeTab(b)}),b.$transcludeFn=f}}}]).directive("uibTabHeadingTransclude",function(){return{restrict:"A",require:"^uibTab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}).directive("uibTabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("uib-tab-heading")||a.hasAttribute("data-uib-tab-heading")||a.hasAttribute("x-uib-tab-heading")||"uib-tab-heading"===a.tagName.toLowerCase()||"data-uib-tab-heading"===a.tagName.toLowerCase()||"x-uib-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^uibTabset",link:function(b,c,d){var e=b.$eval(d.uibTabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("uibTimepickerConfig",{hourStep:1,minuteStep:1,secondStep:1,showMeridian:!0,showSeconds:!1,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0,showSpinners:!0,templateUrl:"uib/template/timepicker/timepicker.html"}).controller("UibTimepickerController",["$scope","$element","$attrs","$parse","$log","$locale","uibTimepickerConfig",function(a,b,c,d,e,f,g){function h(){var b=+a.hours,c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===t[1]&&(b+=12)),b):void 0}function i(){var b=+a.minutes;return b>=0&&60>b?b:void 0}function j(){var b=+a.seconds;return b>=0&&60>b?b:void 0}function k(a){return null===a?"":angular.isDefined(a)&&a.toString().length<2?"0"+a:a.toString()}function l(a){m(),s.$setViewValue(new Date(r)),n(a)}function m(){s.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1,a.invalidSeconds=!1}function n(b){if(s.$modelValue){var c=r.getHours(),d=r.getMinutes(),e=r.getSeconds();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:k(c),"m"!==b&&(a.minutes=k(d)),a.meridian=r.getHours()<12?t[0]:t[1],"s"!==b&&(a.seconds=k(e)),a.meridian=r.getHours()<12?t[0]:t[1]}else a.hours=null,a.minutes=null,a.seconds=null,a.meridian=t[0]}function o(a){r=q(r,a),l()}function p(a,b){return q(a,60*b)}function q(a,b){var c=new Date(a.getTime()+1e3*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes(),c.getSeconds()),d}var r=new Date,s={$setViewValue:angular.noop},t=angular.isDefined(c.meridians)?a.$parent.$eval(c.meridians):g.meridians||f.DATETIME_FORMATS.AMPMS;a.tabindex=angular.isDefined(c.tabindex)?c.tabindex:0,b.removeAttr("tabindex"),this.init=function(b,d){s=b,s.$render=this.render,s.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),f=d.eq(1),h=d.eq(2),i=angular.isDefined(c.mousewheel)?a.$parent.$eval(c.mousewheel):g.mousewheel;i&&this.setupMousewheelEvents(e,f,h);var j=angular.isDefined(c.arrowkeys)?a.$parent.$eval(c.arrowkeys):g.arrowkeys;j&&this.setupArrowkeyEvents(e,f,h),a.readonlyInput=angular.isDefined(c.readonlyInput)?a.$parent.$eval(c.readonlyInput):g.readonlyInput,this.setupInputEvents(e,f,h)};var u=g.hourStep;c.hourStep&&a.$parent.$watch(d(c.hourStep),function(a){u=+a});var v=g.minuteStep;c.minuteStep&&a.$parent.$watch(d(c.minuteStep),function(a){v=+a});var w;a.$parent.$watch(d(c.min),function(a){var b=new Date(a);w=isNaN(b)?void 0:b});var x;a.$parent.$watch(d(c.max),function(a){var b=new Date(a);x=isNaN(b)?void 0:b});var y=!1;c.ngDisabled&&a.$parent.$watch(d(c.ngDisabled),function(a){y=a}),a.noIncrementHours=function(){var a=p(r,60*u);return y||a>x||r>a&&w>a},a.noDecrementHours=function(){var a=p(r,60*-u);return y||w>a||a>r&&a>x},a.noIncrementMinutes=function(){var a=p(r,v);return y||a>x||r>a&&w>a},a.noDecrementMinutes=function(){var a=p(r,-v);return y||w>a||a>r&&a>x},a.noIncrementSeconds=function(){var a=q(r,z);return y||a>x||r>a&&w>a},a.noDecrementSeconds=function(){var a=q(r,-z);return y||w>a||a>r&&a>x},a.noToggleMeridian=function(){return r.getHours()<12?y||p(r,720)>x:y||p(r,-720)<w};var z=g.secondStep;c.secondStep&&a.$parent.$watch(d(c.secondStep),function(a){z=+a}),a.showSeconds=g.showSeconds,c.showSeconds&&a.$parent.$watch(d(c.showSeconds),function(b){a.showSeconds=!!b}),a.showMeridian=g.showMeridian,c.showMeridian&&a.$parent.$watch(d(c.showMeridian),function(b){if(a.showMeridian=!!b,s.$error.time){var c=h(),d=i();angular.isDefined(c)&&angular.isDefined(d)&&(r.setHours(c),l())}else n()}),this.setupMousewheelEvents=function(b,c,d){var e=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){y||a.$apply(e(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){y||a.$apply(e(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()}),d.bind("mousewheel wheel",function(b){y||a.$apply(e(b)?a.incrementSeconds():a.decrementSeconds()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c,d){b.bind("keydown",function(b){y||(38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply()))}),c.bind("keydown",function(b){y||(38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply()))}),d.bind("keydown",function(b){y||(38===b.which?(b.preventDefault(),a.incrementSeconds(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementSeconds(),a.$apply()))})},this.setupInputEvents=function(b,c,d){if(a.readonlyInput)return a.updateHours=angular.noop,a.updateMinutes=angular.noop,void(a.updateSeconds=angular.noop);var e=function(b,c,d){s.$setViewValue(null),s.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c),angular.isDefined(d)&&(a.invalidSeconds=d)};a.updateHours=function(){var a=h(),b=i();s.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(r.setHours(a),r.setMinutes(b),w>r||r>x?e(!0):l("h")):e(!0)},b.bind("blur",function(b){s.$setTouched(),null===a.hours||""===a.hours?e(!0):!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=k(a.hours)})}),a.updateMinutes=function(){var a=i(),b=h();s.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(r.setHours(b),r.setMinutes(a),w>r||r>x?e(void 0,!0):l("m")):e(void 0,!0)},c.bind("blur",function(b){s.$setTouched(),null===a.minutes?e(void 0,!0):!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=k(a.minutes)})}),a.updateSeconds=function(){var a=j();s.$setDirty(),angular.isDefined(a)?(r.setSeconds(a),l("s")):e(void 0,void 0,!0)},d.bind("blur",function(b){!a.invalidSeconds&&a.seconds<10&&a.$apply(function(){a.seconds=k(a.seconds)})})},this.render=function(){var b=s.$viewValue;isNaN(b)?(s.$setValidity("time",!1),e.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(r=b),w>r||r>x?(s.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):m(),n())},a.showSpinners=angular.isDefined(c.showSpinners)?a.$parent.$eval(c.showSpinners):g.showSpinners,a.incrementHours=function(){a.noIncrementHours()||o(60*u*60)},a.decrementHours=function(){a.noDecrementHours()||o(60*-u*60)},a.incrementMinutes=function(){a.noIncrementMinutes()||o(60*v)},a.decrementMinutes=function(){a.noDecrementMinutes()||o(60*-v)},a.incrementSeconds=function(){a.noIncrementSeconds()||o(z)},a.decrementSeconds=function(){a.noDecrementSeconds()||o(-z)},a.toggleMeridian=function(){var b=i(),c=h();a.noToggleMeridian()||(angular.isDefined(b)&&angular.isDefined(c)?o(720*(r.getHours()<12?60:-60)):a.meridian=a.meridian===t[0]?t[1]:t[0])},a.blur=function(){s.$setTouched()}}]).directive("uibTimepicker",["uibTimepickerConfig",function(a){return{require:["uibTimepicker","?^ngModel"],controller:"UibTimepickerController",controllerAs:"timepicker",replace:!0,scope:{},templateUrl:function(b,c){return c.templateUrl||a.templateUrl},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){N.moveInProgress||(N.moveInProgress=!0,N.$digest()),Y()}function o(){N.position=D?l.offset(b):l.position(b),N.position.top+=b.prop("offsetHeight")}var p,q,r=[9,13,27,38,40],s=200,t=a.$eval(c.typeaheadMinLength);t||0===t||(t=1);var u=a.$eval(c.typeaheadWaitMs)||0,v=a.$eval(c.typeaheadEditable)!==!1;a.$watch(c.typeaheadEditable,function(a){v=a!==!1});var w,x,y=e(c.typeaheadLoading).assign||angular.noop,z=e(c.typeaheadOnSelect),A=angular.isDefined(c.typeaheadSelectOnBlur)?a.$eval(c.typeaheadSelectOnBlur):!1,B=e(c.typeaheadNoResults).assign||angular.noop,C=c.typeaheadInputFormatter?e(c.typeaheadInputFormatter):void 0,D=c.typeaheadAppendToBody?a.$eval(c.typeaheadAppendToBody):!1,E=c.typeaheadAppendTo?a.$eval(c.typeaheadAppendTo):null,F=a.$eval(c.typeaheadFocusFirst)!==!1,G=c.typeaheadSelectOnExact?a.$eval(c.typeaheadSelectOnExact):!1,H=e(c.typeaheadIsOpen).assign||angular.noop,I=a.$eval(c.typeaheadShowHint)||!1,J=e(c.ngModel),K=e(c.ngModel+"($$$p)"),L=function(b,c){return angular.isFunction(J(a))&&q&&q.$options&&q.$options.getterSetter?K(b,{$$$p:c}):J.assign(b,c)},M=m.parse(c.uibTypeahead),N=a.$new(),O=a.$on("$destroy",function(){N.$destroy()});N.$on("$destroy",O);var P="typeahead-"+N.$id+"-"+Math.floor(1e4*Math.random());b.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":P});var Q,R;I&&(Q=angular.element("<div></div>"),Q.css("position","relative"),b.after(Q),R=b.clone(),R.attr("placeholder",""),R.val(""),R.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),b.css({position:"relative","vertical-align":"top","background-color":"transparent"}),Q.append(R),R.after(b));var S=angular.element("<div uib-typeahead-popup></div>");S.attr({id:P,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(c.typeaheadTemplateUrl)&&S.attr("template-url",c.typeaheadTemplateUrl),angular.isDefined(c.typeaheadPopupTemplateUrl)&&S.attr("popup-template-url",c.typeaheadPopupTemplateUrl);var T=function(){I&&R.val("")},U=function(){N.matches=[],N.activeIdx=-1,b.attr("aria-expanded",!1),T()},V=function(a){return P+"-option-"+a};N.$watch("activeIdx",function(a){0>a?b.removeAttr("aria-activedescendant"):b.attr("aria-activedescendant",V(a))});var W=function(a,b){return N.matches.length>b&&a?a.toUpperCase()===N.matches[b].label.toUpperCase():!1},X=function(c,d){var e={$viewValue:c};y(a,!0),B(a,!1),f.when(M.source(a,e)).then(function(f){var g=c===p.$viewValue;if(g&&w)if(f&&f.length>0){N.activeIdx=F?0:-1,B(a,!1),N.matches.length=0;for(var h=0;h<f.length;h++)e[M.itemName]=f[h],N.matches.push({id:V(h),label:M.viewMapper(N,e),model:f[h]});if(N.query=c,o(),b.attr("aria-expanded",!0),G&&1===N.matches.length&&W(c,0)&&(angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(0,d)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(0,d)),I){var i=N.matches[0].label;c.length>0&&i.slice(0,c.length).toUpperCase()===c.toUpperCase()?R.val(c+i.slice(c.length)):R.val("")}}else U(),B(a,!0);g&&y(a,!1)},function(){U(),y(a,!1),B(a,!0)})};D&&(angular.element(i).on("resize",n),h.find("body").on("scroll",n));var Y=k(function(){N.matches.length&&o(),N.moveInProgress=!1},s);N.moveInProgress=!1,N.query=void 0;var Z,$=function(a){Z=g(function(){X(a)},u)},_=function(){Z&&g.cancel(Z)};U(),N.assignIsOpen=function(b){H(a,b)},N.select=function(d,e){var f,h,i={};x=!0,i[M.itemName]=h=N.matches[d].model,f=M.modelMapper(a,i),L(a,f),p.$setValidity("editable",!0),p.$setValidity("parse",!0),z(a,{$item:h,$model:f,$label:M.viewMapper(a,i),$event:e}),U(),N.$eval(c.typeaheadFocusOnSelect)!==!1&&g(function(){b[0].focus()},0,!1)},b.on("keydown",function(a){if(0!==N.matches.length&&-1!==r.indexOf(a.which)){if(-1===N.activeIdx&&(9===a.which||13===a.which))return U(),void N.$digest();a.preventDefault();var b;switch(a.which){case 9:case 13:N.$apply(function(){angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(N.activeIdx,a)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(N.activeIdx,a)});break;case 27:a.stopPropagation(),U(),N.$digest();break;case 38:N.activeIdx=(N.activeIdx>0?N.activeIdx:N.matches.length)-1,N.$digest(),b=S.find("li")[N.activeIdx],b.parentNode.scrollTop=b.offsetTop;break;case 40:N.activeIdx=(N.activeIdx+1)%N.matches.length,N.$digest(),b=S.find("li")[N.activeIdx],b.parentNode.scrollTop=b.offsetTop}}}),b.bind("focus",function(a){w=!0,0!==t||p.$viewValue||g(function(){X(p.$viewValue,a)},0)}),b.bind("blur",function(a){A&&N.matches.length&&-1!==N.activeIdx&&!x&&(x=!0,N.$apply(function(){angular.isObject(N.debounceUpdate)&&angular.isNumber(N.debounceUpdate.blur)?k(function(){N.select(N.activeIdx,a)},N.debounceUpdate.blur):N.select(N.activeIdx,a)})),!v&&p.$error.editable&&(p.$viewValue="",b.val("")),w=!1,x=!1});var aa=function(a){b[0]!==a.target&&3!==a.which&&0!==N.matches.length&&(U(),j.$$phase||N.$digest())};h.on("click",aa),a.$on("$destroy",function(){h.off("click",aa),(D||E)&&ba.remove(),D&&(angular.element(i).off("resize",n),h.find("body").off("scroll",n)),S.remove(),I&&Q.remove()});var ba=d(S)(N);D?h.find("body").append(ba):E?angular.element(E).eq(0).append(ba):b.after(ba),this.init=function(b,c){p=b,q=c,N.debounceUpdate=p.$options&&e(p.$options.debounce)(a),p.$parsers.unshift(function(b){return w=!0,0===t||b&&b.length>=t?u>0?(_(),$(b)):X(b):(y(a,!1),_(),U()),v?b:b?void p.$setValidity("editable",!1):(p.$setValidity("editable",!0),null)}),p.$formatters.push(function(b){var c,d,e={};return v||p.$setValidity("editable",!0),C?(e.$model=b,C(a,e)):(e[M.itemName]=b,c=M.viewMapper(a,e),e[M.itemName]=void 0,d=M.viewMapper(a,e),c!==d?c:b)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","^?ngModelOptions","uibTypeahead"],link:function(a,b,c,d){d[2].init(d[0],d[1])}}}).directive("uibTypeaheadPopup",["$$debounce",function(a){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(b,c,d){b.templateUrl=d.templateUrl,b.isOpen=function(){var a=b.matches.length>0;return b.assignIsOpen({isOpen:a}),a},b.isActive=function(a){return b.active===a},b.selectActive=function(a){b.active=a},b.selectMatch=function(c,d){var e=b.debounce();angular.isNumber(e)||angular.isObject(e)?a(function(){b.select({activeIdx:c,evt:d})},angular.isNumber(e)?e:e["default"]):b.select({activeIdx:c,evt:d})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"uib/template/typeahead/typeahead-match.html";a(g).then(function(a){var c=angular.element(a.trim());e.replaceWith(c),b(c)(d)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"<strong>$&</strong>"):b,f||(b=a.trustAsHtml(b)),b}}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>')}),angular.module("ui.bootstrap.tabs").run(function(){!angular.$$csp().noInlineStyle&&angular.element(document).find("head").prepend('<style type="text/css">.uib-tab > div{position:relative;display:block;padding:10px 15px;outline:0;color:#337ab7;}.uib-tab > div:focus,.uib-tab > div:hover{background-color:#eee;color:#23527c;}.uib-tab.disabled > div{color:#777;}.uib-tab.disabled > div:focus,.uib-tab.disabled > div:hover{color:#777;cursor:not-allowed;background-color:transparent;}.nav-tabs > .uib-tab > div{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0;}.nav-tabs > .uib-tab > div:hover{border-color:#eee #eee #ddd;}.nav-tabs > .uib-tab.active > div,.nav-tabs > .uib-tab.active > div:focus,.nav-tabs > .uib-tab.active > div:hover{color:#555;cursor:default;background-color:#fff;border-color:#ddd #ddd transparent #ddd;}.nav-pills > .uib-tab > div{border-radius:4px;}.nav-pills > .uib-tab.active > div,.nav-pills > .uib-tab.active > div:focus,.nav-pills > .uib-tab.active > div:hover{color:#fff;background-color:#337ab7;}</style>')});
|
!function(){var checkboxValues={scrolling:{true:"yes",false:"no"},frameborder:{true:"1",false:"0"}};function loadValue(iframeNode){var isCheckbox=this instanceof CKEDITOR.ui.dialog.checkbox;if(iframeNode.hasAttribute(this.id)){var value=iframeNode.getAttribute(this.id);isCheckbox?this.setValue(checkboxValues[this.id].true==value.toLowerCase()):this.setValue(value)}}function commitValue(iframeNode){var isRemove=""===this.getValue(),isCheckbox=this instanceof CKEDITOR.ui.dialog.checkbox,value=this.getValue();isRemove?iframeNode.removeAttribute(this.att||this.id):isCheckbox?iframeNode.setAttribute(this.id,checkboxValues[this.id][value]):iframeNode.setAttribute(this.att||this.id,value)}CKEDITOR.dialog.add("iframe",function(editor){var iframeLang=editor.lang.iframe,commonLang=editor.lang.common,dialogadvtab=editor.plugins.dialogadvtab;return{title:iframeLang.title,minWidth:350,minHeight:260,onShow:function(){this.fakeImage=this.iframeNode=null;var fakeImage=this.getSelectedElement();if(fakeImage&&fakeImage.data("cke-real-element-type")&&"iframe"==fakeImage.data("cke-real-element-type")){this.fakeImage=fakeImage;var iframeNode=editor.restoreRealElement(fakeImage);this.iframeNode=iframeNode,this.setupContent(iframeNode)}},onOk:function(){var iframeNode;iframeNode=this.fakeImage?this.iframeNode:new CKEDITOR.dom.element("iframe");var extraStyles={},extraAttributes={};this.commitContent(iframeNode,extraStyles,extraAttributes);var newFakeImage=editor.createFakeElement(iframeNode,"cke_iframe","iframe",!0);newFakeImage.setAttributes(extraAttributes),newFakeImage.setStyles(extraStyles),this.fakeImage?(newFakeImage.replace(this.fakeImage),editor.getSelection().selectElement(newFakeImage)):editor.insertElement(newFakeImage)},contents:[{id:"info",label:commonLang.generalTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{id:"src",type:"text",label:commonLang.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(iframeLang.noUrl),setup:loadValue,commit:commitValue,onLoad:function(iframeNode){var dialog=this.getDialog();document.getElementById(this._.inputId).addEventListener("paste",function(evt){QCMeditors.setItemsiFrameDialog(dialog,evt)})}}]},{type:"hbox",children:[{id:"width",type:"text",requiredContent:"iframe[width]",style:"width:100%",labelLayout:"vertical",label:commonLang.width,validate:CKEDITOR.dialog.validate.htmlLength(commonLang.invalidHtmlLength.replace("%1",commonLang.width)),setup:loadValue,commit:commitValue},{id:"height",type:"text",requiredContent:"iframe[height]",style:"width:100%",labelLayout:"vertical",label:commonLang.height,validate:CKEDITOR.dialog.validate.htmlLength(commonLang.invalidHtmlLength.replace("%1",commonLang.height)),setup:loadValue,commit:commitValue},{id:"align",type:"select",requiredContent:"iframe[align]",default:"",items:[[commonLang.notSet,""],[commonLang.left,"left"],[commonLang.right,"right"],[commonLang.alignTop,"top"],[commonLang.alignMiddle,"middle"],[commonLang.alignBottom,"bottom"]],style:"width:100%",labelLayout:"vertical",label:commonLang.align,setup:function(iframeNode,fakeImage){if(loadValue.apply(this,arguments),fakeImage){var fakeImageAlign=fakeImage.getAttribute("align");this.setValue(fakeImageAlign&&fakeImageAlign.toLowerCase()||"")}},commit:function(iframeNode,extraStyles,extraAttributes){commitValue.apply(this,arguments),this.getValue()&&(extraAttributes.align=this.getValue())}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"scrolling",type:"checkbox",requiredContent:"iframe[scrolling]",label:iframeLang.scrolling,setup:loadValue,commit:commitValue},{id:"frameborder",type:"checkbox",requiredContent:"iframe[frameborder]",label:iframeLang.border,setup:loadValue,commit:commitValue}]},{type:"hbox",widths:["50%","50%"],children:[{id:"name",type:"text",requiredContent:"iframe[name]",label:commonLang.name,setup:loadValue,commit:commitValue},{id:"title",type:"text",requiredContent:"iframe[title]",label:commonLang.advisoryTitle,setup:loadValue,commit:commitValue}]},{id:"longdesc",type:"text",requiredContent:"iframe[longdesc]",label:commonLang.longDescr,setup:loadValue,commit:commitValue}]},dialogadvtab&&dialogadvtab.createAdvancedTab(editor,{id:1,classes:1,styles:1},"iframe")]}})}();
|
const initialState = {
isLoggedIn: false
}
const TOGGLE_LOGIN = 'TOGGLE_LOGIN'
export function toggleLogin() {
return {
type: TOGGLE_LOGIN
}
}
export function userReducer(state = initialState, action) {
switch (action.type) {
case TOGGLE_LOGIN:
return {
...state,
isLoggedIn: !state.isLoggedIn
}
default:
return state
}
}
|
import React from 'react'
import PropTypes from 'prop-types'
import GlobalStyle from '../../styles/globalStyles'
// setting bootstrap css in helmet for now
import SiteMetaDataHelmet from '../SiteMetaDataHelmet'
import App from '../App'
// import AppContext from '../../context'
import Header from '../Header'
import Footer from '../Footer'
// import Ribbon from '../Ribbon'
import Sidebar from '../Sidebar'
import SkipLink from '../SkipLink'
import StyledScrollTop from '../ScrollToTopButton'
import '../../styles/bootstrap.scss'
const TemplateWrapper = ({ children }) => {
// const [nightMode, setNightMode] = useState(false)
return (
<>
<SiteMetaDataHelmet />
<GlobalStyle />
<App>
<SkipLink />
{/* <Ribbon /> */}
<Header />
<div className="row">
<div className="col-md-2">
<Sidebar />
</div>
<main id="main" tabIndex="-1" className="col-md-10">
{children}
</main>
<Footer />
<StyledScrollTop />
</div>
</App>
</>
)
}
TemplateWrapper.propTypes = {
children: PropTypes.object,
}
export default TemplateWrapper
|
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { Range } from '@ohif/ui';
import './SegmentationSettings.css';
const SegmentationSettings = ({ configuration, onBack, onChange }) => {
const [state, setState] = useState({
renderFill: configuration.renderFill,
renderOutline: configuration.renderOutline,
shouldRenderInactiveLabelmaps: configuration.shouldRenderInactiveLabelmaps,
fillAlpha: configuration.fillAlpha,
outlineAlpha: configuration.outlineAlpha,
outlineWidth: configuration.outlineWidth,
fillAlphaInactive: configuration.fillAlphaInactive,
outlineAlphaInactive: configuration.outlineAlphaInactive
});
useEffect(() => {
onChange(state);
}, [state]);
const check = field => {
setState(state => ({ ...state, [field]: !state[field] }));
};
const save = (field, value) => {
setState(state => ({ ...state, [field]: value }));
};
const toFloat = value => parseFloat(value / 100).toFixed(2);
return (
<div className="dcmseg-segmentation-settings">
<div className="settings-title">
<h3>Segmentations Settings</h3>
<button className="return-button" onClick={onBack}>
Back
</button>
</div>
<div
className="settings-group"
style={{ marginBottom: state.renderFill ? 15 : 0 }}
>
<CustomCheck
label="Segment Fill"
checked={state.renderFill}
onChange={() => check('renderFill')}
/>
{state.renderFill && (
<CustomRange
label="Opacity"
step={1}
min={0}
max={100}
value={state.fillAlpha * 100}
onChange={event => save('fillAlpha', toFloat(event.target.value))}
showPercentage
/>
)}
</div>
<div
className="settings-group"
style={{ marginBottom: state.renderOutline ? 15 : 0 }}
>
<CustomCheck
label="Segment Outline"
checked={state.renderOutline}
onChange={() => check('renderOutline')}
/>
{state.renderOutline && (
<>
<CustomRange
value={state.outlineAlpha * 100}
label="Opacity"
showPercentage
step={1}
min={0}
max={100}
onChange={event => save('outlineAlpha', toFloat(event.target.value))}
/>
<CustomRange
value={state.outlineWidth}
label="Width"
showValue
step={1}
min={0}
max={5}
onChange={event => save('outlineWidth', parseInt(event.target.value))}
/>
</>
)}
</div>
{(state.renderFill || state.renderOutline) && (
<div
className="settings-group"
style={{ marginBottom: state.shouldRenderInactiveLabelmaps ? 15 : 0 }}
>
<CustomCheck
label="Render inactive segmentations"
checked={state.shouldRenderInactiveLabelmaps}
onChange={() => check('shouldRenderInactiveLabelmaps')}
/>
{state.shouldRenderInactiveLabelmaps && (
<>
{state.renderFill && (
<CustomRange
label="Fill Opacity"
showPercentage
step={1}
min={0}
max={100}
value={state.fillAlphaInactive * 100}
onChange={event => save('fillAlphaInactive', toFloat(event.target.value))}
/>
)}
{state.renderOutline && (
<CustomRange
label="Outline Opacity"
showPercentage
step={1}
min={0}
max={100}
value={state.outlineAlphaInactive * 100}
onChange={event => save('outlineAlphaInactive', toFloat(event.target.value))}
/>
)}
</>
)}
</div>
)}
</div>
);
};
const CustomCheck = ({ label, checked, onChange }) => {
return (
<div className="custom-check">
<label>
<span>{label}</span>
<input type="checkbox" checked={checked} onChange={onChange} />
</label>
</div>
);
};
const CustomRange = props => {
const { label, onChange } = props;
return (
<div className="range">
<label htmlFor="range">{label}</label>
<Range
{...props}
onChange={event => {
event.persist();
onChange(event);
}}
/>
</div>
);
};
SegmentationSettings.propTypes = {
configuration: PropTypes.shape({
renderFill: PropTypes.bool.isRequired,
renderOutline: PropTypes.bool.isRequired,
shouldRenderInactiveLabelmaps: PropTypes.bool.isRequired,
fillAlpha: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, /* TODO: why fillAlpha is string? */
outlineAlpha: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, /* TODO: why fillAlpha is string? */
outlineWidth: PropTypes.number.isRequired,
fillAlphaInactive: PropTypes.number.isRequired,
outlineAlphaInactive: PropTypes.number.isRequired,
}).isRequired,
onBack: PropTypes.func.isRequired,
onChange: PropTypes.func.isRequired,
};
export default SegmentationSettings;
|
import {Author} from "../../entities/library/author"
import {ItemAbstractReviver} from "@rebolon/json-reviver";
export class AuthorReviver extends ItemAbstractReviver
{
/**
*
* @returns {string}
*/
getNodeName() {
return 'author'
}
/**
*
* @returns {Object}
*/
getNewEntity() {
return new Author()
}
/**
* {@inheritdoc}
* for this kind of json:
* {
* "author": {
* "firstname": "Paul",
* "lastname": "Smith"
* }
* }
*/
public getEzPropsName()
{
return ['id', 'firstname', 'lastname', ]
}
/**
* {@inheritdoc}
*/
public getManyRelPropsName()
{
return {}
}
/**
* {@inheritdoc}
*/
public getOneRelPropsName()
{
return {}
}
}
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
SORT_ASC: 'asc',
SORT_DESC: 'desc',
ROW_SELECT_SINGLE: 'radio',
ROW_SELECT_MULTIPLE: 'checkbox',
ROW_SELECT_DISABLED: 'ROW_SELECT_DISABLED',
CHECKBOX_STATUS_CHECKED: 'checked',
CHECKBOX_STATUS_INDETERMINATE: 'indeterminate',
CHECKBOX_STATUS_UNCHECKED: 'unchecked'
};
|
jest.mock(`fs-extra`, () => {
return {
existsSync: () => false,
copy: jest.fn(),
}
})
const Remark = require(`remark`)
const fsExtra = require(`fs-extra`)
const path = require(`path`)
const plugin = require(`../`)
const remark = new Remark().data(`settings`, {
commonmark: true,
footnotes: true,
pedantic: true,
})
describe(`gatsby-remark-copy-linked-files`, () => {
afterEach(() => {
fsExtra.copy.mockReset()
})
const markdownNode = {
parent: {},
}
const getNode = () => {
return {
dir: ``,
internal: {
type: `File`,
},
}
}
const getFiles = filePath => [
{
absolutePath: path.normalize(filePath),
internal: {},
extension: filePath
.split(`.`)
.pop()
.trim(),
},
]
describe(`images`, () => {
;[`svg`, `gif`].forEach(extension => {
it(`can copy .${extension}`, async () => {
const path = `images/sample-image.${extension}`
const markdownAST = remark.parse(``)
await plugin({
files: getFiles(path),
markdownAST,
markdownNode,
getNode,
})
expect(fsExtra.copy).toHaveBeenCalledWith(
expect.any(String),
expect.any(String)
)
})
})
;[`png`, `jpg`, `jpeg`].forEach(extension => {
it(`ignores images with .${extension}`, async () => {
const path = `images/sample-image.${extension}`
const markdownAST = remark.parse(``)
await plugin({
files: getFiles(path),
markdownAST,
markdownNode,
getNode,
})
expect(fsExtra.copy).not.toHaveBeenCalled()
})
})
})
it(`can copy file links`, async () => {
const path = `files/sample-file.txt`
const markdownAST = remark.parse(`[path to file](${path})`)
await plugin({ files: getFiles(path), markdownAST, markdownNode, getNode })
expect(fsExtra.copy).toHaveBeenCalled()
})
it(`can copy HTML images`, async () => {
const path = `images/sample-image.gif`
const markdownAST = remark.parse(`<img src="${path}">`)
await plugin({ files: getFiles(path), markdownAST, markdownNode, getNode })
expect(fsExtra.copy).toHaveBeenCalled()
})
it(`can copy HTML multiple images`, async () => {
const path1 = `images/sample-image.gif`
const path2 = `images/another-sample-image.gif`
const markdownAST = remark.parse(
`<div><img src="${path1}"><img src="${path2}"></div>`
)
await plugin({
files: [...getFiles(path1), ...getFiles(path2)],
markdownAST,
markdownNode,
getNode,
})
expect(fsExtra.copy).toHaveBeenCalledTimes(2)
})
it(`leaves absolute file paths alone`, async () => {
const path = `https://google.com/images/sample-image.gif`
const markdownAST = remark.parse(``)
await plugin({ files: getFiles(path), markdownAST, markdownNode, getNode })
expect(fsExtra.copy).not.toHaveBeenCalled()
})
})
|
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Geodesy Test Harness - utm/mgrs (c) Chris Veness 2014-2019 */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* eslint-disable space-in-parens */
import Mgrs, { Utm, LatLon, Dms } from '../mgrs.js';
if (typeof window == 'undefined') { // node
import('chai').then(chai => global.should = chai.should());
} else { // browser
window.should = chai.should();
}
describe('utm/mgrs', function() {
const test = it; // just an alias
Dms.separator = ''; // tests are easier without any DMS separator
// useful for manual checks: www.rcn.montana.edu/resources/converter.aspx
describe('@examples UTM', function() {
test('constructor', () => new Utm(31, 'N', 448251, 5411932).toString().should.equal('31 N 448251 5411932'));
test('toLatLon', () => new Utm(31, 'N', 448251.795, 5411932.678).toLatLon().toString().should.equal('48.8582°N, 002.2945°E'));
test('parse', () => Utm.parse('31 N 448251 5411932').toString().should.equal('31 N 448251 5411932'));
test('toString', () => new Utm('31', 'N', 448251, 5411932).toString(4).should.equal('31 N 448251.0000 5411932.0000'));
test('README', () => Utm.parse('48 N 377298.745 1483034.794').toLatLon().toUtm().toString(3).should.equal('48 N 377298.745 1483034.794'));
});
describe('@examples MGRS', function() {
test('constructor', () => new Mgrs(31, 'U', 'D', 'Q', 48251, 11932).toString().should.equal('31U DQ 48251 11932'));
test('toUtm', () => Mgrs.parse('31U DQ 48251 11932').toUtm().toString().should.equal('31 N 448251 5411932'));
test('parse', () => Mgrs.parse('31U DQ 48251 11932').toString().should.equal('31U DQ 48251 11932'));
test('parse military-style', () => Mgrs.parse('31UDQ4825111932').toString().should.equal('31U DQ 48251 11932'));
});
describe('@examples LatLon', function() {
test('toUtm', () => new LatLon(48.8582, 2.2945).toUtm().toString().should.equal('31 N 448252 5411933'));
});
describe('UTM constructor fail', function() {
test('zone fail', () => should.Throw(function() { new Utm(0, 'N', 0, 0); }, RangeError, 'invalid UTM zone ‘0’'));
test('zone fail', () => should.Throw(function() { new Utm(61, 'N', 0, 0); }, RangeError, 'invalid UTM zone ‘61’'));
test('hemisphere fail', () => should.Throw(function() { new Utm(1, 'E', 0, 0); }, RangeError, 'invalid UTM hemisphere ‘E’'));
test('easting fail', () => should.Throw(function() { new Utm(1, 'N', 1001e3, 0); }, RangeError, 'invalid UTM easting ‘1001000’'));
test('northing N fail', () => should.Throw(function() { new Utm(1, 'N', 0, 9329e3); }, RangeError, 'invalid UTM northing ‘9329000’'));
test('northing S fail', () => should.Throw(function() { new Utm(1, 'S', 0, 1118e3); }, RangeError, 'invalid UTM northing ‘1118000’'));
});
describe('MGRS constructor fail', function() {
test('bad zone', () => should.Throw(function() { new Mgrs(0, 'C', 'A', 'A', 0, 0); }, RangeError, 'MGRS zone ‘0’ out of range'));
test('bad band', () => should.Throw(function() { new Mgrs(1, 'A', 'A', 'A', 0, 0); }, RangeError, 'invalid MGRS band ‘A’'));
test('bad grid sq easting', () => should.Throw(function() { new Mgrs(1, 'C', 'I', 'A', 0, 0); }, RangeError, 'invalid MGRS 100km grid square column ‘I’ for zone 1'));
test('bad grid sq northing', () => should.Throw(function() { new Mgrs(1, 'C', 'A', 'I', 0, 0); }, RangeError, 'invalid MGRS 100km grid square row ‘I’'));
test('invalid grid sq e', () => should.Throw(function() { new Mgrs(2, 'C', 'A', 'A', 0, 0); }, RangeError, 'invalid MGRS 100km grid square column ‘A’ for zone 2'));
test('bad easting', () => should.Throw(function() { new Mgrs(1, 'C', 'A', 'A', 'x', 0); }, RangeError, 'invalid MGRS easting ‘x’'));
test('bad northing', () => should.Throw(function() { new Mgrs(1, 'C', 'A', 'A', 0, 'x'); }, RangeError, 'invalid MGRS northing ‘x’'));
test('too far north', () => should.Throw(function() { new Mgrs(1, 'C', 'A', 'A', 0, 'x'); }, RangeError, 'invalid MGRS northing ‘x’'));
test('bad multiples', () => should.Throw(function() { new Mgrs(1, 'A', 'A', 'I', 0, 0); }, RangeError, 'invalid MGRS band ‘A’, invalid MGRS 100km grid square row ‘I’'));
});
describe('UTM parse', function() {
test('parse fail', () => should.Throw(function() { Utm.parse('Cambridge'); }, Error, 'invalid UTM coordinate ‘Cambridge’'));
});
describe('toString', function() {
test('toString fail', () => should.Throw(function() { new Mgrs(1, 'C', 'A', 'A', 0, 0).toString(3); }, Error, 'invalid precision ‘3’'));
});
describe('MGRS parse', function() {
test('parse fail 1', () => should.Throw(function() { Mgrs.parse(null); }, Error, 'invalid MGRS grid reference ‘null’'));
test('parse fail 2', () => should.Throw(function() { Mgrs.parse('Cambridge'); }, Error, 'invalid MGRS grid reference ‘Cambridge’'));
test('parse fail 3', () => should.Throw(function() { Mgrs.parse('New York'); }, Error, 'invalid MGRS grid reference ‘New York’'));
});
describe('latitude/longitude -> UTM', function() {
test('0,0', () => new LatLon( 0, 0).toUtm().toString(6).should.equal('31 N 166021.443081 0.000000'));
test('1,1', () => new LatLon( 1, 1).toUtm().toString(5).should.equal('31 N 277438.26352 110597.97252'));
test('-1,-1', () => new LatLon(-1, -1).toUtm().toString(5).should.equal('30 S 722561.73648 9889402.02748'));
test('eiffel tower', () => new LatLon( 48.8583, 2.2945).toUtm().toString(3).should.equal('31 N 448251.898 5411943.794'));
test('sidney o/h', () => new LatLon(-33.857, 151.215 ).toUtm().toString(3).should.equal('56 S 334873.199 6252266.092'));
test('white house', () => new LatLon( 38.8977, -77.0365).toUtm().toString(3).should.equal('18 N 323394.296 4307395.634'));
test('rio christ', () => new LatLon(-22.9519, -43.2106).toUtm().toString(3).should.equal('23 S 683466.254 7460687.433'));
test('bergen', () => new LatLon( 60.39135, 5.3249).toUtm().toString(2).should.equal('32 N 297508.41 6700645.30'));
test('bergen convergence', () => new LatLon( 60.39135, 5.3249).toUtm().convergence.should.equal(-3.196281440));
test('bergen scale', () => new LatLon( 60.39135, 5.3249).toUtm().scale.should.equal( 1.000102473211));
});
describe('UTM -> latitude/longitude', function() {
test('0,0', () => Utm.parse('31 N 166021.443081 0.000000').toLatLon().toString().should.equal(new LatLon(0, 0).toString()));
test('1,1', () => Utm.parse('31 N 277438.263521 110597.972524').toLatLon().toString().should.equal(new LatLon( 1, 1).toString()));
test('-1,-1', () => Utm.parse('30 S 722561.736479 9889402.027476').toLatLon().toString().should.equal(new LatLon(-1, -1).toString()));
test('eiffel tower', () => Utm.parse('31 N 448251.898 5411943.794').toLatLon().toString().should.equal(new LatLon( 48.8583, 2.2945).toString()));
test('sidney o/h', () => Utm.parse('56 S 334873.199 6252266.092').toLatLon().toString().should.equal(new LatLon(-33.857, 151.215 ).toString()));
test('white house', () => Utm.parse('18 N 323394.296 4307395.634').toLatLon().toString().should.equal(new LatLon( 38.8977, -77.0365).toString()));
test('rio christ', () => Utm.parse('23 S 683466.254 7460687.433').toLatLon().toString().should.equal(new LatLon(-22.9519, -43.2106).toString()));
test('bergen', () => Utm.parse('32 N 297508.410 6700645.296').toLatLon().toString().should.equal(new LatLon( 60.39135, 5.3249).toString()));
test('bergen convergence', () => Utm.parse('32 N 297508.410 6700645.296').toLatLon().convergence.should.equal(-3.196281443));
test('bergen scale', () => Utm.parse('32 N 297508.410 6700645.296').toLatLon().scale.should.equal( 1.000102473212));
});
describe('UTM -> MGRS', function() {
test('0,0', () => Utm.parse('31 N 166021.443081 0.000000').toMgrs().toString().should.equal('31N AA 66021 00000'));
test('1,1', () => Utm.parse('31 N 277438.263521 110597.972524').toMgrs().toString().should.equal('31N BB 77438 10597'));
test('-1,-1', () => Utm.parse('30 S 722561.736479 9889402.027476').toMgrs().toString().should.equal('30M YD 22561 89402'));
test('eiffel tower', () => Utm.parse('31 N 448251.898 5411943.794').toMgrs().toString().should.equal('31U DQ 48251 11943'));
test('sidney o/h', () => Utm.parse('56 S 334873.199 6252266.092').toMgrs().toString().should.equal('56H LH 34873 52266'));
test('white house', () => Utm.parse('18 N 323394.296 4307395.634').toMgrs().toString().should.equal('18S UJ 23394 07395'));
test('rio christ', () => Utm.parse('23 S 683466.254 7460687.433').toMgrs().toString().should.equal('23K PQ 83466 60687'));
test('bergen', () => Utm.parse('32 N 297508.410 6700645.296').toMgrs().toString().should.equal('32V KN 97508 00645'));
});
describe('MGRS -> UTM', function() {
test('0,0', () => Mgrs.parse('31N AA 66021 00000').toUtm().toString().should.equal('31 N 166021 0'));
test('1,1', () => Mgrs.parse('31N BB 77438 10597').toUtm().toString().should.equal('31 N 277438 110597'));
test('-1,-1', () => Mgrs.parse('30M YD 22561 89402').toUtm().toString().should.equal('30 S 722561 9889402'));
test('eiffel tower', () => Mgrs.parse('31U DQ 48251 11943').toUtm().toString().should.equal('31 N 448251 5411943'));
test('sidney o/h', () => Mgrs.parse('56H LH 34873 52266').toUtm().toString().should.equal('56 S 334873 6252266'));
test('white house', () => Mgrs.parse('18S UJ 23394 07395').toUtm().toString().should.equal('18 N 323394 4307395'));
test('rio christ', () => Mgrs.parse('23K PQ 83466 60687').toUtm().toString().should.equal('23 S 683466 7460687'));
test('bergen', () => Mgrs.parse('32V KN 97508 00645').toUtm().toString().should.equal('32 N 297508 6700645'));
// forgiving parsing of 100km squares spanning bands
test('01P ≡ UTM 01Q', () => Mgrs.parse('01P ET 00000 68935').toUtm().toString().should.equal('01 N 500000 1768935'));
test('01Q ≡ UTM 01P', () => Mgrs.parse('01Q ET 00000 68935').toUtm().toString().should.equal('01 N 500000 1768935'));
});
describe('IBM coordconvert', function() {
// https://www.ibm.com/developerworks/library/j-coordconvert/#listing7 (note UTM/MGRS confusion; UTM is rounded, MGRS is truncated; UPS not included)
test('#01 UTM->LL', () => Utm.parse('31 N 166021 0').toLatLon().toString().should.equal('00.0000°N, 000.0000°W'));
test('#02 UTM->LL', () => Utm.parse('30 N 808084 14385').toLatLon().toString().should.equal('00.1300°N, 000.2324°W'));
test('#03 UTM->LL', () => Utm.parse('34 S 683473 4942631').toLatLon().toString().should.equal('45.6456°S, 023.3545°E'));
test('#04 UTM->LL', () => Utm.parse('25 S 404859 8588690').toLatLon().toString().should.equal('12.7650°S, 033.8765°W'));
test('#09 UTM->LL', () => Utm.parse('08 N 453580 2594272').toLatLon().toString().should.equal('23.4578°N, 135.4545°W'));
test('#10 UTM->LL', () => Utm.parse('57 N 450793 8586116').toLatLon().toString().should.equal('77.3450°N, 156.9876°E'));
test('#01 LL->UTM', () => new LatLon( 0.0000, 0.0000).toUtm().toString().should.equal('31 N 166021 0'));
test('#01 LL->MGRS', () => new LatLon( 0.0000, 0.0000).toUtm().toMgrs().toString().should.equal('31N AA 66021 00000'));
test('#02 LL->UTM', () => new LatLon( 0.1300, -0.2324).toUtm().toString().should.equal('30 N 808084 14386'));
test('#02 LL->MGRS', () => new LatLon( 0.1300, -0.2324).toUtm().toMgrs().toString().should.equal('30N ZF 08084 14385'));
test('#03 LL->UTM', () => new LatLon(-45.6456, 23.3545).toUtm().toString().should.equal('34 S 683474 4942631'));
test('#03 LL->MGRS', () => new LatLon(-45.6456, 23.3545).toUtm().toMgrs().toString().should.equal('34G FQ 83473 42631'));
test('#04 LL->UTM', () => new LatLon(-12.7650, -33.8765).toUtm().toString().should.equal('25 S 404859 8588691'));
test('#04 LL->MGRS', () => new LatLon(-12.7650, -33.8765).toUtm().toMgrs().toString().should.equal('25L DF 04859 88691'));
test('#09 LL->UTM', () => new LatLon( 23.4578, -135.4545).toUtm().toString().should.equal('08 N 453580 2594273'));
test('#09 LL->MGRS', () => new LatLon( 23.4578, -135.4545).toUtm().toMgrs().toString().should.equal('08Q ML 53580 94272'));
test('#10 LL->UTM', () => new LatLon( 77.3450, 156.9876).toUtm().toString().should.equal('57 N 450794 8586116'));
test('#10 LL->MGRS', () => new LatLon( 77.3450, 156.9876).toUtm().toMgrs().toString().should.equal('57X VF 50793 86116'));
});
describe('varying resolution', function() {
test('MGRS 4-digit -> UTM', () => Mgrs.parse('12S TC 52 86').toUtm().toString().should.equal('12 N 252000 3786000'));
test('MGRS 10-digit -> UTM', () => Mgrs.parse('12S TC 52000 86000').toUtm().toString().should.equal('12 N 252000 3786000'));
test('MGRS 10-digit+decimals', () => Mgrs.parse('12S TC 52000.123 86000.123').toUtm().toString(3).should.equal('12 N 252000.123 3786000.123'));
test('MGRS truncate', () => Mgrs.parse('12S TC 52999.999 86999.999').toString(6).should.equal('12S TC 529 869'));
test('MGRS-UTM round', () => Mgrs.parse('12S TC 52999.999 86999.999').toUtm().toString().should.equal('12 N 253000 3787000'));
});
describe('UTM fail', function() {
test('zone fail', () => should.Throw(function() { new LatLon(85, 0).toUtm(); }, RangeError, 'latitude ‘85’ outside UTM limits'));
});
describe('Norway/Svalbard adjustment', function() {
test('Norway 31->32', () => new LatLon(60, 4).toUtm().zone.should.equal(32));
test('Svalbard 32->31', () => new LatLon(75, 8).toUtm().zone.should.equal(31));
test('Svalbard 32->33', () => new LatLon(75, 10).toUtm().zone.should.equal(33));
test('Svalbard 34->33', () => new LatLon(75, 20).toUtm().zone.should.equal(33));
test('Svalbard 34->35', () => new LatLon(75, 22).toUtm().zone.should.equal(35));
test('Svalbard 36->35', () => new LatLon(75, 32).toUtm().zone.should.equal(35));
test('Svalbard 36->37', () => new LatLon(75, 34).toUtm().zone.should.equal(37));
});
});
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
const models = require('./index');
/**
* The service objectives capability.
*
*/
class ServiceObjectiveCapability {
/**
* Create a ServiceObjectiveCapability.
* @member {string} [name] The service objective name.
* @member {string} [status] The status of the service objective. Possible
* values include: 'Visible', 'Available', 'Default', 'Disabled'
* @member {string} [unit] Unit type used to measure service objective
* performance level. Possible values include: 'DTU'
* @member {number} [value] Performance level value.
* @member {uuid} [id] The unique ID of the service objective.
* @member {array} [supportedMaxSizes] The list of supported maximum database
* sizes for this service objective.
* @member {object} [includedMaxSize] The included (free) max size for this
* service level objective.
* @member {number} [includedMaxSize.limit] The maximum size of the database
* (see 'unit' for the units).
* @member {string} [includedMaxSize.unit] The units that the limit is
* expressed in. Possible values include: 'Megabytes', 'Gigabytes',
* 'Terabytes', 'Petabytes'
* @member {string} [includedMaxSize.status] The status of the maximum size
* capability. Possible values include: 'Visible', 'Available', 'Default',
* 'Disabled'
*/
constructor() {
}
/**
* Defines the metadata of ServiceObjectiveCapability
*
* @returns {object} metadata of ServiceObjectiveCapability
*
*/
mapper() {
return {
required: false,
serializedName: 'ServiceObjectiveCapability',
type: {
name: 'Composite',
className: 'ServiceObjectiveCapability',
modelProperties: {
name: {
required: false,
readOnly: true,
serializedName: 'name',
type: {
name: 'String'
}
},
status: {
required: false,
readOnly: true,
serializedName: 'status',
type: {
name: 'Enum',
allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ]
}
},
unit: {
required: false,
readOnly: true,
serializedName: 'performanceLevel.unit',
type: {
name: 'Enum',
allowedValues: [ 'DTU' ]
}
},
value: {
required: false,
readOnly: true,
serializedName: 'performanceLevel.value',
type: {
name: 'Number'
}
},
id: {
required: false,
readOnly: true,
serializedName: 'id',
type: {
name: 'String'
}
},
supportedMaxSizes: {
required: false,
readOnly: true,
serializedName: 'supportedMaxSizes',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'MaxSizeCapabilityElementType',
type: {
name: 'Composite',
className: 'MaxSizeCapability'
}
}
}
},
includedMaxSize: {
required: false,
readOnly: true,
serializedName: 'includedMaxSize',
type: {
name: 'Composite',
className: 'MaxSizeCapability'
}
}
}
}
};
}
}
module.exports = ServiceObjectiveCapability;
|
export const POKEMON_STATS = {
HP: "hp",
ATTACK: "attack",
DEFENSE: "defense",
SPECIAL_ATTACK: "special-attack",
SPECIAL_DEFENSE: "special-defense",
SPEED: "speed",
};
export const POKEMON_TYPES = {
normal: { name: { pt_br: "Normal" }, color: "#C4C0B4" },
fighting: { name: { pt_br: "Lutador" }, color: "#852816" },
flying: { name: { pt_br: "Voador" }, color: "#8FA4FF" },
poison: { name: { pt_br: "Venenoso" }, color: "#924990" },
ground: { name: { pt_br: "Terra" }, color: "#C5A455" },
rock: { name: { pt_br: "Pedra" }, color: "#5E491C" },
bug: { name: { pt_br: "Inseto" }, color: "#87950C" },
ghost: { name: { pt_br: "Fantasma" }, color: "#6969AF" },
steel: { name: { pt_br: "Metálico" }, color: "#7F8488" },
fire: { name: { pt_br: "Fogo" }, color: "#CF2C03" },
water: { name: { pt_br: "Água" }, color: "#3B9BF1" },
grass: { name: { pt_br: "Planta" }, color: "#67AF32" },
electric: { name: { pt_br: "Elétrico" }, color: "#E08D00" },
psychic: { name: { pt_br: "Psíquico" }, color: "#E25484" },
ice: { name: { pt_br: "Gelo" }, color: "#B4EDF8" },
dragon: { name: { pt_br: "Dragão" }, color: "#7361D1" },
dark: { name: { pt_br: "Noturno" }, color: "#413831" },
fairy: { name: { pt_br: "Fada" }, color: "#E29FE6" },
unknown: { name: { pt_br: "Desconhecido" }, color: "#000" },
shadow: { name: { pt_br: "Sombrio" }, color: "#2E3053" },
};
export const CURRENT_POKEMON_STATUS = {
NEW: "new",
CAPTURED: "captured",
CUSTOM: "custom",
};
|
(function(global, factory) {
if (typeof define === 'function' && define.amd) {
define(function() {
return factory(global, global.document);
});
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = factory(global, global.document);
} else {
global.Shake = factory(global, global.document);
}
} (typeof window !== 'undefined' ? window : this, function (window, document) {
'use strict';
function Shake(options) {
//feature detect
this.hasDeviceMotion = 'ondevicemotion' in window;
this.options = {
threshold: 15, //default velocity threshold for shake to register
timeout: 1000 //default interval between events
};
if (typeof options === 'object') {
for (var i in options) {
if (options.hasOwnProperty(i)) {
this.options[i] = options[i];
}
}
}
//use date to prevent multiple shakes firing
this.lastTime = new Date();
//accelerometer values
this.lastX = null;
this.lastY = null;
this.lastZ = null;
//create custom event
if (typeof document.CustomEvent === 'function') {
this.event = new document.CustomEvent('shake', {
bubbles: true,
cancelable: true
});
} else if (typeof document.createEvent === 'function') {
this.event = document.createEvent('Event');
this.event.initEvent('shake', true, true);
} else {
return false;
}
}
//reset timer values
Shake.prototype.reset = function () {
this.lastTime = new Date();
this.lastX = null;
this.lastY = null;
this.lastZ = null;
};
//start listening for devicemotion
Shake.prototype.start = function () {
this.reset();
if (this.hasDeviceMotion) {
window.addEventListener('devicemotion', this, false);
}
};
//stop listening for devicemotion
Shake.prototype.stop = function () {
if (this.hasDeviceMotion) {
window.removeEventListener('devicemotion', this, false);
}
this.reset();
};
//calculates if shake did occur
Shake.prototype.devicemotion = function (e) {
var current = e.accelerationIncludingGravity;
var currentTime;
var timeDifference;
var deltaX = 0;
var deltaY = 0;
var deltaZ = 0;
if ((this.lastX === null) && (this.lastY === null) && (this.lastZ === null)) {
this.lastX = current.x;
this.lastY = current.y;
this.lastZ = current.z;
return;
}
deltaX = Math.abs(this.lastX - current.x);
deltaY = Math.abs(this.lastY - current.y);
deltaZ = Math.abs(this.lastZ - current.z);
if (((deltaX > this.options.threshold) && (deltaY > this.options.threshold)) || ((deltaX > this.options.threshold) && (deltaZ > this.options.threshold)) || ((deltaY > this.options.threshold) && (deltaZ > this.options.threshold))) {
//calculate time in milliseconds since last shake registered
currentTime = new Date();
timeDifference = currentTime.getTime() - this.lastTime.getTime();
if (timeDifference > this.options.timeout) {
window.dispatchEvent(this.event);
this.lastTime = new Date();
}
}
this.lastX = current.x;
this.lastY = current.y;
this.lastZ = current.z;
};
//event handler
Shake.prototype.handleEvent = function (e) {
if (typeof (this[e.type]) === 'function') {
return this[e.type](e);
}
};
return Shake;
}));
|
import React, { Component } from 'react'
import classNames from './styles/bpStyle.css'
import BPChart from './BPChart'
import BPForm from './BPForm'
//mobx
import store from './mobx/Store';
import { observer } from 'mobx-react'
class LoggedIn extends Component {
constructor(props) {
super(props)
}
componentDidMount() {
// console.log('login mounted')
// store.initializeAuth0(true);
}
render() {
return (
<div className={classNames.view}>
<BPForm />
<BPChart />
</div>
)
}
}
export default LoggedIn;
|
import React from "react";
import {useState,useEffect} from "react";
import {useHistory ,useParams} from "react-router-dom";
import SquareLoader from "../../components/SquareLoader";
import PopupForm from "../../components/PopupForm"
import API from "../../utils/API";
import errorHandler from "../../utils/errorHandler";
function EditAnswer() {
const [loading,setLoading]=useState(true);
const [question,setQuestion]=useState("");
const [answer,setAnswer]=useState("");
const [show_answer,setShowAnswer]=useState(false);
const history = useHistory();
const {ANSWER_ID} = useParams();
useEffect(()=>{
API.getMyAnswer(ANSWER_ID)
.then((res)=>{
setLoading(false);
if(res.data.status==="sucess"){
setAnswer(res.data.answer.answer);
}else{
errorHandler(true,res.data.msg);
}
})
.catch((res)=>{
setLoading(false);
res=res.response
if(res.data && res.data.msg){
errorHandler(true,res.data.msg);
}else{
errorHandler(true);
console.log(res)
}
});
},[ANSWER_ID])
let validateForm=()=>{
if(answer){
return true;
}else{
return false;
}
}
let submitAnswer=()=>{
if(validateForm()){
setLoading(true);
API.updateMyAnswer({answer_id:ANSWER_ID,answer})
.then((res)=>{
setLoading(false);
if(res.data.status==="sucess"){
errorHandler(false,
"Your Answer Updated sucessfully."
).then(()=>{history.push("/user/myAnswers");});
}
else{
errorHandler(true,res.data.msg);
}
})
.catch((res)=>{
setLoading(false);
res=res.response
if(res.data && res.data.msg){
errorHandler(true,res.data.msg);
}else{
errorHandler(true);
}
});
}
}
return ( <>
<SquareLoader loading={loading}/>
<PopupForm
show_answer={!loading}
setShowAnswer={()=>{history.push("/user/myAnswers")}}
answer={answer}
setAnswer={setAnswer}
submitAnswer={submitAnswer}
/>
</>);
}
export default EditAnswer;
|
function rgbToHexColor(red, green, blue) {
if (!Number.isInteger(red) || (red < 0) || (red > 255))
return undefined; // Red value is invalid
if (!Number.isInteger(green) || (green < 0) || (green > 255))
return undefined; // Green value is invalid
if (!Number.isInteger(blue) || (blue < 0) || (blue > 255))
return undefined; // Blue value is invalid
return "#" +
("0" + red.toString(16).toUpperCase()).slice(-2) +
("0" + green.toString(16).toUpperCase()).slice(-2) +
("0" + blue.toString(16).toUpperCase()).slice(-2);
}
module.exports = { rgbToHexColor };
|
export var esmDep = true;
(function(g) {
g.esmDep = 'esm-dep';
})(typeof window != 'undefined' ? window : global);
|
import React, { Component } from 'react';
import { connect } from 'react-redux';
import mapStoreToProps from '../../redux/mapStoreToProps';
//Material-UI imports
import {
TextField,
FormControl,
InputLabel,
Select,
MenuItem,
Button,
Chip,
Box,
LinearProgress,
} from '@material-ui/core';
import ImageUpload from '../../components/ImageUpload/ImageUpload';
class UserPageEdit extends Component {
state = {
first_name: this.props.store.user.first_name,
last_name: this.props.store.user.last_name,
zip_code: this.props.store.user.zip_code,
phone_number: this.props.store.user.phone_number,
email: this.props.store.user.email,
skills: [],
};
handleInputChangeFor = (propertyName) => (event) => {
this.setState({
[propertyName]: event.target.value,
});
};
handleEditActivities = () => {
const selected = [];
for (
let i = 0;
i < this.props.store.verifiedUserDetailReducer.skills_label_array.length;
i++
) {
selected.push(
this.props.store.verifiedUserDetailReducer.skills_label_array[i]
);
console.log(selected);
}
this.setState({
editActivitiesSelected: selected,
});
this.setState({
editActivitiesBtnSelected: true,
});
};
handlePhoneChange = (event) => {
const onlyNums = event.target.value.replace(/[^0-9]/g, '');
if (onlyNums.length < 10) {
this.setState({ phone_number: onlyNums });
} else if (onlyNums.length === 10) {
const number = onlyNums.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3');
this.setState({ phone_number: number });
}
};
handleZipChange = (event) => {
const onlyNums = event.target.value.replace(/[^0-9]/g, '');
if (onlyNums.length < 5) {
this.setState({ zip_code: onlyNums });
} else if (onlyNums.length === 5) {
const number = onlyNums.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3');
this.setState({ zip_code: number });
}
};
handleSubmit = (e) => {
this.props.dispatch({ type: 'PUT_USER', payload: this.state });
};
handleSwitchSkills = (skill) => {
switch (skill) {
case 1:
skill = 'JavaScript';
return skill;
break;
case 2:
skill = 'CSS';
return skill;
break;
case 3:
skill = 'HTML';
return skill;
break;
case 4:
skill = 'React';
return skill;
break;
case 5:
skill = 'Angular';
return skill;
break;
case 6:
skill = 'Python';
return skill;
case 7:
skill = 'C#';
return skill;
case 8:
skill = 'C++';
return skill;
case 9:
skill = 'C';
return skill;
case 10:
skill = 'Java';
return skill;
case 11:
skill = 'PostgreSQL';
return skill;
case 12:
skill = 'MongoDB';
return skill;
}
};
render() {
//loop through to get each skill from database
const skills = this.props.store.dropdown.skillReducer.map((item, index) => {
return (
<MenuItem value={item.id} key={index}>
{item.skills_label}
</MenuItem>
);
});
return this.props.store.user !== undefined ? (
//displays the edit form if user info is loaded
<div>
<div className="placeholder">
<ImageUpload />
</div>
<div className="profile-area">
<form onSubmit={this.handleSubmit}>
<Box mb={2}>
<div>
<TextField
style={{ backgroundColor: 'white' }}
fullWidth
size="small"
placeholder="first name"
type="text"
name="first_name"
value={this.state.first_name}
// required
variant="outlined"
onChange={this.handleInputChangeFor('first_name')}
/>
</div>
</Box>
<Box mb={2}>
<div>
<TextField
style={{ backgroundColor: 'white' }}
fullWidth
size="small"
placeholder="last name"
type="text"
name="last_name"
value={this.state.last_name}
// required
variant="outlined"
onChange={this.handleInputChangeFor('last_name')}
/>
</div>
</Box>
<Box mb={2}>
<div>
<TextField
style={{ backgroundColor: 'white' }}
fullWidth
size="small"
placeholder="zipcode"
type="number"
name="zip_code"
value={this.state.zip_code}
variant="outlined"
onChange={this.handleZipChange}
/>
</div>
</Box>
<Box mb={2}>
<div>
<TextField
style={{ backgroundColor: 'white' }}
fullWidth
size="small"
placeholder="phone number"
type="text"
name="phone_number"
value={this.state.phone_number}
variant="outlined"
onChange={this.handlePhoneChange}
/>
</div>
</Box>
<Box mb={2}>
<div>
<TextField
style={{ backgroundColor: 'white' }}
fullWidth
size="small"
placeholder="email"
type="email"
name="email"
value={this.state.email}
variant="outlined"
onChange={this.handleInputChangeFor('email')}
/>
</div>
</Box>
<FormControl variant="outlined" fullWidth>
<InputLabel id="skills">Edit your skills</InputLabel>
<Select
style={{ backgroundColor: 'white' }}
style={{ backgroundColor: 'white' }}
labelId="skills"
id="skills"
multiple
value={this.state.skills}
onChange={this.handleInputChangeFor('skills')}
// input={<Input id="select-multiple-chip" />}
renderValue={(selected) => (
<div>
{selected.map((value) => (
<Chip
key={value}
label={this.handleSwitchSkills(value)}
/>
))}
</div>
)}
>
{skills}
</Select>
</FormControl>
<Box mt={2}>
<Button
variant="contained"
color="secondary"
type="submit"
// onClick={this.props.edit}
>
Update Profile
</Button>
</Box>
</form>
</div>
</div>
) : (
<LinearProgress color="secondary" />
);
}
}
export default connect(mapStoreToProps)(UserPageEdit);
|
'use strict';
angular.module('editorApp')
.controller('LogsController', function ($scope, LogsService) {
$scope.loggers = LogsService.findAll();
$scope.changeLevel = function (name, level) {
LogsService.changeLevel({name: name, level: level}, function () {
$scope.loggers = LogsService.findAll();
});
};
});
|
import { TIMEOUT_SEC, BF_APIKEY, BF_PARAM_HEADER } from "./config";
var bf_header = new Headers();
bf_header.append("project_id", "mainnetiSXrfNxhpPChKCnts2KX9MJ1eQ7exYgb");
const timeout = function (s) {
return new Promise(function (_, reject) {
setTimeout(function () {
reject(new Error(`Request took too long! Timeout after ${s} second`));
}, s * 1000);
});
};
export const AJAX = async function (url, uploadData = undefined) {
try {
const fetchPro = uploadData
? fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(uploadData),
})
: fetch(url, {
method: "GET",
headers: bf_header,
});
const res = await Promise.race([fetchPro, timeout(TIMEOUT_SEC)]);
const data = await res.json();
if (!res.ok) throw new Error(`${data.message} (${res.status})`);
return data;
} catch (err) {
throw err;
}
};
// 1 ADA = 1 million de lovelance
export const lovelanceToAda = (lovelance) => lovelance / (1000 * 1000);
// Calcul the number of epochs for x month (calc aprox)
export const nbOfEpochs = (nbOfMonths) => (30 / 5) * nbOfEpochs;
|
var Keen = exports;
// deal with some browsers not supporting console.log
var alertFallback = false; //only use in dev
if (typeof console === "undefined" || typeof console.log === "undefined") {
console = {};
if (alertFallback) {
console.log = function(msg) {
alert(msg);
};
} else {
console.log = function() {};
}
}
/*
* -----------INHERITANCE STUFF-----------
*
* This is to give us inheritance capabilities in vanilla javascript.
*
* Docs: http://dean.edwards.name/weblog/2006/03/base/
* Base.js, version 1.1a
* Copyright 2006-2010, Dean Edwards
* License: http://www.opensource.org/licenses/mit-license.php
*/
var Base = function() {
// dummy
};
Base.extend = function(_instance, _static) { // subclass
var extend = Base.prototype.extend;
// build the prototype
Base._prototyping = true;
var proto = new this;
extend.call(proto, _instance);
proto.base = function() {
// call this method from any other method to invoke that method's ancestor
};
delete Base._prototyping;
// create the wrapper for the constructor function
//var constructor = proto.constructor.valueOf(); //-dean
var constructor = proto.constructor;
var klass = proto.constructor = function() {
if (!Base._prototyping) {
if (this._constructing || this.constructor == klass) { // instantiation
this._constructing = true;
constructor.apply(this, arguments);
delete this._constructing;
} else if (arguments[0] != null) { // casting
return (arguments[0].extend || extend).call(arguments[0], proto);
}
}
};
// build the class interface
klass.ancestor = this;
klass.extend = this.extend;
klass.forEach = this.forEach;
klass.implement = this.implement;
klass.prototype = proto;
klass.toString = this.toString;
klass.valueOf = function(type) {
//return (type == "object") ? klass : constructor; //-dean
return (type == "object") ? klass : constructor.valueOf();
};
extend.call(klass, _static);
// class initialisation
if (typeof klass.init == "function") klass.init();
return klass;
};
Base.prototype = {
extend: function(source, value) {
if (arguments.length > 1) { // extending with a name/value pair
var ancestor = this[source];
if (ancestor && (typeof value == "function") && // overriding a method?
// the valueOf() comparison is to avoid circular references
(!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) &&
/\bbase\b/.test(value)) {
// get the underlying method
var method = value.valueOf();
// override
value = function() {
var previous = this.base || Base.prototype.base;
this.base = ancestor;
var returnValue = method.apply(this, arguments);
this.base = previous;
return returnValue;
};
// point to the underlying method
value.valueOf = function(type) {
return (type == "object") ? value : method;
};
value.toString = Base.toString;
}
this[source] = value;
} else if (source) { // extending with an object literal
var extend = Base.prototype.extend;
// if this object has a customised extend method then use it
if (!Base._prototyping && typeof this != "function") {
extend = this.extend || extend;
}
var proto = {toSource: null};
// do the "toString" and other methods manually
var hidden = ["constructor", "toString", "valueOf"];
// if we are prototyping then include the constructor
var i = Base._prototyping ? 0 : 1;
while (key = hidden[i++]) {
if (source[key] != proto[key]) {
extend.call(this, key, source[key]);
}
}
// copy each of the source object's properties to this object
for (var key in source) {
if (!proto[key]) extend.call(this, key, source[key]);
}
}
return this;
}
};
// initialise
Base = Base.extend({
constructor: function() {
this.extend(arguments[0]);
}
}, {
ancestor: Object,
version: "1.1",
forEach: function(object, block, context) {
for (var key in object) {
if (this.prototype[key] === undefined) {
block.call(context, object[key], key, object);
}
}
},
implement: function() {
for (var i = 0; i < arguments.length; i++) {
if (typeof arguments[i] == "function") {
// if it's a function, call it
arguments[i](this.prototype);
} else {
// add the interface using the extend method
this.prototype.extend(arguments[i]);
}
}
return this;
},
toString: function() {
return String(this.valueOf());
}
});
//-------KEEN OBJECT-----------
/**
* Configure the Keen IO JS Library with a Project ID and API Keys.
* @param {Object} config Contains the project ID and optional keys.
* @param {String} config.projectId the Keen IO Project ID
* @param {String} [config.writeKey] the Keen IO Scoped Write Key
* @param {String} [config.readKey] the Keen IO Scoped Read Key
* @param {String} [config.keenUrl] the base url for the Keen IO API
*
* @returns {Keen.Client} An instance of Keen.Client that has been configured
*/
Keen.configure = function (config) {
this.client = new Keen.Client(config);
return this.client;
};
/**
* Add an event to Keen IO.
* @param {String} eventCollection The name of the event collection
* @param {Object} event The actual event to send
* @param {Function} [success] Invoked on success
* @param {Function} [error] Invoked on failure
*/
Keen.addEvent = function (eventCollection, event, success, error) {
if (this.client) {
this.client.uploadEvent(eventCollection, event, success, error);
}
};
/**
* Add an event to Keen IO before navigating to an external page/submitting form
* @param {Element} htmlElement The html element being clicked/submitted
* @param {String} eventCollection The name of the event to be recorded
* @param {Object} event The event properties
* @param {Integer} [timeout=500] The amount of time to wait in milliseconds before timing out
* @param {Function} [timeoutCallback] Invoked on timeout
*
* @returns {Boolean} Returns false to prevent a default action from taking place
*/
Keen.trackExternalLink = function(htmlElementOrEvent, eventCollection, event, timeout, timeoutCallback){
var htmlElement = htmlElementOrEvent;
var jsEvent = null;
var newTab = false;
if (!htmlElementOrEvent.nodeName) {
// htmlElementOrEvent == event
jsEvent = htmlElementOrEvent;
htmlElement = jsEvent.target;
newTab = (htmlElementOrEvent.metaKey || false);
} else if (window.event && window.event.metaKey == true) {
// htmlElementOrEvent == element, new tab == true
newTab = true;
}
if (timeout === undefined){
timeout = 500;
}
var triggered = false;
var callback = function(){};
if( htmlElement.nodeName === "A"){
callback = function(){
if(!newTab && !triggered){
triggered = true;
window.location = htmlElement.href;
}
};
}
else if (htmlElement.nodeName === "FORM"){
callback = function(){
if(!triggered){
triggered = true;
htmlElement.submit();
}
}
}
if(timeoutCallback){
callback = function(){
if(!triggered){
triggered = true;
timeoutCallback();
}
}
}
Keen.addEvent(eventCollection, event, callback, callback);
setTimeout(function() {
callback();
}, timeout);
if (!newTab) {
return false;
}
};
/**
* Retrieve an array of event collection names and their properties
* @param {Function} [success] Invoked on success
* @param {Function} [error] Invoked on failure
*/
Keen.getEventCollections = function(success, error) {
var url = this.client.getKeenUrl("/events");
this.client.getJSON(url, success, error);
};
/**
* Retrieve the properties of a given event collection
* @param eventCollection string, name of the event collection
* @param {Function} [success] Invoked on success
* @param {Function} [error] Invoked on failure
*/
Keen.getEventCollectionProperties = function (eventCollection, success, error) {
var url = this.client.getKeenUrl("/events/" + eventCollection);
this.client.getJSON(url, success, error);
};
/**
* Sets the global properties to use.
* @param {Function} newGlobalProperties A function that returns an object of properties
*/
Keen.setGlobalProperties = function (newGlobalProperties) {
if (this.client) {
if (newGlobalProperties && typeof(newGlobalProperties) == "function") {
this.client.globalProperties = newGlobalProperties;
} else {
throw new Error("Invalid value for global properties: " + newGlobalProperties);
}
}
};
// KEEN CLIENT OBJECT
Keen.Client = function (config) {
if(typeof config.projectId === "undefined" || !config.projectId) {
throw new Error("Configuration must include a valid projectId");
} else {
this.projectId = config.projectId;
}
this.writeKey = config.writeKey;
this.readKey = config.readKey;
this.globalProperties = null;
this.keenUrl = "https://api.keen.io";
if(config !== undefined && config.keenUrl !== undefined){
this.keenUrl = config.keenUrl;
}
};
/**
* Uploads a single event to the Keen IO servers.
* @param {String} eventCollection The name of the event collection to use
* @param {Object} event The actual event properties to send
* @param {Function} [success] Invoked on success
* @param {Function} [error] Invoked on failure
*/
Keen.Client.prototype.uploadEvent = function (eventCollection, event, success, error) {
var url = this.getKeenUrl("/events/" + eventCollection);
// handle global properties
var newEvent = {};
if (this.globalProperties) {
newEvent = this.globalProperties(eventCollection);
}
// now add in the properties from the user-defined event
for (var property in event) {
if (event.hasOwnProperty(property)) {
newEvent[property] = event[property];
}
}
if (supportsXhr()) {
sendXhr("POST", url, null, newEvent, this.writeKey, success, error);
} else {
var jsonBody = JSON.stringify(newEvent);
var base64Body = Keen.Base64.encode(jsonBody);
url = url + "?api_key=" + this.writeKey;
url = url + "&data=" + base64Body;
url = url + "&modified=" + new Date().getTime();
sendJsonpRequest(url, null, success, error);
}
};
/**
* Returns a full URL by appending the provided path to the root Keen IO URL.
* @param {String} path The path of the desired url
* @returns {String} A fully formed URL for use in an API call.
*/
Keen.Client.prototype.getKeenUrl = function (path) {
return this.keenUrl + "/3.0/projects/" + this.projectId + path;
};
function supportsXhr() {
if (typeof XMLHttpRequest === 'undefined') {
return false
} else {
return "withCredentials" in new XMLHttpRequest();
}
}
function sendXhr(method, url, headers, body, apiKey, success, error) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status >= 200 && xhr.status < 300) {
var response;
try {
response = JSON.parse(xhr.responseText);
} catch (e) {
console.log("Could not JSON parse HTTP response: " + xhr.responseText);
if (error) {
error(xhr, e);
}
}
if (response) {
if (success) {
success(response);
}
}
} else {
console.log("HTTP request failed.");
if (error) {
error(xhr, null);
}
}
}
};
xhr.open(method, url, true);
if (apiKey){
xhr.setRequestHeader("Authorization", apiKey);
}
if (body) {
xhr.setRequestHeader("Content-Type", "application/json");
}
if (headers) {
for (var headerName in headers) {
if (headers.hasOwnProperty(headerName)) {
xhr.setRequestHeader(headerName, headers[headerName]);
}
}
}
var toSend = body ? JSON.stringify(body) : null;
xhr.send(toSend);
}
function sendJsonpRequest(url, apiKey, success, error) {
// have to fall back to JSONP for GET and sending data base64 encoded for POST
// add api_key if it's not there
if (apiKey && url.indexOf("api_key") < 0) {
var delimiterChar = url.indexOf("?") > 0 ? "&" : "?";
url = url + delimiterChar + "api_key=" + apiKey;
}
// do JSONP
var callbackName = "keenJSONPCallback" + new Date().getTime();
while (callbackName in window) {
callbackName += "a";
}
var loaded = false;
window[callbackName] = function (response) {
loaded = true;
if (success && response) {
success(response);
}
// now remove this from the namespace
window[callbackName] = undefined;
};
url = url + "&jsonp=" + callbackName;
var script = document.createElement("script");
script.id = "keen-jsonp";
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
// for early IE w/ no onerror event
script.onreadystatechange = function() {
if (loaded === false && this.readyState === "loaded") {
loaded = true;
if (error) {
error();
}
}
}
// non-ie, etc
script.onerror = function() {
if (loaded === false) { // on IE9 both onerror and onreadystatechange are called
loaded = true;
if (error) {
error();
}
}
}
}
/**
* Asynchronously sends an HTTP GET via XHR or JSONP
*
* Automatically sets the Content-Type of the request to "application/json" and sets the Authorization
* header.
*
* @param {String} url what URL to send the request to
* @param {Function} [success] Invoked on success
* @param {Function} [error] Invoked on failure
*/
Keen.Client.prototype.getJSON = function (url, success, error) {
if (supportsXhr()) {
sendXhr("GET", url, null, null, this.readKey, success, error);
} else {
sendJsonpRequest(url, this.readKey, success, error);
}
};
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/
Keen.Base64 = {
// private property
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
// public method for encoding
encode : function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
input = Keen.Base64._utf8_encode(input);
while (i < input.length) {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output = output +
Keen.Base64._keyStr.charAt(enc1) + Keen.Base64._keyStr.charAt(enc2) +
Keen.Base64._keyStr.charAt(enc3) + Keen.Base64._keyStr.charAt(enc4);
}
return output;
},
// public method for decoding
decode : function (input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (i < input.length) {
enc1 = Keen.Base64._keyStr.indexOf(input.charAt(i++));
enc2 = Keen.Base64._keyStr.indexOf(input.charAt(i++));
enc3 = Keen.Base64._keyStr.indexOf(input.charAt(i++));
enc4 = Keen.Base64._keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
}
output = Keen.Base64._utf8_decode(output);
return output;
},
// private method for UTF-8 encoding
_utf8_encode : function (string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
}
else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
},
// private method for UTF-8 decoding
_utf8_decode : function (utftext) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;
while ( i < utftext.length ) {
c = utftext.charCodeAt(i);
if (c < 128) {
string += String.fromCharCode(c);
i++;
}
else if((c > 191) && (c < 224)) {
c2 = utftext.charCodeAt(i+1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
}
else {
c2 = utftext.charCodeAt(i+1);
c3 = utftext.charCodeAt(i+2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return string;
}
};
// handle any queued commands
if (Keen._cf) {
Keen.configure(Keen._cf);
Keen._cf = null;
}
if (Keen._gp) {
Keen.setGlobalProperties(Keen._gp);
Keen._gp = null;
}
if (Keen._eq && Keen._eq.length > 0) {
for (var i = 0; i < Keen._eq.length; i++) {
var eventCollection = Keen._eq[i].shift();
var event = Keen._eq[i].shift();
var success = Keen._eq[i].shift();
var error = Keen._eq[i].shift();
Keen.addEvent(eventCollection, event, success, error);
}
Keen._eq = null;
}
if (Keen._ocrq && Keen._ocrq.length > 0) {
for (var i = 0; i < Keen._ocrq.length; i++) {
var onChartsReadyHandler = Keen._ocrq[i];
Keen.onChartsReady(onChartsReadyHandler);
}
Keen._ocrq = null;
}
|
// I get it, you're curious,
// but it's OK if you don't understand what's going on in here, you'll learn it in time.
const abTroubleshoot = require("./troubleshooting");
const result = abTroubleshoot();
if(result === 2) {
console.log("Congrats! You got the correct answer");
} else if(typeof result === 'number') {
console.log(`You returned the number ${result}, the result should be the number 2`);
} else {
console.log(`You returned string "${result}", the result should be the number 2`);
}
|
document.getElementById('button1').addEventListener('click', getText);
document.getElementById('button2').addEventListener('click', getJson);
document.getElementById('button3').addEventListener('click', getExternal);
// Get local text file data
function getText() {
fetch('test.txt')
.then(function(res){
return res.text();
})
.then(function(data) {
console.log(data);
document.getElementById('output').innerHTML = data;
})
.catch(function(err){
console.log(err);
});
}
// Get local json data
function getJson() {
fetch('posts.json')
.then(function(res){
return res.json();
})
.then(function(data) {
console.log(data);
let output = '';
data.forEach(function(post) {
output += `<li>${post.title}</li>`;
});
document.getElementById('output').innerHTML = output;
})
.catch(function(err){
console.log(err);
});
}
// Get from external API
function getExternal() {
fetch('https://api.github.com/users')
.then(function(res){
return res.json();
})
.then(function(data) {
console.log(data);
let output = '';
data.forEach(function(user) {
output += `<li>${user.login}</li>`;
});
document.getElementById('output').innerHTML = output;
})
.catch(function(err){
console.log(err);
});
}
|
import '@babel/runtime/helpers/esm/objectWithoutProperties';
import '@babel/runtime/helpers/esm/extends';
import '@babel/runtime/helpers/esm/toConsumableArray';
import '@babel/runtime/helpers/esm/objectSpread';
import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
import _createClass from '@babel/runtime/helpers/esm/createClass';
import _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';
import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
import _inherits from '@babel/runtime/helpers/esm/inherits';
import _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
import React, { Component } from 'react';
import memoizeOne from 'memoize-one';
import { CacheProvider } from '@emotion/core';
import 'react-dom';
import 'prop-types';
import '@babel/runtime/helpers/esm/typeof';
import './chunk-39d3fda8.browser.esm.js';
export { y as components } from './chunk-80640036.browser.esm.js';
import { S as Select } from './base/dist/react-select-cac0a5ae.browser.esm.js';
export { c as createFilter, a as defaultTheme, m as mergeStyles } from './base/dist/react-select-cac0a5ae.browser.esm.js';
import '@emotion/css';
import '@babel/runtime/helpers/esm/taggedTemplateLiteral';
import 'react-input-autosize';
import { m as manageState } from './chunk-b36baf1a.browser.esm.js';
import createCache from '@emotion/cache';
var NonceProvider =
/*#__PURE__*/
function (_Component) {
_inherits(NonceProvider, _Component);
function NonceProvider(props) {
var _this;
_classCallCheck(this, NonceProvider);
_this = _possibleConstructorReturn(this, _getPrototypeOf(NonceProvider).call(this, props));
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "createEmotionCache", function (nonce) {
return createCache({
nonce: nonce
});
});
_this.createEmotionCache = memoizeOne(_this.createEmotionCache);
return _this;
}
_createClass(NonceProvider, [{
key: "render",
value: function render() {
var emotionCache = this.createEmotionCache(this.props.nonce);
return React.createElement(CacheProvider, {
value: emotionCache
}, this.props.children);
}
}]);
return NonceProvider;
}(Component);
var index = manageState(Select);
export default index;
export { NonceProvider };
|
/**
* Auto-generated action file for "AdvisorManagementClient" API.
*
* Generated at: 2019-05-07T14:37:06.386Z
* Mass generator version: 1.1.0
*
* flowground :- Telekom iPaaS / azure-com-advisor-connector
* Copyright © 2019, Deutsche Telekom AG
* contact: flowground@telekom.de
*
* All files of this connector are licensed under the Apache 2.0 License. For details
* see the file LICENSE on the toplevel directory.
*
*
* Operation: 'Configurations_CreateInSubscription'
* Endpoint Path: '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations'
* Method: 'put'
*
*/
const Swagger = require('swagger-client');
const processWrapper = require('../services/process-wrapper');
const spec = require('../spec.json');
// this wrapers offers a simplified emitData(data) function
module.exports.process = processWrapper(processAction);
// parameter names for this call
const PARAMETERS = [
"api-version",
"subscriptionId"
];
// mappings from connector field names to API field names
const FIELD_MAP = {
"api_version": "api-version",
"subscriptionId": "subscriptionId",
"id": "id",
"name": "name",
"exclude": "exclude",
"low_cpu_threshold": "low_cpu_threshold",
"properties": "properties",
"type": "type",
"requestBody": "requestBody"
};
function processAction(msg, cfg) {
var isVerbose = process.env.debug || cfg.verbose;
if (isVerbose) {
console.log(`---MSG: ${JSON.stringify(msg)}`);
console.log(`---CFG: ${JSON.stringify(cfg)}`);
console.log(`---ENV: ${JSON.stringify(process.env)}`);
}
const contentType = 'application/json';
const body = msg.body;
mapFieldNames(body);
let parameters = {};
for(let param of PARAMETERS) {
parameters[param] = body[param];
}
// credentials for this operation
let securities = {};
securities['azure_auth'] = {token: cfg['azure_auth']};
let callParams = {
spec: spec,
operationId: 'Configurations_CreateInSubscription',
pathName: '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations',
method: 'put',
parameters: parameters,
requestContentType: contentType,
requestBody: body.requestBody,
securities: {authorized: securities},
server: spec.servers[cfg.server] || cfg.otherServer,
};
if (isVerbose) {
let out = Object.assign({}, callParams);
out.spec = '[omitted]';
console.log(`--SWAGGER CALL: ${JSON.stringify(out)}`);
}
// Call operation via Swagger client
return Swagger.execute(callParams).then(data => {
// emit a single message with data
this.emitData(data);
// if the response contains an array of entities, you can emit them one by one:
// data.obj.someItems.forEach((item) => {
// this.emitData(item);
// }
});
}
function mapFieldNames(obj) {
if(Array.isArray(obj)) {
obj.forEach(mapFieldNames);
}
else if(typeof obj === 'object' && obj) {
Object.keys(obj).forEach(key => {
mapFieldNames(obj[key]);
let goodKey = FIELD_MAP[key];
if(goodKey && goodKey !== key) {
obj[goodKey] = obj[key];
delete obj[key];
}
});
}
}
|
/*globals describe, it, before*/
const {
expect
} = require('chai');
const sinon = require('sinon');
let IPC = require('../lib/core/ipc.js');
let Proxy = require('../lib/modules/blockchain_process/proxy');
const constants = require('../lib/constants');
describe('embark.Proxy', function () {
let ipc, proxy, ipcRequests;
before(function () {
ipc = new IPC({
ipcRole: 'none'
});
ipcRequests = [];
ipc.connected = true;
sinon.stub(ipc, 'request').callsFake((...args) => {
ipcRequests.push(args);
});
proxy = new Proxy(ipc);
});
describe('#trackRequest', function () {
it('should handle eth_sendTransaction', function (done) {
const to = "to";
const data = "data";
proxy.trackRequest({ws: true, data: {
id: 1,
method: constants.blockchain.transactionMethods.eth_sendTransaction,
params: [{
to: to,
data: data
}]
}});
expect(proxy.commList[1]).to.deep.equal({
type: 'contract-log',
address: to,
data: data
});
done();
});
it('should handle eth_sendRawTransaction', function (done) {
const to = "0x2e6242a07ea1c4e79ecc5c69a2dccae19878a280";
const data = "0x60fe47b1000000000000000000000000000000000000000000000000000000000000115c";
proxy.trackRequest({ws: true, data: {
id: 1,
method: constants.blockchain.transactionMethods.eth_sendRawTransaction,
params: ["0xf8852701826857942e6242a07ea1c4e79ecc5c69a2dccae19878a28080a460fe47b1000000000000000000000000000000000000000000000000000000000000115c820a96a04d6e3cbb86d80a75cd51da02bf8f0cc9893d64ca7956ce21b350cc143aa8a023a05878a850e4e7810d08093add07df405298280fdd901ecbabb74e73422cb5e0b0"]
}});
expect(proxy.commList[1]).to.deep.equal({
type: 'contract-log',
address: to,
data: data
});
done();
});
});
describe('#trackResponse', function () {
describe('when the response is a transaction', function () {
before(function () {
proxy.trackRequest({ws: true, data: {
id: 1,
method: constants.blockchain.transactionMethods.eth_sendTransaction,
params: [{to: "to", data: "data" }]
}});
});
it('should populate the transaction when it is a known id', function (done) {
proxy.trackResponse({
id: 1,
result: 1
});
expect(proxy.transactions[1]).to.deep.equal({
commListId: 1
});
done();
});
it('should not populate the transaction when it is a unknown id', function (done) {
proxy.trackResponse({
id: 2
});
expect(proxy.transactions[2]).to.be.equal(undefined);
done();
});
});
describe('when the response is a receipt', function () {
it('should make an ipc call', function (done) {
proxy.trackRequest({ws: true, data: {
id: 3,
method: constants.blockchain.transactionMethods.eth_sendTransaction,
params: [{
to: "to",
data: "data"
}]
}});
proxy.trackResponse({
id: 3,
result: {
to: "to",
data: "data"
}
});
proxy.trackRequest({ws: true, data: {
id: 4,
method: constants.blockchain.transactionMethods.eth_getTransactionReceipt,
params: [{
to: "to",
data: "data"
}]
}});
expect(proxy.receipts[4]).to.be.equal(3);
proxy.trackResponse({
id: 4,
result: {
blockNumber: 666,
gasUsed: 122,
status: 'ok'
}
});
expect(ipcRequests[0]).to.deep.equal([
"log", {
"address": "to",
"blockNumber": 666,
"data": "data",
"gasUsed": 122,
"status": "ok",
"transactionHash": {
"data": "data",
"to": "to"
},
"type": "contract-log"
}
]);
done();
});
});
});
});
|
import React, { Component } from "react";
import { Card, CardTitle, CardText, CardActions, Button } from "react-mdl";
export default class AboutMe extends Component {
render() {
return (
<div className="projects-grid">
<Card
shadow={0}
style={{ width: "600px", height: "500px", margin: "auto" }}
>
<CardTitle
expand
style={{
color: "#fff",
background: "url()"
}}
>
About Me
</CardTitle>
<CardText>
<p>
Hi, I'm Boniface, a software engineer based in Columbus Ohio. With
over three years of experience, I can help you make your next
website and software for your business. I am available to work
remotely and willing to relocate. I am available for hire full
time, part time and also, per project. I am quick learner, goal
oriented, team player, willing to learn new technologies and
problem solving capability.
</p>
</CardText>
</Card>
</div>
);
}
}
|
// This file is part of InvenioRDM
// Copyright (C) 2020 CERN.
// Copyright (C) 2020 Northwestern University.
// Copyright (C) 2021 Graz University of Technology.
//
// Invenio App RDM is free software; you can redistribute it and/or modify it
// under the terms of the MIT License; see LICENSE file for more details.
import _get from "lodash/get";
import React, { Component, createRef, Fragment } from "react";
import {
AccessRightField,
CreatibutorsField,
DatesField,
DeleteButton,
DepositFormApp,
DepositFormTitle,
DescriptionsField,
FileUploader,
FormFeedback,
IdentifiersField,
LanguagesField,
SubjectsField,
LicenseField,
PIDField,
PreviewButton,
PublicationDateField,
PublishButton,
PublisherField,
RelatedWorksField,
ResourceTypeField,
SaveButton,
TitlesField,
VersionField,
} from "react-invenio-deposit";
import { AccordionField } from "react-invenio-forms";
import { Card, Container, Divider, Grid, Ref, Sticky } from "semantic-ui-react";
export class RDMDepositForm extends Component {
constructor(props) {
super(props);
this.config = props.config || {};
// TODO: retrieve from backend
this.config["canHaveMetadataOnlyRecords"] = true;
// TODO: Make ALL vocabulary be generated by backend.
// Currently, some vocabulary is generated by backend and some is
// generated by frontend here. Iteration is faster and abstractions can be
// discovered by generating vocabulary here. Once happy with vocabularies,
// then we can generate it in the backend.
this.vocabularies = {
metadata: {
...this.config.vocabularies,
titles: {
...this.config.vocabularies.titles,
},
descriptions: {
type: [
{ text: "Abstract", value: "abstract" },
{ text: "Methods", value: "methods" },
{ text: "Series Information", value: "seriesinformation" },
{ text: "Table of Contents", value: "tableofcontents" },
{ text: "Technical Info", value: "technicalinfo" },
{ text: "Other", value: "other" },
],
},
creators: {
type: [
{ text: "Person", value: "personal" },
{ text: "Organization", value: "organizational" },
],
role: [
{ text: "Editor", value: "editor" },
{ text: "Data Curator", value: "datacurator" },
{ text: "Data Manager", value: "datamanager" },
{ text: "Project Manager", value: "projectmanager" },
],
},
contributors: {
type: [
{ text: "Person", value: "personal" },
{ text: "Organization", value: "organizational" },
],
role: [
{ text: "Editor", value: "editor" },
{ text: "Data Curator", value: "datacurator" },
{ text: "Data Manager", value: "datamanager" },
{ text: "Project Manager", value: "projectmanager" },
],
},
dates: {
type: [
{ text: "Accepted", value: "accepted" },
{ text: "Available", value: "available" },
{ text: "Copyrighted", value: "copyrighted" },
{ text: "Collected", value: "collected" },
{ text: "Created", value: "created" },
{ text: "Issued", value: "issued" },
{ text: "Submitted", value: "submitted" },
{ text: "Updated", value: "updated" },
{ text: "Valid", value: "valid" },
{ text: "Withdrawn", value: "withdrawn" },
{ text: "Other", value: "other" },
],
},
// TODO: Replace with an API backend
funding: {
funder: [
{
name: "National Institutes of Health (US)",
identifier: "funder1",
scheme: "funderScheme1",
},
{
name: "European Commission (EU)",
identifier: "funder2",
scheme: "funderScheme2",
},
],
award: [
{
title: "CANCER &AIDS DRUGS--PRECLIN PHARMACOL/TOXICOLOGY",
number: "N01CM037835-016",
identifier: "awardA",
scheme: "awardSchemeA",
parentScheme: "funderScheme1",
parentIdentifier: "funder1",
},
{
title:
"Beyond the Standard Model at the LHC and with Atom Interferometers.",
number: "228169",
identifier: "awardB1",
scheme: "awardSchemeB",
parentScheme: "funderScheme2",
parentIdentifier: "funder2",
},
{
title: "ENvironmental COnditions in GLAucoma Patients",
number: "747441",
identifier: "awardB2",
scheme: "awardSchemeB",
parentScheme: "funderScheme2",
parentIdentifier: "funder2",
},
],
},
identifiers: {
resource_type: this.config.vocabularies.resource_type,
scheme: [
{ text: "ARK", value: "ark" },
{ text: "ARXIV", value: "arxiv" },
{ text: "BIBCODE", value: "bibcode" },
{ text: "DOI", value: "doi" },
{ text: "EAN13", value: "ean13" },
{ text: "EISSN", value: "eissn" },
{ text: "HANDLE", value: "handle" },
{ text: "IGSN", value: "igsn" },
{ text: "ISBN", value: "isbn" },
{ text: "ISSN", value: "issn" },
{ text: "ISTC", value: "istc" },
{ text: "LISSN", value: "lissn" },
{ text: "LSID", value: "lsid" },
{ text: "PMID", value: "pmid" },
{ text: "PURL", value: "purl" },
{ text: "UPC", value: "upc" },
{ text: "URL", value: "url" },
{ text: "URN", value: "urn" },
{ text: "W3ID", value: "w3id" },
],
relations: this.config.vocabularies.relation_type,
},
subjects: {
options: [
{
text: "Deep Learning",
value: {
subject: "Deep Learning",
scheme: "user",
identifier: "U1",
},
},
{
text: "MeSH: Cognitive Neuroscience",
value: {
subject: "Cognitive Neuroscience",
scheme: "mesh",
identifier: "D000066494",
},
},
{
text: "FAST: Glucagonoma",
value: {
subject: "Glucagonoma",
scheme: "fast",
identifier: "943672",
},
},
],
limitToOptions: [
{ text: "All", value: "all" },
{ text: "Science", value: "science" },
],
},
},
};
// check if files are present
this.noFiles = false;
if (
!Array.isArray(this.props.files.entries) ||
(!this.props.files.entries.length && this.props.record.is_published)
) {
this.noFiles = true;
}
}
formFeedbackRef = createRef();
sidebarRef = createRef();
accordionStyle = {
header: { className: "inverted brand", style: { cursor: "pointer" } },
};
render() {
return (
<DepositFormApp
config={this.config}
record={this.props.record}
files={this.props.files}
permissions={this.props.permissions}
>
<FormFeedback fieldPath="message" />
<Container style={{ marginTop: "10px" }}>
<DepositFormTitle />
<Grid>
<Grid.Row>
<Grid.Column width={11}>
<AccordionField
fieldPath=""
active={true}
label={"Files"}
ui={this.accordionStyle}
>
{this.noFiles && this.props.record.is_published && (
<p
style={{
textAlign: "center",
opacity: "0.5",
cursor: "default !important",
}}
>
<em>The record has no files.</em>
</p>
)}
<FileUploader
isDraftRecord={!this.props.record.is_published}
quota={{
maxFiles: 100,
maxStorage: 10 ** 10,
}}
/>
</AccordionField>
<AccordionField
fieldPath=""
active={true}
label={"Basic information"}
ui={this.accordionStyle}
>
{this.config.pids.map((pid) => (
<Fragment key={pid.scheme}>
<PIDField
btnLabelGetPID={pid.btn_label_get_pid}
canBeManaged={pid.can_be_managed}
canBeUnmanaged={pid.can_be_unmanaged}
fieldPath={`pids.${pid.scheme}`}
isEditingPublishedRecord={
this.props.record.is_published === true // is_published is `null` at first upload
}
managedHelpText={pid.managed_help_text}
pidLabel={pid.pid_label}
pidPlaceholder={pid.pid_placeholder}
pidType={pid.scheme}
unmanagedHelpText={pid.unmanaged_help_text}
/>
<Divider />
</Fragment>
))}
<ResourceTypeField
options={this.vocabularies.metadata.resource_type}
required
/>
<TitlesField
options={this.config.vocabularies.titles}
recordUI={this.props.record.ui}
required
/>
<PublicationDateField required />
<CreatibutorsField
label={"Creators"}
labelIcon={"user"}
fieldPath={"metadata.creators"}
roleOptions={this.config.vocabularies.creators.role}
schema="creators"
required
/>
<DescriptionsField
options={this.config.vocabularies.descriptions}
recordUI={_get(this.props.record, "ui", null)}
editorConfig={{
removePlugins: [
"Image",
"ImageCaption",
"ImageStyle",
"ImageToolbar",
"ImageUpload",
"MediaEmbed",
"Table",
"TableToolbar",
"TableProperties",
"TableCellProperties",
],
}}
/>
<LicenseField
fieldPath="metadata.rights"
searchConfig={{
searchApi: {
axios: {
headers: {
Accept: "application/vnd.inveniordm.v1+json",
},
url: "/api/vocabularies/licenses",
withCredentials: false,
},
},
initialQueryState: {
filters: [["tags", "recommended"]],
},
}}
serializeLicenses={(result) => ({
title: result.title_l10n,
description: result.description_l10n,
id: result.id,
link: result.props.url,
})}
/>
<br />
</AccordionField>
<AccordionField
fieldPath=""
active={true}
label={"Recommended information"}
ui={this.accordionStyle}
>
<CreatibutorsField
addButtonLabel={"Add contributor"}
label={"Contributors"}
labelIcon={"user plus"}
fieldPath={"metadata.contributors"}
roleOptions={this.config.vocabularies.contributors.role}
schema="contributors"
modal={{
addLabel: "Add contributor",
editLabel: "Edit contributor",
}}
/>
<SubjectsField
initialOptions={_get(
this.props.record,
"ui.subjects",
null
)}
limitToOptions={
this.vocabularies.metadata.subjects.limitToOptions
}
/>
<LanguagesField
initialOptions={_get(
this.props.record,
"ui.languages",
[]
).filter((lang) => lang !== null)} // needed because dumped empty record from backend gives [null]
serializeSuggestions={(suggestions) =>
suggestions.map((item) => ({
text: item.title_l10n,
value: item.id,
key: item.id,
}))
}
/>
<DatesField options={this.config.vocabularies.dates} />
<VersionField />
<PublisherField />
<br />
</AccordionField>
{/**TODO: uncomment to use FundingField*/}
{/* <AccordionField
fieldPath=""
active={true}
label={"Funding"}
ui={this.accordionStyle}
>
<FundingField options={this.vocabularies.metadata.funding} />
<ComingSoonField
fieldPath="metadata.funding"
label="Awards"
labelIcon="money bill alternate outline"
/>
<br />
</AccordionField> */}
<AccordionField
fieldPath=""
active={true}
label={"Alternate identifiers"}
ui={this.accordionStyle}
>
<IdentifiersField
fieldPath="metadata.identifiers"
label="Alternate identifier(s)"
labelIcon="barcode"
schemeOptions={
this.vocabularies.metadata.identifiers.scheme
}
/>
</AccordionField>
<AccordionField
fieldPath=""
active={true}
label={"Related works"}
ui={this.accordionStyle}
>
<RelatedWorksField
options={this.vocabularies.metadata.identifiers}
/>
<br />
</AccordionField>
</Grid.Column>
<Ref innerRef={this.sidebarRef}>
<Grid.Column width={5} className="deposit-sidebar">
<Sticky context={this.sidebarRef} offset={20}>
<Card className="actions">
<Card.Content>
<div className="sidebar-buttons">
<SaveButton fluid className="save-button" />
<PreviewButton fluid className="preview-button" />
</div>
<PublishButton fluid />
</Card.Content>
</Card>
<Card className="actions">
<Card.Content>
<DeleteButton
fluid
// TODO: make is_published part of the API response
// so we don't have to do this
isPublished={this.props.record.is_published}
/>
</Card.Content>
</Card>
<AccessRightField
label={"Visibility"}
labelIcon={"shield"}
/>
</Sticky>
</Grid.Column>
</Ref>
</Grid.Row>
</Grid>
</Container>
</DepositFormApp>
);
}
}
|
let XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest
let API = 'https://rickandmortyapi.com/api/character/'
function fetchData(url_api, callback) {
let xhttp = new XMLHttpRequest()
xhttp.open('GET', url_api, true)
xhttp.onreadystatechange = function (event) {
if (xhttp.readyState === 4) {
if(xhttp.status === 200) {
callback(null, JSON.parse(xhttp.responseText))
} else {
const error = new Error('Error ' + url_api)
return callback(error, null)
}
}
}
xhttp.send()
}
fetchData(API, function(error1, data1) {
if (error1) {
return console.error(error1)
}
console.log('Paso la primera')
fetchData(API + data1.results[0].id, function (error2, data2) {
if(error2) {
return console.error(error2)
}
console.log('Paso la segunda')
fetchData(data2.origin.url, function (error3, data3) {
if (error3) {
return console.error(error3)
}
console.log('Paso la tercera')
console.log(data1.info.count)
console.log(data2.name)
console.log(data3.dimension)
})
})
})
|
/**
* Dual licensed under the Apache License 2.0 and the MIT license.
*/
(function($)
{
var _defaultConfig = {
'max-age' : 30 * 60,
path : '/'
};
function _set(key, value, options)
{
var o = $.extend({}, _defaultConfig, options);
if (value === null || value === undefined)
{
value = '';
o['max-age'] = 0;
o.expires = new Date(new Date().getTime() - 1000);
}
// Create the cookie string
var result = key + '=' + encodeURIComponent(value);
if (o.expires && o.expires.toUTCString)
{
result += '; expires=' + o.expires.toUTCString();
}
if (o['max-age'] && typeof o['max-age'] === 'number')
{
result += '; max-age=' + o['max-age'];
}
if (o.path)
{
result += '; path=' + (o.path);
}
if (o.domain)
{
result += '; domain=' + (o.domain);
}
if (o.secure)
{
result +='; secure';
}
document.cookie = result;
}
function _get(key)
{
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; ++i)
{
var cookie = $.trim(cookies[i]);
if (cookie.substring(0, key.length + 1) == (key + '='))
{
return decodeURIComponent(cookie.substring(key.length + 1));
}
}
return null;
}
$.cookie = function(key, value, options)
{
if (arguments.length > 1)
{
_set(key, value, options);
return undefined;
}
else
{
return _get(key);
}
};
})(jQuery);
|
import React, { useState } from "react";
import FormInputGroup from "../../../components/FormInputGroup";
import { Formik, Form } from "formik";
import validationSchema from "./validationSchema";
import Button from "../../../components/Button";
function FormLogin(props) {
const [ objUser, setUser] = useState({phone: '', pass: ''});
const handleSubmit = values => {
props.onSubmit(values);
};
return (
<Formik
initialValues={objUser}
validationSchema={validationSchema}
onSubmit={handleSubmit}
render={({ handleChange, handleBlur }) => {
return (
<Form>
<FormInputGroup
label="Phone"
name="phone"
placeholder="Enter your phone"
large
onChange={handleChange}
onBlur={handleBlur}
/>
<FormInputGroup
label="Password"
name="pass"
placeholder="Enter your password"
type="password"
large
onChange={handleChange}
onBlur={handleBlur}
/>
<Button text="Login" large type="submit" />
</Form>
);
}}
/>
);
}
export default FormLogin;
|
/*
* Translated default messages for the jQuery validation plugin.
* Language: FR
* Author: Marius Cosareanu
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define('validate-fr', ['jquery', 'bforms-validate'], factory);
} else {
factory(window.jQuery);
}
}(function (jQuery) {
jQuery.extend(jQuery.validator.messages, {
required: "Ce champ est obligatoire.",
mandatory: "Ce champ est obligatoire.",
remote: "Se il vous plaît remplir ce champ.",
email: "Se il vous plaît entrer une adresse email valide.",
url: "Se il vous plaît entrer une URL valide.",
date: "Se il vous plaît entrer une date correcte .",
dateISO: "Se il vous plaît entrer une date ( ISO ) correcte .",
number: "Se il vous plaît entrer un numéro valide.",
digits: "Se il vous plaît entrer que des chiffres.",
creditcard: "Se il vous plaît entrez un numéro de carte de crédit valide .",
equalTo: "Se il vous plaît entrer de nouveau la valeur .",
maxlength: jQuery.format("Se il vous plaît entrez pas plus de {0} caractères."),
minlength: jQuery.format("Se il vous plaît entrer au moins { 0 } caractères."),
rangelength: jQuery.format("Se il vous plaît entrer une valeur comprise entre {0} et {1} caractères."),
range: jQuery.format("Se il vous plaît entrer une valeur comprise entre {0} et {1} ."),
max: jQuery.format("Se il vous plaît entrer une valeur inférieure à {0} égale ou ."),
min: jQuery.format("Se il vous plaît entrer une valeur égale ou supérieure à {0}.")
});
}));
|
// Crée par Joachim Zadi le 09/03/2022 à 15:15. Version 1.0
// ========================================================
// ====================
// LE TYPE NUMBER EN JS
// ====================
20;
-45;
2.654;
-1.2563;
// Les operations de base ==> +, -, *, /, %
let addition = 45 + 3.2;
console.log(`45 + 3.2 = ${addition}`);
let soustraction = 45 - 3.2;
console.log(`45 - 3.2 = ${soustraction}`);
let multiplication = 45 * 3.2;
console.log(`45 * 3.2 = ${multiplication}`);
let division = 45 / 3.2;
console.log(`45 / 3.2 = ${division}`);
let modulo = 45 % 8;
console.log(`45 % 8 = ${modulo}`);
// ORDRE DE PRIORITE DES OPERATIONS
// ================================
let resultat = 3 - 9 * 2;
console.log(`resultat = ${resultat}`);
resultat = (3 - 9) * 2;
console.log(`resultat = ${resultat}`);
// LES EXPOSANTS
// =============
console.log(2 ** 3);
console.log(2 ** 5);
console.log(5 ** 3);
// LE NaN OU NOT A NUMBER
// ======================
resultat = 0 / 0;
console.log(`resultat = ${resultat}`);
console.log(typeof resultat);
resultat = 1 + NaN;
console.log(`resultat = ${resultat}`);
resultat = 1 / 0;
console.log(`resultat = ${resultat}`);
resultat = -1 / 0;
console.log(`resultat = ${resultat}`);
// LES OPERATEURS D'ASSIGANTIONS
// =============================
let x = 3;
console.log(`x = ${x}`);
x = x + 4;
console.log(`x = ${x}`);
x += 6; // ==> x = x + 6
console.log(`x = ${x}`);
x -= 1;
console.log(`x = ${x}`);
x *= 1;
console.log(`x = ${x}`);
x /= 5;
console.log(`x = ${x}`);
x = 12;
x %= 5;
console.log(`x = ${x}`);
x++;// x = x + 1 post-incrementation
console.log(`x = ${x}`);
x--;// x = x - 1 post-decrementation
console.log(`x = ${x}`);
++x; // x = x + 1 pre-incrementation
console.log(`x = ${x}`);
--x; // x = x + 1 pre-decrementation
console.log(`x = ${x}`);
let a = 25;
x = 3;
let resultat = a + x;
console.log(`resultat = ${resultat}`);
resultat = a + x++;
console.log(`x = ${x}`);
console.log(`resultat = ${resultat}`);
resultat = a + ++x;
console.log(`x = ${x}`);
console.log(`resultat = ${resultat}`);
// EXERCICE D'APPLICATION
// ======================
console.log(1.5 + 1.5 * 3); // ==> 6
console.log((10 % 6) ** 2); // ==> 16
console.log(200 + 0 / 0); // ==> NaN
// LES ARRONDIS
// ============
console.log(Math.floor(0.9)); // ==> 0
console.log(Math.floor(1.1)); // ==> 1
console.log(Math.round(0.49)); // ==> 0
console.log(Math.round(0.5)); // ==> 1
console.log(Math.round(2.9)); // ==> 3
console.log(Math.ceil(0.1)); // ==> 1
console.log(Math.ceil(0.9)); // ==> 1
console.log(Math.ceil(21)); // ==> 21
console.log(Math.ceil(21.01)); // ==> 22
// GENERATION D'UN NOMBRE ALEATOIRE COMPRIS ENTRE [0; 1[
let aleatoire = Math.random();
// aleatoire = Math.round(Math.random() * 10);
// aleatoire = Math.floor(Math.random() * 11);
console.log(`aleatoire = ${aleatoire}`);
// OPERATEURS DE COMPARAISON
// =========================
console.log(4 < 5);
console.log(4 < 3);
console.log(4 <= 3);
console.log(4 <= 4);
console.log(4 >= 4);
console.log(4 > 3);
console.log(4 == 3);
console.log(4 == 4);
console.log(4 == '4');
console.log(4 === '4');
console.log(4 != 4);
console.log(4 != "4");
console.log(4 !== '4');
console.log(4 !== 4);
let fin = "Fin de cette partie du cours";
console.log(fin);
|
import React from 'react';
const Link = ({ active, children, onClick }) => {
if (active) {
return <span>{children}</span>;
}
return (
<div className="column">
<a
className="button"
onClick={e => {
e.preventDefault();
onClick();
}}
>
{children}
</a>
</div>
);
};
export default Link;
|
describe('UNIT: Observer', function () {
var Observer = require('vue/src/observer'),
Emitter = require('emitter'),
DepsOb = require('vue/src/deps-parser').observer
describe('Observing Object', function () {
it('should not watch a ViewModel instance', function () {
var obj = new Vue(), ob = new Emitter()
Observer.observe(obj, 'test', ob)
assert.notOk(obj.__observer__)
})
it('should attach hidden observer and values to the object', function () {
var obj = {}, ob = new Emitter()
Observer.observe(obj, 'test', ob)
assert.ok(obj.__observer__ instanceof Emitter)
assert.ok(obj.__observer__.values)
})
it('should emit set events with correct path', setTestFactory({
obj: { a: 1, b: { c: 2 } },
expects: [
{ key: 'test.a', val: 1 },
{ key: 'test.b.c', val: 3 }
],
path: 'test'
}))
it('should emit multiple events when a nested object is set', setTestFactory({
obj: { a: 1, b: { c: 2 } },
expects: [
{ key: 'test.b', val: { c: 3 } },
{ key: 'test.b.c', val: 3, skip: true }
],
path: 'test'
}))
it('should emit get events on tip values', function () {
DepsOb.active = true
getTestFactory({
obj: { a: 1, b: { c: 2 } },
expects: [
'test.a',
'test.b.c'
],
path: 'test'
})()
DepsOb.active = false
})
it('should emit set when first observing', function () {
var obj = { a: 1, b: { c: 2} },
ob = new Emitter(), i = 0
var expects = [
{ key: 'test.a', val: obj.a },
{ key: 'test.b', val: obj.b },
{ key: 'test.b.c', val: obj.b.c }
]
ob.on('set', function (key, val) {
var exp = expects[i]
assert.strictEqual(key, exp.key)
assert.strictEqual(val, exp.val)
i++
})
Observer.observe(obj, 'test', ob)
assert.strictEqual(i, expects.length)
})
it('should emit set when watching an already observed object', function () {
var obj = { a: 1, b: { c: 2} },
ob1 = new Emitter(),
ob2 = new Emitter(),
i = 0
Observer.observe(obj, 'test', ob1) // watch first time
var expects = [
{ key: 'test.a', val: obj.a },
{ key: 'test.b', val: obj.b },
{ key: 'test.b.c', val: obj.b.c }
]
ob2.on('set', function (key, val) {
var exp = expects[i]
assert.strictEqual(key, exp.key)
assert.strictEqual(val, exp.val)
i++
})
Observer.observe(obj, 'test', ob2) // watch again
assert.strictEqual(i, expects.length)
})
})
describe('Observing Array', function () {
var arr = [],
ob = new Emitter()
Observer.observe(arr, 'test', ob)
it('should attach the hidden observer', function () {
assert.ok(arr.__observer__ instanceof Emitter)
})
it('should overwrite the native array mutator methods', function () {
['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'].forEach(function (method) {
assert.notStrictEqual(arr[method], Array.prototype[method])
})
})
it('should emit set for .length when it mutates', function () {
var emitted = false
ob.once('set', function (key, val) {
assert.strictEqual(key, 'test.length')
assert.strictEqual(val, 1)
emitted = true
})
arr.push(1)
assert.ok(emitted)
})
describe('Mutator Methods', function () {
it('push', function () {
var arg1 = 123,
arg2 = 234,
emitted = false
ob.once('mutate', function (key, array, mutation) {
assert.strictEqual(key, 'test')
assert.strictEqual(array, arr)
assert.strictEqual(array.length, 3)
assert.strictEqual(mutation.method, 'push')
assert.strictEqual(mutation.args.length, 2)
assert.strictEqual(mutation.args[0], arg1)
assert.strictEqual(mutation.args[1], arg2)
assert.strictEqual(mutation.result, arr.length)
emitted = true
})
var r = arr.push(arg1, arg2)
assert.ok(emitted)
assert.strictEqual(r, arr.length)
})
it('pop', function () {
var emitted = false,
expected = arr[arr.length - 1]
ob.once('mutate', function (key, array, mutation) {
assert.strictEqual(key, 'test')
assert.strictEqual(array, arr)
assert.strictEqual(array.length, 2)
assert.strictEqual(mutation.method, 'pop')
assert.strictEqual(mutation.args.length, 0)
assert.strictEqual(mutation.result, expected)
emitted = true
})
var r = arr.pop()
assert.ok(emitted)
assert.strictEqual(r, expected)
})
it('shift', function () {
var emitted = false,
expected = arr[0]
ob.once('mutate', function (key, array, mutation) {
assert.strictEqual(key, 'test')
assert.strictEqual(array, arr)
assert.strictEqual(array.length, 1)
assert.strictEqual(mutation.method, 'shift')
assert.strictEqual(mutation.args.length, 0)
assert.strictEqual(mutation.result, expected)
emitted = true
})
var r = arr.shift()
assert.ok(emitted)
assert.strictEqual(r, expected)
})
it('unshift', function () {
var emitted = false,
arg1 = 456,
arg2 = 678
ob.once('mutate', function (key, array, mutation) {
assert.strictEqual(key, 'test')
assert.strictEqual(array, arr)
assert.strictEqual(array.length, 3)
assert.strictEqual(mutation.method, 'unshift')
assert.strictEqual(mutation.args.length, 2)
assert.strictEqual(mutation.args[0], arg1)
assert.strictEqual(mutation.args[1], arg2)
assert.strictEqual(mutation.result, arr.length)
emitted = true
})
var r = arr.unshift(arg1, arg2)
assert.ok(emitted)
assert.strictEqual(r, arr.length)
})
it('splice', function () {
var emitted = false,
arg1 = 789,
arg2 = 910,
expected = arr[1]
ob.once('mutate', function (key, array, mutation) {
assert.strictEqual(key, 'test')
assert.strictEqual(array, arr)
assert.strictEqual(array.length, 4)
assert.strictEqual(mutation.method, 'splice')
assert.strictEqual(mutation.args.length, 4)
assert.strictEqual(mutation.args[0], 1)
assert.strictEqual(mutation.args[1], 1)
assert.strictEqual(mutation.args[2], arg1)
assert.strictEqual(mutation.args[3], arg2)
assert.strictEqual(mutation.result.length, 1)
assert.strictEqual(mutation.result[0], expected)
emitted = true
})
var r = arr.splice(1, 1, arg1, arg2)
assert.ok(emitted)
assert.strictEqual(r.length, 1)
assert.strictEqual(r[0], expected)
})
it('sort', function () {
var emitted = false,
sorter = function (a, b) {
return a > b ? -1 : 1
},
copy = arr.slice().sort(sorter)
ob.once('mutate', function (key, array, mutation) {
assert.strictEqual(key, 'test')
assert.strictEqual(array, arr)
assert.strictEqual(mutation.method, 'sort')
assert.strictEqual(mutation.args.length, 1)
assert.strictEqual(mutation.result, arr)
for (var i = 0; i < copy.length; i++) {
assert.strictEqual(array[i], copy[i])
}
emitted = true
})
var r = arr.sort(sorter)
assert.ok(emitted)
assert.strictEqual(r, arr)
})
it('reverse', function () {
var emitted = false,
copy = arr.slice().reverse()
ob.once('mutate', function (key, array, mutation) {
assert.strictEqual(key, 'test')
assert.strictEqual(array, arr)
assert.strictEqual(mutation.method, 'reverse')
assert.strictEqual(mutation.args.length, 0)
assert.strictEqual(mutation.result, arr)
for (var i = 0; i < copy.length; i++) {
assert.strictEqual(array[i], copy[i])
}
emitted = true
})
var r = arr.reverse()
assert.ok(emitted)
assert.strictEqual(r, arr)
})
})
describe('Augmentations', function () {
it('remove (index)', function () {
var emitted = false,
index = ~~(Math.random() * arr.length),
expected = arr[index] = { a: 1 }
ob.once('mutate', function (key, array, mutation) {
emitted = true
assert.strictEqual(mutation.method, 'splice')
assert.strictEqual(mutation.args.length, 2)
assert.strictEqual(mutation.args[0], index)
})
var r = arr.remove(index)
assert.ok(emitted)
assert.strictEqual(r, expected)
})
it('remove (object)', function () {
var emitted = false,
index = ~~(Math.random() * arr.length),
expected = arr[index] = { a: 1 }
ob.once('mutate', function (key, array, mutation) {
emitted = true
assert.strictEqual(mutation.method, 'splice')
assert.strictEqual(mutation.args.length, 2)
assert.strictEqual(mutation.args[0], index)
})
var r = arr.remove(expected)
assert.ok(emitted)
assert.strictEqual(r, expected)
})
it('remove (function)', function () {
var expected = [1001, 1002]
arr.push.apply(arr, expected)
var filter = function (e) {
return e > 1000
},
copy = arr.filter(function (e) {
return e <= 1000
})
var removed = arr.remove(filter)
assert.deepEqual(arr, copy)
assert.deepEqual(expected, removed)
})
it('replace (index)', function () {
var emitted = false,
index = ~~(Math.random() * arr.length),
expected = arr[index] = { a: 1 },
arg = 34567
ob.once('mutate', function (key, array, mutation) {
emitted = true
assert.strictEqual(mutation.method, 'splice')
assert.strictEqual(mutation.args.length, 3)
assert.strictEqual(mutation.args[0], index)
})
var r = arr.replace(index, arg)
assert.ok(emitted)
assert.strictEqual(r, expected)
assert.strictEqual(arr[index], arg)
})
it('replace (object)', function () {
var emitted = false,
index = ~~(Math.random() * arr.length),
expected = arr[index] = { a: 1 },
arg = 45678
ob.once('mutate', function (key, array, mutation) {
emitted = true
assert.strictEqual(mutation.method, 'splice')
assert.strictEqual(mutation.args.length, 3)
assert.strictEqual(mutation.args[0], index)
})
var r = arr.replace(expected, arg)
assert.ok(emitted)
assert.strictEqual(r, expected)
assert.strictEqual(arr[index], arg)
})
it('replace (function)', function () {
arr[0] = 1
arr[1] = 2
arr[2] = 3
var expected = [2, 3, 3],
expectRet = [1, 2]
var replaced = arr.replace(function (e) {
if (e < 3) return e + 1
})
assert.deepEqual(arr, expected)
assert.deepEqual(replaced, expectRet)
})
})
})
describe('Multiple observers', function () {
var ob1 = new Emitter(),
ob2 = new Emitter(),
obj = {a:1}
Observer.observe(obj, 'test', ob1)
Observer.observe(obj, 'test', ob2)
var ob1Called = false,
ob2Called = false
ob1.on('set', function () {
ob1Called = true
})
ob2.on('set', function () {
ob2Called = true
})
it('should trigger events for multiple observers observing the same object', function () {
obj.a = 2
assert.ok(ob1Called)
assert.ok(ob2Called)
})
})
describe('.unobserve()', function () {
var ob1 = new Emitter(),
ob2 = new Emitter(),
obj = {a:1}
Observer.observe(obj, 'test', ob1)
Observer.observe(obj, 'test', ob2)
Observer.unobserve(obj, 'test', ob1)
var ob1Called = false
ob1.on('set', function () {
ob1Called = true
})
var ob2Called = false
ob2.on('set', function () {
ob2Called = true
})
it('should set observer proxies path to null', function () {
assert.strictEqual(ob1.proxies['test.'], null)
})
it('should turn off corresponding event listeners', function () {
var callbacks = obj.__observer__._callbacks
for (var e in callbacks) {
assert.strictEqual(callbacks[e].length, 1)
}
})
it('should no longer emit events', function () {
obj.a = 2
assert.notOk(ob1Called)
assert.ok(ob2Called)
})
})
describe('.ensurePath()', function () {
it('should ensure a path can be accessed without error', function () {
var obj = {},
path = 'a.b.c'
Observer.ensurePath(obj, path)
assert.strictEqual(obj.a.b.c, undefined)
})
})
// describe('.copyPaths()', function () {
// it('should ensure path for all paths that start with the given key', function () {
// var key = 'a',
// obj = {},
// paths = {
// 'a.b.c': 1,
// 'a.d': 2,
// 'e.f': 3,
// 'g': 4
// }
// Observer.ensurePaths(key, obj, paths)
// assert.strictEqual(obj.b.c, undefined)
// assert.strictEqual(obj.d, undefined)
// assert.notOk('f' in obj)
// assert.strictEqual(Object.keys(obj).length, 2)
// })
// })
function setTestFactory (opts) {
return function () {
var ob = new Emitter(),
i = 0,
obj = opts.obj,
expects = opts.expects
Observer.observe(obj, opts.path, ob)
ob.on('set', function (key, val) {
var expect = expects[i]
assert.strictEqual(key, expect.key)
assert.strictEqual(val, expect.val)
i++
})
expects.forEach(function (expect) {
if (expect.skip) return
var path = expect.key.split('.'),
j = 1,
data = obj
while (j < path.length - 1) {
data = data[path[j]]
j++
}
data[path[j]] = expect.val
})
assert.strictEqual(i, expects.length)
}
}
function getTestFactory (opts) {
return function () {
var ob = new Emitter(),
i = 0,
obj = opts.obj,
expects = opts.expects
Observer.observe(obj, opts.path, ob)
ob.on('get', function (key) {
var expected = expects[i]
assert.strictEqual(key, expected)
i++
})
expects.forEach(function (key) {
var path = key.split('.'),
j = 1,
data = obj
while (j < path.length) {
data = data[path[j]]
j++
}
})
assert.strictEqual(i, expects.length)
}
}
})
|
/**
* Cesium - https://github.com/AnalyticalGraphicsInc/cesium
*
* Copyright 2011-2016 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
*/
/**
@license
mersenne-twister.js - https://gist.github.com/banksean/300494
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,r,n){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,r){return"Expected "+r+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,n){if(!t(e))throw new r(a(n))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new r("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new r("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new r(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new r(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new r(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new r(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new r(i(typeof e,"boolean",t))},o}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,p=a.z,m=l*l*h*h,_=E*E*d*d,T=f*f*p*p,y=m+_+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(r,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,N=u.y,S=u.z,I=o;I.x=A.x*v*2,I.y=A.y*N*2,I.z=A.z*S*2;var M,O,g,C,w,P,x,L,U,b,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,g=1/(1+D*v),C=1/(1+D*N),w=1/(1+D*S),P=g*g,x=C*C,L=w*w,U=P*g,b=x*C,F=L*w,M=m*P+_*x+T*L-1,O=m*U*v+_*b*N+T*F*S;var z=-2*O;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*g,c.y=E*C,c.z=f*w,c):new e(l*g,E*C,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var d=r(n)?n.oneOverRadii:E,p=r(n)?n.oneOverRadiiSquared:f,m=r(n)?n._centerToleranceSquared:h,_=o(t,d,p,m,c);if(r(_)){var T=e.multiplyComponents(_,p,s);T=e.normalize(T,T);var y=e.subtract(t,_,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),v=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var n=e[u.getElementIndex(d[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,n=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(d[i],h[i])]);s>n&&(a=i,n=s)}var c=1,l=0,E=h[a],f=d[a];if(Math.abs(e[u.getElementIndex(f,E)])>r){var p,m=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(E,E)],T=e[u.getElementIndex(f,E)],y=(m-_)/2/T;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+p*p),l=p*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(E,E)]=t[u.getElementIndex(f,f)]=c,t[u.getElementIndex(f,E)]=l,t[u.getElementIndex(E,f)]=-l,t}u.packedLength=9,u.pack=function(e,r,n){return n=t(n,0),r[n++]=e[0],r[n++]=e[1],r[n++]=e[2],r[n++]=e[3],r[n++]=e[4],r[n++]=e[5],r[n++]=e[6],r[n++]=e[7],r[n++]=e[8],r},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n++],a[1]=e[n++],a[2]=e[n++],a[3]=e[n++],a[4]=e[n++],a[5]=e[n++],a[6]=e[n++],a[7]=e[n++],a[8]=e[n++],a},u.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n],a[1]=e[n+1],a[2]=e[n+2],a[3]=e[n+3],a[4]=e[n+4],a[5]=e[n+5],a[6]=e[n+6],a[7]=e[n+7],a[8]=e[n+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=n-s-E+h,p=2*(a-f),m=2*(i+l),_=2*(a+f),T=-n+s-E+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),v=-n-s+E+h;return r(t)?(t[0]=d,t[1]=_,t[2]=R,t[3]=p,t[4]=T,t[5]=A,t[6]=m,t[7]=y,t[8]=v,t):new u(d,p,m,_,T,y,R,A,v)},u.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,E=-i*s+c*o*a,f=c*s+i*o*a,h=n*s,d=i*a+c*o*s,p=-o*i+i*o*s,m=-o,_=c*n,T=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=E,t[4]=d,t[5]=_,t[6]=f,t[7]=p,t[8]=T,t):new u(l,E,f,h,d,p,m,_,T)},u.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new u(1,0,0,0,n,-a,0,a,n)},u.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new u(n,0,a,0,1,0,-a,0,n)},u.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(n,-a,0,a,n,0,0,0,1)},u.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},u.setColumn=function(e,t,r,n){n=u.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},u.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},u.setRow=function(e,t,r,n){return n=u.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var E=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],E)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],E)),r};var f=new e;u.getMaximumScale=function(t){return u.getScale(t,f),e.maximumComponent(f)},u.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,r},u.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},u.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},u.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},u.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},u.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},u.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},u.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var h=[1,0,0],d=[2,2,1],p=new u,m=new u;return u.computeEigenDecomposition=function(e,t){var n=o.EPSILON20,a=10,i=0,E=0;r(t)||(t={});for(var f=t.unitary=u.clone(u.IDENTITY,t.unitary),h=t.diagonal=u.clone(e,t.diagonal),d=n*s(h);E<a&&c(h)>d;)l(h,p),u.transpose(p,m),u.multiply(h,p,h),u.multiply(m,h,h),u.multiply(f,p,f),++i>2&&(++E,i=0);return t},u.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},u.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},u.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=u.determinant(e);t[0]=o*E-l*s,t[1]=l*a-n*E,t[2]=n*s-o*a,t[3]=c*s-i*E,t[4]=r*E-c*a,t[5]=i*a-r*s,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return u.multiplyByScalar(t,h,t)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(e,r,n,a,o){return t(o)?(o.x=e,o.y=r,o.z=n,o.w=a,o):new i(e,r,n,a)},i.fromColor=function(e,r){return t(r)?(r.x=e.red,r.y=e.green,r.z=e.blue,r.w=e.alpha,r):new i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=4*n:r=new Array(4*n);for(var a=0;a<n;++a)i.pack(e[a],r,4*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/4:r=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},i.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,s);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z&&e.w===r.w},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)&&a.equalsEpsilon(e.z,r.z,n,i)&&a.equalsEpsilon(e.w,r.w,n,i)},i.ZERO=n(new i(0,0,0,0)),i.UNIT_X=n(new i(1,0,0,0)),i.UNIT_Y=n(new i(0,1,0,0)),i.UNIT_Z=n(new i(0,0,1,0)),i.UNIT_W=n(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,E,f,h,d,p,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),
this[5]=r(o,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(m,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,a,i){return a=r(a,e.ZERO),n(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,m=t.z*t.z,_=t.z*t.w,T=t.w*t.w,y=s-h-m+T,R=2*(c-_),A=2*(E+p),v=2*(c+_),N=-s+h-m+T,S=2*(d-f),I=2*(E-p),M=2*(d+f),O=-s-h+m+T;return a[0]=y*i,a[1]=v*i,a[2]=I*i,a[3]=0,a[4]=R*o,a[5]=N*o,a[6]=M*o,a[7]=0,a[8]=A*u,a[9]=S*u,a[10]=O*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,r){var a=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,p=E.y,m=E.z,_=h.x,T=h.y,y=h.z,R=a.x,A=a.y,v=a.z,N=u*-R+s*-A+c*-v,S=_*-R+T*-A+y*-v,I=d*R+p*A+m*v;return n(r)?(r[0]=u,r[1]=_,r[2]=-d,r[3]=0,r[4]=s,r[5]=T,r[6]=-p,r[7]=0,r[8]=c,r[9]=y,r[10]=-m,r[11]=0,r[12]=N,r[13]=S,r[14]=I,r[15]=1,r):new l(u,s,c,N,_,T,y,S,-d,-p,-m,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,E=.5*(n-t),f=c,h=l,d=E,p=i+c,m=o+l,_=t+E,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=p,a[13]=m,a[14]=_,a[15]=T,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var d=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],_=e[14],T=e[15],y=t[0],R=t[1],A=t[2],v=t[3],N=t[4],S=t[5],I=t[6],M=t[7],O=t[8],g=t[9],C=t[10],w=t[11],P=t[12],x=t[13],L=t[14],U=t[15],b=n*y+u*R+E*A+p*v,F=a*y+s*R+f*A+m*v,D=i*y+c*R+h*A+_*v,B=o*y+l*R+d*A+T*v,z=n*N+u*S+E*I+p*M,G=a*N+s*S+f*I+m*M,V=i*N+c*S+h*I+_*M,q=o*N+l*S+d*I+T*M,X=n*O+u*g+E*C+p*w,H=a*O+s*g+f*C+m*w,W=i*O+c*g+h*C+_*w,k=o*O+l*g+d*C+T*w,Y=n*P+u*x+E*L+p*U,K=a*P+s*x+f*L+m*U,Z=i*P+c*x+h*L+_*U,j=o*P+l*x+d*L+T*U;return r[0]=b,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=X,r[9]=H,r[10]=W,r[11]=k,r[12]=Y,r[13]=K,r[14]=Z,r[15]=j,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],p=t[0],m=t[1],_=t[2],T=t[4],y=t[5],R=t[6],A=t[8],v=t[9],N=t[10],S=t[12],I=t[13],M=t[14],O=n*p+o*m+c*_,g=a*p+u*m+l*_,C=i*p+s*m+E*_,w=n*T+o*y+c*R,P=a*T+u*y+l*R,x=i*T+s*y+E*R,L=n*A+o*v+c*N,U=a*A+u*v+l*N,b=i*A+s*v+E*N,F=n*S+o*I+c*M+f,D=a*S+u*I+l*M+h,B=i*S+s*I+E*M+d;return r[0]=O,r[1]=g,r[2]=C,r[3]=0,r[4]=w,r[5]=P,r[6]=x,r[7]=0,r[8]=L,r[9]=U,r[10]=b,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],p=t[3],m=t[4],_=t[5],T=t[6],y=t[7],R=t[8],A=n*f+o*h+c*d,v=a*f+u*h+l*d,N=i*f+s*h+E*d,S=n*p+o*m+c*_,I=a*p+u*m+l*_,M=i*p+s*m+E*_,O=n*T+o*y+c*R,g=a*T+u*y+l*R,C=i*T+s*y+E*R;return r[0]=A,r[1]=v,r[2]=N,r[3]=0,r[4]=S,r[5]=I,r[6]=M,r[7]=0,r[8]=O,r[9]=g,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var m=new e;l.multiplyByUniformScale=function(e,t,r){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var _=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,_),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],p=e[2],m=e[6],A=e[10],v=e[14],N=e[3],S=e[7],I=e[11],M=e[15],O=A*M,g=v*I,C=m*M,w=v*S,P=m*I,x=A*S,L=p*M,U=v*N,b=p*I,F=A*N,D=p*S,B=m*N,z=O*f+w*h+P*d-(g*f+C*h+x*d),G=g*E+L*h+F*d-(O*E+U*h+b*d),V=C*E+U*f+D*d-(w*E+L*f+B*d),q=x*E+b*f+B*h-(P*E+F*f+D*h),X=g*a+C*i+x*o-(O*a+w*i+P*o),H=O*n+U*i+b*o-(g*n+L*i+F*o),W=w*n+L*a+B*o-(C*n+U*a+D*o),k=P*n+F*a+D*i-(x*n+b*a+B*i);O=i*d,g=o*h,C=a*d,w=o*f,P=a*h,x=i*f,L=n*d,U=o*E,b=n*h,F=i*E,D=n*f,B=a*E;var Y=O*S+w*I+P*M-(g*S+C*I+x*M),K=g*N+L*I+F*M-(O*N+U*I+b*M),Z=C*N+U*S+D*M-(w*N+L*S+B*M),j=x*N+b*S+B*I-(P*N+F*S+D*I),Q=C*A+x*v+g*m-(P*v+O*m+w*A),J=b*v+O*p+U*A-(L*A+F*v+g*p),$=L*m+B*v+w*p-(D*v+C*p+U*m),ee=D*A+P*p+F*m-(b*m+B*A+x*p),te=n*z+a*G+i*V+o*q;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=V*te,r[3]=q*te,r[4]=X*te,r[5]=H*te,r[6]=W*te,r[7]=k*te,r[8]=Y*te,r[9]=K*te,r[10]=Z*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,p=-i*E-o*f-u*h,m=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north,r},s.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new s),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,n,a,i,o){return e=u.toRadians(t(e,0)),n=u.toRadians(t(n,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),r(o)?(o.west=e,o.south=n,o.east=a,o.north=i,o):new s(e,n,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=E,n):new s(a,l,i,E)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=h,n):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=E,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,n,a,o){n=t(n,i.WGS84),a=t(a,0),r(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,p=c;p.height=a,p.longitude=d,p.latitude=E,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.latitude=f,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++,E<0?p.latitude=E:f>0?p.latitude=f:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=n.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=n.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,d=new e,p=new e,m=new e,_=new e,T=new e,y=new e,R=new e,A=new e,v=new e,N=new e,S=new e;f.fromPoints=function(t,r){if(n(r)||(r=new f),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var a=e.clone(t[0],y),i=e.clone(a,h),o=e.clone(a,d),u=e.clone(a,p),s=e.clone(a,m),c=e.clone(a,_),l=e.clone(a,T),E=t.length,I=1;I<E;I++){e.clone(t[I],a);var M=a.x,O=a.y,g=a.z;M<i.x&&e.clone(a,i),M>s.x&&e.clone(a,s),O<o.y&&e.clone(a,o),O>c.y&&e.clone(a,c),g<u.z&&e.clone(a,u),g>l.z&&e.clone(a,l)}var C=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=i,L=s,U=C;w>U&&(U=w,x=o,L=c),P>U&&(U=P,x=u,L=l);var b=A;b.x=.5*(x.x+L.x),b.y=.5*(x.y+L.y),b.z=.5*(x.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,R)),D=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var z=N;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,S),V=0;for(I=0;I<E;I++){e.clone(t[I],a);var q=e.magnitude(e.subtract(a,G,R));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(a,b,R));if(X>F){var H=Math.sqrt(X);D=.5*(D+H),F=D*D;var W=H-D;b.x=(D*b.x+W*a.x)/H,b.y=(D*b.y+W*a.y)/H,b.z=(D*b.z+W*a.z)/H}}return D<V?(e.clone(b,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var I=new o,M=new e,O=new e,g=new t,C=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,a,i,o,u){if(n(u)||(u=new f),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=r(a,I),E.southwest(t,g),g.height=i,E.northeast(t,C),C.height=o;var s=a.project(g,M),c=a.project(C,O),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=E.subsample(e,t,a,w)),f.fromPoints(u,o)},f.fromVertices=function(t,a,i,o){if(n(o)||(o=new f),!n(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=r(a,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,m),I=e.clone(u,_),M=e.clone(u,T),O=t.length,g=0;g<O;g+=i){var C=t[g]+a.x,w=t[g+1]+a.y,P=t[g+2]+a.z;u.x=C,u.y=w,u.z=P,C<s.x&&e.clone(u,s),C>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),P<l.z&&e.clone(u,l),P>M.z&&e.clone(u,M)}var x=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(I,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),b=s,F=E,D=x;L>D&&(D=L,b=c,F=I),U>D&&(D=U,b=l,F=M);var B=A;B.x=.5*(b.x+F.x),B.y=.5*(b.y+F.y),B.z=.5*(b.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),V=v;V.x=s.x,V.y=c.y,V.z=l.z;var q=N;q.x=E.x,q.y=I.y,q.z=M.z;var X=e.multiplyByScalar(e.add(V,q,R),.5,S),H=0;for(g=0;g<O;g+=i){u.x=t[g]+a.x,u.y=t[g+1]+a.y,u.z=t[g+2]+a.z;var W=e.magnitude(e.subtract(u,X,R));W>H&&(H=W);var k=e.magnitudeSquared(e.subtract(u,B,R));if(k>z){var Y=Math.sqrt(k);G=.5*(G+Y),z=G*G;var K=Y-G;B.x=(G*B.x+K*u.x)/Y,B.y=(G*B.y+K*u.y)/Y,B.z=(G*B.z+K*u.z)/Y}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},f.fromEncodedCartesianVertices=function(t,r,a){if(n(a)||(a=new f),!n(t)||!n(r)||t.length!==r.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=y;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,_),E=e.clone(i,T),I=t.length,M=0;M<I;M+=3){var O=t[M]+r[M],g=t[M+1]+r[M+1],C=t[M+2]+r[M+2];i.x=O,i.y=g,i.z=C,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),C<s.z&&e.clone(i,s),C>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=e.magnitudeSquared(e.subtract(E,s,R)),L=o,U=c,b=w;P>b&&(b=P,L=u,U=l),x>b&&(b=x,L=s,U=E);var F=A;F.x=.5*(L.x+U.x),F.y=.5*(L.y+U.y),F.z=.5*(L.z+U.z);var D=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(D),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,R),.5,S),q=0;for(M=0;M<I;M+=3){i.x=t[M]+r[M],i.y=t[M+1]+r[M+1],i.z=t[M+2]+r[M+2];var X=e.magnitude(e.subtract(i,V,R));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var k=W-B;F.x=(B*F.x+k*i.x)/W,F.y=(B*F.y+k*i.y)/W,F.z=(B*F.z+k*i.z)/W}}return B<q?(e.clone(F,a.center),a.radius=B):(e.clone(V,a.center),a.radius=q),a},f.fromCornerPoints=function(t,r,a){n(a)||(a=new f);var i=a.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,r),a},f.fromEllipsoid=function(t,r){return n(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;f.fromBoundingSpheres=function(t,r){if(n(r)||(r=new f),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=t.length;if(1===a)return f.clone(t[0],r);if(2===a)return f.union(t[0],t[1],r);for(var i=[],o=0;o<a;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var x=new e,L=new e,U=new e;f.fromOrientedBoundingBox=function(t,r){n(r)||(r=new f);var a=t.halfAxes,i=c.getColumn(a,0,x),o=c.getColumn(a,1,L),u=c.getColumn(a,2,U),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,E),r},f.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,a){t=r(t,0),n(a)||(a=new f);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var b=new e,F=new e;f.union=function(t,r,a){n(a)||(a=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,b),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return r.clone(a),a;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,a.center),a.radius=E,a};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,V=new e,q=new e,X=new e,H=new e,W=new t,k=new Array(8),Y=0;Y<8;++Y)k[Y]=new e;var K=new o;return f.projectTo2D=function(t,n,a){n=r(n,K);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,V);e.normalize(c,c);var l=e.cross(s,c,q);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,H),h=e.negate(c,X),d=k,p=d[0];e.add(s,l,p),e.add(p,c,p),p=d[1],e.add(s,l,p),e.add(p,h,p),p=d[2],e.add(s,E,p),e.add(p,h,p),p=d[3],e.add(s,E,p),e.add(p,c,p),e.negate(s,s),p=d[4],e.add(s,l,p),e.add(p,c,p),p=d[5],e.add(s,l,p),e.add(p,h,p),p=d[6],e.add(s,E,p),e.add(p,h,p),p=d[7],e.add(s,E,p),e.add(p,c,p);for(var m=d.length,_=0;_<m;++_){var T=d[_];e.add(o,T,T);var y=i.cartesianToCartographic(T,W);n.project(y,T)}a=f.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,S=n(e[1]))}return N}function u(){return o()&&S}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,M=n(e[1]),M.isNightly=!!e[2])}return I}function c(){return s()&&M}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1])))}return O}function E(){return l()&&g}function f(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,w=n(e[1]))}return C}function h(){return f()&&w}function d(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(P=!0,x=n(e[1]))}return P}function p(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function m(){return d()&&x}function _(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function T(){
if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(b=r)}return F}function y(){return T()?b:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,N,S,I,M,O,g,C,w,P,x,L,U,b,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:T,imageRenderingValue:y};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r){this.x=e(t,0),this.y=e(r,0)}i.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new i(e,r)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n]=t.y,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=2*n:r=new Array(2*n);for(var a=0;a<n;++a)i.pack(e[a],r,2*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/2:r=new Array(n/2);for(var a=0;a<n;a+=2){var o=a/2;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},i.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);return i.abs(r,r),t=r.x<=r.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)},i.ZERO=n(new i(0,0)),i.UNIT_X=n(new i(1,0)),i.UNIT_Y=n(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var E,f,h,d,p,m,_,T;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(n,a,u),d=t.dot(E,E),p=t.dot(E,f),m=t.dot(E,h),_=t.dot(f,f),T=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(n,a,u),d=e.dot(E,E),p=e.dot(E,f),m=e.dot(E,h),_=e.dot(f,f),T=e.dot(f,h));var y=1/(d*_-p*p);return l.y=(_*m-p*T)*y,l.z=(d*T-p*m)*y,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,p=o*c-u*s,m=u*c-h,_=4*d*m-p*p;if(_<0){var T,y,R;f*E>=l*h?(T=o,y=d,R=-2*u*d+o*p):(T=c,y=m,R=-c*p+2*s*m);var A=R<0?-1:1,v=-A*Math.abs(T)*Math.sqrt(-_);i=-R+v;var N=i/2,S=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===v?-S:-y/S;return a=y<=0?S+I:-R/(S*S+I*I+y),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var M=d,O=-2*u*d+o*p,g=m,C=-c*p+2*s*m,w=Math.sqrt(_),P=Math.sqrt(3)/2,x=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-M);var L=Math.cos(x);i=a*L;var U=a*(-L/2-P*Math.sin(x)),b=i+U>2*u?i-u:U-u,F=o,D=b/F;x=Math.abs(Math.atan2(c*w,-C)/3),a=2*Math.sqrt(-g),L=Math.cos(x),i=a*L,U=a*(-L/2-P*Math.sin(x));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,V=F*z,q=-b*z-F*B,X=b*B,H=(s*q-u*X)/(-u*q+s*V);return D<=H?D<=G?H<=G?[D,H,G]:[D,G,H]:[G,D,H]:D<=G?[H,D,G]:H<=G?[H,G,D]:[G,H,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var p,m=d[0],_=d[1];if(m>=0&&_>=0){var T=Math.sqrt(m),y=Math.sqrt(_);return[f-y,f-T,f+T,f+y]}if(m>=0&&_<0)return p=Math.sqrt(m),[f-p,f+p];if(m<0&&_>=0)return p=Math.sqrt(_),[f-p,f+p]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,N=n.computeRealRoots(1,R,A),S=n.computeRealRoots(1,-R,v);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==S.length?(S[0]+=f,S[1]+=f,N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>S[0]&&N[0]<S[1]?[S[0],N[0],S[1],N[1]]:[N[0],S[0],N[1],S[1]]):N):0!==S.length?(S[0]+=f,S[1]+=f,S):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,p,m=h[0],_=a-m,T=_*_,y=t/2,R=_/2,A=T-4*o,v=T+4*Math.abs(o),N=c-4*m,S=c+4*Math.abs(m);if(m<0||A*S<N*v){var I=Math.sqrt(N);d=I/2,p=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);d=0===M?0:(t*R-i)/M,p=M/2}var O,g;0===y&&0===d?(O=0,g=0):r.sign(y)===r.sign(d)?(O=y+d,g=m/O):(g=y-d,O=m/g);var C,w;0===R&&0===p?(C=0,w=0):r.sign(R)===r.sign(p)?(C=R+p,w=o/C):(w=R-p,C=o/w);var P=n.computeRealRoots(1,O,C),x=n.computeRealRoots(1,g,w);if(0!==P.length)return 0!==x.length?P[1]<=x[0]?[P[0],P[1],x[0],x[1]]:x[1]<=P[0]?[x[0],x[1],P[0],P[1]]:P[0]>=x[0]&&P[1]<=x[1]?[x[0],P[0],P[1],x[1]]:x[0]>=P[0]&&x[1]<=P[1]?[P[0],x[0],x[1],P[1]]:P[0]>x[0]&&P[0]<x[1]?[x[0],P[0],x[1],P[1]]:[P[0],x[0],P[1],x[1]]:P;if(0!==x.length)return x}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,p=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function E(t,r,a){n(a)||(a={});var i=t.origin,o=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(i,u,_),E=e.dot(o,o),f=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,d=l(E,f,h,A);if(n(d))return a.start=d.root0,a.stop=d.root1,a}function f(e,t,r){var n=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function h(t,r,n,a,c){var l,E=a*a,h=c*c,d=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(a*f(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),m=t[o.COLUMN0ROW0]*E+t[o.COLUMN2ROW2]*h+a*r.x+n,_=h*f(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),T=c*(a*f(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),y=[];if(0===T&&0===_){if(l=u.computeRealRoots(d,p,m),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,c*R,c*-A)),y.push(new e(a,c*R,c*A)),2===l.length){var v=l[1],N=Math.sqrt(Math.max(1-v*v,0));y.push(new e(a,c*v,c*-N)),y.push(new e(a,c*v,c*N))}return y}var S=T*T,I=_*_,M=d*d,O=T*_,g=M+I,C=2*(p*d+O),w=2*m*d+p*p-I+S,P=2*(m*p-O),x=m*m-S;if(0===g&&0===C&&0===w&&0===P)return y;l=s.computeRealRoots(g,C,w,P,x);var L=l.length;if(0===L)return y;for(var U=0;U<L;++U){var b,F=l[U],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);b=i.sign(d)===i.sign(m)?f(d*D+m,p*F,i.EPSILON12):i.sign(m)===i.sign(p*F)?f(d*D,p*F+m,i.EPSILON12):f(d*D+p*F,m,i.EPSILON12);var G=f(_*F,T,i.EPSILON15),V=b*G;V<0?y.push(new e(a,c*F,c*z)):V>0?y.push(new e(a,c*F,c*-z)):0!==z?(y.push(new e(a,c*F,c*-z)),y.push(new e(a,c*F,c*z)),
++U):y.push(new e(a,c*F,c*z))}return y}var d={};d.rayPlane=function(t,r,a){n(a)||(a=new e);var o=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-r.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var p=new e,m=new e,_=new e,T=new e,y=new e;d.rayTriangleParametric=function(t,n,a,o,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,R=e.subtract(a,n,p),A=e.subtract(o,n,m),v=e.cross(d,A,_),N=e.dot(R,v);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(h,n,T),l=e.dot(s,v),l<0||l>N)return;if(c=e.cross(s,R,y),E=e.dot(d,c),E<0||l+E>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<i.EPSILON6)return;var S=1/N;if(s=e.subtract(h,n,T),l=e.dot(s,v)*S,l<0||l>1)return;if(c=e.cross(s,R,y),E=e.dot(d,c)*S,E<0||l+E>1)return;f=e.dot(A,c)*S}return f},d.rayTriangle=function(t,r,a,i,o,u){var s=d.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;d.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=d.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};d.raySphere=function(e,t,r){if(r=E(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var v=new c;d.lineSegmentSphere=function(t,r,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=E(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,S=new e;d.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,N),l=e.multiplyComponents(s,t.direction,S),E=e.magnitudeSquared(c),f=e.dot(c,l);if(E>1){if(f>=0)return;var h=f*f;if(n=E-1,a=e.magnitudeSquared(l),i=a*n,h<i)return;if(h>i){o=f*f-i,u=-f+Math.sqrt(o);var d=u/a,p=n/u;return d<p?{start:d,stop:p}:{start:p,stop:d}}var m=Math.sqrt(n/a);return{start:m,stop:m}}return E<1?(n=E-1,a=e.magnitudeSquared(l),i=a*n,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):f<0?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var I=new e,M=new e,O=new e,g=new e,C=new e,w=new o,P=new o,x=new o,L=new o,U=new o,b=new o,F=new o,D=new e,B=new e,z=new t;d.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,I);if(e.dot(u,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,I),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,g),d=e.normalize(e.cross(f,E,M),M),p=e.normalize(e.cross(E,d,O),O),m=w;m[0]=E.x,m[1]=E.y,m[2]=E.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var _=o.transpose(m,P),T=o.fromScale(r.radii,x),y=o.fromScale(r.oneOverRadii,L),R=U;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,v,N=o.multiply(o.multiply(_,y,b),R,b),S=o.multiply(o.multiply(N,T,F),m,F),G=o.multiplyByVector(N,a,C),V=h(S,e.negate(G,I),0,0,1),q=V.length;if(q>0){for(var X=e.clone(e.ZERO,B),H=Number.NEGATIVE_INFINITY,W=0;W<q;++W){A=o.multiplyByVector(T,o.multiplyByVector(m,V[W],D),D);var k=e.normalize(e.subtract(A,a,g),g),Y=e.dot(k,u);Y>H&&(H=Y,X=e.clone(A,X))}var K=r.cartesianToCartographic(X,z);return H=i.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,g))*Math.sqrt(1-H*H),v=c?-v:v,K.height=v,r.cartographicToCartesian(K,new e)}};var G=new e;return d.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,o),e.add(t,o,o),o}},d.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return d.lineSegmentPlane(t,r,a,E),d.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return d.lineSegmentPlane(r,n,a,E),d.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return d.lineSegmentPlane(n,t,a,E),d.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return d.lineSegmentPlane(r,t,a,E),d.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return d.lineSegmentPlane(n,r,a,E),d.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return d.lineSegmentPlane(t,n,a,E),d.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},d}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],p=0;p<l;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var m=0;E<h;)d[o[E]].vertexTriangles.push(m),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(m),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(m),++d[o[E+2]].numLiveTriangles,++m,E+=3;var _=0,T=s+1;i=1;var y,R,A=[],v=[],N=0,S=[],I=c/3,M=[];for(p=0;p<I;p++)M[p]=!1;for(var O,g;_!==-1;){A=[],R=d[_],g=R.vertexTriangles.length;for(var C=0;C<g;++C)if(m=R.vertexTriangles[C],!M[m]){M[m]=!0,E=m+m+m;for(var w=0;w<3;++w)O=o[E],A.push(O),v.push(O),S[N]=O,++N,y=d[O],--y.numLiveTriangles,T-y.timeStamp>s&&(y.timeStamp=T,++T),++E}_=a(o,s,A,d,T,v,l)}return S},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,p,m,_,T,y,R,A,v,N,S){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function M(e){for(var t=e.length,r=t/3*6,n=m.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=m.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function g(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=m.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function C(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new d({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function w(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function x(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function L(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,_=L(e,t);for(n in _)if(_.hasOwnProperty(n))for(s=_[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var T;if(d){var y=0;for(i=0;i<f;++i)y+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:_,primitiveType:N.POINTS})),A=m.createTypedArray(R,y),v=0,S=0;for(i=0;i<f;++i){var I=e[i][t].indices,M=I.length;for(u=0;u<M;++u)A[v++]=S+I[u];S+=h.computeNumberOfVertices(e[i][t])}T=A}var O,g=new a,C=0;for(i=0;i<f;++i){if(O=e[i][t].boundingSphere,!c(O)){g=void 0;break}a.add(O.center,g,g)}if(c(g))for(a.divideByScalar(g,f,g),i=0;i<f;++i){O=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(O.center,g,se))+O.radius;w>C&&(C=w)}return new h({attributes:_,indices:T,primitiveType:p,boundingSphere:c(g)?new r(g,C):void 0})}function b(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=N.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=N.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function z(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=N.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=N.LINES,e}function V(e){switch(e.primitiveType){case N.TRIANGLE_FAN:return F(e);case N.TRIANGLE_STRIP:return D(e);case N.TRIANGLES:return b(e);case N.LINE_STRIP:return z(e);case N.LINE_LOOP:return G(e);case N.LINES:return B(e)}return e}function q(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return q(e,e.y<0),q(t,t.y<0),void q(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?y.sign(e.y):y.sign(r.y):i>o?y.sign(t.y):y.sign(r.y);var u=n<0;q(e,u),q(t,u),q(r,u)}function H(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),r),a.clone(r,n),q(r,!0),q(n,!1)}function W(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,Ae,Ne),H(e,r,ve,Se),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,r,Ae,Ne),H(t,e,ve,Se),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(r,e,Ae,Ne),H(r,t,ve,Se),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(H(r,e,Ae,Ne),H(r,t,ve,Se),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,Ae,Ne),H(t,e,ve,Se),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,Ae,Ne),H(e,r,ve,Se),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=ve,s[5]=Ne,s[6]=Se,s.length=7),Ie}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function K(e,t,r){var n=c(e.geometry.boundingSphere);t=k(t,n),r=k(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,o,u,s,l,E,f,h,d){if(c(s)||c(l)||c(E)||c(f)){var p=a.fromArray(u,3*e,Me),m=a.fromArray(u,3*r,Oe),_=a.fromArray(u,3*i,ge),T=t(o,p,m,_,Ce);if(c(s)){var y=a.fromArray(s,3*e,Me),R=a.fromArray(s,3*r,Oe),A=a.fromArray(s,3*i,ge);a.multiplyByScalar(y,T.x,y),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(A,T.z,A);var v=a.add(y,R,y);a.add(v,A,v),a.normalize(v,v),a.pack(v,h.normal.values,3*d)}if(c(l)){var N=a.fromArray(l,3*e,Me),S=a.fromArray(l,3*r,Oe),I=a.fromArray(l,3*i,ge);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(S,T.y,S),a.multiplyByScalar(I,T.z,I);var M=a.add(N,S,N);a.add(M,I,M),a.normalize(M,M),a.pack(M,h.binormal.values,3*d)}if(c(E)){var O=a.fromArray(E,3*e,Me),g=a.fromArray(E,3*r,Oe),C=a.fromArray(E,3*i,ge);a.multiplyByScalar(O,T.x,O),a.multiplyByScalar(g,T.y,g),a.multiplyByScalar(C,T.z,C);var w=a.add(O,g,O);a.add(w,C,w),a.normalize(w,w),a.pack(w,h.tangent.values,3*d)}if(c(f)){var P=n.fromArray(f,2*e,we),x=n.fromArray(f,2*r,Pe),L=n.fromArray(f,2*i,xe);n.multiplyByScalar(P,T.x,P),n.multiplyByScalar(x,T.y,x),n.multiplyByScalar(L,T.z,L);var U=n.add(P,x,P);n.add(U,L,U),n.pack(U,h.st.values,2*d)}}}function j(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.binormal)?s.binormal.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,p=u.indices,m=Y(u),_=Y(u),T=[];T.length=l.length/3;var y=[];for(y.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,y[o]=-1;var R=p.length;for(o=0;o<R;o+=3){var A=p[o],v=p[o+1],N=p[o+2],S=a.fromArray(l,3*A),I=a.fromArray(l,3*v),M=a.fromArray(l,3*N),O=W(S,I,M);if(c(O)&&O.positions.length>3)for(var g=O.positions,C=O.indices,w=C.length,P=0;P<w;++P){var x=C[P],L=g[x];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=y),i=j(t,r,n,p,x<3?o+x:-1,L),Z(A,v,N,L,l,E,f,h,d,t,i)}else c(O)&&(S=O.positions[0],I=O.positions[1],M=O.positions[2]),S.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=y),i=j(t,r,n,p,o,S),Z(A,v,N,S,l,E,f,h,d,t,i),i=j(t,r,n,p,o+1,I),Z(A,v,N,I,l,E,f,h,d,t,i),i=j(t,r,n,p,o+2,M),Z(A,v,N,M,l,E,f,h,d,t,i)}K(e,_,m)}function J(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=Y(r),s=Y(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],p=a.fromArray(i,3*h,Me),m=a.fromArray(i,3*d,Oe);Math.abs(p.y)<y.EPSILON6&&(p.y<0?p.y=-y.EPSILON6:p.y=y.EPSILON6),Math.abs(m.y)<y.EPSILON6&&(m.y<0?m.y=-y.EPSILON6:m.y=y.EPSILON6);var _=u.attributes,R=u.indices,A=f,v=s.attributes,N=s.indices,S=E,I=T.lineSegmentPlane(p,m,Le,ge);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*y.EPSILON9,Ue);p.y<0&&(a.negate(M,M),_=s.attributes,R=s.indices,A=E,v=u.attributes,N=u.indices,S=f);var O=a.add(I,M,be);j(_,R,A,o,t,p),j(_,R,A,o,-1,O),a.negate(M,M),a.add(I,M,O),j(v,N,S,o,-1,O),j(v,N,S,o,t+1,m)}else{var g,C,w;p.y<0?(g=s.attributes,C=s.indices,w=E):(g=u.attributes,C=u.indices,w=f),j(g,C,w,o,t,p),j(g,C,w,o,t+1,m)}}K(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Be);if(!(s.x>0)){var c=a.unpack(n,u,ze);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ge);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=Y(u),_=Y(u),R=!1,A=l.length/3;for(t=0;t<A;t+=4){var v=t,N=t+2,S=a.fromArray(l,3*v,Be),I=a.fromArray(l,3*N,ze);if(Math.abs(S.y)<ke)for(S.y=ke*(I.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,r=3*v;r<3*v+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<ke)for(I.y=ke*(S.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*v;r<3*v+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var M=m.attributes,O=m.indices,g=_.attributes,C=_.indices,w=T.lineSegmentPlane(S,I,Le,Ve);if(c(w)){R=!0;var P=a.multiplyByScalar(a.UNIT_Y,We,qe);S.y<0&&(a.negate(P,P),M=_.attributes,O=_.indices,g=m.attributes,C=m.indices);var x=a.add(w,P,Xe);M.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),M.position.values.push(x.x,x.y,x.z),M.position.values.push(x.x,x.y,x.z),M.prevPosition.values.push(E[3*v],E[3*v+1],E[3*v+2]),M.prevPosition.values.push(E[3*v+3],E[3*v+4],E[3*v+5]),M.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),a.negate(P,P),a.add(w,P,x),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.nextPosition.values.push(f[3*N],f[3*N+1],f[3*N+2]),g.nextPosition.values.push(f[3*N+3],f[3*N+4],f[3*N+5]);var L=n.fromArray(h,2*v,Fe),U=Math.abs(L.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),g.expandAndWidth.values.push(-1,U,1,U),g.expandAndWidth.values.push(-1,-U,1,-U);var b=a.magnitudeSquared(a.subtract(w,S,Ge));if(b/=a.magnitudeSquared(a.subtract(I,S,Ge)),c(p)){var F=i.fromArray(p,4*v,He),D=i.fromArray(p,4*N,He),B=y.lerp(F.x,D.x,b),z=y.lerp(F.y,D.y,b),G=y.lerp(F.z,D.z,b),V=y.lerp(F.w,D.w,b);for(r=4*v;r<4*v+8;++r)M.color.values.push(p[r]);for(M.color.values.push(B,z,G,V),M.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),r=4*N;r<4*N+8;++r)g.color.values.push(p[r])}if(c(d)){var q=n.fromArray(d,2*v,Fe),X=n.fromArray(d,2*(t+3),De),H=y.lerp(q.x,X.x,b);for(r=2*v;r<2*v+4;++r)M.st.values.push(d[r]);for(M.st.values.push(H,q.y),M.st.values.push(H,X.y),g.st.values.push(H,q.y),g.st.values.push(H,X.y),r=2*N;r<2*N+4;++r)g.st.values.push(d[r])}o=M.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=g.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var W,k;for(S.y<0?(W=_.attributes,k=_.indices):(W=m.attributes,k=m.indices),W.position.values.push(S.x,S.y,S.z),W.position.values.push(S.x,S.y,S.z),W.position.values.push(I.x,I.y,I.z),W.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)W.prevPosition.values.push(E[r]),W.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)W.expandAndWidth.values.push(h[r]),c(d)&&W.st.values.push(d[r]);if(c(p))for(r=4*t;r<4*t+16;++r)W.color.values.push(p[r]);o=W.position.values.length/3-4,k.push(o,o+2,o+1),k.push(o+1,o+2,o+3)}}R&&($(_),$(m)),K(e,_,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case N.TRIANGLES:e.indices=M(t);break;case N.TRIANGLE_STRIP:e.indices=O(t);break;case N.TRIANGLE_FAN:e.indices=g(t)}e.primitiveType=N.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var p,m=e.boundingSphere;return c(m)&&(p=new r(m.center,m.radius+n)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:N.LINES,boundingSphere:p})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=m.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var p=e.attributes;for(var _ in p)if(p.hasOwnProperty(_)&&c(p[_])&&c(p[_].values)){for(var T=p[_],y=T.values,R=0,A=T.componentsPerAttribute,v=u.createTypedArray(T.componentDatatype,d*A);R<t;){var N=n[R];if(N!==-1)for(a=0;a<A;a++)v[A*N+a]=y[A*R+a];++R}T.values=v}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===N.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=S.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=C(e.attributes),s=e.indices,l=s.length;e.primitiveType===N.TRIANGLES?n=3:e.primitiveType===N.LINES?n=2:e.primitiveType===N.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var d=s[E+f],p=a[d];c(p)||(p=o++,a[d]=p,w(u,e.attributes,d)),i.push(p)}o+n>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=C(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var m=a.fromArray(l,p,re),_=s.cartesianToCartographic(m,ne),T=i.project(_,re);E[h++]=T.x,E[h++]=T.y,E[h++]=T.z}return e.attributes[r]=o,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new A,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),x(ue,n.normal),x(ue,n.binormal),x(ue,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],p=t[E+1],m=t[E+2],_=3*h,T=3*p,y=3*m;le.x=n[_],le.y=n[_+1],le.z=n[_+2],Ee.x=n[T],Ee.y=n[T+1],Ee.z=n[T+2],fe.x=n[y],fe.y=n[y+1],fe.z=n[y+2],s[h].count++,s[p].count++,s[m].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var R=0;for(E=0;E<i;E++)s[E].indexOffset+=R,R+=s[E].count;f=0;var A;for(E=0;E<o;E+=3){A=s[t[E]];var v=A.indexOffset+A.currentCount;l[v]=f,A.currentCount++,A=s[t[E+1]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,A=s[t[E+2]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var S=3*E;if(A=s[E],A.count>0){for(a.clone(a.ZERO,ce),f=0;f<A.count;f++)a.add(ce,c[l[A.indexOffset+f]],ce);a.normalize(ce,ce),N[S]=ce.x,N[S+1]=ce.y,N[S+2]=ce.z}else N[S]=0,N[S+1]=0,N[S+2]=1}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,pe=new a;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var p=t[l],m=t[l+1],_=t[l+2];E=3*p,f=3*m,h=3*_;var T=2*p,y=2*m,R=2*_,A=r[E],v=r[E+1],N=r[E+2],S=i[T],I=i[T+1],M=i[y+1]-I,O=i[R+1]-I,g=1/((i[y]-S)*O-(i[R]-S)*M),C=(O*(r[f]-A)-M*(r[h]-A))*g,w=(O*(r[f+1]-v)-M*(r[h+1]-v))*g,P=(O*(r[f+2]-N)-M*(r[h+2]-N))*g;c[E]+=C,c[E+1]+=w,c[E+2]+=P,c[f]+=C,c[f+1]+=w,c[f+2]+=P,c[h]+=C,c[h+1]+=w,c[h+2]+=P}var x=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var U=a.fromArray(n,E,he),b=a.fromArray(c,E,pe),F=a.dot(U,b);a.multiplyByScalar(U,F,de),a.normalize(a.subtract(b,de,b),b),L[E]=b.x,L[f]=b.y,L[h]=b.z,a.normalize(a.cross(U,b,b),b),x[E]=b.x,x[f]=b.y,x[h]=b.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e.attributes.binormal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:x}),e};var me=new n,_e=new a,Te=new a,ye=new a;te.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var o,s,l,E,f=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(f)&&(l=f.values),h&&(E=h.values);var p=c(o)?o.length:s.length,m=c(o)?3:2,_=p/m,T=_,y=c(s)&&c(o)?2:1;y+=c(l)||c(E)?1:0,T*=y;for(var R=new Float32Array(T),A=0,v=0;v<_;++v){c(s)&&(n.fromArray(s,2*v,me),R[A++]=e.compressTextureCoordinates(me));var N=3*v;c(o)&&c(l)&&c(E)?(a.fromArray(o,N,_e),a.fromArray(l,N,Te),a.fromArray(E,N,ye),e.octPack(_e,Te,ye,me),R[A++]=me.x,R[A++]=me.y):(c(o)&&(a.fromArray(o,N,_e),R[A++]=e.octEncodeFloat(_e)),c(l)&&(a.fromArray(l,N,_e),R[A++]=e.octEncodeFloat(_e)),c(E)&&(a.fromArray(E,N,_e),R[A++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:y,values:R}),c(o)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(E)&&delete t.attributes.binormal,t};var Re=new a,Ae=new a,ve=new a,Ne=new a,Se=new a,Ie={positions:new Array(7),indices:new Array(9)},Me=new a,Oe=new a,ge=new a,Ce=new a,we=new n,Pe=new n,xe=new n,Le=v.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,be=new a,Fe=new n,De=new n,Be=new a,ze=new a,Ge=new a,Ve=new a,qe=new a,Xe=new a,He=new i,We=5*y.EPSILON9,ke=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,v.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:ee(e);break;case p.TRIANGLES:Q(e);break;case p.LINES:J(e)}else V(t),t.primitiveType===N.TRIANGLES?Q(e):t.primitiveType===N.LINES&&J(e);return e},te}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},s.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h){"use strict";function d(e,t,n){var a,i=!n,o=e.length;if(!i&&o>1){var u=e[0].modelMatrix;for(a=1;a<o;++a)if(!f.equals(u,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)r(e[a].geometry)&&l.transformToWorldCoordinates(e[a]);else f.multiplyTransformation(t,e[0].modelMatrix,t)}function p(e,r){var n=e.attributes,a=n.position,i=a.values.length/a.componentsPerAttribute;n.batchId=new s({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=n.batchId.values,u=0;u<i;++u)o[u]=r}function m(e){for(var t=e.length,n=0;n<t;++n){var a=e[n];r(a.geometry)?p(a.geometry,n):r(a.westHemisphereGeometry)&&r(a.eastHemisphereGeometry)&&(p(a.westHemisphereGeometry,n),p(a.eastHemisphereGeometry,n))}}function _(n){var a,i,o,u=n.instances,s=n.projection,c=n.elementIndexUintSupported,E=n.scene3DOnly,f=n.vertexCacheOptimize,h=n.compressVertices,p=n.modelMatrix,_=u.length;for(a=0;a<_;++a)if(r(u[a].geometry)){o=u[a].geometry.primitiveType;break}if(d(u,p,E),!E)for(a=0;a<_;++a)r(u[a].geometry)&&l.splitLongitude(u[a]);if(m(u),f)for(a=0;a<_;++a){var T=u[a];r(T.geometry)?(l.reorderForPostVertexCache(T.geometry),l.reorderForPreVertexCache(T.geometry)):r(T.westHemisphereGeometry)&&r(T.eastHemisphereGeometry)&&(l.reorderForPostVertexCache(T.westHemisphereGeometry),l.reorderForPreVertexCache(T.westHemisphereGeometry),l.reorderForPostVertexCache(T.eastHemisphereGeometry),l.reorderForPreVertexCache(T.eastHemisphereGeometry))}var y=l.combineInstances(u);
for(_=y.length,a=0;a<_;++a){i=y[a];var R,A=i.attributes;if(E)for(R in A)A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE&&l.encodeAttribute(i,R,R+"3DHigh",R+"3DLow");else for(R in A)if(A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE){var v=R+"3D",N=R+"2D";l.projectTo2D(i,R,v,N,s),r(i.boundingSphere)&&"position"===R&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),l.encodeAttribute(i,v,v+"High",v+"Low"),l.encodeAttribute(i,N,N+"High",N+"Low")}h&&l.compressVertices(i)}if(!c){var S=[];for(_=y.length,a=0;a<_;++a)i=y[a],S=S.concat(l.fitToUnsignedShortIndices(i));y=S}return y}function T(e,t,n,a){var i,o,u,s=a.length-1;if(s>=0){var c=a[s];i=c.offset+c.count,u=c.index,o=n[u].indices.length}else i=0,u=0,o=n[u].indices.length;for(var l=e.length,E=0;E<l;++E){var f=e[E],h=f[t];if(r(h)){var d=h.indices.length;i+d>o&&(i=0,o=n[++u].indices.length),a.push({index:u,offset:i,count:d}),i+=d}}}function y(e,t){var r=[];return T(e,"geometry",t,r),T(e,"westHemisphereGeometry",t,r),T(e,"eastHemisphereGeometry",t,r),r}function R(e,t){var n=e.attributes;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];r(i)&&r(i.values)&&t.push(i.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;n<r;++n)R(e[n],t)}function v(t){for(var n=1,a=t.length,i=0;i<a;i++){var o=t[i];if(++n,r(o)){var u=o.attributes;n+=6+2*e.packedLength+(r(o.indices)?o.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&r(u[s])){var c=u[s];n+=5+c.values.length}}}return n}function N(e,t){var r=e.length,n=new Float64Array(1+16*r),a=0;n[a++]=r;for(var i=0;i<r;i++){var o=e[i];f.pack(o.modelMatrix,n,a),a+=f.packedLength}return t.push(n.buffer),n}function S(e){for(var t=e,r=new Array(t[0]),n=0,a=1;a<t.length;){var i=f.unpack(t,a);a+=f.packedLength,r[n++]={modelMatrix:i}}return r}function I(t){var n=t.length,a=1+(e.packedLength+1)*n,i=new Float32Array(a),o=0;i[o++]=n;for(var u=0;u<n;++u){var s=t[u];r(s)?(i[o++]=1,e.pack(t[u],i,o)):i[o++]=0,o+=e.packedLength}return i}function M(t){for(var r=new Array(t[0]),n=0,a=1;a<t.length;)1===t[a++]&&(r[n]=e.unpack(t,a)),++n,a+=e.packedLength;return r}if(!i.supportsTypedArrays())return{};var O={};return O.combineGeometry=function(t){var n,a,i=t.instances,o=i.length;o>0&&(n=_(t),n.length>0&&(a=l.createAttributeLocations(n[0])));var u;t.createPickOffsets&&n.length>0&&(u=y(i,n));for(var s=new Array(o),c=new Array(o),E=0;E<o;++E){var f=i[E],h=f.geometry;r(h)&&(s[E]=h.boundingSphere,c[E]=h.boundingSphereCV);var d=f.eastHemisphereGeometry,p=f.westHemisphereGeometry;r(d)&&r(p)&&(r(d.boundingSphere)&&r(p.boundingSphere)&&(s[E]=e.union(d.boundingSphere,p.boundingSphere)),r(d.boundingSphereCV)&&r(p.boundingSphereCV)&&(c[E]=e.union(d.boundingSphereCV,p.boundingSphereCV)))}return{geometries:n,modelMatrix:t.modelMatrix,attributeLocations:a,pickOffsets:u,boundingSpheres:s,boundingSpheresCV:c}},O.packCreateGeometryResults=function(t,n){var a=new Float64Array(v(t)),i=[],o={},u=t.length,s=0;a[s++]=u;for(var c=0;c<u;c++){var l=t[c],E=r(l);if(a[s++]=E?1:0,E){a[s++]=l.primitiveType,a[s++]=l.geometryType;var f=r(l.boundingSphere)?1:0;a[s++]=f,f&&e.pack(l.boundingSphere,a,s),s+=e.packedLength;var h=r(l.boundingSphereCV)?1:0;a[s++]=h,h&&e.pack(l.boundingSphereCV,a,s),s+=e.packedLength;var d=l.attributes,p=[];for(var m in d)d.hasOwnProperty(m)&&r(d[m])&&(p.push(m),r(o[m])||(o[m]=i.length,i.push(m)));a[s++]=p.length;for(var _=0;_<p.length;_++){var T=p[_],y=d[T];a[s++]=o[T],a[s++]=y.componentDatatype,a[s++]=y.componentsPerAttribute,a[s++]=y.normalize?1:0,a[s++]=y.values.length,a.set(y.values,s),s+=y.values.length}var R=r(l.indices)?l.indices.length:0;a[s++]=R,R>0&&(a.set(l.indices,s),s+=R)}}return n.push(a.buffer),{stringTable:i,packedData:a}},O.unpackCreateGeometryResults=function(r){for(var n,a=r.stringTable,i=r.packedData,o=new Array(i[0]),l=0,f=1;f<i.length;){var h=1===i[f++];if(h){var d,p,m=i[f++],_=i[f++],T=1===i[f++];T&&(d=e.unpack(i,f)),f+=e.packedLength;var y=1===i[f++];y&&(p=e.unpack(i,f)),f+=e.packedLength;var R,A,v,N=new c,S=i[f++];for(n=0;n<S;n++){var I=a[i[f++]],M=i[f++];v=i[f++];var O=0!==i[f++];R=i[f++],A=t.createTypedArray(M,R);for(var g=0;g<R;g++)A[g]=i[f++];N[I]=new s({componentDatatype:M,componentsPerAttribute:v,normalize:O,values:A})}var C;if(R=i[f++],R>0){var w=A.length/v;for(C=E.createTypedArray(w,R),n=0;n<R;n++)C[n]=i[f++]}o[l++]=new u({primitiveType:m,geometryType:_,boundingSphere:d,boundingSphereCV:p,indices:C,attributes:N})}else o[l++]=void 0}return o},O.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,a=0;a<n;a++)t.push(r[a].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:N(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},O.unpackCombineGeometryParameters=function(e){for(var t=S(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,u=0;u<n;u++)for(var s=O.unpackCreateGeometryResults(r[u]),c=s.length,l=0;l<c;l++){var E=s[l],d=t[i];d.geometry=E,++i}var p=a.clone(e.ellipsoid),m=e.isGeographic?new o(p):new h(p);return{instances:t,ellipsoid:p,projection:m,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:f.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},O.packCombineGeometryResults=function(e,t){r(e.geometries)&&A(e.geometries,t);var n=I(e.boundingSpheres),a=I(e.boundingSpheresCV);return t.push(n.buffer,a.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:n,boundingSpheresCV:a}},O.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:M(e.boundingSpheres),boundingSpheresCV:M(e.boundingSpheresCV)}},O}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,a=t.message;r=e(n)&&e(a)?n+": "+a:t.toString();var i=t.stack;return e(i)&&(r+="\n"+i),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return n}),define("Workers/createGeometry",["../Core/defined","../Scene/PrimitivePipeline","./createTaskProcessorWorker","require"],function(e,t,r,n){"use strict";function a(t){var r=o[t];return e(r)||("object"==typeof exports?o[r]=r=n("Workers/"+t):n(["./"+t],function(e){r=e,o[r]=e})),r}function i(r,n){for(var i=r.subTasks,o=i.length,u=new Array(o),s=0;s<o;s++){var c=i[s],l=c.geometry,E=c.moduleName;if(e(E)){var f=a(E);u[s]=f(l,c.offset)}else u[s]=l}return t.packCreateGeometryResults(u,n)}var o={};return r(i)})}();
|
'use strict';
var baseFlatten = require('./_baseFlatten'),
map = require('./map');
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity]
* The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDeep([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMapDeep(collection, iteratee) {
return baseFlatten(map(collection, iteratee), INFINITY);
}
module.exports = flatMapDeep;
//# sourceMappingURL=flatMapDeep-compiled.js.map
|
import { fromEvent, ReplaySubject } from 'rxjs';
import { delay, first, map, startWith, switchMap } from 'rxjs/operators';
export class ScrollService {
static scroll$ = new ReplaySubject(1);
static scroll(scroll) {
// console.log('ScrollService.scroll', scroll);
this.scroll$.next(scroll);
}
static init$(node) {
let previousY = window.pageYOffset;
const event = { direction: null, scroll: { x: 0, y: 0 }, speed: 0 };
return fromEvent(window, 'DOMContentLoaded').pipe(
// tap(_ => console.log('ScrollService.DOMContentLoaded')),
first(),
delay(1),
switchMap(_ => fromEvent(window, 'scroll')),
startWith(true),
// tap(_ => console.log('ScrollService.scroll')),
map(_ => {
/*
const body = document.querySelector('body');
let previousY = body.scrollTop;
body.addEventListener('scroll', () => {
const y = body.scrollTop;
const direction = y >= previousY ? 'down' : 'up';
if (Math.abs(y - previousY) > 90) {
// console.log('scroll', y, direction);
previousY = y;
event.direction = direction;
event.scroll.y = y;
ScrollService.scroll(event);
}
}, true);
*/
const y = window.pageYOffset;
const direction = y >= previousY ? 'down' : 'up';
// console.log(Math.abs(y - previousY) > 90);
// if (Math.abs(y - previousY) > 90) {
previousY = y;
event.direction = direction;
event.scroll.y = y;
ScrollService.scroll(event);
// }
return event;
}),
);
}
static scrollTo(target, options = { offset: -130 }) {
const body = document.querySelector('body');
const currentTop = body.scrollTop; // window.pageYOffset; // body.scrollTop;
const targetTop = currentTop + target.getBoundingClientRect().top + options.offset;
const distance = targetTop - currentTop;
const o = { pow: 0 };
gsap.set(body, {
'scroll-behavior': 'auto'
});
if (options.disableLerp) {
gsap.set(body, {
'scrollTop': currentTop + distance
});
gsap.set(body, {
'scroll-behavior': 'smooth'
});
} else {
gsap.to(o, {
duration: Math.abs(distance) / 2000,
pow: 1,
ease: Quad.easeOut,
overwrite: 'all',
onUpdate: () => {
gsap.set(body, {
'scrollTop': currentTop + distance * o.pow
});
// window.scrollTo(0, currentTop + distance * o.pow);
},
onComplete: () => {
gsap.set(body, {
'scroll-behavior': 'smooth'
});
}
});
}
// target.scrollIntoView();
}
static scrollToSelector(selector, options) {
const target = document.querySelector(selector);
if (target) {
ScrollService.scrollTo(target, options);
}
}
}
|
/* globals hqImport */
// This file depends on reports/js/filters/main.js
var HQAsyncReport = function (o) {
'use strict';
var self = this;
self.reportContent = $('#report-content');
self.filterForm = o.filterForm || $('#paramSelectorForm');
self.loadingIssueModal = $('#loadingReportIssueModal');
self.issueAttempts = 0;
self.hqLoading = null;
self.standardReport = o.standardReport;
self.filterRequest = null;
self.reportRequest = null;
self.loaderClass = '.report-loading';
self.humanReadableErrors = {
400: gettext("Please check your Internet connection!"),
404: gettext("Report Not Found."),
408: gettext("Request timed out when rendering this report. This might be an issue with our servers" +
" or with your Internet connection. We encourage you to report an issue to CommCare HQ Support so we" +
" can look into any possible issues."),
500: gettext("Problem Rendering Report. Our error monitoring tools have noticed this and we are working quickly to" +
" resolve this issue as soon as possible. We encourage you to contact CommCare HQ Support" +
" if this issue persists for more than a few minutes. We appreciate any additional information" +
" you can give us about this problem so we can fix it immediately."),
502: gettext("Bad Gateway. Please contact CommCare HQ Support."),
503: gettext("CommCare HQ is experiencing server difficulties. We're working quickly to resolve it." +
" Thank you for your patience. We are extremely sorry."),
504: gettext("Gateway Timeout. Please contact CommCare HQ Support."),
};
var loadFilters = function (data) {
self.filterRequest = null;
try {
$('#hq-report-filters').html(data.filters);
hqImport("reports/js/filters/main").init();
} catch (e) {
console.log(e);
}
$('#reportFiltersAccordion').removeClass('hide');
self.standardReport.resetFilterState();
};
self.init = function () {
self.reportContent.attr('style', 'position: relative;');
self.updateReport(true, window.location.search.substr(1), self.standardReport.filterSet);
// only update the report if there are actually filters set
if (!self.standardReport.needsFilters) {
self.standardReport.filterSubmitButton.addClass('disabled');
}
self.filterForm.submit(function () {
var params = hqImport('reports/js/reports.util').urlSerialize(this);
history.pushState(null,window.location.title, window.location.pathname + '?' + params);
self.updateFilters(params);
self.updateReport(false, params, true);
return false;
});
};
self.updateFilters = function (form_params) {
self.standardReport.saveDatespanToCookie();
self.filterRequest = $.ajax({
url: window.location.pathname.replace(self.standardReport.urlRoot,
self.standardReport.urlRoot + 'filters/') + "?" + form_params,
dataType: 'json',
success: loadFilters,
});
};
self.updateReport = function (initial_load, params, setFilters) {
var process_filters = "";
if (initial_load) {
process_filters = "hq_filters=true&";
if (self.standardReport.loadDatespanFromCookie()) {
process_filters = process_filters +
"&startdate=" + self.standardReport.datespan.startdate +
"&enddate=" + self.standardReport.datespan.enddate;
}
}
if (setFilters != undefined) {
process_filters = process_filters + "&filterSet=" + setFilters;
}
if (setFilters) {
$(self.standardReport.exportReportButton).removeClass('hide');
$(self.standardReport.emailReportButton).removeClass('hide');
$(self.standardReport.printReportButton).removeClass('hide');
}
self.reportRequest = $.ajax({
url: (window.location.pathname.replace(self.standardReport.urlRoot,
self.standardReport.urlRoot + 'async/')) + "?" + process_filters + "&" + params,
dataType: 'json',
success: function (data) {
self.reportRequest = null;
if (data.filters) {
loadFilters(data);
}
self.issueAttempts = 0;
self.loadingIssueModal.modal('hide');
self.hqLoading = $(self.loaderClass);
self.reportContent.html(data.report);
hqImport('reports/js/charts/main').init();
// clear lingering popovers
_.each($('body > .popover'), function (popover) {
$(popover).remove();
});
self.reportContent.append(self.hqLoading);
self.hqLoading.removeClass('hide');
// Assorted UI cleanup/initialization
$('.hq-report-time-notice').removeClass('hide');
if ($.timeago) {
$(".timeago").timeago();
}
$('.loading-backdrop').fadeOut();
self.hqLoading.fadeOut();
if (!initial_load || !self.standardReport.needsFilters) {
self.standardReport.filterSubmitButton
.button('reset');
setTimeout(function () {
// Bootstrap clears all btn styles except btn on reset
// This gets around it by waiting 10ms.
self.standardReport.filterSubmitButton
.removeClass('btn-primary')
.addClass('disabled')
.prop('disabled', true);
}, 10);
} else {
self.standardReport.filterSubmitButton
.button('reset')
.addClass('btn-primary')
.removeClass('disabled')
.prop('disabled', false);
}
},
error: function (data) {
var humanReadable;
self.reportRequest = null;
if (data.status != 0) {
// If it is a BadRequest allow for report to specify text
if (data.status === 400) {
humanReadable = data.responseText || self.humanReadableErrors[data.status];
} else {
humanReadable = self.humanReadableErrors[data.status];
}
self.loadingIssueModal.find('.report-error-status').html('<strong>' + data.status + '</strong> ' +
((humanReadable) ? humanReadable : ""));
if (self.issueAttempts > 0)
self.loadingIssueModal.find('.btn-primary').button('fail');
self.issueAttempts += 1;
self.loadingIssueModal.modal('show');
} else {
self.hqLoading = $(self.loaderClass);
self.hqLoading.find('h4').text("Loading Stopped");
self.hqLoading.find('.js-loading-spinner').attr('style', 'visibility: hidden;');
}
},
beforeSend: function () {
self.standardReport.filterSubmitButton.button('loading');
$('.loading-backdrop').fadeIn();
if (self.hqLoading) {
self.hqLoading.attr('style', 'position: absolute; top: 30px; left: 40%;');
self.hqLoading.fadeIn();
}
},
});
};
self.loadingIssueModal.on('click', '.try-again', function () {
self.loadingIssueModal.find('.btn-primary').button('loading');
self.updateReport(true, window.location.search.substr(1));
});
self.loadingIssueModal.on('hide hide.bs.modal', function () {
if (self.issueAttempts > 0) {
self.hqLoading = $(self.loaderClass);
self.hqLoading.find('.js-loading-spinner').addClass('hide');
self.hqLoading.find('h4').text(gettext('We were unsuccessful loading the report:'))
.attr('style', 'margin-bottom: 10px;');
}
});
};
|
/*global QUnit*/
sap.ui.define([
"sap/ui/core/Core",
"sap/ui/thirdparty/jquery",
"qunit/DynamicPageUtil",
"sap/f/DynamicPage"
],
function (
Core,
$,
DynamicPageUtil,
DynamicPage
) {
"use strict";
var INITIAL_SCROLL_POSITION = 0,
BIG_SCROLL_POSITION = 1000,
oLibraryFactory = DynamicPageUtil.oFactory,
oUtil = DynamicPageUtil.oUtil;
function scrollingStatesOfStickyContent(assert, oDynamicPage) {
var oDynamicPageContent = oDynamicPage.getContent(),
iIntermediateHeightInHeader = oDynamicPage._getHeaderHeight() / 2;
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(iIntermediateHeightInHeader);
oDynamicPage._adjustStickyContent();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(BIG_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(iIntermediateHeightInHeader);
oDynamicPage._adjustStickyContent();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(INITIAL_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.destroy();
}
function statesOfStickyContentWhileScrollingWhenPinUnpin(assert, oDynamicPage) {
var oDynamicPageContent = oDynamicPage.getContent(),
iIntermediateHeightInHeader = oDynamicPage._getHeaderHeight() / 2;
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._pin();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._unPin();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(iIntermediateHeightInHeader);
oDynamicPage._adjustStickyContent();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(BIG_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage.setHeaderExpanded(true);
oDynamicPage._pin();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(iIntermediateHeightInHeader);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(INITIAL_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(iIntermediateHeightInHeader);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(BIG_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._unPin();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(iIntermediateHeightInHeader);
oDynamicPage._adjustStickyContent();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(INITIAL_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.destroy();
}
function headerSnapExpandStateWhileScrolling(assert, oDynamicPage) {
var oDynamicPageContent = oDynamicPage.getContent();
oDynamicPage.setHeaderExpanded(true);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.setHeaderExpanded(false);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.setHeaderExpanded(true);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(BIG_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage.setHeaderExpanded(true);
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage.setHeaderExpanded(false);
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage.setHeaderExpanded(true);
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage.destroy();
}
function headerDynamicVisibilityChange(assert, oDynamicPage) {
var oDynamicPageContent = oDynamicPage.getContent();
oDynamicPage.getHeader().setVisible(true);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.getHeader().setVisible(false);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.getHeader().setVisible(true);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(BIG_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage.getHeader().setVisible(true);
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage.getHeader().setVisible(false);
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage.getHeader().setVisible(true);
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage.destroy();
}
QUnit.module("Association value");
QUnit.test("change the value", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/),
sWrongStickySubheaderSource = "sWrongStickySubheaderSource",
sStickyContentProviderId;
oUtil.renderObject(oDynamicPage);
sStickyContentProviderId = oDynamicPage.getContent().getId();
assert.notEqual(oDynamicPage._oStickySubheader, null, "There was setted sticky subheader");
assert.equal(oDynamicPage.getStickySubheaderProvider(), sStickyContentProviderId, "Sticky subheader provider is the control in content aggregation");
oDynamicPage.setStickySubheaderProvider(null);
Core.applyChanges();
assert.equal(oDynamicPage._oStickySubheader, null, "There was not setted sticky subheader");
assert.equal(oDynamicPage.getStickySubheaderProvider(), null, "Sticky content is in sticky area");
oDynamicPage.setStickySubheaderProvider(sWrongStickySubheaderSource);
Core.applyChanges();
assert.equal(oDynamicPage._oStickySubheader, null, "There was not setted sticky subheader");
assert.equal(oDynamicPage.getStickySubheaderProvider(), sWrongStickySubheaderSource, "Sticky content is in sticky area");
oDynamicPage.setStickySubheaderProvider(sStickyContentProviderId);
Core.applyChanges();
assert.notEqual(oDynamicPage._oStickySubheader, null, "There was setted sticky subheader");
assert.equal(oDynamicPage.getStickySubheaderProvider(), sStickyContentProviderId, "Sticky content is in sticky area");
oDynamicPage.destroy();
});
QUnit.module("DynamicPage sticky content position while scrolling");
QUnit.test("DynamicPage which has header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oUtil.renderObject(oDynamicPage);
scrollingStatesOfStickyContent(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has title and is without header", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, false /*has header*/, false /*header visible*/, true /*has title*/);
oUtil.renderObject(oDynamicPage);
scrollingStatesOfStickyContent(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has title and is without header", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, false /*has header*/, false /*header visible*/, false /*has title*/);
oUtil.renderObject(oDynamicPage);
scrollingStatesOfStickyContent(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has header and is without title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, false /*has title*/);
oUtil.renderObject(oDynamicPage);
scrollingStatesOfStickyContent(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has header without content and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oDynamicPage.getHeader().destroyContent();
oUtil.renderObject(oDynamicPage);
scrollingStatesOfStickyContent(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has header and without title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, false /*has title*/);
oUtil.renderObject(oDynamicPage);
scrollingStatesOfStickyContent(assert, oDynamicPage);
});
QUnit.module("DynamicPage sticky content position while scrolling and pin/unpin");
QUnit.test("DynamicPage which has header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oUtil.renderObject(oDynamicPage);
statesOfStickyContentWhileScrollingWhenPinUnpin(assert, oDynamicPage);
});
QUnit.module("DynamicPage sticky content position while snap/expand header");
QUnit.test("DynamicPage which has header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oUtil.renderObject(oDynamicPage);
headerSnapExpandStateWhileScrolling(assert, oDynamicPage);
});
QUnit.module("DynamicPage sticky content position while scrolling and changing the visibility of header");
QUnit.test("DynamicPage which has header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has header and without title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, false /*has title*/);
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has not visible header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, false /*header visible*/, true /*has title*/);
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has not visible header and without title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, false /*header visible*/, false /*has title*/);
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.module("DynamicPage sticky content position while scrolling and changing the visibility of header without content");
QUnit.test("DynamicPage which has header without content and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oDynamicPage.getHeader().destroyContent();
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has header without content and without title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, false /*has title*/);
oDynamicPage.getHeader().destroyContent();
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.module("DynamicPage sticky content position while scrolling and rerendering iconTabBar");
QUnit.test("DynamicPage which has header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/),
oIconTabBar = oDynamicPage.getContent();
assert.expect(2);
oUtil.renderObject(oDynamicPage);
oDynamicPage._setScrollPosition(BIG_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
// Verify init state
assert.ok(oIconTabBar._getStickySubheaderSticked(), "Sticky content is in sticky area");
//Act: rerender
oIconTabBar.rerender();
// Check
assert.ok(oIconTabBar._getStickySubheaderSticked(), "Sticky content is still in sticky area");
// Cleanup
oDynamicPage.destroy();
});
QUnit.module("DynamicPage with preservedHeaderStateOnScroll sticky content position while scrolling");
QUnit.test("DynamicPage which has header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(true /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/),
oDynamicPageContent = oDynamicPage.getContent(),
iIntermediateHeightInHeader;
oUtil.renderObject(oDynamicPage);
iIntermediateHeightInHeader = oDynamicPage._getHeaderHeight() / 2;
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(iIntermediateHeightInHeader);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(BIG_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(iIntermediateHeightInHeader);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(INITIAL_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
oDynamicPage.setHeaderExpanded(false);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(BIG_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(INITIAL_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage._setScrollPosition(BIG_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
oDynamicPage.setHeaderExpanded(true);
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(iIntermediateHeightInHeader);
oDynamicPage._adjustStickyContent();
assert.ok(oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in sticky area");
oDynamicPage._setScrollPosition(INITIAL_SCROLL_POSITION);
oDynamicPage._adjustStickyContent();
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.destroy();
});
QUnit.module("DynamicPage with preservedHeaderStateOnScroll sticky content while snap/expand");
QUnit.test("DynamicPage which has header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(true /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/),
oDynamicPageContent = oDynamicPage.getContent();
oUtil.renderObject(oDynamicPage);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.setHeaderExpanded(false);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.setHeaderExpanded(true);
assert.ok(!oDynamicPageContent._getStickySubheaderSticked(), "Sticky content is in the DOM of his provider");
oDynamicPage.destroy();
});
QUnit.module("DynamicPage with preservedHeaderStateOnScroll sticky content position while scrolling and snap/expand header");
QUnit.test("DynamicPage which has header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(true /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oUtil.renderObject(oDynamicPage);
headerSnapExpandStateWhileScrolling(assert, oDynamicPage);
});
QUnit.module("DynamicPage with preservedHeaderStateOnScroll sticky content position while scrolling and changing the visibility of header");
QUnit.test("DynamicPage which has header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(true /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has header and without title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(true /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, false /*has title*/);
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has not visible header and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(true /*preserveHeaderStateOnScroll*/, true /*has header*/, false /*header visible*/, true /*has title*/);
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has not visible header and without title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(true /*preserveHeaderStateOnScroll*/, true /*has header*/, false /*header visible*/, false /*has title*/);
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.module("DynamicPage with preservedHeaderStateOnScroll sticky content position while scrolling and changing the visibility of header without content");
QUnit.test("DynamicPage which has header witout content and title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(true /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oDynamicPage.getHeader().destroyContent();
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.test("DynamicPage which has header without content and without title", function (assert) {
var oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(true /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, false /*has title*/);
oDynamicPage.getHeader().destroyContent();
oUtil.renderObject(oDynamicPage);
headerDynamicVisibilityChange(assert, oDynamicPage);
});
QUnit.module("DynamicPage - Conditional CSS applied when StickySubheaderProvider is present", {
beforeEach: function () {
// Arrange
this.oDynamicPage = oLibraryFactory.getDynamicPageWithStickySubheader(false /*preserveHeaderStateOnScroll*/, true /*has header*/, true /*header visible*/, true /*has title*/);
oUtil.renderObject(this.oDynamicPage);
},
afterEach: function () {
// Clean up
this.oDynamicPage.destroy();
this.oDynamicPage = null;
}
});
QUnit.test("DynamicPage - " + DynamicPage.NAVIGATION_CLASS_NAME + " CSS class", function(assert) {
// Assert
assert.ok(this.oDynamicPage.hasStyleClass(DynamicPage.NAVIGATION_CLASS_NAME),
"Dynamic Page has the " + DynamicPage.NAVIGATION_CLASS_NAME + ", " +
"when we have StickySubheaderProvider.");
// Act - Destroy the StickySubheaderProvider
Core.byId(this.oDynamicPage.getStickySubheaderProvider()).destroy();
oUtil.renderObject(this.oDynamicPage);
// Assert
assert.notOk(this.oDynamicPage.hasStyleClass(DynamicPage.NAVIGATION_CLASS_NAME),
"Dynamic Page doesn't have the " + DynamicPage.NAVIGATION_CLASS_NAME + ", " +
"when we don't have StickySubheaderProvider.");
});
});
|
/**
* Created by heavenduke on 17-4-28.
*/
var express = require('express');
var repository_controller = require('../../controllers').repositories;
var star_router = require('./star');
var astepback = require('../../middlewares').astepback;
var router = express.Router();
router.get('/:owner/:name', astepback, repository_controller.show);
router.use(star_router);
module.exports = router;
|
"use strict";
describe("Postprocessors", () => {
require("./3.1-tty.js");
});
|
import styled from "styled-components"
import media from "styled-media-query"
export const PaginationWrapper = styled.section`
align-items: center;
border-top: 1px solid var(--borders);
color: var(--texts);
display: flex;
padding: 1.5rem 3rem;
justify-content: space-between;
${media.lessThan("large")`
font-size: .8rem;
padding: 1rem;
`}
a {
color: var(--texts);
text-decoration: none;
transition: color 0.5s;
&:hover {
color: var(--highlight);
}
}
`
|
import React from 'react';
import Button from 'material-ui/Button';
import { compose, withHandlers } from 'recompose';
import { graphql } from 'react-apollo';
import UserQuery from '../UserQuery';
import START_DRAFT_MUTATION from '../../graphql/StartDraftMutation.graphql';
const DraftStartButton = ({ league, startDraft }) => (
<UserQuery>
{({ user }) =>
user && user.id === league.creator.id && league.status === 'IDLE' ? (
<Button
size="large"
variant="raised"
color="primary"
onClick={startDraft}
>
Start Draft
</Button>
) : null
}
</UserQuery>
);
const enhanced = compose(
graphql(START_DRAFT_MUTATION, { name: 'startDraftMutation' }),
withHandlers({
startDraft: ({ league, startDraftMutation }) => () =>
startDraftMutation({ variables: { leagueId: league.id } }),
})
)(DraftStartButton);
export default enhanced;
|
import * as React from 'react';
import { StyledIconBase } from '@styled-icons/styled-icon';
export const Skype = /*#__PURE__*/React.forwardRef((props, ref) => {
const attrs = {
"fill": "currentColor",
"xmlns": "http://www.w3.org/2000/svg"
};
return /*#__PURE__*/React.createElement(StyledIconBase, Object.assign({
iconAttrs: attrs,
iconVerticalAlign: "middle",
iconViewBox: "0 0 20 20"
}, props, {
ref: ref
}), /*#__PURE__*/React.createElement("path", {
d: "M18.671 12.037a9.347 9.347 0 00.203-1.938c0-4.986-3.93-9.029-8.777-9.029-.511 0-1.012.047-1.5.133A4.962 4.962 0 005.89.4C3.079.4.8 2.744.8 5.637c0 .965.256 1.871.699 2.648a9.348 9.348 0 00-.178 1.815c0 4.986 3.93 9.029 8.775 9.029.551 0 1.087-.051 1.607-.15a4.956 4.956 0 002.406.621c2.811 0 5.09-2.344 5.09-5.236a5.328 5.328 0 00-.528-2.327zm-4.072 2.379c-.406.59-1.006 1.059-1.783 1.391-.769.33-1.692.496-2.742.496-1.26 0-2.317-.227-3.143-.678a4.161 4.161 0 01-1.445-1.318c-.372-.555-.561-1.104-.561-1.633 0-.33.123-.617.365-.852.24-.232.549-.352.916-.352.301 0 .562.094.773.277.202.176.375.438.514.773.156.367.326.676.505.92.172.234.42.432.735.586.318.154.748.232 1.275.232.725 0 1.32-.158 1.768-.473.438-.309.65-.676.65-1.127 0-.357-.111-.637-.34-.857a2.409 2.409 0 00-.936-.531 18.034 18.034 0 00-1.611-.41c-.91-.201-1.683-.439-2.299-.707-.63-.275-1.137-.658-1.508-1.137-.375-.483-.567-1.092-.567-1.807 0-.682.2-1.297.596-1.828.393-.525.965-.935 1.703-1.217.728-.277 1.596-.418 2.576-.418.783 0 1.473.094 2.047.277.578.186 1.066.436 1.449.744.387.311.674.643.854.986.182.35.275.695.275 1.031 0 .322-.121.615-.361.871-.24.258-.543.387-.9.387-.324 0-.58-.082-.756-.242-.164-.148-.336-.383-.524-.717-.219-.428-.484-.766-.788-1.002-.295-.232-.788-.35-1.466-.35-.629 0-1.141.131-1.519.387-.368.249-.545.532-.545.866 0 .207.058.379.176.525.125.158.301.295.523.41.23.12.467.214.705.282.244.07.654.172 1.215.307.711.156 1.363.332 1.939.521a6.22 6.22 0 011.502.705c.42.283.754.645.989 1.076.237.434.357.969.357 1.59a3.49 3.49 0 01-.613 2.016z"
}));
});
Skype.displayName = 'Skype';
export const SkypeDimensions = {
height: 20,
width: 20
};
|
// @flow
import 'url-search-params-polyfill';
import createHistory from 'history/createMemoryHistory';
import {extendObservable, observable, isObservable} from 'mobx';
import Router from '../Router';
import routeRegistry from '../registries/RouteRegistry';
jest.mock('../registries/RouteRegistry', () => {
const getAllMock = jest.fn();
return {
getAll: getAllMock,
get: jest.fn((key) => getAllMock()[key]),
};
});
test('Navigate to route using state', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid'});
expect(isObservable(router.route)).toBe(true);
expect(router.route.view).toBe('form');
expect(router.route.options.type).toBe('page');
expect(router.attributes.uuid).toBe('some-uuid');
expect(history.location.pathname).toBe('/pages/some-uuid');
expect(history.entries.some((entry) => entry.pathname === '/')).toEqual(true);
expect(history.entries.some((entry) => entry.pathname === '/pages/some-uuid')).toEqual(true);
});
test('Redirect to route using state', () => {
routeRegistry.getAll.mockReturnValue({
test: {
name: 'test',
view: 'test',
path: '/test',
attributeDefaults: {},
},
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('test', {uuid: 'some-uuid'});
router.redirect('page', {uuid: 'some-uuid'});
expect(isObservable(router.route)).toBe(true);
expect(router.route.view).toBe('form');
expect(router.route.options.type).toBe('page');
expect(router.attributes.uuid).toBe('some-uuid');
expect(history.location.pathname).toBe('/pages/some-uuid');
expect(history.entries.some((entry) => entry.pathname === '/test')).toEqual(false);
expect(history.entries.some((entry) => entry.pathname === '/pages/some-uuid')).toEqual(true);
});
test('Navigate to route with search parameters using state', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid', page: 1, sort: 'title'});
expect(isObservable(router.route)).toBe(true);
expect(router.route.view).toBe('form');
expect(router.route.options.type).toBe('page');
expect(router.attributes.uuid).toBe('some-uuid');
expect(router.attributes.page).toBe(1);
expect(router.attributes.sort).toBe('title');
expect(history.location.pathname).toBe('/pages/some-uuid');
expect(history.location.search).toBe('?page=1&sort=title');
});
test('Navigate to route without parameters using state', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid'});
expect(router.route.name).toBe('page');
});
test('Navigate to route with default attribute', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list/:locale',
attributeDefaults: {
locale: 'en',
},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('list');
expect(router.attributes.locale).toBe('en');
expect(history.location.pathname).toBe('/list/en');
});
test('Navigate to route without default attribute when observable is changed', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list/:locale',
attributeDefaults: {
locale: 'en',
},
},
});
const locale = observable.box();
const history = createHistory();
const router = new Router(history);
router.bind('locale', locale);
router.handleNavigation('list', {});
expect(router.attributes.locale).toBe('en');
expect(history.location.pathname).toBe('/list/en');
locale.set('de');
expect(router.attributes.locale).toBe('de');
expect(history.location.pathname).toBe('/list/de');
});
test('Apply updateAttributesHooks before applying default attributes but after passed attributes', () => {
routeRegistry.getAll.mockReturnValue({
webspace_overview: {
name: 'webspace_overview',
view: 'webspace_overview',
path: '/webspace/:webspace/:locale',
attributeDefaults: {
webspace: 'webspace1',
sortOrder: 'desc',
},
},
});
const history = createHistory();
const router = new Router(history);
router.addUpdateAttributesHook((route) => {
if (route.view !== 'webspace_overview') {
return {};
}
return {
webspace: 'webspace2',
};
});
router.addUpdateAttributesHook(() => {
return {
value: 'test',
};
});
router.handleNavigation('webspace_overview', {locale: 'en'});
expect(router.attributes.webspace).toEqual('webspace2');
expect(router.attributes.locale).toEqual('en');
expect(router.attributes.sortOrder).toEqual('desc');
expect(router.attributes.value).toEqual('test');
});
test('Apply attribute defaults if value of passed attribute is undefined', () => {
routeRegistry.getAll.mockReturnValue({
webspace_overview: {
name: 'webspace_overview',
view: 'webspace_overview',
path: '/webspace/:webspace/:locale',
attributeDefaults: {
webspace: 'webspace1',
sortOrder: 'desc',
},
},
});
const history = createHistory();
const router = new Router(history);
router.handleNavigation('webspace_overview', {locale: 'en', webspace: undefined});
expect(router.attributes.webspace).toEqual('webspace1');
expect(router.attributes.locale).toEqual('en');
});
test('Update observable attribute on route change', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list/:locale',
attributeDefaults: {
locale: 'en',
},
},
});
const locale = observable.box();
const history = createHistory();
const router = new Router(history);
router.bind('locale', locale);
router.navigate('list');
expect(router.attributes.locale).toBe('en');
expect(history.location.pathname).toBe('/list/en');
history.push('/list/de');
expect(router.attributes.locale).toBe('de');
expect(history.location.pathname).toBe('/list/de');
});
test('Update boolean observable attribute on route change', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {
exclude: true,
},
},
});
const exclude = observable.box();
const history = createHistory();
const router = new Router(history);
router.bind('exclude', exclude);
router.navigate('list');
expect(router.attributes.exclude).toBe(true);
history.push('/list?exclude=false');
expect(router.attributes.exclude).toBe(false);
});
test('Navigate to route using URL', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid/:test',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
history.push('/pages/some-uuid/value');
expect(router.route.view).toBe('form');
expect(router.route.options.type).toBe('page');
expect(router.attributes.uuid).toBe('some-uuid');
expect(router.attributes.test).toBe('value');
expect(history.location.pathname).toBe('/pages/some-uuid/value');
});
test('Navigate to route using URL with search parameters', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid/:test',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
history.push('/pages/some-uuid/value?page=1&sort=date');
expect(router.route.view).toBe('form');
expect(router.route.options.type).toBe('page');
expect(router.attributes.uuid).toBe('some-uuid');
expect(router.attributes.test).toBe('value');
expect(router.attributes.page).toBe(1);
expect(router.attributes.sort).toBe('date');
expect(history.location.pathname).toBe('/pages/some-uuid/value');
expect(history.location.search).toBe('?page=1&sort=date');
});
test('Navigate to route changing only parameters', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid'});
expect(history.location.pathname).toBe('/pages/some-uuid');
router.navigate('page', {uuid: 'some-other-uuid'});
expect(history.location.pathname).toBe('/pages/some-other-uuid');
});
test('Navigate to route by adding parameters', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid/:value?',
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid'});
expect(history.location.pathname).toBe('/pages/some-uuid');
router.navigate('page', {uuid: 'some-uuid', value: 'test'});
expect(history.location.pathname).toBe('/pages/some-uuid/test');
});
test('Navigate to route by removing parameters', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid/:value?',
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid', value: 'test'});
expect(history.location.pathname).toBe('/pages/some-uuid/test');
router.navigate('page', {uuid: 'some-uuid'});
expect(history.location.pathname).toBe('/pages/some-uuid');
});
test('Navigate to route changing only search parameters', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid', sort: 'date'});
expect(history.location.pathname).toBe('/pages/some-uuid');
expect(history.location.search).toBe('?sort=date');
router.navigate('page', {uuid: 'some-uuid', sort: 'title'});
expect(history.location.pathname).toBe('/pages/some-uuid');
expect(history.location.search).toBe('?sort=title');
});
test('Navigate to route by adding search parameters', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid', sort: 'date'});
expect(history.location.pathname).toBe('/pages/some-uuid');
expect(history.location.search).toBe('?sort=date');
router.navigate('page', {uuid: 'some-uuid', sort: 'date', order: 'asc'});
expect(history.location.pathname).toBe('/pages/some-uuid');
expect(history.location.search).toBe('?sort=date&order=asc');
});
test('Navigate to route by removing search parameters', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid', sort: 'date', order: 'asc'});
expect(history.location.pathname).toBe('/pages/some-uuid');
expect(history.location.search).toBe('?sort=date&order=asc');
router.navigate('page', {uuid: 'some-uuid', sort: 'date'});
expect(history.location.pathname).toBe('/pages/some-uuid');
expect(history.location.search).toBe('?sort=date');
});
test('Navigate to route and let history react', () => {
routeRegistry.getAll.mockReturnValue({
home: {
name: 'home',
view: 'home',
path: '/',
attributeDefaults: {},
},
page: {
name: 'page',
view: 'page',
path: '/page',
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page');
expect(history.location.pathname).toBe('/page');
});
test('Do not navigate if all parameters are equal', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid'});
const expectedParameters = router.attributes;
expect(router.attributes).toBe(expectedParameters);
router.navigate('page', {uuid: 'some-uuid'});
expect(router.attributes).toBe(expectedParameters);
});
test('Use current route from URL', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'page',
path: '/page',
attributeDefaults: {},
},
});
const history = createHistory();
history.push('/page');
const router = new Router(history);
expect(router.route.name).toBe('page');
});
test('Binding should update passed observable', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const value = observable.box();
const history = createHistory();
const router = new Router(history);
router.bind('page', value);
router.handleNavigation('list', {page: 2});
expect(value.get()).toBe(2);
});
test('Binding should update state in router', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const page = observable.box(1);
const history = createHistory();
const router = new Router(history);
router.navigate('list', {page: 1});
router.bind('page', page);
expect(router.attributes.page).toBe(1);
page.set(2);
expect(router.attributes.page).toBe(2);
});
test('Binding should set default attribute', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'page',
path: '/page/:locale',
attributeDefaults: {},
},
});
const locale = observable.box();
const history = createHistory();
const router = new Router(history);
router.bind('locale', locale, 'en');
router.handleNavigation('page', {});
expect(router.attributes.locale).toBe('en');
expect(router.url).toBe('/page/en');
});
test('Binding should update URL with fixed attributes', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'page',
path: '/page/:uuid',
attributeDefaults: {},
},
});
const uuid = observable.box(1);
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 1, locale: 'de'});
router.bind('uuid', uuid);
expect(router.attributes.uuid).toBe(1);
expect(router.url).toBe('/page/1?locale=de');
uuid.set(2);
expect(router.attributes.uuid).toBe(2);
});
test('Binding should update URL with fixed attributes as string if not a number', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'page',
path: '/page/:uuid',
attributeDefaults: {},
},
});
const uuid = observable.box('old-uuid');
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'some-uuid', locale: 'de'});
router.bind('uuid', uuid);
expect(router.attributes.uuid).toBe('some-uuid');
expect(router.url).toBe('/page/some-uuid?locale=de');
uuid.set('another-uuid');
expect(router.attributes.uuid).toBe('another-uuid');
});
test('Binding should update state in router with other default bindings', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const page = observable.box();
const locale = observable.box('en');
const history = createHistory();
const router = new Router(history);
router.bind('page', page, '1');
router.bind('locale', locale);
router.handleNavigation('list', {});
locale.set('de');
expect(history.location.search).toBe('?locale=de');
expect(router.attributes.locale).toBe('de');
});
test('Do not add parameter to URL if undefined', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const value = observable.box();
const history = createHistory();
const router = new Router(history);
router.bind('page', value);
history.push('/list');
expect(history.location.search).toBe('');
});
test('Set state to undefined if parameter is removed from URL', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const value = observable.box(5);
const history = createHistory();
const router = new Router(history);
router.bind('page', value);
history.push('/list');
expect(value.get()).toBe(undefined);
});
test('Bound query should update state to default value if removed from URL', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const value = observable.box(5);
const history = createHistory();
const router = new Router(history);
router.bind('page', value, '1');
history.push('/list');
expect(value.get()).toBe('1');
});
test('Bound query should omit URL parameter if set to default value', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const value = observable.box('5');
const history = createHistory();
const router = new Router(history);
router.navigate('list');
router.bind('page', value, '1');
value.set('1');
expect(history.location.search).toBe('');
});
test('Bound query should initially not be set to undefined in URL', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const value = observable.box();
const history = createHistory();
history.push('/list');
const router = new Router(history);
router.bind('page', value, '1');
expect(history.location.search).toBe('');
});
test('Binding should be set to initial passed value from URL', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const value = observable.box();
const history = createHistory();
history.push('/list?page=2');
const router = new Router(history);
router.bind('page', value, 1);
expect(value.get()).toBe(2);
expect(history.location.search).toBe('?page=2');
});
test('Binding should not be set to initial passed value from URL if values already match', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const value = {
get: jest.fn().mockReturnValue(2),
intercept: jest.fn(),
observe: jest.fn(),
set: jest.fn(),
};
const history = createHistory();
history.push('/list?page=2');
const router = new Router(history);
router.bind('page', value, 1);
expect(value.set).not.toBeCalled();
});
test('Binding should not be updated if only data type changes', () => {
routeRegistry.getAll.mockReturnValue({
list: {
name: 'list',
view: 'list',
path: '/list',
attributeDefaults: {},
},
});
const page = jest.fn(() => ({
get: jest.fn(),
set: jest.fn(),
observe: jest.fn(),
intercept: jest.fn(),
}))();
const history = createHistory();
const router = new Router(history);
router.bind('page', page);
router.navigate('list', {page: 2});
page.get.mockReturnValue(2);
router.navigate('list', {page: '2'});
expect(page.set.mock.calls).not.toContainEqual(['2']);
});
test('Navigate to child route using state', () => {
const formRoute = extendObservable({}, {
name: 'sulu_snippet.form',
view: 'sulu_admin.tab',
path: '/snippets/:uuid',
options: {
resourceKey: 'snippet',
},
attributeDefaults: {},
children: [],
});
const detailRoute = extendObservable({}, {
name: 'sulu_snippet.form.detail',
parent: formRoute,
view: 'sulu_admin.form',
path: '/snippets/:uuid/detail',
options: {
tabTitle: 'Detail',
},
attributeDefaults: {},
});
const taxonomyRoute = extendObservable({}, {
name: 'sulu_snippet.form.taxonomy',
parent: formRoute,
view: 'sulu_admin.form',
path: '/snippets/:uuid/taxonomy',
options: {
tabTitle: 'Taxonomies',
},
attributeDefaults: {},
});
formRoute.children = [detailRoute, taxonomyRoute];
routeRegistry.getAll.mockReturnValue({
'sulu_snippet.form': formRoute,
'sulu_snippet.form.detail': detailRoute,
'sulu_snippet.form.taxonomy': taxonomyRoute,
});
const history = createHistory();
const router = new Router(history);
router.navigate('sulu_snippet.form.detail', {uuid: 'some-uuid'});
expect(router.route.view).toBe('sulu_admin.form');
expect(router.route.options.tabTitle).toBe('Detail');
expect(router.attributes.uuid).toBe('some-uuid');
expect(history.location.pathname).toBe('/snippets/some-uuid/detail');
const parent = router.route.parent;
if (!parent) {
throw new Error('Parent must be set!');
}
expect(parent.view).toBe('sulu_admin.tab');
expect(parent.options.resourceKey).toBe('snippet');
expect(parent.children).toHaveLength(2);
expect(parent.children[0]).toBe(router.route);
expect(parent.children[1].options.tabTitle).toBe('Taxonomies');
});
test('Navigate to child route using URL', () => {
const formRoute = extendObservable({}, {
name: 'sulu_snippet.form',
view: 'sulu_admin.tab',
path: '/snippets/:uuid',
options: {
resourceKey: 'snippet',
},
attributeDefaults: {},
children: [],
});
const detailRoute = extendObservable({}, {
name: 'sulu_snippet.form.detail',
parent: formRoute,
view: 'sulu_admin.form',
path: '/snippets/:uuid/detail',
options: {
tabTitle: 'Detail',
},
attributeDefaults: {},
});
const taxonomyRoute = extendObservable({}, {
name: 'sulu_snippet.form.taxonomy',
parent: formRoute,
view: 'sulu_admin.form',
path: '/snippets/:uuid/taxonomy',
options: {
tabTitle: 'Taxonomies',
},
attributeDefaults: {},
});
formRoute.children = [detailRoute, taxonomyRoute];
routeRegistry.getAll.mockReturnValue({
'sulu_snippet.form': formRoute,
'sulu_snippet.form.detail': detailRoute,
'sulu_snippet.form.taxonomy': taxonomyRoute,
});
const history = createHistory();
const router = new Router(history);
history.push('/snippets/some-uuid/detail');
expect(router.route.view).toBe('sulu_admin.form');
expect(router.route.options.tabTitle).toBe('Detail');
expect(router.attributes.uuid).toBe('some-uuid');
expect(history.location.pathname).toBe('/snippets/some-uuid/detail');
const parent = router.route.parent;
if (!parent) {
throw new Error('Parent must be set!');
}
expect(parent.view).toBe('sulu_admin.tab');
expect(parent.options.resourceKey).toBe('snippet');
expect(parent.children).toHaveLength(2);
expect(parent.children[0]).toBe(router.route);
expect(parent.children[1].options.tabTitle).toBe('Taxonomies');
});
test('Navigating should store the old route information', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
snippet: {
name: 'snippet',
view: 'form',
path: '/snippets/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'page-uuid', locale: 'en'});
router.navigate('snippet', {uuid: 'snippet-uuid', locale: 'de'});
router.navigate('page', {uuid: 'other-page-uuid', locale: 'de'});
router.navigate('page', {uuid: 'another-page-uuid', locale: 'de'});
expect(router.attributesHistory['page']).toEqual([
{
uuid: 'page-uuid',
locale: 'en',
},
{
uuid: 'other-page-uuid',
locale: 'de',
},
]);
expect(router.attributesHistory['snippet']).toEqual([
{
uuid: 'snippet-uuid',
locale: 'de',
},
]);
});
test('Navigating to route with defaults should store the old route information once', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:locale/:uuid',
options: {
type: 'page',
},
attributeDefaults: {
locale: 'en',
},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'page-uuid'});
router.navigate('page', {uuid: 'page-uuid', locale: 'de'});
expect(router.attributesHistory['page']).toEqual([
{
uuid: 'page-uuid',
locale: 'en',
},
]);
});
test('Restore should navigate to the given route with the stored data', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
snippet: {
name: 'snippet',
view: 'form',
path: '/snippets/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('snippet', {uuid: 'snippet-uuid', locale: 'de'});
router.navigate('page', {uuid: 'another-page-uuid', locale: 'de'});
expect(router.route.name).toEqual('page');
router.restore('snippet');
expect(router.route.name).toEqual('snippet');
expect(router.attributes).toEqual({uuid: 'snippet-uuid', locale: 'de'});
});
test('Restore should navigate to the given route with passed data being merged', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
snippet: {
name: 'snippet',
view: 'form',
path: '/snippets/:uuid/:test',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('snippet', {uuid: 'uuid', test: 'other-test', locale: 'en', parameter: 'other-value'});
router.navigate('snippet', {uuid: 'snippet-uuid', test: 'test', locale: 'de', parameter: 'value'});
router.navigate('page', {uuid: 'other-page-uuid', locale: 'de'});
expect(router.route.name).toEqual('page');
router.restore('snippet', {test: 'new-test', locale: 'en'});
expect(router.route.name).toEqual('snippet');
expect(router.attributes).toEqual({uuid: 'snippet-uuid', test: 'new-test', locale: 'en', parameter: 'value'});
});
test('Restore should just navigate if no history is available', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.restore('page', {uuid: 'page-uuid', locale: 'de'});
expect(router.route.name).toEqual('page');
expect(router.attributes).toEqual({uuid: 'page-uuid', locale: 'de'});
});
test('Restore should not create a new history entry', () => {
routeRegistry.getAll.mockReturnValue({
page: {
name: 'page',
view: 'form',
path: '/pages/:uuid',
options: {
type: 'page',
},
attributeDefaults: {},
},
});
const history = createHistory();
const router = new Router(history);
router.navigate('page', {uuid: 'page-uuid', locale: 'de'});
router.navigate('page', {uuid: 'other-page-uuid', locale: 'de'});
router.navigate('page', {uuid: 'another-page-uuid', locale: 'de'});
expect(router.attributesHistory['page']).toHaveLength(2);
router.restore('page');
expect(router.attributesHistory['page']).toHaveLength(1);
});
|
import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles, useTheme } from '@material-ui/core/styles';
import {
useMediaQuery,
colors,
Grid,
FormControl,
OutlinedInput,
InputAdornment,
Button,
Typography,
} from '@material-ui/core';
import { Image, Icon } from 'components/atoms';
import { SectionHeader } from 'components/molecules';
const useStyles = makeStyles(theme => ({
image: {
[theme.breakpoints.down('sm')]: {
maxWidth: 400,
},
},
searchInputContainer: {
background: theme.palette.alternate.main,
padding: theme.spacing(2),
boxShadow: '0 4px 14px 0 rgba(0, 0, 0, 0.11)',
borderRadius: theme.spacing(1),
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
'& .MuiOutlinedInput-notchedOutline': {
border: '0 !important',
},
'& .MuiInputAdornment-positionStart': {
marginRight: theme.spacing(2),
},
'& .MuiOutlinedInput-adornedStart': {
paddingLeft: 0,
},
'& .MuiOutlinedInput-input': {
padding: 0,
},
[theme.breakpoints.down('sm')]: {
padding: theme.spacing(1),
},
},
searchButton: {
maxHeight: 45,
minWidth: 135,
[theme.breakpoints.down('sm')]: {
minWidth: 'auto',
},
},
tags: {
display: 'flex',
flexWrap: 'wrap',
},
tag: {
padding: theme.spacing(1 / 2, 1),
borderRadius: theme.spacing(1 / 2),
background: theme.palette.secondary.light,
color: 'white',
margin: theme.spacing(0, 1, 1, 0),
cursor: 'pointer',
[theme.breakpoints.up('md')]: {
margin: theme.spacing(0, 2, 2, 0),
},
},
}));
const tags = ['Design', 'Product', 'UI / UX', 'UI Kit', 'Raect', 'Material UI'];
const Hero = props => {
const { data, className, ...rest } = props;
const classes = useStyles();
const theme = useTheme();
const isMd = useMediaQuery(theme.breakpoints.up('md'), {
defaultMatches: true,
});
return (
<div className={className} {...rest}>
<Grid container justify="space-between" spacing={isMd ? 4 : 2}>
<Grid item xs={12} md={6} data-aos={'fade-up'}>
<SectionHeader
title={
<span>
We want to showcase all{' '}
<Typography component="span" variant="inherit" color="primary">
the rich blog post options.
</Typography>
</span>
}
subtitle="How you use TheFront's blog cards is up to you! Our design begins with atomic elements which are easily combined to create rich blog post components."
align={isMd ? 'left' : 'center'}
disableGutter
titleVariant="h3"
/>
</Grid>
<Grid
item
container
justify="center"
xs={12}
md={6}
data-aos={'fade-up'}
>
<Image
src="https://assets.maccarianagency.com/the-front/illustrations/mobiles.svg"
className={classes.image}
/>
</Grid>
<Grid item xs={12}>
<div className={classes.searchInputContainer} data-aos="fade-up">
<FormControl fullWidth variant="outlined">
<OutlinedInput
startAdornment={
<InputAdornment position="start">
<Icon
fontIconClass="fas fa-search"
fontIconColor={colors.blueGrey[900]}
/>
</InputAdornment>
}
placeholder="Search for the blog"
/>
</FormControl>
<Button
color="primary"
variant="contained"
size="large"
className={classes.searchButton}
>
Search
</Button>
</div>
</Grid>
<Grid item xs={12}>
<div className={classes.tags}>
{tags.map((item, index) => (
<Typography
variant="caption"
color="primary"
className={classes.tag}
key={index}
>
{item}
</Typography>
))}
</div>
</Grid>
</Grid>
</div>
);
};
Hero.propTypes = {
/**
* External classes
*/
className: PropTypes.string,
};
export default Hero;
|
"use strict";
exports.default = void 0;
var _renderer = _interopRequireDefault(require("../../core/renderer"));
var _editor = _interopRequireDefault(require("../editor/editor"));
var _ui = _interopRequireDefault(require("./ui.date_view_roller"));
var _date = _interopRequireDefault(require("../../core/utils/date"));
var _iterator = require("../../core/utils/iterator");
var _extend = require("../../core/utils/extend");
var _ui2 = _interopRequireDefault(require("./ui.date_utils"));
var _component_registrator = _interopRequireDefault(require("../../core/component_registrator"));
var _date2 = _interopRequireDefault(require("../../localization/date"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DATEVIEW_CLASS = 'dx-dateview';
var DATEVIEW_COMPACT_CLASS = 'dx-dateview-compact';
var DATEVIEW_WRAPPER_CLASS = 'dx-dateview-wrapper';
var DATEVIEW_ROLLER_CONTAINER_CLASS = 'dx-dateview-rollers';
var DATEVIEW_ROLLER_CLASS = 'dx-dateviewroller';
var TYPE = {
date: 'date',
datetime: 'datetime',
time: 'time'
};
var ROLLER_TYPE = {
year: 'year',
month: 'month',
day: 'day',
hours: 'hours'
};
var DateView = _editor.default.inherit({
_valueOption: function _valueOption() {
var value = this.option('value');
var date = new Date(value);
return !value || isNaN(date) ? this._getDefaultDate() : date;
},
_getDefaultDate: function _getDefaultDate() {
var date = new Date();
if (this.option('type') === TYPE.date) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
}
return date;
},
_getDefaultOptions: function _getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
minDate: _ui2.default.MIN_DATEVIEW_DEFAULT_DATE,
maxDate: _ui2.default.MAX_DATEVIEW_DEFAULT_DATE,
type: TYPE.date,
value: new Date(),
applyCompactClass: false
});
},
_defaultOptionsRules: function _defaultOptionsRules() {
return this.callBase().concat([{
device: function device(_device) {
return _device.deviceType !== 'desktop';
},
options: {
applyCompactClass: true
}
}]);
},
_render: function _render() {
this.callBase();
this.$element().addClass(DATEVIEW_CLASS);
this._toggleFormatClasses(this.option('type'));
this._toggleCompactClass();
},
_toggleFormatClasses: function _toggleFormatClasses(currentFormat, previousFormat) {
this.$element().addClass(DATEVIEW_CLASS + '-' + currentFormat);
previousFormat && this.$element().removeClass(DATEVIEW_CLASS + '-' + previousFormat);
},
_toggleCompactClass: function _toggleCompactClass() {
this.$element().toggleClass(DATEVIEW_COMPACT_CLASS, this.option('applyCompactClass'));
},
_wrapper: function _wrapper() {
return this._$wrapper;
},
_renderContentImpl: function _renderContentImpl() {
this._$wrapper = (0, _renderer.default)('<div>').addClass(DATEVIEW_WRAPPER_CLASS);
this._renderRollers();
this._$wrapper.appendTo(this.$element());
},
_renderRollers: function _renderRollers() {
if (!this._$rollersContainer) {
this._$rollersContainer = (0, _renderer.default)('<div>').addClass(DATEVIEW_ROLLER_CONTAINER_CLASS);
}
this._$rollersContainer.empty();
this._createRollerConfigs();
this._rollers = {};
var that = this;
(0, _iterator.each)(that._rollerConfigs, function (name) {
var $roller = (0, _renderer.default)('<div>').appendTo(that._$rollersContainer).addClass(DATEVIEW_ROLLER_CLASS + '-' + that._rollerConfigs[name].type);
that._rollers[that._rollerConfigs[name].type] = that._createComponent($roller, _ui.default, {
items: that._rollerConfigs[name].displayItems,
selectedIndex: that._rollerConfigs[name].selectedIndex,
showScrollbar: false,
onStart: function onStart(e) {
var roller = e.component;
roller._toggleActive(true);
that._setActiveRoller(that._rollerConfigs[name], roller.option('selectedIndex'));
},
onEnd: function onEnd(e) {
var roller = e.component;
roller._toggleActive(false);
},
onClick: function onClick(e) {
var roller = e.component;
roller._toggleActive(true);
that._setActiveRoller(that._rollerConfigs[name], roller.option('selectedIndex'));
that._setRollerState(that._rollerConfigs[name], roller.option('selectedIndex'));
roller._toggleActive(false);
},
onSelectedIndexChanged: function onSelectedIndexChanged(e) {
var roller = e.component;
that._setRollerState(that._rollerConfigs[name], roller.option('selectedIndex'));
}
});
});
that._$rollersContainer.appendTo(that._wrapper());
},
_createRollerConfigs: function _createRollerConfigs(type) {
var that = this;
type = type || that.option('type');
that._rollerConfigs = {};
_date2.default.getFormatParts(_ui2.default.FORMATS_MAP[type]).forEach(function (partName) {
that._createRollerConfig(partName);
});
},
_createRollerConfig: function _createRollerConfig(componentName) {
var componentInfo = _ui2.default.DATE_COMPONENTS_INFO[componentName];
var valueRange = this._calculateRollerConfigValueRange(componentName);
var startValue = valueRange.startValue;
var endValue = valueRange.endValue;
var formatter = componentInfo.formatter;
var curDate = this._getCurrentDate();
var config = {
type: componentName,
setValue: componentInfo.setter,
valueItems: [],
displayItems: [],
getIndex: function getIndex(value) {
return value[componentInfo.getter]() - startValue;
}
};
for (var i = startValue; i <= endValue; i++) {
config.valueItems.push(i);
config.displayItems.push(formatter(i, curDate));
}
config.selectedIndex = config.getIndex(curDate);
this._rollerConfigs[componentName] = config;
},
_setActiveRoller: function _setActiveRoller(currentRoller) {
var activeRoller = currentRoller && this._rollers[currentRoller.type];
(0, _iterator.each)(this._rollers, function () {
this.toggleActiveState(this === activeRoller);
});
},
_updateRollersPosition: function _updateRollersPosition() {
var that = this;
(0, _iterator.each)(this._rollers, function (type) {
var correctIndex = that._rollerConfigs[type].getIndex(that._getCurrentDate());
this.option('selectedIndex', correctIndex);
});
},
_setRollerState: function _setRollerState(roller, selectedIndex) {
if (selectedIndex !== roller.selectedIndex) {
var rollerValue = roller.valueItems[selectedIndex];
var setValue = roller.setValue;
var currentValue = new Date(this._getCurrentDate());
var currentDate = currentValue.getDate();
var minDate = this.option('minDate');
var maxDate = this.option('maxDate');
if (roller.type === ROLLER_TYPE.month) {
currentDate = Math.min(currentDate, _ui2.default.getMaxMonthDay(currentValue.getFullYear(), rollerValue));
} else if (roller.type === ROLLER_TYPE.year) {
currentDate = Math.min(currentDate, _ui2.default.getMaxMonthDay(rollerValue, currentValue.getMonth()));
}
currentValue.setDate(currentDate);
currentValue[setValue](rollerValue);
var normalizedDate = _date.default.normalizeDate(currentValue, minDate, maxDate);
currentValue = _ui2.default.mergeDates(normalizedDate, currentValue, 'time');
currentValue = _date.default.normalizeDate(currentValue, minDate, maxDate);
this.option('value', currentValue);
roller.selectedIndex = selectedIndex;
}
if (roller.type === ROLLER_TYPE.year) {
this._refreshRollers();
}
if (roller.type === ROLLER_TYPE.month) {
this._refreshRoller(ROLLER_TYPE.day);
this._refreshRoller(ROLLER_TYPE.hours);
}
},
_refreshRoller: function _refreshRoller(rollerType) {
var roller = this._rollers[rollerType];
if (roller) {
this._createRollerConfig(rollerType);
var rollerConfig = this._rollerConfigs[rollerType];
if (rollerType === ROLLER_TYPE.day || rollerConfig.displayItems.toString() !== roller.option('items').toString()) {
roller.option({
items: rollerConfig.displayItems,
selectedIndex: rollerConfig.selectedIndex
});
}
}
},
_getCurrentDate: function _getCurrentDate() {
var curDate = this._valueOption();
var minDate = this.option('minDate');
var maxDate = this.option('maxDate');
return _date.default.normalizeDate(curDate, minDate, maxDate);
},
_calculateRollerConfigValueRange: function _calculateRollerConfigValueRange(componentName) {
var curDate = this._getCurrentDate();
var minDate = this.option('minDate');
var maxDate = this.option('maxDate');
var minYear = _date.default.sameYear(curDate, minDate);
var minMonth = minYear && curDate.getMonth() === minDate.getMonth();
var maxYear = _date.default.sameYear(curDate, maxDate);
var maxMonth = maxYear && curDate.getMonth() === maxDate.getMonth();
var minHour = minMonth && curDate.getDate() === minDate.getDate();
var maxHour = maxMonth && curDate.getDate() === maxDate.getDate();
var componentInfo = _ui2.default.DATE_COMPONENTS_INFO[componentName];
var startValue = componentInfo.startValue;
var endValue = componentInfo.endValue;
if (componentName === ROLLER_TYPE.year) {
startValue = minDate.getFullYear();
endValue = maxDate.getFullYear();
}
if (componentName === ROLLER_TYPE.month) {
if (minYear) {
startValue = minDate.getMonth();
}
if (maxYear) {
endValue = maxDate.getMonth();
}
}
if (componentName === ROLLER_TYPE.day) {
endValue = _ui2.default.getMaxMonthDay(curDate.getFullYear(), curDate.getMonth());
if (minYear && minMonth) {
startValue = minDate.getDate();
}
if (maxYear && maxMonth) {
endValue = maxDate.getDate();
}
}
if (componentName === ROLLER_TYPE.hours) {
startValue = minHour ? minDate.getHours() : startValue;
endValue = maxHour ? maxDate.getHours() : endValue;
}
return {
startValue: startValue,
endValue: endValue
};
},
_refreshRollers: function _refreshRollers() {
this._refreshRoller(ROLLER_TYPE.month);
this._refreshRoller(ROLLER_TYPE.day);
this._refreshRoller(ROLLER_TYPE.hours);
},
_optionChanged: function _optionChanged(args) {
switch (args.name) {
case 'minDate':
case 'maxDate':
case 'type':
this._renderRollers();
this._toggleFormatClasses(args.value, args.previousValue);
break;
case 'visible':
this.callBase(args);
if (args.value) {
this._renderRollers();
}
break;
case 'value':
this.option('value', this._valueOption());
this._refreshRollers();
this._updateRollersPosition();
break;
default:
this.callBase(args);
}
},
_clean: function _clean() {
this.callBase();
delete this._$rollersContainer;
}
});
(0, _component_registrator.default)('dxDateView', DateView);
var _default = DateView;
exports.default = _default;
module.exports = exports.default;
module.exports.default = exports.default;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.