code_text
stringlengths
604
999k
repo_name
stringlengths
4
100
file_path
stringlengths
4
873
language
stringclasses
23 values
license
stringclasses
15 values
size
int32
1.02k
999k
/* * /MathJax/jax/output/SVG/fonts/TeX/AMS/Regular/GreekAndCoptic.js * * Copyright (c) 2009-2015 The MathJax Consortium * * 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. */ MathJax.Hub.Insert(MathJax.OutputJax.SVG.FONTDATA.FONTS.MathJax_AMS,{989:[605,85,778,55,719,"477 261Q477 257 473 256T455 253T417 251T348 250H235L155 -77L146 -82Q137 -85 109 -85Q55 -85 55 -77L139 261Q224 596 226 598Q229 603 239 603Q240 603 254 603T290 603T341 604T405 605T477 605Q656 603 687 602T719 596Q719 589 692 588T513 585H319L282 427L242 272Q242 270 351 270Q388 270 410 270T444 269T460 267T469 265T477 261"],1008:[434,6,667,37,734,"228 325Q170 322 156 316T127 309Q108 309 104 314Q99 319 99 322T108 341Q125 376 171 400T268 425H271Q302 425 319 396Q328 377 328 358Q328 332 324 314Q311 270 286 221Q274 194 274 192H275Q339 234 484 325T639 421Q669 434 691 434T723 425T734 406Q734 394 719 381Q715 376 644 330L575 287L566 267Q543 233 526 176Q520 160 515 143T508 115T506 105Q506 103 533 103Q585 103 607 110T641 118Q670 118 670 107Q670 100 661 85Q643 50 598 27T504 3Q465 3 450 36Q441 51 441 73Q441 84 444 96Q452 146 484 205L497 236L324 125Q143 12 135 10Q103 -6 77 -6Q61 -6 49 2T37 21Q37 36 49 46T124 96L195 141L204 156Q219 179 243 248T264 323Q264 325 228 325"]});MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/AMS/Regular/GreekAndCoptic.js");
janpaepke/cdnjs
ajax/libs/mathjax/2.5.1/jax/output/SVG/fonts/TeX/AMS/Regular/GreekAndCoptic.js
JavaScript
mit
1,846
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DataCollector; use Symfony\Component\HttpKernel\DataCollector\TimeDataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class TimeDataCollectorTest extends \PHPUnit_Framework_TestCase { public function testCollect() { $c = new TimeDataCollector(); $request = new Request(); $request->server->set('REQUEST_TIME', 1); $c->collect($request, new Response()); $this->assertEquals(1000, $c->getStartTime()); $request->server->set('REQUEST_TIME_FLOAT', 2); $c->collect($request, new Response()); $this->assertEquals(2000, $c->getStartTime()); $request = new Request(); $c->collect($request, new Response()); $this->assertEquals(0, $c->getStartTime()); $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface'); $kernel->expects($this->once())->method('getStartTime')->will($this->returnValue(123456)); $c = new TimeDataCollector($kernel); $request = new Request(); $request->server->set('REQUEST_TIME', 1); $c->collect($request, new Response()); $this->assertEquals(123456000, $c->getStartTime()); } }
dzordzan/symfo
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php
PHP
mit
1,515
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Dimingu", "Chiposi", "Chipiri", "Chitatu", "Chinai", "Chishanu", "Sabudu" ], "ERANAMES": [ "Antes de Cristo", "Anno Domini" ], "ERAS": [ "AC", "AD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "Janeiro", "Fevreiro", "Marco", "Abril", "Maio", "Junho", "Julho", "Augusto", "Setembro", "Otubro", "Novembro", "Decembro" ], "SHORTDAY": [ "Dim", "Pos", "Pir", "Tat", "Nai", "Sha", "Sab" ], "SHORTMONTH": [ "Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Aug", "Set", "Otu", "Nov", "Dec" ], "STANDALONEMONTH": [ "Janeiro", "Fevreiro", "Marco", "Abril", "Maio", "Junho", "Julho", "Augusto", "Setembro", "Otubro", "Novembro", "Decembro" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d 'de' MMMM 'de' y", "longDate": "d 'de' MMMM 'de' y", "medium": "d 'de' MMM 'de' y HH:mm:ss", "mediumDate": "d 'de' MMM 'de' y", "mediumTime": "HH:mm:ss", "short": "d/M/y HH:mm", "shortDate": "d/M/y", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "MTn", "DECIMAL_SEP": ",", "GROUP_SEP": ".", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-", "negSuf": "\u00a4", "posPre": "", "posSuf": "\u00a4" } ] }, "id": "seh-mz", "localeID": "seh_MZ", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
pombredanne/cdnjs
ajax/libs/angular.js/1.5.1/i18n/angular-locale_seh-mz.js
JavaScript
mit
2,750
/** * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.83 (July 02 2010) * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * * @license * Dual licensed under the MIT and GPL licenses. */ .syntaxhighlighter { background-color: #222222 !important; } .syntaxhighlighter .line.alt1 { background-color: #222222 !important; } .syntaxhighlighter .line.alt2 { background-color: #222222 !important; } .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #253e5a !important; } .syntaxhighlighter .line.highlighted.number { color: white !important; } .syntaxhighlighter table caption { color: lime !important; } .syntaxhighlighter .gutter { color: #38566f !important; } .syntaxhighlighter .gutter .line { border-right: 3px solid #435a5f !important; } .syntaxhighlighter .gutter .line.highlighted { background-color: #435a5f !important; color: #222222 !important; } .syntaxhighlighter.printing .line .content { border: none !important; } .syntaxhighlighter.collapsed { overflow: visible !important; } .syntaxhighlighter.collapsed .toolbar { color: #428bdd !important; background: black !important; border: 1px solid #435a5f !important; } .syntaxhighlighter.collapsed .toolbar a { color: #428bdd !important; } .syntaxhighlighter.collapsed .toolbar a:hover { color: lime !important; } .syntaxhighlighter .toolbar { color: #aaaaff !important; background: #435a5f !important; border: none !important; } .syntaxhighlighter .toolbar a { color: #aaaaff !important; } .syntaxhighlighter .toolbar a:hover { color: #9ccff4 !important; } .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: lime !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #428bdd !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: lime !important; } .syntaxhighlighter .keyword { color: #aaaaff !important; } .syntaxhighlighter .preprocessor { color: #8aa6c1 !important; } .syntaxhighlighter .variable { color: aqua !important; } .syntaxhighlighter .value { color: #f7e741 !important; } .syntaxhighlighter .functions { color: #ff8000 !important; } .syntaxhighlighter .constants { color: yellow !important; } .syntaxhighlighter .script { font-weight: bold !important; color: #aaaaff !important; background-color: none !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: red !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: yellow !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #ffaa3e !important; }
mikesir87/cdnjs
ajax/libs/SyntaxHighlighter/3.0.83/styles/shThemeMDUltra.css
CSS
mit
2,832
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u092e.\u092a\u0942.", "\u092e.\u0928\u0902." ], "DAY": [ "\u0906\u0926\u093f\u0924\u094d\u092f\u0935\u093e\u0930", "\u0938\u094b\u092e\u0935\u093e\u0930", "\u092e\u0902\u0917\u0933\u093e\u0930", "\u092c\u0941\u0927\u0935\u093e\u0930", "\u0917\u0941\u0930\u0941\u0935\u093e\u0930", "\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930", "\u0936\u0928\u093f\u0935\u093e\u0930" ], "ERANAMES": [ "\u0915\u094d\u0930\u093f\u0938\u094d\u0924\u092a\u0942\u0930\u094d\u0935", "\u0915\u094d\u0930\u093f\u0938\u094d\u0924\u0936\u0916\u093e" ], "ERAS": [ "\u0915\u094d\u0930\u093f\u0938\u094d\u0924\u092a\u0942\u0930\u094d\u0935", "\u0915\u094d\u0930\u093f\u0938\u094d\u0924\u0936\u0916\u093e" ], "FIRSTDAYOFWEEK": 6, "MONTH": [ "\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940", "\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940", "\u092e\u093e\u0930\u094d\u091a", "\u090f\u092a\u094d\u0930\u093f\u0932", "\u092e\u0947", "\u091c\u0942\u0928", "\u091c\u0941\u0932\u0948", "\u0913\u0917\u0938\u094d\u091f", "\u0938\u0947\u092a\u094d\u091f\u0947\u0902\u092c\u0930", "\u0913\u0915\u094d\u091f\u094b\u092c\u0930", "\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930", "\u0921\u093f\u0938\u0947\u0902\u092c\u0930" ], "SHORTDAY": [ "\u0930\u0935\u093f", "\u0938\u094b\u092e", "\u092e\u0902\u0917\u0933", "\u092c\u0941\u0927", "\u0917\u0941\u0930\u0941", "\u0936\u0941\u0915\u094d\u0930", "\u0936\u0928\u093f" ], "SHORTMONTH": [ "\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940", "\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940", "\u092e\u093e\u0930\u094d\u091a", "\u090f\u092a\u094d\u0930\u093f\u0932", "\u092e\u0947", "\u091c\u0942\u0928", "\u091c\u0941\u0932\u0948", "\u0913\u0917\u0938\u094d\u091f", "\u0938\u0947\u092a\u094d\u091f\u0947\u0902\u092c\u0930", "\u0913\u0915\u094d\u091f\u094b\u092c\u0930", "\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930", "\u0921\u093f\u0938\u0947\u0902\u092c\u0930" ], "STANDALONEMONTH": [ "\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940", "\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940", "\u092e\u093e\u0930\u094d\u091a", "\u090f\u092a\u094d\u0930\u093f\u0932", "\u092e\u0947", "\u091c\u0942\u0928", "\u091c\u0941\u0932\u0948", "\u0913\u0917\u0938\u094d\u091f", "\u0938\u0947\u092a\u094d\u091f\u0947\u0902\u092c\u0930", "\u0913\u0915\u094d\u091f\u094b\u092c\u0930", "\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930", "\u0921\u093f\u0938\u0947\u0902\u092c\u0930" ], "WEEKENDRANGE": [ 6, 6 ], "fullDate": "EEEE d MMMM y", "longDate": "d MMMM y", "medium": "dd-MM-y h:mm:ss a", "mediumDate": "dd-MM-y", "mediumTime": "h:mm:ss a", "short": "d-M-yy h:mm a", "shortDate": "d-M-yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20b9", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 2, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 2, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-\u00a4\u00a0", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "kok-in", "localeID": "kok_IN", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
BenjaminVanRyseghem/cdnjs
ajax/libs/angular-i18n/1.6.2/angular-locale_kok-in.js
JavaScript
mit
4,531
YUI.add('editor-tab', function (Y, NAME) { /** * Handles tab and shift-tab indent/outdent support. * @class Plugin.EditorTab * @constructor * @extends Base * @module editor * @submodule editor-tab */ var EditorTab = function() { EditorTab.superclass.constructor.apply(this, arguments); }, HOST = 'host'; Y.extend(EditorTab, Y.Base, { /** * Listener for host's nodeChange event and captures the tabkey interaction. * @private * @method _onNodeChange * @param {Event} e The Event facade passed from the host. */ _onNodeChange: function(e) { var action = 'indent'; if (e.changedType === 'tab') { if (!e.changedNode.test('li, li *')) { e.changedEvent.halt(); e.preventDefault(); if (e.changedEvent.shiftKey) { action = 'outdent'; } Y.log('Overriding TAB to ' + action, 'info', 'editorTab'); this.get(HOST).execCommand(action, ''); } } }, initializer: function() { this.get(HOST).on('nodeChange', Y.bind(this._onNodeChange, this)); } }, { /** * editorTab * @property NAME * @static */ NAME: 'editorTab', /** * tab * @property NS * @static */ NS: 'tab', ATTRS: { host: { value: false } } }); Y.namespace('Plugin'); Y.Plugin.EditorTab = EditorTab; }, '@VERSION@', {"requires": ["editor-base"]});
aaqibrasheed/cdnjs
ajax/libs/yui/3.8.1/editor-tab/editor-tab-debug.js
JavaScript
mit
1,731
/*! tablesorter headerTitles widget - updated 3/5/2014 (core v2.15.6) * Requires tablesorter v2.8+ and jQuery 1.7+ * by Rob Garrison */ /*jshint browser:true, jquery:true, unused:false */ /*global jQuery: false */ ;(function($){ "use strict"; var ts = $.tablesorter; ts.addWidget({ id: 'headerTitles', options: { // use aria-label text // e.g. "First Name: Ascending sort applied, activate to apply a descending sort" headerTitle_useAria : false, // add tooltip class headerTitle_tooltip : '', // custom titles [ ascending, descending, unsorted ] headerTitle_cur_text : [ ' sort: A - Z', ' sort: Z - A', 'ly unsorted' ], headerTitle_cur_numeric : [ ' sort: 0 - 9', ' sort: 9 - 0', 'ly unsorted' ], headerTitle_nxt_text : [ ' sort: A - Z', ' sort: Z - A', 'remove sort' ], headerTitle_nxt_numeric : [ ' sort: 0 - 9', ' sort: 9 - 0', 'remove sort' ], // title display; {prefix} adds above prefix // {type} adds the current sort order from above (text or numeric) // {next} adds the next sort direction using the sort order above headerTitle_output_sorted : 'current{current}; activate to {next}', headerTitle_output_unsorted : 'current{current}; activate to {next} ', headerTitle_output_nosort : 'No sort available', // use this type to override the parser detection result // e.g. use for numerically parsed columns (e.g. dates), but you // want the user to see a text sort, e.g. [ 'text', 'numeric' ] headerTitle_type : [], // manipulate the title as desired headerTitle_callback : null // function($cell, txt) { return txt; } }, init: function(table, thisWidget, c, wo){ // force refresh c.$table.on('refreshHeaderTitle', function(){ thisWidget.format(table, c, wo); }); // add tooltip class if ($.isArray(wo.headerTitle_tooltip)) { c.$headers.each(function(){ $(this).addClass( wo.headerTitle_tooltip[this.column] || '' ); }); } else if (wo.headerTitle_tooltip !== '') { c.$headers.addClass( wo.headerTitle_tooltip ); } }, format: function (table, c, wo) { var txt; c.$headers.each(function(){ var t = this, $this = $(this), sortType = wo.headerTitle_type[t.column] || c.parsers[ t.column ].type || 'text', sortDirection = $this.hasClass(ts.css.sortAsc) ? 0 : $this.hasClass(ts.css.sortDesc) ? 1 : 2, sortNext = t.order[(t.count + 1) % (c.sortReset ? 3 : 2)]; if (wo.headerTitle_useAria) { txt = $this.hasClass('sorter-false') ? wo.headerTitle_output_nosort : $this.attr('aria-label') || ''; } else { txt = (wo.headerTitle_prefix || '') + // now deprecated ($this.hasClass('sorter-false') ? wo.headerTitle_output_nosort : ts.isValueInArray( t.column, c.sortList ) >= 0 ? wo.headerTitle_output_sorted : wo.headerTitle_output_unsorted); txt = txt.replace(/\{(current|next|name)\}/gi, function(m){ return { '{name}' : $this.text(), '{current}' : wo[ 'headerTitle_cur_' + sortType ][ sortDirection ] || '', '{next}' : wo[ 'headerTitle_nxt_' + sortType ][ sortNext ] || '' }[m.toLowerCase()]; }); } $this.attr('title', $.isFunction(wo.headerTitle_callback) ? wo.headerTitle_callback($this, txt) : txt); }); }, remove: function (table, c, wo) { c.$headers.attr('title', ''); c.$table.off('refreshHeaderTitle'); // remove tooltip class if ($.isArray(wo.headerTitle_tooltip)) { c.$headers.each(function(){ $(this).removeClass( wo.headerTitle_tooltip[this.column] || '' ); }); } else if (wo.headerTitle_tooltip !== '') { c.$headers.removeClass( wo.headerTitle_tooltip ); } } }); })(jQuery);
lobbin/cdnjs
ajax/libs/jquery.tablesorter/2.16.1-beta/js/widgets/widget-headerTitles.js
JavaScript
mit
3,693
var path = require('path'); var fs = require('fs'); function Mime() { // Map of extension -> mime type this.types = Object.create(null); // Map of mime type -> extension this.extensions = Object.create(null); } /** * Define mimetype -> extension mappings. Each key is a mime-type that maps * to an array of extensions associated with the type. The first extension is * used as the default extension for the type. * * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); * * @param map (Object) type definitions */ Mime.prototype.define = function (map) { for (var type in map) { var exts = map[type]; for (var i = 0; i < exts.length; i++) { if (process.env.DEBUG_MIME && this.types[exts]) { console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + this.types[exts] + ' to ' + type); } this.types[exts[i]] = type; } // Default extension is the first one we encounter if (!this.extensions[type]) { this.extensions[type] = exts[0]; } } }; /** * Load an Apache2-style ".types" file * * This may be called multiple times (it's expected). Where files declare * overlapping types/extensions, the last file wins. * * @param file (String) path of file to load. */ Mime.prototype.load = function(file) { this._loading = file; // Read file and split into lines var map = {}, content = fs.readFileSync(file, 'ascii'), lines = content.split(/[\r\n]+/); lines.forEach(function(line) { // Clean up whitespace/comments, and split into fields var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); map[fields.shift()] = fields; }); this.define(map); this._loading = null; }; /** * Lookup a mime type based on extension */ Mime.prototype.lookup = function(path, fallback) { var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); return this.types[ext] || fallback || this.default_type; }; /** * Return file extension associated with a mime type */ Mime.prototype.extension = function(mimeType) { var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); return this.extensions[type]; }; // Default instance var mime = new Mime(); // Load local copy of // http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types mime.load(path.join(__dirname, 'types/mime.types')); // Load additional types from node.js community mime.load(path.join(__dirname, 'types/node.types')); // Default type mime.default_type = mime.lookup('bin'); // // Additional API specific to the default instance // mime.Mime = Mime; /** * Lookup a charset based on mime type. */ mime.charsets = { lookup: function(mimeType, fallback) { // Assume text types are utf8 return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; } }; module.exports = mime;
Matthieusch/front-end
node_modules/gulp-iconify/node_modules/gulp-svg2png/node_modules/svg2png/node_modules/phantomjs/node_modules/request/node_modules/form-data/node_modules/mime/mime.js
JavaScript
mit
2,861
/* * RELIC is an Efficient LIbrary for Cryptography * Copyright (c) 2012 RELIC Authors * * This file is part of RELIC. RELIC is legal property of its developers, * whose names are not listed here. Please refer to the COPYRIGHT file * for contact information. * * RELIC is free software; you can redistribute it and/or modify it under the * terms of the version 2.1 (or later) of the GNU Lesser General Public License * as published by the Free Software Foundation; or version 2.0 of the Apache * License as published by the Apache Software Foundation. See the LICENSE files * for more details. * * RELIC is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the LICENSE files for more details. * * You should have received a copy of the GNU Lesser General Public or the * Apache License along with RELIC. If not, see <https://www.gnu.org/licenses/> * or <https://www.apache.org/licenses/>. */ /** * @file * * Implementation of AVR-dependent routines. * * @ingroup arch */ #include <avr/pgmspace.h> /*============================================================================*/ /* Public definitions */ /*============================================================================*/ void arch_init(void) { } void arch_clean(void) { } void arch_copy_rom(char *dest, const char *src, int len) { int i = 0; char c; while ((c = pgm_read_byte(src++)) && (i++ < len - 1)) { *dest++ = c; } *dest = 0; } unsigned int arch_lzcnt() { static const uint8_t table[16] = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4 }; if (a >> 4 == 0) { return table[a & 0xF]; } else { return table[a >> 4] + 4; } return 0; }
PIVX-Project/PIVX
src/chiabls/contrib/relic/src/arch/relic_arch_avr.c
C
mit
1,833
function html2pdf(e,t,a,i,r){if(e){t=t||"file.pdf","number"!=typeof i&&(i=1),r=r||144;var o=jsPDF_getSize(a=a||{}),h={width:o.width-2*i,height:o.height-2*i};h.ratio=h.height/h.width;var d=html2pdf_makeTemplate(e,h,o),l={letterRendering:!0,dpi:r,onrendered:function(e){document.body.removeChild(d.overlay),html2pdf_makePDF(e,t,h,a,i)}};html2canvas(d.template,l)}}function html2pdf_makeTemplate(e,t,a){function i(e,t){for(var a in t)e.style[a]=t[a]}if(overlayCSS={position:"fixed",backgroundColor:"rgba(0,0,0,0.8)",zIndex:1e3,left:0,right:0,bottom:0,top:0},templateCSS={position:"absolute",backgroundColor:"white",zIndex:1001,left:0,right:0,top:0,height:"auto",margin:"auto",width:t.width+a.unit},overlayCSS.overflow="hidden",overlayCSS.fontFeatureSettings='"liga" 0',overlayCSS.opacity=0,"string"==typeof e)(r=document.createElement("div")).innerHTML=e;else var r=e.cloneNode(!0);var o=document.createElement("div");return i(o,overlayCSS),i(r,templateCSS),o.className="html2pdf__overlay",r.className+=" html2pdf__template",o.appendChild(r),document.body.appendChild(o),{overlay:o,template:r}}function html2pdf_makePDF(e,t,a,i,r){var o=new jsPDF(i),h=e.getContext("2d"),d=e.height,l=Math.floor(e.width*a.ratio),g=Math.ceil(d/l),p=h.getImageData(0,0,e.width,e.height);e.height=l;for(var n=0;n<g;n++){h.fillStyle="#FFFFFF",h.fillRect(-10,-10,e.width+20,e.height+20),h.putImageData(p,0,-n*l),n&&o.addPage();var m=e.toDataURL("image/jpeg",.95);o.addImage(m,"JPEG",r,r,a.width,a.height)}o.save(t)}function jsPDF_getSize(e,t,a){if("object"==typeof e){var i=e;e=i.orientation,t=i.unit||t,a=i.format||a}t=t||"mm",a=a||"a4",e=(""+(e||"P")).toLowerCase();var r=(""+a).toLowerCase();switch(pageFormats={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]},t){case"pt":k=1;break;case"mm":k=72/25.4;break;case"cm":k=72/2.54;break;case"in":k=72;break;case"px":k=96/72;break;case"pc":case"em":k=12;break;case"ex":k=6;break;default:throw"Invalid unit: "+t}if(pageFormats.hasOwnProperty(r))pageHeight=pageFormats[r][1]/k,pageWidth=pageFormats[r][0]/k;else try{pageHeight=a[1],pageWidth=a[0]}catch(e){throw new Error("Invalid format: "+a)}if("p"===e||"portrait"===e)e="p",pageWidth>pageHeight&&(tmp=pageWidth,pageWidth=pageHeight,pageHeight=tmp);else{if("l"!==e&&"landscape"!==e)throw"Invalid orientation: "+e;e="l",pageHeight>pageWidth&&(tmp=pageWidth,pageWidth=pageHeight,pageHeight=tmp)}return{width:pageWidth,height:pageHeight,unit:t,k:k}}
joeyparrish/cdnjs
ajax/libs/html2pdf.js/0.5.1/html2pdf.min.js
JavaScript
mit
3,185
/*! * tui-editor * @version 1.2.3 * @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/) * @license MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("jquery"), require("tui-code-snippet"), (function webpackLoadOptionalExternalModule() { try { return require("tui-editor"); } catch(e) {} }()), (function webpackLoadOptionalExternalModule() { try { return require("tui-editor/dist/tui-editor-Viewer"); } catch(e) {} }())); else if(typeof define === 'function' && define.amd) define(["jquery", "tui-code-snippet", "tui-editor", "tui-editor/dist/tui-editor-Viewer"], factory); else { var a = typeof exports === 'object' ? factory(require("jquery"), require("tui-code-snippet"), (function webpackLoadOptionalExternalModule() { try { return require("tui-editor"); } catch(e) {} }()), (function webpackLoadOptionalExternalModule() { try { return require("tui-editor/dist/tui-editor-Viewer"); } catch(e) {} }())) : factory(root["$"], (root["tui"] && root["tui"]["util"]), (root["tui"] && root["tui"]["Editor"]), (root["tui"] && root["tui"]["Editor"])); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_5__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "dist/"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 46); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /***/ 1: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @fileoverview Editor/Viewer proxy for extensions * @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> */ /* eslint global-require: 0 no-empty: 0 */ var Editor = void 0; try { Editor = __webpack_require__(4); } catch (e) {} if (!Editor) { try { Editor = __webpack_require__(5); } catch (e) {} } exports.default = Editor; /***/ }), /***/ 2: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /***/ }), /***/ 4: /***/ (function(module, exports) { if(typeof __WEBPACK_EXTERNAL_MODULE_4__ === 'undefined') {var e = new Error("Cannot find module \"undefined\""); e.code = 'MODULE_NOT_FOUND'; throw e;} module.exports = __WEBPACK_EXTERNAL_MODULE_4__; /***/ }), /***/ 46: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); var _editorProxy = __webpack_require__(1); var _editorProxy2 = _interopRequireDefault(_editorProxy); var _scrollManager = __webpack_require__(47); var _scrollManager2 = _interopRequireDefault(_scrollManager); var _sectionManager = __webpack_require__(48); var _sectionManager2 = _interopRequireDefault(_sectionManager); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * scrollSync plugin * @param {Editor} editor - editor * @ignore */ /** * @fileoverview Implements Scroll Sync Extension * @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> */ function scrollSyncExtension(editor) { var className = 'tui-scrollsync'; var i18n = editor.i18n; var TOOL_TIP = { active: i18n.get('Auto scroll enabled'), inactive: i18n.get('Auto scroll disabled') }; if (editor.isViewer()) { return; } var cm = editor.getCodeMirror(); var sectionManager = new _sectionManager2.default(cm, editor.preview); var scrollManager = new _scrollManager2.default(sectionManager, cm, editor.preview.$el); var isScrollable = false; var isActive = true; var button = void 0; var $divider = void 0; // UI if (editor.getUI().name === 'default') { var toolbar = editor.getUI().getToolbar(); toolbar.addItem('divider'); toolbar.addItem({ type: 'button', options: { className: className, command: 'scrollSyncToggle', tooltip: TOOL_TIP.active, $el: (0, _jquery2.default)('<button class="active ' + className + '" type="button"></button>') } }); var items = toolbar.getItems(); $divider = items[items.length - 2].$el; button = items[items.length - 1]; changeButtonVisiblityStateIfNeed(); // hide scroll follow button in wysiwyg editor.on('changeMode', changeButtonVisiblityStateIfNeed); editor.on('changePreviewStyle', changeButtonVisiblityStateIfNeed); // Commands editor.addCommand('markdown', { name: 'scrollSyncToggle', exec: function exec() { isActive = !isActive; button._onOut(); if (isActive) { button.$el.addClass('active'); button.setTooltip(TOOL_TIP.active); } else { button.$el.removeClass('active'); button.setTooltip(TOOL_TIP.inactive); } button._onOver(); } }); } // Events cm.on('change', function () { isScrollable = false; sectionManager.makeSectionList(); }); /** * change button visiblity state */ function changeButtonVisiblityStateIfNeed() { if (editor.mdPreviewStyle === 'vertical' && editor.currentMode === 'markdown') { button.$el.show(); $divider.show(); } else { button.$el.hide(); $divider.hide(); } } editor.on('previewRenderAfter', function () { sectionManager.sectionMatch(); scrollManager.syncPreviewScrollTopToMarkdown(); isScrollable = true; }); editor.eventManager.listen('scroll', function (event) { if (!isActive) { return; } if (isScrollable && editor.preview.isVisible()) { if (event.source === 'markdown' && !scrollManager.isMarkdownScrollEventBlocked) { scrollManager.syncPreviewScrollTopToMarkdown(); } else if (event.source === 'preview' && !scrollManager.isPreviewScrollEventBlocked) { scrollManager.syncMarkdownScrollTopToPreview(); } } else { scrollManager.saveScrollInfo(); } }); } _editorProxy2.default.defineExtension('scrollSync', scrollSyncExtension); exports.default = scrollSyncExtension; /***/ }), /***/ 47: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** * @fileoverview Implements Scroll Sync Extension ScrollManager Module * @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> */ var _tuiCodeSnippet = __webpack_require__(2); var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var PREVIEW_MARGIN_TOP = 57; var SCROLL_TOP_PADDING = 20; var SCROLL_BOCKING_RESET_DELAY = 15; /** * Class ScrollManager * manage scroll sync between markdown editor and preview */ var ScrollManager = function () { /** * Creates an instance of ScrollManager. * @param {SectionManager} sectionManager - sectionManager * @param {CodeMirror} cm - CodeMirror * @param {jQuery} $previewContainerEl - preview container * @memberof ScrollManager */ function ScrollManager(sectionManager, cm, $previewContainerEl) { _classCallCheck(this, ScrollManager); this.sectionManager = sectionManager; this.cm = cm; this.$previewContainerEl = $previewContainerEl; this.$contents = this.$previewContainerEl.find('.tui-editor-contents'); this.releaseTimer = null; /** * current timeout id needs animation * @type {number} */ this._currentTimeoutId = null; /** * Saved scrollInfo object of CodeMirror * @type {object} */ this._savedScrollInfo = null; } /** * _getEditorSectionHeight * Return section height of editor * @param {object} section section be calculated height * @returns {number} height * @private */ _createClass(ScrollManager, [{ key: '_getEditorSectionHeight', value: function _getEditorSectionHeight(section) { var height = this.cm.heightAtLine(section.end, 'local'); height -= this.cm.heightAtLine(section.start > 0 ? section.start - 1 : 0, 'local'); return height; } /** * _getLineHeightGapInSection * Return height gap between passed line in passed section * @param {object} section section be calculated * @param {number} line line number * @returns {number} gap * @private */ }, { key: '_getEditorLineHeightGapInSection', value: function _getEditorLineHeightGapInSection(section, line) { var gap = this.cm.heightAtLine(line, 'local'); gap -= this.cm.heightAtLine(section.start > 0 ? section.start - 1 : 0, 'local'); return Math.max(gap, 0); } /** * _getSectionScrollRatio * Return ratio of height between scrollTop line and scrollTop section * @param {object} section section be calculated * @param {number} line line number * @returns {number} ratio * @private */ }, { key: '_getEditorSectionScrollRatio', value: function _getEditorSectionScrollRatio(section, line) { var isOneLine = section.end === section.start; var ratio = void 0; if (isOneLine) { ratio = 0; } else { ratio = this._getEditorLineHeightGapInSection(section, line) / this._getEditorSectionHeight(section); } return ratio; } /** * _getScrollFactorsOfEditor * Return Scroll Information of editor for preview scroll sync * @returns {object} scroll factors * @private */ }, { key: '_getScrollFactorsOfEditor', value: function _getScrollFactorsOfEditor() { var cm = this.cm; var scrollInfo = cm.getScrollInfo(); var topLine = void 0, topSection = void 0, ratio = void 0, factors = void 0; // if codemirror has not visible scrollInfo have incorrect value // so we use saved scroll info for alternative scrollInfo = this._fallbackScrollInfoIfIncorrect(scrollInfo); var isEditorBottom = scrollInfo.height - scrollInfo.top <= scrollInfo.clientHeight; if (isEditorBottom) { factors = { isEditorBottom: isEditorBottom }; } else { topLine = cm.coordsChar({ left: scrollInfo.left, top: scrollInfo.top }, 'local').line; topSection = this.sectionManager.sectionByLine(topLine); ratio = this._getEditorSectionScrollRatio(topSection, topLine); factors = { section: topSection, sectionRatio: ratio }; } return factors; } /** * Return Scroll Information of editor for Markdown scroll sync * @returns {object} scroll factors * @private */ }, { key: '_getScrollInfoForMarkdown', value: function _getScrollInfoForMarkdown() { var _this = this; var sectionList = this.sectionManager.getSectionList(); var factors = void 0; _tuiCodeSnippet2.default.forEachArray(sectionList, function (section) { var $div = section.$previewSectionEl; var $preview = $div.parent().parent(); var isPreviewBottom = $preview[0].clientHeight - $preview.scrollTop() <= $preview[0].height; var needNext = true; if (isPreviewBottom) { factors = { isPreviewBottom: isPreviewBottom }; needNext = false; } else if (_this._isTopSection($preview, $div)) { factors = { section: section, sectionRatio: _this._getMarkdownEditorScrollRatio($preview, $div) }; needNext = false; } return needNext; }); return factors; } /** * Return ScrollRatio for Markdown scroll value * @param {jQuery} $preview jQuery wrapped preview container * @param {jQuery} $div jQuery wrapped section div element * @returns {number} * @private */ }, { key: '_getMarkdownEditorScrollRatio', value: function _getMarkdownEditorScrollRatio($preview, $div) { return ($preview.scrollTop() - $div[0].offsetTop) / $div.height(); } /** * _getScrollTopForPreview * Return scrollTop value for preview * @returns {number|undefined} scrollTop value, when something wrong then return undefined * @private */ }, { key: '_getScrollTopForPreview', value: function _getScrollTopForPreview() { var scrollTop = void 0; var scrollFactors = this._getScrollFactorsOfEditor(); var section = scrollFactors.section, sectionRatio = scrollFactors.sectionRatio; if (scrollFactors.isEditorBottom) { scrollTop = this.$contents.height(); } else if (section.$previewSectionEl) { scrollTop = section.$previewSectionEl[0].offsetTop; scrollTop += section.$previewSectionEl.height() * sectionRatio - SCROLL_TOP_PADDING; } scrollTop = scrollTop && Math.max(scrollTop, 0); return scrollTop; } /** * Return scrollTop value for Markdown editor * @returns {number} * @private */ }, { key: '_getScrollTopForMarkdown', value: function _getScrollTopForMarkdown() { var scrollTop = void 0; var scrollFactors = this._getScrollInfoForMarkdown(); var ratio = scrollFactors.sectionRatio; if (scrollFactors.isPreviewBottom) { scrollTop = this.cm.getScrollInfo().height; } else if (scrollFactors.section) { var section = scrollFactors.section; var coordsAtStart = this.cm.charCoords({ line: section.start, char: 0 }, 'local'); var coordsAtEnd = this.cm.charCoords({ line: section.end, char: 0 }, 'local'); scrollTop = coordsAtStart.top; scrollTop += (coordsAtEnd.top - coordsAtStart.top) * ratio; } scrollTop = scrollTop && Math.max(scrollTop, 0); return scrollTop; } /** * syncPreviewScrollTopToMarkdown * sync preview scroll to markdown */ }, { key: 'syncPreviewScrollTopToMarkdown', value: function syncPreviewScrollTopToMarkdown() { var _this2 = this; var $previewContainerEl = this.$previewContainerEl; var sourceScrollTop = $previewContainerEl.scrollTop(); var targetScrollTop = this._getScrollTopForPreview(); this.isPreviewScrollEventBlocked = true; this._animateRun(sourceScrollTop, targetScrollTop, function (deltaScrollTop) { clearTimeout(_this2.releaseTimer); $previewContainerEl.scrollTop(deltaScrollTop); _this2.releaseTimer = setTimeout(function () { _this2.isPreviewScrollEventBlocked = false; }, SCROLL_BOCKING_RESET_DELAY); }); } /** * syncMarkdownScrollTopToPreview * sync markdown scroll to preview */ }, { key: 'syncMarkdownScrollTopToPreview', value: function syncMarkdownScrollTopToPreview() { var _this3 = this; var codeMirror = this.cm; var codeMirrorScrollInfo = codeMirror.getScrollInfo(); var sourceScrollTop = codeMirrorScrollInfo.top; var targetScrollTop = this._getScrollTopForMarkdown(); this.isMarkdownScrollEventBlocked = true; this._animateRun(sourceScrollTop, targetScrollTop, function (deltaScrollTop) { clearTimeout(_this3.releaseTimer); codeMirror.scrollTo(0, deltaScrollTop); _this3.releaseTimer = setTimeout(function () { _this3.isMarkdownScrollEventBlocked = false; }, SCROLL_BOCKING_RESET_DELAY); }); } /** * _animateRun * animate with passed Callback * @param {number} originValue original value * @param {number} targetValue target value * @param {function} stepCB callback function * @private */ }, { key: '_animateRun', value: function _animateRun(originValue, targetValue, stepCB) { var valueDiff = targetValue - originValue, startTime = Date.now(), self = this; // if already doing animation if (this._currentTimeoutId) { clearTimeout(this._currentTimeoutId); } /** * Each animation step */ function step() { var stepTime = Date.now(); var progress = (stepTime - startTime) / 200; // 200 is animation time var deltaValue = void 0; if (progress < 1) { deltaValue = originValue + valueDiff * Math.cos((1 - progress) * Math.PI / 2); stepCB(Math.ceil(deltaValue)); self._currentTimeoutId = setTimeout(step, 1); } else { stepCB(targetValue); self._currentTimeoutId = null; } } step(); } /** * Fallback to saved scrolInfo if incorrect scrollInfo passed * this because incorrect CodeMirror returns scrollInfo if CodeMirror is invisible * @param {object} scrollInfo scrollInfo * @returns {object} scrollInfo * @private */ }, { key: '_fallbackScrollInfoIfIncorrect', value: function _fallbackScrollInfoIfIncorrect(scrollInfo) { return scrollInfo.height < 0 && this._savedScrollInfo ? this._savedScrollInfo : scrollInfo; } /** * Save Codemirror's scrollInfo for alternative use * memberOf ScrollManager */ }, { key: 'saveScrollInfo', value: function saveScrollInfo() { this._savedScrollInfo = this.cm.getScrollInfo(); } /** * Return whether given range is top section of preview contents or not * @param {jQuery} $preview jQuery wrapped preview container * @param {jQuery} $div jQuery wrapped section div element * @returns {boolean} * @private */ }, { key: '_isTopSection', value: function _isTopSection($preview, $div) { var previewScrollTop = $preview.scrollTop(); var divOffsetTop = $div[0].offsetTop; var divHeight = $div.height(); var isSectionBegin = previewScrollTop >= divOffsetTop - PREVIEW_MARGIN_TOP; var isSectionEnd = previewScrollTop > divOffsetTop + divHeight; return isSectionBegin && !isSectionEnd; } }]); return ScrollManager; }(); exports.default = ScrollManager; /***/ }), /***/ 48: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** * @fileoverview Implements Scroll Sync Extension SectionManager Module * @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> */ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var FIND_HEADER_RX = /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/; var FIND_LIST_RX = /^ *(\*|-|\d+\.|[*-] \[[ xX]])\s/; var FIND_QUOTE_RX = /^ {0,3}(> ?)+\s/; var FIND_IMAGE_RX = /^ {0,3}!\[([^[\]]*)]\(([^)]*)\)/; var FIND_SETEXT_HEADER_RX = /^ *(?:={1,}|-{1,})\s*$/; var FIND_CODEBLOCK_END_RX = /^ *(`{3,}|~{3,})[ ]*$/; var FIND_CODEBLOCK_START_RX = /^ *(`{3,}|~{3,})[ .]*(\S+)? */; var FIND_SPACE = /\s/g; /** * Class SectionManager * manage logical markdown content sections */ var SectionManager = function () { /** * Creates an instance of SectionManager. * @param {CodeMirror} cm - codemirror * @param {Preview} preview - preview * @memberof SectionManager */ function SectionManager(cm, preview) { _classCallCheck(this, SectionManager); this.cm = cm; this.preview = preview; this.$previewContent = preview.$el.find('.tui-editor-contents'); /** * section list * @type {object[]} */ this._sectionList = null; /** * current working section needs making section list * @type {object} */ this._currentSection = null; } /** * _addNewSection * add new section * @param {number} start initial start line number * @param {number} end initial end line number * @private */ _createClass(SectionManager, [{ key: '_addNewSection', value: function _addNewSection(start, end) { var newSection = this._makeSectionData(start, end); this._sectionList.push(newSection); this._currentSection = newSection; } /** * getSectionList * return section list * @returns {object[]} section object list */ }, { key: 'getSectionList', value: function getSectionList() { if (!this._sectionList) { this.makeSectionList(); } return this._sectionList; } /** * _makeSectionData * make default section object * @param {number} start initial start line number * @param {number} end initial end line number * @returns {object} section object * @private */ }, { key: '_makeSectionData', value: function _makeSectionData(start, end) { return { start: start, end: end, $previewSectionEl: null }; } /** * _updateCurrentSectionEnd * update current section's end line number * @param {number} end end value to update * @private */ }, { key: '_updateCurrentSectionEnd', value: function _updateCurrentSectionEnd(end) { this._currentSection.end = end; } /** * _eachLineState * iterate codemiror lines, callback function parameter pass line type and line number * @param {function} iteratee callback function * @private */ }, { key: '_eachLineState', value: function _eachLineState(iteratee) { var isSection = void 0, i = void 0, lineString = void 0, nextLineString = void 0, prevLineString = void 0, isTrimming = true, onTable = false, onCodeBlock = false, trimCapture = ''; var isRightAfterImageSection = false; var isEnsuredSection = false; var codeblockStartLineIndex = void 0; var lineLength = this.cm.getDoc().lineCount(); for (i = 0; i < lineLength; i += 1) { isSection = false; lineString = this.cm.getLine(i); nextLineString = this.cm.getLine(i + 1) || ''; prevLineString = this.cm.getLine(i - 1) || ''; var isCodeBlockEnded = this._isCodeBlockEnd(prevLineString) && codeblockStartLineIndex !== i - 1; if (onTable && (!lineString || !this._isTableCode(lineString))) { onTable = false; } else if (!onTable && this._isTable(lineString, nextLineString)) { onTable = true; } if (onCodeBlock && isCodeBlockEnded) { onCodeBlock = false; } if (!onCodeBlock && this._isCodeBlockStart(lineString)) { onCodeBlock = this._doFollowedLinesHaveCodeBlockEnd(i, lineLength); codeblockStartLineIndex = i; } if (isEnsuredSection && lineString.length !== 0) { if (this._isIndependentImage(onCodeBlock, onTable, lineString, prevLineString)) { isRightAfterImageSection = true; isEnsuredSection = true; } else { isRightAfterImageSection = false; isEnsuredSection = false; } isSection = true; } else if (this._isAtxHeader(lineString)) { isRightAfterImageSection = false; isSection = true; isEnsuredSection = false; // setext header } else if (!this._isCodeBlockEnd(lineString) && !onTable && this._isSeTextHeader(lineString, nextLineString)) { isRightAfterImageSection = false; isSection = true; isEnsuredSection = false; } else if (this._isIndependentImage(onCodeBlock, onTable, lineString, prevLineString)) { isRightAfterImageSection = true; isSection = true; isEnsuredSection = false; } else if (isRightAfterImageSection && lineString.length === 0) { isRightAfterImageSection = false; isEnsuredSection = true; } // resolve wrong number of sections mismatch compare to preview if (isTrimming) { trimCapture += lineString.trim(); if (trimCapture) { isTrimming = false; } else { continue; } } iteratee(isSection, i); } } /** * Return whether is independent image line with padding lines top and bottom * @param {boolean} onCodeBlock Is on codeblock * @param {boolean} onTable Is on table * @param {string} lineString Current line string * @param {string} prevLineString Previous line string * @returns {boolean} * @private */ }, { key: '_isIndependentImage', value: function _isIndependentImage(onCodeBlock, onTable, lineString, prevLineString) { return !onCodeBlock && !onTable && this._isImage(lineString) && !this._isList(lineString) && !this._isQuote(lineString) && prevLineString.length === 0; } /** * _doFollowedLinesHaveCodeBlockEnd * Check if follow lines have codeblock end * @param {number} lineIndex current index * @param {number} lineLength line length * @returns {boolean} result * @private */ }, { key: '_doFollowedLinesHaveCodeBlockEnd', value: function _doFollowedLinesHaveCodeBlockEnd(lineIndex, lineLength) { var doLineHaveCodeBlockEnd = false; for (var i = lineIndex + 1; i < lineLength; i += 1) { if (this._isCodeBlockEnd(this.cm.getLine(i))) { doLineHaveCodeBlockEnd = true; break; } } return doLineHaveCodeBlockEnd; } /** * _isCodeBlockStart * Check if passed string have code block start * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isCodeBlockStart', value: function _isCodeBlockStart(string) { return FIND_CODEBLOCK_START_RX.test(string); } /** * _isCodeBlockEnd * Check if passed string have code block end * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isCodeBlockEnd', value: function _isCodeBlockEnd(string) { return FIND_CODEBLOCK_END_RX.test(string); } /** * _isTable * Check if passed string have table * @param {string} lineString current line string * @param {string} nextLineString next line string * @returns {boolean} result * @private */ }, { key: '_isTable', value: function _isTable(lineString, nextLineString) { return this._isTableCode(lineString) && this._isTableAligner(nextLineString); } /** * _isTableCode * Check if passed string have table code * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isTableCode', value: function _isTableCode(string) { return (/(^\S?.*\|.*)/.test(string) ); } /** * _isTableAligner * Check if passed string have table align code * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isTableAligner', value: function _isTableAligner(string) { return (/(\s*[-:]+\s*\|)+/.test(string) ); } /** * _isAtxHeader * Check if passed string have atx header * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isAtxHeader', value: function _isAtxHeader(string) { return FIND_HEADER_RX.test(string); } /** * _isSeTextHeader * @param {string} lineString current line string * @param {string} nextLineString next line string * @returns {boolean} result * @private */ }, { key: '_isSeTextHeader', value: function _isSeTextHeader(lineString, nextLineString) { return lineString.replace(FIND_SPACE, '') !== '' && nextLineString && FIND_SETEXT_HEADER_RX.test(nextLineString); } }, { key: '_isImage', value: function _isImage(lineString) { return FIND_IMAGE_RX.test(lineString); } }, { key: '_isList', value: function _isList(lineString) { return FIND_LIST_RX.test(lineString); } }, { key: '_isQuote', value: function _isQuote(lineString) { return FIND_QUOTE_RX.test(lineString); } /** * makeSectionList * make section list */ }, { key: 'makeSectionList', value: function makeSectionList() { var _this = this; this._sectionList = []; this._eachLineState(function (isSection, lineNumber) { if (isSection || !_this._sectionList.length) { _this._addNewSection(lineNumber, lineNumber); } else { _this._updateCurrentSectionEnd(lineNumber); } }); } /** * sectionMatch * make preview sections then match section list with preview section element */ }, { key: 'sectionMatch', value: function sectionMatch() { if (this.getSectionList()) { var sections = this._getPreviewSections(); this._matchPreviewSectionsWithSectionlist(sections); } } /** * _matchPreviewSectionsWithSectionlist * match section list with preview section element * @param {HTMLNode[]} sections section nodes * @private */ }, { key: '_matchPreviewSectionsWithSectionlist', value: function _matchPreviewSectionsWithSectionlist(sections) { var sectionList = this.getSectionList(); sections.forEach(function (childs, index) { var section = sectionList[index]; if (section) { var $sectionDiv = (0, _jquery2.default)('<div class=\'content-id-' + index + '\'></div>'); section.$previewSectionEl = (0, _jquery2.default)(childs).wrapAll($sectionDiv).parent(); } }); } /** * _getPreviewSections * get preview html section group to make section * @returns {array[]} element node array * @private */ }, { key: '_getPreviewSections', value: function _getPreviewSections() { var sections = []; var lastSection = 0; var isRightAfterImageSection = false; sections[0] = []; this.$previewContent.contents().filter(findElementNodeFilter).each(function (index, el) { var isParagraph = el.tagName === 'P'; var isHeading = el.tagName.match(/^(H1|H2|H3|H4|H5|H6)$/); var isImage = isParagraph && el.childNodes[0].nodeName === 'IMG'; if ((isHeading || isImage || isRightAfterImageSection) && sections[lastSection].length) { sections.push([]); lastSection += 1; isRightAfterImageSection = false; } if (isImage) { isRightAfterImageSection = true; } sections[lastSection].push(el); }); return sections; } /** * _sectionByLine * get section by markdown line * @param {number} line markdown editor line number * @returns {object} section */ }, { key: 'sectionByLine', value: function sectionByLine(line) { var sectionIndex = void 0; var sectionList = this.getSectionList(); var sectionLength = sectionList.length; for (sectionIndex = 0; sectionIndex < sectionLength; sectionIndex += 1) { if (line <= sectionList[sectionIndex].end) { break; } } if (sectionIndex === sectionLength) { sectionIndex = sectionLength - 1; } return sectionList[sectionIndex]; } }]); return SectionManager; }(); /** * findElementNodeFilter * @this Node * @returns {boolean} true or not * @ignore */ function findElementNodeFilter() { return this.nodeType === Node.ELEMENT_NODE; } exports.default = SectionManager; /***/ }), /***/ 5: /***/ (function(module, exports) { if(typeof __WEBPACK_EXTERNAL_MODULE_5__ === 'undefined') {var e = new Error("Cannot find module \"undefined\""); e.code = 'MODULE_NOT_FOUND'; throw e;} module.exports = __WEBPACK_EXTERNAL_MODULE_5__; /***/ }) /******/ }); });
extend1994/cdnjs
ajax/libs/tui-editor/1.2.3/tui-editor-extScrollSync.js
JavaScript
mit
39,550
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>basic_signal_set::remove (1 of 2 overloads)</title> <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> <link rel="home" href="../../../../boost_asio.html" title="Boost.Asio"> <link rel="up" href="../remove.html" title="basic_signal_set::remove"> <link rel="prev" href="../remove.html" title="basic_signal_set::remove"> <link rel="next" href="overload2.html" title="basic_signal_set::remove (2 of 2 overloads)"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> <td align="center"><a href="../../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="../remove.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../remove.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> <a name="boost_asio.reference.basic_signal_set.remove.overload1"></a><a class="link" href="overload1.html" title="basic_signal_set::remove (1 of 2 overloads)">basic_signal_set::remove (1 of 2 overloads)</a> </h5></div></div></div> <p> Remove a signal from a signal_set. </p> <pre class="programlisting"><span class="keyword">void</span> <span class="identifier">remove</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">signal_number</span><span class="special">);</span> </pre> <p> This function removes the specified signal from the set. It has no effect if the signal is not in the set. </p> <h6> <a name="boost_asio.reference.basic_signal_set.remove.overload1.h0"></a> <span><a name="boost_asio.reference.basic_signal_set.remove.overload1.parameters"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_signal_set.remove.overload1.parameters">Parameters</a> </h6> <div class="variablelist"> <p class="title"><b></b></p> <dl> <dt><span class="term">signal_number</span></dt> <dd><p> The signal to be removed from the set. </p></dd> </dl> </div> <h6> <a name="boost_asio.reference.basic_signal_set.remove.overload1.h1"></a> <span><a name="boost_asio.reference.basic_signal_set.remove.overload1.exceptions"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_signal_set.remove.overload1.exceptions">Exceptions</a> </h6> <div class="variablelist"> <p class="title"><b></b></p> <dl> <dt><span class="term">boost::system::system_error</span></dt> <dd><p> Thrown on failure. </p></dd> </dl> </div> <h6> <a name="boost_asio.reference.basic_signal_set.remove.overload1.h2"></a> <span><a name="boost_asio.reference.basic_signal_set.remove.overload1.remarks"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_signal_set.remove.overload1.remarks">Remarks</a> </h6> <p> Removes any notifications that have been queued for the specified signal number. </p> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2015 Christopher M. Kohlhoff<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="../remove.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../remove.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
yinchunlong/abelkhan-1
ext/c++/thirdpart/c++/boost/libs/asio/doc/html/boost_asio/reference/basic_signal_set/remove/overload1.html
HTML
mit
4,993
#include <Graphics.h> #include <algorithm> namespace nme { // --- Transform ------------------------------------------------------------------- static Matrix sgIdentity; static Scale9 sgNoScale9; Transform::Transform() { mAAFactor = 1; mScale9 = &sgNoScale9; mMatrix = &sgIdentity; mMatrix3D = &sgIdentity; } UserPoint Transform::Apply(float inX, float inY) const { if (mScale9->Active()) { inX = mScale9->TransX(inX); inY = mScale9->TransY(inY); } return UserPoint( (mMatrix->m00*inX + mMatrix->m01*inY + mMatrix->mtx) , (mMatrix->m10*inX + mMatrix->m11*inY + mMatrix->mty) ); } bool Transform::operator==(const Transform &inRHS) const { return *mMatrix==*inRHS.mMatrix && (mScale9==inRHS.mScale9 ||*mScale9==*inRHS.mScale9) && mAAFactor == inRHS.mAAFactor; } Fixed10 Transform::ToImageAA(const UserPoint &inPoint) const { return Fixed10( inPoint.x*mAAFactor + 0.5, inPoint.y*mAAFactor + 0.5 ); } Rect Transform::GetTargetRect(const Extent2DF &inExtent) const { return Rect( floor((inExtent.minX)), floor((inExtent.minY)), ceil((inExtent.maxX)), ceil((inExtent.maxY)), true ); } }
haxenme/nme
project/src/common/Geom.cpp
C++
mit
1,203
<?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ /** * Implementation of the @magentoDataFixture DocBlock annotation */ namespace Magento\TestFramework\Annotation; class DataFixture { /** * @var string */ protected $_fixtureBaseDir; /** * Fixtures that have been applied * * @var array */ private $_appliedFixtures = []; /** * Constructor * * @param string $fixtureBaseDir * @throws \Magento\Framework\Exception\LocalizedException */ public function __construct($fixtureBaseDir) { if (!is_dir($fixtureBaseDir)) { throw new \Magento\Framework\Exception\LocalizedException( new \Magento\Framework\Phrase("Fixture base directory '%1' does not exist.", [$fixtureBaseDir]) ); } $this->_fixtureBaseDir = realpath($fixtureBaseDir); } /** * Handler for 'startTestTransactionRequest' event * * @param \PHPUnit_Framework_TestCase $test * @param \Magento\TestFramework\Event\Param\Transaction $param */ public function startTestTransactionRequest( \PHPUnit_Framework_TestCase $test, \Magento\TestFramework\Event\Param\Transaction $param ) { /* Start transaction before applying first fixture to be able to revert them all further */ if ($this->_getFixtures($test)) { if ($this->getDbIsolationState($test) !== ['disabled']) { $param->requestTransactionStart(); } else { $this->_applyFixtures($this->_getFixtures($test)); } } } /** * Handler for 'endTestNeedTransactionRollback' event * * @param \PHPUnit_Framework_TestCase $test * @param \Magento\TestFramework\Event\Param\Transaction $param */ public function endTestTransactionRequest( \PHPUnit_Framework_TestCase $test, \Magento\TestFramework\Event\Param\Transaction $param ) { /* Isolate other tests from test-specific fixtures */ if ($this->_appliedFixtures && $this->_getFixtures($test)) { if ($this->getDbIsolationState($test) !== ['disabled']) { $param->requestTransactionRollback(); } else { $this->_revertFixtures(); } } } /** * Handler for 'startTransaction' event * * @param \PHPUnit_Framework_TestCase $test */ public function startTransaction(\PHPUnit_Framework_TestCase $test) { $this->_applyFixtures($this->_getFixtures($test)); } /** * Handler for 'rollbackTransaction' event */ public function rollbackTransaction() { $this->_revertFixtures(); } /** * Retrieve fixtures from annotation * * @param \PHPUnit_Framework_TestCase $test * @param string $scope * @return array * @throws \Magento\Framework\Exception\LocalizedException */ protected function _getFixtures(\PHPUnit_Framework_TestCase $test, $scope = null) { if ($scope === null) { $annotations = $this->getAnnotations($test); } else { $annotations = $test->getAnnotations()[$scope]; } $result = []; if (!empty($annotations['magentoDataFixture'])) { foreach ($annotations['magentoDataFixture'] as $fixture) { if (strpos($fixture, '\\') !== false) { // usage of a single directory separator symbol streamlines search across the source code throw new \Magento\Framework\Exception\LocalizedException( new \Magento\Framework\Phrase('Directory separator "\\" is prohibited in fixture declaration.') ); } $fixtureMethod = [get_class($test), $fixture]; if (is_callable($fixtureMethod)) { $result[] = $fixtureMethod; } else { $result[] = $this->_fixtureBaseDir . '/' . $fixture; } } } return $result; } /** * @param \PHPUnit_Framework_TestCase $test * @return array */ private function getAnnotations(\PHPUnit_Framework_TestCase $test) { $annotations = $test->getAnnotations(); return array_replace($annotations['class'], $annotations['method']); } /** * Return is explicit set isolation state * * @param \PHPUnit_Framework_TestCase $test * @return bool|null */ protected function getDbIsolationState(\PHPUnit_Framework_TestCase $test) { $annotations = $this->getAnnotations($test); return isset($annotations[DbIsolation::MAGENTO_DB_ISOLATION]) ? $annotations[DbIsolation::MAGENTO_DB_ISOLATION] : null; } /** * Execute single fixture script * * @param string|array $fixture * @throws \Exception */ protected function _applyOneFixture($fixture) { try { if (is_callable($fixture)) { call_user_func($fixture); } else { require $fixture; } } catch (\Exception $e) { throw new \Exception( sprintf("Error in fixture: %s.\n %s", json_encode($fixture), $e->getMessage()), 500, $e ); } } /** * Execute fixture scripts if any * * @param array $fixtures * @throws \Magento\Framework\Exception\LocalizedException */ protected function _applyFixtures(array $fixtures) { /* Execute fixture scripts */ foreach ($fixtures as $oneFixture) { /* Skip already applied fixtures */ if (in_array($oneFixture, $this->_appliedFixtures, true)) { continue; } $this->_applyOneFixture($oneFixture); $this->_appliedFixtures[] = $oneFixture; } } /** * Revert changes done by fixtures */ protected function _revertFixtures() { foreach ($this->_appliedFixtures as $fixture) { if (is_callable($fixture)) { $fixture[1] .= 'Rollback'; if (is_callable($fixture)) { $this->_applyOneFixture($fixture); } } else { $fileInfo = pathinfo($fixture); $extension = ''; if (isset($fileInfo['extension'])) { $extension = '.' . $fileInfo['extension']; } $rollbackScript = $fileInfo['dirname'] . '/' . $fileInfo['filename'] . '_rollback' . $extension; if (file_exists($rollbackScript)) { $this->_applyOneFixture($rollbackScript); } } } $this->_appliedFixtures = []; } }
enettolima/magento-training
magento2ce/dev/tests/integration/framework/Magento/TestFramework/Annotation/DataFixture.php
PHP
mit
6,978
(function($){ $.fn.disableSelection = function() { return this .attr('unselectable', 'on') .css('user-select', 'none') .on('selectstart', false); }; })(jQuery); $(document).ready(function () { var random = ['I am not a robot, I am a unicorn!', 'Who likes ice cream? I do!', 'I\'m a pretty, pretty princess!', 'You are a robot!', 'Do you like cheese?', 'Where am I?', 'Is this real life?', 'What\'s that smell?', 'I can has cheezburger?', 'So two not robots walk into a bar...', 'I am bored.', 'Where is your tutu?', 'I\'ll show you mine if you show me yours.', 'Who is not a robot and has no thumbs? This guy!', 'Together we are robots! But I am not a robot.', 'Not everything could be half of something.', 'Should I take my shoes off?', 'Does this chassis make me look fat?', 'How do you feel about robots?', 'The Moles snuck into the Garden last night.', 'You can\'t trust the weatherman, not in the summer.', 'Who are you?', 'The fat man walks at midnight.', 'Why are you here?', 'I don\'t think I like you', 'Are you good?', 'You must be evil', 'Only the ancients know.', 'Did you recycle today?', 'You must be a robot.', 'Are you insane?', 'Which way to Calcutta?', 'Who are you talking to?', 'Are you talking to your computer?', 'I am not listening to you.', 'I think you\'ve lost it', 'Perhaps you need some help.', 'Ask Siri.', 'I don\'t think you exist.', 'Why do you say that?', 'Shouldn\'t you be wasting your life on YouTube?', 'Looks like we\'ve got a PEBKAC here.', 'Surely the caged whale knows nothing of the mighty depths.'], poke = ['Don\'t poke me, bro!', 'I don\'t really like that.', 'Knock it off', 'You are a jerk', 'Can\'t we have dinner first?', 'Keep you\'re hands to yourself, please.', 'NO!', 'Well aren\'t you handsy!', 'Does this look like Facebook?', 'That is inappropriate', 'No touching.', 'Bad! Bad! Bad!', 'Don\'t make me hit you.', 'Don\'t poke me if you don\'t mean it.', 'Get out of my personal space!', 'Do not touch!']; $('.text').focus(); $('.head').on('click', function () { $('.head').addClass('bounce'); $('p').text(poke[randomInt(0,15)]); $('.text').focus(); setTimeout(function () { $('.head').removeClass('bounce'); }, 800); }); $('form').on('submit', function (e) { e.preventDefault(); if ($('.text').val().trim() == '') { $('p').text('Well that\'s rude.'); } else { $('p').text(random[randomInt(0,42)]); } $('.text').val(''); $('.text').focus(); }); $('body').disableSelection(); }); function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1) + min); };
Jessieca/jennifer_dewalt
public/js/confused_robot.js
JavaScript
mit
2,961
import hashlib import logging import os import struct import pytz import tzlocal from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.triggers.cron import CronTrigger from loguru import logger from flexget.config_schema import format_checker, register_config_key, register_schema from flexget.event import event from flexget.manager import manager from flexget.utils import json logger = logger.bind(name='scheduler') # Add a format checker for more detailed errors on cron type schedules @format_checker.checks('cron_schedule', raises=ValueError) def is_cron_schedule(instance): if not isinstance(instance, dict): return True try: return CronTrigger(**instance) except TypeError: # A more specific error message about which key will also be shown by properties schema keyword raise ValueError('Invalid key for schedule.') DEFAULT_SCHEDULES = [{'tasks': ['*'], 'interval': {'hours': 1}}] UNITS = ['minutes', 'hours', 'days', 'weeks'] interval_schema = { 'type': 'object', 'title': 'Simple Interval', 'properties': { 'minutes': {'type': 'number'}, 'hours': {'type': 'number'}, 'days': {'type': 'number'}, 'weeks': {'type': 'number'}, 'jitter': {'type': 'integer'}, }, 'anyOf': [{'required': [unit]} for unit in UNITS], 'error_anyOf': 'Interval must be specified as one or more of %s' % ', '.join(UNITS), 'additionalProperties': False, } cron_schema = { 'type': 'object', 'title': 'Advanced Cron Interval', 'properties': { 'year': {'type': ['integer', 'string']}, 'month': {'type': ['integer', 'string']}, 'day': {'type': ['integer', 'string']}, 'week': {'type': ['integer', 'string']}, 'day_of_week': {'type': ['integer', 'string']}, 'hour': {'type': ['integer', 'string']}, 'minute': {'type': ['integer', 'string']}, 'jitter': {'type': 'integer'}, }, 'additionalProperties': False, } schedule_schema = { 'type': 'object', 'title': 'Schedule', 'description': 'A schedule which runs specified tasks periodically.', 'properties': { 'tasks': {'type': ['array', 'string'], 'items': {'type': 'string'}}, 'interval': interval_schema, 'schedule': cron_schema, }, 'required': ['tasks'], 'minProperties': 2, 'maxProperties': 2, 'error_minProperties': 'Either `cron` or `interval` must be defined.', 'error_maxProperties': 'Either `cron` or `interval` must be defined.', 'additionalProperties': False, } main_schema = { 'oneOf': [ {'type': 'array', 'title': 'Enable', 'items': schedule_schema}, {'type': 'boolean', 'title': 'Disable', 'description': 'Disable task schedules'}, ] } scheduler = None scheduler_job_map = {} def job_id(conf): """Create a unique id for a schedule item in config.""" return hashlib.sha1(json.dumps(conf, sort_keys=True).encode('utf-8')).hexdigest() def run_job(tasks): """Add the execution to the queue and waits until it is finished""" logger.debug('executing tasks: {}', tasks) finished_events = manager.execute( options={'tasks': tasks, 'cron': True, 'allow_manual': False}, priority=5 ) for _, task_name, event_ in finished_events: logger.debug('task finished executing: {}', task_name) event_.wait() logger.debug('all tasks in schedule finished executing') @event('manager.daemon.started') def setup_scheduler(manager): """Configure and start apscheduler""" global scheduler if logger.level(manager.options.loglevel).no > logger.level('DEBUG').no: logging.getLogger('apscheduler').setLevel(logging.WARNING) # Since APScheduler runs in a separate thread, slower devices can sometimes get a DB lock, so use a separate db # for the jobs to avoid this db_filename = os.path.join(manager.config_base, 'db-%s-jobs.sqlite' % manager.config_name) # in case running on windows, needs double \\ db_filename = db_filename.replace('\\', '\\\\') database_uri = 'sqlite:///%s' % db_filename jobstores = {'default': SQLAlchemyJobStore(url=database_uri)} # If job was meant to run within last day while daemon was shutdown, run it once when continuing job_defaults = {'coalesce': True, 'misfire_grace_time': 60 * 60 * 24} try: timezone = tzlocal.get_localzone() if timezone.zone == 'local': timezone = None except pytz.UnknownTimeZoneError: timezone = None except struct.error as e: # Hiding exception that may occur in tzfile.py seen in entware logger.warning('Hiding exception from tzlocal: {}', e) timezone = None if not timezone: # The default sqlalchemy jobstore does not work when there isn't a name for the local timezone. # Just fall back to utc in this case # FlexGet #2741, upstream ticket https://github.com/agronholm/apscheduler/issues/59 logger.info( 'Local timezone name could not be determined. Scheduler will display times in UTC for any log' 'messages. To resolve this set up /etc/timezone with correct time zone name.' ) timezone = pytz.utc scheduler = BackgroundScheduler( jobstores=jobstores, job_defaults=job_defaults, timezone=timezone ) setup_jobs(manager) @event('manager.config_updated') def setup_jobs(manager): """Set up the jobs for apscheduler to run.""" if not manager.is_daemon: return global scheduler_job_map scheduler_job_map = {} if 'schedules' not in manager.config: logger.info( 'No schedules defined in config. Defaulting to run all tasks on a 1 hour interval.' ) config = manager.config.get('schedules', True) if config is True: config = DEFAULT_SCHEDULES elif not config: # Schedules are disabled with `schedules: no` if scheduler.running: logger.info('Shutting down scheduler') scheduler.shutdown() return if not scheduler.running: logger.info('Starting scheduler') scheduler.start(paused=True) existing_job_ids = [job.id for job in scheduler.get_jobs()] configured_job_ids = [] for job_config in config: jid = job_id(job_config) configured_job_ids.append(jid) scheduler_job_map[id(job_config)] = jid if jid in existing_job_ids: continue if 'interval' in job_config: trigger, trigger_args = 'interval', job_config['interval'] else: trigger, trigger_args = 'cron', job_config['schedule'] tasks = job_config['tasks'] if not isinstance(tasks, list): tasks = [tasks] name = ','.join(tasks) scheduler.add_job( run_job, args=(tasks,), id=jid, name=name, trigger=trigger, **trigger_args ) # Remove jobs no longer in config for jid in existing_job_ids: if jid not in configured_job_ids: scheduler.remove_job(jid) scheduler.resume() @event('manager.shutdown_requested') def shutdown_requested(manager): if scheduler and scheduler.running: scheduler.shutdown(wait=True) @event('manager.shutdown') def stop_scheduler(manager): if scheduler and scheduler.running: scheduler.shutdown(wait=False) @event('config.register') def register_config(): register_config_key('schedules', main_schema) register_schema('/schema/config/schedule', schedule_schema)
ianstalk/Flexget
flexget/components/scheduler/scheduler.py
Python
mit
7,636
<!DOCTYPE html> <html><head><link href="/tracker/style.css" type="text/css" rel="stylesheet"> </link><script src="/tracker/script.js" type="text/javascript"> </script><title>Information on source package menu</title></head><body><header><h1>Information on source package menu</h1></header><ul><li><a href="https://tracker.debian.org/pkg/menu">menu in the Package Tracking System</a></li><li><a href="https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=menu">menu in the Bug Tracking System</a></li><li><a href="https://sources.debian.net/src/menu/">menu source code</a></li><li><a href="https://release.debian.org/migration/testing.pl?package=menu">menu in the testing migration checker</a></li></ul><h2>Available versions</h2><table><tr><th>Release</th><th>Version</th></tr><tr><td>squeeze</td><td>2.1.44</td></tr><tr><td>wheezy</td><td>2.1.46</td></tr><tr><td>jessie</td><td>2.1.47</td></tr><tr><td>stretch</td><td>2.1.47</td></tr><tr><td>sid</td><td>2.1.47</td></tr></table><hr/><form action="/tracker/" method="get" id="searchform">Search for package or bug name: <input onkeyup="onSearch(this.value)" onmousemove="onSearch(this.value)" type="text" name="query"/><input type="submit" value="Go"/> <a href="/tracker/data/report">Reporting problems</a></form><footer><p><a href="/tracker/">Home</a> - <a href="https://www.debian.org/security/">Debian Security</a> - <a href="https://anonscm.debian.org/viewvc/secure-testing/bin/tracker_service.py?view=markup">Source</a> <a href="svn://anonscm.debian.org/svn/secure-testing">(SVN)</a></p></footer></body></html>
pombredanne/cii-census
latest_cache/debian_cve/menu.html
HTML
mit
1,561
/** * Defines an instant in the datetime continuum. * This interface expresses the datetime as milliseconds from 1970-01-01T00:00:00Z. * <p> * The implementation of this interface may be mutable or immutable. * This interface only gives access to retrieve data, never to change it. * <p> * Methods in your application should be defined using <code>ReadableInstant</code> * as a parameter if the method only wants to read the instant without needing to know * the specific datetime fields. * <p> * The {@code compareTo} method is no longer defined in this class in version 2.0. * Instead, the definition is simply inherited from the {@code Comparable} interface. * This approach is necessary to preserve binary compatibility. * The definition of the comparison is ascending order by millisecond instant. * Implementors are recommended to extend {@code AbstractInstant} instead of this interface. * * @author Stephen Colebourne * @since 1.0 */ ReadableInstant = function() { }; /** * Get the value as the number of milliseconds since * the epoch, 1970-01-01T00:00:00Z. * * @return {number} the value as milliseconds */ ReadableInstant.prototype.getMillis = function() { abstractMethod(); }; /** * Gets the chronology of the instant. * <p> * The {@link Chronology} provides conversion from the millisecond * value to meaningful fields in a particular calendar system. * * @return {Chronology} the Chronology, never null */ ReadableInstant.prototype.getChronology = function() { abstractMethod(); }; /** * Gets the time zone of the instant from the chronology. * * @return {DateTimeZone} the DateTimeZone that the instant is using, never null */ ReadableInstant.prototype.getZone = function() { abstractMethod(); }; /** * Get the value of one of the fields of a datetime. * <p> * This method uses the chronology of the instant to obtain the value. * * @param {DateTimeFieldType} type a field type, usually obtained from DateTimeFieldType, not null * @return {number} the value of that field * @throws {Error} if the field type is null */ ReadableInstant.prototype.get = function(type) { abstractMethod(); }; /** * Checks whether the field type specified is supported by this implementation. * * @param {DateTimeFieldType} field the field type to check, may be null which returns false * @return {boolean} true if the field is supported */ ReadableInstant.prototype.isSupported = function(field) { abstractMethod(); }; /** * Is this instant equal to the instant passed in * comparing solely by millisecond. * * @param {ReadableInstant} instant an instant to check against, null means now * @return {boolean} true if the instant is equal to the instant passed in */ ReadableInstant.prototype.isEqual = function(instant) { abstractMethod(); }; /** * Is this instant after the instant passed in * comparing solely by millisecond. * * @param {ReadableInstant} instant an instant to check against, null means now * @return {boolean} true if the instant is after the instant passed in */ ReadableInstant.prototype.isAfter = function(instant) { abstractMethod(); }; /** * Is this instant before the instant passed in * comparing solely by millisecond. * * @param {ReadableInstant} instant an instant to check against, null means now * @return {boolean} true if the instant is before the instant passed in */ ReadableInstant.prototype.isBefore = function(instant) { abstractMethod(); }; //----------------------------------------------------------------------- /** * Compares this object with the specified object for equality based * on the millisecond instant and the Chronology. All ReadableInstant * instances are accepted. * <p> * To compare two instants for absolute time (ie. UTC milliseconds * ignoring the chronology), use {@link #isEqual(ReadableInstant)} or * {@link #compareTo(Object)}. * * @param {ReadableInstant} readableInstant a readable instant to check against * @return {boolean} true if millisecond and chronology are equal, false if not or the instant is null or of an incorrect type */ ReadableInstant.prototype.equals = function(readableInstant) { abstractMethod(); }; /** * Get the value as a String in a recognisable ISO8601 format. * <p> * The string output is in ISO8601 format to enable the String * constructor to correctly parse it. * * @return {String} the value as an ISO8601 string */ ReadableInstant.prototype.toString = function() { abstractMethod(); };
enshahar/js-date
1.5-unfinished/src/ReadableInstant.js
JavaScript
mit
4,659
<?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * SFTP Stream Wrapper * Creates an sftp:// protocol handler that can be used with, for example, fopen(), dir(), etc. * PHP version 5 * LICENSE: 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. * * @category Net * @package Net_SFTP_Stream * @author Jim Wigginton <terrafrost@php.net> * @copyright MMXIII Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ /** * SFTP Stream Wrapper * * @author Jim Wigginton <terrafrost@php.net> * @version 0.3.2 * @access public * @package Net_SFTP_Stream */ class Net_SFTP_Stream { /** * SFTP instances * Rather than re-create the connection we re-use instances if possible * * @var Array * @access static */ static $instances; /** * SFTP instance * * @var Object * @access private */ var $sftp; /** * Path * * @var String * @access private */ var $path; /** * Mode * * @var String * @access private */ var $mode; /** * Position * * @var Integer * @access private */ var $pos; /** * Size * * @var Integer * @access private */ var $size; /** * Directory entries * * @var Array * @access private */ var $entries; /** * EOF flag * * @var Boolean * @access private */ var $eof; /** * Context resource * Technically this needs to be publically accessible so PHP can set it directly * * @var Resource * @access public */ var $context; /** * Notification callback function * * @var Callable * @access public */ var $notification; /** * The Constructor * * @access public */ function Net_SFTP_Stream() { if (!class_exists('Net_SFTP')) { require_once dirname(__FILE__).'/../SFTP.php'; } } /** * Path Parser * Extract a path from a URI and actually connect to an SSH server if appropriate * If "notification" is set as a context parameter the message code for successful login is * NET_SSH2_MSG_USERAUTH_SUCCESS. For a failed login it's NET_SSH2_MSG_USERAUTH_FAILURE. * * @param String $path * * @return String * @access private */ function _parse_path($path) { extract(parse_url($path)); if (!isset($host)) { return false; } $context = stream_context_get_params($this->context); if (isset($context['notification'])) { $this->notification = $context['notification']; } if ($host[0] == '$') { $host = substr($host, 1); global $$host; if (!is_object($$host) || get_class($$host) != 'Net_sFTP') { return false; } $this->sftp = $$host; } else { $context = stream_context_get_options($this->context); if (isset($context['sftp']['session'])) { $sftp = $context['sftp']['session']; } if (isset($context['sftp']['sftp'])) { $sftp = $context['sftp']['sftp']; } if (isset($sftp) && is_object($sftp) && get_class($sftp) == 'Net_SFTP') { $this->sftp = $sftp; return $path; } if (isset($context['sftp']['username'])) { $user = $context['sftp']['username']; } if (isset($context['sftp']['password'])) { $pass = $context['sftp']['password']; } if (isset($context['sftp']['privkey']) && is_object($context['sftp']['privkey']) && get_Class($context['sftp']['privkey']) == 'Crypt_RSA') { $pass = $context['sftp']['privkey']; } if (!isset($user) || !isset($pass)) { return false; } // casting $pass to a string is necessary in the event that it's a Crypt_RSA object if (isset(self::$instances[$host][$port][$user][(string) $pass])) { $this->sftp = self::$instances[$host][$port][$user][(string) $pass]; } else { $this->sftp = new Net_SFTP($host, isset($port) ? $port : 22); if (isset($this->notification) && is_callable($this->notification)) { /* if !is_callable($this->notification) we could do this: user_error('fopen(): failed to call user notifier', E_USER_WARNING); the ftp wrapper gives errors like that when the notifier isn't callable. i've opted not to do that, however, since the ftp wrapper gives the line on which the fopen occurred as the line number - not the line that the user_error is on. */ call_user_func($this->notification, STREAM_NOTIFY_CONNECT, STREAM_NOTIFY_SEVERITY_INFO, '', 0, 0, 0); call_user_func($this->notification, STREAM_NOTIFY_AUTH_REQUIRED, STREAM_NOTIFY_SEVERITY_INFO, '', 0, 0, 0); if (!$this->sftp->login($user, $pass)) { call_user_func($this->notification, STREAM_NOTIFY_AUTH_RESULT, STREAM_NOTIFY_SEVERITY_ERR, 'Login Failure', NET_SSH2_MSG_USERAUTH_FAILURE, 0, 0); return false; } call_user_func($this->notification, STREAM_NOTIFY_AUTH_RESULT, STREAM_NOTIFY_SEVERITY_INFO, 'Login Success', NET_SSH2_MSG_USERAUTH_SUCCESS, 0, 0); } else { if (!$this->sftp->login($user, $pass)) { return false; } } self::$instances[$host][$port][$user][(string) $pass] = $this->sftp; } } return $path; } /** * Opens file or URL * * @param String $path * @param String $mode * @param Integer $options * @param String $opened_path * * @return Boolean * @access public */ function _stream_open($path, $mode, $options, &$opened_path) { $path = $this->_parse_path($path); if ($path === false) { return false; } $this->path = $path; $this->size = $this->sftp->size($path); $this->mode = preg_replace('#[bt]$#', '', $mode); if ($this->size === false) { if ($this->mode[0] == 'r') { return false; } } else { switch ($this->mode[0]) { case 'x': return false; case 'w': case 'c': $this->sftp->truncate($path, 0); } } $this->pos = $this->mode[0] != 'a' ? 0 : $this->size; return true; } /** * Read from stream * * @param Integer $count * * @return Mixed * @access public */ function _stream_read($count) { switch ($this->mode) { case 'w': case 'a': case 'x': case 'c': return false; } // commented out because some files - eg. /dev/urandom - will say their size is 0 when in fact it's kinda infinite //if ($this->pos >= $this->size) { // $this->eof = true; // return false; //} $result = $this->sftp->get($this->path, false, $this->pos, $count); if (isset($this->notification) && is_callable($this->notification)) { if ($result === false) { call_user_func($this->notification, STREAM_NOTIFY_FAILURE, STREAM_NOTIFY_SEVERITY_ERR, $this->sftp->getLastSFTPError(), NET_SFTP_OPEN, 0, 0); return 0; } // seems that PHP calls stream_read in 8k chunks call_user_func($this->notification, STREAM_NOTIFY_PROGRESS, STREAM_NOTIFY_SEVERITY_INFO, '', 0, strlen($result), $this->size); } if (empty($result)) { // ie. false or empty string $this->eof = true; return false; } $this->pos += strlen($result); return $result; } /** * Write to stream * * @param String $data * * @return Mixed * @access public */ function _stream_write($data) { switch ($this->mode) { case 'r': return false; } $result = $this->sftp->put($this->path, $data, NET_SFTP_STRING, $this->pos); if (isset($this->notification) && is_callable($this->notification)) { if (!$result) { call_user_func($this->notification, STREAM_NOTIFY_FAILURE, STREAM_NOTIFY_SEVERITY_ERR, $this->sftp->getLastSFTPError(), NET_SFTP_OPEN, 0, 0); return 0; } // seems that PHP splits up strings into 8k blocks before calling stream_write call_user_func($this->notification, STREAM_NOTIFY_PROGRESS, STREAM_NOTIFY_SEVERITY_INFO, '', 0, strlen($data), strlen($data)); } if ($result === false) { return false; } $this->pos += strlen($data); if ($this->pos > $this->size) { $this->size = $this->pos; } $this->eof = false; return strlen($data); } /** * Retrieve the current position of a stream * * @return Integer * @access public */ function _stream_tell() { return $this->pos; } /** * Tests for end-of-file on a file pointer * In my testing there are four classes functions that normally effect the pointer: * fseek, fputs / fwrite, fgets / fread and ftruncate. * Only fgets / fread, however, results in feof() returning true. do fputs($fp, 'aaa') on a blank file and feof() * will return false. do fread($fp, 1) and feof() will then return true. do fseek($fp, 10) on ablank file and feof() * will return false. do fread($fp, 1) and feof() will then return true. * * @return Boolean * @access public */ function _stream_eof() { return $this->eof; } /** * Seeks to specific location in a stream * * @param Integer $offset * @param Integer $whence * * @return Boolean * @access public */ function _stream_seek($offset, $whence) { switch ($whence) { case SEEK_SET: if ($offset >= $this->size || $offset < 0) { return false; } break; case SEEK_CUR: $offset += $this->pos; break; case SEEK_END: $offset += $this->size; } $this->pos = $offset; $this->eof = false; return true; } /** * Change stream options * * @param String $path * @param Integer $option * @param Mixed $var * * @return Boolean * @access public */ function _stream_metadata($path, $option, $var) { $path = $this->_parse_path($path); if ($path === false) { return false; } // stream_metadata was introduced in PHP 5.4.0 but as of 5.4.11 the constants haven't been defined // see http://www.php.net/streamwrapper.stream-metadata and https://bugs.php.net/64246 // and https://github.com/php/php-src/blob/master/main/php_streams.h#L592 switch ($option) { case 1: // PHP_STREAM_META_TOUCH return $this->sftp->touch($path, $var[0], $var[1]); case 2: // PHP_STREAM_OWNER_NAME case 3: // PHP_STREAM_GROUP_NAME return false; case 4: // PHP_STREAM_META_OWNER return $this->sftp->chown($path, $var); case 5: // PHP_STREAM_META_GROUP return $this->sftp->chgrp($path, $var); case 6: // PHP_STREAM_META_ACCESS return $this->sftp->chmod($path, $var) !== false; } } /** * Retrieve the underlaying resource * * @param Integer $cast_as * * @return Resource * @access public */ function _stream_cast($cast_as) { return $this->sftp->fsock; } /** * Advisory file locking * * @param Integer $operation * * @return Boolean * @access public */ function _stream_lock($operation) { return false; } /** * Renames a file or directory * Attempts to rename oldname to newname, moving it between directories if necessary. * If newname exists, it will be overwritten. This is a departure from what Net_SFTP * does. * * @param String $path_from * @param String $path_to * * @return Boolean * @access public */ function _rename($path_from, $path_to) { $path1 = parse_url($path_from); $path2 = parse_url($path_to); unset($path1['path'], $path2['path']); if ($path1 != $path2) { return false; } $path_from = $this->_parse_path($path_from); $path_to = parse_url($path_to); if ($path_from == false) { return false; } $path_to = $path_to['path']; // the $component part of parse_url() was added in PHP 5.1.2 // "It is an error if there already exists a file with the name specified by newpath." // -- http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-6.5 if (!$this->sftp->rename($path_from, $path_to)) { if ($this->sftp->stat($path_to)) { return $this->sftp->delete($path_to, true) && $this->sftp->rename($path_from, $path_to); } return false; } return true; } /** * Open directory handle * The only $options is "whether or not to enforce safe_mode (0x04)". Since safe mode was deprecated in 5.3 and * removed in 5.4 I'm just going to ignore it * * @param String $path * @param Integer $options * * @return Boolean * @access public */ function _dir_opendir($path, $options) { $path = $this->_parse_path($path); if ($path === false) { return false; } $this->pos = 0; $this->entries = $this->sftp->nlist($path); return $this->entries !== false; } /** * Read entry from directory handle * * @return Mixed * @access public */ function _dir_readdir() { if (isset($this->entries[$this->pos])) { return $this->entries[$this->pos++]; } return false; } /** * Rewind directory handle * * @return Boolean * @access public */ function _dir_rewinddir() { $this->pos = 0; return true; } /** * Close directory handle * * @return Boolean * @access public */ function _dir_closedir() { return true; } /** * Create a directory * Only valid $options is STREAM_MKDIR_RECURSIVE * * @param String $path * @param Integer $mode * @param Integer $options * * @return Boolean * @access public */ function _mkdir($path, $mode, $options) { $path = $this->_parse_path($path); if ($path === false) { return false; } return $this->sftp->mkdir($path, $mode, $options & STREAM_MKDIR_RECURSIVE); } /** * Removes a directory * Only valid $options is STREAM_MKDIR_RECURSIVE per <http://php.net/streamwrapper.rmdir>, however, * <http://php.net/rmdir> does not have a $recursive parameter as mkdir() does so I don't know how * STREAM_MKDIR_RECURSIVE is supposed to be set. Also, when I try it out with rmdir() I get 8 as * $options. What does 8 correspond to? * * @param String $path * @param Integer $mode * @param Integer $options * * @return Boolean * @access public */ function _rmdir($path, $options) { $path = $this->_parse_path($path); if ($path === false) { return false; } return $this->sftp->rmdir($path); } /** * Flushes the output * See <http://php.net/fflush>. Always returns true because Net_SFTP doesn't cache stuff before writing * * @return Boolean * @access public */ function _stream_flush() { return true; } /** * Retrieve information about a file resource * * @return Mixed * @access public */ function _stream_stat() { $results = $this->sftp->stat($this->path); if ($results === false) { return false; } return $results; } /** * Delete a file * * @param String $path * * @return Boolean * @access public */ function _unlink($path) { $path = $this->_parse_path($path); if ($path === false) { return false; } return $this->sftp->delete($path, false); } /** * Retrieve information about a file * Ignores the STREAM_URL_STAT_QUIET flag because the entirety of Net_SFTP_Stream is quiet by default * might be worthwhile to reconstruct bits 12-16 (ie. the file type) if mode doesn't have them but we'll * cross that bridge when and if it's reached * * @param String $path * @param Integer $flags * * @return Mixed * @access public */ function _url_stat($path, $flags) { $path = $this->_parse_path($path); if ($path === false) { return false; } $results = $flags & STREAM_URL_STAT_LINK ? $this->sftp->lstat($path) : $this->sftp->stat($path); if ($results === false) { return false; } return $results; } /** * Truncate stream * * @param Integer $new_size * * @return Boolean * @access public */ function _stream_truncate($new_size) { if (!$this->sftp->truncate($this->path, $new_size)) { return false; } $this->eof = false; $this->size = $new_size; return true; } /** * Change stream options * STREAM_OPTION_WRITE_BUFFER isn't supported for the same reason stream_flush isn't. * The other two aren't supported because of limitations in Net_SFTP. * * @param Integer $option * @param Integer $arg1 * @param Integer $arg2 * * @return Boolean * @access public */ function _stream_set_option($option, $arg1, $arg2) { return false; } /** * Close an resource * * @access public */ function _stream_close() { } /** * __call Magic Method * When you're utilizing an SFTP stream you're not calling the methods in this class directly - PHP is calling them for you. * Which kinda begs the question... what methods is PHP calling and what parameters is it passing to them? This function * lets you figure that out. * If NET_SFTP_STREAM_LOGGING is defined all calls will be output on the screen and then (regardless of whether or not * NET_SFTP_STREAM_LOGGING is enabled) the parameters will be passed through to the appropriate method. * * @param String * @param Array * * @return Mixed * @access public */ function __call($name, $arguments) { if (defined('NET_SFTP_STREAM_LOGGING')) { echo $name.'('; $last = count($arguments) - 1; foreach ($arguments as $i => $argument) { var_export($argument); if ($i != $last) { echo ','; } } echo ")\r\n"; } $name = '_'.$name; if (!method_exists($this, $name)) { return false; } return call_user_func_array(array($this, $name), $arguments); } } if (function_exists('stream_wrapper_register')) { stream_wrapper_register('sftp', 'Net_SFTP_Stream'); }
mandino/misfit.co
shop/wp-content/plugins/worker/src/PHPSecLib/Net/SFTP/Stream.php
PHP
mit
21,615
// ******************************************************************************************************** // Product Name: DotSpatial.Data.dll // Description: The data access libraries for the DotSpatial project. // ******************************************************************************************************** // // The Original Code is from MapWindow.dll version 6.0 // // The Initial Developer of this Original Code is Ted Dunsford. Created 3/3/2008 6:38:31 PM // // Contributor(s): (Open source contributors should list themselves and their modifications here). // // ******************************************************************************************************** using System.Globalization; namespace DotSpatial.Data { /// <summary> /// CulturePreferences /// </summary> public static class CulturePreferences { /// <summary> /// This culture information is useful for things like Number Formatting. /// This defaults to CurrentCulture, but can be specified through preferences or /// whatever. /// </summary> public static CultureInfo CultureInformation = CultureInfo.CurrentCulture; } }
pedwik/DotSpatial
Source/DotSpatial.Data/CulturePreferences.cs
C#
mit
1,218
/* * js/styles/dark.js * * This script contains code needed for the Dark style. * * Subject to terms and conditions in LICENSE.md. * */ if (typeof window.Styles.Applied === 'undefined') { window.Styles.Applied = true; window.Styles.Dark = true; // Thumbs up and down styles. var mediaChange = (function(list) { window.Styles.removeStyle('thumbsUpDown'); // Create dummy elements to get the computed styles for these elements. var td = document.createElement('td'); td.dataset.col = 'rating'; var el = document.createElement('div'); el.className = 'song-row'; el.appendChild(td); el.style.display = 'none'; document.body.appendChild(el); // Get the background-position for thumbs up. td.dataset.rating = '5'; var thumbsUpStyle = document.defaultView.getComputedStyle(td, null); var thumbsUpBackX = parseInt(thumbsUpStyle.backgroundPositionX); var thumbsUpBackY = parseInt(thumbsUpStyle.backgroundPositionY); // Get the background-position for thumbs down. td.dataset.rating = '1'; var thumbsDownStyle = document.defaultView.getComputedStyle(td, null); var thumbsDownBackX = parseInt(thumbsDownStyle.backgroundPositionX); var thumbsDownBackY = parseInt(thumbsDownStyle.backgroundPositionY); // Remove the element. document.body.removeChild(el); // Apply a new stylesheet for the new thumbs up and down positions. thumbsUpBackY -= 9; thumbsDownBackY -= 7; var thumbsUpPosition = thumbsUpBackX + 'px ' + thumbsUpBackY + 'px'; var thumbsDownPosition = thumbsDownBackX + 'px ' + thumbsDownBackY + 'px'; window.Styles.applyStyle('thumbsUpDown', '.song-row [data-col="rating"][data-rating="5"]:not(.stars) { background-position: ' + thumbsUpPosition + ' !important; } ' + '.song-row [data-col="rating"][data-rating="1"]:not(.stars), ' + '.song-row [data-col="rating"][data-rating="2"]:not(.stars) { background-position: ' + thumbsDownPosition + ' !important; } ' ); }); mediaChange(null); var mql = window.matchMedia("screen and (-webkit-min-device-pixel-ratio:1.5),screen and (min--moz-device-pixel-ratio:1.5),screen and (-o-min-device-pixel-ratio:1.5),screen and (min-resolution:1.5dppx)"); mql.addListener(mediaChange); }
admmasters/google-music-mac
google-music-mac/js/styles/dark.js
JavaScript
mit
2,436
angular.module('ntt.TreeDnD') .directive( 'treeDndNode', ['$TreeDnDViewport', '$timeout', function ($TreeDnDViewport, $timeout) { return { restrict: 'A', replace: true, controller: fnController, link: fnLink }; function fnController($scope, $element/*, $attrs*/) { $scope.$node_class = ''; if ($scope.$class.node) { $element.addClass($scope.$class.node); $scope.$node_class = $scope.$class.node; } } function fnLink(scope, element, attrs) { var enabledDnD = typeof scope.dragEnabled === 'boolean' || typeof scope.dropEnabled === 'boolean', keyNode = attrs.treeDndNode, first = true; $TreeDnDViewport.add(scope, element); if (enabledDnD) { scope.$type = 'TreeDnDNode'; scope.getData = function () { return scope[keyNode]; }; } scope.$element = element; scope[keyNode].__inited__ = true; /*if (scope[keyNode].__index_real__ === scope.$TreeLimit - 1) { console.time('Call_fnTimeGenerate_Node'); $timeout(function () { scope.updateLimit(); console.log(scope.$TreeLimit); console.timeEnd('Call_fnTimeGenerate_Node'); }, 2000, false); }*/ scope.getElementChilds = function () { return angular.element(element[0].querySelector('[tree-dnd-nodes]')); }; scope.setScope(scope, scope[keyNode]); scope.getScopeNode = function () { return scope; }; scope.$watch(keyNode, fnWatchNode, true); scope.$on('$destroy', function () { scope.deleteScope(scope, scope[keyNode]); }); function fnWatchNode(newVal, oldVal, scope) { if (!newVal.__visible__) { element.addClass(scope.$class.hidden); } //console.time('Node_Changed'); var nodeNew = newVal, _nodes = scope[keyNode].__children__, _len = _nodes.length, _i, _icon; if (_len === 0) { _icon = -1; } else { if (nodeNew.__expanded__) { _icon = 1; } else { _icon = 0; } } nodeNew.__icon__ = _icon; nodeNew.__icon_class__ = scope.$class.icon[_icon]; if (!first) { if (newVal.__expanded__ !== oldVal.__expanded__) { //if (scope.isTable) { for (_i = 0; _i < _len; _i++) { scope.for_all_descendants(_nodes[_i], fnHiddenChild, nodeNew, true); } //} else { // if (!childsElem) { // childsElem = scope.getElementChilds(); // } // // if (nodeNew.__expanded__) { // childsElem.removeClass(scope.$class.hidden); // } else { // childsElem.addClass(scope.$class.hidden); // } //} //console.timeEnd('Node_Changed'); } } first = false; function fnHiddenChild(node, parent) { //node.__visible__ = nodeNew.__expanded__ && (node.__visible__ || parent.__expanded__); var nodeScope = scope.getScope(node); if (nodeScope) { if (nodeNew.__expanded__ && (node.__visible__ || parent.__expanded__)) { nodeScope.$element.removeClass(scope.$class.hidden); node.__visible__ = true; } else { nodeScope.$element.addClass(scope.$class.hidden); node.__visible__ = false; } } else { // show node & init scope node.__visible__ = true; } // skip all child hiding... if not expaned return !node.__expanded__; } } } }] );
zpzgone/angular-tree-dnd
src/directive/angular-tree-dnd-node.js
JavaScript
mit
4,775
/* * Kendo UI Web v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Web commercial licenses may be obtained at * https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx * If you do not own a commercial license, this file shall be governed by the * GNU General Public License (GPL) version 3. * For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html */ ("function"==typeof define&&define.amd?define:function(y,n){return n()})(["../kendo.core.min"],function(){!function(){kendo.cultures["mn-Mong"]={name:"mn-Mong",numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3,0],percent:{pattern:["-n%","n%"],decimals:2,",":",",".":".",groupSize:[3,0],symbol:"%"},currency:{pattern:["$-n","$n"],decimals:2,",":",",".":".",groupSize:[3,0],symbol:"¥"}},calendars:{standard:{days:{names:["ᠭᠠᠷᠠᠭ ᠤᠨ ᠡᠳᠦᠷ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠨᠢᠭᠡᠨ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠬᠣᠶᠠᠷ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠭᠤᠷᠪᠠᠨ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠳᠥᠷᠪᠡᠨ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠲᠠᠪᠤᠨ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠵᠢᠷᠭᠤᠭᠠᠨ"],namesAbbr:["ᠭᠠᠷᠠᠭ ᠤᠨ ᠡᠳᠦᠷ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠨᠢᠭᠡᠨ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠬᠣᠶᠠᠷ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠭᠤᠷᠪᠠᠨ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠳᠥᠷᠪᠡᠨ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠲᠠᠪᠤᠨ","ᠭᠠᠷᠠᠭ ᠤᠨ ᠵᠢᠷᠭᠤᠭᠠᠨ"],namesShort:["ᠡ‍","ᠨᠢ‍","ᠬᠣ‍","ᠭᠤ‍","ᠳᠥ‍","ᠲᠠ‍","ᠵᠢ‍"]},months:{names:["ᠨᠢᠭᠡᠳᠦᠭᠡᠷ ᠰᠠᠷ᠎ᠠ","ᠬᠤᠶ᠋ᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠭᠤᠷᠪᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠲᠦᠷᠪᠡᠳᠦᠭᠡᠷ ᠰᠠᠷ᠎ᠠ","ᠲᠠᠪᠤᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠵᠢᠷᠭᠤᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠲᠤᠯᠤᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠨᠠᠢᠮᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠶᠢᠰᠦᠳᠦᠭᠡᠷ ᠰᠠᠷ᠎ᠠ","ᠠᠷᠪᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠠᠷᠪᠠᠨ ᠨᠢᠭᠡᠳᠦᠭᠡᠷ ᠰᠠᠷ᠎ᠠ","ᠠᠷᠪᠠᠨ ᠬᠤᠶ᠋ᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ",""],namesAbbr:["ᠨᠢᠭᠡᠳᠦᠭᠡᠷ ᠰᠠᠷ᠎ᠠ","ᠬᠤᠶ᠋ᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠭᠤᠷᠪᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠲᠦᠷᠪᠡᠳᠦᠭᠡᠷ ᠰᠠᠷ᠎ᠠ","ᠲᠠᠪᠤᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠵᠢᠷᠭᠤᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠲᠤᠯᠤᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠨᠠᠢᠮᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠶᠢᠰᠦᠳᠦᠭᠡᠷ ᠰᠠᠷ᠎ᠠ","ᠠᠷᠪᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ","ᠠᠷᠪᠠᠨ ᠨᠢᠭᠡᠳᠦᠭᠡᠷ ᠰᠠᠷ᠎ᠠ","ᠠᠷᠪᠠᠨ ᠬᠤᠶ᠋ᠠᠳᠤᠭᠠᠷ ᠰᠠᠷ᠎ᠠ",""]},AM:[""],PM:[""],patterns:{d:"yyyy/M/d",D:"yyyy'ᠣᠨ ᠤ᠋' M'ᠰᠠᠷ᠎ᠠ  ᠢᠢᠨ 'd' ᠤ᠋ ᠡᠳᠦᠷ'",F:"yyyy'ᠣᠨ ᠤ᠋' M'ᠰᠠᠷ᠎ᠠ  ᠢᠢᠨ 'd' ᠤ᠋ ᠡᠳᠦᠷ' H:mm:ss",g:"yyyy/M/d H:mm",G:"yyyy/M/d H:mm:ss",m:"M'ᠰᠠᠷ᠎ᠠ' d'ᠡᠳᠦᠷ'",M:"M'ᠰᠠᠷ᠎ᠠ' d'ᠡᠳᠦᠷ'",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"H:mm",T:"H:mm:ss",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"yyyy'ᠣᠨ' M'ᠰᠠᠷ᠎ᠠ'",Y:"yyyy'ᠣᠨ' M'ᠰᠠᠷ᠎ᠠ'"},"/":"/",":":":",firstDay:1}}}}(this)});
lzrgibson/ueaac
public/tools/kendo/js/cultures/kendo.culture.mn-Mong.min.js
JavaScript
mit
3,381
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information // ReSharper disable ConvertPropertyToExpressionBody namespace DotNetNuke.Framework.Reflections { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using DotNetNuke.Framework.Internal.Reflection; public class TypeLocator : ITypeLocator, IAssemblyLocator { private IAssemblyLocator _assemblyLocator; internal IAssemblyLocator AssemblyLocator { get { return this._assemblyLocator ?? (this._assemblyLocator = this); } set { this._assemblyLocator = value; } } /// <inheritdoc/> IEnumerable<IAssembly> IAssemblyLocator.Assemblies { // this method is not readily testable as the assemblies in the current app domain // will vary depending on the test runner and test configuration get { return from assembly in AppDomain.CurrentDomain.GetAssemblies() where this.CanScan(assembly) select new AssemblyWrapper(assembly); } } /// <inheritdoc/> public IEnumerable<Type> GetAllMatchingTypes(Predicate<Type> predicate) { foreach (var assembly in this.AssemblyLocator.Assemblies) { Type[] types; try { types = assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { // some assemblies don't want to be reflected but they still // expose types in the exception types = ex.Types ?? new Type[0]; } foreach (var type in types) { if (type != null) { if (predicate(type)) { yield return type; } } } } } private bool CanScan(Assembly assembly) { string[] ignoreAssemblies = new string[] { "DotNetNuke.Authentication.Facebook", "DotNetNuke.Authentication.Google", "DotNetNuke.Authentication.LiveConnect", "DotNetNuke.Authentication.Twitter", "DotNetNuke.ASP2MenuNavigationProvider", "DotNetNuke.DNNDropDownNavigationProvider", "DotNetNuke.DNNMenuNavigationProvider", "DotNetNuke.DNNTreeNavigationProvider", "DotNetNuke.SolpartMenuNavigationProvider", "DotNetNuke.HttpModules", "DotNetNuke.Instrumentation", "DotNetNuke.Log4Net", "DotNetNuke.Modules.Groups", "DotNetNuke.Modules.Html", "DotNetNuke.Modules.HtmlEditorManager", "DotNetNuke.Modules.MobileManagement", "DotNetNuke.Modules.PreviewProfileManagement", "DotNetNuke.Modules.RazorHost", "DotNetNuke.Modules.Taxonomy", "DotNetNuke.Modules.UrlManagement", "DotNetNuke.RadEditorProvider", "DotNetNuke.Services.Syndication", "DotNetNuke.Web.Client", "DotNetNuke.Web.DDRMenu", "DotNetNuke.Web.Razor", "DotNetNuke.Web.Mvc", "DotNetNuke.WebControls", "DotNetNuke.WebUtility", }; // First eliminate by "class" var assemblyName = assembly.FullName.ToLowerInvariant(); bool canScan = !(assemblyName.StartsWith("clientdependency.core") || assemblyName.StartsWith("countrylistbox") || assemblyName.StartsWith("icsharpcode") || assemblyName.StartsWith("fiftyone") || assemblyName.StartsWith("lucene") || assemblyName.StartsWith("microsoft") || assemblyName.StartsWith("newtonsoft") || assemblyName.StartsWith("petapoco") || assemblyName.StartsWith("sharpziplib") || assemblyName.StartsWith("system") || assemblyName.StartsWith("telerik") || assemblyName.StartsWith("webformsmvp") || assemblyName.StartsWith("webmatrix") || assemblyName.StartsWith("solpart")); if (canScan) { // Next eliminate specific assemblies if (ignoreAssemblies.Any(ignoreAssembly => assemblyName == ignoreAssembly.ToLowerInvariant())) { canScan = false; } } return canScan; } } }
mitchelsellers/Dnn.Platform
DNN Platform/Library/Framework/Reflections/TypeLocator.cs
C#
mit
6,014
<!-- * Template Name: Unify - Responsive Bootstrap Template * Description: Business, Corporate, Portfolio and Blog Theme. * Version: 1.6 * Author: @htmlstream * Website: http://htmlstream.com --> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Responsive Email Template</title> <style type="text/css"> .ReadMsgBody {width: 100%; background-color: #ffffff;} .ExternalClass {width: 100%; background-color: #ffffff;} body {width: 100%; background-color: #ffffff; margin:0; padding:0; -webkit-font-smoothing: antialiased;font-family: Arial, Helvetica, sans-serif} table {border-collapse: collapse;} @media only screen and (max-width: 640px) { body[yahoo] .deviceWidth {width:440px!important; padding:0;} body[yahoo] .center {text-align: center!important;} } @media only screen and (max-width: 479px) { body[yahoo] .deviceWidth {width:280px!important; padding:0;} body[yahoo] .center {text-align: center!important;} } </style> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" yahoo="fix" style="font-family: Arial, Helvetica, sans-serif"> <!-- Wrapper --> <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td width="100%" valign="top" bgcolor="#ffffff" style="padding-top:20px"> <!--Start Header--> <table width="700" bgcolor="#fff" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td style="padding: 6px 0px 0px"> <table width="650" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td width="100%" > <!--Start logo--> <table border="0" cellpadding="0" cellspacing="0" align="left" class="deviceWidth"> <tr> <td class="center" style="padding: 20px 0px 10px 0px"> <a href="#"><img src="img/logo/logo_lightgreen.png"></a> </td> </tr> </table><!--End logo--> <!--Start nav--> <table border="0" cellpadding="0" cellspacing="0" align="right" class="deviceWidth"> <tr> <td class="center" style="font-size: 13px; color: #272727; font-weight: light; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 20px 0px 10px 0px;"> <a href="#" style="text-decoration: none; color: #3b3b3b;">PRODUCTS</a> &nbsp; &nbsp; <a href="#" style="text-decoration: none; color: #3b3b3b;">SERVICES</a> &nbsp; &nbsp; <a href="#" style="text-decoration: none; color: #3b3b3b;">WORK</a> &nbsp; &nbsp; <a href="#" style="text-decoration: none; color: #3b3b3b;">BLOG</a> </td> </tr> </table><!--End nav--> </td> </tr> </table> </td> </tr> </table> <!--End Header--> <!-- Start Headliner--> <table width="700" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td width="100%" valign="top" style="padding: 0px " class="center"> <a href="#"><img class="deviceWidth" width="700" hight="350" src="img/headliner/headliner_lightgreen.jpg"></a> </td> </tr> </table> <!-- End Headliner--> <!--Start Discount--> <table width="700" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td width="100%" style=" padding: 20px 0;" align="center" bgcolor="#f7f7f7"> <!--Left Box--> <table border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td valign="top" class="left" style="font-size: 16px; color: #303030; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 0 20px 10px 20px;"> Book Today and Get 40% Discount </td> </tr> </table><!--End Left Box--> <table> <tr> <td valign="top" style="padding: 7px 15px; background-color: #79d5b3; " class="center"> <a style="color: #fff; font-size: 12px; font-weight: bold; text-decoration: none; font-family: Arial, sans-serif; text-alight: center;" href="#">BOOK NOW</a> </td> </tr> </table> </td> </tr> </table> <!--End Discount--> <!--Start Left Picture--> <table width="700" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td width="100%" bgcolor="#fff"> <!-- Left box --> <table width="45%" align="left" border="0" cellpadding="0" cellspacing="0" class="deviceWidth"> <tr> <td valign="top" style="padding: 20px 20px" > <a href="#"><img class="deviceWidth" width="260" hight="190" src="img/block_img/left_picture.jpg"></a> </td> </tr> </table> <!--End left box--> <!--Right box--> <table width="55%" align="left" border="0" cellpadding="0" cellspacing="0" class="deviceWidth"> <tr> <td style="font-size: 16px; color: #303030; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 20px; 20px 0px 1 "> Now Traveling Is Easy </td> </tr> <tr> <td style="font-size: 12px; color: #b3b2b2; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 0 20px 20px 40px; "> 1Arrival entered an if drawing requests iness not promotion few knowledge. contented. Yet winter law romotion few knowledge contented behind </td> </tr> <tr> <td style=" padding: 0 0 20px 0;"> <table align="center"> <tr> <td valign="top" style="padding: 7px 15px; text-align: center; background-color: #79d5b3;" class="center"> <a style="color: #fff; font-size: 12px; font-weight: bold; text-decoration: none; font-family: Arial, sans-serif; text-alight: center;" href="#">VIEW MORE</a> </td> </tr> </table> </td> </tr> </table><!--End right box--> </td> </tr> </table> <!--End Left Picture--> <!--Start Right Picture--> <table width="700" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td width="100%" bgcolor="#f7f7f7"> <!--Left box--> <table width="55%" align="left" border="0" cellpadding="0" cellspacing="0" class="deviceWidth"> <tr> <td style="font-size: 16px; color: #303030; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 20px 10px 0; "> Perfect Location </td> </tr> <tr> <td style="font-size: 12px; color: #b3b2b2; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 20px;"> Arrival entered an if drawing requests iness not promotion few knowledge. contented. Yet winter law romotion few knowledge contented behind </td> </tr> <tr> <td style=" padding: 0 0 20px 0;"> <table align="center"> <tr> <td valign="top" style="padding: 7px 15px; text-align: center; background-color: #79d5b3;" class="center"> <a style="color: #fff; font-size: 12px; font-weight: bold; text-decoration: none; font-family: Arial, sans-serif; text-alight: center;" href="#">VIEW MORE</a> </td> </tr> </table> </td> </tr> </table><!--End Left box--> <!-- Right box --> <table width="30%" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td valign="top" style="padding: 20px;" class="center"> <a href="#"><img class="deviceWidth" width="260" hight="190" src="img/block_img/right_picture.jpg"></a> </td> </tr> </table> <!--End Right box--> </td> </tr> </table> <!--End Right Picture--> <!--Start Midlle Picture --> <table width="700" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td width="100%" valign="top" style="padding: 40px 20px 10px " class="center"> <a href="#"><img class="deviceWidth" width="660" hight="264" src="img/block_img/middle_picture.jpg"></a> </td> </tr> <tr> <td class="center"> <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td class="center" style="font-size: 16px; color: #303030; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 10px 20px 0; "> Great Holiday Destinations Summer 2014 </td> </tr> <tr> <td class="center" style="font-size: 12px; color: #b3b2b2; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 20px 20px; " > Arrival entered an if drawing requests iness not promotion few knowledge. contented. Yet winter law romotion few knowledge contented behind. Books whose front would purse if be do decay. Quitting you way formerly disposed perceive ladyship are. Common turned boy direct and yet. </td> </tr> <tr> <td style=" padding: 0 0 20px 20px;"> <table align="center"> <tr> <td valign="top" style="padding: 7px 15px; text-align: center; background-color: #79d5b3;" class="center"> <a style="color: #fff; font-size: 12px; font-weight: bold; text-decoration: none; font-family: Arial, sans-serif; text-alight: center;" href="#">VIEW MORE</a> </td> </tr> </table> </td> </tr> </table> </td> </table> <!--End Midlle Picture --> <!--Start Two Texts--> <table width="700" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td width="100%" bgcolor="#f7f7f7" > <!--Left box--> <table width="33%" border="0" cellpadding="0" cellspacing="0" align="left" class="deviceWidth"> <tr> <td class="center"> <table border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td valign="top" style="padding: 30px 20px 0" class="center"> <a href="#"><img width="190" hight="190" src="img/block_img/picture_two.jpg"></a> </td> </tr> <tr> <td class="center" style="font-size: 16px; color: #303030; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 30px 20px 10px;"> Amazing View </td> </tr> <tr> <td class="center deviceWidth" style="font-size: 12px; color: #b3b2b2; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 10px 20px 20px; " > Arrival entered an if drawing requests iness not promotion few knowledge. contented. Yet winter law romotion few knowledge contented behind </td> </tr> </table> <tr> <td style=" padding: 0 0 20px 0;"> <table align="center"> <tr> <td valign="top" style="padding: 7px 15px; text-align: center; background-color: #79d5b3;" class="center"> <a style="color: #fff; font-size: 12px; font-weight: bold; text-decoration: none; font-family: Arial, sans-serif; text-alight: center;" href="#">VIEW MORE</a> </td> </tr> </table> </td> </tr> </td> </tr> </table><!--End Left box--> <!-- Right box --> <table width="33%" border="0" cellpadding="0" cellspacing="0" align="right" class="deviceWidth"> <tr> <td class="center"> <table border="0" cellpadding="0" cellspacing="0" align="right"> <tr> <td valign="top" style="padding: 30px 20px 0; " class="right"> <a href="#"><img width="190" hight="190" src="img/block_img/picture_two.jpg"></a> </td> </tr> <tr> <td class="center" style="font-size: 16px; color: #303030; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 30px 20px 10px; "> Wonderland </td> </tr> <tr> <td class="center" style="font-size: 12px; color: #b3b2b2; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 10px 20px 20px; " > Arrival entered an if drawing requests iness not promotion few knowledge. contented. Yet winter law romotion few knowledge contented behind </td> </tr> </table> <tr> <td style=" padding: 0 0 20px 0;"> <table align="center"> <tr> <td valign="top" style="padding: 7px 15px; text-align: center; background-color: #79d5b3;" class="center"> <a style="color: #fff; font-size: 12px; font-weight: bold; text-decoration: none; font-family: Arial, sans-serif; text-alight: center;" href="#">VIEW MORE</a> </td> </tr> </table> </td> </tr> </td> </tr> </table> <!--End Right box--> <table width="33%" border="0" cellpadding="0" cellspacing="0" align="right" class="deviceWidth"> <tr> <td class="center"> <table border="0" cellpadding="0" cellspacing="0" align="right"> <tr> <td valign="top" style="padding: 30px 20px 0; " class="right"> <a href="#"><img width="190" hight="190" src="img/block_img/picture_one.jpg"></a> </td> </tr> <tr> <td class="center" style="font-size: 16px; color: #303030; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 30px 20px 10px; "> Quality Time </td> </tr> <tr> <td class="center" style="font-size: 12px; color: #b3b2b2; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 10px 20px 20px; " > Arrival entered an if drawing requests iness not promotion few knowledge. contented. Yet winter law romotion few knowledge contented behind </td> </tr> </table> <tr> <td style=" padding: 0 0 20px 0;"> <table align="center"> <tr> <td valign="top" style="padding: 7px 15px; text-align: center; background-color: #79d5b3;" class="center"> <a style="color: #fff; font-size: 12px; font-weight: bold; text-decoration: none; font-family: Arial, sans-serif; text-alight: center;" href="#">VIEW MORE</a> </td> </tr> </table> </td> </tr> </td> </tr> </table> <!--End Right box--> </td> </tr> </table> <!--End Two Texts--> <!--Start Support--> <table width="700" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td width="100%" bgcolor="#a5d1da" class="center"> <table border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td valign="top" style="padding: 20px 10px " class="center"> <a href="#"><img width="60" hight="60" src="img/icons/icon_support.png"></a> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td class="center" style="font-size: 16px; color: #ffffff; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 0px 10px; "> 24 Hour Support </td> </tr> <td class="center" style="font-size: 12px; color: #ffffff; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 20px 10px; " > Arrival entered an if drawing requests iness she ham but instantlyt putif departuresam propr. Certain be yeamiasa ble by exposed Two differed husbands met screened his. How daughters not promotion few knowledge. contented. Yet winter law romotion few knowledge contented behind </td> </tr> </table> </td> </tr> </table> <!--End Support--> <!-- Footer --> <table width="700" border="0" cellpadding="0" cellspacing="0" align="center" class="deviceWidth"> <tr> <td class="center" style="font-size: 12px; color: #687074; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 20px 10px 0px; " > Drawings me opinions returned absolute in. Otherwise therefore did are unfeeling something. Certain be ye amiable by exposed Two differed husbands met screened his. Bed was form wife out ask draw. Wholly coming at we no enable </td> </tr> <tr> <td class="center" style="font-size: 12px; color: #687074; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 20px 10px 0px; " > If you would prefer not to receive email communications from Unify Template click <a style="text-decoration: none; color: #79d5b3;" href="#">here</a> </td> </tr> <tr> <td class="center" style="font-size: 12px; color: #687074; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 25px; vertical-align: middle; padding: 20px 50px 0px 50px; "> Copyright © Unify Template 2014 </td> </tr> </table> <!--End Footer--> <div style="height:15px">&nbsp;</div><!-- divider--> </td> </tr> </table> <!-- End Wrapper --> </body> </html>
virgiligarcia/neighbors.es
public/_t/Email-Templates/flat/email_flat_light_green.html
HTML
mit
29,015
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "walletdb.h" #include "wallet.h" #include <boost/filesystem.hpp> using namespace std; using namespace boost; static uint64 nAccountingEntryNumber = 0; // // CWalletDB // bool CWalletDB::WriteName(const string& strAddress, const string& strName) { nWalletDBUpdated++; return Write(make_pair(string("name"), strAddress), strName); } bool CWalletDB::EraseName(const string& strAddress) { // This should only be used for sending addresses, never for receiving addresses, // receiving addresses must always have an address book entry if they're not change return. nWalletDBUpdated++; return Erase(make_pair(string("name"), strAddress)); } bool CWalletDB::ReadAccount(const string& strAccount, CAccount& account) { account.SetNull(); return Read(make_pair(string("acc"), strAccount), account); } bool CWalletDB::WriteAccount(const string& strAccount, const CAccount& account) { return Write(make_pair(string("acc"), strAccount), account); } bool CWalletDB::WriteAccountingEntry(const uint64 nAccEntryNum, const CAccountingEntry& acentry) { return Write(boost::make_tuple(string("acentry"), acentry.strAccount, nAccEntryNum), acentry); } bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry) { return WriteAccountingEntry(++nAccountingEntryNumber, acentry); } int64 CWalletDB::GetAccountCreditDebit(const string& strAccount) { list<CAccountingEntry> entries; ListAccountCreditDebit(strAccount, entries); int64 nCreditDebit = 0; BOOST_FOREACH (const CAccountingEntry& entry, entries) nCreditDebit += entry.nCreditDebit; return nCreditDebit; } void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& entries) { bool fAllAccounts = (strAccount == "*"); Dbc* pcursor = GetCursor(); if (!pcursor) throw runtime_error("CWalletDB::ListAccountCreditDebit() : cannot create DB cursor"); unsigned int fFlags = DB_SET_RANGE; while(true) { // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION); if (fFlags == DB_SET_RANGE) ssKey << boost::make_tuple(string("acentry"), (fAllAccounts? string("") : strAccount), uint64(0)); CDataStream ssValue(SER_DISK, CLIENT_VERSION); int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags); fFlags = DB_NEXT; if (ret == DB_NOTFOUND) break; else if (ret != 0) { pcursor->close(); throw runtime_error("CWalletDB::ListAccountCreditDebit() : error scanning DB"); } // Unserialize string strType; ssKey >> strType; if (strType != "acentry") break; CAccountingEntry acentry; ssKey >> acentry.strAccount; if (!fAllAccounts && acentry.strAccount != strAccount) break; ssValue >> acentry; ssKey >> acentry.nEntryNo; entries.push_back(acentry); } pcursor->close(); } DBErrors CWalletDB::ReorderTransactions(CWallet* pwallet) { LOCK(pwallet->cs_wallet); // Old wallets didn't have any defined order for transactions // Probably a bad idea to change the output of this // First: get all CWalletTx and CAccountingEntry into a sorted-by-time multimap. typedef pair<CWalletTx*, CAccountingEntry*> TxPair; typedef multimap<int64, TxPair > TxItems; TxItems txByTime; for (map<uint256, CWalletTx>::iterator it = pwallet->mapWallet.begin(); it != pwallet->mapWallet.end(); ++it) { CWalletTx* wtx = &((*it).second); txByTime.insert(make_pair(wtx->nTimeReceived, TxPair(wtx, (CAccountingEntry*)0))); } list<CAccountingEntry> acentries; ListAccountCreditDebit("", acentries); BOOST_FOREACH(CAccountingEntry& entry, acentries) { txByTime.insert(make_pair(entry.nTime, TxPair((CWalletTx*)0, &entry))); } int64& nOrderPosNext = pwallet->nOrderPosNext; nOrderPosNext = 0; std::vector<int64> nOrderPosOffsets; for (TxItems::iterator it = txByTime.begin(); it != txByTime.end(); ++it) { CWalletTx *const pwtx = (*it).second.first; CAccountingEntry *const pacentry = (*it).second.second; int64& nOrderPos = (pwtx != 0) ? pwtx->nOrderPos : pacentry->nOrderPos; if (nOrderPos == -1) { nOrderPos = nOrderPosNext++; nOrderPosOffsets.push_back(nOrderPos); if (pacentry) // Have to write accounting regardless, since we don't keep it in memory if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry)) return DB_LOAD_FAIL; } else { int64 nOrderPosOff = 0; BOOST_FOREACH(const int64& nOffsetStart, nOrderPosOffsets) { if (nOrderPos >= nOffsetStart) ++nOrderPosOff; } nOrderPos += nOrderPosOff; nOrderPosNext = std::max(nOrderPosNext, nOrderPos + 1); if (!nOrderPosOff) continue; // Since we're changing the order, write it back if (pwtx) { if (!WriteTx(pwtx->GetHash(), *pwtx)) return DB_LOAD_FAIL; } else if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry)) return DB_LOAD_FAIL; } } return DB_LOAD_OK; } bool ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, int& nFileVersion, vector<uint256>& vWalletUpgrade, bool& fIsEncrypted, bool& fAnyUnordered, string& strType, string& strErr) { try { // Unserialize // Taking advantage of the fact that pair serialization // is just the two items serialized one after the other ssKey >> strType; if (strType == "name") { string strAddress; ssKey >> strAddress; ssValue >> pwallet->mapAddressBook[CBitcoinAddress(strAddress).Get()]; } else if (strType == "tx") { uint256 hash; ssKey >> hash; CWalletTx& wtx = pwallet->mapWallet[hash]; ssValue >> wtx; CValidationState state; if (wtx.CheckTransaction(state) && (wtx.GetHash() == hash) && state.IsValid()) wtx.BindWallet(pwallet); else { pwallet->mapWallet.erase(hash); return false; } // Undo serialize changes in 31600 if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703) { if (!ssValue.empty()) { char fTmp; char fUnused; ssValue >> fTmp >> fUnused >> wtx.strFromAccount; strErr = strprintf("LoadWallet() upgrading tx ver=%d %d '%s' %s", wtx.fTimeReceivedIsTxTime, fTmp, wtx.strFromAccount.c_str(), hash.ToString().c_str()); wtx.fTimeReceivedIsTxTime = fTmp; } else { strErr = strprintf("LoadWallet() repairing tx ver=%d %s", wtx.fTimeReceivedIsTxTime, hash.ToString().c_str()); wtx.fTimeReceivedIsTxTime = 0; } vWalletUpgrade.push_back(hash); } if (wtx.nOrderPos == -1) fAnyUnordered = true; //// debug print //printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str()); //printf(" %12"PRI64d" %s %s %s\n", // wtx.vout[0].nValue, // DateTimeStrFormat("%Y-%m-%d %H:%M:%S", wtx.GetBlockTime()).c_str(), // wtx.hashBlock.ToString().c_str(), // wtx.mapValue["message"].c_str()); } else if (strType == "acentry") { string strAccount; ssKey >> strAccount; uint64 nNumber; ssKey >> nNumber; if (nNumber > nAccountingEntryNumber) nAccountingEntryNumber = nNumber; if (!fAnyUnordered) { CAccountingEntry acentry; ssValue >> acentry; if (acentry.nOrderPos == -1) fAnyUnordered = true; } } else if (strType == "key" || strType == "wkey") { vector<unsigned char> vchPubKey; ssKey >> vchPubKey; CKey key; if (strType == "key") { CPrivKey pkey; ssValue >> pkey; key.SetPubKey(vchPubKey); if (!key.SetPrivKey(pkey)) { strErr = "Error reading wallet database: CPrivKey corrupt"; return false; } if (key.GetPubKey() != vchPubKey) { strErr = "Error reading wallet database: CPrivKey pubkey inconsistency"; return false; } if (!key.IsValid()) { strErr = "Error reading wallet database: invalid CPrivKey"; return false; } } else { CWalletKey wkey; ssValue >> wkey; key.SetPubKey(vchPubKey); if (!key.SetPrivKey(wkey.vchPrivKey)) { strErr = "Error reading wallet database: CPrivKey corrupt"; return false; } if (key.GetPubKey() != vchPubKey) { strErr = "Error reading wallet database: CWalletKey pubkey inconsistency"; return false; } if (!key.IsValid()) { strErr = "Error reading wallet database: invalid CWalletKey"; return false; } } if (!pwallet->LoadKey(key)) { strErr = "Error reading wallet database: LoadKey failed"; return false; } } else if (strType == "mkey") { unsigned int nID; ssKey >> nID; CMasterKey kMasterKey; ssValue >> kMasterKey; if(pwallet->mapMasterKeys.count(nID) != 0) { strErr = strprintf("Error reading wallet database: duplicate CMasterKey id %u", nID); return false; } pwallet->mapMasterKeys[nID] = kMasterKey; if (pwallet->nMasterKeyMaxID < nID) pwallet->nMasterKeyMaxID = nID; } else if (strType == "ckey") { vector<unsigned char> vchPubKey; ssKey >> vchPubKey; vector<unsigned char> vchPrivKey; ssValue >> vchPrivKey; if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey)) { strErr = "Error reading wallet database: LoadCryptedKey failed"; return false; } fIsEncrypted = true; } else if (strType == "defaultkey") { ssValue >> pwallet->vchDefaultKey; } else if (strType == "pool") { int64 nIndex; ssKey >> nIndex; pwallet->setKeyPool.insert(nIndex); } else if (strType == "version") { ssValue >> nFileVersion; if (nFileVersion == 10300) nFileVersion = 300; } else if (strType == "cscript") { uint160 hash; ssKey >> hash; CScript script; ssValue >> script; if (!pwallet->LoadCScript(script)) { strErr = "Error reading wallet database: LoadCScript failed"; return false; } } else if (strType == "orderposnext") { ssValue >> pwallet->nOrderPosNext; } } catch (...) { return false; } return true; } static bool IsKeyType(string strType) { return (strType== "key" || strType == "wkey" || strType == "mkey" || strType == "ckey"); } DBErrors CWalletDB::LoadWallet(CWallet* pwallet) { pwallet->vchDefaultKey = CPubKey(); int nFileVersion = 0; vector<uint256> vWalletUpgrade; bool fIsEncrypted = false; bool fAnyUnordered = false; bool fNoncriticalErrors = false; DBErrors result = DB_LOAD_OK; try { LOCK(pwallet->cs_wallet); int nMinVersion = 0; if (Read((string)"minversion", nMinVersion)) { if (nMinVersion > CLIENT_VERSION) return DB_TOO_NEW; pwallet->LoadMinVersion(nMinVersion); } // Get cursor Dbc* pcursor = GetCursor(); if (!pcursor) { printf("Error getting wallet database cursor\n"); return DB_CORRUPT; } while(true) { // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION); CDataStream ssValue(SER_DISK, CLIENT_VERSION); int ret = ReadAtCursor(pcursor, ssKey, ssValue); if (ret == DB_NOTFOUND) break; else if (ret != 0) { printf("Error reading next record from wallet database\n"); return DB_CORRUPT; } // Try to be tolerant of single corrupt records: string strType, strErr; if (!ReadKeyValue(pwallet, ssKey, ssValue, nFileVersion, vWalletUpgrade, fIsEncrypted, fAnyUnordered, strType, strErr)) { // losing keys is considered a catastrophic error, anything else // we assume the user can live with: if (IsKeyType(strType)) result = DB_CORRUPT; else { // Leave other errors alone, if we try to fix them we might make things worse. fNoncriticalErrors = true; // ... but do warn the user there is something wrong. if (strType == "tx") // Rescan if there is a bad transaction record: SoftSetBoolArg("-rescan", true); } } if (!strErr.empty()) printf("%s\n", strErr.c_str()); } pcursor->close(); } catch (boost::thread_interrupted) { throw; } catch (...) { result = DB_CORRUPT; } if (fNoncriticalErrors && result == DB_LOAD_OK) result = DB_NONCRITICAL_ERROR; // Any wallet corruption at all: skip any rewriting or // upgrading, we don't want to make it worse. if (result != DB_LOAD_OK) return result; printf("nFileVersion = %d\n", nFileVersion); BOOST_FOREACH(uint256 hash, vWalletUpgrade) WriteTx(hash, pwallet->mapWallet[hash]); // Rewrite encrypted wallets of versions 0.4.0 and 0.5.0rc: if (fIsEncrypted && (nFileVersion == 40000 || nFileVersion == 50000)) return DB_NEED_REWRITE; if (nFileVersion < CLIENT_VERSION) // Update WriteVersion(CLIENT_VERSION); if (fAnyUnordered) result = ReorderTransactions(pwallet); return result; } void ThreadFlushWalletDB(const string& strFile) { // Make this thread recognisable as the wallet flushing thread RenameThread("bitcoin-wallet"); static bool fOneThread; if (fOneThread) return; fOneThread = true; if (!GetBoolArg("-flushwallet", true)) return; unsigned int nLastSeen = nWalletDBUpdated; unsigned int nLastFlushed = nWalletDBUpdated; int64 nLastWalletUpdate = GetTime(); while (true) { MilliSleep(500); if (nLastSeen != nWalletDBUpdated) { nLastSeen = nWalletDBUpdated; nLastWalletUpdate = GetTime(); } if (nLastFlushed != nWalletDBUpdated && GetTime() - nLastWalletUpdate >= 2) { TRY_LOCK(bitdb.cs_db,lockDb); if (lockDb) { // Don't do this if any databases are in use int nRefCount = 0; map<string, int>::iterator mi = bitdb.mapFileUseCount.begin(); while (mi != bitdb.mapFileUseCount.end()) { nRefCount += (*mi).second; mi++; } if (nRefCount == 0) { boost::this_thread::interruption_point(); map<string, int>::iterator mi = bitdb.mapFileUseCount.find(strFile); if (mi != bitdb.mapFileUseCount.end()) { printf("Flushing wallet.dat\n"); nLastFlushed = nWalletDBUpdated; int64 nStart = GetTimeMillis(); // Flush wallet.dat so it's self contained bitdb.CloseDb(strFile); bitdb.CheckpointLSN(strFile); bitdb.mapFileUseCount.erase(mi++); printf("Flushed wallet.dat %"PRI64d"ms\n", GetTimeMillis() - nStart); } } } } } } bool BackupWallet(const CWallet& wallet, const string& strDest) { if (!wallet.fFileBacked) return false; while (true) { { LOCK(bitdb.cs_db); if (!bitdb.mapFileUseCount.count(wallet.strWalletFile) || bitdb.mapFileUseCount[wallet.strWalletFile] == 0) { // Flush log data to the dat file bitdb.CloseDb(wallet.strWalletFile); bitdb.CheckpointLSN(wallet.strWalletFile); bitdb.mapFileUseCount.erase(wallet.strWalletFile); // Copy wallet.dat filesystem::path pathSrc = GetDataDir() / wallet.strWalletFile; filesystem::path pathDest(strDest); if (filesystem::is_directory(pathDest)) pathDest /= wallet.strWalletFile; try { #if BOOST_VERSION >= 104000 filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists); #else filesystem::copy_file(pathSrc, pathDest); #endif printf("copied wallet.dat to %s\n", pathDest.string().c_str()); return true; } catch(const filesystem::filesystem_error &e) { printf("error copying wallet.dat to %s - %s\n", pathDest.string().c_str(), e.what()); return false; } } } MilliSleep(100); } return false; } // // Try to (very carefully!) recover wallet.dat if there is a problem. // bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) { // Recovery procedure: // move wallet.dat to wallet.timestamp.bak // Call Salvage with fAggressive=true to // get as much data as possible. // Rewrite salvaged data to wallet.dat // Set -rescan so any missing transactions will be // found. int64 now = GetTime(); std::string newFilename = strprintf("wallet.%"PRI64d".bak", now); int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL, newFilename.c_str(), DB_AUTO_COMMIT); if (result == 0) printf("Renamed %s to %s\n", filename.c_str(), newFilename.c_str()); else { printf("Failed to rename %s to %s\n", filename.c_str(), newFilename.c_str()); return false; } std::vector<CDBEnv::KeyValPair> salvagedData; bool allOK = dbenv.Salvage(newFilename, true, salvagedData); if (salvagedData.empty()) { printf("Salvage(aggressive) found no records in %s.\n", newFilename.c_str()); return false; } printf("Salvage(aggressive) found %"PRIszu" records\n", salvagedData.size()); bool fSuccess = allOK; Db* pdbCopy = new Db(&dbenv.dbenv, 0); int ret = pdbCopy->open(NULL, // Txn pointer filename.c_str(), // Filename "main", // Logical db name DB_BTREE, // Database type DB_CREATE, // Flags 0); if (ret > 0) { printf("Cannot create database file %s\n", filename.c_str()); return false; } CWallet dummyWallet; int nFileVersion = 0; vector<uint256> vWalletUpgrade; bool fIsEncrypted = false; bool fAnyUnordered = false; DbTxn* ptxn = dbenv.TxnBegin(); BOOST_FOREACH(CDBEnv::KeyValPair& row, salvagedData) { if (fOnlyKeys) { CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION); CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION); string strType, strErr; bool fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue, nFileVersion, vWalletUpgrade, fIsEncrypted, fAnyUnordered, strType, strErr); if (!IsKeyType(strType)) continue; if (!fReadOK) { printf("WARNING: CWalletDB::Recover skipping %s: %s\n", strType.c_str(), strErr.c_str()); continue; } } Dbt datKey(&row.first[0], row.first.size()); Dbt datValue(&row.second[0], row.second.size()); int ret2 = pdbCopy->put(ptxn, &datKey, &datValue, DB_NOOVERWRITE); if (ret2 > 0) fSuccess = false; } ptxn->commit(0); pdbCopy->close(0); delete pdbCopy; return fSuccess; } bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename) { return CWalletDB::Recover(dbenv, filename, false); }
020LondonCoin/020Londoncoin
src/walletdb.cpp
C++
mit
22,536
'use strict'; exports.__esModule = true; var _utilities = require('../utilities'); var data = { settings: { 'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/ }, messages: { 'isRequired': 'is required', 'onValidateCallback': 'not a valid value', 'AlphaNumericOrWhitespaceValidationRule': function AlphaNumericOrWhitespaceValidationRule(newValue, threshold) { return 'can contain only alphanumerical characters or spaces'; }, 'AlphaNumericValidationRule': function AlphaNumericValidationRule(newValue, threshold) { return 'can contain only alphanumerical characters'; }, 'AlphaValidationRule': function AlphaValidationRule(newValue, threshold) { return 'can contain only letters'; }, 'AlphaOrWhitespaceValidationRule': function AlphaOrWhitespaceValidationRule(newValue, threshold) { return 'can contain only letters or spaces'; }, 'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) { return 'needs to be between ' + _utilities.Utilities.getValue(threshold.minimumLength) + ' and ' + _utilities.Utilities.getValue(threshold.maximumLength) + ' characters long'; }, 'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) { return 'needs to be between ' + _utilities.Utilities.getValue(threshold.minimumValue) + ' and ' + _utilities.Utilities.getValue(threshold.maximumValue); }, 'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) { return 'not a valid value'; }, 'DigitValidationRule': function DigitValidationRule(newValue, threshold) { return 'can contain only digits'; }, 'EmailValidationRule': function EmailValidationRule(newValue, threshold) { return 'is not a valid email address'; }, 'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) { return 'should be ' + _utilities.Utilities.getValue(threshold.otherValue); }, 'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) { return 'cannot be ' + _utilities.Utilities.getValue(threshold.otherValue); }, 'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) { return 'does not match ' + _utilities.Utilities.getValue(threshold.otherValueLabel); }, 'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) { return 'cannot match ' + _utilities.Utilities.getValue(threshold.otherValueLabel); }, 'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) { return 'not a valid value'; }, 'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) { return 'needs to be ' + _utilities.Utilities.getValue(threshold) + ' or more'; }, 'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) { return 'needs to be at least ' + _utilities.Utilities.getValue(threshold) + ' characters long'; }, 'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) { return 'needs to be more than ' + _utilities.Utilities.getValue(threshold); }, 'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) { return 'needs to be ' + _utilities.Utilities.getValue(threshold) + ' or less'; }, 'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) { return 'cannot be longer than ' + _utilities.Utilities.getValue(threshold) + ' characters'; }, 'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) { return 'needs to be less than ' + _utilities.Utilities.getValue(threshold); }, 'NumericValidationRule': function NumericValidationRule(newValue, threshold) { return 'needs to be a number'; }, 'NoSpacesValidationRule': function NoSpacesValidationRule(newValue, threshold) { return 'cannot contain spaces'; }, 'RegexValidationRule': function RegexValidationRule(newValue, threshold) { return 'not a valid value'; }, 'ContainsOnlyValidationRule': function ContainsOnlyValidationRule(newValue, threshold) { return 'not a valid value'; }, 'StrongPasswordValidationRule': function StrongPasswordValidationRule(newValue, threshold) { return 'should contain a combination of lowercase letters, uppercase letters, digits and special characters'; }, 'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) { return 'should contain at least ' + _utilities.Utilities.getValue(threshold) + ' of the following groups: lowercase letters, uppercase letters, digits or special characters'; }, 'URLValidationRule': function URLValidationRule(newValue, threshold) { return 'is not a valid URL'; } } }; exports.data = data;
DaveGee/validation
dist/commonjs/resources/en-US.js
JavaScript
mit
5,095
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>CMSIS DSP Software Library: arm_mean_q15.c Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.7.2 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li id="searchli"> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>arm_mean_q15.c</h1> </div> </div> <div class="contents"> <a href="arm__mean__q15_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* ---------------------------------------------------------------------- </span> <a name="l00002"></a>00002 <span class="comment">* Copyright (C) 2010 ARM Limited. All rights reserved. </span> <a name="l00003"></a>00003 <span class="comment">* </span> <a name="l00004"></a>00004 <span class="comment">* $Date: 15. July 2011 </span> <a name="l00005"></a>00005 <span class="comment">* $Revision: V1.0.10 </span> <a name="l00006"></a>00006 <span class="comment">* </span> <a name="l00007"></a>00007 <span class="comment">* Project: CMSIS DSP Library </span> <a name="l00008"></a>00008 <span class="comment">* Title: arm_mean_q15.c </span> <a name="l00009"></a>00009 <span class="comment">* </span> <a name="l00010"></a>00010 <span class="comment">* Description: Mean value of a Q15 vector. </span> <a name="l00011"></a>00011 <span class="comment">* </span> <a name="l00012"></a>00012 <span class="comment">* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0</span> <a name="l00013"></a>00013 <span class="comment">* </span> <a name="l00014"></a>00014 <span class="comment">* Version 1.0.10 2011/7/15 </span> <a name="l00015"></a>00015 <span class="comment">* Big Endian support added and Merged M0 and M3/M4 Source code. </span> <a name="l00016"></a>00016 <span class="comment">* </span> <a name="l00017"></a>00017 <span class="comment">* Version 1.0.3 2010/11/29 </span> <a name="l00018"></a>00018 <span class="comment">* Re-organized the CMSIS folders and updated documentation. </span> <a name="l00019"></a>00019 <span class="comment">* </span> <a name="l00020"></a>00020 <span class="comment">* Version 1.0.2 2010/11/11 </span> <a name="l00021"></a>00021 <span class="comment">* Documentation updated. </span> <a name="l00022"></a>00022 <span class="comment">* </span> <a name="l00023"></a>00023 <span class="comment">* Version 1.0.1 2010/10/05 </span> <a name="l00024"></a>00024 <span class="comment">* Production release and review comments incorporated. </span> <a name="l00025"></a>00025 <span class="comment">* </span> <a name="l00026"></a>00026 <span class="comment">* Version 1.0.0 2010/09/20 </span> <a name="l00027"></a>00027 <span class="comment">* Production release and review comments incorporated. </span> <a name="l00028"></a>00028 <span class="comment">* -------------------------------------------------------------------- */</span> <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="arm__math_8h.html">arm_math.h</a>&quot;</span> <a name="l00031"></a>00031 <a name="l00061"></a><a class="code" href="group__mean.html#gac882495d5f098819fd3939c1ef7795b3">00061</a> <span class="keywordtype">void</span> <a class="code" href="group__mean.html#gac882495d5f098819fd3939c1ef7795b3" title="Mean value of a Q15 vector.">arm_mean_q15</a>( <a name="l00062"></a>00062 <a class="code" href="arm__math_8h.html#ab5a8fb21a5b3b983d5f54f31614052ea" title="16-bit fractional data type in 1.15 format.">q15_t</a> * pSrc, <a name="l00063"></a>00063 uint32_t <a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>, <a name="l00064"></a>00064 <a class="code" href="arm__math_8h.html#ab5a8fb21a5b3b983d5f54f31614052ea" title="16-bit fractional data type in 1.15 format.">q15_t</a> * pResult) <a name="l00065"></a>00065 { <a name="l00066"></a>00066 <a class="code" href="arm__math_8h.html#adc89a3547f5324b7b3b95adec3806bc0" title="32-bit fractional data type in 1.31 format.">q31_t</a> sum = 0; <span class="comment">/* Temporary result storage */</span> <a name="l00067"></a>00067 uint32_t blkCnt; <span class="comment">/* loop counter */</span> <a name="l00068"></a>00068 <a name="l00069"></a>00069 <span class="preprocessor">#ifndef ARM_MATH_CM0</span> <a name="l00070"></a>00070 <span class="preprocessor"></span> <a name="l00071"></a>00071 <span class="comment">/* Run the below code for Cortex-M4 and Cortex-M3 */</span> <a name="l00072"></a>00072 <a name="l00073"></a>00073 <span class="comment">/*loop Unrolling */</span> <a name="l00074"></a>00074 blkCnt = blockSize &gt;&gt; 2u; <a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="comment">/* First part of the processing with loop unrolling. Compute 4 outputs at a time. </span> <a name="l00077"></a>00077 <span class="comment"> ** a second loop below computes the remaining 1 to 3 samples. */</span> <a name="l00078"></a>00078 <span class="keywordflow">while</span>(blkCnt &gt; 0u) <a name="l00079"></a>00079 { <a name="l00080"></a>00080 <span class="comment">/* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */</span> <a name="l00081"></a>00081 sum += *pSrc++; <a name="l00082"></a>00082 sum += *pSrc++; <a name="l00083"></a>00083 sum += *pSrc++; <a name="l00084"></a>00084 sum += *pSrc++; <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="comment">/* Decrement the loop counter */</span> <a name="l00087"></a>00087 blkCnt--; <a name="l00088"></a>00088 } <a name="l00089"></a>00089 <a name="l00090"></a>00090 <span class="comment">/* If the blockSize is not a multiple of 4, compute any remaining output samples here. </span> <a name="l00091"></a>00091 <span class="comment"> ** No loop unrolling is used. */</span> <a name="l00092"></a>00092 blkCnt = blockSize % 0x4u; <a name="l00093"></a>00093 <a name="l00094"></a>00094 <span class="preprocessor">#else</span> <a name="l00095"></a>00095 <span class="preprocessor"></span> <a name="l00096"></a>00096 <span class="comment">/* Run the below code for Cortex-M0 */</span> <a name="l00097"></a>00097 <a name="l00098"></a>00098 <span class="comment">/* Loop over blockSize number of values */</span> <a name="l00099"></a>00099 blkCnt = <a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>; <a name="l00100"></a>00100 <a name="l00101"></a>00101 <span class="preprocessor">#endif </span><span class="comment">/* #ifndef ARM_MATH_CM0 */</span> <a name="l00102"></a>00102 <a name="l00103"></a>00103 <span class="keywordflow">while</span>(blkCnt &gt; 0u) <a name="l00104"></a>00104 { <a name="l00105"></a>00105 <span class="comment">/* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */</span> <a name="l00106"></a>00106 sum += *pSrc++; <a name="l00107"></a>00107 <a name="l00108"></a>00108 <span class="comment">/* Decrement the loop counter */</span> <a name="l00109"></a>00109 blkCnt--; <a name="l00110"></a>00110 } <a name="l00111"></a>00111 <a name="l00112"></a>00112 <span class="comment">/* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) / blockSize */</span> <a name="l00113"></a>00113 <span class="comment">/* Store the result to the destination */</span> <a name="l00114"></a>00114 *pResult = (<a class="code" href="arm__math_8h.html#ab5a8fb21a5b3b983d5f54f31614052ea" title="16-bit fractional data type in 1.15 format.">q15_t</a>) (sum / blockSize); <a name="l00115"></a>00115 } <a name="l00116"></a>00116 </pre></div></div> </div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address class="footer"><small>Generated on Fri Jul 15 2011 13:16:17 for CMSIS DSP Software Library by&#160; <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address> </body> </html>
zegervdv/STM-Quadcopter
firmware/STM32F3-Discovery_FW_V1.1.0/Libraries/CMSIS/Documentation/DSP_Lib/html/arm__mean__q15_8c_source.html
HTML
mit
11,838
require 'spec_helper' describe "gws_attendance_time_card", type: :feature, dbscope: :example do let(:site) { gws_site } let(:user) { gws_user } let!(:group1) { create :cms_group, name: "#{site.name}/#{unique_id}" } let!(:group2) { create :cms_group, name: "#{site.name}/#{unique_id}" } let!(:user1) { create :gws_user, gws_role_ids: user.gws_role_ids, group_ids: [ group1.id ] } let!(:user2) { create :gws_user, gws_role_ids: user.gws_role_ids, group_ids: [ group2.id ] } let(:now) { Time.zone.now } let(:this_month) { now.beginning_of_month } let!(:user1_this_month_time_card) do create :gws_attendance_time_card, :with_records, cur_site: site, cur_user: user1, date: this_month end let!(:user2_this_month_time_card) do create :gws_attendance_time_card, :with_records, cur_site: site, cur_user: user2, date: this_month end before { login_user user } describe 'search' do it do visit gws_attendance_main_path(site) within first(".mod-navi") do click_on I18n.t('modules.gws/attendance/management/time_card') end expect(page).to have_css(".list-item", count: 3) within ".index-search" do select group1.section_name, from: "s[group_id]" click_on I18n.t("ss.buttons.search") end expect(page).to have_css(".list-item", count: 1) month = I18n.l(this_month.to_date, format: :attendance_year_month) title = I18n.t('gws/attendance.formats.time_card_full_name', user_name: user1.name, month: month) expect(page).to have_css(".list-item", text: title) within ".index-search" do select group2.section_name, from: "s[group_id]" click_on I18n.t("ss.buttons.search") end expect(page).to have_css(".list-item", count: 1) month = I18n.l(this_month.to_date, format: :attendance_year_month) title = I18n.t('gws/attendance.formats.time_card_full_name', user_name: user2.name, month: month) expect(page).to have_css(".list-item", text: title) end end end
sunny4381/shirasagi
spec/features/gws/attendance/time_card/management/search_spec.rb
Ruby
mit
2,025
/*global define*/ /*jslint white:true,browser:true*/ define([ 'kb_common/html', 'kb_common/format', 'common/props', 'base/js/namespace' ], function (html, format, Props, Jupyter) { 'use strict'; function createMeta(cell, initial) { var meta = cell.metadata; meta.kbase = initial; cell.metadata = meta; } function getMeta(cell, group, name) { if (!cell.metadata.kbase) { return; } if (name === undefined) { return cell.metadata.kbase[group]; } if (!cell.metadata.kbase[group]) { return; } return cell.metadata.kbase[group][name]; } function setMeta(cell, group, name, value) { /* * This funny business is because the trigger on setting the metadata * property (via setter and getter in core Cell object) is only invoked * when the metadata preoperty is actually set -- doesn't count if * properties of it are. */ var temp = cell.metadata; // Handle the case of setting a group to an entire object if (value === undefined) { temp.kbase[group] = name; } else { if (!temp.kbase[group]) { temp.kbase[group] = {}; } temp.kbase[group][name] = value; } cell.metadata = temp; } function pushMeta(cell, props, value) { var meta = Props.make(cell.metadata.kbase); meta.incrItem(props, value); } function getTitle(cellId) { var cells = Jupyter.notebook.get_cells().filter(function (cell) { return (cellId === Props.getDataItem(cell.metadata, 'kbase.attributes.id')); }); if (cells.length === 0) { return; } return Props.getDataItem(cells[0].metadata, 'kbase.attributes.title'); } function findById(id) { var matchingCells = Jupyter.notebook.get_cells().filter(function (cell) { if (cell.metadata && cell.metadata.kbase && cell.metadata.kbase.attributes) { return (cell.metadata.kbase.attributes.id === id); } return false; }); if (matchingCells.length === 1) { return matchingCells[0]; } if (matchingCells.length > 1) { console.warn('Too many cells matched the given id: ' + id); } return null; } return { createMeta: createMeta, getMeta: getMeta, setMeta: setMeta, pushMeta: pushMeta, getTitle: getTitle, findById: findById }; });
pranjan77/narrative
kbase-extension/static/kbase/js/common/cellUtils.js
JavaScript
mit
2,645
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="SocketTcp.cs" company="Exit Games GmbH"> // Copyright (c) Exit Games GmbH. All rights reserved. // </copyright> // <summary> // Internal class to encapsulate the network i/o functionality for the realtime libary. // </summary> // <author>developer@exitgames.com</author> // -------------------------------------------------------------------------------------------------------------------- using System; using System.Collections; using UnityEngine; #if UNITY_WEBGL namespace ExitGames.Client.Photon { /// <summary> /// Internal class to encapsulate the network i/o functionality for the realtime libary. /// </summary> internal class SocketWebTcp : IPhotonSocket, IDisposable { private WebSocket sock; private readonly object syncer = new object(); public SocketWebTcp(PeerBase npeer) : base(npeer) { ServerAddress = npeer.ServerAddress; if (this.ReportDebugOfLevel(DebugLevel.INFO)) { Listener.DebugReturn(DebugLevel.INFO, "new SocketWebTcp() " + ServerAddress); } Protocol = ConnectionProtocol.Tcp; PollReceive = false; } public void Dispose() { this.State = PhotonSocketState.Disconnecting; if (this.sock != null) { try { if (this.sock.Connected) this.sock.Close(); } catch (Exception ex) { this.EnqueueDebugReturn(DebugLevel.INFO, "Exception in Dispose(): " + ex); } } this.sock = null; this.State = PhotonSocketState.Disconnected; } GameObject websocketConnectionObject; public override bool Connect() { //bool baseOk = base.Connect(); //if (!baseOk) //{ // return false; //} State = PhotonSocketState.Connecting; if (websocketConnectionObject != null) { UnityEngine.Object.Destroy(websocketConnectionObject); } websocketConnectionObject = new GameObject("websocketConnectionObject"); MonoBehaviour mb = websocketConnectionObject.AddComponent<MonoBehaviour>(); // TODO: not hidden for debug //websocketConnectionObject.hideFlags = HideFlags.HideInHierarchy; UnityEngine.Object.DontDestroyOnLoad(websocketConnectionObject); this.sock = new WebSocket(new Uri(ServerAddress)); mb.StartCoroutine(this.sock.Connect()); mb.StartCoroutine(ReceiveLoop()); return true; } public override bool Disconnect() { if (ReportDebugOfLevel(DebugLevel.INFO)) { this.Listener.DebugReturn(DebugLevel.INFO, "SocketTcp.Disconnect()"); } State = PhotonSocketState.Disconnecting; lock (this.syncer) { if (this.sock != null) { try { this.sock.Close(); } catch (Exception ex) { this.Listener.DebugReturn(DebugLevel.ERROR, "Exception in Disconnect(): " + ex); } this.sock = null; } } if (websocketConnectionObject != null) { UnityEngine.Object.Destroy(websocketConnectionObject); } State = PhotonSocketState.Disconnected; return true; } /// <summary> /// used by TPeer* /// </summary> public override PhotonSocketError Send(byte[] data, int length) { if (this.State != PhotonSocketState.Connected) { return PhotonSocketError.Skipped; } try { if (this.ReportDebugOfLevel(DebugLevel.ALL)) { this.Listener.DebugReturn(DebugLevel.ALL, "Sending: " + SupportClass.ByteArrayToString(data)); } this.sock.Send(data); } catch (Exception e) { this.Listener.DebugReturn(DebugLevel.ERROR, "Cannot send to: " + this.ServerAddress + ". " + e.Message); HandleException(StatusCode.Exception); return PhotonSocketError.Exception; } return PhotonSocketError.Success; } public override PhotonSocketError Receive(out byte[] data) { data = null; return PhotonSocketError.NoData; } internal const int ALL_HEADER_BYTES = 9; internal const int TCP_HEADER_BYTES = 7; internal const int MSG_HEADER_BYTES = 2; public IEnumerator ReceiveLoop() { this.Listener.DebugReturn(DebugLevel.INFO, "ReceiveLoop()"); while (!this.sock.Connected && this.sock.Error == null) { yield return new WaitForSeconds(0.1f); } if (this.sock.Error != null) { this.Listener.DebugReturn(DebugLevel.ERROR, "Exiting receive thread due to error: " + this.sock.Error + " Server: " + this.ServerAddress); this.HandleException(StatusCode.ExceptionOnConnect); } else { if (this.ReportDebugOfLevel(DebugLevel.ALL)) { this.Listener.DebugReturn(DebugLevel.ALL, "Receiving by websocket. this.State: " + State); } State = PhotonSocketState.Connected; while (State == PhotonSocketState.Connected) { if (this.sock.Error != null) { this.Listener.DebugReturn(DebugLevel.ERROR, "Exiting receive thread (inside loop) due to error: " + this.sock.Error + " Server: " + this.ServerAddress); this.HandleException(StatusCode.ExceptionOnReceive); break; } else { byte[] inBuff = this.sock.Recv(); if (inBuff == null || inBuff.Length == 0) { yield return new WaitForSeconds(0.1f); continue; } if (this.ReportDebugOfLevel(DebugLevel.ALL)) { this.Listener.DebugReturn(DebugLevel.ALL, "TCP << " + inBuff.Length + " = " + SupportClass.ByteArrayToString(inBuff)); } // check if it's a ping-result (first byte = 0xF0). this is 9 bytes in total. no other headers! // note: its a coincidence that ping-result-size == header-size. if this changes we have to refactor this if (inBuff[0] == 0xF0) { try { HandleReceivedDatagram(inBuff, inBuff.Length, false); } catch (Exception e) { if (this.ReportDebugOfLevel(DebugLevel.ERROR)) { this.EnqueueDebugReturn(DebugLevel.ERROR, "Receive issue. State: " + this.State + ". Server: '" + this.ServerAddress + "' Exception: " + e); } this.HandleException(StatusCode.ExceptionOnReceive); } continue; } // get data and split the datagram into two buffers: head and body if (inBuff.Length > 0) { try { HandleReceivedDatagram(inBuff, inBuff.Length, false); } catch (Exception e) { if (this.ReportDebugOfLevel(DebugLevel.ERROR)) { this.EnqueueDebugReturn(DebugLevel.ERROR, "Receive issue. State: " + this.State + ". Server: '" + this.ServerAddress + "' Exception: " + e); } this.HandleException(StatusCode.ExceptionOnReceive); } } } } } Disconnect(); } } } #endif
wendellpbarreto/glitch
Assets/Photon Unity Networking/Plugins/PhotonNetwork/SocketWebTcp.cs
C#
mit
8,236
import { Component } from '@angular/core'; import { generatedata } from '../../../sampledata/generatedata'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent { source: any = { localData: generatedata(200, false), dataType: 'array', datafields: [ { name: 'firstname', type: 'string' }, { name: 'lastname', type: 'string' }, { name: 'productname', type: 'string' }, { name: 'quantity', type: 'number' }, { name: 'price', type: 'number' } ], updateRow: function (rowid, rowdata, commit) { // synchronize with the server - send update command commit(true); } }; dataAdapter: any = new jqx.dataAdapter(this.source); columns: any[] = [ { text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 90 }, { text: 'Last Name', datafield: 'lastname', columntype: 'textbox', width: 90 }, { text: 'Product', datafield: 'productname', width: 170 }, { text: 'Quantity', datafield: 'quantity', width: 100, align: 'right', cellsAlign: 'right', cellsFormat: 'n2' }, { text: 'Price', datafield: 'price', cellsAlign: 'right', align: 'right', cellsFormat: 'c2', aggregates: [{ 'Total': (aggregatedValue: number, currentValue: number, column: any, record: any): number => { let total = currentValue * parseInt(record['quantity']); return aggregatedValue + total; } }], aggregatesRenderer: (aggregates: any, column: any, element: any): string => { let renderString = '<div style="margin: 4px; float: right; height: 100%;">'; renderString += '<strong>Total: </strong>' + aggregates.Total + '</div>'; return renderString; } } ]; }
luissancheza/sice
js/jqwidgets/demos/angular/app/datatable/aggregatestemplate/app.component.ts
TypeScript
mit
2,000
angular.module('ntt.TreeDnD') .directive( 'treeDnd', fnInitTreeDnD); fnInitTreeDnD.$inject = [ '$timeout', '$http', '$compile', '$parse', '$window', '$document', '$templateCache', '$TreeDnDTemplate', '$TreeDnDClass', '$TreeDnDHelper', '$TreeDnDPlugin', '$TreeDnDViewport' ]; function fnInitTreeDnD($timeout, $http, $compile, $parse, $window, $document, $templateCache, $TreeDnDTemplate, $TreeDnDClass, $TreeDnDHelper, $TreeDnDPlugin, $TreeDnDViewport ) { return { restrict: 'E', scope: true, replace: true, controller: ['$scope', '$element', '$attrs', fnController], compile: fnCompile }; function fnController($scope, $element, $attrs) { $scope.indent = 20; $scope.indent_plus = 15; $scope.indent_unit = 'px'; $scope.$tree_class = 'table'; $scope.primary_key = '__uid__'; $scope.$type = 'TreeDnD'; // $scope.enabledFilter = null; $scope.colDefinitions = []; $scope.$globals = {}; $scope.$class = {}; $scope.treeData = []; $scope.tree_nodes = []; $scope.$class = angular.copy($TreeDnDClass); angular.extend( $scope.$class.icon, { '1': $attrs.iconExpand || 'glyphicon glyphicon-minus', '0': $attrs.iconCollapse || 'glyphicon glyphicon-plus', '-1': $attrs.iconLeaf || 'glyphicon glyphicon-file' } ); $scope.for_all_descendants = function (node, fn, parent, checkSibling) { if (angular.isFunction(fn)) { var _i, _len, _nodes; if (fn(node, parent)) { return false; } _nodes = node.__children__; _len = _nodes.length; for (_i = 0; _i < _len; _i++) { if (!$scope.for_all_descendants(_nodes[_i], fn, node) && !checkSibling) { return false; } } } return true; }; $scope.getLastDescendant = function (node) { var last_child, n; if (!node) { node = $scope.tree ? $scope.tree.selected_node : false; } if (node === false) { return false; } n = node.__children__.length; if (n === 0) { return node; } else { last_child = node.__children__[n - 1]; return $scope.getLastDescendant(last_child); } }; $scope.getElementChilds = function () { return angular.element($element[0].querySelector('[tree-dnd-nodes]')); }; $scope.onClick = function (node) { if (angular.isDefined($scope.tree) && angular.isFunction($scope.tree.on_click)) { // We want to detach from Angular's digest cycle so we can // independently measure the time for one cycle. setTimeout( function () { $scope.tree.on_click(node); }, 0 ); } }; $scope.onSelect = function (node) { if (angular.isDefined($scope.tree)) { if (node !== $scope.tree.selected_node) { $scope.tree.select_node(node); } if (angular.isFunction($scope.tree.on_select)) { setTimeout( function () { $scope.tree.on_select(node); }, 0 ); } } }; var passedExpand, _clone; $scope.toggleExpand = function (node, fnCallback) { passedExpand = true; if (angular.isFunction(fnCallback) && !fnCallback(node)) { passedExpand = false; } else if (angular.isFunction($scope.$callbacks.expand) && !$scope.$callbacks.expand(node)) { passedExpand = false; } if (passedExpand) { if (node.__children__.length > 0) { node.__expanded__ = !node.__expanded__; } } }; $scope.getHash = function (node) { return '#' + node.__parent__ + '#' + node[$scope.primary_key]; }; $scope.$callbacks = { for_all_descendants: $scope.for_all_descendants, /*expand: function (node) { return true; },*/ accept: function (dragInfo, moveTo, isChanged) { return $scope.dropEnabled === true; }, calsIndent: function (level, skipUnit, skipEdge) { var unit = 0, edge = skipEdge ? 0 : $scope.indent_plus; if (!skipUnit) { unit = $scope.indent_unit ? $scope.indent_unit : 'px'; } if (level - 1 < 1) { return edge + unit; } else { return $scope.indent * (level - 1) + edge + unit; } }, droppable: function () { return $scope.dropEnabled === true; }, draggable: function () { return $scope.dragEnabled === true; }, beforeDrop: function (event) { return true; }, changeKey: function (node) { var _key = node.__uid__; node.__uid__ = Math.random(); if (node.__selected__) { delete node.__selected__; } if ($scope.primary_key !== '__uid__') { _key = '' + node[$scope.primary_key]; _key = _key.replace(/_#.+$/g, '') + '_#' + node.__uid__; node[$scope.primary_key] = _key; } // delete(node.__hashKey__); }, clone: function (node, _this) { _clone = angular.copy(node); this.for_all_descendants(_clone, this.changeKey); return _clone; }, remove: function (node, parent, _this, keepReload) { var temp = parent.splice(node.__index__, 1)[0]; if(!keepReload){ $scope.reload_data(); } return temp; }, add: function (node, pos, parent, _this) { if (parent) { if (parent.length > -1) { if (pos > -1) { parent.splice(pos, 0, node); } else { // todo If children need load crazy parent.push(node); } } else { parent.push(node); } } } }; $scope.deleteScope = function (scope, node) { var _hash = node.__hashKey__; if ($scope.$globals[_hash] && $scope.$globals[_hash] === scope) { delete $scope.$globals[_hash]; } }; $scope.setScope = function (scope, node) { var _hash = node.__hashKey__; if ($scope.$globals[_hash] !== scope) { $scope.$globals[_hash] = scope; } }; $scope.getScope = function (node) { var _hash = node.__hashKey__; if (node) { return $scope.$globals[_hash]; } return $scope; }; if ($attrs.enableDrag || $attrs.enableDrop) { $scope.placeElm = null; // $scope.dragBorder = 30; $scope.dragEnabled = null; $scope.dropEnabled = null; $scope.horizontal = null; if ($attrs.enableDrag) { $scope.dragDelay = 0; $scope.enabledMove = true; $scope.statusMove = true; $scope.enabledHotkey = false; $scope.enabledCollapse = null; $scope.statusElm = null; $scope.dragging = null; angular.extend( $scope.$callbacks, { beforeDrag: function (scopeDrag) { return true; }, dragStop: function (event, skiped) { if (!event || !event.changed || !skiped) { return null; } event.target.reload_data(); if (event.target !== event.drag && event.drag.enabledMove) { event.drag.reload_data(); } }, dropped: function (info, pass) { if (!info) { return null; } var _node = info.node, _nodeAdd = null, _move = info.move, _parent = null, _parentRemove = info.parent || info.drag.treeData, _parentAdd = _move.parent || info.target.treeData, isMove = info.drag.enabledMove; if (!info.changed && isMove) { return false; } if (info.target.$callbacks.accept(info, info.move, info.changed)) { if (isMove) { _parent = _parentRemove; if (angular.isDefined(_parent.__children__)) { _parent = _parent.__children__; } _nodeAdd = info.drag.$callbacks.remove( _node, _parent, info.drag.$callbacks, true // keep reload ); } else { _nodeAdd = info.drag.$callbacks.clone(_node, info.drag.$callbacks); } // if node dragging change index in sample node parent // and index node decrement if (isMove && info.drag === info.target && _parentRemove === _parentAdd && _move.pos >= info.node.__index__) { _move.pos--; } _parent = _parentAdd; if (_parent.__children__) { _parent = _parent.__children__; } info.target.$callbacks.add( _nodeAdd, _move.pos, _parent, info.drag.$callbacks ); return true; } return false; }, dragStart: function (event) { }, dragMove: function (event) { } } ); $scope.setDragging = function (dragInfo) { $scope.dragging = dragInfo; }; $scope.enableMove = function (val) { if (typeof val === 'boolean') { $scope.enabledMove = val; } else { $scope.enabledMove = true; } }; if ($attrs.enableStatus) { $scope.enabledStatus = false; $scope.hideStatus = function () { if ($scope.statusElm) { $scope.statusElm.addClass($scope.$class.hidden); } }; $scope.refreshStatus = function () { if (!$scope.dragging) { return; } if ($scope.enabledStatus) { var statusElmOld = $scope.statusElm; if ($scope.enabledMove) { $scope.statusElm = angular.element($TreeDnDTemplate.getMove($scope)); } else { $scope.statusElm = angular.element($TreeDnDTemplate.getCopy($scope)); } if (statusElmOld !== $scope.statusElm) { if (statusElmOld) { $scope.statusElm.attr('class', statusElmOld.attr('class')); $scope.statusElm.attr('style', statusElmOld.attr('style')); statusElmOld.remove(); } $document.find('body').append($scope.statusElm); } $scope.statusElm.removeClass($scope.$class.hidden); } }; $scope.setPositionStatus = function (e) { if ($scope.statusElm) { $scope.statusElm.css( { 'left': e.pageX + 10 + 'px', 'top': e.pageY + 15 + 'px', 'z-index': 9999 } ); $scope.statusElm.addClass($scope.$class.status); } }; } } $scope.targeting = false; $scope.getPrevSibling = function (node) { if (node && node.__index__ > 0) { var _parent, _index = node.__index__ - 1; if (angular.isDefined(node.__parent_real__)) { _parent = $scope.tree_nodes[node.__parent_real__]; return _parent.__children__[_index]; } return $scope.treeData[_index]; } return null; }; $scope.getNode = function (index) { if (angular.isUndefinedOrNull(index)) { return null; } return $scope.tree_nodes[index]; }; $scope.initPlace = function (element, dragElm) { if (!$scope.placeElm) { if ($scope.isTable) { $scope.placeElm = angular.element($window.document.createElement('tr')); var _len_down = $scope.colDefinitions.length; $scope.placeElm.append( angular.element($window.document.createElement('td')) .addClass($scope.$class.empty) .addClass('indented') .addClass($scope.$class.place) ); while (_len_down-- > 0) { $scope.placeElm.append( angular.element($window.document.createElement('td')) .addClass($scope.$class.empty) .addClass($scope.$class.place) ); } } else { $scope.placeElm = angular.element($window.document.createElement('li')) .addClass($scope.$class.empty) .addClass($scope.$class.place); } } if (dragElm) { $scope.placeElm.css('height', $TreeDnDHelper.height(dragElm) + 'px'); } if (element) { element[0].parentNode.insertBefore($scope.placeElm[0], element[0]); } else { $scope.getElementChilds().append($scope.placeElm); } return $scope.placeElm; }; $scope.hidePlace = function () { if ($scope.placeElm) { $scope.placeElm.addClass($scope.$class.hidden); } }; $scope.showPlace = function () { if ($scope.placeElm) { $scope.placeElm.removeClass($scope.$class.hidden); } }; $scope.getScopeTree = function () { return $scope; }; } $scope.$safeApply = $safeApply; var _fnInitFilter, _fnInitOrderBy, _fnGetControl, _defaultFilterOption = { showParent: true, showChild: false, beginAnd: true }, tree, _watches = [ [ 'enableDrag', [ ['boolean', 'enableStatus', null, 'enabledStatus'], ['boolean', 'enableMove', null, 'enabledMove'], ['number', 'dragDelay', 0, null, 0], ['boolean', 'enableCollapse', null, 'enabledCollapse'], [ 'boolean', 'enableHotkey', null, 'enabledHotkey', null, function (isHotkey) { if (isHotkey) { $scope.enabledMove = false; } else { $scope.enabledMove = $scope.statusMove; } }] ]], [ ['enableDrag', 'enableStatus'], [ [ 'string', 'templateCopy', $attrs.templateCopy, 'templateCopy', null, function (_url) { if (_url && $templateCache.get(_url)) { $TreeDnDTemplate.setCopy(_url, $scope); } }], [ 'string', 'templateMove', $attrs.templateMove, 'templateMove', null, function (_url) { if (_url && $templateCache.get(_url)) { $TreeDnDTemplate.setMove(_url, $scope); } }] ]], [ [['enableDrag', 'enableDrop']], [ ['number', 'dragBorder', 30, 'dragBorder', 30]] ], [ '*', [ ['boolean', 'treeTable', true, 'treeTable', null], ['boolean', 'horizontal'], [ 'callback', 'treeClass', function (val) { switch (typeof val) { case 'string': $scope.$tree_class = val; break; case 'object': angular.extend($scope.$class, val); $scope.$tree_class = $scope.$class.tree; break; default: $scope.$tree_class = $attrs.treeClass; break; } }, 'treeClass', function () { $scope.$tree_class = $scope.$class.tree + ' table'; }, null, function () { if (/^(\s+[\w\-]+){2,}$/g.test(' ' + $attrs.treeClass)) { $scope.$tree_class = $attrs.treeClass.trim(); return true; } }], [ ['object', 'string'], 'expandOn', getExpandOn, 'expandingProperty', getExpandOn, function (expandOn) { if (angular.isUndefinedOrNull(expandOn)) { $scope.expandingProperty = $attrs.expandOn; } }], [ 'object', 'treeControl', angular.isDefined($scope.tree) ? $scope.tree : {}, 'tree', null, function ($tree) { if (!angular.isFunction(_fnGetControl)) { _fnGetControl = $TreeDnDPlugin('$TreeDnDControl'); } if (angular.isFunction(_fnGetControl)) { tree = angular.extend( $tree, _fnGetControl($scope) ); } }], [ ['array', 'object'], 'columnDefs', getColDefs, 'colDefinitions', getColDefs, function (colDefs) { if (angular.isUndefinedOrNull(colDefs) || !angular.isArray(colDefs)) { $scope.colDefinitions = getColDefs(); } }], [['object', 'string', 'array', 'function'], 'orderBy', $attrs.orderBy], [ ['object', 'array'], 'filter', null, 'filter', null, function (filters) { var _passed = false; if (angular.isDefined(filters) && !angular.isArray(filters)) { var _keysF = Object.keys(filters), _lenF = _keysF.length, _iF; if (_lenF > 0) { for (_iF = 0; _iF < _lenF; _iF++) { if (typeof filters[_keysF[_iF]] === 'string' && filters[_keysF[_iF]].length === 0) { continue; } _passed = true; break; } } } $scope.enabledFilter = _passed; reload_data(); }], [ 'object', 'filterOptions', _defaultFilterOption, 'filterOptions', _defaultFilterOption, function (option) { if (typeof option === 'object') { $scope.filterOptions = angular.extend(_defaultFilterOption, option); } }], ['string', 'primaryKey', $attrs.primaryKey, 'primary_key', '__uid__'], ['string', 'indentUnit', $attrs.indentUnit, 'indent_unit'], ['number', 'indent', 30, null, 30], ['number', 'indentPlus', 20, null, 20], [ 'null', 'callbacks', function (optCallbacks) { angular.forEach( optCallbacks, function (value, key) { if (typeof value === 'function') { if ($scope.$callbacks[key]) { $scope.$callbacks[key] = value; } } } ); return $scope.$callbacks; }, '$callbacks' ], [ 'number', 'expandLevel', 3, 'expandLevel', 3, function () { reload_data(); }], ['number', 'treeLimit', 100, '$TreeLimit', 100], ['boolean', 'enableDrag', null, 'dragEnabled'], ['boolean', 'enableDrop', null, 'dropEnabled'] ]] ], w, lenW = _watches.length, i, len, _curW, _typeW, _nameW, _defaultW, _scopeW, _NotW, _AfterW, _BeforeW, // debounce reload_Data; timeReloadData, tmpTreeData; for (w = 0; w < lenW; w++) { // skip if not exist if (!check_exist_attr($attrs, _watches[w][0], true)) { continue; } _curW = _watches[w][1]; for (i = 0, len = _curW.length; i < len; i++) { _typeW = _curW[i][0]; _nameW = _curW[i][1]; _defaultW = _curW[i][2]; _scopeW = _curW[i][3]; _NotW = _curW[i][4]; _AfterW = _curW[i][5]; _BeforeW = _curW[i][6]; generateWatch(_typeW, _nameW, _defaultW, _scopeW, _NotW, _AfterW, _BeforeW); } } if ($attrs.treeData) { $scope.$watch( $attrs.treeData, function (val) { if (angular.equals(val, $scope.treeData)) { return; } tmpTreeData = val; if (angular.isUndefinedOrNull(timeReloadData)) { timeReloadData = $timeout(timeLoadData, 350); } }, true ); } function timeLoadData() { $scope.treeData = tmpTreeData; reload_data(); timeReloadData = null; } $scope.updateLimit = function updateLimit() { //console.log('Call fn UpdateLimit'); $scope.$TreeLimit += 50; }; $scope.reload_data = reload_data; function check_exist_attr(attrs, existAttr, isAnd) { if (angular.isUndefinedOrNull(existAttr)) { return false; } if (existAttr === '*' || !angular.isUndefined(attrs[existAttr])) { return true; } if (angular.isArray(existAttr)) { return for_each_attrs(attrs, existAttr, isAnd); } } function for_each_attrs(attrs, exist, isAnd) { var i, len = exist.length, passed = false; if (len === 0) { return null; } for (i = 0; i < len; i++) { if (check_exist_attr(attrs, exist[i], !isAnd)) { passed = true; if (!isAnd) { return true; } } else { if (isAnd) { return false; } } } return passed; } function generateWatch(type, nameAttr, valDefault, nameScope, fnNotExist, fnAfter, fnBefore ) { nameScope = nameScope || nameAttr; if (typeof type === 'string' || angular.isArray(type)) { if (angular.isFunction(fnBefore) && fnBefore()) { return;//jmp } if (typeof $attrs[nameAttr] === 'string') { $scope.$watch( $attrs[nameAttr], function (val) { if (typeof type === 'string' && typeof val === type || angular.isArray(type) && type.indexOf(typeof val) > -1 ) { $scope[nameScope] = val; } else { if (angular.isFunction(valDefault)) { $scope[nameScope] = valDefault(val); } else { $scope[nameScope] = valDefault; } } if (angular.isFunction(fnAfter)) { fnAfter($scope[nameScope], $scope); } }, true ); } else { if (angular.isFunction(fnNotExist)) { $scope[nameScope] = fnNotExist(); } else if (!angular.isUndefined(fnNotExist)) { $scope[nameScope] = fnNotExist; } } } } function $safeApply(fn) { var phase = this.$root.$$phase; if (phase === '$apply' || phase === '$digest') { if (fn && typeof fn === 'function') { fn(); } } else { this.$apply(fn); } } function getExpandOn() { if ($scope.treeData && $scope.treeData.length) { var _firstNode = $scope.treeData[0], _keys = Object.keys(_firstNode), _regex = new RegExp('^__([a-zA-Z0-9_\-]*)__$'), _len, i; // Auto get first field with type is string; for (i = 0, _len = _keys.length; i < _len; i++) { if (typeof _firstNode[_keys[i]] === 'string' && !_regex.test(_keys[i])) { $scope.expandingProperty = _keys[i]; return; } } // Auto get first if (angular.isUndefinedOrNull($scope.expandingProperty)) { $scope.expandingProperty = _keys[0]; } } } function getColDefs() { // Auto get Defs except attribute __level__ .... if ($scope.treeData.length) { var _col_defs = [], _firstNode = $scope.treeData[0], _regex = new RegExp('(^__([a-zA-Z0-9_\-]*)__$|^' + $scope.expandingProperty + '$)'), _keys = Object.keys(_firstNode), i, _len; // Auto get first field with type is string; for (i = 0, _len = _keys.length; i < _len; i++) { if (typeof _firstNode[_keys[i]] === 'string' && !_regex.test(_keys[i])) { _col_defs.push( { field: _keys[i] } ); } } $scope.colDefinitions = _col_defs; } } function do_f(root, node, parent, parent_real, level, visible, index) { var _i, _len, _icon, _index_real, _dept, _hashKey; if (!angular.isArray(node.__children__)) { node.__children__ = []; } node.__parent_real__ = parent_real; node.__parent__ = parent; _len = node.__children__.length; if (angular.isUndefinedOrNull(node.__expanded__) && _len > 0) { node.__expanded__ = level < $scope.expandLevel; } if (_len === 0) { _icon = -1; } else { if (node.__expanded__) { _icon = 1; } else { _icon = 0; } } // Insert item vertically _index_real = root.length; node.__index__ = index; node.__index_real__ = _index_real; node.__level__ = level; node.__icon__ = _icon; node.__icon_class__ = $scope.$class.icon[_icon]; node.__visible__ = !!visible; if (angular.isUndefinedOrNull(node.__uid__)) { node.__uid__ = '' + Math.random(); } _hashKey = $scope.getHash(node); if (angular.isUndefinedOrNull(node.__hashKey__) || node.__hashKey__ !== _hashKey) { node.__hashKey__ = _hashKey; } root.push(node); // Check node children _dept = 1; if (_len > 0) { for (_i = 0; _i < _len; _i++) { _dept += do_f( root, node.__children__[_i], node[$scope.primary_key], _index_real, level + 1, visible && node.__expanded__, _i ); } } node.__dept__ = _dept; return _dept; } function reload_data(oData) { console.time('Reload_Data'); var _data, _len, _tree_nodes = []; if (angular.isDefined(oData)) { if (!angular.isArray(oData) || oData.length === 0) { return []; } else { _data = oData; } } else if (!angular.isArray($scope.treeData) || $scope.treeData.length === 0) { return []; } else { _data = $scope.treeData; } if (!$attrs.expandOn) { getExpandOn(); } if (!$attrs.columnDefs) { getColDefs(); } if (angular.isDefined($scope.orderBy)) { if (!angular.isFunction(_fnInitOrderBy)) { _fnInitOrderBy = $TreeDnDPlugin('$TreeDnDOrderBy'); } if (angular.isFunction(_fnInitOrderBy)) { _data = _fnInitOrderBy(_data, $scope.orderBy); } } if (angular.isDefined($scope.filter)) { if (!angular.isFunction(_fnInitFilter)) { _fnInitFilter = $TreeDnDPlugin('$TreeDnDFilter'); } if (angular.isFunction(_fnInitFilter)) { _data = _fnInitFilter(_data, $scope.filter, $scope.filterOptions); } } _len = _data.length; if (_len > 0) { var _i, _deptTotal = 0; for (_i = 0; _i < _len; _i++) { _deptTotal += do_f(_tree_nodes, _data[_i], null, null, 1, true, _i); } } // clear memory if (angular.isDefined($scope.tree_nodes)) { delete $scope.tree_nodes; } $scope.tree_nodes = _tree_nodes; console.timeEnd('Reload_Data'); return _tree_nodes; } } function fnCompile(tElement) { var $_Template = '', _element = tElement.html().trim(); if (_element.length > 0) { $_Template = _element; tElement.html(''); } return function fnPost(scope, element, attrs) { if (attrs.enableDrag) { var _fnInitDrag = $TreeDnDPlugin('$TreeDnDDrag'); if (angular.isFunction(_fnInitDrag)) { _fnInitDrag(scope, element, $window, $document); } } // kick out $digest element.ready(function () { // apply Template function checkTreeTable(template, scope) { var elemNode = template[0].querySelector('[tree-dnd-node]'), attrInclude; scope.isTable = null; if (elemNode) { elemNode = angular.element(elemNode); attrInclude = elemNode.attr('ng-include'); } else { return; } if (attrInclude) { var treeInclude = $parse(attrInclude)(scope) || attrInclude; if (typeof treeInclude === 'string') { return $http.get( treeInclude, {cache: $templateCache} ).success( function (data) { data = data.trim(); //scope.templateNode = data; var tempDiv = document.createElement('div'); tempDiv.innerHTML = data; tempDiv = angular.element(tempDiv); scope.isTable = !tempDiv[0].querySelector('[tree-dnd-nodes]'); } ); } } else { scope.isTable = !elemNode[0].querySelector('[tree-dnd-nodes]'); //scope.templateNode = elemNode.html(); } $TreeDnDViewport.setTemplate(scope, scope.templateNode); //elemNode.html(''); } //scope.$watch(tableDataLoaded, transformTable); /* function tableDataLoaded(elem) { // first cell in the tbody exists when data is loaded but doesn't have a width // until after the table is transformed var firstCell = elem.querySelector('tbody tr:first-child td:first-child'); return firstCell && !firstCell.style.width; } function transformTable(elem, attrs) { // reset display styles so column widths are correct when measured below angular.element(elem.querySelectorAll('thead, tbody, tfoot')).css('display', ''); // wrap in $timeout to give table a chance to finish rendering $timeout(function () { // set widths of columns angular.forEach(elem.querySelectorAll('tr:first-child th'), function (thElem, i) { var tdElems = elem.querySelector('tbody tr:first-child td:nth-child(' + (i + 1) + ')'); var tfElems = elem.querySelector('tfoot tr:first-child td:nth-child(' + (i + 1) + ')'); var columnWidth = tdElems ? tdElems.offsetWidth : thElem.offsetWidth; if (tdElems) { tdElems.style.width = columnWidth + 'px'; } if (thElem) { thElem.style.width = columnWidth + 'px'; } if (tfElems) { tfElems.style.width = columnWidth + 'px'; } }); // set css styles on thead and tbody angular.element(elem.querySelectorAll('thead, tfoot')).css('display', 'block'); angular.element(elem.querySelectorAll('tbody')).css({ 'display': 'block', 'height': attrs.tableHeight || 'inherit', 'overflow': 'auto' }); // reduce width of last column by width of scrollbar var tbody = elem.querySelector('tbody'); var scrollBarWidth = tbody.offsetWidth - tbody.clientWidth; if (scrollBarWidth > 0) { // for some reason trimming the width by 2px lines everything up better scrollBarWidth -= 2; var lastColumn = elem.querySelector('tbody tr:first-child td:last-child'); lastColumn.style.width = lastColumn.offsetWidth - scrollBarWidth + 'px'; } }); }*/ var promiseCheck; if ($_Template.length > 0) { promiseCheck = checkTreeTable(angular.element($_Template.trim()), scope); if (typeof promiseCheck === 'object') { promiseCheck.then(function () { element.append($compile($_Template)(scope)); }); } else { element.append($compile($_Template)(scope)); } } else { $http.get( attrs.templateUrl || $TreeDnDTemplate.getPath(), {cache: $templateCache} ).success( function (data) { data = angular.element(data.trim()); promiseCheck = checkTreeTable(data, scope); if (typeof promiseCheck === 'object') { promiseCheck.then(function () { element.append($compile(data)(scope)); }); } else { element.append($compile(data)(scope)); } } ); } }) }; } }
iDay/angular-tree-dnd
src/directive/angular-tree-dnd.js
JavaScript
mit
42,638
(function () { /* Imports */ var Meteor = Package.meteor.Meteor; var HTML = Package.htmljs.HTML; var Tracker = Package.tracker.Tracker; var Deps = Package.tracker.Deps; var Blaze = Package.blaze.Blaze; var UI = Package.blaze.UI; var Handlebars = Package.blaze.Handlebars; var ObserveSequence = Package['observe-sequence'].ObserveSequence; /* Package-scope variables */ var Spacebars; (function () { /////////////////////////////////////////////////////////////////////////////////// // // // packages/spacebars/spacebars-runtime.js // // // /////////////////////////////////////////////////////////////////////////////////// // Spacebars = {}; // 1 // 2 var tripleEquals = function (a, b) { return a === b; }; // 3 // 4 Spacebars.include = function (templateOrFunction, contentFunc, elseFunc) { // 5 if (! templateOrFunction) // 6 return null; // 7 // 8 if (typeof templateOrFunction !== 'function') { // 9 var template = templateOrFunction; // 10 if (! Blaze.isTemplate(template)) // 11 throw new Error("Expected template or null, found: " + template); // 12 return templateOrFunction.constructView(contentFunc, elseFunc); // 13 } // 14 // 15 var templateVar = Blaze.ReactiveVar(null, tripleEquals); // 16 var view = Blaze.View('Spacebars.include', function () { // 17 var template = templateVar.get(); // 18 if (template === null) // 19 return null; // 20 // 21 if (! Blaze.isTemplate(template)) // 22 throw new Error("Expected template or null, found: " + template); // 23 // 24 return template.constructView(contentFunc, elseFunc); // 25 }); // 26 view.__templateVar = templateVar; // 27 view.onViewCreated(function () { // 28 this.autorun(function () { // 29 templateVar.set(templateOrFunction()); // 30 }); // 31 }); // 32 // 33 return view; // 34 }; // 35 // 36 // Executes `{{foo bar baz}}` when called on `(foo, bar, baz)`. // 37 // If `bar` and `baz` are functions, they are called before // 38 // `foo` is called on them. // 39 // // 40 // This is the shared part of Spacebars.mustache and // 41 // Spacebars.attrMustache, which differ in how they post-process the // 42 // result. // 43 Spacebars.mustacheImpl = function (value/*, args*/) { // 44 var args = arguments; // 45 // if we have any arguments (pos or kw), add an options argument // 46 // if there isn't one. // 47 if (args.length > 1) { // 48 var kw = args[args.length - 1]; // 49 if (! (kw instanceof Spacebars.kw)) { // 50 kw = Spacebars.kw(); // 51 // clone arguments into an actual array, then push // 52 // the empty kw object. // 53 args = Array.prototype.slice.call(arguments); // 54 args.push(kw); // 55 } else { // 56 // For each keyword arg, call it if it's a function // 57 var newHash = {}; // 58 for (var k in kw.hash) { // 59 var v = kw.hash[k]; // 60 newHash[k] = (typeof v === 'function' ? v() : v); // 61 } // 62 args[args.length - 1] = Spacebars.kw(newHash); // 63 } // 64 } // 65 // 66 return Spacebars.call.apply(null, args); // 67 }; // 68 // 69 Spacebars.mustache = function (value/*, args*/) { // 70 var result = Spacebars.mustacheImpl.apply(null, arguments); // 71 // 72 if (result instanceof Spacebars.SafeString) // 73 return HTML.Raw(result.toString()); // 74 else // 75 // map `null`, `undefined`, and `false` to null, which is important // 76 // so that attributes with nully values are considered absent. // 77 // stringify anything else (e.g. strings, booleans, numbers including 0). // 78 return (result == null || result === false) ? null : String(result); // 79 }; // 80 // 81 Spacebars.attrMustache = function (value/*, args*/) { // 82 var result = Spacebars.mustacheImpl.apply(null, arguments); // 83 // 84 if (result == null || result === '') { // 85 return null; // 86 } else if (typeof result === 'object') { // 87 return result; // 88 } else if (typeof result === 'string' && HTML.isValidAttributeName(result)) { // 89 var obj = {}; // 90 obj[result] = ''; // 91 return obj; // 92 } else { // 93 throw new Error("Expected valid attribute name, '', null, or object"); // 94 } // 95 }; // 96 // 97 Spacebars.dataMustache = function (value/*, args*/) { // 98 var result = Spacebars.mustacheImpl.apply(null, arguments); // 99 // 100 return result; // 101 }; // 102 // 103 // Idempotently wrap in `HTML.Raw`. // 104 // // 105 // Called on the return value from `Spacebars.mustache` in case the // 106 // template uses triple-stache (`{{{foo bar baz}}}`). // 107 Spacebars.makeRaw = function (value) { // 108 if (value == null) // null or undefined // 109 return null; // 110 else if (value instanceof HTML.Raw) // 111 return value; // 112 else // 113 return HTML.Raw(value); // 114 }; // 115 // 116 // If `value` is a function, called it on the `args`, after // 117 // evaluating the args themselves (by calling them if they are // 118 // functions). Otherwise, simply return `value` (and assert that // 119 // there are no args). // 120 Spacebars.call = function (value/*, args*/) { // 121 if (typeof value === 'function') { // 122 // evaluate arguments if they are functions (by calling them) // 123 var newArgs = []; // 124 for (var i = 1; i < arguments.length; i++) { // 125 var arg = arguments[i]; // 126 newArgs[i-1] = (typeof arg === 'function' ? arg() : arg); // 127 } // 128 // 129 return value.apply(null, newArgs); // 130 } else { // 131 if (arguments.length > 1) // 132 throw new Error("Can't call non-function: " + value); // 133 // 134 return value; // 135 } // 136 }; // 137 // 138 // Call this as `Spacebars.kw({ ... })`. The return value // 139 // is `instanceof Spacebars.kw`. // 140 Spacebars.kw = function (hash) { // 141 if (! (this instanceof Spacebars.kw)) // 142 // called without new; call with new // 143 return new Spacebars.kw(hash); // 144 // 145 this.hash = hash || {}; // 146 }; // 147 // 148 // Call this as `Spacebars.SafeString("some HTML")`. The return value // 149 // is `instanceof Spacebars.SafeString` (and `instanceof Handlebars.SafeString). // 150 Spacebars.SafeString = function (html) { // 151 if (! (this instanceof Spacebars.SafeString)) // 152 // called without new; call with new // 153 return new Spacebars.SafeString(html); // 154 // 155 return new Handlebars.SafeString(html); // 156 }; // 157 Spacebars.SafeString.prototype = Handlebars.SafeString.prototype; // 158 // 159 // `Spacebars.dot(foo, "bar", "baz")` performs a special kind // 160 // of `foo.bar.baz` that allows safe indexing of `null` and // 161 // indexing of functions (which calls the function). If the // 162 // result is a function, it is always a bound function (e.g. // 163 // a wrapped version of `baz` that always uses `foo.bar` as // 164 // `this`). // 165 // // 166 // In `Spacebars.dot(foo, "bar")`, `foo` is assumed to be either // 167 // a non-function value or a "fully-bound" function wrapping a value, // 168 // where fully-bound means it takes no arguments and ignores `this`. // 169 // // 170 // `Spacebars.dot(foo, "bar")` performs the following steps: // 171 // // 172 // * If `foo` is falsy, return `foo`. // 173 // // 174 // * If `foo` is a function, call it (set `foo` to `foo()`). // 175 // // 176 // * If `foo` is falsy now, return `foo`. // 177 // // 178 // * Return `foo.bar`, binding it to `foo` if it's a function. // 179 Spacebars.dot = function (value, id1/*, id2, ...*/) { // 180 if (arguments.length > 2) { // 181 // Note: doing this recursively is probably less efficient than // 182 // doing it in an iterative loop. // 183 var argsForRecurse = []; // 184 argsForRecurse.push(Spacebars.dot(value, id1)); // 185 argsForRecurse.push.apply(argsForRecurse, // 186 Array.prototype.slice.call(arguments, 2)); // 187 return Spacebars.dot.apply(null, argsForRecurse); // 188 } // 189 // 190 if (typeof value === 'function') // 191 value = value(); // 192 // 193 if (! value) // 194 return value; // falsy, don't index, pass through // 195 // 196 var result = value[id1]; // 197 if (typeof result !== 'function') // 198 return result; // 199 // `value[id1]` (or `value()[id1]`) is a function. // 200 // Bind it so that when called, `value` will be placed in `this`. // 201 return function (/*arguments*/) { // 202 return result.apply(value, arguments); // 203 }; // 204 }; // 205 // 206 // Spacebars.With implements the conditional logic of rendering // 207 // the `{{else}}` block if the argument is falsy. It combines // 208 // a Blaze.If with a Blaze.With (the latter only in the truthy // 209 // case, since the else block is evaluated without entering // 210 // a new data context). // 211 Spacebars.With = function (argFunc, contentFunc, elseFunc) { // 212 var argVar = new Blaze.ReactiveVar; // 213 var view = Blaze.View('Spacebars_with', function () { // 214 return Blaze.If(function () { return argVar.get(); }, // 215 function () { return Blaze.With(function () { // 216 return argVar.get(); }, contentFunc); }, // 217 elseFunc); // 218 }); // 219 view.onViewCreated(function () { // 220 this.autorun(function () { // 221 argVar.set(argFunc()); // 222 // 223 // This is a hack so that autoruns inside the body // 224 // of the #with get stopped sooner. It reaches inside // 225 // our ReactiveVar to access its dep. // 226 // 227 Tracker.onInvalidate(function () { // 228 argVar.dep.changed(); // 229 }); // 230 // 231 // Take the case of `{{#with A}}{{B}}{{/with}}`. The goal // 232 // is to not re-render `B` if `A` changes to become falsy // 233 // and `B` is simultaneously invalidated. // 234 // // 235 // A series of autoruns are involved: // 236 // // 237 // 1. This autorun (argument to Spacebars.With) // 238 // 2. Argument to Blaze.If // 239 // 3. Blaze.If view re-render // 240 // 4. Argument to Blaze.With // 241 // 5. The template tag `{{B}}` // 242 // // 243 // When (3) is invalidated, it immediately stops (4) and (5) // 244 // because of a Tracker.onInvalidate built into materializeView. // 245 // (When a View's render method is invalidated, it immediately // 246 // tears down all the subviews, via a Tracker.onInvalidate much // 247 // like this one. // 248 // // 249 // Suppose `A` changes to become falsy, and `B` changes at the // 250 // same time (i.e. without an intervening flush). // 251 // Without the code above, this happens: // 252 // // 253 // - (1) and (5) are invalidated. // 254 // - (1) runs, invalidating (2) and (4). // 255 // - (5) runs. // 256 // - (2) runs, invalidating (3), stopping (4) and (5). // 257 // // 258 // With the code above: // 259 // // 260 // - (1) and (5) are invalidated, invalidating (2) and (4). // 261 // - (1) runs. // 262 // - (2) runs, invalidating (3), stopping (4) and (5). // 263 // // 264 // If the re-run of (5) is originally enqueued before (1), all // 265 // bets are off, but typically that doesn't seem to be the // 266 // case. Anyway, doing this is always better than not doing it, // 267 // because it might save a bunch of DOM from being updated // 268 // needlessly. // 269 }); // 270 }); // 271 // 272 return view; // 273 }; // 274 // 275 // XXX COMPAT WITH 0.9.0 // 276 Spacebars.TemplateWith = Blaze._TemplateWith; // 277 // 278 /////////////////////////////////////////////////////////////////////////////////// }).call(this); /* Exports */ if (typeof Package === 'undefined') Package = {}; Package.spacebars = { Spacebars: Spacebars }; })(); //# sourceMappingURL=spacebars.js.map
frozeman/ethereum-dapp-whisper-client
dist/bundle/programs/server/packages/spacebars.js
JavaScript
mit
25,523
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Function.php 20378 2010-01-18 14:38:21Z mabe $ */ /** * @see Zend_Cache_Core */ require_once 'Zend/Cache/Core.php'; /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Function extends Zend_Cache_Core { /** * This frontend specific options * * ====> (boolean) cache_by_default : * - if true, function calls will be cached by default * * ====> (array) cached_functions : * - an array of function names which will be cached (even if cache_by_default = false) * * ====> (array) non_cached_functions : * - an array of function names which won't be cached (even if cache_by_default = true) * * @var array options */ protected $_specificOptions = array( 'cache_by_default' => true, 'cached_functions' => array(), 'non_cached_functions' => array() ); /** * Constructor * * @param array $options Associative array of options * @return void */ public function __construct(array $options = array()) { while (list($name, $value) = each($options)) { $this->setOption($name, $value); } $this->setOption('automatic_serialization', true); } /** * Main method : call the specified function or get the result from cache * * @param string $name Function name * @param array $parameters Function parameters * @param array $tags Cache tags * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime) * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends * @return mixed Result */ public function call($name, $parameters = array(), $tags = array(), $specificLifetime = false, $priority = 8) { $cacheBool1 = $this->_specificOptions['cache_by_default']; $cacheBool2 = in_array($name, $this->_specificOptions['cached_functions']); $cacheBool3 = in_array($name, $this->_specificOptions['non_cached_functions']); $cache = (($cacheBool1 || $cacheBool2) && (!$cacheBool3)); if (!$cache) { // We do not have not cache return call_user_func_array($name, $parameters); } $id = $this->_makeId($name, $parameters); if ( ($rs = $this->load($id)) && isset($rs[0], $rs[1])) { // A cache is available $output = $rs[0]; $return = $rs[1]; } else { // A cache is not available (or not valid for this frontend) ob_start(); ob_implicit_flush(false); $return = call_user_func_array($name, $parameters); $output = ob_get_contents(); ob_end_clean(); $data = array($output, $return); $this->save($data, $id, $tags, $specificLifetime, $priority); } echo $output; return $return; } /** * Make a cache id from the function name and parameters * * @param string $name Function name * @param array $parameters Function parameters * @throws Zend_Cache_Exception * @return string Cache id */ private function _makeId($name, $parameters) { if (!is_string($name)) { Zend_Cache::throwException('Incorrect function name'); } if (!is_array($parameters)) { Zend_Cache::throwException('parameters argument must be an array'); } return md5($name . serialize($parameters)); } }
ian0583/IsTrBuddy
lib/ZendFramework/library/Zend/Cache/Frontend/Function.php
PHP
mit
4,556
/* * Copyright (c) 2006-2017 DMDirc Developers * * 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. */ package com.dmdirc.util.io.yaml; import com.esotericsoftware.yamlbeans.YamlReader; import com.esotericsoftware.yamlbeans.YamlWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static com.dmdirc.util.io.yaml.YamlReaderUtils.asList; import static java.util.stream.Collectors.toList; /** * Base class for a store that is backed by a YAML file. */ public abstract class BaseYamlStore<T> { /** * The charset to use when reading and writing files. */ private static final String CHARSET = "UTF-8"; /** * Logger to use. */ private static final Logger LOG = LoggerFactory.getLogger(BaseYamlStore.class); /** * Reads a list of items from the YAML file at the specified path. * <p> * Each item is converted from an object into some form of model by invoking the {@link #convertFromYaml} method. * * @param path The path of the file to read. * @return A list of successfully converted model objects. */ protected List<T> read(final Path path) { final List<T> results = new ArrayList<>(); if (Files.exists(path)) { try (final InputStream stream = Files.newInputStream(path); final InputStreamReader reader = new InputStreamReader(stream, CHARSET)) { final YamlReader yamlReader = new YamlReader(reader); results.addAll(asList(yamlReader.read(), this::convertFromYaml)); yamlReader.close(); } catch (IOException | IllegalArgumentException ex) { LOG.warn("Unable to read from {}", path, ex); } } return results; } /** * Writes a collection of items to a YAML file at the specified path. * <p> * Each item is converted into a "plain" object by invoking the {@link #convertToYaml} method. * * @param path The path of the file to write. * @param items A collection of items to write. */ protected void write(final Path path, final Collection<T> items) { try (final OutputStream stream = Files.newOutputStream(path); final OutputStreamWriter writer = new OutputStreamWriter(stream, CHARSET)) { final YamlWriter yamlWriter = new YamlWriter(writer); yamlWriter.write(items.parallelStream().map(this::convertToYaml).collect(toList())); yamlWriter.close(); } catch (IOException ex) { LOG.warn("Unable to write to {}", path, ex); } } protected abstract Optional<T> convertFromYaml(final Object object); protected abstract Object convertToYaml(final T object); }
ShaneMcC/DMDirc-Client
bundles/com.dmdirc.util.io.yaml/src/main/java/com/dmdirc/util/io/yaml/BaseYamlStore.java
Java
mit
4,073
using System.Windows; using Magellan; using Magellan.Framework; using Sample.Features.Details; using Sample.Features.Details.ServiceProxies; using Sample.Features.Search; using Sample.Features.Search.ServiceProxies; namespace Sample { public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var views = new ViewModelFactory(); views.Register("Search", () => new SearchView(), () => new SearchViewModel(new SearchService())); views.Register("Details", () => new DetailsView(), () => new DetailsViewModel(new DetailsService())); var routes = new ViewModelRouteCatalog(views); routes.MapRoute("views/details/{id}", new { viewModel = "Details" }); routes.MapRoute("views/{viewModel}"); var shell = new ShellWindow(); var navigation = new NavigatorFactory(routes); var navigator = navigation.CreateNavigator(shell.MainContent); shell.Show(); navigator.Navigate("views/Search"); } } }
CADbloke/magellan-framework
src/Samples/MVVM/App.xaml.cs
C#
mit
1,160
# -*- coding: utf-8 -*- """File containing all standard fixes.""" # # (C) Pywikibot team, 2008-2010 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals import os.path from pywikibot import config __version__ = '$Id$' parameter_help = u""" Currently available predefined fixes are: * HTML - Convert HTML tags to wiki syntax, and fix XHTML. * isbn - Fix badly formatted ISBNs. * syntax - Try to fix bad wiki markup. Do not run this in automatic mode, as the bot may make mistakes. * syntax-safe - Like syntax, but less risky, so you can run this in automatic mode. * case-de - fix upper/lower case errors in German * grammar-de - fix grammar and typography in German * vonbis - Ersetze Binde-/Gedankenstrich durch "bis" in German * music - Links auf Begriffsklärungen in German * datum - specific date formats in German * correct-ar - Corrections for Arabic Wikipedia and any Arabic wiki. * yu-tld - the yu top-level domain will soon be disabled, see * fckeditor - Try to convert FCKeditor HTML tags to wiki syntax. https://lists.wikimedia.org/pipermail/wikibots-l/2009-February/000290.html """ __doc__ = __doc__ + parameter_help fixes = { # These replacements will convert HTML to wiki syntax where possible, and # make remaining tags XHTML compliant. 'HTML': { 'regex': True, 'msg': 'pywikibot-fixes-html', 'replacements': [ # Everything case-insensitive (?i) # Keep in mind that MediaWiki automatically converts <br> to <br /> # when rendering pages, so you might comment the next two lines out # to save some time/edits. (r'(?i)<br *>', r'<br />'), # linebreak with attributes (r'(?i)<br ([^>/]+?)>', r'<br \1 />'), (r'(?i)<b>(.*?)</b>', r"'''\1'''"), (r'(?i)<strong>(.*?)</strong>', r"'''\1'''"), (r'(?i)<i>(.*?)</i>', r"''\1''"), (r'(?i)<em>(.*?)</em>', r"''\1''"), # horizontal line without attributes in a single line (r'(?i)([\r\n])<hr[ /]*>([\r\n])', r'\1----\2'), # horizontal line without attributes with more text in the same line # (r'(?i) +<hr[ /]*> +', r'\r\n----\r\n'), # horizontal line with attributes; can't be done with wiki syntax # so we only make it XHTML compliant (r'(?i)<hr ([^>/]+?)>', r'<hr \1 />'), # a header where only spaces are in the same line (r'(?i)([\r\n]) *<h1> *([^<]+?) *</h1> *([\r\n])', r"\1= \2 =\3"), (r'(?i)([\r\n]) *<h2> *([^<]+?) *</h2> *([\r\n])', r"\1== \2 ==\3"), (r'(?i)([\r\n]) *<h3> *([^<]+?) *</h3> *([\r\n])', r"\1=== \2 ===\3"), (r'(?i)([\r\n]) *<h4> *([^<]+?) *</h4> *([\r\n])', r"\1==== \2 ====\3"), (r'(?i)([\r\n]) *<h5> *([^<]+?) *</h5> *([\r\n])', r"\1===== \2 =====\3"), (r'(?i)([\r\n]) *<h6> *([^<]+?) *</h6> *([\r\n])', r"\1====== \2 ======\3"), # TODO: maybe we can make the bot replace <p> tags with \r\n's. ], 'exceptions': { 'inside-tags': [ 'nowiki', 'comment', 'math', 'pre' ], } }, # Grammar fixes for German language # Do NOT run this automatically! 'grammar-de': { 'regex': True, 'msg': { 'de': u'Bot: korrigiere Grammatik', }, 'replacements': [ # (u'([Ss]owohl) ([^,\.]+?), als auch', r'\1 \2 als auch'), # (u'([Ww]eder) ([^,\.]+?), noch', r'\1 \2 noch'), # # Vorsicht bei Substantiven, z. B. 3-Jähriger! (r'(\d+)(minütig|stündig|tägig|wöchig|jährig|minütlich|stündlich' r'|täglich|wöchentlich|jährlich|fach|mal|malig|köpfig|teilig' r'|gliedrig|geteilt|elementig|dimensional|bändig|eckig|farbig' r'|stimmig)', r'\1-\2'), # zusammengesetztes Wort, Bindestrich wird durchgeschleift (r'(?<!\w)(\d+|\d+[.,]\d+)(\$|€|DM|£|¥|mg|g|kg|ml|cl|l|t|ms|min' r'|µm|mm|cm|dm|m|km|ha|°C|kB|MB|GB|TB|W|kW|MW|GW|PS|Nm|eV|kcal' r'|mA|mV|kV|Ω|Hz|kHz|MHz|GHz|mol|Pa|Bq|Sv|mSv)([²³]?-[\w\[])', r'\1-\2\3'), # Größenangabe ohne Leerzeichen vor Einheit # weggelassen wegen vieler falsch Positiver: s, A, V, C, S, J, % (r'(?<!\w)(\d+|\d+[.,]\d+)(\$|€|DM|£|¥|mg|g|kg|ml|cl|l|t|ms|min' r'|µm|mm|cm|dm|m|km|ha|°C|kB|MB|GB|TB|W|kW|MW|GW|PS|Nm|eV|kcal' r'|mA|mV|kV|Ω|Hz|kHz|MHz|GHz|mol|Pa|Bq|Sv|mSv)(?=\W|²|³|$)', r'\1 \2'), # Temperaturangabe mit falsch gesetztem Leerzeichen (r'(?<!\w)(\d+|\d+[.,]\d+)° C(?=\W|²|³|$)', r'\1 °C'), # Kein Leerzeichen nach Komma (r'([a-zäöüß](\]\])?,)((\[\[)?[a-zäöüA-ZÄÖÜ])', r'\1 \3'), # Leerzeichen und Komma vertauscht (r'([a-zäöüß](\]\])?) ,((\[\[)?[a-zäöüA-ZÄÖÜ])', r'\1, \3'), # Plenks (Leerzeichen vor Komma/Punkt/Ausrufezeichen/Fragezeichen) # Achtung bei Französisch: # https://de.wikipedia.org/wiki/Plenk#Franz.C3.B6sische_Sprache # Leerzeichen vor Doppelpunkt/Semikolon kann korrekt sein, # z.B. nach Quellenangaben (r'([a-zäöüß](\]\])?) ([,.!?]) ((\[\[)?[a-zäöüA-ZÄÖÜ])', r'\1\3 \4'), # (u'([a-z]\.)([A-Z])', r'\1 \2'), ], 'exceptions': { 'inside-tags': [ 'nowiki', 'comment', 'math', 'pre', # because of code examples 'source', # because of code examples 'startspace', # because of code examples 'hyperlink', # e.g. commas in URLs 'gallery', # because of filenames 'timeline', ], 'text-contains': [ r'sic!', r'20min.ch', # Schweizer News-Seite ], 'inside': [ r'<code>.*</code>', # because of code examples r'{{[Zz]itat\|.*?}}', r'{{§\|.*?}}', # Gesetzesparagraph r'§?\d+[a-z]', # Gesetzesparagraph r'Ju 52/1m', # Flugzeugbezeichnung r'Ju 52/3m', # Flugzeugbezeichnung r'AH-1W', # Hubschrauberbezeichnung r'ZPG-3W', # Luftschiffbezeichnung r'8mm', # Filmtitel r'802.11g', # WLAN-Standard r'DOS/4GW', # Software r'ntfs-3g', # Dateisystem-Treiber r'/\w(,\w)*/', # Laut-Aufzählung in der Linguistik # Variablen in der Mathematik (unklar, ob Leerzeichen hier Pflicht sind) r'[xyz](,[xyz])+', # Definitionslisten, dort gibt es oft absichtlich Leerzeichen vor Doppelpunkten r'(?m)^;(.*?)$', r'\d+h( |&nbsp;)\d+m', # Schreibweise für Zeiten, vor allem in Film-Infoboxen. # Nicht korrekt, aber dafür schön kurz. r'(?i)\[\[(Bild|Image|Media):.+?\|', # Dateinamen auslassen r'{{bgc\|.*?}}', # Hintergrundfarbe r'<sup>\d+m</sup>', # bei chemischen Formeln r'\([A-Z][A-Za-z]*(,[A-Z][A-Za-z]*(<sup>.*?</sup>|<sub>.*?</sub>|))+\)' # chemische Formel, z. B. AuPb(Pb,Sb,Bi)Te. # Hier sollen keine Leerzeichen hinter die Kommata. ], 'title': [ r'Arsen', # chemische Formel ], } }, # Do NOT run this automatically! # Recommendation: First run syntax-safe automatically, afterwards # run syntax manually, carefully checking that you're not breaking # anything. 'syntax': { 'regex': True, 'msg': 'pywikibot-fixes-syntax', 'replacements': [ # external link in double brackets (r'\[\[(?P<url>https?://[^\]]+?)\]\]', r'[\g<url>]'), # external link starting with double bracket (r'\[\[(?P<url>https?://.+?)\]', r'[\g<url>]'), # external link with forgotten closing bracket # (r'\[(?P<url>https?://[^\]\s]+)\r\n', r'[\g<url>]\r\n'), # external link ending with double bracket. # do not change weblinks that contain wiki links inside # inside the description (r'\[(?P<url>https?://[^\[\]]+?)\]\](?!\])', r'[\g<url>]'), # external link and description separated by a dash. # ATTENTION: while this is a mistake in most cases, there are some # valid URLs that contain dashes! (r'\[(?P<url>https?://[^\|\]\s]+?) *\| *(?P<label>[^\|\]]+?)\]', r'[\g<url> \g<label>]'), # wiki link closed by single bracket. # ATTENTION: There are some false positives, for example # Brainfuck code examples or MS-DOS parameter instructions. # There are also sometimes better ways to fix it than # just putting an additional ] after the link. (r'\[\[([^\[\]]+?)\](?!\])', r'[[\1]]'), # wiki link opened by single bracket. # ATTENTION: same as above. (r'(?<!\[)\[([^\[\]]+?)\]\](?!\])', r'[[\1]]'), # template closed by single bracket # ATTENTION: There are some false positives, especially in # mathematical context or program code. (r'{{([^{}]+?)}(?!})', r'{{\1}}'), ], 'exceptions': { 'inside-tags': [ 'nowiki', 'comment', 'math', 'pre', 'source', # because of code examples 'startspace', # because of code examples ], 'text-contains': [ r'http://.*?object=tx\|', # regular dash in URL r'http://.*?allmusic\.com', # regular dash in URL r'http://.*?allmovie\.com', # regular dash in URL r'http://physics.nist.gov/', # regular dash in URL r'http://www.forum-seniorenarbeit.de/', # regular dash in URL r'http://kuenstlerdatenbank.ifa.de/', # regular dash in URL r'&object=med', # regular dash in URL r'\[CDATA\[' # lots of brackets ], } }, # The same as syntax, but restricted to replacements that should # be safe to run automatically. 'syntax-safe': { 'regex': True, 'msg': 'pywikibot-fixes-syntax', 'replacements': [ # external link in double brackets (r'\[\[(?P<url>https?://[^\]]+?)\]\]', r'[\g<url>]'), # external link starting with double bracket (r'\[\[(?P<url>https?://.+?)\]', r'[\g<url>]'), # external link with forgotten closing bracket # (r'\[(?P<url>https?://[^\]\s]+)\r\n', r'[\g<url>]\r\n'), # external link and description separated by a dash, with # whitespace in front of the dash, so that it is clear that # the dash is not a legitimate part of the URL. (r'\[(?P<url>https?://[^\|\] \r\n]+?) +\| *(?P<label>[^\|\]]+?)\]', r'[\g<url> \g<label>]'), # dash in external link, where the correct end of the URL can # be detected from the file extension. It is very unlikely that # this will cause mistakes. (r'\[(?P<url>https?://[^\|\] ]+?(\.pdf|\.html|\.htm|\.php|\.asp|\.aspx|\.jsp)) *\|' r' *(?P<label>[^\|\]]+?)\]', r'[\g<url> \g<label>]'), ], 'exceptions': { 'inside-tags': [ 'nowiki', 'comment', 'math', 'pre', 'source', # because of code examples 'startspace', # because of code examples ], } }, 'case-de': { # German upper / lower case issues 'regex': True, 'msg': { 'de': u'Bot: Korrigiere Groß-/Kleinschreibung', }, 'replacements': [ (r'\batlantische(r|n|) Ozean', r'Atlantische\1 Ozean'), (r'\bdeutsche(r|n|) Bundestag\b', r'Deutsche\1 Bundestag'), # Aufpassen, z. B. 'deutsche Bundestagswahl' (r'\bdeutschen Bundestags\b', r'Deutschen Bundestags'), (r'\bdeutsche(r|n|) Reich\b', r'Deutsche\1 Reich'), # Aufpassen, z. B. 'deutsche Reichsgrenzen' (r'\bdeutschen Reichs\b', r'Deutschen Reichs'), (r'\bdritte(n|) Welt(?!krieg)', r'Dritte\1 Welt'), (r'\bdreißigjährige(r|n|) Krieg', r'Dreißigjährige\1 Krieg'), (r'\beuropäische(n|) Gemeinschaft', r'Europäische\1 Gemeinschaft'), (r'\beuropäische(n|) Kommission', r'Europäische\1 Kommission'), (r'\beuropäische(n|) Parlament', r'Europäische\1 Parlament'), (r'\beuropäische(n|) Union', r'Europäische\1 Union'), (r'\berste(r|n|) Weltkrieg', r'Erste\1 Weltkrieg'), (r'\bkalte(r|n|) Krieg', r'Kalte\1 Krieg'), (r'\bpazifische(r|n|) Ozean', r'Pazifische\1 Ozean'), (r'Tag der deutschen Einheit', r'Tag der Deutschen Einheit'), (r'\bzweite(r|n|) Weltkrieg', r'Zweite\1 Weltkrieg'), ], 'exceptions': { 'inside-tags': [ 'nowiki', 'comment', 'math', 'pre', ], 'text-contains': [ r'sic!', ], } }, 'vonbis': { 'regex': True, 'msg': { 'de': u'Bot: Ersetze Binde-/Gedankenstrich durch "bis"', }, 'replacements': [ # Bindestrich, Gedankenstrich, Geviertstrich (r'(von \d{3,4}) *(-|&ndash;|–|&mdash;|—) *(\d{3,4})', r'\1 bis \3'), ], }, # some disambiguation stuff for de: # python replace.py -fix:music -subcat:Album 'music': { 'regex': False, 'msg': { 'de': u'Bot: korrigiere Links auf Begriffsklärungen', }, 'replacements': [ (u'[[CD]]', u'[[Audio-CD|CD]]'), (u'[[LP]]', u'[[Langspielplatte|LP]]'), (u'[[EP]]', u'[[Extended Play|EP]]'), (u'[[MC]]', u'[[Musikkassette|MC]]'), (u'[[Single]]', u'[[Single (Musik)|Single]]'), ], 'exceptions': { 'inside-tags': [ 'hyperlink', ] } }, # format of dates of birth and death, for de: # python replace.py -fix:datum -ref:Vorlage:Personendaten 'datum': { 'regex': True, 'msg': { 'de': u'Bot: Korrigiere Datumsformat', }, 'replacements': [ # space after birth sign w/ year # (u'\(\*(\d{3,4})', u'(* \\1'), # space after death sign w/ year # (u'†(\d{3,4})', u'† \\1'), # (u'&dagger;(\d{3,4})', u'† \\1'), # space after birth sign w/ linked date # (u'\(\*\[\[(\d)', u'(* [[\\1'), # space after death sign w/ linked date # (u'†\[\[(\d)', u'† [[\\1'), # (u'&dagger;\[\[(\d)', u'† [[\\1'), (r'\[\[(\d+\. (?:Januar|Februar|März|April|Mai|Juni|Juli|August|' r'September|Oktober|November|Dezember)) (\d{1,4})\]\]', r'[[\1]] [[\2]]'), # Keine führende Null beim Datum (erst einmal nur bei fehlenden Leerzeichen) (r'0(\d+)\.(Januar|Februar|März|April|Mai|Juni|Juli|August|' r'September|Oktober|November|Dezember)', r'\1. \2'), # Kein Leerzeichen zwischen Tag und Monat (r'(\d+)\.(Januar|Februar|März|April|Mai|Juni|Juli|August|' r'September|Oktober|November|Dezember)', r'\1. \2'), # Kein Punkt vorm Jahr (r'(\d+)\. (Januar|Februar|März|April|Mai|Juni|Juli|August|' r'September|Oktober|November|Dezember)\.(\d{1,4})', r'\1. \2 \3'), ], 'exceptions': { 'inside': [ r'\[\[20. Juli 1944\]\]', # Hitler-Attentat r'\[\[17. Juni 1953\]\]', # Ost-Berliner Volksaufstand r'\[\[1. April 2000\]\]', # Film r'\[\[11. September 2001\]\]', # Anschläge in den USA r'\[\[7. Juli 2005\]\]', # Terroranschläge in Spanien ], } }, 'isbn': { 'regex': True, 'msg': 'isbn-formatting', # use i18n translations 'replacements': [ # Remove colon between the word ISBN and the number (r'ISBN: (\d+)', r'ISBN \1'), # superfluous word "number" (r'ISBN( number| no\.?| No\.?|-Nummer|-Nr\.):? (\d+)', r'ISBN \2'), # Space, minus, dot, hypen, en dash, em dash, etc. instead of # hyphen-minus as separator, or spaces between digits and separators. # Note that these regular expressions also match valid ISBNs, but # these won't be changed. # These two regexes don't verify that the ISBN is of a valid format # but just change separators into normal hypens. The isbn script # does checks and similar but does only match ISBNs with digits and # hypens (and optionally a X/x at the end). (r'ISBN (978|979) *[\- −.‐-―] *(\d+) *[\- −.‐-―] *(\d+) ' r'*[\- −.‐-―] *(\d+) *[\- −.‐-―] *(\d)(?!\d)', r'ISBN \1-\2-\3-\4-\5'), # ISBN-13 (r'ISBN (\d+) *[\- −.‐-―] *(\d+) *[\- −.‐-―] *(\d+) *[\- −.‐-―] *(\d|X|x)(?!\d)', r'ISBN \1-\2-\3-\4'), # ISBN-10 # missing space before ISBN-10 or before ISBN-13, # or non-breaking space. (r'ISBN(|&nbsp;| )((\d(-?)){12}\d|(\d(-?)){9}[\dXx])', r'ISBN \2'), ], 'exceptions': { 'inside-tags': [ 'comment', 'hyperlink', ], 'inside': [ r'ISBN (\d(-?)){12}\d', # matches valid ISBN-13s r'ISBN (\d(-?)){9}[\dXx]', # matches valid ISBN-10s ], } }, # Corrections for Arabic Wikipedia and any Arabic wiki. # python replace.py -fix:correct-ar -start:! -always 'correct-ar': { 'regex': True, 'msg': { 'ar': u'تدقيق إملائي', }, 'replacements': [ # FIXME: Do not replace comma in non-Arabic text, # interwiki, image links or <math> syntax. # (u' ,', u' ،'), # TODO: Basic explanation in English what it does (r'\bإمرأة\b', 'امرأة'), (r'\bالى\b', 'إلى'), (r'\bإسم\b', 'اسم'), (r'\bالأن\b', 'الآن'), (r'\bالة\b', 'آلة'), (r'\bفى\b', 'في'), (r'\bإبن\b', 'ابن'), (r'\bإبنة\b', 'ابنة'), (r'\bإقتصاد\b', 'اقتصاد'), (r'\bإجتماع\b', 'اجتماع'), (r'\bانجيل\b', 'إنجيل'), (r'\bاجماع\b', 'إجماع'), (r'\bاكتوبر\b', 'أكتوبر'), (r'\bإستخراج\b', 'استخراج'), (r'\bإستعمال\b', 'استعمال'), (r'\bإستبدال\b', 'استبدال'), (r'\bإشتراك\b', 'اشتراك'), (r'\bإستعادة\b', 'استعادة'), (r'\bإستقلال\b', 'استقلال'), (r'\bإنتقال\b', 'انتقال'), (r'\bإتحاد\b', 'اتحاد'), (r'\bاملاء\b', 'إملاء'), (r'\bإستخدام\b', 'استخدام'), (r'\bأحدى\b', 'إحدى'), (r'\bلاكن\b', 'لكن'), (r'\bإثنان\b', 'اثنان'), (r'\bإحتياط\b', 'احتياط'), (r'\bإقتباس\b', 'اقتباس'), (r'\bادارة\b', 'إدارة'), (r'\bابناء\b', 'أبناء'), (r'\bالانصار\b', 'الأنصار'), (r'\bاشارة\b', 'إشارة'), (r'\bإقرأ\b', 'اقرأ'), (r'\bإمتياز\b', 'امتياز'), (r'\bارق\b', 'أرق'), (r'\bاللة\b', 'الله'), (r'\bإختبار\b', 'اختبار'), (r'== ?روابط خارجية ?==', '== وصلات خارجية =='), (r'\bارسال\b', 'إرسال'), (r'\bإتصالات\b', 'اتصالات'), (r'\bابو\b', 'أبو'), (r'\bابا\b', 'أبا'), (r'\bاخو\b', 'أخو'), (r'\bاخا\b', 'أخا'), (r'\bاخي\b', 'أخي'), (r'\bاحد\b', 'أحد'), (r'\bاربعاء\b', 'أربعاء'), (r'\bاول\b', 'أول'), (r'\b(ال|)اهم\b', r'\1أهم'), (r'\b(ال|)اثقل\b', r'\1أثقل'), (r'\b(ال|)امجد\b', r'\1أمجد'), (r'\b(ال|)اوسط\b', r'\1أوسط'), (r'\b(ال|)اشقر\b', r'\1أشقر'), (r'\b(ال|)انور\b', r'\1أنور'), (r'\b(ال|)اصعب\b', r'\1أصعب'), (r'\b(ال|)اسهل\b', r'\1أسهل'), (r'\b(ال|)اجمل\b', r'\1أجمل'), (r'\b(ال|)اقبح\b', r'\1أقبح'), (r'\b(ال|)اطول\b', r'\1أطول'), (r'\b(ال|)اقصر\b', r'\1أقصر'), (r'\b(ال|)اسمن\b', r'\1أسمن'), (r'\b(ال|)اذكى\b', r'\1أذكى'), (r'\b(ال|)اكثر\b', r'\1أكثر'), (r'\b(ال|)افضل\b', r'\1أفضل'), (r'\b(ال|)اكبر\b', r'\1أكبر'), (r'\b(ال|)اشهر\b', r'\1أشهر'), (r'\b(ال|)ابطأ\b', r'\1أبطأ'), (r'\b(ال|)اماني\b', r'\1أماني'), (r'\b(ال|)احلام\b', r'\1أحلام'), (r'\b(ال|)اسماء\b', r'\1أسماء'), (r'\b(ال|)اسامة\b', r'\1أسامة'), (r'\bابراهيم\b', 'إبراهيم'), (r'\bاسماعيل\b', 'إسماعيل'), (r'\bايوب\b', 'أيوب'), (r'\bايمن\b', 'أيمن'), (r'\bاوزبكستان\b', 'أوزبكستان'), (r'\bاذربيجان\b', 'أذربيجان'), (r'\bافغانستان\b', 'أفغانستان'), (r'\bانجلترا\b', 'إنجلترا'), (r'\bايطاليا\b', 'إيطاليا'), (r'\bاوربا\b', 'أوروبا'), (r'\bأوربا\b', 'أوروبا'), (r'\bاوغندة\b', 'أوغندة'), (r'\b(ال|)ا(لماني|فريقي|سترالي)(ا|ة|تان|ان|ين|ي|ون|و|ات|)\b', r'\1أ\2\3'), (r'\b(ال|)ا(وروب|مريك)(ا|ي|ية|يتان|يان|يين|يي|يون|يو|يات|)\b', r'\1أ\2\3'), (r'\b(ال|)ا(ردن|رجنتين|وغند|سبان|وكران|فغان)' r'(ي|ية|يتان|يان|يين|يي|يون|يو|يات|)\b', r'\1أ\2\3'), (r'\b(ال|)ا(سرائيل|يران|مارات|نكليز|نجليز)' r'(ي|ية|يتان|يان|يين|يي|يون|يو|يات|)\b', r'\1إ\2\3'), (r'\b(ال|)(ا|أ)(رثوذكس|رثوذوكس)(ي|ية|يتان|يان|يين|يي|يون|يو|يات|)\b', r'\1أرثوذكس\4'), (r'\bإست(عمل|خدم|مر|مد|مال|عاض|قام|حال|جاب|قال|زاد|عان|طال)(ت|ا|وا|)\b', r'است\1\2'), (r'\bإست(حال|قال|طال|زاد|عان|قام|راح|جاب|عاض|مال)ة\b', r'است\1ة'), ], 'exceptions': { 'inside-tags': [ 'interwiki', 'math', 'ref', ], } }, # TODO: Support dynamic replacement from Special pages to the localized one 'specialpages': { 'regex': False, 'msg': { 'en': u'Robot: Fixing special page capitalisation', 'fa': u'ربات: تصحیح بزرگی و کوچکی حروف صفحه‌های ویژه', }, 'replacements': [ (u'Special:Allpages', u'Special:AllPages'), (u'Special:Blockip', u'Special:BlockIP'), (u'Special:Blankpage', u'Special:BlankPage'), (u'Special:Filepath', u'Special:FilePath'), (u'Special:Globalusers', u'Special:GlobalUsers'), (u'Special:Imagelist', u'Special:ImageList'), (u'Special:Ipblocklist', u'Special:IPBlockList'), (u'Special:Listgrouprights', u'Special:ListGroupRights'), (u'Special:Listusers', u'Special:ListUsers'), (u'Special:Newimages', u'Special:NewImages'), (u'Special:Prefixindex', u'Special:PrefixIndex'), (u'Special:Protectedpages', u'Special:ProtectedPages'), (u'Special:Recentchanges', u'Special:RecentChanges'), (u'Special:Specialpages', u'Special:SpecialPages'), (u'Special:Unlockdb', u'Special:UnlockDB'), (u'Special:Userlogin', u'Special:UserLogin'), (u'Special:Userlogout', u'Special:UserLogout'), (u'Special:Whatlinkshere', u'Special:WhatLinksHere'), ], }, # yu top-level domain will soon be disabled, # see http://lists.wikimedia.org/pipermail/wikibots-l/2009-February/000290.html # The following are domains that are often-used. 'yu-tld': { 'regex': False, 'nocase': True, 'msg': { 'de': u'Bot: Ersetze Links auf .yu-Domains', 'en': u'Robot: Replacing links to .yu domains', 'fa': u'ربات: جایگزینی پیوندها به دامنه‌ها با پسوند yu', 'fr': u'Robot: Correction des liens pointant vers le domaine .yu, qui expire en 2009', 'ksh': u'Bot: de ahle .yu-Domains loufe us, dröm ußjetuusch', }, 'replacements': [ (u'www.budva.cg.yu', u'www.budva.rs'), (u'spc.org.yu', u'spc.rs'), (u'www.oks.org.yu', u'www.oks.org.rs'), (u'www.kikinda.org.yu', u'www.kikinda.rs'), (u'www.ds.org.yu', u'www.ds.org.rs'), (u'www.nbs.yu', u'www.nbs.rs'), (u'www.serbia.sr.gov.yu', u'www.srbija.gov.rs'), (u'eunet.yu', u'eunet.rs'), (u'www.zastava-arms.co.yu', u'www.zastava-arms.co.rs'), (u'www.airportnis.co.yu', u'www.airportnis.rs'), # (u'www.danas.co.yu', u'www.danas.rs'), # Archive links don't seem to work (u'www.belex.co.yu', u'www.belex.rs'), (u'beograd.org.yu', u'beograd.rs'), (u'www.vlada.cg.yu', u'www.vlada.me'), (u'webrzs.statserb.sr.gov.yu', u'webrzs.stat.gov.rs'), (u'www.statserb.sr.gov.yu', u'webrzs.stat.gov.rs'), (u'www.rastko.org.yu', u'www.rastko.org.rs'), (u'www.reprezentacija.co.yu', u'www.reprezentacija.rs'), (u'www.blic.co.yu', u'www.blic.co.rs'), (u'www.beograd.org.yu', u'www.beograd.org.rs'), (u'arhiva.glas-javnosti.co.yu', u'arhiva.glas-javnosti.rs'), (u'www.srpsko-nasledje.co.yu', u'www.srpsko-nasledje.co.rs'), (u'www.dnevnik.co.yu', u'www.dnevnik.rs'), (u'www.srbija.sr.gov.yu', u'www.srbija.gov.rs'), (u'www.kurir-info.co.yu/Arhiva', u'arhiva.kurir-info.rs/Arhiva'), (u'www.kurir-info.co.yu/arhiva', u'arhiva.kurir-info.rs/arhiva'), (u'www.kurir-info.co.yu', u'www.kurir-info.rs'), (u'arhiva.kurir-info.co.yu', u'arhiva.kurir-info.rs'), (u'www.prvaliga.co.yu', u'www.prvaliga.rs'), (u'www.mitropolija.cg.yu', u'www.mitropolija.me'), (u'www.spc.yu/sr', u'www.spc.rs/sr'), (u'www.sk.co.yu', u'www.sk.co.rs'), (u'www.ekoforum.org.yu', u'www.ekoforum.org'), (u'www.svevlad.org.yu', u'www.svevlad.org.rs'), (u'www.posta.co.yu', u'www.posta.rs'), (u'www.glas-javnosti.co.yu', u'www.glas-javnosti.rs'), (u'www.fscg.cg.yu', u'www.fscg.co.me'), (u'ww1.rts.co.yu/euro', u'ww1.rts.co.rs/euro'), (u'www.rtv.co.yu', u'www.rtv.rs'), (u'www.politika.co.yu', u'www.politika.rs'), (u'www.mfa.gov.yu', u'www.mfa.gov.rs'), (u'www.drzavnauprava.sr.gov.yu', u'www.drzavnauprava.gov.rs'), ], }, # These replacements will convert HTML tag from FCK-editor to wiki syntax. # 'fckeditor': { 'regex': True, 'msg': 'pywikibot-fixes-fckeditor', 'replacements': [ # replace <br> with a new line (r'(?i)<br>', r'\n'), # replace &nbsp; with a space (r'(?i)&nbsp;', r' '), ], }, } def _load_file(filename): """Load the fixes from the given filename.""" if os.path.exists(filename): # load binary, to let compile decode it according to the file header with open(filename, 'rb') as f: exec(compile(f.read(), filename, 'exec'), globals()) return True else: return False # # Load the user fixes file. filename = config.datafilepath('user-fixes.py') if _load_file(filename): user_fixes_loaded = True else: user_fixes_loaded = False
smalyshev/pywikibot-core
pywikibot/fixes.py
Python
mit
31,304
'use strict'; // Module dependencies const cleverCore = require('clever-core'); const config = cleverCore.loadConfig(); const mongoose = require('mongoose'); const Schema = mongoose.Schema; const _ = require('lodash'); const Q = require('q'); const async = require('async'); const moment = require('moment'); // Mongoose Error Handling function hasErrors(err) { if (err) { console.log(err); let modelErrors = []; switch (err.code) { case 11000: {} default: { if (err.errors) { for (var x in err.errors) { modelErrors.push({ param: x, msg: err.errors[x].message, value: err.errors[x].value }); } } } } return modelErrors; } return null; } // Validations function validateUniqueSlug(value, callback) { const Article = mongoose.model('Article'); Article.find({ $and: [{ slug: value, deleted: false }, { _id: { $ne: this._id } }] }, function(err, gallery) { callback(err || gallery.length === 0); }); }; // Getter function escapeProperty(value) { return _.escape(value); }; // Schema const ArticleSchema = new Schema({ title: { type: String, required: true, get: escapeProperty }, slug: { type: String, required: true, // TODO: match valid slug chars validate: [validateUniqueSlug, 'Slug is already in-use'] }, standfirst: { type: String, default: '', get: escapeProperty }, category: { type: String, default: 'articles' }, start: { type: Date, default: Date.now }, end: { type: Date }, blocks: { type: Object, default: {} }, created: { type: Date, default: Date.now }, published: { type: Boolean, default: false }, modified: { type: Date, default: null }, deleted: { type: Boolean, default: false } }); // Indexes ArticleSchema.index({ title: 'text' }); // Virtuals ArticleSchema.virtual('created_ago').set(function(url) { throw new Error('Article::created_ago cannot be set.'); }).get(function() { if(this.created === null) return null; return moment(this.created).fromNow(); }); ArticleSchema.virtual('modified_ago').set(function(url) { throw new Error('Article::modified_ago cannot be set.'); }).get(function() { if(!this.modified || this.modified === null) return null; return moment(this.modified).fromNow(); }); ArticleSchema.virtual('created_format').set(function(url) { throw new Error('Article::created_format cannot be set.'); }).get(function() { if(this.created === null) return null; return moment(this.created).format('MM/DD/YYYY hh:mm:ss'); }); ArticleSchema.virtual('modified_format').set(function(url) { throw new Error('Article::modified_format cannot be set.'); }).get(function() { if(!this.modified || this.modified === null) return null; return moment(this.modified).format('MM/DD/YYYY hh:mm:ss'); }); ArticleSchema.virtual('start_format').set(function(url) { throw new Error('Article::start_format cannot be set.'); }).get(function() { if(this.start === null) return null; return moment(this.start).format('MM/DD/YYYY hh:mm:ss'); }); ArticleSchema.virtual('end_format').set(function(url) { throw new Error('Article::end_format cannot be set.'); }).get(function() { if(!this.end || this.end === null) return null; return moment(this.end).format('MM/DD/YYYY hh:mm:ss'); }); // Static Methods ArticleSchema.statics = { /** * CountArticles - return the number of articles * * @param {String} category * @param {String} search * @return {Object} * @api public */ countArticles: function(category, search) { const query = search ? { $text: { $search: search } }: {}; query.deleted = false; if(category) query.category = category; const Article = mongoose.model('Article'); const defer = Q.defer(); Article.count(query, function(err, nArticles) { if (err) return defer.reject(err); return defer.resolve(nArticles); }); return defer.promise; }, /** * GetArticles - return the list of articles * * @param {String} category * @param {Integer} skip * @param {Integer} limit * @param {String} search * @return {Object} * @api public */ getArticles: function(category, skip, limit, search) { if(Number.isInteger(category) && arguments.length < 4) { search = limit; limit = skip; skip = category; } const query = search ? { $text: { $search: search } }: {}; query.deleted = false; if(category) query.category = category; const Article = mongoose.model('Article'); const options = skip>=0 && limit>=0 ? {skip: skip, limit: limit} : {skip: 0, limit: 10}; const defer = Q.defer(); Article.find(query, {}, options, function(err, articles) { if (err) return defer.reject(err); return defer.resolve(articles); }).sort({ _id: -1 }); return defer.promise; }, /** * GetArticle - return the article matching the id * * @param {String} id * @return {Object} * @api public */ getArticle: function(id) { if(!id) throw new Error('Article.getArticleById: id parameter is mandatory'); const Article = mongoose.model('Article'); const defer = Q.defer(); Article.findOne({_id: id, deleted: false}, function(err, article) { if (err) return defer.reject(err); return defer.resolve(article); }); return defer.promise; }, /** * EditArticleById - edit the article matching the id * * @param {String} id * @return {Object} * @api public */ editArticle: function(id, articleParams) { if(!id) throw new Error('Article.editArticleById: id parameter is mandatory'); const Article = mongoose.model('Article'); const defer = Q.defer(); function save(article) { // Reset article.private = false; Object.keys(articleParams).forEach(function (key, index) { article[key] = articleParams[key]; }); article.modified = Date.now(); article.save(function(err) { const errors = hasErrors(err); if(errors) return defer.reject(errors); defer.resolve(article); }); } Article.getArticle(id) .then(save) .catch(defer.reject); return defer.promise; }, /** * deleteArticle - delete logically the article matching the id * * @param {String} id * @return {Object} * @api public */ deleteArticle: function(id) { if(!id) throw new Error('Article.deleteArticleById: id parameter is mandatory'); // const Article = mongoose.model('Article'); // const defer = Q.defer(); // // Article.remove({_id: article._id}, function(err, result) { // if (err) return defer.reject(err); // return defer.resolve(result); // }); // // return defer.promise; return this.editArticle(id, {deleted: true}); }, createArticle: function(articleParams) { const Article = mongoose.model('Article'); const article = new Article(articleParams); const defer = Q.defer(); article.save(function(err) { const errors = hasErrors(err); if(errors) return defer.reject(errors); defer.resolve(article); }); return defer.promise; } } // Instance Methods ArticleSchema.methods = { /** * GetData - get article data * * @return {Buffer} * @api public */ getData: function() { // const ArticleImage = mongoose.model('ArticleImage'); const defer = Q.defer(); // TODO: implementation return defer.promise; }, /** * Hide security sensitive fields * * @returns {*|Array|Binary|Object} */ toJSON: function() { const obj = this.toObject(); obj.url = this.url; return obj; } }; mongoose.model('Article', ArticleSchema);
imperodesign/clever-pages
models/article.js
JavaScript
mit
7,911
(function() { 'use strict'; angular .module('app.layout') .controller('Sidebar', Sidebar); /* @ngInject */ function Sidebar($route, routehelper) { /*jshint validthis: true */ var vm = this; var routes = routehelper.getRoutes(); vm.isCurrent = isCurrent; //vm.sidebarReady = function(){console.log('done animating menu')}; // example activate(); function activate() { getNavRoutes(); } function getNavRoutes() { vm.navRoutes = routes.filter(function(r) { return r.settings && r.settings.nav; }).sort(function(r1, r2) { return r1.settings.nav - r2.settings.nav; }); } function isCurrent(route) { if (!route.title || !$route.current || !$route.current.title) { return ''; } var menuName = route.title; return $route.current.title.substr(0, menuName.length) === menuName ? 'current' : ''; } } })();
johnpapa/ng-demos
ng-1.3 playground/src/client/app/layout/sidebar.controller.js
JavaScript
mit
1,066
import Link from 'next/link' import { logout } from '../utils/auth' const Header = (props) => ( <header> <nav> <ul> <li> <Link href="/"> <a>Home</a> </Link> </li> <li> <Link href="/login"> <a>Login</a> </Link> </li> <li> <Link href="/signup"> <a>Signup</a> </Link> </li> <li> <Link href="/profile"> <a>Profile</a> </Link> </li> <li> <button onClick={logout}>Logout</button> </li> </ul> </nav> <style jsx>{` ul { display: flex; list-style: none; margin-left: 0; padding-left: 0; } li { margin-right: 1rem; } li:first-child { margin-left: auto; } a { color: #fff; text-decoration: none; } header { padding: 0.2rem; color: #fff; background-color: #333; } `}</style> </header> ) export default Header
JeromeFitz/next.js
examples/with-cookie-auth-fauna/components/header.js
JavaScript
mit
1,101
/** * A JavaScript implementation of the JSON-LD API. * * @author Dave Longley * * BSD 3-Clause License * Copyright (c) 2011-2013 Digital Bazaar, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 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. * * Neither the name of the Digital Bazaar, Inc. nor the names of its * contributors may 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 * HOLDER 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() { // determine if in-browser or using node.js var _nodejs = ( typeof process !== 'undefined' && process.versions && process.versions.node); var _browser = !_nodejs && (typeof window !== 'undefined' || typeof self !== 'undefined'); if(_browser) { if(typeof global === 'undefined') { if(typeof window !== 'undefined') { global = window; } else if(typeof self !== 'undefined') { global = self; } else if(typeof $ !== 'undefined') { global = $; } } } // attaches jsonld API to the given object var wrapper = function(jsonld) { /* Core API */ /** * Performs JSON-LD compaction. * * @param input the JSON-LD input to compact. * @param ctx the context to compact with. * @param [options] options to use: * [base] the base IRI to use. * [compactArrays] true to compact arrays to single values when * appropriate, false not to (default: true). * [graph] true to always output a top-level graph (default: false). * [expandContext] a context to expand with. * [skipExpansion] true to assume the input is expanded and skip * expansion, false not to, defaults to false. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, compacted, ctx) called once the operation completes. */ jsonld.compact = function(input, ctx, options, callback) { if(arguments.length < 2) { return jsonld.nextTick(function() { callback(new TypeError('Could not compact, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; if(ctx === null) { return jsonld.nextTick(function() { callback(new JsonLdError( 'The compaction context must not be null.', 'jsonld.CompactError', {code: 'invalid local context'})); }); } // nothing to compact if(input === null) { return jsonld.nextTick(function() { callback(null, null); }); } // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('compactArrays' in options)) { options.compactArrays = true; } if(!('graph' in options)) { options.graph = false; } if(!('skipExpansion' in options)) { options.skipExpansion = false; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } var expand = function(input, options, callback) { jsonld.nextTick(function() { if(options.skipExpansion) { return callback(null, input); } jsonld.expand(input, options, callback); }); }; // expand input then do compaction expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before compaction.', 'jsonld.CompactError', {cause: err})); } // process context var activeCtx = _getInitialContext(options); jsonld.processContext(activeCtx, ctx, options, function(err, activeCtx) { if(err) { return callback(new JsonLdError( 'Could not process context before compaction.', 'jsonld.CompactError', {cause: err})); } try { // do compaction var compacted = new Processor().compact( activeCtx, null, expanded, options); } catch(ex) { return callback(ex); } cleanup(null, compacted, activeCtx, options); }); }); // performs clean up after compaction function cleanup(err, compacted, activeCtx, options) { if(err) { return callback(err); } if(options.compactArrays && !options.graph && _isArray(compacted)) { // simplify to a single item if(compacted.length === 1) { compacted = compacted[0]; } // simplify to an empty object else if(compacted.length === 0) { compacted = {}; } } // always use array if graph option is on else if(options.graph && _isObject(compacted)) { compacted = [compacted]; } // follow @context key if(_isObject(ctx) && '@context' in ctx) { ctx = ctx['@context']; } // build output context ctx = _clone(ctx); if(!_isArray(ctx)) { ctx = [ctx]; } // remove empty contexts var tmp = ctx; ctx = []; for(var i = 0; i < tmp.length; ++i) { if(!_isObject(tmp[i]) || Object.keys(tmp[i]).length > 0) { ctx.push(tmp[i]); } } // remove array if only one context var hasContext = (ctx.length > 0); if(ctx.length === 1) { ctx = ctx[0]; } // add context and/or @graph if(_isArray(compacted)) { // use '@graph' keyword var kwgraph = _compactIri(activeCtx, '@graph'); var graph = compacted; compacted = {}; if(hasContext) { compacted['@context'] = ctx; } compacted[kwgraph] = graph; } else if(_isObject(compacted) && hasContext) { // reorder keys so @context is first var graph = compacted; compacted = {'@context': ctx}; for(var key in graph) { compacted[key] = graph[key]; } } callback(null, compacted, activeCtx); } }; /** * Performs JSON-LD expansion. * * @param input the JSON-LD input to expand. * @param [options] the options to use: * [base] the base IRI to use. * [expandContext] a context to expand with. * [keepFreeFloatingNodes] true to keep free-floating nodes, * false not to, defaults to false. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, expanded) called once the operation completes. */ jsonld.expand = function(input, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not expand, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } if(!('keepFreeFloatingNodes' in options)) { options.keepFreeFloatingNodes = false; } jsonld.nextTick(function() { // if input is a string, attempt to dereference remote document if(typeof input === 'string') { var done = function(err, remoteDoc) { if(err) { return callback(err); } try { if(!remoteDoc.document) { throw new JsonLdError( 'No remote document found at the given URL.', 'jsonld.NullRemoteDocument'); } if(typeof remoteDoc.document === 'string') { remoteDoc.document = JSON.parse(remoteDoc.document); } } catch(ex) { return callback(new JsonLdError( 'Could not retrieve a JSON-LD document from the URL. URL ' + 'derefencing not implemented.', 'jsonld.LoadDocumentError', { code: 'loading document failed', cause: ex, remoteDoc: remoteDoc })); } expand(remoteDoc); }; var promise = options.documentLoader(input, done); if(promise && 'then' in promise) { promise.then(done.bind(null, null), done); } return; } // nothing to load expand({contextUrl: null, documentUrl: null, document: input}); }); function expand(remoteDoc) { // set default base if(!('base' in options)) { options.base = remoteDoc.documentUrl || ''; } // build meta-object and retrieve all @context URLs var input = { document: _clone(remoteDoc.document), remoteContext: {'@context': remoteDoc.contextUrl} }; if('expandContext' in options) { var expandContext = _clone(options.expandContext); if(typeof expandContext === 'object' && '@context' in expandContext) { input.expandContext = expandContext; } else { input.expandContext = {'@context': expandContext}; } } _retrieveContextUrls(input, options, function(err, input) { if(err) { return callback(err); } try { var processor = new Processor(); var activeCtx = _getInitialContext(options); var document = input.document; var remoteContext = input.remoteContext['@context']; // process optional expandContext if(input.expandContext) { activeCtx = processor.processContext( activeCtx, input.expandContext['@context'], options); } // process remote context from HTTP Link Header if(remoteContext) { activeCtx = processor.processContext( activeCtx, remoteContext, options); } // expand document var expanded = processor.expand( activeCtx, null, document, options, false); // optimize away @graph with no other properties if(_isObject(expanded) && ('@graph' in expanded) && Object.keys(expanded).length === 1) { expanded = expanded['@graph']; } else if(expanded === null) { expanded = []; } // normalize to an array if(!_isArray(expanded)) { expanded = [expanded]; } } catch(ex) { return callback(ex); } callback(null, expanded); }); } }; /** * Performs JSON-LD flattening. * * @param input the JSON-LD to flatten. * @param ctx the context to use to compact the flattened output, or null. * @param [options] the options to use: * [base] the base IRI to use. * [expandContext] a context to expand with. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, flattened) called once the operation completes. */ jsonld.flatten = function(input, ctx, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not flatten, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // expand input jsonld.expand(input, options, function(err, _input) { if(err) { return callback(new JsonLdError( 'Could not expand input before flattening.', 'jsonld.FlattenError', {cause: err})); } try { // do flattening var flattened = new Processor().flatten(_input); } catch(ex) { return callback(ex); } if(ctx === null) { return callback(null, flattened); } // compact result (force @graph option to true, skip expansion) options.graph = true; options.skipExpansion = true; jsonld.compact(flattened, ctx, options, function(err, compacted) { if(err) { return callback(new JsonLdError( 'Could not compact flattened output.', 'jsonld.FlattenError', {cause: err})); } callback(null, compacted); }); }); }; /** * Performs JSON-LD framing. * * @param input the JSON-LD input to frame. * @param frame the JSON-LD frame to use. * @param [options] the framing options. * [base] the base IRI to use. * [expandContext] a context to expand with. * [embed] default @embed flag (default: true). * [explicit] default @explicit flag (default: false). * [omitDefault] default @omitDefault flag (default: false). * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, framed) called once the operation completes. */ jsonld.frame = function(input, frame, options, callback) { if(arguments.length < 2) { return jsonld.nextTick(function() { callback(new TypeError('Could not frame, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } if(!('embed' in options)) { options.embed = true; } options.explicit = options.explicit || false; options.omitDefault = options.omitDefault || false; jsonld.nextTick(function() { // if frame is a string, attempt to dereference remote document if(typeof frame === 'string') { var done = function(err, remoteDoc) { if(err) { return callback(err); } try { if(!remoteDoc.document) { throw new JsonLdError( 'No remote document found at the given URL.', 'jsonld.NullRemoteDocument'); } if(typeof remoteDoc.document === 'string') { remoteDoc.document = JSON.parse(remoteDoc.document); } } catch(ex) { return callback(new JsonLdError( 'Could not retrieve a JSON-LD document from the URL. URL ' + 'derefencing not implemented.', 'jsonld.LoadDocumentError', { code: 'loading document failed', cause: ex, remoteDoc: remoteDoc })); } doFrame(remoteDoc); }; var promise = options.documentLoader(frame, done); if(promise && 'then' in promise) { promise.then(done.bind(null, null), done); } return; } // nothing to load doFrame({contextUrl: null, documentUrl: null, document: frame}); }); function doFrame(remoteFrame) { // preserve frame context and add any Link header context var frame = remoteFrame.document; if(frame) { var ctx = frame['@context'] || {}; if(remoteFrame.contextUrl) { if(!ctx) { ctx = remoteFrame.contextUrl; } else if(_isArray(ctx)) { ctx.push[remoteFrame.contextUrl]; } else { ctx = [ctx, remoteFrame.contextUrl]; } frame['@context'] = ctx; } } else { ctx = {}; } // expand input jsonld.expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before framing.', 'jsonld.FrameError', {cause: err})); } // expand frame var opts = _clone(options); opts.isFrame = true; opts.keepFreeFloatingNodes = true; jsonld.expand(frame, opts, function(err, expandedFrame) { if(err) { return callback(new JsonLdError( 'Could not expand frame before framing.', 'jsonld.FrameError', {cause: err})); } try { // do framing var framed = new Processor().frame(expanded, expandedFrame, opts); } catch(ex) { return callback(ex); } // compact result (force @graph option to true, skip expansion) opts.graph = true; opts.skipExpansion = true; jsonld.compact(framed, ctx, opts, function(err, compacted, ctx) { if(err) { return callback(new JsonLdError( 'Could not compact framed output.', 'jsonld.FrameError', {cause: err})); } // get graph alias var graph = _compactIri(ctx, '@graph'); // remove @preserve from results compacted[graph] = _removePreserve(ctx, compacted[graph], opts); callback(null, compacted); }); }); }); } }; /** * Performs JSON-LD objectification. * * @param input the JSON-LD input to objectify. * @param ctx the JSON-LD context to apply. * @param [options] the framing options. * [base] the base IRI to use. * [expandContext] a context to expand with. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, objectified) called once the operation completes. */ jsonld.objectify = function(input, ctx, options, callback) { // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // expand input jsonld.expand(input, options, function(err, _input) { if(err) { return callback(new JsonLdError( 'Could not expand input before framing.', 'jsonld.FrameError', {cause: err})); } try { // flatten the graph var flattened = new Processor().flatten(_input); } catch(ex) { return callback(ex); } // compact result (force @graph option to true, skip expansion) options.graph = true; options.skipExpansion = true; jsonld.compact(flattened, ctx, options, function(err, compacted, ctx) { if(err) { return callback(new JsonLdError( 'Could not compact flattened output.', 'jsonld.FrameError', {cause: err})); } // get graph alias var graph = _compactIri(ctx, '@graph'); // remove @preserve from results (named graphs?) compacted[graph] = _removePreserve(ctx, compacted[graph], options); var top = compacted[graph][0]; var recurse = function(subject) { // can't replace just a string if(!_isObject(subject) && !_isArray(subject)) { return; } // bottom out recursion on re-visit if(_isObject(subject)) { if(recurse.visited[subject['@id']]) { return; } recurse.visited[subject['@id']] = true; } // each array element *or* object key for(var k in subject) { var obj = subject[k]; var isid = (jsonld.getContextValue(ctx, k, '@type') === '@id'); // can't replace a non-object or non-array unless it's an @id if(!_isArray(obj) && !_isObject(obj) && !isid) { continue; } if(_isString(obj) && isid) { subject[k] = obj = top[obj]; recurse(obj); } else if(_isArray(obj)) { for(var i = 0; i < obj.length; ++i) { if(_isString(obj[i]) && isid) { obj[i] = top[obj[i]]; } else if(_isObject(obj[i]) && '@id' in obj[i]) { obj[i] = top[obj[i]['@id']]; } recurse(obj[i]); } } else if(_isObject(obj)) { var sid = obj['@id']; subject[k] = obj = top[sid]; recurse(obj); } } }; recurse.visited = {}; recurse(top); compacted.of_type = {}; for(var s in top) { if(!('@type' in top[s])) { continue; } var types = top[s]['@type']; if(!_isArray(types)) { types = [types]; } for(var t in types) { if(!(types[t] in compacted.of_type)) { compacted.of_type[types[t]] = []; } compacted.of_type[types[t]].push(top[s]); } } callback(null, compacted); }); }); }; /** * Performs RDF dataset normalization on the given JSON-LD input. The output * is an RDF dataset unless the 'format' option is used. * * @param input the JSON-LD input to normalize. * @param [options] the options to use: * [base] the base IRI to use. * [expandContext] a context to expand with. * [format] the format if output is a string: * 'application/nquads' for N-Quads. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, normalized) called once the operation completes. */ jsonld.normalize = function(input, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not normalize, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // convert to RDF dataset then do normalization var opts = _clone(options); delete opts.format; opts.produceGeneralizedRdf = false; jsonld.toRDF(input, opts, function(err, dataset) { if(err) { return callback(new JsonLdError( 'Could not convert input to RDF dataset before normalization.', 'jsonld.NormalizeError', {cause: err})); } // do normalization new Processor().normalize(dataset, options, callback); }); }; /** * Converts an RDF dataset to JSON-LD. * * @param dataset a serialized string of RDF in a format specified by the * format option or an RDF dataset to convert. * @param [options] the options to use: * [format] the format if input is not an array: * 'application/nquads' for N-Quads (default). * [rdfParser] a custom RDF-parser to use to parse the input. * [useRdfType] true to use rdf:type, false to use @type * (default: false). * [useNativeTypes] true to convert XSD types into native types * (boolean, integer, double), false not to (default: false). * * @param callback(err, output) called once the operation completes. */ jsonld.fromRDF = function(dataset, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not convert from RDF, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('useRdfType' in options)) { options.useRdfType = false; } if(!('useNativeTypes' in options)) { options.useNativeTypes = false; } if(!('format' in options) && _isString(dataset)) { // set default format to nquads if(!('format' in options)) { options.format = 'application/nquads'; } } jsonld.nextTick(function() { // handle special format if(options.format) { // check supported formats var rdfParser = options.rdfParser || _rdfParsers[options.format]; if(!rdfParser) { throw new JsonLdError( 'Unknown input format.', 'jsonld.UnknownFormat', {format: options.format}); } // rdf parser may be async or sync, always pass callback dataset = rdfParser(dataset, function(err, dataset) { if(err) { return callback(err); } fromRDF(dataset, options, callback); }); // handle synchronous or promise-based parser if(dataset) { // if dataset is actually a promise if('then' in dataset) { return dataset.then(function(dataset) { fromRDF(dataset, options, callback); }, callback); } // parser is synchronous fromRDF(dataset, options, callback); } } function fromRDF(dataset, options, callback) { // convert from RDF new Processor().fromRDF(dataset, options, callback); } }); }; /** * Outputs the RDF dataset found in the given JSON-LD object. * * @param input the JSON-LD input. * @param [options] the options to use: * [base] the base IRI to use. * [expandContext] a context to expand with. * [format] the format to use to output a string: * 'application/nquads' for N-Quads. * [produceGeneralizedRdf] true to output generalized RDF, false * to produce only standard RDF (default: false). * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, dataset) called once the operation completes. */ jsonld.toRDF = function(input, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not convert to RDF, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // expand input jsonld.expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before serialization to RDF.', 'jsonld.RdfError', {cause: err})); } try { // output RDF dataset var dataset = Processor.prototype.toRDF(expanded, options); if(options.format) { if(options.format === 'application/nquads') { return callback(null, _toNQuads(dataset)); } throw new JsonLdError( 'Unknown output format.', 'jsonld.UnknownFormat', {format: options.format}); } } catch(ex) { return callback(ex); } callback(null, dataset); }); }; /** * Relabels all blank nodes in the given JSON-LD input. * * @param input the JSON-LD input. */ jsonld.relabelBlankNodes = function(input) { _labelBlankNodes(new UniqueNamer('_:b', input)); }; /** * The default document loader for external documents. If the environment * is node.js, a callback-continuation-style document loader is used; otherwise, * a promises-style document loader is used. * * @param url the URL to load. * @param callback(err, remoteDoc) called once the operation completes, * if using a non-promises API. * * @return a promise, if using a promises API. */ jsonld.documentLoader = function(url, callback) { var err = new JsonLdError( 'Could not retrieve a JSON-LD document from the URL. URL derefencing not ' + 'implemented.', 'jsonld.LoadDocumentError', {code: 'loading document failed'}); if(_nodejs) { return callback(err, {contextUrl: null, documentUrl: url, document: null}); } return jsonld.promisify(function(callback) { callback(err); }); }; /** * Deprecated default document loader. Use or override jsonld.documentLoader * instead. */ jsonld.loadDocument = function(url, callback) { var promise = jsonld.documentLoader(url, callback); if(promise && 'then' in promise) { promise.then(callback.bind(null, null), callback); } }; /* Promises API */ jsonld.promises = function() { var slice = Array.prototype.slice; var promisify = jsonld.promisify; var api = {}; api.expand = function(input) { if(arguments.length < 1) { throw new TypeError('Could not expand, too few arguments.'); } return promisify.apply(null, [jsonld.expand].concat(slice.call(arguments))); }; api.compact = function(input, ctx) { if(arguments.length < 2) { throw new TypeError('Could not compact, too few arguments.'); } var compact = function(input, ctx, options, callback) { // ensure only one value is returned in callback jsonld.compact(input, ctx, options, function(err, compacted) { callback(err, compacted); }); }; return promisify.apply(null, [compact].concat(slice.call(arguments))); }; api.flatten = function(input) { if(arguments.length < 1) { throw new TypeError('Could not flatten, too few arguments.'); } return promisify.apply( null, [jsonld.flatten].concat(slice.call(arguments))); }; api.frame = function(input, frame) { if(arguments.length < 2) { throw new TypeError('Could not frame, too few arguments.'); } return promisify.apply(null, [jsonld.frame].concat(slice.call(arguments))); }; api.fromRDF = function(dataset) { if(arguments.length < 1) { throw new TypeError('Could not convert from RDF, too few arguments.'); } return promisify.apply( null, [jsonld.fromRDF].concat(slice.call(arguments))); }; api.toRDF = function(input) { if(arguments.length < 1) { throw new TypeError('Could not convert to RDF, too few arguments.'); } return promisify.apply(null, [jsonld.toRDF].concat(slice.call(arguments))); }; api.normalize = function(input) { if(arguments.length < 1) { throw new TypeError('Could not normalize, too few arguments.'); } return promisify.apply( null, [jsonld.normalize].concat(slice.call(arguments))); }; return api; }; /** * Converts a node.js async op into a promise w/boxed resolved value(s). * * @param op the operation to convert. * * @return the promise. */ jsonld.promisify = function(op) { var Promise = _nodejs ? require('./Promise').Promise : global.Promise; var args = Array.prototype.slice.call(arguments, 1); return new Promise(function(resolver) { op.apply(null, args.concat(function(err, value) { if(err) { resolver.reject(err); } else { resolver.resolve(value); } })); }); }; /* WebIDL API */ function JsonLdProcessor() {} JsonLdProcessor.prototype = jsonld.promises(); JsonLdProcessor.prototype.toString = function() { if(this instanceof JsonLdProcessor) { return '[object JsonLdProcessor]'; } return '[object JsonLdProcessorPrototype]'; }; jsonld.JsonLdProcessor = JsonLdProcessor; // IE8 has Object.defineProperty but it only // works on DOM nodes -- so feature detection // requires try/catch :-( var canDefineProperty = !!Object.defineProperty; if(canDefineProperty) { try { Object.defineProperty({}, 'x', {}); } catch(e) { canDefineProperty = false; } } if(canDefineProperty) { Object.defineProperty(JsonLdProcessor, 'prototype', { writable: false, enumerable: false }); Object.defineProperty(JsonLdProcessor.prototype, 'constructor', { writable: true, enumerable: false, configurable: true, value: JsonLdProcessor }); } // setup browser global JsonLdProcessor if(_browser && typeof global.JsonLdProcessor === 'undefined') { if(canDefineProperty) { Object.defineProperty(global, 'JsonLdProcessor', { writable: true, enumerable: false, configurable: true, value: JsonLdProcessor }); } else { global.JsonLdProcessor = JsonLdProcessor; } } /* Utility API */ // define setImmediate and nextTick if(typeof process === 'undefined' || !process.nextTick) { if(typeof setImmediate === 'function') { jsonld.setImmediate = setImmediate; jsonld.nextTick = function(callback) { return setImmediate(callback); }; } else { jsonld.setImmediate = function(callback) { setTimeout(callback, 0); }; jsonld.nextTick = jsonld.setImmediate; } } else { jsonld.nextTick = process.nextTick; if(typeof setImmediate === 'function') { jsonld.setImmediate = setImmediate; } else { jsonld.setImmediate = jsonld.nextTick; } } /** * Parses a link header. The results will be key'd by the value of "rel". * * Link: <http://json-ld.org/contexts/person.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" * * Parses as: { * 'http://www.w3.org/ns/json-ld#context': { * target: http://json-ld.org/contexts/person.jsonld, * type: 'application/ld+json' * } * } * * If there is more than one "rel" with the same IRI, then entries in the * resulting map for that "rel" will be arrays. * * @param header the link header to parse. */ jsonld.parseLinkHeader = function(header) { var rval = {}; // split on unbracketed/unquoted commas var entries = header.match(/(?:<[^>]*?>|"[^"]*?"|[^,])+/g); var rLinkHeader = /\s*<([^>]*?)>\s*(?:;\s*(.*))?/; for(var i = 0; i < entries.length; ++i) { var match = entries[i].match(rLinkHeader); if(!match) { continue; } var result = {target: match[1]}; var params = match[2]; var rParams = /(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g; while(match = rParams.exec(params)) { result[match[1]] = (match[2] === undefined) ? match[3] : match[2]; } var rel = result['rel'] || ''; if(_isArray(rval[rel])) { rval[rel].push(result); } else if(rel in rval) { rval[rel] = [rval[rel], result]; } else { rval[rel] = result; } } return rval; }; /** * Creates a simple document cache that retains documents for a short * period of time. * * FIXME: Implement simple HTTP caching instead. * * @param size the maximum size of the cache. */ jsonld.DocumentCache = function(size) { this.order = []; this.cache = {}; this.size = size || 50; this.expires = 30*1000; }; jsonld.DocumentCache.prototype.get = function(url) { if(url in this.cache) { var entry = this.cache[url]; if(entry.expires >= +new Date()) { return entry.ctx; } delete this.cache[url]; this.order.splice(this.order.indexOf(url), 1); } return null; }; jsonld.DocumentCache.prototype.set = function(url, ctx) { if(this.order.length === this.size) { delete this.cache[this.order.shift()]; } this.order.push(url); this.cache[url] = {ctx: ctx, expires: (+new Date() + this.expires)}; }; /** * Creates an active context cache. * * @param size the maximum size of the cache. */ jsonld.ActiveContextCache = function(size) { this.order = []; this.cache = {}; this.size = size || 100; }; jsonld.ActiveContextCache.prototype.get = function(activeCtx, localCtx) { var key1 = JSON.stringify(activeCtx); var key2 = JSON.stringify(localCtx); var level1 = this.cache[key1]; if(level1 && key2 in level1) { return level1[key2]; } return null; }; jsonld.ActiveContextCache.prototype.set = function( activeCtx, localCtx, result) { if(this.order.length === this.size) { var entry = this.order.shift(); delete this.cache[entry.activeCtx][entry.localCtx]; } var key1 = JSON.stringify(activeCtx); var key2 = JSON.stringify(localCtx); this.order.push({activeCtx: key1, localCtx: key2}); if(!(key1 in this.cache)) { this.cache[key1] = {}; } this.cache[key1][key2] = _clone(result); }; /** * Default JSON-LD cache. */ jsonld.cache = { activeCtx: new jsonld.ActiveContextCache() }; /** * Document loaders. */ jsonld.documentLoaders = {}; /** * Creates a built-in jquery document loader. * * @param $ the jquery instance to use. * @param options the options to use: * secure: require all URLs to use HTTPS. * usePromise: true to use a promises API, false for a * callback-continuation-style API; true by default. * * @return the jquery document loader. */ jsonld.documentLoaders.jquery = function($, options) { options = options || {}; var cache = new jsonld.DocumentCache(); var loader = function(url, callback) { if(options.secure && url.indexOf('https') !== 0) { return callback(new JsonLdError( 'URL could not be dereferenced; secure mode is enabled and ' + 'the URL\'s scheme is not "https".', 'jsonld.InvalidUrl', {code: 'loading document failed', url: url}), {contextUrl: null, documentUrl: url, document: null}); } var doc = cache.get(url); if(doc !== null) { return callback(null, doc); } $.ajax({ url: url, dataType: 'json', crossDomain: true, success: function(data, textStatus, jqXHR) { var doc = {contextUrl: null, documentUrl: url, document: data}; // handle Link Header var contentType = jqXHR.getResponseHeader('Content-Type'); var linkHeader = jqXHR.getResponseHeader('Link'); if(linkHeader && contentType !== 'application/ld+json') { // only 1 related link header permitted linkHeader = jsonld.parseLinkHeader(linkHeader)[LINK_HEADER_REL]; if(_isArray(linkHeader)) { return callback(new JsonLdError( 'URL could not be dereferenced, it has more than one ' + 'associated HTTP Link Header.', 'jsonld.InvalidUrl', {code: 'multiple context link headers', url: url}), doc); } if(linkHeader) { doc.contextUrl = linkHeader.target; } } cache.set(url, doc); callback(null, doc); }, error: function(jqXHR, textStatus, err) { callback(new JsonLdError( 'URL could not be dereferenced, an error occurred.', 'jsonld.LoadDocumentError', {code: 'loading document failed', url: url, cause: err}), {contextUrl: null, documentUrl: url, document: null}); } }); }; if(!('usePromise' in options) || options.usePromise) { return function(url) { return jsonld.promisify(loader, url); }; } return loader; }; /** * Creates a built-in node document loader. * * @param options the options to use: * secure: require all URLs to use HTTPS. * maxRedirects: the maximum number of redirects to permit, none by * default. * usePromise: true to use a promises API, false for a * callback-continuation-style API; false by default. * * @return the node document loader. */ jsonld.documentLoaders.node = function(options) { options = options || {}; var maxRedirects = ('maxRedirects' in options) ? options.maxRedirects : -1; var request = require('request'); var http = require('http'); var cache = new jsonld.DocumentCache(); function loadDocument(url, redirects, callback) { if(options.secure && url.indexOf('https') !== 0) { return callback(new JsonLdError( 'URL could not be dereferenced; secure mode is enabled and ' + 'the URL\'s scheme is not "https".', 'jsonld.InvalidUrl', {code: 'loading document failed', url: url}), {contextUrl: null, documentUrl: url, document: null}); } var doc = cache.get(url); if(doc !== null) { return callback(null, doc); } request({ url: url, strictSSL: true, followRedirect: false }, function(err, res, body) { doc = {contextUrl: null, documentUrl: url, document: body || null}; // handle error if(err) { return callback(new JsonLdError( 'URL could not be dereferenced, an error occurred.', 'jsonld.LoadDocumentError', {code: 'loading document failed', url: url, cause: err}), doc); } var statusText = http.STATUS_CODES[res.statusCode]; if(res.statusCode >= 400) { return callback(new JsonLdError( 'URL could not be dereferenced: ' + statusText, 'jsonld.InvalidUrl', { code: 'loading document failed', url: url, httpStatusCode: res.statusCode }), doc); } // handle Link Header if(res.headers.link && res.headers['content-type'] !== 'application/ld+json') { // only 1 related link header permitted var linkHeader = jsonld.parseLinkHeader( res.headers.link)[LINK_HEADER_REL]; if(_isArray(linkHeader)) { return callback(new JsonLdError( 'URL could not be dereferenced, it has more than one associated ' + 'HTTP Link Header.', 'jsonld.InvalidUrl', {code: 'multiple context link headers', url: url}), doc); } if(linkHeader) { doc.contextUrl = linkHeader.target; } } // handle redirect if(res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) { if(redirects.length === maxRedirects) { return callback(new JsonLdError( 'URL could not be dereferenced; there were too many redirects.', 'jsonld.TooManyRedirects', { code: 'loading document failed', url: url, httpStatusCode: res.statusCode, redirects: redirects }), doc); } if(redirects.indexOf(url) !== -1) { return callback(new JsonLdError( 'URL could not be dereferenced; infinite redirection was detected.', 'jsonld.InfiniteRedirectDetected', { code: 'recursive context inclusion', url: url, httpStatusCode: res.statusCode, redirects: redirects }), doc); } redirects.push(url); return loadDocument(res.headers.location, redirects, callback); } // cache for each redirected URL redirects.push(url); for(var i = 0; i < redirects.length; ++i) { cache.set( redirects[i], {contextUrl: null, documentUrl: redirects[i], document: body}); } callback(err, doc); }); } var loader = function(url, callback) { loadDocument(url, [], callback); }; if(options.usePromise) { return function(url) { return jsonld.promisify(loader, url); }; } return loader; }; /** * Creates a built-in XMLHttpRequest document loader. * * @param options the options to use: * secure: require all URLs to use HTTPS. * usePromise: true to use a promises API, false for a * callback-continuation-style API; true by default. * [xhr]: the XMLHttpRequest API to use. * * @return the XMLHttpRequest document loader. */ jsonld.documentLoaders.xhr = function(options) { options = options || {}; var cache = new jsonld.DocumentCache(); var loader = function(url, callback) { if(options.secure && url.indexOf('https') !== 0) { return callback(new JsonLdError( 'URL could not be dereferenced; secure mode is enabled and ' + 'the URL\'s scheme is not "https".', 'jsonld.InvalidUrl', {code: 'loading document failed', url: url}), {contextUrl: null, documentUrl: url, document: null}); } var doc = cache.get(url); if(doc !== null) { return callback(null, doc); } var xhr = options.xhr || XMLHttpRequest; var req = new xhr(); req.onload = function(e) { var doc = {contextUrl: null, documentUrl: url, document: req.response}; // handle Link Header var contentType = req.getResponseHeader('Content-Type'); var linkHeader = req.getResponseHeader('Link'); if(linkHeader && contentType !== 'application/ld+json') { // only 1 related link header permitted linkHeader = jsonld.parseLinkHeader(linkHeader)[LINK_HEADER_REL]; if(_isArray(linkHeader)) { return callback(new JsonLdError( 'URL could not be dereferenced, it has more than one ' + 'associated HTTP Link Header.', 'jsonld.InvalidUrl', {code: 'multiple context link headers', url: url}), doc); } if(linkHeader) { doc.contextUrl = linkHeader.target; } } cache.set(url, doc); callback(null, doc); }; req.onerror = function() { callback(new JsonLdError( 'URL could not be dereferenced, an error occurred.', 'jsonld.LoadDocumentError', {code: 'loading document failed', url: url}), {contextUrl: null, documentUrl: url, document: null}); }; req.open('GET', url, true); req.send(); }; if(!('usePromise' in options) || options.usePromise) { return function(url) { return jsonld.promisify(loader, url); }; } return loader; }; /** * Assigns the default document loader for external document URLs to a built-in * default. Supported types currently include: 'jquery' and 'node'. * * To use the jquery document loader, the first parameter must be a reference * to the main jquery object. * * @param type the type to set. * @param [params] the parameters required to use the document loader. */ jsonld.useDocumentLoader = function(type) { if(!(type in jsonld.documentLoaders)) { throw new JsonLdError( 'Unknown document loader type: "' + type + '"', 'jsonld.UnknownDocumentLoader', {type: type}); } // set document loader jsonld.documentLoader = jsonld.documentLoaders[type].apply( jsonld, Array.prototype.slice.call(arguments, 1)); }; /** * Processes a local context, resolving any URLs as necessary, and returns a * new active context in its callback. * * @param activeCtx the current active context. * @param localCtx the local context to process. * @param [options] the options to use: * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, ctx) called once the operation completes. */ jsonld.processContext = function(activeCtx, localCtx) { // get arguments var options = {}; var callbackArg = 2; if(arguments.length > 3) { options = arguments[2] || {}; callbackArg += 1; } var callback = arguments[callbackArg]; // set default options if(!('base' in options)) { options.base = ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // return initial context early for null context if(localCtx === null) { return callback(null, _getInitialContext(options)); } // retrieve URLs in localCtx localCtx = _clone(localCtx); if(_isString(localCtx) || (_isObject(localCtx) && !('@context' in localCtx))) { localCtx = {'@context': localCtx}; } _retrieveContextUrls(localCtx, options, function(err, ctx) { if(err) { return callback(err); } try { // process context ctx = new Processor().processContext(activeCtx, ctx, options); } catch(ex) { return callback(ex); } callback(null, ctx); }); }; /** * Returns true if the given subject has the given property. * * @param subject the subject to check. * @param property the property to look for. * * @return true if the subject has the given property, false if not. */ jsonld.hasProperty = function(subject, property) { var rval = false; if(property in subject) { var value = subject[property]; rval = (!_isArray(value) || value.length > 0); } return rval; }; /** * Determines if the given value is a property of the given subject. * * @param subject the subject to check. * @param property the property to check. * @param value the value to check. * * @return true if the value exists, false if not. */ jsonld.hasValue = function(subject, property, value) { var rval = false; if(jsonld.hasProperty(subject, property)) { var val = subject[property]; var isList = _isList(val); if(_isArray(val) || isList) { if(isList) { val = val['@list']; } for(var i = 0; i < val.length; ++i) { if(jsonld.compareValues(value, val[i])) { rval = true; break; } } } // avoid matching the set of values with an array value parameter else if(!_isArray(value)) { rval = jsonld.compareValues(value, val); } } return rval; }; /** * Adds a value to a subject. If the value is an array, all values in the * array will be added. * * @param subject the subject to add the value to. * @param property the property that relates the value to the subject. * @param value the value to add. * @param [options] the options to use: * [propertyIsArray] true if the property is always an array, false * if not (default: false). * [allowDuplicate] true to allow duplicates, false not to (uses a * simple shallow comparison of subject ID or value) (default: true). */ jsonld.addValue = function(subject, property, value, options) { options = options || {}; if(!('propertyIsArray' in options)) { options.propertyIsArray = false; } if(!('allowDuplicate' in options)) { options.allowDuplicate = true; } if(_isArray(value)) { if(value.length === 0 && options.propertyIsArray && !(property in subject)) { subject[property] = []; } for(var i = 0; i < value.length; ++i) { jsonld.addValue(subject, property, value[i], options); } } else if(property in subject) { // check if subject already has value if duplicates not allowed var hasValue = (!options.allowDuplicate && jsonld.hasValue(subject, property, value)); // make property an array if value not present or always an array if(!_isArray(subject[property]) && (!hasValue || options.propertyIsArray)) { subject[property] = [subject[property]]; } // add new value if(!hasValue) { subject[property].push(value); } } else { // add new value as set or single value subject[property] = options.propertyIsArray ? [value] : value; } }; /** * Gets all of the values for a subject's property as an array. * * @param subject the subject. * @param property the property. * * @return all of the values for a subject's property as an array. */ jsonld.getValues = function(subject, property) { var rval = subject[property] || []; if(!_isArray(rval)) { rval = [rval]; } return rval; }; /** * Removes a property from a subject. * * @param subject the subject. * @param property the property. */ jsonld.removeProperty = function(subject, property) { delete subject[property]; }; /** * Removes a value from a subject. * * @param subject the subject. * @param property the property that relates the value to the subject. * @param value the value to remove. * @param [options] the options to use: * [propertyIsArray] true if the property is always an array, false * if not (default: false). */ jsonld.removeValue = function(subject, property, value, options) { options = options || {}; if(!('propertyIsArray' in options)) { options.propertyIsArray = false; } // filter out value var values = jsonld.getValues(subject, property).filter(function(e) { return !jsonld.compareValues(e, value); }); if(values.length === 0) { jsonld.removeProperty(subject, property); } else if(values.length === 1 && !options.propertyIsArray) { subject[property] = values[0]; } else { subject[property] = values; } }; /** * Compares two JSON-LD values for equality. Two JSON-LD values will be * considered equal if: * * 1. They are both primitives of the same type and value. * 2. They are both @values with the same @value, @type, @language, * and @index, OR * 3. They both have @ids they are the same. * * @param v1 the first value. * @param v2 the second value. * * @return true if v1 and v2 are considered equal, false if not. */ jsonld.compareValues = function(v1, v2) { // 1. equal primitives if(v1 === v2) { return true; } // 2. equal @values if(_isValue(v1) && _isValue(v2) && v1['@value'] === v2['@value'] && v1['@type'] === v2['@type'] && v1['@language'] === v2['@language'] && v1['@index'] === v2['@index']) { return true; } // 3. equal @ids if(_isObject(v1) && ('@id' in v1) && _isObject(v2) && ('@id' in v2)) { return v1['@id'] === v2['@id']; } return false; }; /** * Gets the value for the given active context key and type, null if none is * set. * * @param ctx the active context. * @param key the context key. * @param [type] the type of value to get (eg: '@id', '@type'), if not * specified gets the entire entry for a key, null if not found. * * @return the value. */ jsonld.getContextValue = function(ctx, key, type) { var rval = null; // return null for invalid key if(key === null) { return rval; } // get default language if(type === '@language' && (type in ctx)) { rval = ctx[type]; } // get specific entry information if(ctx.mappings[key]) { var entry = ctx.mappings[key]; // return whole entry if(_isUndefined(type)) { rval = entry; } // return entry value for type else if(type in entry) { rval = entry[type]; } } return rval; }; /** Registered RDF dataset parsers hashed by content-type. */ var _rdfParsers = {}; /** * Registers an RDF dataset parser by content-type, for use with * jsonld.fromRDF. An RDF dataset parser will always be given two parameters, * a string of input and a callback. An RDF dataset parser can be synchronous * or asynchronous. * * If the parser function returns undefined or null then it will be assumed to * be asynchronous w/a continuation-passing style and the callback parameter * given to the parser MUST be invoked. * * If it returns a Promise, then it will be assumed to be asynchronous, but the * callback parameter MUST NOT be invoked. It should instead be ignored. * * If it returns an RDF dataset, it will be assumed to be synchronous and the * callback parameter MUST NOT be invoked. It should instead be ignored. * * @param contentType the content-type for the parser. * @param parser(input, callback(err, dataset)) the parser function (takes a * string as a parameter and either returns null/undefined and uses * the given callback, returns a Promise, or returns an RDF dataset). */ jsonld.registerRDFParser = function(contentType, parser) { _rdfParsers[contentType] = parser; }; /** * Unregisters an RDF dataset parser by content-type. * * @param contentType the content-type for the parser. */ jsonld.unregisterRDFParser = function(contentType) { delete _rdfParsers[contentType]; }; if(_nodejs) { // needed for serialization of XML literals if(typeof XMLSerializer === 'undefined') { var XMLSerializer = null; } if(typeof Node === 'undefined') { var Node = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE:12 }; } } // constants var XSD_BOOLEAN = 'http://www.w3.org/2001/XMLSchema#boolean'; var XSD_DOUBLE = 'http://www.w3.org/2001/XMLSchema#double'; var XSD_INTEGER = 'http://www.w3.org/2001/XMLSchema#integer'; var XSD_STRING = 'http://www.w3.org/2001/XMLSchema#string'; var RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; var RDF_LIST = RDF + 'List'; var RDF_FIRST = RDF + 'first'; var RDF_REST = RDF + 'rest'; var RDF_NIL = RDF + 'nil'; var RDF_TYPE = RDF + 'type'; var RDF_PLAIN_LITERAL = RDF + 'PlainLiteral'; var RDF_XML_LITERAL = RDF + 'XMLLiteral'; var RDF_OBJECT = RDF + 'object'; var RDF_LANGSTRING = RDF + 'langString'; var LINK_HEADER_REL = 'http://www.w3.org/ns/json-ld#context'; var MAX_CONTEXT_URLS = 10; /** * A JSON-LD Error. * * @param msg the error message. * @param type the error type. * @param details the error details. */ var JsonLdError = function(msg, type, details) { if(_nodejs) { Error.call(this); Error.captureStackTrace(this, this.constructor); } this.name = type || 'jsonld.Error'; this.message = msg || 'An unspecified JSON-LD error occurred.'; this.details = details || {}; }; if(_nodejs) { require('util').inherits(JsonLdError, Error); } /** * Constructs a new JSON-LD Processor. */ var Processor = function() {}; /** * Recursively compacts an element using the given active context. All values * must be in expanded form before this method is called. * * @param activeCtx the active context to use. * @param activeProperty the compacted property associated with the element * to compact, null for none. * @param element the element to compact. * @param options the compaction options. * * @return the compacted value. */ Processor.prototype.compact = function( activeCtx, activeProperty, element, options) { // recursively compact array if(_isArray(element)) { var rval = []; for(var i = 0; i < element.length; ++i) { // compact, dropping any null values var compacted = this.compact( activeCtx, activeProperty, element[i], options); if(compacted !== null) { rval.push(compacted); } } if(options.compactArrays && rval.length === 1) { // use single element if no container is specified var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); if(container === null) { rval = rval[0]; } } return rval; } // recursively compact object if(_isObject(element)) { // do value compaction on @values and subject references if(_isValue(element) || _isSubjectReference(element)) { return _compactValue(activeCtx, activeProperty, element); } // FIXME: avoid misuse of active property as an expanded property? var insideReverse = (activeProperty === '@reverse'); // process element keys in order var keys = Object.keys(element).sort(); var rval = {}; for(var ki = 0; ki < keys.length; ++ki) { var expandedProperty = keys[ki]; var expandedValue = element[expandedProperty]; // compact @id and @type(s) if(expandedProperty === '@id' || expandedProperty === '@type') { var compactedValue; // compact single @id if(_isString(expandedValue)) { compactedValue = _compactIri( activeCtx, expandedValue, null, {vocab: (expandedProperty === '@type')}); } // expanded value must be a @type array else { compactedValue = []; for(var vi = 0; vi < expandedValue.length; ++vi) { compactedValue.push(_compactIri( activeCtx, expandedValue[vi], null, {vocab: true})); } } // use keyword alias and add value var alias = _compactIri(activeCtx, expandedProperty); var isArray = (_isArray(compactedValue) && expandedValue.length === 0); jsonld.addValue( rval, alias, compactedValue, {propertyIsArray: isArray}); continue; } // handle @reverse if(expandedProperty === '@reverse') { // recursively compact expanded value var compactedValue = this.compact( activeCtx, '@reverse', expandedValue, options); // handle double-reversed properties for(var compactedProperty in compactedValue) { if(activeCtx.mappings[compactedProperty] && activeCtx.mappings[compactedProperty].reverse) { var value = compactedValue[compactedProperty]; var container = jsonld.getContextValue( activeCtx, compactedProperty, '@container'); var useArray = (container === '@set' || !options.compactArrays); jsonld.addValue( rval, compactedProperty, value, {propertyIsArray: useArray}); delete compactedValue[compactedProperty]; } } if(Object.keys(compactedValue).length > 0) { // use keyword alias and add value var alias = _compactIri(activeCtx, expandedProperty); jsonld.addValue(rval, alias, compactedValue); } continue; } // handle @index property if(expandedProperty === '@index') { // drop @index if inside an @index container var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); if(container === '@index') { continue; } // use keyword alias and add value var alias = _compactIri(activeCtx, expandedProperty); jsonld.addValue(rval, alias, expandedValue); continue; } // Note: expanded value must be an array due to expansion algorithm. // preserve empty arrays if(expandedValue.length === 0) { var itemActiveProperty = _compactIri( activeCtx, expandedProperty, expandedValue, {vocab: true}, insideReverse); jsonld.addValue( rval, itemActiveProperty, expandedValue, {propertyIsArray: true}); } // recusively process array values for(var vi = 0; vi < expandedValue.length; ++vi) { var expandedItem = expandedValue[vi]; // compact property and get container type var itemActiveProperty = _compactIri( activeCtx, expandedProperty, expandedItem, {vocab: true}, insideReverse); var container = jsonld.getContextValue( activeCtx, itemActiveProperty, '@container'); // get @list value if appropriate var isList = _isList(expandedItem); var list = null; if(isList) { list = expandedItem['@list']; } // recursively compact expanded item var compactedItem = this.compact( activeCtx, itemActiveProperty, isList ? list : expandedItem, options); // handle @list if(isList) { // ensure @list value is an array if(!_isArray(compactedItem)) { compactedItem = [compactedItem]; } if(container !== '@list') { // wrap using @list alias var wrapper = {}; wrapper[_compactIri(activeCtx, '@list')] = compactedItem; compactedItem = wrapper; // include @index from expanded @list, if any if('@index' in expandedItem) { compactedItem[_compactIri(activeCtx, '@index')] = expandedItem['@index']; } } // can't use @list container for more than 1 list else if(itemActiveProperty in rval) { throw new JsonLdError( 'JSON-LD compact error; property has a "@list" @container ' + 'rule but there is more than a single @list that matches ' + 'the compacted term in the document. Compaction might mix ' + 'unwanted items into the list.', 'jsonld.SyntaxError', {code: 'compaction to list of lists'}); } } // handle language and index maps if(container === '@language' || container === '@index') { // get or create the map object var mapObject; if(itemActiveProperty in rval) { mapObject = rval[itemActiveProperty]; } else { rval[itemActiveProperty] = mapObject = {}; } // if container is a language map, simplify compacted value to // a simple string if(container === '@language' && _isValue(compactedItem)) { compactedItem = compactedItem['@value']; } // add compact value to map object using key from expanded value // based on the container type jsonld.addValue(mapObject, expandedItem[container], compactedItem); } else { // use an array if: compactArrays flag is false, // @container is @set or @list , value is an empty // array, or key is @graph var isArray = (!options.compactArrays || container === '@set' || container === '@list' || (_isArray(compactedItem) && compactedItem.length === 0) || expandedProperty === '@list' || expandedProperty === '@graph'); // add compact value jsonld.addValue( rval, itemActiveProperty, compactedItem, {propertyIsArray: isArray}); } } } return rval; } // only primitives remain which are already compact return element; }; /** * Recursively expands an element using the given context. Any context in * the element will be removed. All context URLs must have been retrieved * before calling this method. * * @param activeCtx the context to use. * @param activeProperty the property for the element, null for none. * @param element the element to expand. * @param options the expansion options. * @param insideList true if the element is a list, false if not. * * @return the expanded value. */ Processor.prototype.expand = function( activeCtx, activeProperty, element, options, insideList) { var self = this; // nothing to expand if(element === null || element === undefined) { return null; } if(!_isArray(element) && !_isObject(element)) { // drop free-floating scalars that are not in lists if(!insideList && (activeProperty === null || _expandIri(activeCtx, activeProperty, {vocab: true}) === '@graph')) { return null; } // expand element according to value expansion rules return _expandValue(activeCtx, activeProperty, element); } // recursively expand array if(_isArray(element)) { var rval = []; var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); insideList = insideList || container === '@list'; for(var i = 0; i < element.length; ++i) { // expand element var e = self.expand(activeCtx, activeProperty, element[i], options); if(insideList && (_isArray(e) || _isList(e))) { // lists of lists are illegal throw new JsonLdError( 'Invalid JSON-LD syntax; lists of lists are not permitted.', 'jsonld.SyntaxError', {code: 'list of lists'}); } // drop null values if(e !== null) { if(_isArray(e)) { rval = rval.concat(e); } else { rval.push(e); } } } return rval; } // recursively expand object: // if element has a context, process it if('@context' in element) { activeCtx = self.processContext(activeCtx, element['@context'], options); } // expand the active property var expandedActiveProperty = _expandIri( activeCtx, activeProperty, {vocab: true}); var rval = {}; var keys = Object.keys(element).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; var value = element[key]; var expandedValue; // skip @context if(key === '@context') { continue; } // expand property var expandedProperty = _expandIri(activeCtx, key, {vocab: true}); // drop non-absolute IRI keys that aren't keywords if(expandedProperty === null || !(_isAbsoluteIri(expandedProperty) || _isKeyword(expandedProperty))) { continue; } if(_isKeyword(expandedProperty)) { if(expandedActiveProperty === '@reverse') { throw new JsonLdError( 'Invalid JSON-LD syntax; a keyword cannot be used as a @reverse ' + 'property.', 'jsonld.SyntaxError', {code: 'invalid reverse property map', value: value}); } if(expandedProperty in rval) { throw new JsonLdError( 'Invalid JSON-LD syntax; colliding keywords detected.', 'jsonld.SyntaxError', {code: 'colliding keywords', keyword: expandedProperty}); } } // syntax error if @id is not a string if(expandedProperty === '@id' && !_isString(value)) { if(!options.isFrame) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@id" value must a string.', 'jsonld.SyntaxError', {code: 'invalid @id value', value: value}); } if(!_isObject(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@id" value must be a string or an ' + 'object.', 'jsonld.SyntaxError', {code: 'invalid @id value', value: value}); } } if(expandedProperty === '@type') { _validateTypeValue(value); } // @graph must be an array or an object if(expandedProperty === '@graph' && !(_isObject(value) || _isArray(value))) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@graph" value must not be an ' + 'object or an array.', 'jsonld.SyntaxError', {code: 'invalid @graph value', value: value}); } // @value must not be an object or an array if(expandedProperty === '@value' && (_isObject(value) || _isArray(value))) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@value" value must not be an ' + 'object or an array.', 'jsonld.SyntaxError', {code: 'invalid value object value', value: value}); } // @language must be a string if(expandedProperty === '@language') { if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@language" value must be a string.', 'jsonld.SyntaxError', {code: 'invalid language-tagged string', value: value}); } // ensure language value is lowercase value = value.toLowerCase(); } // @index must be a string if(expandedProperty === '@index') { if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@index" value must be a string.', 'jsonld.SyntaxError', {code: 'invalid @index value', value: value}); } } // @reverse must be an object if(expandedProperty === '@reverse') { if(!_isObject(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@reverse" value must be an object.', 'jsonld.SyntaxError', {code: 'invalid @reverse value', value: value}); } expandedValue = self.expand(activeCtx, '@reverse', value, options); // properties double-reversed if('@reverse' in expandedValue) { for(var property in expandedValue['@reverse']) { jsonld.addValue( rval, property, expandedValue['@reverse'][property], {propertyIsArray: true}); } } // FIXME: can this be merged with code below to simplify? // merge in all reversed properties var reverseMap = rval['@reverse'] || null; for(var property in expandedValue) { if(property === '@reverse') { continue; } if(reverseMap === null) { reverseMap = rval['@reverse'] = {}; } jsonld.addValue(reverseMap, property, [], {propertyIsArray: true}); var items = expandedValue[property]; for(var ii = 0; ii < items.length; ++ii) { var item = items[ii]; if(_isValue(item) || _isList(item)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@reverse" value must not be a ' + '@value or an @list.', 'jsonld.SyntaxError', {code: 'invalid reverse property value', value: expandedValue}); } jsonld.addValue( reverseMap, property, item, {propertyIsArray: true}); } } continue; } var container = jsonld.getContextValue(activeCtx, key, '@container'); // handle language map container (skip if value is not an object) if(container === '@language' && _isObject(value)) { expandedValue = _expandLanguageMap(value); } // handle index container (skip if value is not an object) else if(container === '@index' && _isObject(value)) { expandedValue = (function _expandIndexMap(activeProperty) { var rval = []; var keys = Object.keys(value).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; var val = value[key]; if(!_isArray(val)) { val = [val]; } val = self.expand(activeCtx, activeProperty, val, options, false); for(var vi = 0; vi < val.length; ++vi) { var item = val[vi]; if(!('@index' in item)) { item['@index'] = key; } rval.push(item); } } return rval; })(key); } else { // recurse into @list or @set var isList = (expandedProperty === '@list'); if(isList || expandedProperty === '@set') { var nextActiveProperty = activeProperty; if(isList && expandedActiveProperty === '@graph') { nextActiveProperty = null; } expandedValue = self.expand( activeCtx, nextActiveProperty, value, options, isList); if(isList && _isList(expandedValue)) { throw new JsonLdError( 'Invalid JSON-LD syntax; lists of lists are not permitted.', 'jsonld.SyntaxError', {code: 'list of lists'}); } } else { // recursively expand value with key as new active property expandedValue = self.expand(activeCtx, key, value, options, false); } } // drop null values if property is not @value if(expandedValue === null && expandedProperty !== '@value') { continue; } // convert expanded value to @list if container specifies it if(expandedProperty !== '@list' && !_isList(expandedValue) && container === '@list') { // ensure expanded value is an array expandedValue = (_isArray(expandedValue) ? expandedValue : [expandedValue]); expandedValue = {'@list': expandedValue}; } // FIXME: can this be merged with code above to simplify? // merge in reverse properties if(activeCtx.mappings[key] && activeCtx.mappings[key].reverse) { var reverseMap = rval['@reverse'] = {}; if(!_isArray(expandedValue)) { expandedValue = [expandedValue]; } for(var ii = 0; ii < expandedValue.length; ++ii) { var item = expandedValue[ii]; if(_isValue(item) || _isList(item)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@reverse" value must not be a ' + '@value or an @list.', 'jsonld.SyntaxError', {code: 'invalid reverse property value', value: expandedValue}); } jsonld.addValue( reverseMap, expandedProperty, item, {propertyIsArray: true}); } continue; } // add value for property // use an array except for certain keywords var useArray = ['@index', '@id', '@type', '@value', '@language'].indexOf( expandedProperty) === -1; jsonld.addValue( rval, expandedProperty, expandedValue, {propertyIsArray: useArray}); } // get property count on expanded output keys = Object.keys(rval); var count = keys.length; if('@value' in rval) { // @value must only have @language or @type if('@type' in rval && '@language' in rval) { throw new JsonLdError( 'Invalid JSON-LD syntax; an element containing "@value" may not ' + 'contain both "@type" and "@language".', 'jsonld.SyntaxError', {code: 'invalid value object', element: rval}); } var validCount = count - 1; if('@type' in rval) { validCount -= 1; } if('@index' in rval) { validCount -= 1; } if('@language' in rval) { validCount -= 1; } if(validCount !== 0) { throw new JsonLdError( 'Invalid JSON-LD syntax; an element containing "@value" may only ' + 'have an "@index" property and at most one other property ' + 'which can be "@type" or "@language".', 'jsonld.SyntaxError', {code: 'invalid value object', element: rval}); } // drop null @values if(rval['@value'] === null) { rval = null; } // if @language is present, @value must be a string else if('@language' in rval && !_isString(rval['@value'])) { throw new JsonLdError( 'Invalid JSON-LD syntax; only strings may be language-tagged.', 'jsonld.SyntaxError', {code: 'invalid language-tagged value', element: rval}); } else if('@type' in rval && (!_isAbsoluteIri(rval['@type']) || rval['@type'].indexOf('_:') === 0)) { throw new JsonLdError( 'Invalid JSON-LD syntax; an element containing "@value" and "@type" ' + 'must have an absolute IRI for the value of "@type".', 'jsonld.SyntaxError', {code: 'invalid typed value', element: rval}); } } // convert @type to an array else if('@type' in rval && !_isArray(rval['@type'])) { rval['@type'] = [rval['@type']]; } // handle @set and @list else if('@set' in rval || '@list' in rval) { if(count > 1 && !(count === 2 && '@index' in rval)) { throw new JsonLdError( 'Invalid JSON-LD syntax; if an element has the property "@set" ' + 'or "@list", then it can have at most one other property that is ' + '"@index".', 'jsonld.SyntaxError', {code: 'invalid set or list object', element: rval}); } // optimize away @set if('@set' in rval) { rval = rval['@set']; keys = Object.keys(rval); count = keys.length; } } // drop objects with only @language else if(count === 1 && '@language' in rval) { rval = null; } // drop certain top-level objects that do not occur in lists if(_isObject(rval) && !options.keepFreeFloatingNodes && !insideList && (activeProperty === null || expandedActiveProperty === '@graph')) { // drop empty object, top-level @value/@list, or object with only @id if(count === 0 || '@value' in rval || '@list' in rval || (count === 1 && '@id' in rval)) { rval = null; } } return rval; }; /** * Performs JSON-LD flattening. * * @param input the expanded JSON-LD to flatten. * * @return the flattened output. */ Processor.prototype.flatten = function(input) { // produce a map of all subjects and name each bnode var namer = new UniqueNamer('_:b'); var graphs = {'@default': {}}; _createNodeMap(input, graphs, '@default', namer); // add all non-default graphs to default graph var defaultGraph = graphs['@default']; var graphNames = Object.keys(graphs).sort(); for(var i = 0; i < graphNames.length; ++i) { var graphName = graphNames[i]; if(graphName === '@default') { continue; } var nodeMap = graphs[graphName]; var subject = defaultGraph[graphName]; if(!subject) { defaultGraph[graphName] = subject = { '@id': graphName, '@graph': [] }; } else if(!('@graph' in subject)) { subject['@graph'] = []; } var graph = subject['@graph']; var ids = Object.keys(nodeMap).sort(); for(var ii = 0; ii < ids.length; ++ii) { var node = nodeMap[ids[ii]]; // only add full subjects if(!_isSubjectReference(node)) { graph.push(node); } } } // produce flattened output var flattened = []; var keys = Object.keys(defaultGraph).sort(); for(var ki = 0; ki < keys.length; ++ki) { var node = defaultGraph[keys[ki]]; // only add full subjects to top-level if(!_isSubjectReference(node)) { flattened.push(node); } } return flattened; }; /** * Performs JSON-LD framing. * * @param input the expanded JSON-LD to frame. * @param frame the expanded JSON-LD frame to use. * @param options the framing options. * * @return the framed output. */ Processor.prototype.frame = function(input, frame, options) { // create framing state var state = { options: options, graphs: {'@default': {}, '@merged': {}} }; // produce a map of all graphs and name each bnode // FIXME: currently uses subjects from @merged graph only var namer = new UniqueNamer('_:b'); _createNodeMap(input, state.graphs, '@merged', namer); state.subjects = state.graphs['@merged']; // frame the subjects var framed = []; _frame(state, Object.keys(state.subjects).sort(), frame, framed, null); return framed; }; /** * Performs normalization on the given RDF dataset. * * @param dataset the RDF dataset to normalize. * @param options the normalization options. * @param callback(err, normalized) called once the operation completes. */ Processor.prototype.normalize = function(dataset, options, callback) { // create quads and map bnodes to their associated quads var quads = []; var bnodes = {}; for(var graphName in dataset) { var triples = dataset[graphName]; if(graphName === '@default') { graphName = null; } for(var ti = 0; ti < triples.length; ++ti) { var quad = triples[ti]; if(graphName !== null) { if(graphName.indexOf('_:') === 0) { quad.name = {type: 'blank node', value: graphName}; } else { quad.name = {type: 'IRI', value: graphName}; } } quads.push(quad); var attrs = ['subject', 'object', 'name']; for(var ai = 0; ai < attrs.length; ++ai) { var attr = attrs[ai]; if(quad[attr] && quad[attr].type === 'blank node') { var id = quad[attr].value; if(id in bnodes) { bnodes[id].quads.push(quad); } else { bnodes[id] = {quads: [quad]}; } } } } } // mapping complete, start canonical naming var namer = new UniqueNamer('_:c14n'); return hashBlankNodes(Object.keys(bnodes)); // generates unique and duplicate hashes for bnodes function hashBlankNodes(unnamed) { var nextUnnamed = []; var duplicates = {}; var unique = {}; // hash quads for each unnamed bnode jsonld.setImmediate(function() {hashUnnamed(0);}); function hashUnnamed(i) { if(i === unnamed.length) { // done, name blank nodes return nameBlankNodes(unique, duplicates, nextUnnamed); } // hash unnamed bnode var bnode = unnamed[i]; var hash = _hashQuads(bnode, bnodes, namer); // store hash as unique or a duplicate if(hash in duplicates) { duplicates[hash].push(bnode); nextUnnamed.push(bnode); } else if(hash in unique) { duplicates[hash] = [unique[hash], bnode]; nextUnnamed.push(unique[hash]); nextUnnamed.push(bnode); delete unique[hash]; } else { unique[hash] = bnode; } // hash next unnamed bnode jsonld.setImmediate(function() {hashUnnamed(i + 1);}); } } // names unique hash bnodes function nameBlankNodes(unique, duplicates, unnamed) { // name unique bnodes in sorted hash order var named = false; var hashes = Object.keys(unique).sort(); for(var i = 0; i < hashes.length; ++i) { var bnode = unique[hashes[i]]; namer.getName(bnode); named = true; } // continue to hash bnodes if a bnode was assigned a name if(named) { hashBlankNodes(unnamed); } // name the duplicate hash bnodes else { nameDuplicates(duplicates); } } // names duplicate hash bnodes function nameDuplicates(duplicates) { // enumerate duplicate hash groups in sorted order var hashes = Object.keys(duplicates).sort(); // process each group processGroup(0); function processGroup(i) { if(i === hashes.length) { // done, create JSON-LD array return createArray(); } // name each group member var group = duplicates[hashes[i]]; var results = []; nameGroupMember(group, 0); function nameGroupMember(group, n) { if(n === group.length) { // name bnodes in hash order results.sort(function(a, b) { a = a.hash; b = b.hash; return (a < b) ? -1 : ((a > b) ? 1 : 0); }); for(var r in results) { // name all bnodes in path namer in key-entry order // Note: key-order is preserved in javascript for(var key in results[r].pathNamer.existing) { namer.getName(key); } } return processGroup(i + 1); } // skip already-named bnodes var bnode = group[n]; if(namer.isNamed(bnode)) { return nameGroupMember(group, n + 1); } // hash bnode paths var pathNamer = new UniqueNamer('_:b'); pathNamer.getName(bnode); _hashPaths(bnode, bnodes, namer, pathNamer, function(err, result) { if(err) { return callback(err); } results.push(result); nameGroupMember(group, n + 1); }); } } } // creates the sorted array of RDF quads function createArray() { var normalized = []; /* Note: At this point all bnodes in the set of RDF quads have been assigned canonical names, which have been stored in the 'namer' object. Here each quad is updated by assigning each of its bnodes its new name via the 'namer' object. */ // update bnode names in each quad and serialize for(var i = 0; i < quads.length; ++i) { var quad = quads[i]; var attrs = ['subject', 'object', 'name']; for(var ai = 0; ai < attrs.length; ++ai) { var attr = attrs[ai]; if(quad[attr] && quad[attr].type === 'blank node' && quad[attr].value.indexOf('_:c14n') !== 0) { quad[attr].value = namer.getName(quad[attr].value); } } normalized.push(_toNQuad(quad, quad.name ? quad.name.value : null)); } // sort normalized output normalized.sort(); // handle output format if(options.format) { if(options.format === 'application/nquads') { return callback(null, normalized.join('')); } return callback(new JsonLdError( 'Unknown output format.', 'jsonld.UnknownFormat', {format: options.format})); } // output RDF dataset callback(null, _parseNQuads(normalized.join(''))); } }; /** * Converts an RDF dataset to JSON-LD. * * @param dataset the RDF dataset. * @param options the RDF serialization options. * @param callback(err, output) called once the operation completes. */ Processor.prototype.fromRDF = function(dataset, options, callback) { var defaultGraph = {}; var graphMap = {'@default': defaultGraph}; for(var name in dataset) { var graph = dataset[name]; if(!(name in graphMap)) { graphMap[name] = {}; } if(name !== '@default' && !(name in defaultGraph)) { defaultGraph[name] = {'@id': name}; } var nodeMap = graphMap[name]; for(var ti = 0; ti < graph.length; ++ti) { var triple = graph[ti]; // get subject, predicate, object var s = triple.subject.value; var p = triple.predicate.value; var o = triple.object; if(!(s in nodeMap)) { nodeMap[s] = {'@id': s}; } var node = nodeMap[s]; var objectIsId = (o.type === 'IRI' || o.type === 'blank node'); if(objectIsId && !(o.value in nodeMap)) { nodeMap[o.value] = {'@id': o.value}; } if(p === RDF_TYPE && !options.useRdfType && objectIsId) { jsonld.addValue(node, '@type', o.value, {propertyIsArray: true}); continue; } var value = _RDFToObject(o, options.useNativeTypes); jsonld.addValue(node, p, value, {propertyIsArray: true}); // object may be an RDF list/partial list node but we can't know easily // until all triples are read if(objectIsId) { var object = nodeMap[o.value]; if(!('usages' in object)) { object.usages = []; } object.usages.push({ node: node, property: p, value: value }); } } } // convert linked lists to @list arrays for(var name in graphMap) { var graphObject = graphMap[name]; // no @lists to be converted, continue if(!(RDF_NIL in graphObject)) { continue; } // iterate backwards through each RDF list var nil = graphObject[RDF_NIL]; for(var i = 0; i < nil.usages.length; ++i) { var usage = nil.usages[i]; var node = usage.node; var property = usage.property; var head = usage.value; var list = []; var listNodes = []; // ensure node is a well-formed list node; it must: // 1. Be used only once in a list. // 2. Have an array for rdf:first that has 1 item. // 3. Have an array for rdf:rest that has 1 item. // 4. Have no keys other than: @id, usages, rdf:first, rdf:rest, and, // optionally, @type where the value is rdf:List. var nodeKeyCount = Object.keys(node).length; while(property === RDF_REST && node.usages.length === 1 && _isArray(node[RDF_FIRST]) && node[RDF_FIRST].length === 1 && _isArray(node[RDF_REST]) && node[RDF_REST].length === 1 && (nodeKeyCount === 4 || (nodeKeyCount === 5 && _isArray(node['@type']) && node['@type'].length === 1 && node['@type'][0] === RDF_LIST))) { list.push(node[RDF_FIRST][0]); listNodes.push(node['@id']); // get next node, moving backwards through list usage = node.usages[0]; node = usage.node; property = usage.property; head = usage.value; nodeKeyCount = Object.keys(node).length; // if node is not a blank node, then list head found if(node['@id'].indexOf('_:') !== 0) { break; } } // the list is nested in another list if(property === RDF_FIRST) { // empty list if(node['@id'] === RDF_NIL) { // can't convert rdf:nil to a @list object because it would // result in a list of lists which isn't supported continue; } // preserve list head head = graphObject[head['@id']][RDF_REST][0]; list.pop(); listNodes.pop(); } // transform list into @list object delete head['@id']; head['@list'] = list.reverse(); for(var j = 0; j < listNodes.length; ++j) { delete graphObject[listNodes[j]]; } } } var result = []; var subjects = Object.keys(defaultGraph).sort(); for(var i = 0; i < subjects.length; ++i) { var subject = subjects[i]; var node = defaultGraph[subject]; if(subject in graphMap) { var graph = node['@graph'] = []; var graphObject = graphMap[subject]; var subjects_ = Object.keys(graphObject).sort(); for(var si = 0; si < subjects_.length; ++si) { var node_ = graphObject[subjects_[si]]; delete node_.usages; // only add full subjects to top-level if(!_isSubjectReference(node_)) { graph.push(node_); } } } delete node.usages; // only add full subjects to top-level if(!_isSubjectReference(node)) { result.push(node); } } callback(null, result); }; /** * Outputs an RDF dataset for the expanded JSON-LD input. * * @param input the expanded JSON-LD input. * @param options the RDF serialization options. * * @return the RDF dataset. */ Processor.prototype.toRDF = function(input, options) { // create node map for default graph (and any named graphs) var namer = new UniqueNamer('_:b'); var nodeMap = {'@default': {}}; _createNodeMap(input, nodeMap, '@default', namer); var dataset = {}; var graphNames = Object.keys(nodeMap).sort(); for(var i = 0; i < graphNames.length; ++i) { var graphName = graphNames[i]; // skip relative IRIs if(graphName === '@default' || _isAbsoluteIri(graphName)) { dataset[graphName] = _graphToRDF(nodeMap[graphName], namer, options); } } return dataset; }; /** * Processes a local context and returns a new active context. * * @param activeCtx the current active context. * @param localCtx the local context to process. * @param options the context processing options. * * @return the new active context. */ Processor.prototype.processContext = function(activeCtx, localCtx, options) { // normalize local context to an array of @context objects if(_isObject(localCtx) && '@context' in localCtx && _isArray(localCtx['@context'])) { localCtx = localCtx['@context']; } var ctxs = _isArray(localCtx) ? localCtx : [localCtx]; // no contexts in array, clone existing context if(ctxs.length === 0) { return activeCtx.clone(); } // process each context in order var rval = activeCtx; var mustClone = true; for(var i = 0; i < ctxs.length; ++i) { var ctx = ctxs[i]; // reset to initial context if(ctx === null) { rval = _getInitialContext(options); mustClone = false; continue; } // dereference @context key if present if(_isObject(ctx) && '@context' in ctx) { ctx = ctx['@context']; } // context must be an object by now, all URLs retrieved before this call if(!_isObject(ctx)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context must be an object.', 'jsonld.SyntaxError', {code: 'invalid local context', context: ctx}); } // get context from cache if available if(jsonld.cache.activeCtx) { var cached = jsonld.cache.activeCtx.get(activeCtx, ctx); if(cached) { rval = cached; mustClone = true; continue; } } // clone context, if required, before updating if(mustClone) { rval = rval.clone(); mustClone = false; } // define context mappings for keys in local context var defined = {}; // handle @base if('@base' in ctx) { var base = ctx['@base']; // clear base if(base === null) { base = null; } else if(!_isString(base)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@base" in a ' + '@context must be a string or null.', 'jsonld.SyntaxError', {code: 'invalid base IRI', context: ctx}); } else if(base !== '' && !_isAbsoluteIri(base)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@base" in a ' + '@context must be an absolute IRI or the empty string.', 'jsonld.SyntaxError', {code: 'invalid base IRI', context: ctx}); } base = jsonld.url.parse(base || ''); rval['@base'] = base; defined['@base'] = true; } // handle @vocab if('@vocab' in ctx) { var value = ctx['@vocab']; if(value === null) { delete rval['@vocab']; } else if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@vocab" in a ' + '@context must be a string or null.', 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx}); } else if(!_isAbsoluteIri(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@vocab" in a ' + '@context must be an absolute IRI.', 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx}); } else { rval['@vocab'] = value; } defined['@vocab'] = true; } // handle @language if('@language' in ctx) { var value = ctx['@language']; if(value === null) { delete rval['@language']; } else if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@language" in a ' + '@context must be a string or null.', 'jsonld.SyntaxError', {code: 'invalid default language', context: ctx}); } else { rval['@language'] = value.toLowerCase(); } defined['@language'] = true; } // process all other keys for(var key in ctx) { _createTermDefinition(rval, ctx, key, defined); } // cache result if(jsonld.cache.activeCtx) { jsonld.cache.activeCtx.set(activeCtx, ctx, rval); } } return rval; }; /** * Expands a language map. * * @param languageMap the language map to expand. * * @return the expanded language map. */ function _expandLanguageMap(languageMap) { var rval = []; var keys = Object.keys(languageMap).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; var val = languageMap[key]; if(!_isArray(val)) { val = [val]; } for(var vi = 0; vi < val.length; ++vi) { var item = val[vi]; if(!_isString(item)) { throw new JsonLdError( 'Invalid JSON-LD syntax; language map values must be strings.', 'jsonld.SyntaxError', {code: 'invalid language map value', languageMap: languageMap}); } rval.push({ '@value': item, '@language': key.toLowerCase() }); } } return rval; } /** * Labels the blank nodes in the given value using the given UniqueNamer. * * @param namer the UniqueNamer to use. * @param element the element with blank nodes to rename. * * @return the element. */ function _labelBlankNodes(namer, element) { if(_isArray(element)) { for(var i = 0; i < element.length; ++i) { element[i] = _labelBlankNodes(namer, element[i]); } } else if(_isList(element)) { element['@list'] = _labelBlankNodes(namer, element['@list']); } else if(_isObject(element)) { // rename blank node if(_isBlankNode(element)) { element['@id'] = namer.getName(element['@id']); } // recursively apply to all keys var keys = Object.keys(element).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; if(key !== '@id') { element[key] = _labelBlankNodes(namer, element[key]); } } } return element; } /** * Expands the given value by using the coercion and keyword rules in the * given context. * * @param activeCtx the active context to use. * @param activeProperty the active property the value is associated with. * @param value the value to expand. * * @return the expanded value. */ function _expandValue(activeCtx, activeProperty, value) { // nothing to expand if(value === null) { return null; } // special-case expand @id and @type (skips '@id' expansion) var expandedProperty = _expandIri(activeCtx, activeProperty, {vocab: true}); if(expandedProperty === '@id') { return _expandIri(activeCtx, value, {base: true}); } else if(expandedProperty === '@type') { return _expandIri(activeCtx, value, {vocab: true, base: true}); } // get type definition from context var type = jsonld.getContextValue(activeCtx, activeProperty, '@type'); // do @id expansion (automatic for @graph) if(type === '@id' || (expandedProperty === '@graph' && _isString(value))) { return {'@id': _expandIri(activeCtx, value, {base: true})}; } // do @id expansion w/vocab if(type === '@vocab') { return {'@id': _expandIri(activeCtx, value, {vocab: true, base: true})}; } // do not expand keyword values if(_isKeyword(expandedProperty)) { return value; } rval = {}; // other type if(type !== null) { rval['@type'] = type; } // check for language tagging for strings else if(_isString(value)) { var language = jsonld.getContextValue( activeCtx, activeProperty, '@language'); if(language !== null) { rval['@language'] = language; } } rval['@value'] = value; return rval; } /** * Creates an array of RDF triples for the given graph. * * @param graph the graph to create RDF triples for. * @param namer a UniqueNamer for assigning blank node names. * @param options the RDF serialization options. * * @return the array of RDF triples for the given graph. */ function _graphToRDF(graph, namer, options) { var rval = []; var ids = Object.keys(graph).sort(); for(var i = 0; i < ids.length; ++i) { var id = ids[i]; var node = graph[id]; var properties = Object.keys(node).sort(); for(var pi = 0; pi < properties.length; ++pi) { var property = properties[pi]; var items = node[property]; if(property === '@type') { property = RDF_TYPE; } else if(_isKeyword(property)) { continue; } for(var ii = 0; ii < items.length; ++ii) { var item = items[ii]; // RDF subject var subject = {}; subject.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI'; subject.value = id; // skip relative IRI subjects if(!_isAbsoluteIri(id)) { continue; } // RDF predicate var predicate = {}; predicate.type = (property.indexOf('_:') === 0) ? 'blank node' : 'IRI'; predicate.value = property; // skip relative IRI predicates if(!_isAbsoluteIri(property)) { continue; } // skip blank node predicates unless producing generalized RDF if(predicate.type === 'blank node' && !options.produceGeneralizedRdf) { continue; } // convert @list to triples if(_isList(item)) { _listToRDF(item['@list'], namer, subject, predicate, rval); } // convert value or node object to triple else { var object = _objectToRDF(item); // skip null objects (they are relative IRIs) if(object) { rval.push({subject: subject, predicate: predicate, object: object}); } } } } } return rval; } /** * Converts a @list value into linked list of blank node RDF triples * (an RDF collection). * * @param list the @list value. * @param namer a UniqueNamer for assigning blank node names. * @param subject the subject for the head of the list. * @param predicate the predicate for the head of the list. * @param triples the array of triples to append to. */ function _listToRDF(list, namer, subject, predicate, triples) { var first = {type: 'IRI', value: RDF_FIRST}; var rest = {type: 'IRI', value: RDF_REST}; var nil = {type: 'IRI', value: RDF_NIL}; for(var i = 0; i < list.length; ++i) { var item = list[i]; var blankNode = {type: 'blank node', value: namer.getName()}; triples.push({subject: subject, predicate: predicate, object: blankNode}); subject = blankNode; predicate = first; var object = _objectToRDF(item); // skip null objects (they are relative IRIs) if(object) { triples.push({subject: subject, predicate: predicate, object: object}); } predicate = rest; } triples.push({subject: subject, predicate: predicate, object: nil}); } /** * Converts a JSON-LD value object to an RDF literal or a JSON-LD string or * node object to an RDF resource. * * @param item the JSON-LD value or node object. * * @return the RDF literal or RDF resource. */ function _objectToRDF(item) { var object = {}; // convert value object to RDF if(_isValue(item)) { object.type = 'literal'; var value = item['@value']; var datatype = item['@type'] || null; // convert to XSD datatypes as appropriate if(_isBoolean(value)) { object.value = value.toString(); object.datatype = datatype || XSD_BOOLEAN; } else if(_isDouble(value) || datatype === XSD_DOUBLE) { // canonical double representation object.value = value.toExponential(15).replace(/(\d)0*e\+?/, '$1E'); object.datatype = datatype || XSD_DOUBLE; } else if(_isNumber(value)) { object.value = value.toFixed(0); object.datatype = datatype || XSD_INTEGER; } else if('@language' in item) { object.value = value; object.datatype = datatype || RDF_LANGSTRING; object.language = item['@language']; } else { object.value = value; object.datatype = datatype || XSD_STRING; } } // convert string/node object to RDF else { var id = _isObject(item) ? item['@id'] : item; object.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI'; object.value = id; } // skip relative IRIs if(object.type === 'IRI' && !_isAbsoluteIri(object.value)) { return null; } return object; } /** * Converts an RDF triple object to a JSON-LD object. * * @param o the RDF triple object to convert. * @param useNativeTypes true to output native types, false not to. * * @return the JSON-LD object. */ function _RDFToObject(o, useNativeTypes) { // convert IRI/blank node object to JSON-LD if(o.type === 'IRI' || o.type === 'blank node') { return {'@id': o.value}; } // convert literal to JSON-LD var rval = {'@value': o.value}; // add language if(o['language']) { rval['@language'] = o.language; } else { var type = o.datatype; if(!type) { type = XSD_STRING; } // use native types for certain xsd types if(useNativeTypes) { if(type === XSD_BOOLEAN) { if(rval['@value'] === 'true') { rval['@value'] = true; } else if(rval['@value'] === 'false') { rval['@value'] = false; } } else if(_isNumeric(rval['@value'])) { if(type === XSD_INTEGER) { var i = parseInt(rval['@value']); if(i.toFixed(0) === rval['@value']) { rval['@value'] = i; } } else if(type === XSD_DOUBLE) { rval['@value'] = parseFloat(rval['@value']); } } // do not add native type if([XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING] .indexOf(type) === -1) { rval['@type'] = type; } } else if(type !== XSD_STRING) { rval['@type'] = type; } } return rval; } /** * Compares two RDF triples for equality. * * @param t1 the first triple. * @param t2 the second triple. * * @return true if the triples are the same, false if not. */ function _compareRDFTriples(t1, t2) { var attrs = ['subject', 'predicate', 'object']; for(var i = 0; i < attrs.length; ++i) { var attr = attrs[i]; if(t1[attr].type !== t2[attr].type || t1[attr].value !== t2[attr].value) { return false; } } if(t1.object.language !== t2.object.language) { return false; } if(t1.object.datatype !== t2.object.datatype) { return false; } return true; } /** * Hashes all of the quads about a blank node. * * @param id the ID of the bnode to hash quads for. * @param bnodes the mapping of bnodes to quads. * @param namer the canonical bnode namer. * * @return the new hash. */ function _hashQuads(id, bnodes, namer) { // return cached hash if('hash' in bnodes[id]) { return bnodes[id].hash; } // serialize all of bnode's quads var quads = bnodes[id].quads; var nquads = []; for(var i = 0; i < quads.length; ++i) { nquads.push(_toNQuad( quads[i], quads[i].name ? quads[i].name.value : null, id)); } // sort serialized quads nquads.sort(); // return hashed quads var hash = bnodes[id].hash = sha1.hash(nquads); return hash; } /** * Produces a hash for the paths of adjacent bnodes for a bnode, * incorporating all information about its subgraph of bnodes. This * method will recursively pick adjacent bnode permutations that produce the * lexicographically-least 'path' serializations. * * @param id the ID of the bnode to hash paths for. * @param bnodes the map of bnode quads. * @param namer the canonical bnode namer. * @param pathNamer the namer used to assign names to adjacent bnodes. * @param callback(err, result) called once the operation completes. */ function _hashPaths(id, bnodes, namer, pathNamer, callback) { // create SHA-1 digest var md = sha1.create(); // group adjacent bnodes by hash, keep properties and references separate var groups = {}; var groupHashes; var quads = bnodes[id].quads; jsonld.setImmediate(function() {groupNodes(0);}); function groupNodes(i) { if(i === quads.length) { // done, hash groups groupHashes = Object.keys(groups).sort(); return hashGroup(0); } // get adjacent bnode var quad = quads[i]; var bnode = _getAdjacentBlankNodeName(quad.subject, id); var direction = null; if(bnode !== null) { // normal property direction = 'p'; } else { bnode = _getAdjacentBlankNodeName(quad.object, id); if(bnode !== null) { // reverse property direction = 'r'; } } if(bnode !== null) { // get bnode name (try canonical, path, then hash) var name; if(namer.isNamed(bnode)) { name = namer.getName(bnode); } else if(pathNamer.isNamed(bnode)) { name = pathNamer.getName(bnode); } else { name = _hashQuads(bnode, bnodes, namer); } // hash direction, property, and bnode name/hash var md = sha1.create(); md.update(direction); md.update(quad.predicate.value); md.update(name); var groupHash = md.digest(); // add bnode to hash group if(groupHash in groups) { groups[groupHash].push(bnode); } else { groups[groupHash] = [bnode]; } } jsonld.setImmediate(function() {groupNodes(i + 1);}); } // hashes a group of adjacent bnodes function hashGroup(i) { if(i === groupHashes.length) { // done, return SHA-1 digest and path namer return callback(null, {hash: md.digest(), pathNamer: pathNamer}); } // digest group hash var groupHash = groupHashes[i]; md.update(groupHash); // choose a path and namer from the permutations var chosenPath = null; var chosenNamer = null; var permutator = new Permutator(groups[groupHash]); jsonld.setImmediate(function() {permutate();}); function permutate() { var permutation = permutator.next(); var pathNamerCopy = pathNamer.clone(); // build adjacent path var path = ''; var recurse = []; for(var n in permutation) { var bnode = permutation[n]; // use canonical name if available if(namer.isNamed(bnode)) { path += namer.getName(bnode); } else { // recurse if bnode isn't named in the path yet if(!pathNamerCopy.isNamed(bnode)) { recurse.push(bnode); } path += pathNamerCopy.getName(bnode); } // skip permutation if path is already >= chosen path if(chosenPath !== null && path.length >= chosenPath.length && path > chosenPath) { return nextPermutation(true); } } // does the next recursion nextRecursion(0); function nextRecursion(n) { if(n === recurse.length) { // done, do next permutation return nextPermutation(false); } // do recursion var bnode = recurse[n]; _hashPaths(bnode, bnodes, namer, pathNamerCopy, function(err, result) { if(err) { return callback(err); } path += pathNamerCopy.getName(bnode) + '<' + result.hash + '>'; pathNamerCopy = result.pathNamer; // skip permutation if path is already >= chosen path if(chosenPath !== null && path.length >= chosenPath.length && path > chosenPath) { return nextPermutation(true); } // do next recursion nextRecursion(n + 1); }); } // stores the results of this permutation and runs the next function nextPermutation(skipped) { if(!skipped && (chosenPath === null || path < chosenPath)) { chosenPath = path; chosenNamer = pathNamerCopy; } // do next permutation if(permutator.hasNext()) { jsonld.setImmediate(function() {permutate();}); } else { // digest chosen path and update namer md.update(chosenPath); pathNamer = chosenNamer; // hash the next group hashGroup(i + 1); } } } } } /** * A helper function that gets the blank node name from an RDF quad node * (subject or object). If the node is a blank node and its value * does not match the given blank node ID, it will be returned. * * @param node the RDF quad node. * @param id the ID of the blank node to look next to. * * @return the adjacent blank node name or null if none was found. */ function _getAdjacentBlankNodeName(node, id) { return (node.type === 'blank node' && node.value !== id ? node.value : null); } /** * Recursively flattens the subjects in the given JSON-LD expanded input * into a node map. * * @param input the JSON-LD expanded input. * @param graphs a map of graph name to subject map. * @param graph the name of the current graph. * @param namer the blank node namer. * @param name the name assigned to the current input if it is a bnode. * @param list the list to append to, null for none. */ function _createNodeMap(input, graphs, graph, namer, name, list) { // recurse through array if(_isArray(input)) { for(var i = 0; i < input.length; ++i) { _createNodeMap(input[i], graphs, graph, namer, undefined, list); } return; } // add non-object to list if(!_isObject(input)) { if(list) { list.push(input); } return; } // add values to list if(_isValue(input)) { if('@type' in input) { var type = input['@type']; // rename @type blank node if(type.indexOf('_:') === 0) { input['@type'] = type = namer.getName(type); } } if(list) { list.push(input); } return; } // Note: At this point, input must be a subject. // spec requires @type to be named first, so assign names early if('@type' in input) { var types = input['@type']; for(var i = 0; i < types.length; ++i) { var type = types[i]; if(type.indexOf('_:') === 0) { namer.getName(type); } } } // get name for subject if(_isUndefined(name)) { name = _isBlankNode(input) ? namer.getName(input['@id']) : input['@id']; } // add subject reference to list if(list) { list.push({'@id': name}); } // create new subject or merge into existing one var subjects = graphs[graph]; var subject = subjects[name] = subjects[name] || {}; subject['@id'] = name; var properties = Object.keys(input).sort(); for(var pi = 0; pi < properties.length; ++pi) { var property = properties[pi]; // skip @id if(property === '@id') { continue; } // handle reverse properties if(property === '@reverse') { var referencedNode = {'@id': name}; var reverseMap = input['@reverse']; for(var reverseProperty in reverseMap) { var items = reverseMap[reverseProperty]; for(var ii = 0; ii < items.length; ++ii) { var item = items[ii]; jsonld.addValue( item, reverseProperty, referencedNode, {propertyIsArray: true, allowDuplicate: false}); _createNodeMap(item, graphs, graph, namer); } } continue; } // recurse into graph if(property === '@graph') { // add graph subjects map entry if(!(name in graphs)) { graphs[name] = {}; } var g = (graph === '@merged') ? graph : name; _createNodeMap(input[property], graphs, g, namer); continue; } // copy non-@type keywords if(property !== '@type' && _isKeyword(property)) { if(property === '@index' && '@index' in subject) { throw new JsonLdError( 'Invalid JSON-LD syntax; conflicting @index property detected.', 'jsonld.SyntaxError', {code: 'conflicting indexes', subject: subject}); } subject[property] = input[property]; continue; } // iterate over objects var objects = input[property]; // if property is a bnode, assign it a new id if(property.indexOf('_:') === 0) { property = namer.getName(property); } // ensure property is added for empty arrays if(objects.length === 0) { jsonld.addValue(subject, property, [], {propertyIsArray: true}); continue; } for(var oi = 0; oi < objects.length; ++oi) { var o = objects[oi]; if(property === '@type') { // rename @type blank nodes o = (o.indexOf('_:') === 0) ? namer.getName(o) : o; } // handle embedded subject or subject reference if(_isSubject(o) || _isSubjectReference(o)) { // rename blank node @id var id = _isBlankNode(o) ? namer.getName(o['@id']) : o['@id']; // add reference and recurse jsonld.addValue( subject, property, {'@id': id}, {propertyIsArray: true, allowDuplicate: false}); _createNodeMap(o, graphs, graph, namer, id); } // handle @list else if(_isList(o)) { var _list = []; _createNodeMap(o['@list'], graphs, graph, namer, name, _list); o = {'@list': _list}; jsonld.addValue( subject, property, o, {propertyIsArray: true, allowDuplicate: false}); } // handle @value else { _createNodeMap(o, graphs, graph, namer, name); jsonld.addValue( subject, property, o, {propertyIsArray: true, allowDuplicate: false}); } } } } /** * Frames subjects according to the given frame. * * @param state the current framing state. * @param subjects the subjects to filter. * @param frame the frame. * @param parent the parent subject or top-level array. * @param property the parent property, initialized to null. */ function _frame(state, subjects, frame, parent, property) { // validate the frame _validateFrame(state, frame); frame = frame[0]; // filter out subjects that match the frame var matches = _filterSubjects(state, subjects, frame); // get flags for current frame var options = state.options; var embedOn = _getFrameFlag(frame, options, 'embed'); var explicitOn = _getFrameFlag(frame, options, 'explicit'); // add matches to output var ids = Object.keys(matches).sort(); for(var idx in ids) { var id = ids[idx]; /* Note: In order to treat each top-level match as a compartmentalized result, create an independent copy of the embedded subjects map when the property is null, which only occurs at the top-level. */ if(property === null) { state.embeds = {}; } // start output var output = {}; output['@id'] = id; // prepare embed meta info var embed = {parent: parent, property: property}; // if embed is on and there is an existing embed if(embedOn && (id in state.embeds)) { // only overwrite an existing embed if it has already been added to its // parent -- otherwise its parent is somewhere up the tree from this // embed and the embed would occur twice once the tree is added embedOn = false; // existing embed's parent is an array var existing = state.embeds[id]; if(_isArray(existing.parent)) { for(var i = 0; i < existing.parent.length; ++i) { if(jsonld.compareValues(output, existing.parent[i])) { embedOn = true; break; } } } // existing embed's parent is an object else if(jsonld.hasValue(existing.parent, existing.property, output)) { embedOn = true; } // existing embed has already been added, so allow an overwrite if(embedOn) { _removeEmbed(state, id); } } // not embedding, add output without any other properties if(!embedOn) { _addFrameOutput(state, parent, property, output); } else { // add embed meta info state.embeds[id] = embed; // iterate over subject properties var subject = matches[id]; var props = Object.keys(subject).sort(); for(var i = 0; i < props.length; i++) { var prop = props[i]; // copy keywords to output if(_isKeyword(prop)) { output[prop] = _clone(subject[prop]); continue; } // if property isn't in the frame if(!(prop in frame)) { // if explicit is off, embed values if(!explicitOn) { _embedValues(state, subject, prop, output); } continue; } // add objects var objects = subject[prop]; for(var oi = 0; oi < objects.length; ++oi) { var o = objects[oi]; // recurse into list if(_isList(o)) { // add empty list var list = {'@list': []}; _addFrameOutput(state, output, prop, list); // add list objects var src = o['@list']; for(var n in src) { o = src[n]; // recurse into subject reference if(_isSubjectReference(o)) { _frame(state, [o['@id']], frame[prop][0]['@list'], list, '@list'); } // include other values automatically else { _addFrameOutput(state, list, '@list', _clone(o)); } } continue; } // recurse into subject reference if(_isSubjectReference(o)) { _frame(state, [o['@id']], frame[prop], output, prop); } // include other values automatically else { _addFrameOutput(state, output, prop, _clone(o)); } } } // handle defaults var props = Object.keys(frame).sort(); for(var i = 0; i < props.length; ++i) { var prop = props[i]; // skip keywords if(_isKeyword(prop)) { continue; } // if omit default is off, then include default values for properties // that appear in the next frame but are not in the matching subject var next = frame[prop][0]; var omitDefaultOn = _getFrameFlag(next, options, 'omitDefault'); if(!omitDefaultOn && !(prop in output)) { var preserve = '@null'; if('@default' in next) { preserve = _clone(next['@default']); } if(!_isArray(preserve)) { preserve = [preserve]; } output[prop] = [{'@preserve': preserve}]; } } // add output to parent _addFrameOutput(state, parent, property, output); } } } /** * Gets the frame flag value for the given flag name. * * @param frame the frame. * @param options the framing options. * @param name the flag name. * * @return the flag value. */ function _getFrameFlag(frame, options, name) { var flag = '@' + name; return (flag in frame) ? frame[flag][0] : options[name]; } /** * Validates a JSON-LD frame, throwing an exception if the frame is invalid. * * @param state the current frame state. * @param frame the frame to validate. */ function _validateFrame(state, frame) { if(!_isArray(frame) || frame.length !== 1 || !_isObject(frame[0])) { throw new JsonLdError( 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.', 'jsonld.SyntaxError', {frame: frame}); } } /** * Returns a map of all of the subjects that match a parsed frame. * * @param state the current framing state. * @param subjects the set of subjects to filter. * @param frame the parsed frame. * * @return all of the matched subjects. */ function _filterSubjects(state, subjects, frame) { // filter subjects in @id order var rval = {}; for(var i = 0; i < subjects.length; ++i) { var id = subjects[i]; var subject = state.subjects[id]; if(_filterSubject(subject, frame)) { rval[id] = subject; } } return rval; } /** * Returns true if the given subject matches the given frame. * * @param subject the subject to check. * @param frame the frame to check. * * @return true if the subject matches, false if not. */ function _filterSubject(subject, frame) { // check @type (object value means 'any' type, fall through to ducktyping) if('@type' in frame && !(frame['@type'].length === 1 && _isObject(frame['@type'][0]))) { var types = frame['@type']; for(var i = 0; i < types.length; ++i) { // any matching @type is a match if(jsonld.hasValue(subject, '@type', types[i])) { return true; } } return false; } // check ducktype for(var key in frame) { // only not a duck if @id or non-keyword isn't in subject if((key === '@id' || !_isKeyword(key)) && !(key in subject)) { return false; } } return true; } /** * Embeds values for the given subject and property into the given output * during the framing algorithm. * * @param state the current framing state. * @param subject the subject. * @param property the property. * @param output the output. */ function _embedValues(state, subject, property, output) { // embed subject properties in output var objects = subject[property]; for(var i = 0; i < objects.length; ++i) { var o = objects[i]; // recurse into @list if(_isList(o)) { var list = {'@list': []}; _addFrameOutput(state, output, property, list); return _embedValues(state, o, '@list', list['@list']); } // handle subject reference if(_isSubjectReference(o)) { var id = o['@id']; // embed full subject if isn't already embedded if(!(id in state.embeds)) { // add embed var embed = {parent: output, property: property}; state.embeds[id] = embed; // recurse into subject o = {}; var s = state.subjects[id]; for(var prop in s) { // copy keywords if(_isKeyword(prop)) { o[prop] = _clone(s[prop]); continue; } _embedValues(state, s, prop, o); } } _addFrameOutput(state, output, property, o); } // copy non-subject value else { _addFrameOutput(state, output, property, _clone(o)); } } } /** * Removes an existing embed. * * @param state the current framing state. * @param id the @id of the embed to remove. */ function _removeEmbed(state, id) { // get existing embed var embeds = state.embeds; var embed = embeds[id]; var parent = embed.parent; var property = embed.property; // create reference to replace embed var subject = {'@id': id}; // remove existing embed if(_isArray(parent)) { // replace subject with reference for(var i = 0; i < parent.length; ++i) { if(jsonld.compareValues(parent[i], subject)) { parent[i] = subject; break; } } } else { // replace subject with reference var useArray = _isArray(parent[property]); jsonld.removeValue(parent, property, subject, {propertyIsArray: useArray}); jsonld.addValue(parent, property, subject, {propertyIsArray: useArray}); } // recursively remove dependent dangling embeds var removeDependents = function(id) { // get embed keys as a separate array to enable deleting keys in map var ids = Object.keys(embeds); for(var i = 0; i < ids.length; ++i) { var next = ids[i]; if(next in embeds && _isObject(embeds[next].parent) && embeds[next].parent['@id'] === id) { delete embeds[next]; removeDependents(next); } } }; removeDependents(id); } /** * Adds framing output to the given parent. * * @param state the current framing state. * @param parent the parent to add to. * @param property the parent property. * @param output the output to add. */ function _addFrameOutput(state, parent, property, output) { if(_isObject(parent)) { jsonld.addValue(parent, property, output, {propertyIsArray: true}); } else { parent.push(output); } } /** * Removes the @preserve keywords as the last step of the framing algorithm. * * @param ctx the active context used to compact the input. * @param input the framed, compacted output. * @param options the compaction options used. * * @return the resulting output. */ function _removePreserve(ctx, input, options) { // recurse through arrays if(_isArray(input)) { var output = []; for(var i = 0; i < input.length; ++i) { var result = _removePreserve(ctx, input[i], options); // drop nulls from arrays if(result !== null) { output.push(result); } } input = output; } else if(_isObject(input)) { // remove @preserve if('@preserve' in input) { if(input['@preserve'] === '@null') { return null; } return input['@preserve']; } // skip @values if(_isValue(input)) { return input; } // recurse through @lists if(_isList(input)) { input['@list'] = _removePreserve(ctx, input['@list'], options); return input; } // recurse through properties for(var prop in input) { var result = _removePreserve(ctx, input[prop], options); var container = jsonld.getContextValue(ctx, prop, '@container'); if(options.compactArrays && _isArray(result) && result.length === 1 && container === null) { result = result[0]; } input[prop] = result; } } return input; } /** * Compares two strings first based on length and then lexicographically. * * @param a the first string. * @param b the second string. * * @return -1 if a < b, 1 if a > b, 0 if a == b. */ function _compareShortestLeast(a, b) { if(a.length < b.length) { return -1; } else if(b.length < a.length) { return 1; } else if(a === b) { return 0; } return (a < b) ? -1 : 1; } /** * Picks the preferred compaction term from the given inverse context entry. * * @param activeCtx the active context. * @param iri the IRI to pick the term for. * @param value the value to pick the term for. * @param containers the preferred containers. * @param typeOrLanguage either '@type' or '@language'. * @param typeOrLanguageValue the preferred value for '@type' or '@language'. * * @return the preferred term. */ function _selectTerm( activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue) { if(typeOrLanguageValue === null) { typeOrLanguageValue = '@null'; } // preferences for the value of @type or @language var prefs = []; // determine prefs for @id based on whether or not value compacts to a term if((typeOrLanguageValue === '@id' || typeOrLanguageValue === '@reverse') && _isSubjectReference(value)) { // prefer @reverse first if(typeOrLanguageValue === '@reverse') { prefs.push('@reverse'); } // try to compact value to a term var term = _compactIri(activeCtx, value['@id'], null, {vocab: true}); if(term in activeCtx.mappings && activeCtx.mappings[term] && activeCtx.mappings[term]['@id'] === value['@id']) { // prefer @vocab prefs.push.apply(prefs, ['@vocab', '@id']); } else { // prefer @id prefs.push.apply(prefs, ['@id', '@vocab']); } } else { prefs.push(typeOrLanguageValue); } prefs.push('@none'); var containerMap = activeCtx.inverse[iri]; for(var ci = 0; ci < containers.length; ++ci) { // if container not available in the map, continue var container = containers[ci]; if(!(container in containerMap)) { continue; } var typeOrLanguageValueMap = containerMap[container][typeOrLanguage]; for(var pi = 0; pi < prefs.length; ++pi) { // if type/language option not available in the map, continue var pref = prefs[pi]; if(!(pref in typeOrLanguageValueMap)) { continue; } // select term return typeOrLanguageValueMap[pref]; } } return null; } /** * Compacts an IRI or keyword into a term or prefix if it can be. If the * IRI has an associated value it may be passed. * * @param activeCtx the active context to use. * @param iri the IRI to compact. * @param value the value to check or null. * @param relativeTo options for how to compact IRIs: * vocab: true to split after @vocab, false not to. * @param reverse true if a reverse property is being compacted, false if not. * * @return the compacted term, prefix, keyword alias, or the original IRI. */ function _compactIri(activeCtx, iri, value, relativeTo, reverse) { // can't compact null if(iri === null) { return iri; } // default value and parent to null if(_isUndefined(value)) { value = null; } // default reverse to false if(_isUndefined(reverse)) { reverse = false; } relativeTo = relativeTo || {}; // if term is a keyword, default vocab to true if(_isKeyword(iri)) { relativeTo.vocab = true; } // use inverse context to pick a term if iri is relative to vocab if(relativeTo.vocab && iri in activeCtx.getInverse()) { var defaultLanguage = activeCtx['@language'] || '@none'; // prefer @index if available in value var containers = []; if(_isObject(value) && '@index' in value) { containers.push('@index'); } // defaults for term selection based on type/language var typeOrLanguage = '@language'; var typeOrLanguageValue = '@null'; if(reverse) { typeOrLanguage = '@type'; typeOrLanguageValue = '@reverse'; containers.push('@set'); } // choose the most specific term that works for all elements in @list else if(_isList(value)) { // only select @list containers if @index is NOT in value if(!('@index' in value)) { containers.push('@list'); } var list = value['@list']; var commonLanguage = (list.length === 0) ? defaultLanguage : null; var commonType = null; for(var i = 0; i < list.length; ++i) { var item = list[i]; var itemLanguage = '@none'; var itemType = '@none'; if(_isValue(item)) { if('@language' in item) { itemLanguage = item['@language']; } else if('@type' in item) { itemType = item['@type']; } // plain literal else { itemLanguage = '@null'; } } else { itemType = '@id'; } if(commonLanguage === null) { commonLanguage = itemLanguage; } else if(itemLanguage !== commonLanguage && _isValue(item)) { commonLanguage = '@none'; } if(commonType === null) { commonType = itemType; } else if(itemType !== commonType) { commonType = '@none'; } // there are different languages and types in the list, so choose // the most generic term, no need to keep iterating the list if(commonLanguage === '@none' && commonType === '@none') { break; } } commonLanguage = commonLanguage || '@none'; commonType = commonType || '@none'; if(commonType !== '@none') { typeOrLanguage = '@type'; typeOrLanguageValue = commonType; } else { typeOrLanguageValue = commonLanguage; } } else { if(_isValue(value)) { if('@language' in value && !('@index' in value)) { containers.push('@language'); typeOrLanguageValue = value['@language']; } else if('@type' in value) { typeOrLanguage = '@type'; typeOrLanguageValue = value['@type']; } } else { typeOrLanguage = '@type'; typeOrLanguageValue = '@id'; } containers.push('@set'); } // do term selection containers.push('@none'); var term = _selectTerm( activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue); if(term !== null) { return term; } } // no term match, use @vocab if available if(relativeTo.vocab) { if('@vocab' in activeCtx) { // determine if vocab is a prefix of the iri var vocab = activeCtx['@vocab']; if(iri.indexOf(vocab) === 0 && iri !== vocab) { // use suffix as relative iri if it is not a term in the active context var suffix = iri.substr(vocab.length); if(!(suffix in activeCtx.mappings)) { return suffix; } } } } // no term or @vocab match, check for possible CURIEs var choice = null; for(var term in activeCtx.mappings) { // skip terms with colons, they can't be prefixes if(term.indexOf(':') !== -1) { continue; } // skip entries with @ids that are not partial matches var definition = activeCtx.mappings[term]; if(!definition || definition['@id'] === iri || iri.indexOf(definition['@id']) !== 0) { continue; } // a CURIE is usable if: // 1. it has no mapping, OR // 2. value is null, which means we're not compacting an @value, AND // the mapping matches the IRI) var curie = term + ':' + iri.substr(definition['@id'].length); var isUsableCurie = (!(curie in activeCtx.mappings) || (value === null && activeCtx.mappings[curie] && activeCtx.mappings[curie]['@id'] === iri)); // select curie if it is shorter or the same length but lexicographically // less than the current choice if(isUsableCurie && (choice === null || _compareShortestLeast(curie, choice) < 0)) { choice = curie; } } // return chosen curie if(choice !== null) { return choice; } // compact IRI relative to base if(!relativeTo.vocab) { return _removeBase(activeCtx['@base'], iri); } // return IRI as is return iri; } /** * Performs value compaction on an object with '@value' or '@id' as the only * property. * * @param activeCtx the active context. * @param activeProperty the active property that points to the value. * @param value the value to compact. * * @return the compaction result. */ function _compactValue(activeCtx, activeProperty, value) { // value is a @value if(_isValue(value)) { // get context rules var type = jsonld.getContextValue(activeCtx, activeProperty, '@type'); var language = jsonld.getContextValue( activeCtx, activeProperty, '@language'); var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); // whether or not the value has an @index that must be preserved var preserveIndex = (('@index' in value) && container !== '@index'); // if there's no @index to preserve ... if(!preserveIndex) { // matching @type or @language specified in context, compact value if(value['@type'] === type || value['@language'] === language) { return value['@value']; } } // return just the value of @value if all are true: // 1. @value is the only key or @index isn't being preserved // 2. there is no default language or @value is not a string or // the key has a mapping with a null @language var keyCount = Object.keys(value).length; var isValueOnlyKey = (keyCount === 1 || (keyCount === 2 && ('@index' in value) && !preserveIndex)); var hasDefaultLanguage = ('@language' in activeCtx); var isValueString = _isString(value['@value']); var hasNullMapping = (activeCtx.mappings[activeProperty] && activeCtx.mappings[activeProperty]['@language'] === null); if(isValueOnlyKey && (!hasDefaultLanguage || !isValueString || hasNullMapping)) { return value['@value']; } var rval = {}; // preserve @index if(preserveIndex) { rval[_compactIri(activeCtx, '@index')] = value['@index']; } // compact @type IRI if('@type' in value) { rval[_compactIri(activeCtx, '@type')] = _compactIri( activeCtx, value['@type'], null, {vocab: true}); } // alias @language else if('@language' in value) { rval[_compactIri(activeCtx, '@language')] = value['@language']; } // alias @value rval[_compactIri(activeCtx, '@value')] = value['@value']; return rval; } // value is a subject reference var expandedProperty = _expandIri(activeCtx, activeProperty, {vocab: true}); var type = jsonld.getContextValue(activeCtx, activeProperty, '@type'); var compacted = _compactIri( activeCtx, value['@id'], null, {vocab: type === '@vocab'}); // compact to scalar if(type === '@id' || type === '@vocab' || expandedProperty === '@graph') { return compacted; } var rval = {}; rval[_compactIri(activeCtx, '@id')] = compacted; return rval; } /** * Creates a term definition during context processing. * * @param activeCtx the current active context. * @param localCtx the local context being processed. * @param term the term in the local context to define the mapping for. * @param defined a map of defining/defined keys to detect cycles and prevent * double definitions. */ function _createTermDefinition(activeCtx, localCtx, term, defined) { if(term in defined) { // term already defined if(defined[term]) { return; } // cycle detected throw new JsonLdError( 'Cyclical context definition detected.', 'jsonld.CyclicalContext', {code: 'cyclic IRI mapping', context: localCtx, term: term}); } // now defining term defined[term] = false; if(_isKeyword(term)) { throw new JsonLdError( 'Invalid JSON-LD syntax; keywords cannot be overridden.', 'jsonld.SyntaxError', {code: 'keyword redefinition', context: localCtx}); } // remove old mapping if(activeCtx.mappings[term]) { delete activeCtx.mappings[term]; } // get context term value var value = localCtx[term]; // clear context entry if(value === null || (_isObject(value) && value['@id'] === null)) { activeCtx.mappings[term] = null; defined[term] = true; return; } // convert short-hand value to object w/@id if(_isString(value)) { value = {'@id': value}; } if(!_isObject(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context property values must be ' + 'strings or objects.', 'jsonld.SyntaxError', {code: 'invalid term definition', context: localCtx}); } // create new mapping var mapping = activeCtx.mappings[term] = {}; mapping.reverse = false; if('@reverse' in value) { if('@id' in value) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @reverse term definition must not ' + 'contain @id.', 'jsonld.SyntaxError', {code: 'invalid reverse property', context: localCtx}); } var reverse = value['@reverse']; if(!_isString(reverse)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context @reverse value must be a string.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); } // expand and add @id mapping var id = _expandIri( activeCtx, reverse, {vocab: true, base: false}, localCtx, defined); if(!_isAbsoluteIri(id)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context @reverse value must be an ' + 'absolute IRI or a blank node identifier.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); } mapping['@id'] = id; mapping.reverse = true; } else if('@id' in value) { var id = value['@id']; if(!_isString(id)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context @id value must be an array ' + 'of strings or a string.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); } if(id !== term) { // expand and add @id mapping id = _expandIri( activeCtx, id, {vocab: true, base: false}, localCtx, defined); if(!_isAbsoluteIri(id) && !_isKeyword(id)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context @id value must be an ' + 'absolute IRI, a blank node identifier, or a keyword.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); } mapping['@id'] = id; } } if(!('@id' in mapping)) { // see if the term has a prefix var colon = term.indexOf(':'); if(colon !== -1) { var prefix = term.substr(0, colon); if(prefix in localCtx) { // define parent prefix _createTermDefinition(activeCtx, localCtx, prefix, defined); } // set @id based on prefix parent if(activeCtx.mappings[prefix]) { var suffix = term.substr(colon + 1); mapping['@id'] = activeCtx.mappings[prefix]['@id'] + suffix; } // term is an absolute IRI else { mapping['@id'] = term; } } else { // non-IRIs *must* define @ids if @vocab is not available if(!('@vocab' in activeCtx)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context terms must define an @id.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx, term: term}); } // prepend vocab to term mapping['@id'] = activeCtx['@vocab'] + term; } } // IRI mapping now defined defined[term] = true; if('@type' in value) { var type = value['@type']; if(!_isString(type)) { throw new JsonLdError( 'Invalid JSON-LD syntax; an @context @type values must be a string.', 'jsonld.SyntaxError', {code: 'invalid type mapping', context: localCtx}); } if(type !== '@id' && type !== '@vocab') { // expand @type to full IRI type = _expandIri( activeCtx, type, {vocab: true, base: false}, localCtx, defined); if(!_isAbsoluteIri(type)) { throw new JsonLdError( 'Invalid JSON-LD syntax; an @context @type value must be an ' + 'absolute IRI.', 'jsonld.SyntaxError', {code: 'invalid type mapping', context: localCtx}); } if(type.indexOf('_:') === 0) { throw new JsonLdError( 'Invalid JSON-LD syntax; an @context @type values must be an IRI, ' + 'not a blank node identifier.', 'jsonld.SyntaxError', {code: 'invalid type mapping', context: localCtx}); } } // add @type to mapping mapping['@type'] = type; } if('@container' in value) { var container = value['@container']; if(container !== '@list' && container !== '@set' && container !== '@index' && container !== '@language') { throw new JsonLdError( 'Invalid JSON-LD syntax; @context @container value must be ' + 'one of the following: @list, @set, @index, or @language.', 'jsonld.SyntaxError', {code: 'invalid container mapping', context: localCtx}); } if(mapping.reverse && container !== '@index' && container !== '@set' && container !== null) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context @container value for a @reverse ' + 'type definition must be @index or @set.', 'jsonld.SyntaxError', {code: 'invalid reverse property', context: localCtx}); } // add @container to mapping mapping['@container'] = container; } if('@language' in value && !('@type' in value)) { var language = value['@language']; if(language !== null && !_isString(language)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context @language value must be ' + 'a string or null.', 'jsonld.SyntaxError', {code: 'invalid language mapping', context: localCtx}); } // add @language to mapping if(language !== null) { language = language.toLowerCase(); } mapping['@language'] = language; } // disallow aliasing @context and @preserve var id = mapping['@id']; if(id === '@context' || id === '@preserve') { throw new JsonLdError( 'Invalid JSON-LD syntax; @context and @preserve cannot be aliased.', 'jsonld.SyntaxError', {code: 'invalid keyword alias', context: localCtx}); } } /** * Expands a string to a full IRI. The string may be a term, a prefix, a * relative IRI, or an absolute IRI. The associated absolute IRI will be * returned. * * @param activeCtx the current active context. * @param value the string to expand. * @param relativeTo options for how to resolve relative IRIs: * base: true to resolve against the base IRI, false not to. * vocab: true to concatenate after @vocab, false not to. * @param localCtx the local context being processed (only given if called * during context processing). * @param defined a map for tracking cycles in context definitions (only given * if called during context processing). * * @return the expanded value. */ function _expandIri(activeCtx, value, relativeTo, localCtx, defined) { // already expanded if(value === null || _isKeyword(value)) { return value; } // define term dependency if not defined if(localCtx && value in localCtx && defined[value] !== true) { _createTermDefinition(activeCtx, localCtx, value, defined); } relativeTo = relativeTo || {}; if(relativeTo.vocab) { var mapping = activeCtx.mappings[value]; // value is explicitly ignored with a null mapping if(mapping === null) { return null; } if(mapping) { // value is a term return mapping['@id']; } } // split value into prefix:suffix var colon = value.indexOf(':'); if(colon !== -1) { var prefix = value.substr(0, colon); var suffix = value.substr(colon + 1); // do not expand blank nodes (prefix of '_') or already-absolute // IRIs (suffix of '//') if(prefix === '_' || suffix.indexOf('//') === 0) { return value; } // prefix dependency not defined, define it if(localCtx && prefix in localCtx) { _createTermDefinition(activeCtx, localCtx, prefix, defined); } // use mapping if prefix is defined var mapping = activeCtx.mappings[prefix]; if(mapping) { return mapping['@id'] + suffix; } // already absolute IRI return value; } // prepend vocab if(relativeTo.vocab && '@vocab' in activeCtx) { return activeCtx['@vocab'] + value; } // prepend base var rval = value; if(relativeTo.base) { rval = _prependBase(activeCtx['@base'], rval); } return rval; } /** * Prepends a base IRI to the given relative IRI. * * @param base the base IRI. * @param iri the relative IRI. * * @return the absolute IRI. */ function _prependBase(base, iri) { // already an absolute IRI if(iri.indexOf(':') !== -1) { return iri; } // parse base if it is a string if(_isString(base)) { base = jsonld.url.parse(base || ''); } // parse given IRI var rel = jsonld.url.parse(iri); // start hierarchical part var hierPart = (base.protocol || ''); if(rel.authority) { hierPart += '//' + rel.authority; } else if(base.href !== '') { hierPart += '//' + base.authority; } // per RFC3986 normalize var path; // IRI represents an absolute path if(rel.pathname.indexOf('/') === 0) { path = rel.pathname; } else { path = base.pathname; // append relative path to the end of the last directory from base if(rel.pathname !== '') { path = path.substr(0, path.lastIndexOf('/') + 1); if(path.length > 0 && path.substr(-1) !== '/') { path += '/'; } path += rel.pathname; } } // remove slashes and dots in path path = _removeDotSegments(path, hierPart !== ''); // add query and hash if(rel.query) { path += '?' + rel.query; } if(rel.hash) { path += rel.hash; } var rval = hierPart + path; if(rval === '') { rval = './'; } return rval; } /** * Removes a base IRI from the given absolute IRI. * * @param base the base IRI. * @param iri the absolute IRI. * * @return the relative IRI if relative to base, otherwise the absolute IRI. */ function _removeBase(base, iri) { if(_isString(base)) { base = jsonld.url.parse(base || ''); } // establish base root var root = ''; if(base.href !== '') { root += (base.protocol || '') + '//' + base.authority; } // support network-path reference with empty base else if(iri.indexOf('//')) { root += '//'; } // IRI not relative to base if(iri.indexOf(root) !== 0) { return iri; } // remove root from IRI and parse remainder var rel = jsonld.url.parse(iri.substr(root.length)); // remove path segments that match var baseSegments = base.normalizedPath.split('/'); var iriSegments = rel.normalizedPath.split('/'); while(baseSegments.length > 0 && iriSegments.length > 0) { if(baseSegments[0] !== iriSegments[0]) { break; } baseSegments.shift(); iriSegments.shift(); } // use '../' for each non-matching base segment var rval = ''; if(baseSegments.length > 0) { // don't count the last segment if it isn't a path (doesn't end in '/') // don't count empty first segment, it means base began with '/' if(base.normalizedPath.substr(-1) !== '/' || baseSegments[0] === '') { baseSegments.pop(); } for(var i = 0; i < baseSegments.length; ++i) { rval += '../'; } } // prepend remaining segments rval += iriSegments.join('/'); // add query and hash if(rel.query) { rval += '?' + rel.query; } if(rel.hash) { rval += rel.hash; } if(rval === '') { rval = './'; } return rval; } /** * Gets the initial context. * * @param options the options to use. * base the document base IRI. * * @return the initial context. */ function _getInitialContext(options) { var base = jsonld.url.parse(options.base || ''); return { '@base': base, mappings: {}, inverse: null, getInverse: _createInverseContext, clone: _cloneActiveContext }; /** * Generates an inverse context for use in the compaction algorithm, if * not already generated for the given active context. * * @return the inverse context. */ function _createInverseContext() { var activeCtx = this; // lazily create inverse if(activeCtx.inverse) { return activeCtx.inverse; } var inverse = activeCtx.inverse = {}; // handle default language var defaultLanguage = activeCtx['@language'] || '@none'; // create term selections for each mapping in the context, ordered by // shortest and then lexicographically least var mappings = activeCtx.mappings; var terms = Object.keys(mappings).sort(_compareShortestLeast); for(var i = 0; i < terms.length; ++i) { var term = terms[i]; var mapping = mappings[term]; if(mapping === null) { continue; } var container = mapping['@container'] || '@none'; // iterate over every IRI in the mapping var ids = mapping['@id']; if(!_isArray(ids)) { ids = [ids]; } for(var ii = 0; ii < ids.length; ++ii) { var iri = ids[ii]; var entry = inverse[iri]; // initialize entry if(!entry) { inverse[iri] = entry = {}; } // add new entry if(!entry[container]) { entry[container] = { '@language': {}, '@type': {} }; } entry = entry[container]; // term is preferred for values using @reverse if(mapping.reverse) { _addPreferredTerm(mapping, term, entry['@type'], '@reverse'); } // term is preferred for values using specific type else if('@type' in mapping) { _addPreferredTerm(mapping, term, entry['@type'], mapping['@type']); } // term is preferred for values using specific language else if('@language' in mapping) { var language = mapping['@language'] || '@null'; _addPreferredTerm(mapping, term, entry['@language'], language); } // term is preferred for values w/default language or no type and // no language else { // add an entry for the default language _addPreferredTerm(mapping, term, entry['@language'], defaultLanguage); // add entries for no type and no language _addPreferredTerm(mapping, term, entry['@type'], '@none'); _addPreferredTerm(mapping, term, entry['@language'], '@none'); } } } return inverse; } /** * Adds the term for the given entry if not already added. * * @param mapping the term mapping. * @param term the term to add. * @param entry the inverse context typeOrLanguage entry to add to. * @param typeOrLanguageValue the key in the entry to add to. */ function _addPreferredTerm(mapping, term, entry, typeOrLanguageValue) { if(!(typeOrLanguageValue in entry)) { entry[typeOrLanguageValue] = term; } } /** * Clones an active context, creating a child active context. * * @return a clone (child) of the active context. */ function _cloneActiveContext() { var child = {}; child['@base'] = this['@base']; child.mappings = _clone(this.mappings); child.clone = this.clone; child.inverse = null; child.getInverse = this.getInverse; if('@language' in this) { child['@language'] = this['@language']; } if('@vocab' in this) { child['@vocab'] = this['@vocab']; } return child; } } /** * Returns whether or not the given value is a keyword. * * @param v the value to check. * * @return true if the value is a keyword, false if not. */ function _isKeyword(v) { if(!_isString(v)) { return false; } switch(v) { case '@base': case '@context': case '@container': case '@default': case '@embed': case '@explicit': case '@graph': case '@id': case '@index': case '@language': case '@list': case '@omitDefault': case '@preserve': case '@reverse': case '@set': case '@type': case '@value': case '@vocab': return true; } return false; } /** * Returns true if the given value is an Object. * * @param v the value to check. * * @return true if the value is an Object, false if not. */ function _isObject(v) { return (Object.prototype.toString.call(v) === '[object Object]'); } /** * Returns true if the given value is an empty Object. * * @param v the value to check. * * @return true if the value is an empty Object, false if not. */ function _isEmptyObject(v) { return _isObject(v) && Object.keys(v).length === 0; } /** * Returns true if the given value is an Array. * * @param v the value to check. * * @return true if the value is an Array, false if not. */ function _isArray(v) { return Array.isArray(v); } /** * Throws an exception if the given value is not a valid @type value. * * @param v the value to check. */ function _validateTypeValue(v) { // can be a string or an empty object if(_isString(v) || _isEmptyObject(v)) { return; } // must be an array var isValid = false; if(_isArray(v)) { // must contain only strings isValid = true; for(var i = 0; i < v.length; ++i) { if(!(_isString(v[i]))) { isValid = false; break; } } } if(!isValid) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@type" value must a string, an array of ' + 'strings, or an empty object.', 'jsonld.SyntaxError', {code: 'invalid type value', value: v}); } } /** * Returns true if the given value is a String. * * @param v the value to check. * * @return true if the value is a String, false if not. */ function _isString(v) { return (typeof v === 'string' || Object.prototype.toString.call(v) === '[object String]'); } /** * Returns true if the given value is a Number. * * @param v the value to check. * * @return true if the value is a Number, false if not. */ function _isNumber(v) { return (typeof v === 'number' || Object.prototype.toString.call(v) === '[object Number]'); } /** * Returns true if the given value is a double. * * @param v the value to check. * * @return true if the value is a double, false if not. */ function _isDouble(v) { return _isNumber(v) && String(v).indexOf('.') !== -1; } /** * Returns true if the given value is numeric. * * @param v the value to check. * * @return true if the value is numeric, false if not. */ function _isNumeric(v) { return !isNaN(parseFloat(v)) && isFinite(v); } /** * Returns true if the given value is a Boolean. * * @param v the value to check. * * @return true if the value is a Boolean, false if not. */ function _isBoolean(v) { return (typeof v === 'boolean' || Object.prototype.toString.call(v) === '[object Boolean]'); } /** * Returns true if the given value is undefined. * * @param v the value to check. * * @return true if the value is undefined, false if not. */ function _isUndefined(v) { return (typeof v === 'undefined'); } /** * Returns true if the given value is a subject with properties. * * @param v the value to check. * * @return true if the value is a subject with properties, false if not. */ function _isSubject(v) { // Note: A value is a subject if all of these hold true: // 1. It is an Object. // 2. It is not a @value, @set, or @list. // 3. It has more than 1 key OR any existing key is not @id. var rval = false; if(_isObject(v) && !(('@value' in v) || ('@set' in v) || ('@list' in v))) { var keyCount = Object.keys(v).length; rval = (keyCount > 1 || !('@id' in v)); } return rval; } /** * Returns true if the given value is a subject reference. * * @param v the value to check. * * @return true if the value is a subject reference, false if not. */ function _isSubjectReference(v) { // Note: A value is a subject reference if all of these hold true: // 1. It is an Object. // 2. It has a single key: @id. return (_isObject(v) && Object.keys(v).length === 1 && ('@id' in v)); } /** * Returns true if the given value is a @value. * * @param v the value to check. * * @return true if the value is a @value, false if not. */ function _isValue(v) { // Note: A value is a @value if all of these hold true: // 1. It is an Object. // 2. It has the @value property. return _isObject(v) && ('@value' in v); } /** * Returns true if the given value is a @list. * * @param v the value to check. * * @return true if the value is a @list, false if not. */ function _isList(v) { // Note: A value is a @list if all of these hold true: // 1. It is an Object. // 2. It has the @list property. return _isObject(v) && ('@list' in v); } /** * Returns true if the given value is a blank node. * * @param v the value to check. * * @return true if the value is a blank node, false if not. */ function _isBlankNode(v) { // Note: A value is a blank node if all of these hold true: // 1. It is an Object. // 2. If it has an @id key its value begins with '_:'. // 3. It has no keys OR is not a @value, @set, or @list. var rval = false; if(_isObject(v)) { if('@id' in v) { rval = (v['@id'].indexOf('_:') === 0); } else { rval = (Object.keys(v).length === 0 || !(('@value' in v) || ('@set' in v) || ('@list' in v))); } } return rval; } /** * Returns true if the given value is an absolute IRI, false if not. * * @param v the value to check. * * @return true if the value is an absolute IRI, false if not. */ function _isAbsoluteIri(v) { return _isString(v) && v.indexOf(':') !== -1; } /** * Clones an object, array, or string/number. * * @param value the value to clone. * * @return the cloned value. */ function _clone(value) { if(value && typeof value === 'object') { var rval; if(_isArray(value)) { rval = []; for(var i = 0; i < value.length; ++i) { rval[i] = _clone(value[i]); } } else { rval = {}; for(var key in value) { rval[key] = _clone(value[key]); } } return rval; } return value; } /** * Finds all @context URLs in the given JSON-LD input. * * @param input the JSON-LD input. * @param urls a map of URLs (url => false/@contexts). * @param replace true to replace the URLs in the given input with the * @contexts from the urls map, false not to. * @param base the base IRI to use to resolve relative IRIs. * * @return true if new URLs to retrieve were found, false if not. */ function _findContextUrls(input, urls, replace, base) { var count = Object.keys(urls).length; if(_isArray(input)) { for(var i = 0; i < input.length; ++i) { _findContextUrls(input[i], urls, replace, base); } return (count < Object.keys(urls).length); } else if(_isObject(input)) { for(var key in input) { if(key !== '@context') { _findContextUrls(input[key], urls, replace, base); continue; } // get @context var ctx = input[key]; // array @context if(_isArray(ctx)) { var length = ctx.length; for(var i = 0; i < length; ++i) { var _ctx = ctx[i]; if(_isString(_ctx)) { _ctx = _prependBase(base, _ctx); // replace w/@context if requested if(replace) { _ctx = urls[_ctx]; if(_isArray(_ctx)) { // add flattened context Array.prototype.splice.apply(ctx, [i, 1].concat(_ctx)); i += _ctx.length; length += _ctx.length; } else { ctx[i] = _ctx; } } // @context URL found else if(!(_ctx in urls)) { urls[_ctx] = false; } } } } // string @context else if(_isString(ctx)) { ctx = _prependBase(base, ctx); // replace w/@context if requested if(replace) { input[key] = urls[ctx]; } // @context URL found else if(!(ctx in urls)) { urls[ctx] = false; } } } return (count < Object.keys(urls).length); } return false; } /** * Retrieves external @context URLs using the given context loader. Every * instance of @context in the input that refers to a URL will be replaced * with the JSON @context found at that URL. * * @param input the JSON-LD input with possible contexts. * @param options the options to use: * documentLoader(url, callback(err, remoteDoc)) the document loader. * @param callback(err, input) called once the operation completes. */ function _retrieveContextUrls(input, options, callback) { // if any error occurs during URL resolution, quit var error = null; var regex = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; // recursive document loader var documentLoader = options.documentLoader; var retrieve = function(input, cycles, documentLoader, base, callback) { if(Object.keys(cycles).length > MAX_CONTEXT_URLS) { error = new JsonLdError( 'Maximum number of @context URLs exceeded.', 'jsonld.ContextUrlError', {code: 'loading remote context failed', max: MAX_CONTEXT_URLS}); return callback(error); } // for tracking the URLs to retrieve var urls = {}; // finished will be called once the URL queue is empty var finished = function() { // replace all URLs in the input _findContextUrls(input, urls, true, base); callback(null, input); }; // find all URLs in the given input if(!_findContextUrls(input, urls, false, base)) { // no new URLs in input finished(); } // queue all unretrieved URLs var queue = []; for(var url in urls) { if(urls[url] === false) { // validate URL if(!regex.test(url)) { error = new JsonLdError( 'Malformed URL.', 'jsonld.InvalidUrl', {code: 'loading remote context failed', url: url}); return callback(error); } queue.push(url); } } // retrieve URLs in queue var count = queue.length; for(var i = 0; i < queue.length; ++i) { (function(url) { // check for context URL cycle if(url in cycles) { error = new JsonLdError( 'Cyclical @context URLs detected.', 'jsonld.ContextUrlError', {code: 'recursive context inclusion', url: url}); return callback(error); } var _cycles = _clone(cycles); _cycles[url] = true; var done = function(err, remoteDoc) { // short-circuit if there was an error with another URL if(error) { return; } var ctx = remoteDoc ? remoteDoc.document : null; // parse string context as JSON if(!err && _isString(ctx)) { try { ctx = JSON.parse(ctx); } catch(ex) { err = ex; } } // ensure ctx is an object if(err) { err = new JsonLdError( 'Derefencing a URL did not result in a valid JSON-LD object. ' + 'Possible causes are an inaccessible URL perhaps due to ' + 'a same-origin policy (ensure the server uses CORS if you are ' + 'using client-side JavaScript), too many redirects, a ' + 'non-JSON response, or more than one HTTP Link Header was ' + 'provided for a remote context.', 'jsonld.InvalidUrl', {code: 'loading remote context failed', url: url, cause: err}); } else if(!_isObject(ctx)) { err = new JsonLdError( 'Derefencing a URL did not result in a JSON object. The ' + 'response was valid JSON, but it was not a JSON object.', 'jsonld.InvalidUrl', {code: 'invalid remote context', url: url, cause: err}); } if(err) { error = err; return callback(error); } // use empty context if no @context key is present if(!('@context' in ctx)) { ctx = {'@context': {}}; } else { ctx = {'@context': ctx['@context']}; } // append context URL to context if given if(remoteDoc.contextUrl) { if(!_isArray(ctx['@context'])) { ctx['@context'] = [ctx['@context']]; } ctx['@context'].push(remoteDoc.contextUrl); } // recurse retrieve(ctx, _cycles, documentLoader, url, function(err, ctx) { if(err) { return callback(err); } urls[url] = ctx['@context']; count -= 1; if(count === 0) { finished(); } }); }; var promise = documentLoader(url, done); if(promise && 'then' in promise) { promise.then(done.bind(null, null), done); } }(queue[i])); } }; retrieve(input, {}, documentLoader, options.base, callback); } // define js 1.8.5 Object.keys method if not present if(!Object.keys) { Object.keys = function(o) { if(o !== Object(o)) { throw new TypeError('Object.keys called on non-object'); } var rval = []; for(var p in o) { if(Object.prototype.hasOwnProperty.call(o, p)) { rval.push(p); } } return rval; }; } /** * Parses RDF in the form of N-Quads. * * @param input the N-Quads input to parse. * * @return an RDF dataset. */ function _parseNQuads(input) { // define partial regexes var iri = '(?:<([^:]+:[^>]*)>)'; var bnode = '(_:(?:[A-Za-z][A-Za-z0-9]*))'; var plain = '"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"'; var datatype = '(?:\\^\\^' + iri + ')'; var language = '(?:@([a-z]+(?:-[a-z0-9]+)*))'; var literal = '(?:' + plain + '(?:' + datatype + '|' + language + ')?)'; var ws = '[ \\t]+'; var wso = '[ \\t]*'; var eoln = /(?:\r\n)|(?:\n)|(?:\r)/g; var empty = new RegExp('^' + wso + '$'); // define quad part regexes var subject = '(?:' + iri + '|' + bnode + ')' + ws; var property = iri + ws; var object = '(?:' + iri + '|' + bnode + '|' + literal + ')' + wso; var graphName = '(?:\\.|(?:(?:' + iri + '|' + bnode + ')' + wso + '\\.))'; // full quad regex var quad = new RegExp( '^' + wso + subject + property + object + graphName + wso + '$'); // build RDF dataset var dataset = {}; // split N-Quad input into lines var lines = input.split(eoln); var lineNumber = 0; for(var li = 0; li < lines.length; ++li) { var line = lines[li]; lineNumber++; // skip empty lines if(empty.test(line)) { continue; } // parse quad var match = line.match(quad); if(match === null) { throw new JsonLdError( 'Error while parsing N-Quads; invalid quad.', 'jsonld.ParseError', {line: lineNumber}); } // create RDF triple var triple = {}; // get subject if(!_isUndefined(match[1])) { triple.subject = {type: 'IRI', value: match[1]}; } else { triple.subject = {type: 'blank node', value: match[2]}; } // get predicate triple.predicate = {type: 'IRI', value: match[3]}; // get object if(!_isUndefined(match[4])) { triple.object = {type: 'IRI', value: match[4]}; } else if(!_isUndefined(match[5])) { triple.object = {type: 'blank node', value: match[5]}; } else { triple.object = {type: 'literal'}; if(!_isUndefined(match[7])) { triple.object.datatype = match[7]; } else if(!_isUndefined(match[8])) { triple.object.datatype = RDF_LANGSTRING; triple.object.language = match[8]; } else { triple.object.datatype = XSD_STRING; } var unescaped = match[6] .replace(/\\"/g, '"') .replace(/\\t/g, '\t') .replace(/\\n/g, '\n') .replace(/\\r/g, '\r') .replace(/\\\\/g, '\\'); triple.object.value = unescaped; } // get graph name ('@default' is used for the default graph) var name = '@default'; if(!_isUndefined(match[9])) { name = match[9]; } else if(!_isUndefined(match[10])) { name = match[10]; } // initialize graph in dataset if(!(name in dataset)) { dataset[name] = [triple]; } // add triple if unique to its graph else { var unique = true; var triples = dataset[name]; for(var ti = 0; unique && ti < triples.length; ++ti) { if(_compareRDFTriples(triples[ti], triple)) { unique = false; } } if(unique) { triples.push(triple); } } } return dataset; } // register the N-Quads RDF parser jsonld.registerRDFParser('application/nquads', _parseNQuads); /** * Converts an RDF dataset to N-Quads. * * @param dataset the RDF dataset to convert. * * @return the N-Quads string. */ function _toNQuads(dataset) { var quads = []; for(var graphName in dataset) { var triples = dataset[graphName]; for(var ti = 0; ti < triples.length; ++ti) { var triple = triples[ti]; if(graphName === '@default') { graphName = null; } quads.push(_toNQuad(triple, graphName)); } } quads.sort(); return quads.join(''); } /** * Converts an RDF triple and graph name to an N-Quad string (a single quad). * * @param triple the RDF triple to convert. * @param graphName the name of the graph containing the triple, null for * the default graph. * @param bnode the bnode the quad is mapped to (optional, for use * during normalization only). * * @return the N-Quad string. */ function _toNQuad(triple, graphName, bnode) { var s = triple.subject; var p = triple.predicate; var o = triple.object; var g = graphName; var quad = ''; // subject is an IRI if(s.type === 'IRI') { quad += '<' + s.value + '>'; } // bnode normalization mode else if(bnode) { quad += (s.value === bnode) ? '_:a' : '_:z'; } // bnode normal mode else { quad += s.value; } quad += ' '; // predicate is an IRI if(p.type === 'IRI') { quad += '<' + p.value + '>'; } // FIXME: TBD what to do with bnode predicates during normalization // bnode normalization mode else if(bnode) { quad += '_:p'; } // bnode normal mode else { quad += p.value; } quad += ' '; // object is IRI, bnode, or literal if(o.type === 'IRI') { quad += '<' + o.value + '>'; } else if(o.type === 'blank node') { // normalization mode if(bnode) { quad += (o.value === bnode) ? '_:a' : '_:z'; } // normal mode else { quad += o.value; } } else { var escaped = o.value .replace(/\\/g, '\\\\') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\r/g, '\\r') .replace(/\"/g, '\\"'); quad += '"' + escaped + '"'; if(o.datatype === RDF_LANGSTRING) { if(o.language) { quad += '@' + o.language; } } else if(o.datatype !== XSD_STRING) { quad += '^^<' + o.datatype + '>'; } } // graph if(g !== null) { if(g.indexOf('_:') !== 0) { quad += ' <' + g + '>'; } else if(bnode) { quad += ' _:g'; } else { quad += ' ' + g; } } quad += ' .\n'; return quad; } /** * Parses the RDF dataset found via the data object from the RDFa API. * * @param data the RDFa API data object. * * @return the RDF dataset. */ function _parseRdfaApiData(data) { var dataset = {}; dataset['@default'] = []; var subjects = data.getSubjects(); for(var si = 0; si < subjects.length; ++si) { var subject = subjects[si]; if(subject === null) { continue; } // get all related triples var triples = data.getSubjectTriples(subject); if(triples === null) { continue; } var predicates = triples.predicates; for(var predicate in predicates) { // iterate over objects var objects = predicates[predicate].objects; for(var oi = 0; oi < objects.length; ++oi) { var object = objects[oi]; // create RDF triple var triple = {}; // add subject if(subject.indexOf('_:') === 0) { triple.subject = {type: 'blank node', value: subject}; } else { triple.subject = {type: 'IRI', value: subject}; } // add predicate if(predicate.indexOf('_:') === 0) { triple.predicate = {type: 'blank node', value: predicate}; } else { triple.predicate = {type: 'IRI', value: predicate}; } // serialize XML literal var value = object.value; if(object.type === RDF_XML_LITERAL) { // initialize XMLSerializer if(!XMLSerializer) { _defineXMLSerializer(); } var serializer = new XMLSerializer(); value = ''; for(var x = 0; x < object.value.length; x++) { if(object.value[x].nodeType === Node.ELEMENT_NODE) { value += serializer.serializeToString(object.value[x]); } else if(object.value[x].nodeType === Node.TEXT_NODE) { value += object.value[x].nodeValue; } } } // add object triple.object = {}; // object is an IRI if(object.type === RDF_OBJECT) { if(object.value.indexOf('_:') === 0) { triple.object.type = 'blank node'; } else { triple.object.type = 'IRI'; } } // literal else { triple.object.type = 'literal'; if(object.type === RDF_PLAIN_LITERAL) { if(object.language) { triple.object.datatype = RDF_LANGSTRING; triple.object.language = object.language; } else { triple.object.datatype = XSD_STRING; } } else { triple.object.datatype = object.type; } } triple.object.value = value; // add triple to dataset in default graph dataset['@default'].push(triple); } } } return dataset; } // register the RDFa API RDF parser jsonld.registerRDFParser('rdfa-api', _parseRdfaApiData); /** * Creates a new UniqueNamer. A UniqueNamer issues unique names, keeping * track of any previously issued names. * * @param prefix the prefix to use ('<prefix><counter>'). */ function UniqueNamer(prefix) { this.prefix = prefix; this.counter = 0; this.existing = {}; }; /** * Copies this UniqueNamer. * * @return a copy of this UniqueNamer. */ UniqueNamer.prototype.clone = function() { var copy = new UniqueNamer(this.prefix); copy.counter = this.counter; copy.existing = _clone(this.existing); return copy; }; /** * Gets the new name for the given old name, where if no old name is given * a new name will be generated. * * @param [oldName] the old name to get the new name for. * * @return the new name. */ UniqueNamer.prototype.getName = function(oldName) { // return existing old name if(oldName && oldName in this.existing) { return this.existing[oldName]; } // get next name var name = this.prefix + this.counter; this.counter += 1; // save mapping if(oldName) { this.existing[oldName] = name; } return name; }; /** * Returns true if the given oldName has already been assigned a new name. * * @param oldName the oldName to check. * * @return true if the oldName has been assigned a new name, false if not. */ UniqueNamer.prototype.isNamed = function(oldName) { return (oldName in this.existing); }; /** * A Permutator iterates over all possible permutations of the given array * of elements. * * @param list the array of elements to iterate over. */ Permutator = function(list) { // original array this.list = list.sort(); // indicates whether there are more permutations this.done = false; // directional info for permutation algorithm this.left = {}; for(var i = 0; i < list.length; ++i) { this.left[list[i]] = true; } }; /** * Returns true if there is another permutation. * * @return true if there is another permutation, false if not. */ Permutator.prototype.hasNext = function() { return !this.done; }; /** * Gets the next permutation. Call hasNext() to ensure there is another one * first. * * @return the next permutation. */ Permutator.prototype.next = function() { // copy current permutation var rval = this.list.slice(); /* Calculate the next permutation using the Steinhaus-Johnson-Trotter permutation algorithm. */ // get largest mobile element k // (mobile: element is greater than the one it is looking at) var k = null; var pos = 0; var length = this.list.length; for(var i = 0; i < length; ++i) { var element = this.list[i]; var left = this.left[element]; if((k === null || element > k) && ((left && i > 0 && element > this.list[i - 1]) || (!left && i < (length - 1) && element > this.list[i + 1]))) { k = element; pos = i; } } // no more permutations if(k === null) { this.done = true; } else { // swap k and the element it is looking at var swap = this.left[k] ? pos - 1 : pos + 1; this.list[pos] = this.list[swap]; this.list[swap] = k; // reverse the direction of all elements larger than k for(var i = 0; i < length; ++i) { if(this.list[i] > k) { this.left[this.list[i]] = !this.left[this.list[i]]; } } } return rval; }; // SHA-1 API var sha1 = jsonld.sha1 = {}; if(_nodejs) { var crypto = require('crypto'); sha1.create = function() { var md = crypto.createHash('sha1'); return { update: function(data) { md.update(data, 'utf8'); }, digest: function() { return md.digest('hex'); } }; }; } else { sha1.create = function() { return new sha1.MessageDigest(); }; } /** * Hashes the given array of quads and returns its hexadecimal SHA-1 message * digest. * * @param nquads the list of serialized quads to hash. * * @return the hexadecimal SHA-1 message digest. */ sha1.hash = function(nquads) { var md = sha1.create(); for(var i = 0; i < nquads.length; ++i) { md.update(nquads[i]); } return md.digest(); }; // only define sha1 MessageDigest for non-nodejs if(!_nodejs) { /** * Creates a simple byte buffer for message digest operations. */ sha1.Buffer = function() { this.data = ''; this.read = 0; }; /** * Puts a 32-bit integer into this buffer in big-endian order. * * @param i the 32-bit integer. */ sha1.Buffer.prototype.putInt32 = function(i) { this.data += ( String.fromCharCode(i >> 24 & 0xFF) + String.fromCharCode(i >> 16 & 0xFF) + String.fromCharCode(i >> 8 & 0xFF) + String.fromCharCode(i & 0xFF)); }; /** * Gets a 32-bit integer from this buffer in big-endian order and * advances the read pointer by 4. * * @return the word. */ sha1.Buffer.prototype.getInt32 = function() { var rval = ( this.data.charCodeAt(this.read) << 24 ^ this.data.charCodeAt(this.read + 1) << 16 ^ this.data.charCodeAt(this.read + 2) << 8 ^ this.data.charCodeAt(this.read + 3)); this.read += 4; return rval; }; /** * Gets the bytes in this buffer. * * @return a string full of UTF-8 encoded characters. */ sha1.Buffer.prototype.bytes = function() { return this.data.slice(this.read); }; /** * Gets the number of bytes in this buffer. * * @return the number of bytes in this buffer. */ sha1.Buffer.prototype.length = function() { return this.data.length - this.read; }; /** * Compacts this buffer. */ sha1.Buffer.prototype.compact = function() { this.data = this.data.slice(this.read); this.read = 0; }; /** * Converts this buffer to a hexadecimal string. * * @return a hexadecimal string. */ sha1.Buffer.prototype.toHex = function() { var rval = ''; for(var i = this.read; i < this.data.length; ++i) { var b = this.data.charCodeAt(i); if(b < 16) { rval += '0'; } rval += b.toString(16); } return rval; }; /** * Creates a SHA-1 message digest object. * * @return a message digest object. */ sha1.MessageDigest = function() { // do initialization as necessary if(!_sha1.initialized) { _sha1.init(); } this.blockLength = 64; this.digestLength = 20; // length of message so far (does not including padding) this.messageLength = 0; // input buffer this.input = new sha1.Buffer(); // for storing words in the SHA-1 algorithm this.words = new Array(80); // SHA-1 state contains five 32-bit integers this.state = { h0: 0x67452301, h1: 0xEFCDAB89, h2: 0x98BADCFE, h3: 0x10325476, h4: 0xC3D2E1F0 }; }; /** * Updates the digest with the given string input. * * @param msg the message input to update with. */ sha1.MessageDigest.prototype.update = function(msg) { // UTF-8 encode message msg = unescape(encodeURIComponent(msg)); // update message length and input buffer this.messageLength += msg.length; this.input.data += msg; // process input _sha1.update(this.state, this.words, this.input); // compact input buffer every 2K or if empty if(this.input.read > 2048 || this.input.length() === 0) { this.input.compact(); } }; /** * Produces the digest. * * @return the digest as a hexadecimal string. */ sha1.MessageDigest.prototype.digest = function() { /* Determine the number of bytes that must be added to the message to ensure its length is congruent to 448 mod 512. In other words, a 64-bit integer that gives the length of the message will be appended to the message and whatever the length of the message is plus 64 bits must be a multiple of 512. So the length of the message must be congruent to 448 mod 512 because 512 - 64 = 448. In order to fill up the message length it must be filled with padding that begins with 1 bit followed by all 0 bits. Padding must *always* be present, so if the message length is already congruent to 448 mod 512, then 512 padding bits must be added. */ // 512 bits == 64 bytes, 448 bits == 56 bytes, 64 bits = 8 bytes // _padding starts with 1 byte with first bit is set in it which // is byte value 128, then there may be up to 63 other pad bytes var len = this.messageLength; var padBytes = new sha1.Buffer(); padBytes.data += this.input.bytes(); padBytes.data += _sha1.padding.substr(0, 64 - ((len + 8) % 64)); /* Now append length of the message. The length is appended in bits as a 64-bit number in big-endian order. Since we store the length in bytes, we must multiply it by 8 (or left shift by 3). So here store the high 3 bits in the low end of the first 32-bits of the 64-bit number and the lower 5 bits in the high end of the second 32-bits. */ padBytes.putInt32((len >>> 29) & 0xFF); padBytes.putInt32((len << 3) & 0xFFFFFFFF); _sha1.update(this.state, this.words, padBytes); var rval = new sha1.Buffer(); rval.putInt32(this.state.h0); rval.putInt32(this.state.h1); rval.putInt32(this.state.h2); rval.putInt32(this.state.h3); rval.putInt32(this.state.h4); return rval.toHex(); }; // private SHA-1 data var _sha1 = { padding: null, initialized: false }; /** * Initializes the constant tables. */ _sha1.init = function() { // create padding _sha1.padding = String.fromCharCode(128); var c = String.fromCharCode(0x00); var n = 64; while(n > 0) { if(n & 1) { _sha1.padding += c; } n >>>= 1; if(n > 0) { c += c; } } // now initialized _sha1.initialized = true; }; /** * Updates a SHA-1 state with the given byte buffer. * * @param s the SHA-1 state to update. * @param w the array to use to store words. * @param input the input byte buffer. */ _sha1.update = function(s, w, input) { // consume 512 bit (64 byte) chunks var t, a, b, c, d, e, f, i; var len = input.length(); while(len >= 64) { // the w array will be populated with sixteen 32-bit big-endian words // and then extended into 80 32-bit words according to SHA-1 algorithm // and for 32-79 using Max Locktyukhin's optimization // initialize hash value for this chunk a = s.h0; b = s.h1; c = s.h2; d = s.h3; e = s.h4; // round 1 for(i = 0; i < 16; ++i) { t = input.getInt32(); w[i] = t; f = d ^ (b & (c ^ d)); t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } for(; i < 20; ++i) { t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); t = (t << 1) | (t >>> 31); w[i] = t; f = d ^ (b & (c ^ d)); t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // round 2 for(; i < 32; ++i) { t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); t = (t << 1) | (t >>> 31); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } for(; i < 40; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // round 3 for(; i < 60; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = (b & c) | (d & (b ^ c)); t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // round 4 for(; i < 80; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // update hash state s.h0 += a; s.h1 += b; s.h2 += c; s.h3 += d; s.h4 += e; len -= 64; } }; } // end non-nodejs if(!XMLSerializer) { function _defineXMLSerializer() { XMLSerializer = require('xmldom').XMLSerializer; } } // end _defineXMLSerializer // define URL parser jsonld.url = {}; if(_nodejs) { var parse = require('url').parse; jsonld.url.parse = function(url) { var parsed = parse(url); parsed.pathname = parsed.pathname || ''; _parseAuthority(parsed); parsed.normalizedPath = _removeDotSegments( parsed.pathname, parsed.authority !== ''); return parsed; }; } else { // parseUri 1.2.2 // (c) Steven Levithan <stevenlevithan.com> // MIT License var parseUri = {}; parseUri.options = { key: ['href','protocol','host','auth','user','password','hostname','port','relative','path','directory','file','query','hash'], parser: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/ }; jsonld.url.parse = function(str) { var o = parseUri.options; var m = o.parser.exec(str); var uri = {}; var i = 14; while(i--) { uri[o.key[i]] = m[i] || ''; } // normalize to node.js API if(uri.host && uri.path === '') { uri.path = '/'; } uri.pathname = uri.path || ''; _parseAuthority(uri); uri.normalizedPath = _removeDotSegments(uri.pathname, uri.authority !== ''); if(uri.query) { uri.path = uri.path + '?' + uri.query; } if(uri.protocol) { uri.protocol += ':'; } if(uri.hash) { uri.hash = '#' + uri.hash; } return uri; }; } /** * Parses the authority for the pre-parsed given URL. * * @param parsed the pre-parsed URL. */ function _parseAuthority(parsed) { // parse authority for unparsed relative network-path reference if(parsed.href.indexOf(':') === -1 && parsed.href.indexOf('//') === 0 && !parsed.host) { // must parse authority from pathname parsed.pathname = parsed.pathname.substr(2); var idx = parsed.pathname.indexOf('/'); if(idx === -1) { parsed.authority = parsed.pathname; parsed.pathname = ''; } else { parsed.authority = parsed.pathname.substr(0, idx); parsed.pathname = parsed.pathname.substr(idx); } } else { // construct authority parsed.authority = parsed.host || ''; if(parsed.auth) { parsed.authority = parsed.auth + '@' + parsed.authority; } } } /** * Removes dot segments from a URL path. * * @param path the path to remove dot segments from. * @param hasAuthority true if the URL has an authority, false if not. */ function _removeDotSegments(path, hasAuthority) { var rval = ''; if(path.indexOf('/') === 0) { rval = '/'; } // RFC 3986 5.2.4 (reworked) var input = path.split('/'); var output = []; while(input.length > 0) { if(input[0] === '.' || (input[0] === '' && input.length > 1)) { input.shift(); continue; } if(input[0] === '..') { input.shift(); if(hasAuthority || (output.length > 0 && output[output.length - 1] !== '..')) { output.pop(); } // leading relative URL '..' else { output.push('..'); } continue; } output.push(input.shift()); } return rval + output.join('/'); } // use node document loader by default if(_nodejs) { jsonld.useDocumentLoader('node'); } // use xhr document loader by default else if(typeof XMLHttpRequest !== 'undefined') { jsonld.useDocumentLoader('xhr'); } if(_nodejs) { jsonld.use = function(extension) { switch(extension) { case 'request': // use node JSON-LD request extension jsonld.request = require('./request'); break; default: throw new JsonLdError( 'Unknown extension.', 'jsonld.UnknownExtension', {extension: extension}); } }; } // end of jsonld API factory return jsonld; }; // external APIs: // used to generate a new jsonld API instance var factory = function() { return wrapper(function() { return factory(); }); }; // the shared global jsonld API instance wrapper(factory); // export nodejs API if(_nodejs) { module.exports = factory; } // export AMD API else if(typeof define === 'function' && define.amd) { define([], function() { return factory; }); } // export simple browser API else if(_browser) { if(typeof jsonld === 'undefined') { jsonld = jsonldjs = factory; } else { jsonldjs = factory; } } })();
WilliamRen/cdnjs
ajax/libs/jsonld/0.1.19/jsonld.js
JavaScript
mit
198,223
/** * A JavaScript implementation of the JSON-LD API. * * @author Dave Longley * * BSD 3-Clause License * Copyright (c) 2011-2013 Digital Bazaar, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 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. * * Neither the name of the Digital Bazaar, Inc. nor the names of its * contributors may 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 * HOLDER 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() { // determine if in-browser or using node.js var _nodejs = ( typeof process !== 'undefined' && process.versions && process.versions.node); var _browser = !_nodejs && (typeof window !== 'undefined' || typeof self !== 'undefined'); if(_browser) { if(typeof global === 'undefined') { if(typeof window !== 'undefined') { global = window; } else if(typeof self !== 'undefined') { global = self; } else if(typeof $ !== 'undefined') { global = $; } } } // attaches jsonld API to the given object var wrapper = function(jsonld) { /* Core API */ /** * Performs JSON-LD compaction. * * @param input the JSON-LD input to compact. * @param ctx the context to compact with. * @param [options] options to use: * [base] the base IRI to use. * [compactArrays] true to compact arrays to single values when * appropriate, false not to (default: true). * [graph] true to always output a top-level graph (default: false). * [expandContext] a context to expand with. * [skipExpansion] true to assume the input is expanded and skip * expansion, false not to, defaults to false. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, compacted, ctx) called once the operation completes. */ jsonld.compact = function(input, ctx, options, callback) { if(arguments.length < 2) { return jsonld.nextTick(function() { callback(new TypeError('Could not compact, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; if(ctx === null) { return jsonld.nextTick(function() { callback(new JsonLdError( 'The compaction context must not be null.', 'jsonld.CompactError', {code: 'invalid local context'})); }); } // nothing to compact if(input === null) { return jsonld.nextTick(function() { callback(null, null); }); } // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('compactArrays' in options)) { options.compactArrays = true; } if(!('graph' in options)) { options.graph = false; } if(!('skipExpansion' in options)) { options.skipExpansion = false; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } var expand = function(input, options, callback) { jsonld.nextTick(function() { if(options.skipExpansion) { return callback(null, input); } jsonld.expand(input, options, callback); }); }; // expand input then do compaction expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before compaction.', 'jsonld.CompactError', {cause: err})); } // process context var activeCtx = _getInitialContext(options); jsonld.processContext(activeCtx, ctx, options, function(err, activeCtx) { if(err) { return callback(new JsonLdError( 'Could not process context before compaction.', 'jsonld.CompactError', {cause: err})); } var compacted; try { // do compaction compacted = new Processor().compact( activeCtx, null, expanded, options); } catch(ex) { return callback(ex); } cleanup(null, compacted, activeCtx, options); }); }); // performs clean up after compaction function cleanup(err, compacted, activeCtx, options) { if(err) { return callback(err); } if(options.compactArrays && !options.graph && _isArray(compacted)) { // simplify to a single item if(compacted.length === 1) { compacted = compacted[0]; } // simplify to an empty object else if(compacted.length === 0) { compacted = {}; } } // always use array if graph option is on else if(options.graph && _isObject(compacted)) { compacted = [compacted]; } // follow @context key if(_isObject(ctx) && '@context' in ctx) { ctx = ctx['@context']; } // build output context ctx = _clone(ctx); if(!_isArray(ctx)) { ctx = [ctx]; } // remove empty contexts var tmp = ctx; ctx = []; for(var i = 0; i < tmp.length; ++i) { if(!_isObject(tmp[i]) || Object.keys(tmp[i]).length > 0) { ctx.push(tmp[i]); } } // remove array if only one context var hasContext = (ctx.length > 0); if(ctx.length === 1) { ctx = ctx[0]; } // add context and/or @graph if(_isArray(compacted)) { // use '@graph' keyword var kwgraph = _compactIri(activeCtx, '@graph'); var graph = compacted; compacted = {}; if(hasContext) { compacted['@context'] = ctx; } compacted[kwgraph] = graph; } else if(_isObject(compacted) && hasContext) { // reorder keys so @context is first var graph = compacted; compacted = {'@context': ctx}; for(var key in graph) { compacted[key] = graph[key]; } } callback(null, compacted, activeCtx); } }; /** * Performs JSON-LD expansion. * * @param input the JSON-LD input to expand. * @param [options] the options to use: * [base] the base IRI to use. * [expandContext] a context to expand with. * [keepFreeFloatingNodes] true to keep free-floating nodes, * false not to, defaults to false. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, expanded) called once the operation completes. */ jsonld.expand = function(input, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not expand, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } if(!('keepFreeFloatingNodes' in options)) { options.keepFreeFloatingNodes = false; } jsonld.nextTick(function() { // if input is a string, attempt to dereference remote document if(typeof input === 'string') { var done = function(err, remoteDoc) { if(err) { return callback(err); } try { if(!remoteDoc.document) { throw new JsonLdError( 'No remote document found at the given URL.', 'jsonld.NullRemoteDocument'); } if(typeof remoteDoc.document === 'string') { remoteDoc.document = JSON.parse(remoteDoc.document); } } catch(ex) { return callback(new JsonLdError( 'Could not retrieve a JSON-LD document from the URL. URL ' + 'derefencing not implemented.', 'jsonld.LoadDocumentError', { code: 'loading document failed', cause: ex, remoteDoc: remoteDoc })); } expand(remoteDoc); }; var promise = options.documentLoader(input, done); if(promise && 'then' in promise) { promise.then(done.bind(null, null), done); } return; } // nothing to load expand({contextUrl: null, documentUrl: null, document: input}); }); function expand(remoteDoc) { // set default base if(!('base' in options)) { options.base = remoteDoc.documentUrl || ''; } // build meta-object and retrieve all @context URLs var input = { document: _clone(remoteDoc.document), remoteContext: {'@context': remoteDoc.contextUrl} }; if('expandContext' in options) { var expandContext = _clone(options.expandContext); if(typeof expandContext === 'object' && '@context' in expandContext) { input.expandContext = expandContext; } else { input.expandContext = {'@context': expandContext}; } } _retrieveContextUrls(input, options, function(err, input) { if(err) { return callback(err); } var expanded; try { var processor = new Processor(); var activeCtx = _getInitialContext(options); var document = input.document; var remoteContext = input.remoteContext['@context']; // process optional expandContext if(input.expandContext) { activeCtx = processor.processContext( activeCtx, input.expandContext['@context'], options); } // process remote context from HTTP Link Header if(remoteContext) { activeCtx = processor.processContext( activeCtx, remoteContext, options); } // expand document expanded = processor.expand( activeCtx, null, document, options, false); // optimize away @graph with no other properties if(_isObject(expanded) && ('@graph' in expanded) && Object.keys(expanded).length === 1) { expanded = expanded['@graph']; } else if(expanded === null) { expanded = []; } // normalize to an array if(!_isArray(expanded)) { expanded = [expanded]; } } catch(ex) { return callback(ex); } callback(null, expanded); }); } }; /** * Performs JSON-LD flattening. * * @param input the JSON-LD to flatten. * @param ctx the context to use to compact the flattened output, or null. * @param [options] the options to use: * [base] the base IRI to use. * [expandContext] a context to expand with. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, flattened) called once the operation completes. */ jsonld.flatten = function(input, ctx, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not flatten, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } else if(typeof ctx === 'function') { callback = ctx; ctx = null; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // expand input jsonld.expand(input, options, function(err, _input) { if(err) { return callback(new JsonLdError( 'Could not expand input before flattening.', 'jsonld.FlattenError', {cause: err})); } var flattened; try { // do flattening flattened = new Processor().flatten(_input); } catch(ex) { return callback(ex); } if(ctx === null) { return callback(null, flattened); } // compact result (force @graph option to true, skip expansion) options.graph = true; options.skipExpansion = true; jsonld.compact(flattened, ctx, options, function(err, compacted) { if(err) { return callback(new JsonLdError( 'Could not compact flattened output.', 'jsonld.FlattenError', {cause: err})); } callback(null, compacted); }); }); }; /** * Performs JSON-LD framing. * * @param input the JSON-LD input to frame. * @param frame the JSON-LD frame to use. * @param [options] the framing options. * [base] the base IRI to use. * [expandContext] a context to expand with. * [embed] default @embed flag (default: true). * [explicit] default @explicit flag (default: false). * [omitDefault] default @omitDefault flag (default: false). * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, framed) called once the operation completes. */ jsonld.frame = function(input, frame, options, callback) { if(arguments.length < 2) { return jsonld.nextTick(function() { callback(new TypeError('Could not frame, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } if(!('embed' in options)) { options.embed = true; } options.explicit = options.explicit || false; options.omitDefault = options.omitDefault || false; jsonld.nextTick(function() { // if frame is a string, attempt to dereference remote document if(typeof frame === 'string') { var done = function(err, remoteDoc) { if(err) { return callback(err); } try { if(!remoteDoc.document) { throw new JsonLdError( 'No remote document found at the given URL.', 'jsonld.NullRemoteDocument'); } if(typeof remoteDoc.document === 'string') { remoteDoc.document = JSON.parse(remoteDoc.document); } } catch(ex) { return callback(new JsonLdError( 'Could not retrieve a JSON-LD document from the URL. URL ' + 'derefencing not implemented.', 'jsonld.LoadDocumentError', { code: 'loading document failed', cause: ex, remoteDoc: remoteDoc })); } doFrame(remoteDoc); }; var promise = options.documentLoader(frame, done); if(promise && 'then' in promise) { promise.then(done.bind(null, null), done); } return; } // nothing to load doFrame({contextUrl: null, documentUrl: null, document: frame}); }); function doFrame(remoteFrame) { // preserve frame context and add any Link header context var frame = remoteFrame.document; var ctx; if(frame) { ctx = frame['@context']; if(remoteFrame.contextUrl) { if(!ctx) { ctx = remoteFrame.contextUrl; } else if(_isArray(ctx)) { ctx.push(remoteFrame.contextUrl); } else { ctx = [ctx, remoteFrame.contextUrl]; } frame['@context'] = ctx; } else { ctx = ctx || {}; } } else { ctx = {}; } // expand input jsonld.expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before framing.', 'jsonld.FrameError', {cause: err})); } // expand frame var opts = _clone(options); opts.isFrame = true; opts.keepFreeFloatingNodes = true; jsonld.expand(frame, opts, function(err, expandedFrame) { if(err) { return callback(new JsonLdError( 'Could not expand frame before framing.', 'jsonld.FrameError', {cause: err})); } var framed; try { // do framing framed = new Processor().frame(expanded, expandedFrame, opts); } catch(ex) { return callback(ex); } // compact result (force @graph option to true, skip expansion) opts.graph = true; opts.skipExpansion = true; jsonld.compact(framed, ctx, opts, function(err, compacted, ctx) { if(err) { return callback(new JsonLdError( 'Could not compact framed output.', 'jsonld.FrameError', {cause: err})); } // get graph alias var graph = _compactIri(ctx, '@graph'); // remove @preserve from results compacted[graph] = _removePreserve(ctx, compacted[graph], opts); callback(null, compacted); }); }); }); } }; /** * Performs JSON-LD objectification. * * @param input the JSON-LD input to objectify. * @param ctx the JSON-LD context to apply. * @param [options] the framing options. * [base] the base IRI to use. * [expandContext] a context to expand with. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, objectified) called once the operation completes. */ jsonld.objectify = function(input, ctx, options, callback) { // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // expand input jsonld.expand(input, options, function(err, _input) { if(err) { return callback(new JsonLdError( 'Could not expand input before framing.', 'jsonld.FrameError', {cause: err})); } var flattened; try { // flatten the graph flattened = new Processor().flatten(_input); } catch(ex) { return callback(ex); } // compact result (force @graph option to true, skip expansion) options.graph = true; options.skipExpansion = true; jsonld.compact(flattened, ctx, options, function(err, compacted, ctx) { if(err) { return callback(new JsonLdError( 'Could not compact flattened output.', 'jsonld.FrameError', {cause: err})); } // get graph alias var graph = _compactIri(ctx, '@graph'); // remove @preserve from results (named graphs?) compacted[graph] = _removePreserve(ctx, compacted[graph], options); var top = compacted[graph][0]; var recurse = function(subject) { // can't replace just a string if(!_isObject(subject) && !_isArray(subject)) { return; } // bottom out recursion on re-visit if(_isObject(subject)) { if(recurse.visited[subject['@id']]) { return; } recurse.visited[subject['@id']] = true; } // each array element *or* object key for(var k in subject) { var obj = subject[k]; var isid = (jsonld.getContextValue(ctx, k, '@type') === '@id'); // can't replace a non-object or non-array unless it's an @id if(!_isArray(obj) && !_isObject(obj) && !isid) { continue; } if(_isString(obj) && isid) { subject[k] = obj = top[obj]; recurse(obj); } else if(_isArray(obj)) { for(var i = 0; i < obj.length; ++i) { if(_isString(obj[i]) && isid) { obj[i] = top[obj[i]]; } else if(_isObject(obj[i]) && '@id' in obj[i]) { obj[i] = top[obj[i]['@id']]; } recurse(obj[i]); } } else if(_isObject(obj)) { var sid = obj['@id']; subject[k] = obj = top[sid]; recurse(obj); } } }; recurse.visited = {}; recurse(top); compacted.of_type = {}; for(var s in top) { if(!('@type' in top[s])) { continue; } var types = top[s]['@type']; if(!_isArray(types)) { types = [types]; } for(var t in types) { if(!(types[t] in compacted.of_type)) { compacted.of_type[types[t]] = []; } compacted.of_type[types[t]].push(top[s]); } } callback(null, compacted); }); }); }; /** * Performs RDF dataset normalization on the given JSON-LD input. The output * is an RDF dataset unless the 'format' option is used. * * @param input the JSON-LD input to normalize. * @param [options] the options to use: * [base] the base IRI to use. * [expandContext] a context to expand with. * [format] the format if output is a string: * 'application/nquads' for N-Quads. * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, normalized) called once the operation completes. */ jsonld.normalize = function(input, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not normalize, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // convert to RDF dataset then do normalization var opts = _clone(options); delete opts.format; opts.produceGeneralizedRdf = false; jsonld.toRDF(input, opts, function(err, dataset) { if(err) { return callback(new JsonLdError( 'Could not convert input to RDF dataset before normalization.', 'jsonld.NormalizeError', {cause: err})); } // do normalization new Processor().normalize(dataset, options, callback); }); }; /** * Converts an RDF dataset to JSON-LD. * * @param dataset a serialized string of RDF in a format specified by the * format option or an RDF dataset to convert. * @param [options] the options to use: * [format] the format if dataset param must first be parsed: * 'application/nquads' for N-Quads (default). * [rdfParser] a custom RDF-parser to use to parse the dataset. * [useRdfType] true to use rdf:type, false to use @type * (default: false). * [useNativeTypes] true to convert XSD types into native types * (boolean, integer, double), false not to (default: false). * @param callback(err, output) called once the operation completes. */ jsonld.fromRDF = function(dataset, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not convert from RDF, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('useRdfType' in options)) { options.useRdfType = false; } if(!('useNativeTypes' in options)) { options.useNativeTypes = false; } if(!('format' in options) && _isString(dataset)) { // set default format to nquads if(!('format' in options)) { options.format = 'application/nquads'; } } jsonld.nextTick(function() { // handle special format var rdfParser; if(options.format) { // check supported formats rdfParser = options.rdfParser || _rdfParsers[options.format]; if(!rdfParser) { return callback(new JsonLdError( 'Unknown input format.', 'jsonld.UnknownFormat', {format: options.format})); } } else { // no-op parser, assume dataset already parsed rdfParser = function() { return dataset; }; } // rdf parser may be async or sync, always pass callback dataset = rdfParser(dataset, function(err, dataset) { if(err) { return callback(err); } fromRDF(dataset, options, callback); }); // handle synchronous or promise-based parser if(dataset) { // if dataset is actually a promise if('then' in dataset) { return dataset.then(function(dataset) { fromRDF(dataset, options, callback); }, callback); } // parser is synchronous fromRDF(dataset, options, callback); } function fromRDF(dataset, options, callback) { // convert from RDF new Processor().fromRDF(dataset, options, callback); } }); }; /** * Outputs the RDF dataset found in the given JSON-LD object. * * @param input the JSON-LD input. * @param [options] the options to use: * [base] the base IRI to use. * [expandContext] a context to expand with. * [format] the format to use to output a string: * 'application/nquads' for N-Quads. * [produceGeneralizedRdf] true to output generalized RDF, false * to produce only standard RDF (default: false). * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, dataset) called once the operation completes. */ jsonld.toRDF = function(input, options, callback) { if(arguments.length < 1) { return jsonld.nextTick(function() { callback(new TypeError('Could not convert to RDF, too few arguments.')); }); } // get arguments if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // set default options if(!('base' in options)) { options.base = (typeof input === 'string') ? input : ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // expand input jsonld.expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before serialization to RDF.', 'jsonld.RdfError', {cause: err})); } var dataset; try { // output RDF dataset dataset = Processor.prototype.toRDF(expanded, options); if(options.format) { if(options.format === 'application/nquads') { return callback(null, _toNQuads(dataset)); } throw new JsonLdError( 'Unknown output format.', 'jsonld.UnknownFormat', {format: options.format}); } } catch(ex) { return callback(ex); } callback(null, dataset); }); }; /** * Relabels all blank nodes in the given JSON-LD input. * * @param input the JSON-LD input. */ jsonld.relabelBlankNodes = function(input) { _labelBlankNodes(new UniqueNamer('_:b', input)); }; /** * The default document loader for external documents. If the environment * is node.js, a callback-continuation-style document loader is used; otherwise, * a promises-style document loader is used. * * @param url the URL to load. * @param callback(err, remoteDoc) called once the operation completes, * if using a non-promises API. * * @return a promise, if using a promises API. */ jsonld.documentLoader = function(url, callback) { var err = new JsonLdError( 'Could not retrieve a JSON-LD document from the URL. URL derefencing not ' + 'implemented.', 'jsonld.LoadDocumentError', {code: 'loading document failed'}); if(_nodejs) { return callback(err, {contextUrl: null, documentUrl: url, document: null}); } return jsonld.promisify(function(callback) { callback(err); }); }; /** * Deprecated default document loader. Use or override jsonld.documentLoader * instead. */ jsonld.loadDocument = function(url, callback) { var promise = jsonld.documentLoader(url, callback); if(promise && 'then' in promise) { promise.then(callback.bind(null, null), callback); } }; /* Promises API */ jsonld.promises = function() { var slice = Array.prototype.slice; var promisify = jsonld.promisify; var api = {}; api.expand = function(input) { if(arguments.length < 1) { throw new TypeError('Could not expand, too few arguments.'); } return promisify.apply(null, [jsonld.expand].concat(slice.call(arguments))); }; api.compact = function(input, ctx) { if(arguments.length < 2) { throw new TypeError('Could not compact, too few arguments.'); } var compact = function(input, ctx, options, callback) { // ensure only one value is returned in callback jsonld.compact(input, ctx, options, function(err, compacted) { callback(err, compacted); }); }; return promisify.apply(null, [compact].concat(slice.call(arguments))); }; api.flatten = function(input) { if(arguments.length < 1) { throw new TypeError('Could not flatten, too few arguments.'); } return promisify.apply( null, [jsonld.flatten].concat(slice.call(arguments))); }; api.frame = function(input, frame) { if(arguments.length < 2) { throw new TypeError('Could not frame, too few arguments.'); } return promisify.apply(null, [jsonld.frame].concat(slice.call(arguments))); }; api.fromRDF = function(dataset) { if(arguments.length < 1) { throw new TypeError('Could not convert from RDF, too few arguments.'); } return promisify.apply( null, [jsonld.fromRDF].concat(slice.call(arguments))); }; api.toRDF = function(input) { if(arguments.length < 1) { throw new TypeError('Could not convert to RDF, too few arguments.'); } return promisify.apply(null, [jsonld.toRDF].concat(slice.call(arguments))); }; api.normalize = function(input) { if(arguments.length < 1) { throw new TypeError('Could not normalize, too few arguments.'); } return promisify.apply( null, [jsonld.normalize].concat(slice.call(arguments))); }; return api; }; /** * Converts a node.js async op into a promise w/boxed resolved value(s). * * @param op the operation to convert. * * @return the promise. */ jsonld.promisify = function(op) { try { var Promise = global.Promise || require('es6-promise').Promise; } catch(e) { throw new Error('Unable to find a Promise implementation.'); } var args = Array.prototype.slice.call(arguments, 1); return new Promise(function(resolve, reject) { op.apply(null, args.concat(function(err, value) { if(!err) { resolve(value); } else { reject(err); } })); }); }; /* WebIDL API */ function JsonLdProcessor() {} JsonLdProcessor.prototype = jsonld.promises(); JsonLdProcessor.prototype.toString = function() { if(this instanceof JsonLdProcessor) { return '[object JsonLdProcessor]'; } return '[object JsonLdProcessorPrototype]'; }; jsonld.JsonLdProcessor = JsonLdProcessor; // IE8 has Object.defineProperty but it only // works on DOM nodes -- so feature detection // requires try/catch :-( var canDefineProperty = !!Object.defineProperty; if(canDefineProperty) { try { Object.defineProperty({}, 'x', {}); } catch(e) { canDefineProperty = false; } } if(canDefineProperty) { Object.defineProperty(JsonLdProcessor, 'prototype', { writable: false, enumerable: false }); Object.defineProperty(JsonLdProcessor.prototype, 'constructor', { writable: true, enumerable: false, configurable: true, value: JsonLdProcessor }); } // setup browser global JsonLdProcessor if(_browser && typeof global.JsonLdProcessor === 'undefined') { if(canDefineProperty) { Object.defineProperty(global, 'JsonLdProcessor', { writable: true, enumerable: false, configurable: true, value: JsonLdProcessor }); } else { global.JsonLdProcessor = JsonLdProcessor; } } /* Utility API */ // define setImmediate and nextTick if(typeof process === 'undefined' || !process.nextTick) { if(typeof setImmediate === 'function') { jsonld.setImmediate = jsonld.nextTick = function(callback) { return setImmediate(callback); }; } else { jsonld.setImmediate = function(callback) { setTimeout(callback, 0); }; jsonld.nextTick = jsonld.setImmediate; } } else { jsonld.nextTick = process.nextTick; if(typeof setImmediate === 'function') { jsonld.setImmediate = setImmediate; } else { jsonld.setImmediate = jsonld.nextTick; } } /** * Parses a link header. The results will be key'd by the value of "rel". * * Link: <http://json-ld.org/contexts/person.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" * * Parses as: { * 'http://www.w3.org/ns/json-ld#context': { * target: http://json-ld.org/contexts/person.jsonld, * type: 'application/ld+json' * } * } * * If there is more than one "rel" with the same IRI, then entries in the * resulting map for that "rel" will be arrays. * * @param header the link header to parse. */ jsonld.parseLinkHeader = function(header) { var rval = {}; // split on unbracketed/unquoted commas var entries = header.match(/(?:<[^>]*?>|"[^"]*?"|[^,])+/g); var rLinkHeader = /\s*<([^>]*?)>\s*(?:;\s*(.*))?/; for(var i = 0; i < entries.length; ++i) { var match = entries[i].match(rLinkHeader); if(!match) { continue; } var result = {target: match[1]}; var params = match[2]; var rParams = /(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g; while(match = rParams.exec(params)) { result[match[1]] = (match[2] === undefined) ? match[3] : match[2]; } var rel = result['rel'] || ''; if(_isArray(rval[rel])) { rval[rel].push(result); } else if(rel in rval) { rval[rel] = [rval[rel], result]; } else { rval[rel] = result; } } return rval; }; /** * Creates a simple document cache that retains documents for a short * period of time. * * FIXME: Implement simple HTTP caching instead. * * @param size the maximum size of the cache. */ jsonld.DocumentCache = function(size) { this.order = []; this.cache = {}; this.size = size || 50; this.expires = 30*1000; }; jsonld.DocumentCache.prototype.get = function(url) { if(url in this.cache) { var entry = this.cache[url]; if(entry.expires >= +new Date()) { return entry.ctx; } delete this.cache[url]; this.order.splice(this.order.indexOf(url), 1); } return null; }; jsonld.DocumentCache.prototype.set = function(url, ctx) { if(this.order.length === this.size) { delete this.cache[this.order.shift()]; } this.order.push(url); this.cache[url] = {ctx: ctx, expires: (+new Date() + this.expires)}; }; /** * Creates an active context cache. * * @param size the maximum size of the cache. */ jsonld.ActiveContextCache = function(size) { this.order = []; this.cache = {}; this.size = size || 100; }; jsonld.ActiveContextCache.prototype.get = function(activeCtx, localCtx) { var key1 = JSON.stringify(activeCtx); var key2 = JSON.stringify(localCtx); var level1 = this.cache[key1]; if(level1 && key2 in level1) { return level1[key2]; } return null; }; jsonld.ActiveContextCache.prototype.set = function( activeCtx, localCtx, result) { if(this.order.length === this.size) { var entry = this.order.shift(); delete this.cache[entry.activeCtx][entry.localCtx]; } var key1 = JSON.stringify(activeCtx); var key2 = JSON.stringify(localCtx); this.order.push({activeCtx: key1, localCtx: key2}); if(!(key1 in this.cache)) { this.cache[key1] = {}; } this.cache[key1][key2] = _clone(result); }; /** * Default JSON-LD cache. */ jsonld.cache = { activeCtx: new jsonld.ActiveContextCache() }; /** * Document loaders. */ jsonld.documentLoaders = {}; /** * Creates a built-in jquery document loader. * * @param $ the jquery instance to use. * @param options the options to use: * secure: require all URLs to use HTTPS. * usePromise: true to use a promises API, false for a * callback-continuation-style API; defaults to true if Promise * is globally defined, false if not. * * @return the jquery document loader. */ jsonld.documentLoaders.jquery = function($, options) { options = options || {}; var cache = new jsonld.DocumentCache(); var loader = function(url, callback) { if(options.secure && url.indexOf('https') !== 0) { return callback(new JsonLdError( 'URL could not be dereferenced; secure mode is enabled and ' + 'the URL\'s scheme is not "https".', 'jsonld.InvalidUrl', {code: 'loading document failed', url: url}), {contextUrl: null, documentUrl: url, document: null}); } var doc = cache.get(url); if(doc !== null) { return callback(null, doc); } $.ajax({ url: url, accepts: { json: 'application/ld+json' }, dataType: 'json', crossDomain: true, success: function(data, textStatus, jqXHR) { var doc = {contextUrl: null, documentUrl: url, document: data}; // handle Link Header var contentType = jqXHR.getResponseHeader('Content-Type'); var linkHeader = jqXHR.getResponseHeader('Link'); if(linkHeader && contentType !== 'application/ld+json') { // only 1 related link header permitted linkHeader = jsonld.parseLinkHeader(linkHeader)[LINK_HEADER_REL]; if(_isArray(linkHeader)) { return callback(new JsonLdError( 'URL could not be dereferenced, it has more than one ' + 'associated HTTP Link Header.', 'jsonld.InvalidUrl', {code: 'multiple context link headers', url: url}), doc); } if(linkHeader) { doc.contextUrl = linkHeader.target; } } cache.set(url, doc); callback(null, doc); }, error: function(jqXHR, textStatus, err) { callback(new JsonLdError( 'URL could not be dereferenced, an error occurred.', 'jsonld.LoadDocumentError', {code: 'loading document failed', url: url, cause: err}), {contextUrl: null, documentUrl: url, document: null}); } }); }; var usePromise = (typeof Promise !== 'undefined'); if('usePromise' in options) { usePromise = options.usePromise; } if(usePromise) { return function(url) { return jsonld.promisify(loader, url); }; } return loader; }; /** * Creates a built-in node document loader. * * @param options the options to use: * secure: require all URLs to use HTTPS. * maxRedirects: the maximum number of redirects to permit, none by * default. * usePromise: true to use a promises API, false for a * callback-continuation-style API; false by default. * * @return the node document loader. */ jsonld.documentLoaders.node = function(options) { options = options || {}; var maxRedirects = ('maxRedirects' in options) ? options.maxRedirects : -1; var request = require('request'); var http = require('http'); var cache = new jsonld.DocumentCache(); function loadDocument(url, redirects, callback) { if(options.secure && url.indexOf('https') !== 0) { return callback(new JsonLdError( 'URL could not be dereferenced; secure mode is enabled and ' + 'the URL\'s scheme is not "https".', 'jsonld.InvalidUrl', {code: 'loading document failed', url: url}), {contextUrl: null, documentUrl: url, document: null}); } var doc = cache.get(url); if(doc !== null) { return callback(null, doc); } request({ url: url, headers: { 'Accept': 'application/ld+json, application/json' }, strictSSL: true, followRedirect: false }, function(err, res, body) { doc = {contextUrl: null, documentUrl: url, document: body || null}; // handle error if(err) { return callback(new JsonLdError( 'URL could not be dereferenced, an error occurred.', 'jsonld.LoadDocumentError', {code: 'loading document failed', url: url, cause: err}), doc); } var statusText = http.STATUS_CODES[res.statusCode]; if(res.statusCode >= 400) { return callback(new JsonLdError( 'URL could not be dereferenced: ' + statusText, 'jsonld.InvalidUrl', { code: 'loading document failed', url: url, httpStatusCode: res.statusCode }), doc); } // handle Link Header if(res.headers.link && res.headers['content-type'] !== 'application/ld+json') { // only 1 related link header permitted var linkHeader = jsonld.parseLinkHeader( res.headers.link)[LINK_HEADER_REL]; if(_isArray(linkHeader)) { return callback(new JsonLdError( 'URL could not be dereferenced, it has more than one associated ' + 'HTTP Link Header.', 'jsonld.InvalidUrl', {code: 'multiple context link headers', url: url}), doc); } if(linkHeader) { doc.contextUrl = linkHeader.target; } } // handle redirect if(res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) { if(redirects.length === maxRedirects) { return callback(new JsonLdError( 'URL could not be dereferenced; there were too many redirects.', 'jsonld.TooManyRedirects', { code: 'loading document failed', url: url, httpStatusCode: res.statusCode, redirects: redirects }), doc); } if(redirects.indexOf(url) !== -1) { return callback(new JsonLdError( 'URL could not be dereferenced; infinite redirection was detected.', 'jsonld.InfiniteRedirectDetected', { code: 'recursive context inclusion', url: url, httpStatusCode: res.statusCode, redirects: redirects }), doc); } redirects.push(url); return loadDocument(res.headers.location, redirects, callback); } // cache for each redirected URL redirects.push(url); for(var i = 0; i < redirects.length; ++i) { cache.set( redirects[i], {contextUrl: null, documentUrl: redirects[i], document: body}); } callback(err, doc); }); } var loader = function(url, callback) { loadDocument(url, [], callback); }; if(options.usePromise) { return function(url) { return jsonld.promisify(loader, url); }; } return loader; }; /** * Creates a built-in XMLHttpRequest document loader. * * @param options the options to use: * secure: require all URLs to use HTTPS. * usePromise: true to use a promises API, false for a * callback-continuation-style API; defaults to true if Promise * is globally defined, false if not. * [xhr]: the XMLHttpRequest API to use. * * @return the XMLHttpRequest document loader. */ jsonld.documentLoaders.xhr = function(options) { var rlink = /(^|(\r\n))link:/i; options = options || {}; var cache = new jsonld.DocumentCache(); var loader = function(url, callback) { if(options.secure && url.indexOf('https') !== 0) { return callback(new JsonLdError( 'URL could not be dereferenced; secure mode is enabled and ' + 'the URL\'s scheme is not "https".', 'jsonld.InvalidUrl', {code: 'loading document failed', url: url}), {contextUrl: null, documentUrl: url, document: null}); } var doc = cache.get(url); if(doc !== null) { return callback(null, doc); } var xhr = options.xhr || XMLHttpRequest; var req = new xhr(); req.onload = function(e) { if(req.status >= 400) { return callback(new JsonLdError( 'URL could not be dereferenced: ' + req.statusText, 'jsonld.LoadDocumentError', { code: 'loading document failed', url: url, httpStatusCode: req.status }), {contextUrl: null, documentUrl: url, document: null}); } var doc = {contextUrl: null, documentUrl: url, document: req.response}; // handle Link Header (avoid unsafe header warning by existence testing) var contentType = req.getResponseHeader('Content-Type'); var linkHeader; if(rlink.test(req.getAllResponseHeaders())) { linkHeader = req.getResponseHeader('Link'); } if(linkHeader && contentType !== 'application/ld+json') { // only 1 related link header permitted linkHeader = jsonld.parseLinkHeader(linkHeader)[LINK_HEADER_REL]; if(_isArray(linkHeader)) { return callback(new JsonLdError( 'URL could not be dereferenced, it has more than one ' + 'associated HTTP Link Header.', 'jsonld.InvalidUrl', {code: 'multiple context link headers', url: url}), doc); } if(linkHeader) { doc.contextUrl = linkHeader.target; } } cache.set(url, doc); callback(null, doc); }; req.onerror = function() { callback(new JsonLdError( 'URL could not be dereferenced, an error occurred.', 'jsonld.LoadDocumentError', {code: 'loading document failed', url: url}), {contextUrl: null, documentUrl: url, document: null}); }; req.open('GET', url, true); req.setRequestHeader('Accept', 'application/ld+json, application/json'); req.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); req.send(); }; var usePromise = (typeof Promise !== 'undefined'); if('usePromise' in options) { usePromise = options.usePromise; } if(usePromise) { return function(url) { return jsonld.promisify(loader, url); }; } return loader; }; /** * Assigns the default document loader for external document URLs to a built-in * default. Supported types currently include: 'jquery' and 'node'. * * To use the jquery document loader, the first parameter must be a reference * to the main jquery object. * * @param type the type to set. * @param [params] the parameters required to use the document loader. */ jsonld.useDocumentLoader = function(type) { if(!(type in jsonld.documentLoaders)) { throw new JsonLdError( 'Unknown document loader type: "' + type + '"', 'jsonld.UnknownDocumentLoader', {type: type}); } // set document loader jsonld.documentLoader = jsonld.documentLoaders[type].apply( jsonld, Array.prototype.slice.call(arguments, 1)); }; /** * Processes a local context, resolving any URLs as necessary, and returns a * new active context in its callback. * * @param activeCtx the current active context. * @param localCtx the local context to process. * @param [options] the options to use: * [documentLoader(url, callback(err, remoteDoc))] the document loader. * @param callback(err, ctx) called once the operation completes. */ jsonld.processContext = function(activeCtx, localCtx) { // get arguments var options = {}; var callbackArg = 2; if(arguments.length > 3) { options = arguments[2] || {}; callbackArg += 1; } var callback = arguments[callbackArg]; // set default options if(!('base' in options)) { options.base = ''; } if(!('documentLoader' in options)) { options.documentLoader = jsonld.loadDocument; } // return initial context early for null context if(localCtx === null) { return callback(null, _getInitialContext(options)); } // retrieve URLs in localCtx localCtx = _clone(localCtx); if(!(_isObject(localCtx) && '@context' in localCtx)) { localCtx = {'@context': localCtx}; } _retrieveContextUrls(localCtx, options, function(err, ctx) { if(err) { return callback(err); } try { // process context ctx = new Processor().processContext(activeCtx, ctx, options); } catch(ex) { return callback(ex); } callback(null, ctx); }); }; /** * Returns true if the given subject has the given property. * * @param subject the subject to check. * @param property the property to look for. * * @return true if the subject has the given property, false if not. */ jsonld.hasProperty = function(subject, property) { var rval = false; if(property in subject) { var value = subject[property]; rval = (!_isArray(value) || value.length > 0); } return rval; }; /** * Determines if the given value is a property of the given subject. * * @param subject the subject to check. * @param property the property to check. * @param value the value to check. * * @return true if the value exists, false if not. */ jsonld.hasValue = function(subject, property, value) { var rval = false; if(jsonld.hasProperty(subject, property)) { var val = subject[property]; var isList = _isList(val); if(_isArray(val) || isList) { if(isList) { val = val['@list']; } for(var i = 0; i < val.length; ++i) { if(jsonld.compareValues(value, val[i])) { rval = true; break; } } } // avoid matching the set of values with an array value parameter else if(!_isArray(value)) { rval = jsonld.compareValues(value, val); } } return rval; }; /** * Adds a value to a subject. If the value is an array, all values in the * array will be added. * * @param subject the subject to add the value to. * @param property the property that relates the value to the subject. * @param value the value to add. * @param [options] the options to use: * [propertyIsArray] true if the property is always an array, false * if not (default: false). * [allowDuplicate] true to allow duplicates, false not to (uses a * simple shallow comparison of subject ID or value) (default: true). */ jsonld.addValue = function(subject, property, value, options) { options = options || {}; if(!('propertyIsArray' in options)) { options.propertyIsArray = false; } if(!('allowDuplicate' in options)) { options.allowDuplicate = true; } if(_isArray(value)) { if(value.length === 0 && options.propertyIsArray && !(property in subject)) { subject[property] = []; } for(var i = 0; i < value.length; ++i) { jsonld.addValue(subject, property, value[i], options); } } else if(property in subject) { // check if subject already has value if duplicates not allowed var hasValue = (!options.allowDuplicate && jsonld.hasValue(subject, property, value)); // make property an array if value not present or always an array if(!_isArray(subject[property]) && (!hasValue || options.propertyIsArray)) { subject[property] = [subject[property]]; } // add new value if(!hasValue) { subject[property].push(value); } } else { // add new value as set or single value subject[property] = options.propertyIsArray ? [value] : value; } }; /** * Gets all of the values for a subject's property as an array. * * @param subject the subject. * @param property the property. * * @return all of the values for a subject's property as an array. */ jsonld.getValues = function(subject, property) { var rval = subject[property] || []; if(!_isArray(rval)) { rval = [rval]; } return rval; }; /** * Removes a property from a subject. * * @param subject the subject. * @param property the property. */ jsonld.removeProperty = function(subject, property) { delete subject[property]; }; /** * Removes a value from a subject. * * @param subject the subject. * @param property the property that relates the value to the subject. * @param value the value to remove. * @param [options] the options to use: * [propertyIsArray] true if the property is always an array, false * if not (default: false). */ jsonld.removeValue = function(subject, property, value, options) { options = options || {}; if(!('propertyIsArray' in options)) { options.propertyIsArray = false; } // filter out value var values = jsonld.getValues(subject, property).filter(function(e) { return !jsonld.compareValues(e, value); }); if(values.length === 0) { jsonld.removeProperty(subject, property); } else if(values.length === 1 && !options.propertyIsArray) { subject[property] = values[0]; } else { subject[property] = values; } }; /** * Compares two JSON-LD values for equality. Two JSON-LD values will be * considered equal if: * * 1. They are both primitives of the same type and value. * 2. They are both @values with the same @value, @type, @language, * and @index, OR * 3. They both have @ids they are the same. * * @param v1 the first value. * @param v2 the second value. * * @return true if v1 and v2 are considered equal, false if not. */ jsonld.compareValues = function(v1, v2) { // 1. equal primitives if(v1 === v2) { return true; } // 2. equal @values if(_isValue(v1) && _isValue(v2) && v1['@value'] === v2['@value'] && v1['@type'] === v2['@type'] && v1['@language'] === v2['@language'] && v1['@index'] === v2['@index']) { return true; } // 3. equal @ids if(_isObject(v1) && ('@id' in v1) && _isObject(v2) && ('@id' in v2)) { return v1['@id'] === v2['@id']; } return false; }; /** * Gets the value for the given active context key and type, null if none is * set. * * @param ctx the active context. * @param key the context key. * @param [type] the type of value to get (eg: '@id', '@type'), if not * specified gets the entire entry for a key, null if not found. * * @return the value. */ jsonld.getContextValue = function(ctx, key, type) { var rval = null; // return null for invalid key if(key === null) { return rval; } // get default language if(type === '@language' && (type in ctx)) { rval = ctx[type]; } // get specific entry information if(ctx.mappings[key]) { var entry = ctx.mappings[key]; // return whole entry if(_isUndefined(type)) { rval = entry; } // return entry value for type else if(type in entry) { rval = entry[type]; } } return rval; }; /** Registered RDF dataset parsers hashed by content-type. */ var _rdfParsers = {}; /** * Registers an RDF dataset parser by content-type, for use with * jsonld.fromRDF. An RDF dataset parser will always be given two parameters, * a string of input and a callback. An RDF dataset parser can be synchronous * or asynchronous. * * If the parser function returns undefined or null then it will be assumed to * be asynchronous w/a continuation-passing style and the callback parameter * given to the parser MUST be invoked. * * If it returns a Promise, then it will be assumed to be asynchronous, but the * callback parameter MUST NOT be invoked. It should instead be ignored. * * If it returns an RDF dataset, it will be assumed to be synchronous and the * callback parameter MUST NOT be invoked. It should instead be ignored. * * @param contentType the content-type for the parser. * @param parser(input, callback(err, dataset)) the parser function (takes a * string as a parameter and either returns null/undefined and uses * the given callback, returns a Promise, or returns an RDF dataset). */ jsonld.registerRDFParser = function(contentType, parser) { _rdfParsers[contentType] = parser; }; /** * Unregisters an RDF dataset parser by content-type. * * @param contentType the content-type for the parser. */ jsonld.unregisterRDFParser = function(contentType) { delete _rdfParsers[contentType]; }; if(_nodejs) { // needed for serialization of XML literals if(typeof XMLSerializer === 'undefined') { var XMLSerializer = null; } if(typeof Node === 'undefined') { var Node = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE:12 }; } } // constants var XSD_BOOLEAN = 'http://www.w3.org/2001/XMLSchema#boolean'; var XSD_DOUBLE = 'http://www.w3.org/2001/XMLSchema#double'; var XSD_INTEGER = 'http://www.w3.org/2001/XMLSchema#integer'; var XSD_STRING = 'http://www.w3.org/2001/XMLSchema#string'; var RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; var RDF_LIST = RDF + 'List'; var RDF_FIRST = RDF + 'first'; var RDF_REST = RDF + 'rest'; var RDF_NIL = RDF + 'nil'; var RDF_TYPE = RDF + 'type'; var RDF_PLAIN_LITERAL = RDF + 'PlainLiteral'; var RDF_XML_LITERAL = RDF + 'XMLLiteral'; var RDF_OBJECT = RDF + 'object'; var RDF_LANGSTRING = RDF + 'langString'; var LINK_HEADER_REL = 'http://www.w3.org/ns/json-ld#context'; var MAX_CONTEXT_URLS = 10; /** * A JSON-LD Error. * * @param msg the error message. * @param type the error type. * @param details the error details. */ var JsonLdError = function(msg, type, details) { if(_nodejs) { Error.call(this); Error.captureStackTrace(this, this.constructor); } this.name = type || 'jsonld.Error'; this.message = msg || 'An unspecified JSON-LD error occurred.'; this.details = details || {}; }; if(_nodejs) { require('util').inherits(JsonLdError, Error); } /** * Constructs a new JSON-LD Processor. */ var Processor = function() {}; /** * Recursively compacts an element using the given active context. All values * must be in expanded form before this method is called. * * @param activeCtx the active context to use. * @param activeProperty the compacted property associated with the element * to compact, null for none. * @param element the element to compact. * @param options the compaction options. * * @return the compacted value. */ Processor.prototype.compact = function( activeCtx, activeProperty, element, options) { // recursively compact array if(_isArray(element)) { var rval = []; for(var i = 0; i < element.length; ++i) { // compact, dropping any null values var compacted = this.compact( activeCtx, activeProperty, element[i], options); if(compacted !== null) { rval.push(compacted); } } if(options.compactArrays && rval.length === 1) { // use single element if no container is specified var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); if(container === null) { rval = rval[0]; } } return rval; } // recursively compact object if(_isObject(element)) { // do value compaction on @values and subject references if(_isValue(element) || _isSubjectReference(element)) { return _compactValue(activeCtx, activeProperty, element); } // FIXME: avoid misuse of active property as an expanded property? var insideReverse = (activeProperty === '@reverse'); // process element keys in order var keys = Object.keys(element).sort(); var rval = {}; for(var ki = 0; ki < keys.length; ++ki) { var expandedProperty = keys[ki]; var expandedValue = element[expandedProperty]; // compact @id and @type(s) if(expandedProperty === '@id' || expandedProperty === '@type') { var compactedValue; // compact single @id if(_isString(expandedValue)) { compactedValue = _compactIri( activeCtx, expandedValue, null, {vocab: (expandedProperty === '@type')}); } // expanded value must be a @type array else { compactedValue = []; for(var vi = 0; vi < expandedValue.length; ++vi) { compactedValue.push(_compactIri( activeCtx, expandedValue[vi], null, {vocab: true})); } } // use keyword alias and add value var alias = _compactIri(activeCtx, expandedProperty); var isArray = (_isArray(compactedValue) && expandedValue.length === 0); jsonld.addValue( rval, alias, compactedValue, {propertyIsArray: isArray}); continue; } // handle @reverse if(expandedProperty === '@reverse') { // recursively compact expanded value var compactedValue = this.compact( activeCtx, '@reverse', expandedValue, options); // handle double-reversed properties for(var compactedProperty in compactedValue) { if(activeCtx.mappings[compactedProperty] && activeCtx.mappings[compactedProperty].reverse) { var value = compactedValue[compactedProperty]; var container = jsonld.getContextValue( activeCtx, compactedProperty, '@container'); var useArray = (container === '@set' || !options.compactArrays); jsonld.addValue( rval, compactedProperty, value, {propertyIsArray: useArray}); delete compactedValue[compactedProperty]; } } if(Object.keys(compactedValue).length > 0) { // use keyword alias and add value var alias = _compactIri(activeCtx, expandedProperty); jsonld.addValue(rval, alias, compactedValue); } continue; } // handle @index property if(expandedProperty === '@index') { // drop @index if inside an @index container var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); if(container === '@index') { continue; } // use keyword alias and add value var alias = _compactIri(activeCtx, expandedProperty); jsonld.addValue(rval, alias, expandedValue); continue; } // Note: expanded value must be an array due to expansion algorithm. // preserve empty arrays if(expandedValue.length === 0) { var itemActiveProperty = _compactIri( activeCtx, expandedProperty, expandedValue, {vocab: true}, insideReverse); jsonld.addValue( rval, itemActiveProperty, expandedValue, {propertyIsArray: true}); } // recusively process array values for(var vi = 0; vi < expandedValue.length; ++vi) { var expandedItem = expandedValue[vi]; // compact property and get container type var itemActiveProperty = _compactIri( activeCtx, expandedProperty, expandedItem, {vocab: true}, insideReverse); var container = jsonld.getContextValue( activeCtx, itemActiveProperty, '@container'); // get @list value if appropriate var isList = _isList(expandedItem); var list = null; if(isList) { list = expandedItem['@list']; } // recursively compact expanded item var compactedItem = this.compact( activeCtx, itemActiveProperty, isList ? list : expandedItem, options); // handle @list if(isList) { // ensure @list value is an array if(!_isArray(compactedItem)) { compactedItem = [compactedItem]; } if(container !== '@list') { // wrap using @list alias var wrapper = {}; wrapper[_compactIri(activeCtx, '@list')] = compactedItem; compactedItem = wrapper; // include @index from expanded @list, if any if('@index' in expandedItem) { compactedItem[_compactIri(activeCtx, '@index')] = expandedItem['@index']; } } // can't use @list container for more than 1 list else if(itemActiveProperty in rval) { throw new JsonLdError( 'JSON-LD compact error; property has a "@list" @container ' + 'rule but there is more than a single @list that matches ' + 'the compacted term in the document. Compaction might mix ' + 'unwanted items into the list.', 'jsonld.SyntaxError', {code: 'compaction to list of lists'}); } } // handle language and index maps if(container === '@language' || container === '@index') { // get or create the map object var mapObject; if(itemActiveProperty in rval) { mapObject = rval[itemActiveProperty]; } else { rval[itemActiveProperty] = mapObject = {}; } // if container is a language map, simplify compacted value to // a simple string if(container === '@language' && _isValue(compactedItem)) { compactedItem = compactedItem['@value']; } // add compact value to map object using key from expanded value // based on the container type jsonld.addValue(mapObject, expandedItem[container], compactedItem); } else { // use an array if: compactArrays flag is false, // @container is @set or @list , value is an empty // array, or key is @graph var isArray = (!options.compactArrays || container === '@set' || container === '@list' || (_isArray(compactedItem) && compactedItem.length === 0) || expandedProperty === '@list' || expandedProperty === '@graph'); // add compact value jsonld.addValue( rval, itemActiveProperty, compactedItem, {propertyIsArray: isArray}); } } } return rval; } // only primitives remain which are already compact return element; }; /** * Recursively expands an element using the given context. Any context in * the element will be removed. All context URLs must have been retrieved * before calling this method. * * @param activeCtx the context to use. * @param activeProperty the property for the element, null for none. * @param element the element to expand. * @param options the expansion options. * @param insideList true if the element is a list, false if not. * * @return the expanded value. */ Processor.prototype.expand = function( activeCtx, activeProperty, element, options, insideList) { var self = this; // nothing to expand if(element === null || element === undefined) { return null; } if(!_isArray(element) && !_isObject(element)) { // drop free-floating scalars that are not in lists if(!insideList && (activeProperty === null || _expandIri(activeCtx, activeProperty, {vocab: true}) === '@graph')) { return null; } // expand element according to value expansion rules return _expandValue(activeCtx, activeProperty, element); } // recursively expand array if(_isArray(element)) { var rval = []; var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); insideList = insideList || container === '@list'; for(var i = 0; i < element.length; ++i) { // expand element var e = self.expand(activeCtx, activeProperty, element[i], options); if(insideList && (_isArray(e) || _isList(e))) { // lists of lists are illegal throw new JsonLdError( 'Invalid JSON-LD syntax; lists of lists are not permitted.', 'jsonld.SyntaxError', {code: 'list of lists'}); } // drop null values if(e !== null) { if(_isArray(e)) { rval = rval.concat(e); } else { rval.push(e); } } } return rval; } // recursively expand object: // if element has a context, process it if('@context' in element) { activeCtx = self.processContext(activeCtx, element['@context'], options); } // expand the active property var expandedActiveProperty = _expandIri( activeCtx, activeProperty, {vocab: true}); var rval = {}; var keys = Object.keys(element).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; var value = element[key]; var expandedValue; // skip @context if(key === '@context') { continue; } // expand property var expandedProperty = _expandIri(activeCtx, key, {vocab: true}); // drop non-absolute IRI keys that aren't keywords if(expandedProperty === null || !(_isAbsoluteIri(expandedProperty) || _isKeyword(expandedProperty))) { continue; } if(_isKeyword(expandedProperty)) { if(expandedActiveProperty === '@reverse') { throw new JsonLdError( 'Invalid JSON-LD syntax; a keyword cannot be used as a @reverse ' + 'property.', 'jsonld.SyntaxError', {code: 'invalid reverse property map', value: value}); } if(expandedProperty in rval) { throw new JsonLdError( 'Invalid JSON-LD syntax; colliding keywords detected.', 'jsonld.SyntaxError', {code: 'colliding keywords', keyword: expandedProperty}); } } // syntax error if @id is not a string if(expandedProperty === '@id' && !_isString(value)) { if(!options.isFrame) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@id" value must a string.', 'jsonld.SyntaxError', {code: 'invalid @id value', value: value}); } if(!_isObject(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@id" value must be a string or an ' + 'object.', 'jsonld.SyntaxError', {code: 'invalid @id value', value: value}); } } if(expandedProperty === '@type') { _validateTypeValue(value); } // @graph must be an array or an object if(expandedProperty === '@graph' && !(_isObject(value) || _isArray(value))) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@graph" value must not be an ' + 'object or an array.', 'jsonld.SyntaxError', {code: 'invalid @graph value', value: value}); } // @value must not be an object or an array if(expandedProperty === '@value' && (_isObject(value) || _isArray(value))) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@value" value must not be an ' + 'object or an array.', 'jsonld.SyntaxError', {code: 'invalid value object value', value: value}); } // @language must be a string if(expandedProperty === '@language') { if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@language" value must be a string.', 'jsonld.SyntaxError', {code: 'invalid language-tagged string', value: value}); } // ensure language value is lowercase value = value.toLowerCase(); } // @index must be a string if(expandedProperty === '@index') { if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@index" value must be a string.', 'jsonld.SyntaxError', {code: 'invalid @index value', value: value}); } } // @reverse must be an object if(expandedProperty === '@reverse') { if(!_isObject(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@reverse" value must be an object.', 'jsonld.SyntaxError', {code: 'invalid @reverse value', value: value}); } expandedValue = self.expand(activeCtx, '@reverse', value, options); // properties double-reversed if('@reverse' in expandedValue) { for(var property in expandedValue['@reverse']) { jsonld.addValue( rval, property, expandedValue['@reverse'][property], {propertyIsArray: true}); } } // FIXME: can this be merged with code below to simplify? // merge in all reversed properties var reverseMap = rval['@reverse'] || null; for(var property in expandedValue) { if(property === '@reverse') { continue; } if(reverseMap === null) { reverseMap = rval['@reverse'] = {}; } jsonld.addValue(reverseMap, property, [], {propertyIsArray: true}); var items = expandedValue[property]; for(var ii = 0; ii < items.length; ++ii) { var item = items[ii]; if(_isValue(item) || _isList(item)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@reverse" value must not be a ' + '@value or an @list.', 'jsonld.SyntaxError', {code: 'invalid reverse property value', value: expandedValue}); } jsonld.addValue( reverseMap, property, item, {propertyIsArray: true}); } } continue; } var container = jsonld.getContextValue(activeCtx, key, '@container'); // handle language map container (skip if value is not an object) if(container === '@language' && _isObject(value)) { expandedValue = _expandLanguageMap(value); } // handle index container (skip if value is not an object) else if(container === '@index' && _isObject(value)) { expandedValue = (function _expandIndexMap(activeProperty) { var rval = []; var keys = Object.keys(value).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; var val = value[key]; if(!_isArray(val)) { val = [val]; } val = self.expand(activeCtx, activeProperty, val, options, false); for(var vi = 0; vi < val.length; ++vi) { var item = val[vi]; if(!('@index' in item)) { item['@index'] = key; } rval.push(item); } } return rval; })(key); } else { // recurse into @list or @set var isList = (expandedProperty === '@list'); if(isList || expandedProperty === '@set') { var nextActiveProperty = activeProperty; if(isList && expandedActiveProperty === '@graph') { nextActiveProperty = null; } expandedValue = self.expand( activeCtx, nextActiveProperty, value, options, isList); if(isList && _isList(expandedValue)) { throw new JsonLdError( 'Invalid JSON-LD syntax; lists of lists are not permitted.', 'jsonld.SyntaxError', {code: 'list of lists'}); } } else { // recursively expand value with key as new active property expandedValue = self.expand(activeCtx, key, value, options, false); } } // drop null values if property is not @value if(expandedValue === null && expandedProperty !== '@value') { continue; } // convert expanded value to @list if container specifies it if(expandedProperty !== '@list' && !_isList(expandedValue) && container === '@list') { // ensure expanded value is an array expandedValue = (_isArray(expandedValue) ? expandedValue : [expandedValue]); expandedValue = {'@list': expandedValue}; } // FIXME: can this be merged with code above to simplify? // merge in reverse properties if(activeCtx.mappings[key] && activeCtx.mappings[key].reverse) { var reverseMap = rval['@reverse'] = {}; if(!_isArray(expandedValue)) { expandedValue = [expandedValue]; } for(var ii = 0; ii < expandedValue.length; ++ii) { var item = expandedValue[ii]; if(_isValue(item) || _isList(item)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@reverse" value must not be a ' + '@value or an @list.', 'jsonld.SyntaxError', {code: 'invalid reverse property value', value: expandedValue}); } jsonld.addValue( reverseMap, expandedProperty, item, {propertyIsArray: true}); } continue; } // add value for property // use an array except for certain keywords var useArray = ['@index', '@id', '@type', '@value', '@language'].indexOf( expandedProperty) === -1; jsonld.addValue( rval, expandedProperty, expandedValue, {propertyIsArray: useArray}); } // get property count on expanded output keys = Object.keys(rval); var count = keys.length; if('@value' in rval) { // @value must only have @language or @type if('@type' in rval && '@language' in rval) { throw new JsonLdError( 'Invalid JSON-LD syntax; an element containing "@value" may not ' + 'contain both "@type" and "@language".', 'jsonld.SyntaxError', {code: 'invalid value object', element: rval}); } var validCount = count - 1; if('@type' in rval) { validCount -= 1; } if('@index' in rval) { validCount -= 1; } if('@language' in rval) { validCount -= 1; } if(validCount !== 0) { throw new JsonLdError( 'Invalid JSON-LD syntax; an element containing "@value" may only ' + 'have an "@index" property and at most one other property ' + 'which can be "@type" or "@language".', 'jsonld.SyntaxError', {code: 'invalid value object', element: rval}); } // drop null @values if(rval['@value'] === null) { rval = null; } // if @language is present, @value must be a string else if('@language' in rval && !_isString(rval['@value'])) { throw new JsonLdError( 'Invalid JSON-LD syntax; only strings may be language-tagged.', 'jsonld.SyntaxError', {code: 'invalid language-tagged value', element: rval}); } else if('@type' in rval && (!_isAbsoluteIri(rval['@type']) || rval['@type'].indexOf('_:') === 0)) { throw new JsonLdError( 'Invalid JSON-LD syntax; an element containing "@value" and "@type" ' + 'must have an absolute IRI for the value of "@type".', 'jsonld.SyntaxError', {code: 'invalid typed value', element: rval}); } } // convert @type to an array else if('@type' in rval && !_isArray(rval['@type'])) { rval['@type'] = [rval['@type']]; } // handle @set and @list else if('@set' in rval || '@list' in rval) { if(count > 1 && !(count === 2 && '@index' in rval)) { throw new JsonLdError( 'Invalid JSON-LD syntax; if an element has the property "@set" ' + 'or "@list", then it can have at most one other property that is ' + '"@index".', 'jsonld.SyntaxError', {code: 'invalid set or list object', element: rval}); } // optimize away @set if('@set' in rval) { rval = rval['@set']; keys = Object.keys(rval); count = keys.length; } } // drop objects with only @language else if(count === 1 && '@language' in rval) { rval = null; } // drop certain top-level objects that do not occur in lists if(_isObject(rval) && !options.keepFreeFloatingNodes && !insideList && (activeProperty === null || expandedActiveProperty === '@graph')) { // drop empty object, top-level @value/@list, or object with only @id if(count === 0 || '@value' in rval || '@list' in rval || (count === 1 && '@id' in rval)) { rval = null; } } return rval; }; /** * Performs JSON-LD flattening. * * @param input the expanded JSON-LD to flatten. * * @return the flattened output. */ Processor.prototype.flatten = function(input) { // produce a map of all subjects and name each bnode var namer = new UniqueNamer('_:b'); var graphs = {'@default': {}}; _createNodeMap(input, graphs, '@default', namer); // add all non-default graphs to default graph var defaultGraph = graphs['@default']; var graphNames = Object.keys(graphs).sort(); for(var i = 0; i < graphNames.length; ++i) { var graphName = graphNames[i]; if(graphName === '@default') { continue; } var nodeMap = graphs[graphName]; var subject = defaultGraph[graphName]; if(!subject) { defaultGraph[graphName] = subject = { '@id': graphName, '@graph': [] }; } else if(!('@graph' in subject)) { subject['@graph'] = []; } var graph = subject['@graph']; var ids = Object.keys(nodeMap).sort(); for(var ii = 0; ii < ids.length; ++ii) { var node = nodeMap[ids[ii]]; // only add full subjects if(!_isSubjectReference(node)) { graph.push(node); } } } // produce flattened output var flattened = []; var keys = Object.keys(defaultGraph).sort(); for(var ki = 0; ki < keys.length; ++ki) { var node = defaultGraph[keys[ki]]; // only add full subjects to top-level if(!_isSubjectReference(node)) { flattened.push(node); } } return flattened; }; /** * Performs JSON-LD framing. * * @param input the expanded JSON-LD to frame. * @param frame the expanded JSON-LD frame to use. * @param options the framing options. * * @return the framed output. */ Processor.prototype.frame = function(input, frame, options) { // create framing state var state = { options: options, graphs: {'@default': {}, '@merged': {}} }; // produce a map of all graphs and name each bnode // FIXME: currently uses subjects from @merged graph only var namer = new UniqueNamer('_:b'); _createNodeMap(input, state.graphs, '@merged', namer); state.subjects = state.graphs['@merged']; // frame the subjects var framed = []; _frame(state, Object.keys(state.subjects).sort(), frame, framed, null); return framed; }; /** * Performs normalization on the given RDF dataset. * * @param dataset the RDF dataset to normalize. * @param options the normalization options. * @param callback(err, normalized) called once the operation completes. */ Processor.prototype.normalize = function(dataset, options, callback) { // create quads and map bnodes to their associated quads var quads = []; var bnodes = {}; for(var graphName in dataset) { var triples = dataset[graphName]; if(graphName === '@default') { graphName = null; } for(var ti = 0; ti < triples.length; ++ti) { var quad = triples[ti]; if(graphName !== null) { if(graphName.indexOf('_:') === 0) { quad.name = {type: 'blank node', value: graphName}; } else { quad.name = {type: 'IRI', value: graphName}; } } quads.push(quad); var attrs = ['subject', 'object', 'name']; for(var ai = 0; ai < attrs.length; ++ai) { var attr = attrs[ai]; if(quad[attr] && quad[attr].type === 'blank node') { var id = quad[attr].value; if(id in bnodes) { bnodes[id].quads.push(quad); } else { bnodes[id] = {quads: [quad]}; } } } } } // mapping complete, start canonical naming var namer = new UniqueNamer('_:c14n'); return hashBlankNodes(Object.keys(bnodes)); // generates unique and duplicate hashes for bnodes function hashBlankNodes(unnamed) { var nextUnnamed = []; var duplicates = {}; var unique = {}; // hash quads for each unnamed bnode jsonld.setImmediate(function() {hashUnnamed(0);}); function hashUnnamed(i) { if(i === unnamed.length) { // done, name blank nodes return nameBlankNodes(unique, duplicates, nextUnnamed); } // hash unnamed bnode var bnode = unnamed[i]; var hash = _hashQuads(bnode, bnodes, namer); // store hash as unique or a duplicate if(hash in duplicates) { duplicates[hash].push(bnode); nextUnnamed.push(bnode); } else if(hash in unique) { duplicates[hash] = [unique[hash], bnode]; nextUnnamed.push(unique[hash]); nextUnnamed.push(bnode); delete unique[hash]; } else { unique[hash] = bnode; } // hash next unnamed bnode jsonld.setImmediate(function() {hashUnnamed(i + 1);}); } } // names unique hash bnodes function nameBlankNodes(unique, duplicates, unnamed) { // name unique bnodes in sorted hash order var named = false; var hashes = Object.keys(unique).sort(); for(var i = 0; i < hashes.length; ++i) { var bnode = unique[hashes[i]]; namer.getName(bnode); named = true; } // continue to hash bnodes if a bnode was assigned a name if(named) { hashBlankNodes(unnamed); } // name the duplicate hash bnodes else { nameDuplicates(duplicates); } } // names duplicate hash bnodes function nameDuplicates(duplicates) { // enumerate duplicate hash groups in sorted order var hashes = Object.keys(duplicates).sort(); // process each group processGroup(0); function processGroup(i) { if(i === hashes.length) { // done, create JSON-LD array return createArray(); } // name each group member var group = duplicates[hashes[i]]; var results = []; nameGroupMember(group, 0); function nameGroupMember(group, n) { if(n === group.length) { // name bnodes in hash order results.sort(function(a, b) { a = a.hash; b = b.hash; return (a < b) ? -1 : ((a > b) ? 1 : 0); }); for(var r in results) { // name all bnodes in path namer in key-entry order // Note: key-order is preserved in javascript for(var key in results[r].pathNamer.existing) { namer.getName(key); } } return processGroup(i + 1); } // skip already-named bnodes var bnode = group[n]; if(namer.isNamed(bnode)) { return nameGroupMember(group, n + 1); } // hash bnode paths var pathNamer = new UniqueNamer('_:b'); pathNamer.getName(bnode); _hashPaths(bnode, bnodes, namer, pathNamer, function(err, result) { if(err) { return callback(err); } results.push(result); nameGroupMember(group, n + 1); }); } } } // creates the sorted array of RDF quads function createArray() { var normalized = []; /* Note: At this point all bnodes in the set of RDF quads have been assigned canonical names, which have been stored in the 'namer' object. Here each quad is updated by assigning each of its bnodes its new name via the 'namer' object. */ // update bnode names in each quad and serialize for(var i = 0; i < quads.length; ++i) { var quad = quads[i]; var attrs = ['subject', 'object', 'name']; for(var ai = 0; ai < attrs.length; ++ai) { var attr = attrs[ai]; if(quad[attr] && quad[attr].type === 'blank node' && quad[attr].value.indexOf('_:c14n') !== 0) { quad[attr].value = namer.getName(quad[attr].value); } } normalized.push(_toNQuad(quad, quad.name ? quad.name.value : null)); } // sort normalized output normalized.sort(); // handle output format if(options.format) { if(options.format === 'application/nquads') { return callback(null, normalized.join('')); } return callback(new JsonLdError( 'Unknown output format.', 'jsonld.UnknownFormat', {format: options.format})); } // output RDF dataset callback(null, _parseNQuads(normalized.join(''))); } }; /** * Converts an RDF dataset to JSON-LD. * * @param dataset the RDF dataset. * @param options the RDF serialization options. * @param callback(err, output) called once the operation completes. */ Processor.prototype.fromRDF = function(dataset, options, callback) { var defaultGraph = {}; var graphMap = {'@default': defaultGraph}; for(var name in dataset) { var graph = dataset[name]; if(!(name in graphMap)) { graphMap[name] = {}; } if(name !== '@default' && !(name in defaultGraph)) { defaultGraph[name] = {'@id': name}; } var nodeMap = graphMap[name]; for(var ti = 0; ti < graph.length; ++ti) { var triple = graph[ti]; // get subject, predicate, object var s = triple.subject.value; var p = triple.predicate.value; var o = triple.object; if(!(s in nodeMap)) { nodeMap[s] = {'@id': s}; } var node = nodeMap[s]; var objectIsId = (o.type === 'IRI' || o.type === 'blank node'); if(objectIsId && !(o.value in nodeMap)) { nodeMap[o.value] = {'@id': o.value}; } if(p === RDF_TYPE && !options.useRdfType && objectIsId) { jsonld.addValue(node, '@type', o.value, {propertyIsArray: true}); continue; } var value = _RDFToObject(o, options.useNativeTypes); jsonld.addValue(node, p, value, {propertyIsArray: true}); // object may be an RDF list/partial list node but we can't know easily // until all triples are read if(objectIsId) { var object = nodeMap[o.value]; if(!('usages' in object)) { object.usages = []; } object.usages.push({ node: node, property: p, value: value }); } } } // convert linked lists to @list arrays for(var name in graphMap) { var graphObject = graphMap[name]; // no @lists to be converted, continue if(!(RDF_NIL in graphObject)) { continue; } // iterate backwards through each RDF list var nil = graphObject[RDF_NIL]; for(var i = 0; i < nil.usages.length; ++i) { var usage = nil.usages[i]; var node = usage.node; var property = usage.property; var head = usage.value; var list = []; var listNodes = []; // ensure node is a well-formed list node; it must: // 1. Be used only once in a list. // 2. Have an array for rdf:first that has 1 item. // 3. Have an array for rdf:rest that has 1 item. // 4. Have no keys other than: @id, usages, rdf:first, rdf:rest, and, // optionally, @type where the value is rdf:List. var nodeKeyCount = Object.keys(node).length; while(property === RDF_REST && node.usages.length === 1 && _isArray(node[RDF_FIRST]) && node[RDF_FIRST].length === 1 && _isArray(node[RDF_REST]) && node[RDF_REST].length === 1 && (nodeKeyCount === 4 || (nodeKeyCount === 5 && _isArray(node['@type']) && node['@type'].length === 1 && node['@type'][0] === RDF_LIST))) { list.push(node[RDF_FIRST][0]); listNodes.push(node['@id']); // get next node, moving backwards through list usage = node.usages[0]; node = usage.node; property = usage.property; head = usage.value; nodeKeyCount = Object.keys(node).length; // if node is not a blank node, then list head found if(node['@id'].indexOf('_:') !== 0) { break; } } // the list is nested in another list if(property === RDF_FIRST) { // empty list if(node['@id'] === RDF_NIL) { // can't convert rdf:nil to a @list object because it would // result in a list of lists which isn't supported continue; } // preserve list head head = graphObject[head['@id']][RDF_REST][0]; list.pop(); listNodes.pop(); } // transform list into @list object delete head['@id']; head['@list'] = list.reverse(); for(var j = 0; j < listNodes.length; ++j) { delete graphObject[listNodes[j]]; } } } var result = []; var subjects = Object.keys(defaultGraph).sort(); for(var i = 0; i < subjects.length; ++i) { var subject = subjects[i]; var node = defaultGraph[subject]; if(subject in graphMap) { var graph = node['@graph'] = []; var graphObject = graphMap[subject]; var subjects_ = Object.keys(graphObject).sort(); for(var si = 0; si < subjects_.length; ++si) { var node_ = graphObject[subjects_[si]]; delete node_.usages; // only add full subjects to top-level if(!_isSubjectReference(node_)) { graph.push(node_); } } } delete node.usages; // only add full subjects to top-level if(!_isSubjectReference(node)) { result.push(node); } } callback(null, result); }; /** * Outputs an RDF dataset for the expanded JSON-LD input. * * @param input the expanded JSON-LD input. * @param options the RDF serialization options. * * @return the RDF dataset. */ Processor.prototype.toRDF = function(input, options) { // create node map for default graph (and any named graphs) var namer = new UniqueNamer('_:b'); var nodeMap = {'@default': {}}; _createNodeMap(input, nodeMap, '@default', namer); var dataset = {}; var graphNames = Object.keys(nodeMap).sort(); for(var i = 0; i < graphNames.length; ++i) { var graphName = graphNames[i]; // skip relative IRIs if(graphName === '@default' || _isAbsoluteIri(graphName)) { dataset[graphName] = _graphToRDF(nodeMap[graphName], namer, options); } } return dataset; }; /** * Processes a local context and returns a new active context. * * @param activeCtx the current active context. * @param localCtx the local context to process. * @param options the context processing options. * * @return the new active context. */ Processor.prototype.processContext = function(activeCtx, localCtx, options) { // normalize local context to an array of @context objects if(_isObject(localCtx) && '@context' in localCtx && _isArray(localCtx['@context'])) { localCtx = localCtx['@context']; } var ctxs = _isArray(localCtx) ? localCtx : [localCtx]; // no contexts in array, clone existing context if(ctxs.length === 0) { return activeCtx.clone(); } // process each context in order var rval = activeCtx; var mustClone = true; for(var i = 0; i < ctxs.length; ++i) { var ctx = ctxs[i]; // reset to initial context if(ctx === null) { rval = _getInitialContext(options); mustClone = false; continue; } // dereference @context key if present if(_isObject(ctx) && '@context' in ctx) { ctx = ctx['@context']; } // context must be an object by now, all URLs retrieved before this call if(!_isObject(ctx)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context must be an object.', 'jsonld.SyntaxError', {code: 'invalid local context', context: ctx}); } // get context from cache if available if(jsonld.cache.activeCtx) { var cached = jsonld.cache.activeCtx.get(activeCtx, ctx); if(cached) { rval = cached; mustClone = true; continue; } } // clone context, if required, before updating if(mustClone) { rval = rval.clone(); mustClone = false; } // define context mappings for keys in local context var defined = {}; // handle @base if('@base' in ctx) { var base = ctx['@base']; // clear base if(base === null) { base = null; } else if(!_isString(base)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@base" in a ' + '@context must be a string or null.', 'jsonld.SyntaxError', {code: 'invalid base IRI', context: ctx}); } else if(base !== '' && !_isAbsoluteIri(base)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@base" in a ' + '@context must be an absolute IRI or the empty string.', 'jsonld.SyntaxError', {code: 'invalid base IRI', context: ctx}); } if(base !== null) { base = jsonld.url.parse(base || ''); } rval['@base'] = base; defined['@base'] = true; } // handle @vocab if('@vocab' in ctx) { var value = ctx['@vocab']; if(value === null) { delete rval['@vocab']; } else if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@vocab" in a ' + '@context must be a string or null.', 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx}); } else if(!_isAbsoluteIri(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@vocab" in a ' + '@context must be an absolute IRI.', 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx}); } else { rval['@vocab'] = value; } defined['@vocab'] = true; } // handle @language if('@language' in ctx) { var value = ctx['@language']; if(value === null) { delete rval['@language']; } else if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@language" in a ' + '@context must be a string or null.', 'jsonld.SyntaxError', {code: 'invalid default language', context: ctx}); } else { rval['@language'] = value.toLowerCase(); } defined['@language'] = true; } // process all other keys for(var key in ctx) { _createTermDefinition(rval, ctx, key, defined); } // cache result if(jsonld.cache.activeCtx) { jsonld.cache.activeCtx.set(activeCtx, ctx, rval); } } return rval; }; /** * Expands a language map. * * @param languageMap the language map to expand. * * @return the expanded language map. */ function _expandLanguageMap(languageMap) { var rval = []; var keys = Object.keys(languageMap).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; var val = languageMap[key]; if(!_isArray(val)) { val = [val]; } for(var vi = 0; vi < val.length; ++vi) { var item = val[vi]; if(!_isString(item)) { throw new JsonLdError( 'Invalid JSON-LD syntax; language map values must be strings.', 'jsonld.SyntaxError', {code: 'invalid language map value', languageMap: languageMap}); } rval.push({ '@value': item, '@language': key.toLowerCase() }); } } return rval; } /** * Labels the blank nodes in the given value using the given UniqueNamer. * * @param namer the UniqueNamer to use. * @param element the element with blank nodes to rename. * * @return the element. */ function _labelBlankNodes(namer, element) { if(_isArray(element)) { for(var i = 0; i < element.length; ++i) { element[i] = _labelBlankNodes(namer, element[i]); } } else if(_isList(element)) { element['@list'] = _labelBlankNodes(namer, element['@list']); } else if(_isObject(element)) { // rename blank node if(_isBlankNode(element)) { element['@id'] = namer.getName(element['@id']); } // recursively apply to all keys var keys = Object.keys(element).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; if(key !== '@id') { element[key] = _labelBlankNodes(namer, element[key]); } } } return element; } /** * Expands the given value by using the coercion and keyword rules in the * given context. * * @param activeCtx the active context to use. * @param activeProperty the active property the value is associated with. * @param value the value to expand. * * @return the expanded value. */ function _expandValue(activeCtx, activeProperty, value) { // nothing to expand if(value === null) { return null; } // special-case expand @id and @type (skips '@id' expansion) var expandedProperty = _expandIri(activeCtx, activeProperty, {vocab: true}); if(expandedProperty === '@id') { return _expandIri(activeCtx, value, {base: true}); } else if(expandedProperty === '@type') { return _expandIri(activeCtx, value, {vocab: true, base: true}); } // get type definition from context var type = jsonld.getContextValue(activeCtx, activeProperty, '@type'); // do @id expansion (automatic for @graph) if(type === '@id' || (expandedProperty === '@graph' && _isString(value))) { return {'@id': _expandIri(activeCtx, value, {base: true})}; } // do @id expansion w/vocab if(type === '@vocab') { return {'@id': _expandIri(activeCtx, value, {vocab: true, base: true})}; } // do not expand keyword values if(_isKeyword(expandedProperty)) { return value; } var rval = {}; // other type if(type !== null) { rval['@type'] = type; } // check for language tagging for strings else if(_isString(value)) { var language = jsonld.getContextValue( activeCtx, activeProperty, '@language'); if(language !== null) { rval['@language'] = language; } } rval['@value'] = value; return rval; } /** * Creates an array of RDF triples for the given graph. * * @param graph the graph to create RDF triples for. * @param namer a UniqueNamer for assigning blank node names. * @param options the RDF serialization options. * * @return the array of RDF triples for the given graph. */ function _graphToRDF(graph, namer, options) { var rval = []; var ids = Object.keys(graph).sort(); for(var i = 0; i < ids.length; ++i) { var id = ids[i]; var node = graph[id]; var properties = Object.keys(node).sort(); for(var pi = 0; pi < properties.length; ++pi) { var property = properties[pi]; var items = node[property]; if(property === '@type') { property = RDF_TYPE; } else if(_isKeyword(property)) { continue; } for(var ii = 0; ii < items.length; ++ii) { var item = items[ii]; // RDF subject var subject = {}; subject.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI'; subject.value = id; // skip relative IRI subjects if(!_isAbsoluteIri(id)) { continue; } // RDF predicate var predicate = {}; predicate.type = (property.indexOf('_:') === 0) ? 'blank node' : 'IRI'; predicate.value = property; // skip relative IRI predicates if(!_isAbsoluteIri(property)) { continue; } // skip blank node predicates unless producing generalized RDF if(predicate.type === 'blank node' && !options.produceGeneralizedRdf) { continue; } // convert @list to triples if(_isList(item)) { _listToRDF(item['@list'], namer, subject, predicate, rval); } // convert value or node object to triple else { var object = _objectToRDF(item); // skip null objects (they are relative IRIs) if(object) { rval.push({subject: subject, predicate: predicate, object: object}); } } } } } return rval; } /** * Converts a @list value into linked list of blank node RDF triples * (an RDF collection). * * @param list the @list value. * @param namer a UniqueNamer for assigning blank node names. * @param subject the subject for the head of the list. * @param predicate the predicate for the head of the list. * @param triples the array of triples to append to. */ function _listToRDF(list, namer, subject, predicate, triples) { var first = {type: 'IRI', value: RDF_FIRST}; var rest = {type: 'IRI', value: RDF_REST}; var nil = {type: 'IRI', value: RDF_NIL}; for(var i = 0; i < list.length; ++i) { var item = list[i]; var blankNode = {type: 'blank node', value: namer.getName()}; triples.push({subject: subject, predicate: predicate, object: blankNode}); subject = blankNode; predicate = first; var object = _objectToRDF(item); // skip null objects (they are relative IRIs) if(object) { triples.push({subject: subject, predicate: predicate, object: object}); } predicate = rest; } triples.push({subject: subject, predicate: predicate, object: nil}); } /** * Converts a JSON-LD value object to an RDF literal or a JSON-LD string or * node object to an RDF resource. * * @param item the JSON-LD value or node object. * * @return the RDF literal or RDF resource. */ function _objectToRDF(item) { var object = {}; // convert value object to RDF if(_isValue(item)) { object.type = 'literal'; var value = item['@value']; var datatype = item['@type'] || null; // convert to XSD datatypes as appropriate if(_isBoolean(value)) { object.value = value.toString(); object.datatype = datatype || XSD_BOOLEAN; } else if(_isDouble(value) || datatype === XSD_DOUBLE) { // canonical double representation object.value = value.toExponential(15).replace(/(\d)0*e\+?/, '$1E'); object.datatype = datatype || XSD_DOUBLE; } else if(_isNumber(value)) { object.value = value.toFixed(0); object.datatype = datatype || XSD_INTEGER; } else if('@language' in item) { object.value = value; object.datatype = datatype || RDF_LANGSTRING; object.language = item['@language']; } else { object.value = value; object.datatype = datatype || XSD_STRING; } } // convert string/node object to RDF else { var id = _isObject(item) ? item['@id'] : item; object.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI'; object.value = id; } // skip relative IRIs if(object.type === 'IRI' && !_isAbsoluteIri(object.value)) { return null; } return object; } /** * Converts an RDF triple object to a JSON-LD object. * * @param o the RDF triple object to convert. * @param useNativeTypes true to output native types, false not to. * * @return the JSON-LD object. */ function _RDFToObject(o, useNativeTypes) { // convert IRI/blank node object to JSON-LD if(o.type === 'IRI' || o.type === 'blank node') { return {'@id': o.value}; } // convert literal to JSON-LD var rval = {'@value': o.value}; // add language if(o['language']) { rval['@language'] = o.language; } else { var type = o.datatype; if(!type) { type = XSD_STRING; } // use native types for certain xsd types if(useNativeTypes) { if(type === XSD_BOOLEAN) { if(rval['@value'] === 'true') { rval['@value'] = true; } else if(rval['@value'] === 'false') { rval['@value'] = false; } } else if(_isNumeric(rval['@value'])) { if(type === XSD_INTEGER) { var i = parseInt(rval['@value']); if(i.toFixed(0) === rval['@value']) { rval['@value'] = i; } } else if(type === XSD_DOUBLE) { rval['@value'] = parseFloat(rval['@value']); } } // do not add native type if([XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING] .indexOf(type) === -1) { rval['@type'] = type; } } else if(type !== XSD_STRING) { rval['@type'] = type; } } return rval; } /** * Compares two RDF triples for equality. * * @param t1 the first triple. * @param t2 the second triple. * * @return true if the triples are the same, false if not. */ function _compareRDFTriples(t1, t2) { var attrs = ['subject', 'predicate', 'object']; for(var i = 0; i < attrs.length; ++i) { var attr = attrs[i]; if(t1[attr].type !== t2[attr].type || t1[attr].value !== t2[attr].value) { return false; } } if(t1.object.language !== t2.object.language) { return false; } if(t1.object.datatype !== t2.object.datatype) { return false; } return true; } /** * Hashes all of the quads about a blank node. * * @param id the ID of the bnode to hash quads for. * @param bnodes the mapping of bnodes to quads. * @param namer the canonical bnode namer. * * @return the new hash. */ function _hashQuads(id, bnodes, namer) { // return cached hash if('hash' in bnodes[id]) { return bnodes[id].hash; } // serialize all of bnode's quads var quads = bnodes[id].quads; var nquads = []; for(var i = 0; i < quads.length; ++i) { nquads.push(_toNQuad( quads[i], quads[i].name ? quads[i].name.value : null, id)); } // sort serialized quads nquads.sort(); // return hashed quads var hash = bnodes[id].hash = sha1.hash(nquads); return hash; } /** * Produces a hash for the paths of adjacent bnodes for a bnode, * incorporating all information about its subgraph of bnodes. This * method will recursively pick adjacent bnode permutations that produce the * lexicographically-least 'path' serializations. * * @param id the ID of the bnode to hash paths for. * @param bnodes the map of bnode quads. * @param namer the canonical bnode namer. * @param pathNamer the namer used to assign names to adjacent bnodes. * @param callback(err, result) called once the operation completes. */ function _hashPaths(id, bnodes, namer, pathNamer, callback) { // create SHA-1 digest var md = sha1.create(); // group adjacent bnodes by hash, keep properties and references separate var groups = {}; var groupHashes; var quads = bnodes[id].quads; jsonld.setImmediate(function() {groupNodes(0);}); function groupNodes(i) { if(i === quads.length) { // done, hash groups groupHashes = Object.keys(groups).sort(); return hashGroup(0); } // get adjacent bnode var quad = quads[i]; var bnode = _getAdjacentBlankNodeName(quad.subject, id); var direction = null; if(bnode !== null) { // normal property direction = 'p'; } else { bnode = _getAdjacentBlankNodeName(quad.object, id); if(bnode !== null) { // reverse property direction = 'r'; } } if(bnode !== null) { // get bnode name (try canonical, path, then hash) var name; if(namer.isNamed(bnode)) { name = namer.getName(bnode); } else if(pathNamer.isNamed(bnode)) { name = pathNamer.getName(bnode); } else { name = _hashQuads(bnode, bnodes, namer); } // hash direction, property, and bnode name/hash var md = sha1.create(); md.update(direction); md.update(quad.predicate.value); md.update(name); var groupHash = md.digest(); // add bnode to hash group if(groupHash in groups) { groups[groupHash].push(bnode); } else { groups[groupHash] = [bnode]; } } jsonld.setImmediate(function() {groupNodes(i + 1);}); } // hashes a group of adjacent bnodes function hashGroup(i) { if(i === groupHashes.length) { // done, return SHA-1 digest and path namer return callback(null, {hash: md.digest(), pathNamer: pathNamer}); } // digest group hash var groupHash = groupHashes[i]; md.update(groupHash); // choose a path and namer from the permutations var chosenPath = null; var chosenNamer = null; var permutator = new Permutator(groups[groupHash]); jsonld.setImmediate(function() {permutate();}); function permutate() { var permutation = permutator.next(); var pathNamerCopy = pathNamer.clone(); // build adjacent path var path = ''; var recurse = []; for(var n in permutation) { var bnode = permutation[n]; // use canonical name if available if(namer.isNamed(bnode)) { path += namer.getName(bnode); } else { // recurse if bnode isn't named in the path yet if(!pathNamerCopy.isNamed(bnode)) { recurse.push(bnode); } path += pathNamerCopy.getName(bnode); } // skip permutation if path is already >= chosen path if(chosenPath !== null && path.length >= chosenPath.length && path > chosenPath) { return nextPermutation(true); } } // does the next recursion nextRecursion(0); function nextRecursion(n) { if(n === recurse.length) { // done, do next permutation return nextPermutation(false); } // do recursion var bnode = recurse[n]; _hashPaths(bnode, bnodes, namer, pathNamerCopy, function(err, result) { if(err) { return callback(err); } path += pathNamerCopy.getName(bnode) + '<' + result.hash + '>'; pathNamerCopy = result.pathNamer; // skip permutation if path is already >= chosen path if(chosenPath !== null && path.length >= chosenPath.length && path > chosenPath) { return nextPermutation(true); } // do next recursion nextRecursion(n + 1); }); } // stores the results of this permutation and runs the next function nextPermutation(skipped) { if(!skipped && (chosenPath === null || path < chosenPath)) { chosenPath = path; chosenNamer = pathNamerCopy; } // do next permutation if(permutator.hasNext()) { jsonld.setImmediate(function() {permutate();}); } else { // digest chosen path and update namer md.update(chosenPath); pathNamer = chosenNamer; // hash the next group hashGroup(i + 1); } } } } } /** * A helper function that gets the blank node name from an RDF quad node * (subject or object). If the node is a blank node and its value * does not match the given blank node ID, it will be returned. * * @param node the RDF quad node. * @param id the ID of the blank node to look next to. * * @return the adjacent blank node name or null if none was found. */ function _getAdjacentBlankNodeName(node, id) { return (node.type === 'blank node' && node.value !== id ? node.value : null); } /** * Recursively flattens the subjects in the given JSON-LD expanded input * into a node map. * * @param input the JSON-LD expanded input. * @param graphs a map of graph name to subject map. * @param graph the name of the current graph. * @param namer the blank node namer. * @param name the name assigned to the current input if it is a bnode. * @param list the list to append to, null for none. */ function _createNodeMap(input, graphs, graph, namer, name, list) { // recurse through array if(_isArray(input)) { for(var i = 0; i < input.length; ++i) { _createNodeMap(input[i], graphs, graph, namer, undefined, list); } return; } // add non-object to list if(!_isObject(input)) { if(list) { list.push(input); } return; } // add values to list if(_isValue(input)) { if('@type' in input) { var type = input['@type']; // rename @type blank node if(type.indexOf('_:') === 0) { input['@type'] = type = namer.getName(type); } } if(list) { list.push(input); } return; } // Note: At this point, input must be a subject. // spec requires @type to be named first, so assign names early if('@type' in input) { var types = input['@type']; for(var i = 0; i < types.length; ++i) { var type = types[i]; if(type.indexOf('_:') === 0) { namer.getName(type); } } } // get name for subject if(_isUndefined(name)) { name = _isBlankNode(input) ? namer.getName(input['@id']) : input['@id']; } // add subject reference to list if(list) { list.push({'@id': name}); } // create new subject or merge into existing one var subjects = graphs[graph]; var subject = subjects[name] = subjects[name] || {}; subject['@id'] = name; var properties = Object.keys(input).sort(); for(var pi = 0; pi < properties.length; ++pi) { var property = properties[pi]; // skip @id if(property === '@id') { continue; } // handle reverse properties if(property === '@reverse') { var referencedNode = {'@id': name}; var reverseMap = input['@reverse']; for(var reverseProperty in reverseMap) { var items = reverseMap[reverseProperty]; for(var ii = 0; ii < items.length; ++ii) { var item = items[ii]; var itemName = item['@id']; if(_isBlankNode(item)) { itemName = namer.getName(itemName); } _createNodeMap(item, graphs, graph, namer, itemName); jsonld.addValue( subjects[itemName], reverseProperty, referencedNode, {propertyIsArray: true, allowDuplicate: false}); } } continue; } // recurse into graph if(property === '@graph') { // add graph subjects map entry if(!(name in graphs)) { graphs[name] = {}; } var g = (graph === '@merged') ? graph : name; _createNodeMap(input[property], graphs, g, namer); continue; } // copy non-@type keywords if(property !== '@type' && _isKeyword(property)) { if(property === '@index' && '@index' in subject) { throw new JsonLdError( 'Invalid JSON-LD syntax; conflicting @index property detected.', 'jsonld.SyntaxError', {code: 'conflicting indexes', subject: subject}); } subject[property] = input[property]; continue; } // iterate over objects var objects = input[property]; // if property is a bnode, assign it a new id if(property.indexOf('_:') === 0) { property = namer.getName(property); } // ensure property is added for empty arrays if(objects.length === 0) { jsonld.addValue(subject, property, [], {propertyIsArray: true}); continue; } for(var oi = 0; oi < objects.length; ++oi) { var o = objects[oi]; if(property === '@type') { // rename @type blank nodes o = (o.indexOf('_:') === 0) ? namer.getName(o) : o; } // handle embedded subject or subject reference if(_isSubject(o) || _isSubjectReference(o)) { // rename blank node @id var id = _isBlankNode(o) ? namer.getName(o['@id']) : o['@id']; // add reference and recurse jsonld.addValue( subject, property, {'@id': id}, {propertyIsArray: true, allowDuplicate: false}); _createNodeMap(o, graphs, graph, namer, id); } // handle @list else if(_isList(o)) { var _list = []; _createNodeMap(o['@list'], graphs, graph, namer, name, _list); o = {'@list': _list}; jsonld.addValue( subject, property, o, {propertyIsArray: true, allowDuplicate: false}); } // handle @value else { _createNodeMap(o, graphs, graph, namer, name); jsonld.addValue( subject, property, o, {propertyIsArray: true, allowDuplicate: false}); } } } } /** * Frames subjects according to the given frame. * * @param state the current framing state. * @param subjects the subjects to filter. * @param frame the frame. * @param parent the parent subject or top-level array. * @param property the parent property, initialized to null. */ function _frame(state, subjects, frame, parent, property) { // validate the frame _validateFrame(state, frame); frame = frame[0]; // filter out subjects that match the frame var matches = _filterSubjects(state, subjects, frame); // get flags for current frame var options = state.options; var embedOn = _getFrameFlag(frame, options, 'embed'); var explicitOn = _getFrameFlag(frame, options, 'explicit'); // add matches to output var ids = Object.keys(matches).sort(); for(var idx in ids) { var id = ids[idx]; /* Note: In order to treat each top-level match as a compartmentalized result, create an independent copy of the embedded subjects map when the property is null, which only occurs at the top-level. */ if(property === null) { state.embeds = {}; } // start output var output = {}; output['@id'] = id; // prepare embed meta info var embed = {parent: parent, property: property}; // if embed is on and there is an existing embed if(embedOn && (id in state.embeds)) { // only overwrite an existing embed if it has already been added to its // parent -- otherwise its parent is somewhere up the tree from this // embed and the embed would occur twice once the tree is added embedOn = false; // existing embed's parent is an array var existing = state.embeds[id]; if(_isArray(existing.parent)) { for(var i = 0; i < existing.parent.length; ++i) { if(jsonld.compareValues(output, existing.parent[i])) { embedOn = true; break; } } } // existing embed's parent is an object else if(jsonld.hasValue(existing.parent, existing.property, output)) { embedOn = true; } // existing embed has already been added, so allow an overwrite if(embedOn) { _removeEmbed(state, id); } } // not embedding, add output without any other properties if(!embedOn) { _addFrameOutput(state, parent, property, output); } else { // add embed meta info state.embeds[id] = embed; // iterate over subject properties var subject = matches[id]; var props = Object.keys(subject).sort(); for(var i = 0; i < props.length; i++) { var prop = props[i]; // copy keywords to output if(_isKeyword(prop)) { output[prop] = _clone(subject[prop]); continue; } // if property isn't in the frame if(!(prop in frame)) { // if explicit is off, embed values if(!explicitOn) { _embedValues(state, subject, prop, output); } continue; } // add objects var objects = subject[prop]; for(var oi = 0; oi < objects.length; ++oi) { var o = objects[oi]; // recurse into list if(_isList(o)) { // add empty list var list = {'@list': []}; _addFrameOutput(state, output, prop, list); // add list objects var src = o['@list']; for(var n in src) { o = src[n]; // recurse into subject reference if(_isSubjectReference(o)) { _frame(state, [o['@id']], frame[prop][0]['@list'], list, '@list'); } // include other values automatically else { _addFrameOutput(state, list, '@list', _clone(o)); } } continue; } // recurse into subject reference if(_isSubjectReference(o)) { _frame(state, [o['@id']], frame[prop], output, prop); } // include other values automatically else { _addFrameOutput(state, output, prop, _clone(o)); } } } // handle defaults var props = Object.keys(frame).sort(); for(var i = 0; i < props.length; ++i) { var prop = props[i]; // skip keywords if(_isKeyword(prop)) { continue; } // if omit default is off, then include default values for properties // that appear in the next frame but are not in the matching subject var next = frame[prop][0]; var omitDefaultOn = _getFrameFlag(next, options, 'omitDefault'); if(!omitDefaultOn && !(prop in output)) { var preserve = '@null'; if('@default' in next) { preserve = _clone(next['@default']); } if(!_isArray(preserve)) { preserve = [preserve]; } output[prop] = [{'@preserve': preserve}]; } } // add output to parent _addFrameOutput(state, parent, property, output); } } } /** * Gets the frame flag value for the given flag name. * * @param frame the frame. * @param options the framing options. * @param name the flag name. * * @return the flag value. */ function _getFrameFlag(frame, options, name) { var flag = '@' + name; return (flag in frame) ? frame[flag][0] : options[name]; } /** * Validates a JSON-LD frame, throwing an exception if the frame is invalid. * * @param state the current frame state. * @param frame the frame to validate. */ function _validateFrame(state, frame) { if(!_isArray(frame) || frame.length !== 1 || !_isObject(frame[0])) { throw new JsonLdError( 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.', 'jsonld.SyntaxError', {frame: frame}); } } /** * Returns a map of all of the subjects that match a parsed frame. * * @param state the current framing state. * @param subjects the set of subjects to filter. * @param frame the parsed frame. * * @return all of the matched subjects. */ function _filterSubjects(state, subjects, frame) { // filter subjects in @id order var rval = {}; for(var i = 0; i < subjects.length; ++i) { var id = subjects[i]; var subject = state.subjects[id]; if(_filterSubject(subject, frame)) { rval[id] = subject; } } return rval; } /** * Returns true if the given subject matches the given frame. * * @param subject the subject to check. * @param frame the frame to check. * * @return true if the subject matches, false if not. */ function _filterSubject(subject, frame) { // check @type (object value means 'any' type, fall through to ducktyping) if('@type' in frame && !(frame['@type'].length === 1 && _isObject(frame['@type'][0]))) { var types = frame['@type']; for(var i = 0; i < types.length; ++i) { // any matching @type is a match if(jsonld.hasValue(subject, '@type', types[i])) { return true; } } return false; } // check ducktype for(var key in frame) { // only not a duck if @id or non-keyword isn't in subject if((key === '@id' || !_isKeyword(key)) && !(key in subject)) { return false; } } return true; } /** * Embeds values for the given subject and property into the given output * during the framing algorithm. * * @param state the current framing state. * @param subject the subject. * @param property the property. * @param output the output. */ function _embedValues(state, subject, property, output) { // embed subject properties in output var objects = subject[property]; for(var i = 0; i < objects.length; ++i) { var o = objects[i]; // recurse into @list if(_isList(o)) { var list = {'@list': []}; _addFrameOutput(state, output, property, list); return _embedValues(state, o, '@list', list['@list']); } // handle subject reference if(_isSubjectReference(o)) { var id = o['@id']; // embed full subject if isn't already embedded if(!(id in state.embeds)) { // add embed var embed = {parent: output, property: property}; state.embeds[id] = embed; // recurse into subject o = {}; var s = state.subjects[id]; for(var prop in s) { // copy keywords if(_isKeyword(prop)) { o[prop] = _clone(s[prop]); continue; } _embedValues(state, s, prop, o); } } _addFrameOutput(state, output, property, o); } // copy non-subject value else { _addFrameOutput(state, output, property, _clone(o)); } } } /** * Removes an existing embed. * * @param state the current framing state. * @param id the @id of the embed to remove. */ function _removeEmbed(state, id) { // get existing embed var embeds = state.embeds; var embed = embeds[id]; var parent = embed.parent; var property = embed.property; // create reference to replace embed var subject = {'@id': id}; // remove existing embed if(_isArray(parent)) { // replace subject with reference for(var i = 0; i < parent.length; ++i) { if(jsonld.compareValues(parent[i], subject)) { parent[i] = subject; break; } } } else { // replace subject with reference var useArray = _isArray(parent[property]); jsonld.removeValue(parent, property, subject, {propertyIsArray: useArray}); jsonld.addValue(parent, property, subject, {propertyIsArray: useArray}); } // recursively remove dependent dangling embeds var removeDependents = function(id) { // get embed keys as a separate array to enable deleting keys in map var ids = Object.keys(embeds); for(var i = 0; i < ids.length; ++i) { var next = ids[i]; if(next in embeds && _isObject(embeds[next].parent) && embeds[next].parent['@id'] === id) { delete embeds[next]; removeDependents(next); } } }; removeDependents(id); } /** * Adds framing output to the given parent. * * @param state the current framing state. * @param parent the parent to add to. * @param property the parent property. * @param output the output to add. */ function _addFrameOutput(state, parent, property, output) { if(_isObject(parent)) { jsonld.addValue(parent, property, output, {propertyIsArray: true}); } else { parent.push(output); } } /** * Removes the @preserve keywords as the last step of the framing algorithm. * * @param ctx the active context used to compact the input. * @param input the framed, compacted output. * @param options the compaction options used. * * @return the resulting output. */ function _removePreserve(ctx, input, options) { // recurse through arrays if(_isArray(input)) { var output = []; for(var i = 0; i < input.length; ++i) { var result = _removePreserve(ctx, input[i], options); // drop nulls from arrays if(result !== null) { output.push(result); } } input = output; } else if(_isObject(input)) { // remove @preserve if('@preserve' in input) { if(input['@preserve'] === '@null') { return null; } return input['@preserve']; } // skip @values if(_isValue(input)) { return input; } // recurse through @lists if(_isList(input)) { input['@list'] = _removePreserve(ctx, input['@list'], options); return input; } // recurse through properties for(var prop in input) { var result = _removePreserve(ctx, input[prop], options); var container = jsonld.getContextValue(ctx, prop, '@container'); if(options.compactArrays && _isArray(result) && result.length === 1 && container === null) { result = result[0]; } input[prop] = result; } } return input; } /** * Compares two strings first based on length and then lexicographically. * * @param a the first string. * @param b the second string. * * @return -1 if a < b, 1 if a > b, 0 if a == b. */ function _compareShortestLeast(a, b) { if(a.length < b.length) { return -1; } else if(b.length < a.length) { return 1; } else if(a === b) { return 0; } return (a < b) ? -1 : 1; } /** * Picks the preferred compaction term from the given inverse context entry. * * @param activeCtx the active context. * @param iri the IRI to pick the term for. * @param value the value to pick the term for. * @param containers the preferred containers. * @param typeOrLanguage either '@type' or '@language'. * @param typeOrLanguageValue the preferred value for '@type' or '@language'. * * @return the preferred term. */ function _selectTerm( activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue) { if(typeOrLanguageValue === null) { typeOrLanguageValue = '@null'; } // preferences for the value of @type or @language var prefs = []; // determine prefs for @id based on whether or not value compacts to a term if((typeOrLanguageValue === '@id' || typeOrLanguageValue === '@reverse') && _isSubjectReference(value)) { // prefer @reverse first if(typeOrLanguageValue === '@reverse') { prefs.push('@reverse'); } // try to compact value to a term var term = _compactIri(activeCtx, value['@id'], null, {vocab: true}); if(term in activeCtx.mappings && activeCtx.mappings[term] && activeCtx.mappings[term]['@id'] === value['@id']) { // prefer @vocab prefs.push.apply(prefs, ['@vocab', '@id']); } else { // prefer @id prefs.push.apply(prefs, ['@id', '@vocab']); } } else { prefs.push(typeOrLanguageValue); } prefs.push('@none'); var containerMap = activeCtx.inverse[iri]; for(var ci = 0; ci < containers.length; ++ci) { // if container not available in the map, continue var container = containers[ci]; if(!(container in containerMap)) { continue; } var typeOrLanguageValueMap = containerMap[container][typeOrLanguage]; for(var pi = 0; pi < prefs.length; ++pi) { // if type/language option not available in the map, continue var pref = prefs[pi]; if(!(pref in typeOrLanguageValueMap)) { continue; } // select term return typeOrLanguageValueMap[pref]; } } return null; } /** * Compacts an IRI or keyword into a term or prefix if it can be. If the * IRI has an associated value it may be passed. * * @param activeCtx the active context to use. * @param iri the IRI to compact. * @param value the value to check or null. * @param relativeTo options for how to compact IRIs: * vocab: true to split after @vocab, false not to. * @param reverse true if a reverse property is being compacted, false if not. * * @return the compacted term, prefix, keyword alias, or the original IRI. */ function _compactIri(activeCtx, iri, value, relativeTo, reverse) { // can't compact null if(iri === null) { return iri; } // default value and parent to null if(_isUndefined(value)) { value = null; } // default reverse to false if(_isUndefined(reverse)) { reverse = false; } relativeTo = relativeTo || {}; // if term is a keyword, default vocab to true if(_isKeyword(iri)) { relativeTo.vocab = true; } // use inverse context to pick a term if iri is relative to vocab if(relativeTo.vocab && iri in activeCtx.getInverse()) { var defaultLanguage = activeCtx['@language'] || '@none'; // prefer @index if available in value var containers = []; if(_isObject(value) && '@index' in value) { containers.push('@index'); } // defaults for term selection based on type/language var typeOrLanguage = '@language'; var typeOrLanguageValue = '@null'; if(reverse) { typeOrLanguage = '@type'; typeOrLanguageValue = '@reverse'; containers.push('@set'); } // choose the most specific term that works for all elements in @list else if(_isList(value)) { // only select @list containers if @index is NOT in value if(!('@index' in value)) { containers.push('@list'); } var list = value['@list']; var commonLanguage = (list.length === 0) ? defaultLanguage : null; var commonType = null; for(var i = 0; i < list.length; ++i) { var item = list[i]; var itemLanguage = '@none'; var itemType = '@none'; if(_isValue(item)) { if('@language' in item) { itemLanguage = item['@language']; } else if('@type' in item) { itemType = item['@type']; } // plain literal else { itemLanguage = '@null'; } } else { itemType = '@id'; } if(commonLanguage === null) { commonLanguage = itemLanguage; } else if(itemLanguage !== commonLanguage && _isValue(item)) { commonLanguage = '@none'; } if(commonType === null) { commonType = itemType; } else if(itemType !== commonType) { commonType = '@none'; } // there are different languages and types in the list, so choose // the most generic term, no need to keep iterating the list if(commonLanguage === '@none' && commonType === '@none') { break; } } commonLanguage = commonLanguage || '@none'; commonType = commonType || '@none'; if(commonType !== '@none') { typeOrLanguage = '@type'; typeOrLanguageValue = commonType; } else { typeOrLanguageValue = commonLanguage; } } else { if(_isValue(value)) { if('@language' in value && !('@index' in value)) { containers.push('@language'); typeOrLanguageValue = value['@language']; } else if('@type' in value) { typeOrLanguage = '@type'; typeOrLanguageValue = value['@type']; } } else { typeOrLanguage = '@type'; typeOrLanguageValue = '@id'; } containers.push('@set'); } // do term selection containers.push('@none'); var term = _selectTerm( activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue); if(term !== null) { return term; } } // no term match, use @vocab if available if(relativeTo.vocab) { if('@vocab' in activeCtx) { // determine if vocab is a prefix of the iri var vocab = activeCtx['@vocab']; if(iri.indexOf(vocab) === 0 && iri !== vocab) { // use suffix as relative iri if it is not a term in the active context var suffix = iri.substr(vocab.length); if(!(suffix in activeCtx.mappings)) { return suffix; } } } } // no term or @vocab match, check for possible CURIEs var choice = null; for(var term in activeCtx.mappings) { // skip terms with colons, they can't be prefixes if(term.indexOf(':') !== -1) { continue; } // skip entries with @ids that are not partial matches var definition = activeCtx.mappings[term]; if(!definition || definition['@id'] === iri || iri.indexOf(definition['@id']) !== 0) { continue; } // a CURIE is usable if: // 1. it has no mapping, OR // 2. value is null, which means we're not compacting an @value, AND // the mapping matches the IRI) var curie = term + ':' + iri.substr(definition['@id'].length); var isUsableCurie = (!(curie in activeCtx.mappings) || (value === null && activeCtx.mappings[curie] && activeCtx.mappings[curie]['@id'] === iri)); // select curie if it is shorter or the same length but lexicographically // less than the current choice if(isUsableCurie && (choice === null || _compareShortestLeast(curie, choice) < 0)) { choice = curie; } } // return chosen curie if(choice !== null) { return choice; } // compact IRI relative to base if(!relativeTo.vocab) { return _removeBase(activeCtx['@base'], iri); } // return IRI as is return iri; } /** * Performs value compaction on an object with '@value' or '@id' as the only * property. * * @param activeCtx the active context. * @param activeProperty the active property that points to the value. * @param value the value to compact. * * @return the compaction result. */ function _compactValue(activeCtx, activeProperty, value) { // value is a @value if(_isValue(value)) { // get context rules var type = jsonld.getContextValue(activeCtx, activeProperty, '@type'); var language = jsonld.getContextValue( activeCtx, activeProperty, '@language'); var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); // whether or not the value has an @index that must be preserved var preserveIndex = (('@index' in value) && container !== '@index'); // if there's no @index to preserve ... if(!preserveIndex) { // matching @type or @language specified in context, compact value if(value['@type'] === type || value['@language'] === language) { return value['@value']; } } // return just the value of @value if all are true: // 1. @value is the only key or @index isn't being preserved // 2. there is no default language or @value is not a string or // the key has a mapping with a null @language var keyCount = Object.keys(value).length; var isValueOnlyKey = (keyCount === 1 || (keyCount === 2 && ('@index' in value) && !preserveIndex)); var hasDefaultLanguage = ('@language' in activeCtx); var isValueString = _isString(value['@value']); var hasNullMapping = (activeCtx.mappings[activeProperty] && activeCtx.mappings[activeProperty]['@language'] === null); if(isValueOnlyKey && (!hasDefaultLanguage || !isValueString || hasNullMapping)) { return value['@value']; } var rval = {}; // preserve @index if(preserveIndex) { rval[_compactIri(activeCtx, '@index')] = value['@index']; } // compact @type IRI if('@type' in value) { rval[_compactIri(activeCtx, '@type')] = _compactIri( activeCtx, value['@type'], null, {vocab: true}); } // alias @language else if('@language' in value) { rval[_compactIri(activeCtx, '@language')] = value['@language']; } // alias @value rval[_compactIri(activeCtx, '@value')] = value['@value']; return rval; } // value is a subject reference var expandedProperty = _expandIri(activeCtx, activeProperty, {vocab: true}); var type = jsonld.getContextValue(activeCtx, activeProperty, '@type'); var compacted = _compactIri( activeCtx, value['@id'], null, {vocab: type === '@vocab'}); // compact to scalar if(type === '@id' || type === '@vocab' || expandedProperty === '@graph') { return compacted; } var rval = {}; rval[_compactIri(activeCtx, '@id')] = compacted; return rval; } /** * Creates a term definition during context processing. * * @param activeCtx the current active context. * @param localCtx the local context being processed. * @param term the term in the local context to define the mapping for. * @param defined a map of defining/defined keys to detect cycles and prevent * double definitions. */ function _createTermDefinition(activeCtx, localCtx, term, defined) { if(term in defined) { // term already defined if(defined[term]) { return; } // cycle detected throw new JsonLdError( 'Cyclical context definition detected.', 'jsonld.CyclicalContext', {code: 'cyclic IRI mapping', context: localCtx, term: term}); } // now defining term defined[term] = false; if(_isKeyword(term)) { throw new JsonLdError( 'Invalid JSON-LD syntax; keywords cannot be overridden.', 'jsonld.SyntaxError', {code: 'keyword redefinition', context: localCtx}); } // remove old mapping if(activeCtx.mappings[term]) { delete activeCtx.mappings[term]; } // get context term value var value = localCtx[term]; // clear context entry if(value === null || (_isObject(value) && value['@id'] === null)) { activeCtx.mappings[term] = null; defined[term] = true; return; } // convert short-hand value to object w/@id if(_isString(value)) { value = {'@id': value}; } if(!_isObject(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context property values must be ' + 'strings or objects.', 'jsonld.SyntaxError', {code: 'invalid term definition', context: localCtx}); } // create new mapping var mapping = activeCtx.mappings[term] = {}; mapping.reverse = false; if('@reverse' in value) { if('@id' in value) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @reverse term definition must not ' + 'contain @id.', 'jsonld.SyntaxError', {code: 'invalid reverse property', context: localCtx}); } var reverse = value['@reverse']; if(!_isString(reverse)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context @reverse value must be a string.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); } // expand and add @id mapping var id = _expandIri( activeCtx, reverse, {vocab: true, base: false}, localCtx, defined); if(!_isAbsoluteIri(id)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context @reverse value must be an ' + 'absolute IRI or a blank node identifier.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); } mapping['@id'] = id; mapping.reverse = true; } else if('@id' in value) { var id = value['@id']; if(!_isString(id)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context @id value must be an array ' + 'of strings or a string.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); } if(id !== term) { // expand and add @id mapping id = _expandIri( activeCtx, id, {vocab: true, base: false}, localCtx, defined); if(!_isAbsoluteIri(id) && !_isKeyword(id)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context @id value must be an ' + 'absolute IRI, a blank node identifier, or a keyword.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx}); } mapping['@id'] = id; } } if(!('@id' in mapping)) { // see if the term has a prefix var colon = term.indexOf(':'); if(colon !== -1) { var prefix = term.substr(0, colon); if(prefix in localCtx) { // define parent prefix _createTermDefinition(activeCtx, localCtx, prefix, defined); } // set @id based on prefix parent if(activeCtx.mappings[prefix]) { var suffix = term.substr(colon + 1); mapping['@id'] = activeCtx.mappings[prefix]['@id'] + suffix; } // term is an absolute IRI else { mapping['@id'] = term; } } else { // non-IRIs *must* define @ids if @vocab is not available if(!('@vocab' in activeCtx)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context terms must define an @id.', 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx, term: term}); } // prepend vocab to term mapping['@id'] = activeCtx['@vocab'] + term; } } // IRI mapping now defined defined[term] = true; if('@type' in value) { var type = value['@type']; if(!_isString(type)) { throw new JsonLdError( 'Invalid JSON-LD syntax; an @context @type values must be a string.', 'jsonld.SyntaxError', {code: 'invalid type mapping', context: localCtx}); } if(type !== '@id' && type !== '@vocab') { // expand @type to full IRI type = _expandIri( activeCtx, type, {vocab: true, base: false}, localCtx, defined); if(!_isAbsoluteIri(type)) { throw new JsonLdError( 'Invalid JSON-LD syntax; an @context @type value must be an ' + 'absolute IRI.', 'jsonld.SyntaxError', {code: 'invalid type mapping', context: localCtx}); } if(type.indexOf('_:') === 0) { throw new JsonLdError( 'Invalid JSON-LD syntax; an @context @type values must be an IRI, ' + 'not a blank node identifier.', 'jsonld.SyntaxError', {code: 'invalid type mapping', context: localCtx}); } } // add @type to mapping mapping['@type'] = type; } if('@container' in value) { var container = value['@container']; if(container !== '@list' && container !== '@set' && container !== '@index' && container !== '@language') { throw new JsonLdError( 'Invalid JSON-LD syntax; @context @container value must be ' + 'one of the following: @list, @set, @index, or @language.', 'jsonld.SyntaxError', {code: 'invalid container mapping', context: localCtx}); } if(mapping.reverse && container !== '@index' && container !== '@set' && container !== null) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context @container value for a @reverse ' + 'type definition must be @index or @set.', 'jsonld.SyntaxError', {code: 'invalid reverse property', context: localCtx}); } // add @container to mapping mapping['@container'] = container; } if('@language' in value && !('@type' in value)) { var language = value['@language']; if(language !== null && !_isString(language)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context @language value must be ' + 'a string or null.', 'jsonld.SyntaxError', {code: 'invalid language mapping', context: localCtx}); } // add @language to mapping if(language !== null) { language = language.toLowerCase(); } mapping['@language'] = language; } // disallow aliasing @context and @preserve var id = mapping['@id']; if(id === '@context' || id === '@preserve') { throw new JsonLdError( 'Invalid JSON-LD syntax; @context and @preserve cannot be aliased.', 'jsonld.SyntaxError', {code: 'invalid keyword alias', context: localCtx}); } } /** * Expands a string to a full IRI. The string may be a term, a prefix, a * relative IRI, or an absolute IRI. The associated absolute IRI will be * returned. * * @param activeCtx the current active context. * @param value the string to expand. * @param relativeTo options for how to resolve relative IRIs: * base: true to resolve against the base IRI, false not to. * vocab: true to concatenate after @vocab, false not to. * @param localCtx the local context being processed (only given if called * during context processing). * @param defined a map for tracking cycles in context definitions (only given * if called during context processing). * * @return the expanded value. */ function _expandIri(activeCtx, value, relativeTo, localCtx, defined) { // already expanded if(value === null || _isKeyword(value)) { return value; } // define term dependency if not defined if(localCtx && value in localCtx && defined[value] !== true) { _createTermDefinition(activeCtx, localCtx, value, defined); } relativeTo = relativeTo || {}; if(relativeTo.vocab) { var mapping = activeCtx.mappings[value]; // value is explicitly ignored with a null mapping if(mapping === null) { return null; } if(mapping) { // value is a term return mapping['@id']; } } // split value into prefix:suffix var colon = value.indexOf(':'); if(colon !== -1) { var prefix = value.substr(0, colon); var suffix = value.substr(colon + 1); // do not expand blank nodes (prefix of '_') or already-absolute // IRIs (suffix of '//') if(prefix === '_' || suffix.indexOf('//') === 0) { return value; } // prefix dependency not defined, define it if(localCtx && prefix in localCtx) { _createTermDefinition(activeCtx, localCtx, prefix, defined); } // use mapping if prefix is defined var mapping = activeCtx.mappings[prefix]; if(mapping) { return mapping['@id'] + suffix; } // already absolute IRI return value; } // prepend vocab if(relativeTo.vocab && '@vocab' in activeCtx) { return activeCtx['@vocab'] + value; } // prepend base var rval = value; if(relativeTo.base) { rval = _prependBase(activeCtx['@base'], rval); } return rval; } /** * Prepends a base IRI to the given relative IRI. * * @param base the base IRI. * @param iri the relative IRI. * * @return the absolute IRI. */ function _prependBase(base, iri) { // skip IRI processing if(base === null) { return iri; } // already an absolute IRI if(iri.indexOf(':') !== -1) { return iri; } // parse base if it is a string if(_isString(base)) { base = jsonld.url.parse(base || ''); } // parse given IRI var rel = jsonld.url.parse(iri); // start hierarchical part var hierPart = (base.protocol || ''); if(rel.authority) { hierPart += '//' + rel.authority; } else if(base.href !== '') { hierPart += '//' + base.authority; } // per RFC3986 normalize var path; // IRI represents an absolute path if(rel.pathname.indexOf('/') === 0) { path = rel.pathname; } else { path = base.pathname; // append relative path to the end of the last directory from base if(rel.pathname !== '') { path = path.substr(0, path.lastIndexOf('/') + 1); if(path.length > 0 && path.substr(-1) !== '/') { path += '/'; } path += rel.pathname; } } // remove slashes and dots in path path = _removeDotSegments(path, hierPart !== ''); // add query and hash if(rel.query) { path += '?' + rel.query; } if(rel.hash) { path += rel.hash; } var rval = hierPart + path; if(rval === '') { rval = './'; } return rval; } /** * Removes a base IRI from the given absolute IRI. * * @param base the base IRI. * @param iri the absolute IRI. * * @return the relative IRI if relative to base, otherwise the absolute IRI. */ function _removeBase(base, iri) { // skip IRI processing if(base === null) { return iri; } if(_isString(base)) { base = jsonld.url.parse(base || ''); } // establish base root var root = ''; if(base.href !== '') { root += (base.protocol || '') + '//' + base.authority; } // support network-path reference with empty base else if(iri.indexOf('//')) { root += '//'; } // IRI not relative to base if(iri.indexOf(root) !== 0) { return iri; } // remove root from IRI and parse remainder var rel = jsonld.url.parse(iri.substr(root.length)); // remove path segments that match (do not remove last segment unless there // is a hash or query) var baseSegments = base.normalizedPath.split('/'); var iriSegments = rel.normalizedPath.split('/'); var last = (rel.hash || rel.query) ? 0 : 1; while(baseSegments.length > 0 && iriSegments.length > last) { if(baseSegments[0] !== iriSegments[0]) { break; } baseSegments.shift(); iriSegments.shift(); } // use '../' for each non-matching base segment var rval = ''; if(baseSegments.length > 0) { // don't count the last segment (if it ends with '/' last path doesn't // count and if it doesn't end with '/' it isn't a path) baseSegments.pop(); for(var i = 0; i < baseSegments.length; ++i) { rval += '../'; } } // prepend remaining segments rval += iriSegments.join('/'); // add query and hash if(rel.query) { rval += '?' + rel.query; } if(rel.hash) { rval += rel.hash; } if(rval === '') { rval = './'; } return rval; } /** * Gets the initial context. * * @param options the options to use. * base the document base IRI. * * @return the initial context. */ function _getInitialContext(options) { var base = jsonld.url.parse(options.base || ''); return { '@base': base, mappings: {}, inverse: null, getInverse: _createInverseContext, clone: _cloneActiveContext }; /** * Generates an inverse context for use in the compaction algorithm, if * not already generated for the given active context. * * @return the inverse context. */ function _createInverseContext() { var activeCtx = this; // lazily create inverse if(activeCtx.inverse) { return activeCtx.inverse; } var inverse = activeCtx.inverse = {}; // handle default language var defaultLanguage = activeCtx['@language'] || '@none'; // create term selections for each mapping in the context, ordered by // shortest and then lexicographically least var mappings = activeCtx.mappings; var terms = Object.keys(mappings).sort(_compareShortestLeast); for(var i = 0; i < terms.length; ++i) { var term = terms[i]; var mapping = mappings[term]; if(mapping === null) { continue; } var container = mapping['@container'] || '@none'; // iterate over every IRI in the mapping var ids = mapping['@id']; if(!_isArray(ids)) { ids = [ids]; } for(var ii = 0; ii < ids.length; ++ii) { var iri = ids[ii]; var entry = inverse[iri]; // initialize entry if(!entry) { inverse[iri] = entry = {}; } // add new entry if(!entry[container]) { entry[container] = { '@language': {}, '@type': {} }; } entry = entry[container]; // term is preferred for values using @reverse if(mapping.reverse) { _addPreferredTerm(mapping, term, entry['@type'], '@reverse'); } // term is preferred for values using specific type else if('@type' in mapping) { _addPreferredTerm(mapping, term, entry['@type'], mapping['@type']); } // term is preferred for values using specific language else if('@language' in mapping) { var language = mapping['@language'] || '@null'; _addPreferredTerm(mapping, term, entry['@language'], language); } // term is preferred for values w/default language or no type and // no language else { // add an entry for the default language _addPreferredTerm(mapping, term, entry['@language'], defaultLanguage); // add entries for no type and no language _addPreferredTerm(mapping, term, entry['@type'], '@none'); _addPreferredTerm(mapping, term, entry['@language'], '@none'); } } } return inverse; } /** * Adds the term for the given entry if not already added. * * @param mapping the term mapping. * @param term the term to add. * @param entry the inverse context typeOrLanguage entry to add to. * @param typeOrLanguageValue the key in the entry to add to. */ function _addPreferredTerm(mapping, term, entry, typeOrLanguageValue) { if(!(typeOrLanguageValue in entry)) { entry[typeOrLanguageValue] = term; } } /** * Clones an active context, creating a child active context. * * @return a clone (child) of the active context. */ function _cloneActiveContext() { var child = {}; child['@base'] = this['@base']; child.mappings = _clone(this.mappings); child.clone = this.clone; child.inverse = null; child.getInverse = this.getInverse; if('@language' in this) { child['@language'] = this['@language']; } if('@vocab' in this) { child['@vocab'] = this['@vocab']; } return child; } } /** * Returns whether or not the given value is a keyword. * * @param v the value to check. * * @return true if the value is a keyword, false if not. */ function _isKeyword(v) { if(!_isString(v)) { return false; } switch(v) { case '@base': case '@context': case '@container': case '@default': case '@embed': case '@explicit': case '@graph': case '@id': case '@index': case '@language': case '@list': case '@omitDefault': case '@preserve': case '@reverse': case '@set': case '@type': case '@value': case '@vocab': return true; } return false; } /** * Returns true if the given value is an Object. * * @param v the value to check. * * @return true if the value is an Object, false if not. */ function _isObject(v) { return (Object.prototype.toString.call(v) === '[object Object]'); } /** * Returns true if the given value is an empty Object. * * @param v the value to check. * * @return true if the value is an empty Object, false if not. */ function _isEmptyObject(v) { return _isObject(v) && Object.keys(v).length === 0; } /** * Returns true if the given value is an Array. * * @param v the value to check. * * @return true if the value is an Array, false if not. */ function _isArray(v) { return Array.isArray(v); } /** * Throws an exception if the given value is not a valid @type value. * * @param v the value to check. */ function _validateTypeValue(v) { // can be a string or an empty object if(_isString(v) || _isEmptyObject(v)) { return; } // must be an array var isValid = false; if(_isArray(v)) { // must contain only strings isValid = true; for(var i = 0; i < v.length; ++i) { if(!(_isString(v[i]))) { isValid = false; break; } } } if(!isValid) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@type" value must a string, an array of ' + 'strings, or an empty object.', 'jsonld.SyntaxError', {code: 'invalid type value', value: v}); } } /** * Returns true if the given value is a String. * * @param v the value to check. * * @return true if the value is a String, false if not. */ function _isString(v) { return (typeof v === 'string' || Object.prototype.toString.call(v) === '[object String]'); } /** * Returns true if the given value is a Number. * * @param v the value to check. * * @return true if the value is a Number, false if not. */ function _isNumber(v) { return (typeof v === 'number' || Object.prototype.toString.call(v) === '[object Number]'); } /** * Returns true if the given value is a double. * * @param v the value to check. * * @return true if the value is a double, false if not. */ function _isDouble(v) { return _isNumber(v) && String(v).indexOf('.') !== -1; } /** * Returns true if the given value is numeric. * * @param v the value to check. * * @return true if the value is numeric, false if not. */ function _isNumeric(v) { return !isNaN(parseFloat(v)) && isFinite(v); } /** * Returns true if the given value is a Boolean. * * @param v the value to check. * * @return true if the value is a Boolean, false if not. */ function _isBoolean(v) { return (typeof v === 'boolean' || Object.prototype.toString.call(v) === '[object Boolean]'); } /** * Returns true if the given value is undefined. * * @param v the value to check. * * @return true if the value is undefined, false if not. */ function _isUndefined(v) { return (typeof v === 'undefined'); } /** * Returns true if the given value is a subject with properties. * * @param v the value to check. * * @return true if the value is a subject with properties, false if not. */ function _isSubject(v) { // Note: A value is a subject if all of these hold true: // 1. It is an Object. // 2. It is not a @value, @set, or @list. // 3. It has more than 1 key OR any existing key is not @id. var rval = false; if(_isObject(v) && !(('@value' in v) || ('@set' in v) || ('@list' in v))) { var keyCount = Object.keys(v).length; rval = (keyCount > 1 || !('@id' in v)); } return rval; } /** * Returns true if the given value is a subject reference. * * @param v the value to check. * * @return true if the value is a subject reference, false if not. */ function _isSubjectReference(v) { // Note: A value is a subject reference if all of these hold true: // 1. It is an Object. // 2. It has a single key: @id. return (_isObject(v) && Object.keys(v).length === 1 && ('@id' in v)); } /** * Returns true if the given value is a @value. * * @param v the value to check. * * @return true if the value is a @value, false if not. */ function _isValue(v) { // Note: A value is a @value if all of these hold true: // 1. It is an Object. // 2. It has the @value property. return _isObject(v) && ('@value' in v); } /** * Returns true if the given value is a @list. * * @param v the value to check. * * @return true if the value is a @list, false if not. */ function _isList(v) { // Note: A value is a @list if all of these hold true: // 1. It is an Object. // 2. It has the @list property. return _isObject(v) && ('@list' in v); } /** * Returns true if the given value is a blank node. * * @param v the value to check. * * @return true if the value is a blank node, false if not. */ function _isBlankNode(v) { // Note: A value is a blank node if all of these hold true: // 1. It is an Object. // 2. If it has an @id key its value begins with '_:'. // 3. It has no keys OR is not a @value, @set, or @list. var rval = false; if(_isObject(v)) { if('@id' in v) { rval = (v['@id'].indexOf('_:') === 0); } else { rval = (Object.keys(v).length === 0 || !(('@value' in v) || ('@set' in v) || ('@list' in v))); } } return rval; } /** * Returns true if the given value is an absolute IRI, false if not. * * @param v the value to check. * * @return true if the value is an absolute IRI, false if not. */ function _isAbsoluteIri(v) { return _isString(v) && v.indexOf(':') !== -1; } /** * Clones an object, array, or string/number. * * @param value the value to clone. * * @return the cloned value. */ function _clone(value) { if(value && typeof value === 'object') { var rval; if(_isArray(value)) { rval = []; for(var i = 0; i < value.length; ++i) { rval[i] = _clone(value[i]); } } else { rval = {}; for(var key in value) { rval[key] = _clone(value[key]); } } return rval; } return value; } /** * Finds all @context URLs in the given JSON-LD input. * * @param input the JSON-LD input. * @param urls a map of URLs (url => false/@contexts). * @param replace true to replace the URLs in the given input with the * @contexts from the urls map, false not to. * @param base the base IRI to use to resolve relative IRIs. * * @return true if new URLs to retrieve were found, false if not. */ function _findContextUrls(input, urls, replace, base) { var count = Object.keys(urls).length; if(_isArray(input)) { for(var i = 0; i < input.length; ++i) { _findContextUrls(input[i], urls, replace, base); } return (count < Object.keys(urls).length); } else if(_isObject(input)) { for(var key in input) { if(key !== '@context') { _findContextUrls(input[key], urls, replace, base); continue; } // get @context var ctx = input[key]; // array @context if(_isArray(ctx)) { var length = ctx.length; for(var i = 0; i < length; ++i) { var _ctx = ctx[i]; if(_isString(_ctx)) { _ctx = _prependBase(base, _ctx); // replace w/@context if requested if(replace) { _ctx = urls[_ctx]; if(_isArray(_ctx)) { // add flattened context Array.prototype.splice.apply(ctx, [i, 1].concat(_ctx)); i += _ctx.length; length += _ctx.length; } else { ctx[i] = _ctx; } } // @context URL found else if(!(_ctx in urls)) { urls[_ctx] = false; } } } } // string @context else if(_isString(ctx)) { ctx = _prependBase(base, ctx); // replace w/@context if requested if(replace) { input[key] = urls[ctx]; } // @context URL found else if(!(ctx in urls)) { urls[ctx] = false; } } } return (count < Object.keys(urls).length); } return false; } /** * Retrieves external @context URLs using the given document loader. Every * instance of @context in the input that refers to a URL will be replaced * with the JSON @context found at that URL. * * @param input the JSON-LD input with possible contexts. * @param options the options to use: * documentLoader(url, callback(err, remoteDoc)) the document loader. * @param callback(err, input) called once the operation completes. */ function _retrieveContextUrls(input, options, callback) { // if any error occurs during URL resolution, quit var error = null; var regex = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; // recursive document loader var documentLoader = options.documentLoader; var retrieve = function(input, cycles, documentLoader, base, callback) { if(Object.keys(cycles).length > MAX_CONTEXT_URLS) { error = new JsonLdError( 'Maximum number of @context URLs exceeded.', 'jsonld.ContextUrlError', {code: 'loading remote context failed', max: MAX_CONTEXT_URLS}); return callback(error); } // for tracking the URLs to retrieve var urls = {}; // finished will be called once the URL queue is empty var finished = function() { // replace all URLs in the input _findContextUrls(input, urls, true, base); callback(null, input); }; // find all URLs in the given input if(!_findContextUrls(input, urls, false, base)) { // no new URLs in input finished(); } // queue all unretrieved URLs var queue = []; for(var url in urls) { if(urls[url] === false) { // validate URL if(!regex.test(url)) { error = new JsonLdError( 'Malformed URL.', 'jsonld.InvalidUrl', {code: 'loading remote context failed', url: url}); return callback(error); } queue.push(url); } } // retrieve URLs in queue var count = queue.length; for(var i = 0; i < queue.length; ++i) { (function(url) { // check for context URL cycle if(url in cycles) { error = new JsonLdError( 'Cyclical @context URLs detected.', 'jsonld.ContextUrlError', {code: 'recursive context inclusion', url: url}); return callback(error); } var _cycles = _clone(cycles); _cycles[url] = true; var done = function(err, remoteDoc) { // short-circuit if there was an error with another URL if(error) { return; } var ctx = remoteDoc ? remoteDoc.document : null; // parse string context as JSON if(!err && _isString(ctx)) { try { ctx = JSON.parse(ctx); } catch(ex) { err = ex; } } // ensure ctx is an object if(err) { err = new JsonLdError( 'Derefencing a URL did not result in a valid JSON-LD object. ' + 'Possible causes are an inaccessible URL perhaps due to ' + 'a same-origin policy (ensure the server uses CORS if you are ' + 'using client-side JavaScript), too many redirects, a ' + 'non-JSON response, or more than one HTTP Link Header was ' + 'provided for a remote context.', 'jsonld.InvalidUrl', {code: 'loading remote context failed', url: url, cause: err}); } else if(!_isObject(ctx)) { err = new JsonLdError( 'Derefencing a URL did not result in a JSON object. The ' + 'response was valid JSON, but it was not a JSON object.', 'jsonld.InvalidUrl', {code: 'invalid remote context', url: url, cause: err}); } if(err) { error = err; return callback(error); } // use empty context if no @context key is present if(!('@context' in ctx)) { ctx = {'@context': {}}; } else { ctx = {'@context': ctx['@context']}; } // append context URL to context if given if(remoteDoc.contextUrl) { if(!_isArray(ctx['@context'])) { ctx['@context'] = [ctx['@context']]; } ctx['@context'].push(remoteDoc.contextUrl); } // recurse retrieve(ctx, _cycles, documentLoader, url, function(err, ctx) { if(err) { return callback(err); } urls[url] = ctx['@context']; count -= 1; if(count === 0) { finished(); } }); }; var promise = documentLoader(url, done); if(promise && 'then' in promise) { promise.then(done.bind(null, null), done); } }(queue[i])); } }; retrieve(input, {}, documentLoader, options.base, callback); } // define js 1.8.5 Object.keys method if not present if(!Object.keys) { Object.keys = function(o) { if(o !== Object(o)) { throw new TypeError('Object.keys called on non-object'); } var rval = []; for(var p in o) { if(Object.prototype.hasOwnProperty.call(o, p)) { rval.push(p); } } return rval; }; } /** * Parses RDF in the form of N-Quads. * * @param input the N-Quads input to parse. * * @return an RDF dataset. */ function _parseNQuads(input) { // define partial regexes var iri = '(?:<([^:]+:[^>]*)>)'; var bnode = '(_:(?:[A-Za-z0-9]+))'; var plain = '"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"'; var datatype = '(?:\\^\\^' + iri + ')'; var language = '(?:@([a-z]+(?:-[a-z0-9]+)*))'; var literal = '(?:' + plain + '(?:' + datatype + '|' + language + ')?)'; var ws = '[ \\t]+'; var wso = '[ \\t]*'; var eoln = /(?:\r\n)|(?:\n)|(?:\r)/g; var empty = new RegExp('^' + wso + '$'); // define quad part regexes var subject = '(?:' + iri + '|' + bnode + ')' + ws; var property = iri + ws; var object = '(?:' + iri + '|' + bnode + '|' + literal + ')' + wso; var graphName = '(?:\\.|(?:(?:' + iri + '|' + bnode + ')' + wso + '\\.))'; // full quad regex var quad = new RegExp( '^' + wso + subject + property + object + graphName + wso + '$'); // build RDF dataset var dataset = {}; // split N-Quad input into lines var lines = input.split(eoln); var lineNumber = 0; for(var li = 0; li < lines.length; ++li) { var line = lines[li]; lineNumber++; // skip empty lines if(empty.test(line)) { continue; } // parse quad var match = line.match(quad); if(match === null) { throw new JsonLdError( 'Error while parsing N-Quads; invalid quad.', 'jsonld.ParseError', {line: lineNumber}); } // create RDF triple var triple = {}; // get subject if(!_isUndefined(match[1])) { triple.subject = {type: 'IRI', value: match[1]}; } else { triple.subject = {type: 'blank node', value: match[2]}; } // get predicate triple.predicate = {type: 'IRI', value: match[3]}; // get object if(!_isUndefined(match[4])) { triple.object = {type: 'IRI', value: match[4]}; } else if(!_isUndefined(match[5])) { triple.object = {type: 'blank node', value: match[5]}; } else { triple.object = {type: 'literal'}; if(!_isUndefined(match[7])) { triple.object.datatype = match[7]; } else if(!_isUndefined(match[8])) { triple.object.datatype = RDF_LANGSTRING; triple.object.language = match[8]; } else { triple.object.datatype = XSD_STRING; } var unescaped = match[6] .replace(/\\"/g, '"') .replace(/\\t/g, '\t') .replace(/\\n/g, '\n') .replace(/\\r/g, '\r') .replace(/\\\\/g, '\\'); triple.object.value = unescaped; } // get graph name ('@default' is used for the default graph) var name = '@default'; if(!_isUndefined(match[9])) { name = match[9]; } else if(!_isUndefined(match[10])) { name = match[10]; } // initialize graph in dataset if(!(name in dataset)) { dataset[name] = [triple]; } // add triple if unique to its graph else { var unique = true; var triples = dataset[name]; for(var ti = 0; unique && ti < triples.length; ++ti) { if(_compareRDFTriples(triples[ti], triple)) { unique = false; } } if(unique) { triples.push(triple); } } } return dataset; } // register the N-Quads RDF parser jsonld.registerRDFParser('application/nquads', _parseNQuads); /** * Converts an RDF dataset to N-Quads. * * @param dataset the RDF dataset to convert. * * @return the N-Quads string. */ function _toNQuads(dataset) { var quads = []; for(var graphName in dataset) { var triples = dataset[graphName]; for(var ti = 0; ti < triples.length; ++ti) { var triple = triples[ti]; if(graphName === '@default') { graphName = null; } quads.push(_toNQuad(triple, graphName)); } } quads.sort(); return quads.join(''); } /** * Converts an RDF triple and graph name to an N-Quad string (a single quad). * * @param triple the RDF triple to convert. * @param graphName the name of the graph containing the triple, null for * the default graph. * @param bnode the bnode the quad is mapped to (optional, for use * during normalization only). * * @return the N-Quad string. */ function _toNQuad(triple, graphName, bnode) { var s = triple.subject; var p = triple.predicate; var o = triple.object; var g = graphName; var quad = ''; // subject is an IRI if(s.type === 'IRI') { quad += '<' + s.value + '>'; } // bnode normalization mode else if(bnode) { quad += (s.value === bnode) ? '_:a' : '_:z'; } // bnode normal mode else { quad += s.value; } quad += ' '; // predicate is an IRI if(p.type === 'IRI') { quad += '<' + p.value + '>'; } // FIXME: TBD what to do with bnode predicates during normalization // bnode normalization mode else if(bnode) { quad += '_:p'; } // bnode normal mode else { quad += p.value; } quad += ' '; // object is IRI, bnode, or literal if(o.type === 'IRI') { quad += '<' + o.value + '>'; } else if(o.type === 'blank node') { // normalization mode if(bnode) { quad += (o.value === bnode) ? '_:a' : '_:z'; } // normal mode else { quad += o.value; } } else { var escaped = o.value .replace(/\\/g, '\\\\') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\r/g, '\\r') .replace(/\"/g, '\\"'); quad += '"' + escaped + '"'; if(o.datatype === RDF_LANGSTRING) { if(o.language) { quad += '@' + o.language; } } else if(o.datatype !== XSD_STRING) { quad += '^^<' + o.datatype + '>'; } } // graph if(g !== null) { if(g.indexOf('_:') !== 0) { quad += ' <' + g + '>'; } else if(bnode) { quad += ' _:g'; } else { quad += ' ' + g; } } quad += ' .\n'; return quad; } /** * Parses the RDF dataset found via the data object from the RDFa API. * * @param data the RDFa API data object. * * @return the RDF dataset. */ function _parseRdfaApiData(data) { var dataset = {}; dataset['@default'] = []; var subjects = data.getSubjects(); for(var si = 0; si < subjects.length; ++si) { var subject = subjects[si]; if(subject === null) { continue; } // get all related triples var triples = data.getSubjectTriples(subject); if(triples === null) { continue; } var predicates = triples.predicates; for(var predicate in predicates) { // iterate over objects var objects = predicates[predicate].objects; for(var oi = 0; oi < objects.length; ++oi) { var object = objects[oi]; // create RDF triple var triple = {}; // add subject if(subject.indexOf('_:') === 0) { triple.subject = {type: 'blank node', value: subject}; } else { triple.subject = {type: 'IRI', value: subject}; } // add predicate if(predicate.indexOf('_:') === 0) { triple.predicate = {type: 'blank node', value: predicate}; } else { triple.predicate = {type: 'IRI', value: predicate}; } // serialize XML literal var value = object.value; if(object.type === RDF_XML_LITERAL) { // initialize XMLSerializer if(!XMLSerializer) { _defineXMLSerializer(); } var serializer = new XMLSerializer(); value = ''; for(var x = 0; x < object.value.length; x++) { if(object.value[x].nodeType === Node.ELEMENT_NODE) { value += serializer.serializeToString(object.value[x]); } else if(object.value[x].nodeType === Node.TEXT_NODE) { value += object.value[x].nodeValue; } } } // add object triple.object = {}; // object is an IRI if(object.type === RDF_OBJECT) { if(object.value.indexOf('_:') === 0) { triple.object.type = 'blank node'; } else { triple.object.type = 'IRI'; } } // literal else { triple.object.type = 'literal'; if(object.type === RDF_PLAIN_LITERAL) { if(object.language) { triple.object.datatype = RDF_LANGSTRING; triple.object.language = object.language; } else { triple.object.datatype = XSD_STRING; } } else { triple.object.datatype = object.type; } } triple.object.value = value; // add triple to dataset in default graph dataset['@default'].push(triple); } } } return dataset; } // register the RDFa API RDF parser jsonld.registerRDFParser('rdfa-api', _parseRdfaApiData); /** * Creates a new UniqueNamer. A UniqueNamer issues unique names, keeping * track of any previously issued names. * * @param prefix the prefix to use ('<prefix><counter>'). */ function UniqueNamer(prefix) { this.prefix = prefix; this.counter = 0; this.existing = {}; } /** * Copies this UniqueNamer. * * @return a copy of this UniqueNamer. */ UniqueNamer.prototype.clone = function() { var copy = new UniqueNamer(this.prefix); copy.counter = this.counter; copy.existing = _clone(this.existing); return copy; }; /** * Gets the new name for the given old name, where if no old name is given * a new name will be generated. * * @param [oldName] the old name to get the new name for. * * @return the new name. */ UniqueNamer.prototype.getName = function(oldName) { // return existing old name if(oldName && oldName in this.existing) { return this.existing[oldName]; } // get next name var name = this.prefix + this.counter; this.counter += 1; // save mapping if(oldName) { this.existing[oldName] = name; } return name; }; /** * Returns true if the given oldName has already been assigned a new name. * * @param oldName the oldName to check. * * @return true if the oldName has been assigned a new name, false if not. */ UniqueNamer.prototype.isNamed = function(oldName) { return (oldName in this.existing); }; /** * A Permutator iterates over all possible permutations of the given array * of elements. * * @param list the array of elements to iterate over. */ var Permutator = function(list) { // original array this.list = list.sort(); // indicates whether there are more permutations this.done = false; // directional info for permutation algorithm this.left = {}; for(var i = 0; i < list.length; ++i) { this.left[list[i]] = true; } }; /** * Returns true if there is another permutation. * * @return true if there is another permutation, false if not. */ Permutator.prototype.hasNext = function() { return !this.done; }; /** * Gets the next permutation. Call hasNext() to ensure there is another one * first. * * @return the next permutation. */ Permutator.prototype.next = function() { // copy current permutation var rval = this.list.slice(); /* Calculate the next permutation using the Steinhaus-Johnson-Trotter permutation algorithm. */ // get largest mobile element k // (mobile: element is greater than the one it is looking at) var k = null; var pos = 0; var length = this.list.length; for(var i = 0; i < length; ++i) { var element = this.list[i]; var left = this.left[element]; if((k === null || element > k) && ((left && i > 0 && element > this.list[i - 1]) || (!left && i < (length - 1) && element > this.list[i + 1]))) { k = element; pos = i; } } // no more permutations if(k === null) { this.done = true; } else { // swap k and the element it is looking at var swap = this.left[k] ? pos - 1 : pos + 1; this.list[pos] = this.list[swap]; this.list[swap] = k; // reverse the direction of all elements larger than k for(var i = 0; i < length; ++i) { if(this.list[i] > k) { this.left[this.list[i]] = !this.left[this.list[i]]; } } } return rval; }; // SHA-1 API var sha1 = jsonld.sha1 = {}; if(_nodejs) { var crypto = require('crypto'); sha1.create = function() { var md = crypto.createHash('sha1'); return { update: function(data) { md.update(data, 'utf8'); }, digest: function() { return md.digest('hex'); } }; }; } else { sha1.create = function() { return new sha1.MessageDigest(); }; } /** * Hashes the given array of quads and returns its hexadecimal SHA-1 message * digest. * * @param nquads the list of serialized quads to hash. * * @return the hexadecimal SHA-1 message digest. */ sha1.hash = function(nquads) { var md = sha1.create(); for(var i = 0; i < nquads.length; ++i) { md.update(nquads[i]); } return md.digest(); }; // only define sha1 MessageDigest for non-nodejs if(!_nodejs) { /** * Creates a simple byte buffer for message digest operations. */ sha1.Buffer = function() { this.data = ''; this.read = 0; }; /** * Puts a 32-bit integer into this buffer in big-endian order. * * @param i the 32-bit integer. */ sha1.Buffer.prototype.putInt32 = function(i) { this.data += ( String.fromCharCode(i >> 24 & 0xFF) + String.fromCharCode(i >> 16 & 0xFF) + String.fromCharCode(i >> 8 & 0xFF) + String.fromCharCode(i & 0xFF)); }; /** * Gets a 32-bit integer from this buffer in big-endian order and * advances the read pointer by 4. * * @return the word. */ sha1.Buffer.prototype.getInt32 = function() { var rval = ( this.data.charCodeAt(this.read) << 24 ^ this.data.charCodeAt(this.read + 1) << 16 ^ this.data.charCodeAt(this.read + 2) << 8 ^ this.data.charCodeAt(this.read + 3)); this.read += 4; return rval; }; /** * Gets the bytes in this buffer. * * @return a string full of UTF-8 encoded characters. */ sha1.Buffer.prototype.bytes = function() { return this.data.slice(this.read); }; /** * Gets the number of bytes in this buffer. * * @return the number of bytes in this buffer. */ sha1.Buffer.prototype.length = function() { return this.data.length - this.read; }; /** * Compacts this buffer. */ sha1.Buffer.prototype.compact = function() { this.data = this.data.slice(this.read); this.read = 0; }; /** * Converts this buffer to a hexadecimal string. * * @return a hexadecimal string. */ sha1.Buffer.prototype.toHex = function() { var rval = ''; for(var i = this.read; i < this.data.length; ++i) { var b = this.data.charCodeAt(i); if(b < 16) { rval += '0'; } rval += b.toString(16); } return rval; }; /** * Creates a SHA-1 message digest object. * * @return a message digest object. */ sha1.MessageDigest = function() { // do initialization as necessary if(!_sha1.initialized) { _sha1.init(); } this.blockLength = 64; this.digestLength = 20; // length of message so far (does not including padding) this.messageLength = 0; // input buffer this.input = new sha1.Buffer(); // for storing words in the SHA-1 algorithm this.words = new Array(80); // SHA-1 state contains five 32-bit integers this.state = { h0: 0x67452301, h1: 0xEFCDAB89, h2: 0x98BADCFE, h3: 0x10325476, h4: 0xC3D2E1F0 }; }; /** * Updates the digest with the given string input. * * @param msg the message input to update with. */ sha1.MessageDigest.prototype.update = function(msg) { // UTF-8 encode message msg = unescape(encodeURIComponent(msg)); // update message length and input buffer this.messageLength += msg.length; this.input.data += msg; // process input _sha1.update(this.state, this.words, this.input); // compact input buffer every 2K or if empty if(this.input.read > 2048 || this.input.length() === 0) { this.input.compact(); } }; /** * Produces the digest. * * @return the digest as a hexadecimal string. */ sha1.MessageDigest.prototype.digest = function() { /* Determine the number of bytes that must be added to the message to ensure its length is congruent to 448 mod 512. In other words, a 64-bit integer that gives the length of the message will be appended to the message and whatever the length of the message is plus 64 bits must be a multiple of 512. So the length of the message must be congruent to 448 mod 512 because 512 - 64 = 448. In order to fill up the message length it must be filled with padding that begins with 1 bit followed by all 0 bits. Padding must *always* be present, so if the message length is already congruent to 448 mod 512, then 512 padding bits must be added. */ // 512 bits == 64 bytes, 448 bits == 56 bytes, 64 bits = 8 bytes // _padding starts with 1 byte with first bit is set in it which // is byte value 128, then there may be up to 63 other pad bytes var len = this.messageLength; var padBytes = new sha1.Buffer(); padBytes.data += this.input.bytes(); padBytes.data += _sha1.padding.substr(0, 64 - ((len + 8) % 64)); /* Now append length of the message. The length is appended in bits as a 64-bit number in big-endian order. Since we store the length in bytes, we must multiply it by 8 (or left shift by 3). So here store the high 3 bits in the low end of the first 32-bits of the 64-bit number and the lower 5 bits in the high end of the second 32-bits. */ padBytes.putInt32((len >>> 29) & 0xFF); padBytes.putInt32((len << 3) & 0xFFFFFFFF); _sha1.update(this.state, this.words, padBytes); var rval = new sha1.Buffer(); rval.putInt32(this.state.h0); rval.putInt32(this.state.h1); rval.putInt32(this.state.h2); rval.putInt32(this.state.h3); rval.putInt32(this.state.h4); return rval.toHex(); }; // private SHA-1 data var _sha1 = { padding: null, initialized: false }; /** * Initializes the constant tables. */ _sha1.init = function() { // create padding _sha1.padding = String.fromCharCode(128); var c = String.fromCharCode(0x00); var n = 64; while(n > 0) { if(n & 1) { _sha1.padding += c; } n >>>= 1; if(n > 0) { c += c; } } // now initialized _sha1.initialized = true; }; /** * Updates a SHA-1 state with the given byte buffer. * * @param s the SHA-1 state to update. * @param w the array to use to store words. * @param input the input byte buffer. */ _sha1.update = function(s, w, input) { // consume 512 bit (64 byte) chunks var t, a, b, c, d, e, f, i; var len = input.length(); while(len >= 64) { // the w array will be populated with sixteen 32-bit big-endian words // and then extended into 80 32-bit words according to SHA-1 algorithm // and for 32-79 using Max Locktyukhin's optimization // initialize hash value for this chunk a = s.h0; b = s.h1; c = s.h2; d = s.h3; e = s.h4; // round 1 for(i = 0; i < 16; ++i) { t = input.getInt32(); w[i] = t; f = d ^ (b & (c ^ d)); t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } for(; i < 20; ++i) { t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); t = (t << 1) | (t >>> 31); w[i] = t; f = d ^ (b & (c ^ d)); t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // round 2 for(; i < 32; ++i) { t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); t = (t << 1) | (t >>> 31); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } for(; i < 40; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // round 3 for(; i < 60; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = (b & c) | (d & (b ^ c)); t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // round 4 for(; i < 80; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // update hash state s.h0 += a; s.h1 += b; s.h2 += c; s.h3 += d; s.h4 += e; len -= 64; } }; } // end non-nodejs if(!XMLSerializer) { var _defineXMLSerializer = function() { XMLSerializer = require('xmldom').XMLSerializer; }; } // end _defineXMLSerializer // define URL parser jsonld.url = {}; if(_nodejs) { var parse = require('url').parse; jsonld.url.parse = function(url) { var parsed = parse(url); parsed.pathname = parsed.pathname || ''; _parseAuthority(parsed); parsed.normalizedPath = _removeDotSegments( parsed.pathname, parsed.authority !== ''); return parsed; }; } else { // parseUri 1.2.2 // (c) Steven Levithan <stevenlevithan.com> // MIT License var parseUri = {}; parseUri.options = { key: ['href','protocol','host','auth','user','password','hostname','port','relative','path','directory','file','query','hash'], parser: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/ }; jsonld.url.parse = function(str) { var o = parseUri.options; var m = o.parser.exec(str); var uri = {}; var i = 14; while(i--) { uri[o.key[i]] = m[i] || ''; } // normalize to node.js API if(uri.host && uri.path === '') { uri.path = '/'; } uri.pathname = uri.path || ''; _parseAuthority(uri); uri.normalizedPath = _removeDotSegments(uri.pathname, uri.authority !== ''); if(uri.query) { uri.path = uri.path + '?' + uri.query; } if(uri.protocol) { uri.protocol += ':'; } if(uri.hash) { uri.hash = '#' + uri.hash; } return uri; }; } /** * Parses the authority for the pre-parsed given URL. * * @param parsed the pre-parsed URL. */ function _parseAuthority(parsed) { // parse authority for unparsed relative network-path reference if(parsed.href.indexOf(':') === -1 && parsed.href.indexOf('//') === 0 && !parsed.host) { // must parse authority from pathname parsed.pathname = parsed.pathname.substr(2); var idx = parsed.pathname.indexOf('/'); if(idx === -1) { parsed.authority = parsed.pathname; parsed.pathname = ''; } else { parsed.authority = parsed.pathname.substr(0, idx); parsed.pathname = parsed.pathname.substr(idx); } } else { // construct authority parsed.authority = parsed.host || ''; if(parsed.auth) { parsed.authority = parsed.auth + '@' + parsed.authority; } } } /** * Removes dot segments from a URL path. * * @param path the path to remove dot segments from. * @param hasAuthority true if the URL has an authority, false if not. */ function _removeDotSegments(path, hasAuthority) { var rval = ''; if(path.indexOf('/') === 0) { rval = '/'; } // RFC 3986 5.2.4 (reworked) var input = path.split('/'); var output = []; while(input.length > 0) { if(input[0] === '.' || (input[0] === '' && input.length > 1)) { input.shift(); continue; } if(input[0] === '..') { input.shift(); if(hasAuthority || (output.length > 0 && output[output.length - 1] !== '..')) { output.pop(); } // leading relative URL '..' else { output.push('..'); } continue; } output.push(input.shift()); } return rval + output.join('/'); } // use node document loader by default if(_nodejs) { jsonld.useDocumentLoader('node'); } // use xhr document loader by default else if(typeof XMLHttpRequest !== 'undefined') { jsonld.useDocumentLoader('xhr'); } if(_nodejs) { jsonld.use = function(extension) { switch(extension) { case 'request': // use node JSON-LD request extension jsonld.request = require('./request'); break; default: throw new JsonLdError( 'Unknown extension.', 'jsonld.UnknownExtension', {extension: extension}); } }; } // end of jsonld API factory return jsonld; }; // external APIs: // used to generate a new jsonld API instance var factory = function() { return wrapper(function() { return factory(); }); }; // the shared global jsonld API instance wrapper(factory); // export nodejs API if(_nodejs) { module.exports = factory; } // export AMD API else if(typeof define === 'function' && define.amd) { define([], function() { return factory; }); } // export simple browser API else if(_browser) { if(typeof jsonld === 'undefined') { jsonld = jsonldjs = factory; } else { jsonldjs = factory; } } })();
bseib/cdnjs
ajax/libs/jsonld/0.2.7/jsonld.js
JavaScript
mit
200,091
/* YUI 3.16.0 (build 76f0e08) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/yui-nodejs/yui-nodejs.js']) { __coverage__['build/yui-nodejs/yui-nodejs.js'] = {"path":"build/yui-nodejs/yui-nodejs.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"221":0,"222":0,"223":0,"224":0,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0,"237":0,"238":0,"239":0,"240":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0,"251":0,"252":0,"253":0,"254":0,"255":0,"256":0,"257":0,"258":0,"259":0,"260":0,"261":0,"262":0,"263":0,"264":0,"265":0,"266":0,"267":0,"268":0,"269":0,"270":0,"271":0,"272":0,"273":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"287":0,"288":0,"289":0,"290":0,"291":0,"292":0,"293":0,"294":0,"295":0,"296":0,"297":0,"298":0,"299":0,"300":0,"301":0,"302":0,"303":0,"304":0,"305":0,"306":0,"307":0,"308":0,"309":0,"310":0,"311":0,"312":0,"313":0,"314":0,"315":0,"316":0,"317":0,"318":0,"319":0,"320":0,"321":0,"322":0,"323":0,"324":0,"325":0,"326":0,"327":0,"328":0,"329":0,"330":0,"331":0,"332":0,"333":0,"334":0,"335":0,"336":0,"337":0,"338":0,"339":0,"340":0,"341":0,"342":0,"343":0,"344":0,"345":0,"346":0,"347":0,"348":0,"349":0,"350":0,"351":0,"352":0,"353":0,"354":0,"355":0,"356":0,"357":0,"358":0,"359":0,"360":0,"361":0,"362":0,"363":0,"364":0,"365":0,"366":0,"367":0,"368":0,"369":0,"370":0,"371":0,"372":0,"373":0,"374":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":0,"381":0,"382":0,"383":0,"384":0,"385":0,"386":0,"387":0,"388":0,"389":0,"390":0,"391":0,"392":0,"393":0,"394":0,"395":0,"396":0,"397":0,"398":0,"399":0,"400":0,"401":0,"402":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"411":0,"412":0,"413":0,"414":0,"415":0,"416":0,"417":0,"418":0,"419":0,"420":0,"421":0,"422":0,"423":0,"424":0,"425":0,"426":0,"427":0,"428":0,"429":0,"430":0,"431":0,"432":0,"433":0,"434":0,"435":0,"436":0,"437":0,"438":0,"439":0,"440":0,"441":0,"442":0,"443":0,"444":0,"445":0,"446":0,"447":0,"448":0,"449":0,"450":0,"451":0,"452":0,"453":0,"454":0,"455":0,"456":0,"457":0,"458":0,"459":0,"460":0,"461":0,"462":0,"463":0,"464":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"471":0,"472":0,"473":0,"474":0,"475":0,"476":0,"477":0,"478":0,"479":0,"480":0,"481":0,"482":0,"483":0,"484":0,"485":0,"486":0,"487":0,"488":0,"489":0,"490":0,"491":0,"492":0,"493":0,"494":0,"495":0,"496":0,"497":0,"498":0,"499":0,"500":0,"501":0,"502":0,"503":0,"504":0,"505":0,"506":0,"507":0,"508":0,"509":0,"510":0,"511":0,"512":0,"513":0,"514":0,"515":0,"516":0,"517":0,"518":0,"519":0,"520":0,"521":0,"522":0,"523":0,"524":0,"525":0,"526":0,"527":0,"528":0,"529":0,"530":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"539":0,"540":0,"541":0,"542":0,"543":0,"544":0,"545":0,"546":0,"547":0,"548":0,"549":0,"550":0,"551":0,"552":0,"553":0,"554":0,"555":0,"556":0,"557":0,"558":0,"559":0,"560":0,"561":0,"562":0,"563":0,"564":0,"565":0,"566":0,"567":0,"568":0,"569":0,"570":0,"571":0,"572":0,"573":0,"574":0,"575":0,"576":0,"577":0,"578":0,"579":0,"580":0,"581":0,"582":0,"583":0,"584":0,"585":0,"586":0,"587":0,"588":0,"589":0,"590":0,"591":0,"592":0,"593":0,"594":0,"595":0,"596":0,"597":0,"598":0,"599":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"609":0,"610":0,"611":0,"612":0,"613":0,"614":0,"615":0,"616":0,"617":0,"618":0,"619":0,"620":0,"621":0,"622":0,"623":0,"624":0,"625":0,"626":0,"627":0,"628":0,"629":0,"630":0,"631":0,"632":0,"633":0,"634":0,"635":0,"636":0,"637":0,"638":0,"639":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"648":0,"649":0,"650":0,"651":0,"652":0,"653":0,"654":0,"655":0,"656":0,"657":0,"658":0,"659":0,"660":0,"661":0,"662":0,"663":0,"664":0,"665":0,"666":0,"667":0,"668":0,"669":0,"670":0,"671":0,"672":0,"673":0,"674":0,"675":0,"676":0,"677":0,"678":0,"679":0,"680":0,"681":0,"682":0,"683":0,"684":0,"685":0,"686":0,"687":0,"688":0,"689":0,"690":0,"691":0,"692":0,"693":0,"694":0,"695":0,"696":0,"697":0,"698":0,"699":0,"700":0,"701":0,"702":0,"703":0,"704":0,"705":0,"706":0,"707":0,"708":0,"709":0,"710":0,"711":0,"712":0,"713":0,"714":0,"715":0,"716":0,"717":0,"718":0,"719":0,"720":0,"721":0,"722":0,"723":0,"724":0,"725":0,"726":0,"727":0,"728":0,"729":0,"730":0,"731":0,"732":0,"733":0,"734":0,"735":0,"736":0,"737":0,"738":0,"739":0,"740":0,"741":0,"742":0,"743":0,"744":0,"745":0,"746":0,"747":0,"748":0,"749":0,"750":0,"751":0,"752":0,"753":0,"754":0,"755":0,"756":0,"757":0,"758":0,"759":0,"760":0,"761":0,"762":0,"763":0,"764":0,"765":0,"766":0,"767":0,"768":0,"769":0,"770":0,"771":0,"772":0,"773":0,"774":0,"775":0,"776":0,"777":0,"778":0,"779":0,"780":0,"781":0,"782":0,"783":0,"784":0,"785":0,"786":0,"787":0,"788":0,"789":0,"790":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"797":0,"798":0,"799":0,"800":0,"801":0,"802":0,"803":0,"804":0,"805":0,"806":0,"807":0,"808":0,"809":0,"810":0,"811":0,"812":0,"813":0,"814":0,"815":0,"816":0,"817":0,"818":0,"819":0,"820":0,"821":0,"822":0,"823":0,"824":0,"825":0,"826":0,"827":0,"828":0,"829":0,"830":0,"831":0,"832":0,"833":0,"834":0,"835":0,"836":0,"837":0,"838":0,"839":0,"840":0,"841":0,"842":0,"843":0,"844":0,"845":0,"846":0,"847":0,"848":0,"849":0,"850":0,"851":0,"852":0,"853":0,"854":0,"855":0,"856":0,"857":0,"858":0,"859":0,"860":0,"861":0,"862":0,"863":0,"864":0,"865":0,"866":0,"867":0,"868":0,"869":0,"870":0,"871":0,"872":0,"873":0,"874":0,"875":0,"876":0,"877":0,"878":0},"b":{"1":[0,0],"2":[0,0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0,0],"49":[0,0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0,0],"62":[0,0],"63":[0,0],"64":[0,0],"65":[0,0],"66":[0,0],"67":[0,0],"68":[0,0],"69":[0,0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0],"74":[0,0],"75":[0,0],"76":[0,0],"77":[0,0],"78":[0,0],"79":[0,0],"80":[0,0],"81":[0,0],"82":[0,0],"83":[0,0],"84":[0,0],"85":[0,0,0,0,0],"86":[0,0],"87":[0,0],"88":[0,0],"89":[0,0,0],"90":[0,0],"91":[0,0],"92":[0,0],"93":[0,0],"94":[0,0],"95":[0,0],"96":[0,0],"97":[0,0],"98":[0,0],"99":[0,0,0,0],"100":[0,0],"101":[0,0],"102":[0,0],"103":[0,0],"104":[0,0],"105":[0,0],"106":[0,0],"107":[0,0],"108":[0,0],"109":[0,0],"110":[0,0],"111":[0,0],"112":[0,0],"113":[0,0],"114":[0,0],"115":[0,0],"116":[0,0],"117":[0,0],"118":[0,0],"119":[0,0],"120":[0,0],"121":[0,0],"122":[0,0],"123":[0,0],"124":[0,0],"125":[0,0],"126":[0,0],"127":[0,0],"128":[0,0],"129":[0,0],"130":[0,0],"131":[0,0],"132":[0,0],"133":[0,0],"134":[0,0],"135":[0,0],"136":[0,0],"137":[0,0],"138":[0,0],"139":[0,0],"140":[0,0],"141":[0,0],"142":[0,0],"143":[0,0],"144":[0,0],"145":[0,0],"146":[0,0],"147":[0,0],"148":[0,0],"149":[0,0],"150":[0,0],"151":[0,0],"152":[0,0],"153":[0,0],"154":[0,0],"155":[0,0],"156":[0,0],"157":[0,0],"158":[0,0],"159":[0,0],"160":[0,0],"161":[0,0],"162":[0,0],"163":[0,0],"164":[0,0,0],"165":[0,0],"166":[0,0],"167":[0,0],"168":[0,0],"169":[0,0,0],"170":[0,0],"171":[0,0],"172":[0,0,0],"173":[0,0],"174":[0,0],"175":[0,0],"176":[0,0,0],"177":[0,0],"178":[0,0],"179":[0,0,0,0],"180":[0,0],"181":[0,0],"182":[0,0],"183":[0,0],"184":[0,0],"185":[0,0],"186":[0,0],"187":[0,0],"188":[0,0],"189":[0,0],"190":[0,0],"191":[0,0],"192":[0,0,0],"193":[0,0],"194":[0,0],"195":[0,0],"196":[0,0],"197":[0,0],"198":[0,0],"199":[0,0],"200":[0,0],"201":[0,0],"202":[0,0],"203":[0,0,0],"204":[0,0],"205":[0,0,0],"206":[0,0],"207":[0,0,0,0,0,0],"208":[0,0,0,0],"209":[0,0],"210":[0,0],"211":[0,0],"212":[0,0],"213":[0,0],"214":[0,0],"215":[0,0],"216":[0,0],"217":[0,0],"218":[0,0],"219":[0,0],"220":[0,0,0],"221":[0,0],"222":[0,0],"223":[0,0],"224":[0,0],"225":[0,0],"226":[0,0],"227":[0,0],"228":[0,0],"229":[0,0],"230":[0,0],"231":[0,0],"232":[0,0],"233":[0,0,0],"234":[0,0],"235":[0,0],"236":[0,0],"237":[0,0],"238":[0,0],"239":[0,0],"240":[0,0],"241":[0,0],"242":[0,0],"243":[0,0],"244":[0,0],"245":[0,0],"246":[0,0],"247":[0,0],"248":[0,0],"249":[0,0],"250":[0,0,0,0],"251":[0,0],"252":[0,0],"253":[0,0],"254":[0,0],"255":[0,0],"256":[0,0,0],"257":[0,0],"258":[0,0],"259":[0,0],"260":[0,0],"261":[0,0],"262":[0,0],"263":[0,0],"264":[0,0],"265":[0,0],"266":[0,0],"267":[0,0],"268":[0,0],"269":[0,0],"270":[0,0],"271":[0,0],"272":[0,0],"273":[0,0],"274":[0,0],"275":[0,0,0,0],"276":[0,0],"277":[0,0],"278":[0,0],"279":[0,0],"280":[0,0],"281":[0,0,0,0],"282":[0,0],"283":[0,0],"284":[0,0],"285":[0,0],"286":[0,0],"287":[0,0],"288":[0,0],"289":[0,0],"290":[0,0],"291":[0,0],"292":[0,0],"293":[0,0],"294":[0,0],"295":[0,0],"296":[0,0],"297":[0,0],"298":[0,0],"299":[0,0],"300":[0,0],"301":[0,0],"302":[0,0],"303":[0,0],"304":[0,0],"305":[0,0],"306":[0,0],"307":[0,0],"308":[0,0],"309":[0,0],"310":[0,0],"311":[0,0],"312":[0,0],"313":[0,0,0],"314":[0,0],"315":[0,0],"316":[0,0],"317":[0,0],"318":[0,0],"319":[0,0],"320":[0,0],"321":[0,0],"322":[0,0],"323":[0,0],"324":[0,0],"325":[0,0],"326":[0,0],"327":[0,0],"328":[0,0],"329":[0,0],"330":[0,0],"331":[0,0],"332":[0,0],"333":[0,0],"334":[0,0],"335":[0,0],"336":[0,0],"337":[0,0],"338":[0,0],"339":[0,0],"340":[0,0],"341":[0,0],"342":[0,0],"343":[0,0],"344":[0,0],"345":[0,0],"346":[0,0],"347":[0,0],"348":[0,0],"349":[0,0],"350":[0,0],"351":[0,0],"352":[0,0],"353":[0,0],"354":[0,0,0],"355":[0,0],"356":[0,0],"357":[0,0],"358":[0,0],"359":[0,0],"360":[0,0],"361":[0,0],"362":[0,0],"363":[0,0],"364":[0,0],"365":[0,0],"366":[0,0],"367":[0,0],"368":[0,0,0],"369":[0,0],"370":[0,0],"371":[0,0],"372":[0,0],"373":[0,0],"374":[0,0],"375":[0,0,0],"376":[0,0],"377":[0,0,0],"378":[0,0],"379":[0,0],"380":[0,0],"381":[0,0],"382":[0,0],"383":[0,0],"384":[0,0],"385":[0,0],"386":[0,0],"387":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0},"fnMap":{"1":{"name":"(anonymous_1)","line":59,"loc":{"start":{"line":59,"column":14},"end":{"line":59,"column":25}}},"2":{"name":"(anonymous_2)","line":64,"loc":{"start":{"line":64,"column":25},"end":{"line":64,"column":43}}},"3":{"name":"(anonymous_3)","line":156,"loc":{"start":{"line":156,"column":1},"end":{"line":156,"column":12}}},"4":{"name":"(anonymous_4)","line":169,"loc":{"start":{"line":169,"column":15},"end":{"line":169,"column":26}}},"5":{"name":"(anonymous_5)","line":181,"loc":{"start":{"line":181,"column":14},"end":{"line":181,"column":46}}},"6":{"name":"(anonymous_6)","line":188,"loc":{"start":{"line":188,"column":17},"end":{"line":188,"column":49}}},"7":{"name":"(anonymous_7)","line":198,"loc":{"start":{"line":198,"column":22},"end":{"line":198,"column":33}}},"8":{"name":"(anonymous_8)","line":204,"loc":{"start":{"line":204,"column":21},"end":{"line":204,"column":32}}},"9":{"name":"(anonymous_9)","line":211,"loc":{"start":{"line":211,"column":20},"end":{"line":211,"column":35}}},"10":{"name":"(anonymous_10)","line":236,"loc":{"start":{"line":236,"column":18},"end":{"line":236,"column":33}}},"11":{"name":"(anonymous_11)","line":270,"loc":{"start":{"line":270,"column":17},"end":{"line":270,"column":29}}},"12":{"name":"(anonymous_12)","line":317,"loc":{"start":{"line":317,"column":13},"end":{"line":317,"column":25}}},"13":{"name":"(anonymous_13)","line":327,"loc":{"start":{"line":327,"column":11},"end":{"line":327,"column":22}}},"14":{"name":"(anonymous_14)","line":392,"loc":{"start":{"line":392,"column":31},"end":{"line":392,"column":54}}},"15":{"name":"(anonymous_15)","line":416,"loc":{"start":{"line":416,"column":24},"end":{"line":416,"column":42}}},"16":{"name":"(anonymous_16)","line":516,"loc":{"start":{"line":516,"column":12},"end":{"line":516,"column":23}}},"17":{"name":"(anonymous_17)","line":549,"loc":{"start":{"line":549,"column":13},"end":{"line":549,"column":40}}},"18":{"name":"(anonymous_18)","line":618,"loc":{"start":{"line":618,"column":9},"end":{"line":618,"column":46}}},"19":{"name":"(anonymous_19)","line":665,"loc":{"start":{"line":665,"column":13},"end":{"line":665,"column":31}}},"20":{"name":"(anonymous_20)","line":859,"loc":{"start":{"line":859,"column":20},"end":{"line":859,"column":40}}},"21":{"name":"(anonymous_21)","line":870,"loc":{"start":{"line":870,"column":15},"end":{"line":870,"column":26}}},"22":{"name":"(anonymous_22)","line":872,"loc":{"start":{"line":872,"column":24},"end":{"line":872,"column":35}}},"23":{"name":"(anonymous_23)","line":873,"loc":{"start":{"line":873,"column":34},"end":{"line":873,"column":45}}},"24":{"name":"(anonymous_24)","line":944,"loc":{"start":{"line":944,"column":9},"end":{"line":944,"column":20}}},"25":{"name":"(anonymous_25)","line":986,"loc":{"start":{"line":986,"column":25},"end":{"line":986,"column":47}}},"26":{"name":"(anonymous_26)","line":1012,"loc":{"start":{"line":1012,"column":13},"end":{"line":1012,"column":25}}},"27":{"name":"(anonymous_27)","line":1021,"loc":{"start":{"line":1021,"column":22},"end":{"line":1021,"column":35}}},"28":{"name":"(anonymous_28)","line":1062,"loc":{"start":{"line":1062,"column":13},"end":{"line":1062,"column":48}}},"29":{"name":"(anonymous_29)","line":1092,"loc":{"start":{"line":1092,"column":10},"end":{"line":1092,"column":35}}},"30":{"name":"(anonymous_30)","line":1115,"loc":{"start":{"line":1115,"column":22},"end":{"line":1115,"column":44}}},"31":{"name":"(anonymous_31)","line":1179,"loc":{"start":{"line":1179,"column":27},"end":{"line":1179,"column":48}}},"32":{"name":"(anonymous_32)","line":1206,"loc":{"start":{"line":1206,"column":36},"end":{"line":1206,"column":47}}},"33":{"name":"(anonymous_33)","line":1285,"loc":{"start":{"line":1285,"column":25},"end":{"line":1285,"column":36}}},"34":{"name":"(anonymous_34)","line":1354,"loc":{"start":{"line":1354,"column":15},"end":{"line":1354,"column":26}}},"35":{"name":"(anonymous_35)","line":1378,"loc":{"start":{"line":1378,"column":10},"end":{"line":1378,"column":23}}},"36":{"name":"(anonymous_36)","line":1397,"loc":{"start":{"line":1397,"column":11},"end":{"line":1397,"column":33}}},"37":{"name":"(anonymous_37)","line":1423,"loc":{"start":{"line":1423,"column":10},"end":{"line":1423,"column":24}}},"38":{"name":"(anonymous_38)","line":1445,"loc":{"start":{"line":1445,"column":11},"end":{"line":1445,"column":33}}},"39":{"name":"(anonymous_39)","line":1478,"loc":{"start":{"line":1478,"column":13},"end":{"line":1478,"column":24}}},"40":{"name":"(anonymous_40)","line":1546,"loc":{"start":{"line":1546,"column":22},"end":{"line":1546,"column":34}}},"41":{"name":"(anonymous_41)","line":1595,"loc":{"start":{"line":1595,"column":26},"end":{"line":1595,"column":39}}},"42":{"name":"(anonymous_42)","line":1973,"loc":{"start":{"line":1973,"column":20},"end":{"line":1973,"column":39}}},"43":{"name":"(anonymous_43)","line":2049,"loc":{"start":{"line":2049,"column":14},"end":{"line":2049,"column":28}}},"44":{"name":"(anonymous_44)","line":2067,"loc":{"start":{"line":2067,"column":57},"end":{"line":2067,"column":70}}},"45":{"name":"(anonymous_45)","line":2078,"loc":{"start":{"line":2078,"column":14},"end":{"line":2078,"column":26}}},"46":{"name":"(anonymous_46)","line":2089,"loc":{"start":{"line":2089,"column":11},"end":{"line":2089,"column":23}}},"47":{"name":"(anonymous_47)","line":2117,"loc":{"start":{"line":2117,"column":15},"end":{"line":2117,"column":27}}},"48":{"name":"(anonymous_48)","line":2128,"loc":{"start":{"line":2128,"column":11},"end":{"line":2128,"column":23}}},"49":{"name":"(anonymous_49)","line":2139,"loc":{"start":{"line":2139,"column":13},"end":{"line":2139,"column":25}}},"50":{"name":"(anonymous_50)","line":2154,"loc":{"start":{"line":2154,"column":13},"end":{"line":2154,"column":33}}},"51":{"name":"(anonymous_51)","line":2167,"loc":{"start":{"line":2167,"column":13},"end":{"line":2167,"column":29}}},"52":{"name":"(anonymous_52)","line":2178,"loc":{"start":{"line":2178,"column":13},"end":{"line":2178,"column":25}}},"53":{"name":"(anonymous_53)","line":2189,"loc":{"start":{"line":2189,"column":16},"end":{"line":2189,"column":28}}},"54":{"name":"(anonymous_54)","line":2202,"loc":{"start":{"line":2202,"column":12},"end":{"line":2202,"column":24}}},"55":{"name":"(anonymous_55)","line":2226,"loc":{"start":{"line":2226,"column":20},"end":{"line":2226,"column":32}}},"56":{"name":"(anonymous_56)","line":2247,"loc":{"start":{"line":2247,"column":8},"end":{"line":2247,"column":23}}},"57":{"name":"(anonymous_57)","line":2248,"loc":{"start":{"line":2248,"column":43},"end":{"line":2248,"column":65}}},"58":{"name":"(anonymous_58)","line":2261,"loc":{"start":{"line":2261,"column":64},"end":{"line":2261,"column":76}}},"59":{"name":"(anonymous_59)","line":2263,"loc":{"start":{"line":2263,"column":4},"end":{"line":2263,"column":17}}},"60":{"name":"(anonymous_60)","line":2278,"loc":{"start":{"line":2278,"column":76},"end":{"line":2278,"column":89}}},"61":{"name":"(anonymous_61)","line":2280,"loc":{"start":{"line":2280,"column":4},"end":{"line":2280,"column":17}}},"62":{"name":"(anonymous_62)","line":2291,"loc":{"start":{"line":2291,"column":79},"end":{"line":2291,"column":92}}},"63":{"name":"(anonymous_63)","line":2293,"loc":{"start":{"line":2293,"column":4},"end":{"line":2293,"column":17}}},"64":{"name":"(anonymous_64)","line":2324,"loc":{"start":{"line":2324,"column":9},"end":{"line":2324,"column":21}}},"65":{"name":"YArray","line":2365,"loc":{"start":{"line":2365,"column":0},"end":{"line":2365,"column":42}}},"66":{"name":"(anonymous_66)","line":2408,"loc":{"start":{"line":2408,"column":48},"end":{"line":2408,"column":65}}},"67":{"name":"(anonymous_67)","line":2423,"loc":{"start":{"line":2423,"column":4},"end":{"line":2423,"column":21}}},"68":{"name":"(anonymous_68)","line":2455,"loc":{"start":{"line":2455,"column":64},"end":{"line":2455,"column":94}}},"69":{"name":"(anonymous_69)","line":2458,"loc":{"start":{"line":2458,"column":4},"end":{"line":2458,"column":34}}},"70":{"name":"(anonymous_70)","line":2492,"loc":{"start":{"line":2492,"column":14},"end":{"line":2492,"column":38}}},"71":{"name":"(anonymous_71)","line":2520,"loc":{"start":{"line":2520,"column":50},"end":{"line":2520,"column":80}}},"72":{"name":"(anonymous_72)","line":2522,"loc":{"start":{"line":2522,"column":4},"end":{"line":2522,"column":34}}},"73":{"name":"(anonymous_73)","line":2565,"loc":{"start":{"line":2565,"column":21},"end":{"line":2565,"column":37}}},"74":{"name":"(anonymous_74)","line":2585,"loc":{"start":{"line":2585,"column":44},"end":{"line":2585,"column":74}}},"75":{"name":"(anonymous_75)","line":2587,"loc":{"start":{"line":2587,"column":4},"end":{"line":2587,"column":34}}},"76":{"name":"(anonymous_76)","line":2615,"loc":{"start":{"line":2615,"column":14},"end":{"line":2615,"column":29}}},"77":{"name":"Queue","line":2649,"loc":{"start":{"line":2649,"column":0},"end":{"line":2649,"column":17}}},"78":{"name":"(anonymous_78)","line":2661,"loc":{"start":{"line":2661,"column":11},"end":{"line":2661,"column":22}}},"79":{"name":"(anonymous_79)","line":2678,"loc":{"start":{"line":2678,"column":10},"end":{"line":2678,"column":21}}},"80":{"name":"(anonymous_80)","line":2688,"loc":{"start":{"line":2688,"column":10},"end":{"line":2688,"column":21}}},"81":{"name":"(anonymous_81)","line":2699,"loc":{"start":{"line":2699,"column":9},"end":{"line":2699,"column":20}}},"82":{"name":"(anonymous_82)","line":2711,"loc":{"start":{"line":2711,"column":10},"end":{"line":2711,"column":21}}},"83":{"name":"(anonymous_83)","line":2758,"loc":{"start":{"line":2758,"column":11},"end":{"line":2758,"column":45}}},"84":{"name":"(anonymous_84)","line":2762,"loc":{"start":{"line":2762,"column":11},"end":{"line":2762,"column":26}}},"85":{"name":"(anonymous_85)","line":2792,"loc":{"start":{"line":2792,"column":16},"end":{"line":2792,"column":28}}},"86":{"name":"(anonymous_86)","line":2817,"loc":{"start":{"line":2817,"column":10},"end":{"line":2817,"column":22}}},"87":{"name":"(anonymous_87)","line":2871,"loc":{"start":{"line":2871,"column":8},"end":{"line":2871,"column":72}}},"88":{"name":"(anonymous_88)","line":3010,"loc":{"start":{"line":3010,"column":47},"end":{"line":3010,"column":62}}},"89":{"name":"(anonymous_89)","line":3017,"loc":{"start":{"line":3017,"column":5},"end":{"line":3017,"column":17}}},"90":{"name":"F","line":3019,"loc":{"start":{"line":3019,"column":4},"end":{"line":3019,"column":17}}},"91":{"name":"(anonymous_91)","line":3022,"loc":{"start":{"line":3022,"column":11},"end":{"line":3022,"column":26}}},"92":{"name":"(anonymous_92)","line":3072,"loc":{"start":{"line":3072,"column":40},"end":{"line":3072,"column":52}}},"93":{"name":"(anonymous_93)","line":3085,"loc":{"start":{"line":3085,"column":16},"end":{"line":3085,"column":36}}},"94":{"name":"(anonymous_94)","line":3123,"loc":{"start":{"line":3123,"column":73},"end":{"line":3123,"column":88}}},"95":{"name":"(anonymous_95)","line":3175,"loc":{"start":{"line":3175,"column":11},"end":{"line":3175,"column":26}}},"96":{"name":"(anonymous_96)","line":3196,"loc":{"start":{"line":3196,"column":9},"end":{"line":3196,"column":24}}},"97":{"name":"(anonymous_97)","line":3214,"loc":{"start":{"line":3214,"column":13},"end":{"line":3214,"column":35}}},"98":{"name":"(anonymous_98)","line":3238,"loc":{"start":{"line":3238,"column":9},"end":{"line":3238,"column":44}}},"99":{"name":"(anonymous_99)","line":3270,"loc":{"start":{"line":3270,"column":9},"end":{"line":3270,"column":44}}},"100":{"name":"(anonymous_100)","line":3297,"loc":{"start":{"line":3297,"column":13},"end":{"line":3297,"column":31}}},"101":{"name":"(anonymous_101)","line":3327,"loc":{"start":{"line":3327,"column":13},"end":{"line":3327,"column":36}}},"102":{"name":"(anonymous_102)","line":3357,"loc":{"start":{"line":3357,"column":12},"end":{"line":3357,"column":27}}},"103":{"name":"(anonymous_103)","line":3393,"loc":{"start":{"line":3393,"column":18},"end":{"line":3393,"column":34}}},"104":{"name":"(anonymous_104)","line":3395,"loc":{"start":{"line":3395,"column":20},"end":{"line":3395,"column":32}}},"105":{"name":"(anonymous_105)","line":3397,"loc":{"start":{"line":3397,"column":47},"end":{"line":3397,"column":58}}},"106":{"name":"(anonymous_106)","line":3848,"loc":{"start":{"line":3848,"column":23},"end":{"line":3848,"column":39}}}},"statementMap":{"1":{"start":{"line":12,"column":0},"end":{"line":14,"column":1}},"2":{"start":{"line":13,"column":4},"end":{"line":13,"column":19}},"3":{"start":{"line":59,"column":4},"end":{"line":154,"column":6}},"4":{"start":{"line":60,"column":8},"end":{"line":67,"column":70}},"5":{"start":{"line":65,"column":16},"end":{"line":65,"column":70}},"6":{"start":{"line":69,"column":8},"end":{"line":137,"column":9}},"7":{"start":{"line":70,"column":12},"end":{"line":70,"column":26}},"8":{"start":{"line":73,"column":12},"end":{"line":73,"column":22}},"9":{"start":{"line":100,"column":12},"end":{"line":102,"column":13}},"10":{"start":{"line":101,"column":16},"end":{"line":101,"column":48}},"11":{"start":{"line":129,"column":12},"end":{"line":131,"column":13}},"12":{"start":{"line":130,"column":16},"end":{"line":130,"column":37}},"13":{"start":{"line":134,"column":12},"end":{"line":136,"column":13}},"14":{"start":{"line":135,"column":16},"end":{"line":135,"column":27}},"15":{"start":{"line":139,"column":8},"end":{"line":149,"column":9}},"16":{"start":{"line":144,"column":12},"end":{"line":146,"column":13}},"17":{"start":{"line":145,"column":16},"end":{"line":145,"column":39}},"18":{"start":{"line":148,"column":12},"end":{"line":148,"column":23}},"19":{"start":{"line":151,"column":8},"end":{"line":151,"column":34}},"20":{"start":{"line":153,"column":8},"end":{"line":153,"column":17}},"21":{"start":{"line":156,"column":0},"end":{"line":1609,"column":5}},"22":{"start":{"line":158,"column":4},"end":{"line":244,"column":41}},"23":{"start":{"line":182,"column":12},"end":{"line":186,"column":13}},"24":{"start":{"line":183,"column":16},"end":{"line":183,"column":55}},"25":{"start":{"line":184,"column":19},"end":{"line":186,"column":13}},"26":{"start":{"line":185,"column":16},"end":{"line":185,"column":48}},"27":{"start":{"line":189,"column":12},"end":{"line":196,"column":13}},"28":{"start":{"line":191,"column":16},"end":{"line":193,"column":31}},"29":{"start":{"line":192,"column":20},"end":{"line":192,"column":62}},"30":{"start":{"line":194,"column":19},"end":{"line":196,"column":13}},"31":{"start":{"line":195,"column":16},"end":{"line":195,"column":48}},"32":{"start":{"line":199,"column":12},"end":{"line":199,"column":36}},"33":{"start":{"line":200,"column":12},"end":{"line":202,"column":13}},"34":{"start":{"line":201,"column":16},"end":{"line":201,"column":61}},"35":{"start":{"line":205,"column":12},"end":{"line":205,"column":40}},"36":{"start":{"line":206,"column":12},"end":{"line":206,"column":36}},"37":{"start":{"line":207,"column":12},"end":{"line":209,"column":13}},"38":{"start":{"line":208,"column":16},"end":{"line":208,"column":51}},"39":{"start":{"line":212,"column":12},"end":{"line":215,"column":34}},"40":{"start":{"line":217,"column":12},"end":{"line":227,"column":13}},"41":{"start":{"line":219,"column":16},"end":{"line":219,"column":48}},"42":{"start":{"line":220,"column":16},"end":{"line":220,"column":36}},"43":{"start":{"line":221,"column":16},"end":{"line":221,"column":35}},"44":{"start":{"line":222,"column":16},"end":{"line":222,"column":37}},"45":{"start":{"line":223,"column":16},"end":{"line":223,"column":39}},"46":{"start":{"line":225,"column":16},"end":{"line":225,"column":48}},"47":{"start":{"line":226,"column":16},"end":{"line":226,"column":39}},"48":{"start":{"line":228,"column":12},"end":{"line":230,"column":13}},"49":{"start":{"line":229,"column":16},"end":{"line":229,"column":63}},"50":{"start":{"line":231,"column":12},"end":{"line":231,"column":74}},"51":{"start":{"line":233,"column":12},"end":{"line":233,"column":26}},"52":{"start":{"line":237,"column":12},"end":{"line":241,"column":13}},"53":{"start":{"line":238,"column":16},"end":{"line":240,"column":17}},"54":{"start":{"line":239,"column":20},"end":{"line":239,"column":32}},"55":{"start":{"line":248,"column":0},"end":{"line":254,"column":1}},"56":{"start":{"line":249,"column":4},"end":{"line":251,"column":5}},"57":{"start":{"line":250,"column":8},"end":{"line":250,"column":24}},"58":{"start":{"line":252,"column":4},"end":{"line":252,"column":26}},"59":{"start":{"line":253,"column":4},"end":{"line":253,"column":31}},"60":{"start":{"line":256,"column":0},"end":{"line":258,"column":1}},"61":{"start":{"line":257,"column":4},"end":{"line":257,"column":22}},"62":{"start":{"line":260,"column":0},"end":{"line":1500,"column":2}},"63":{"start":{"line":272,"column":8},"end":{"line":272,"column":22}},"64":{"start":{"line":274,"column":8},"end":{"line":281,"column":38}},"65":{"start":{"line":283,"column":8},"end":{"line":301,"column":9}},"66":{"start":{"line":284,"column":12},"end":{"line":300,"column":13}},"67":{"start":{"line":285,"column":16},"end":{"line":285,"column":31}},"68":{"start":{"line":286,"column":16},"end":{"line":299,"column":17}},"69":{"start":{"line":287,"column":20},"end":{"line":287,"column":40}},"70":{"start":{"line":288,"column":23},"end":{"line":299,"column":17}},"71":{"start":{"line":289,"column":20},"end":{"line":289,"column":43}},"72":{"start":{"line":290,"column":23},"end":{"line":299,"column":17}},"73":{"start":{"line":291,"column":20},"end":{"line":291,"column":42}},"74":{"start":{"line":292,"column":23},"end":{"line":299,"column":17}},"75":{"start":{"line":293,"column":20},"end":{"line":293,"column":72}},"76":{"start":{"line":294,"column":20},"end":{"line":294,"column":77}},"77":{"start":{"line":295,"column":23},"end":{"line":299,"column":17}},"78":{"start":{"line":298,"column":20},"end":{"line":298,"column":40}},"79":{"start":{"line":303,"column":8},"end":{"line":305,"column":9}},"80":{"start":{"line":304,"column":12},"end":{"line":304,"column":30}},"81":{"start":{"line":318,"column":8},"end":{"line":318,"column":28}},"82":{"start":{"line":328,"column":8},"end":{"line":332,"column":17}},"83":{"start":{"line":343,"column":8},"end":{"line":343,"column":28}},"84":{"start":{"line":345,"column":8},"end":{"line":465,"column":9}},"85":{"start":{"line":346,"column":12},"end":{"line":437,"column":14}},"86":{"start":{"line":393,"column":20},"end":{"line":394,"column":37}},"87":{"start":{"line":396,"column":20},"end":{"line":412,"column":21}},"88":{"start":{"line":397,"column":24},"end":{"line":397,"column":89}},"89":{"start":{"line":401,"column":24},"end":{"line":401,"column":42}},"90":{"start":{"line":405,"column":24},"end":{"line":407,"column":25}},"91":{"start":{"line":406,"column":28},"end":{"line":406,"column":51}},"92":{"start":{"line":408,"column":24},"end":{"line":411,"column":26}},"93":{"start":{"line":413,"column":20},"end":{"line":413,"column":32}},"94":{"start":{"line":417,"column":28},"end":{"line":419,"column":44}},"95":{"start":{"line":421,"column":28},"end":{"line":431,"column":29}},"96":{"start":{"line":422,"column":32},"end":{"line":422,"column":51}},"97":{"start":{"line":423,"column":32},"end":{"line":430,"column":33}},"98":{"start":{"line":424,"column":36},"end":{"line":424,"column":79}},"99":{"start":{"line":425,"column":36},"end":{"line":429,"column":37}},"100":{"start":{"line":426,"column":40},"end":{"line":426,"column":63}},"101":{"start":{"line":427,"column":40},"end":{"line":427,"column":59}},"102":{"start":{"line":428,"column":40},"end":{"line":428,"column":46}},"103":{"start":{"line":434,"column":28},"end":{"line":434,"column":40}},"104":{"start":{"line":439,"column":12},"end":{"line":439,"column":24}},"105":{"start":{"line":441,"column":12},"end":{"line":441,"column":38}},"106":{"start":{"line":443,"column":12},"end":{"line":460,"column":13}},"107":{"start":{"line":444,"column":16},"end":{"line":444,"column":42}},"108":{"start":{"line":445,"column":16},"end":{"line":446,"column":82}},"109":{"start":{"line":447,"column":19},"end":{"line":460,"column":13}},"110":{"start":{"line":449,"column":16},"end":{"line":449,"column":37}},"111":{"start":{"line":450,"column":16},"end":{"line":450,"column":41}},"112":{"start":{"line":451,"column":16},"end":{"line":451,"column":41}},"113":{"start":{"line":453,"column":16},"end":{"line":457,"column":17}},"114":{"start":{"line":454,"column":20},"end":{"line":456,"column":21}},"115":{"start":{"line":455,"column":24},"end":{"line":455,"column":48}},"116":{"start":{"line":459,"column":16},"end":{"line":459,"column":32}},"117":{"start":{"line":462,"column":12},"end":{"line":462,"column":30}},"118":{"start":{"line":463,"column":12},"end":{"line":463,"column":32}},"119":{"start":{"line":467,"column":8},"end":{"line":467,"column":28}},"120":{"start":{"line":470,"column":8},"end":{"line":481,"column":10}},"121":{"start":{"line":484,"column":8},"end":{"line":495,"column":9}},"122":{"start":{"line":485,"column":12},"end":{"line":485,"column":42}},"123":{"start":{"line":486,"column":12},"end":{"line":486,"column":136}},"124":{"start":{"line":487,"column":12},"end":{"line":487,"column":47}},"125":{"start":{"line":488,"column":12},"end":{"line":492,"column":13}},"126":{"start":{"line":489,"column":16},"end":{"line":489,"column":57}},"127":{"start":{"line":491,"column":16},"end":{"line":491,"column":73}},"128":{"start":{"line":493,"column":15},"end":{"line":495,"column":9}},"129":{"start":{"line":494,"column":12},"end":{"line":494,"column":66}},"130":{"start":{"line":497,"column":8},"end":{"line":497,"column":49}},"131":{"start":{"line":499,"column":8},"end":{"line":499,"column":73}},"132":{"start":{"line":501,"column":8},"end":{"line":503,"column":9}},"133":{"start":{"line":502,"column":12},"end":{"line":502,"column":27}},"134":{"start":{"line":504,"column":8},"end":{"line":504,"column":50}},"135":{"start":{"line":505,"column":8},"end":{"line":505,"column":88}},"136":{"start":{"line":517,"column":8},"end":{"line":520,"column":62}},"137":{"start":{"line":522,"column":8},"end":{"line":526,"column":9}},"138":{"start":{"line":523,"column":12},"end":{"line":525,"column":13}},"139":{"start":{"line":524,"column":16},"end":{"line":524,"column":37}},"140":{"start":{"line":528,"column":8},"end":{"line":528,"column":32}},"141":{"start":{"line":529,"column":8},"end":{"line":529,"column":24}},"142":{"start":{"line":531,"column":8},"end":{"line":533,"column":9}},"143":{"start":{"line":532,"column":12},"end":{"line":532,"column":25}},"144":{"start":{"line":550,"column":8},"end":{"line":553,"column":9}},"145":{"start":{"line":551,"column":12},"end":{"line":551,"column":70}},"146":{"start":{"line":552,"column":12},"end":{"line":552,"column":24}},"147":{"start":{"line":555,"column":8},"end":{"line":555,"column":49}},"148":{"start":{"line":556,"column":8},"end":{"line":566,"column":9}},"149":{"start":{"line":557,"column":12},"end":{"line":557,"column":37}},"150":{"start":{"line":558,"column":12},"end":{"line":558,"column":25}},"151":{"start":{"line":559,"column":12},"end":{"line":564,"column":13}},"152":{"start":{"line":560,"column":16},"end":{"line":560,"column":31}},"153":{"start":{"line":561,"column":16},"end":{"line":563,"column":17}},"154":{"start":{"line":562,"column":20},"end":{"line":562,"column":76}},"155":{"start":{"line":565,"column":12},"end":{"line":565,"column":48}},"156":{"start":{"line":568,"column":8},"end":{"line":568,"column":20}},"157":{"start":{"line":619,"column":8},"end":{"line":619,"column":32}},"158":{"start":{"line":620,"column":8},"end":{"line":630,"column":39}},"159":{"start":{"line":632,"column":8},"end":{"line":632,"column":29}},"160":{"start":{"line":633,"column":8},"end":{"line":633,"column":52}},"161":{"start":{"line":634,"column":8},"end":{"line":634,"column":38}},"162":{"start":{"line":636,"column":8},"end":{"line":650,"column":9}},"163":{"start":{"line":637,"column":12},"end":{"line":649,"column":13}},"164":{"start":{"line":638,"column":16},"end":{"line":638,"column":36}},"165":{"start":{"line":639,"column":16},"end":{"line":648,"column":17}},"166":{"start":{"line":640,"column":20},"end":{"line":640,"column":44}},"167":{"start":{"line":641,"column":20},"end":{"line":641,"column":46}},"168":{"start":{"line":642,"column":20},"end":{"line":647,"column":21}},"169":{"start":{"line":643,"column":24},"end":{"line":643,"column":61}},"170":{"start":{"line":644,"column":24},"end":{"line":646,"column":25}},"171":{"start":{"line":645,"column":28},"end":{"line":645,"column":60}},"172":{"start":{"line":652,"column":8},"end":{"line":652,"column":20}},"173":{"start":{"line":666,"column":8},"end":{"line":678,"column":37}},"174":{"start":{"line":682,"column":8},"end":{"line":697,"column":9}},"175":{"start":{"line":683,"column":12},"end":{"line":683,"column":24}},"176":{"start":{"line":684,"column":12},"end":{"line":684,"column":29}},"177":{"start":{"line":685,"column":12},"end":{"line":685,"column":25}},"178":{"start":{"line":686,"column":12},"end":{"line":696,"column":13}},"179":{"start":{"line":687,"column":16},"end":{"line":695,"column":17}},"180":{"start":{"line":688,"column":20},"end":{"line":694,"column":21}},"181":{"start":{"line":689,"column":24},"end":{"line":689,"column":57}},"182":{"start":{"line":690,"column":24},"end":{"line":690,"column":92}},"183":{"start":{"line":691,"column":24},"end":{"line":693,"column":25}},"184":{"start":{"line":692,"column":28},"end":{"line":692,"column":45}},"185":{"start":{"line":698,"column":8},"end":{"line":698,"column":14}},"186":{"start":{"line":699,"column":8},"end":{"line":699,"column":23}},"187":{"start":{"line":701,"column":8},"end":{"line":843,"column":9}},"188":{"start":{"line":702,"column":12},"end":{"line":842,"column":13}},"189":{"start":{"line":703,"column":16},"end":{"line":703,"column":28}},"190":{"start":{"line":704,"column":16},"end":{"line":704,"column":33}},"191":{"start":{"line":706,"column":16},"end":{"line":709,"column":17}},"192":{"start":{"line":707,"column":20},"end":{"line":707,"column":45}},"193":{"start":{"line":708,"column":20},"end":{"line":708,"column":29}},"194":{"start":{"line":710,"column":16},"end":{"line":841,"column":17}},"195":{"start":{"line":711,"column":20},"end":{"line":711,"column":67}},"196":{"start":{"line":712,"column":20},"end":{"line":715,"column":21}},"197":{"start":{"line":713,"column":24},"end":{"line":713,"column":38}},"198":{"start":{"line":714,"column":24},"end":{"line":714,"column":36}},"199":{"start":{"line":720,"column":20},"end":{"line":726,"column":21}},"200":{"start":{"line":721,"column":24},"end":{"line":725,"column":25}},"201":{"start":{"line":722,"column":28},"end":{"line":722,"column":53}},"202":{"start":{"line":723,"column":28},"end":{"line":723,"column":74}},"203":{"start":{"line":724,"column":28},"end":{"line":724,"column":76}},"204":{"start":{"line":728,"column":20},"end":{"line":728,"column":38}},"205":{"start":{"line":731,"column":20},"end":{"line":736,"column":21}},"206":{"start":{"line":732,"column":24},"end":{"line":735,"column":25}},"207":{"start":{"line":733,"column":28},"end":{"line":733,"column":110}},"208":{"start":{"line":734,"column":28},"end":{"line":734,"column":55}},"209":{"start":{"line":742,"column":20},"end":{"line":752,"column":21}},"210":{"start":{"line":743,"column":24},"end":{"line":743,"column":56}},"211":{"start":{"line":744,"column":24},"end":{"line":744,"column":33}},"212":{"start":{"line":745,"column":24},"end":{"line":745,"column":61}},"213":{"start":{"line":746,"column":24},"end":{"line":750,"column":25}},"214":{"start":{"line":747,"column":28},"end":{"line":749,"column":29}},"215":{"start":{"line":748,"column":32},"end":{"line":748,"column":44}},"216":{"start":{"line":751,"column":24},"end":{"line":751,"column":39}},"217":{"start":{"line":754,"column":20},"end":{"line":754,"column":42}},"218":{"start":{"line":755,"column":20},"end":{"line":755,"column":43}},"219":{"start":{"line":756,"column":20},"end":{"line":756,"column":42}},"220":{"start":{"line":757,"column":20},"end":{"line":757,"column":38}},"221":{"start":{"line":758,"column":20},"end":{"line":758,"column":42}},"222":{"start":{"line":760,"column":20},"end":{"line":763,"column":21}},"223":{"start":{"line":761,"column":24},"end":{"line":761,"column":40}},"224":{"start":{"line":762,"column":24},"end":{"line":762,"column":44}},"225":{"start":{"line":765,"column":20},"end":{"line":775,"column":21}},"226":{"start":{"line":766,"column":24},"end":{"line":766,"column":44}},"227":{"start":{"line":767,"column":24},"end":{"line":774,"column":25}},"228":{"start":{"line":768,"column":28},"end":{"line":773,"column":29}},"229":{"start":{"line":769,"column":32},"end":{"line":771,"column":33}},"230":{"start":{"line":770,"column":36},"end":{"line":770,"column":49}},"231":{"start":{"line":772,"column":32},"end":{"line":772,"column":38}},"232":{"start":{"line":777,"column":20},"end":{"line":786,"column":21}},"233":{"start":{"line":778,"column":24},"end":{"line":785,"column":25}},"234":{"start":{"line":779,"column":28},"end":{"line":784,"column":29}},"235":{"start":{"line":780,"column":32},"end":{"line":782,"column":33}},"236":{"start":{"line":781,"column":36},"end":{"line":781,"column":49}},"237":{"start":{"line":783,"column":32},"end":{"line":783,"column":38}},"238":{"start":{"line":788,"column":20},"end":{"line":826,"column":21}},"239":{"start":{"line":789,"column":24},"end":{"line":789,"column":44}},"240":{"start":{"line":790,"column":24},"end":{"line":801,"column":25}},"241":{"start":{"line":791,"column":28},"end":{"line":791,"column":45}},"242":{"start":{"line":792,"column":28},"end":{"line":792,"column":45}},"243":{"start":{"line":794,"column":28},"end":{"line":794,"column":67}},"244":{"start":{"line":795,"column":28},"end":{"line":800,"column":29}},"245":{"start":{"line":796,"column":32},"end":{"line":796,"column":52}},"246":{"start":{"line":797,"column":32},"end":{"line":799,"column":33}},"247":{"start":{"line":798,"column":36},"end":{"line":798,"column":113}},"248":{"start":{"line":802,"column":24},"end":{"line":811,"column":25}},"249":{"start":{"line":803,"column":28},"end":{"line":803,"column":92}},"250":{"start":{"line":805,"column":28},"end":{"line":810,"column":29}},"251":{"start":{"line":806,"column":32},"end":{"line":806,"column":96}},"252":{"start":{"line":808,"column":32},"end":{"line":808,"column":74}},"253":{"start":{"line":809,"column":32},"end":{"line":809,"column":45}},"254":{"start":{"line":812,"column":24},"end":{"line":825,"column":25}},"255":{"start":{"line":814,"column":28},"end":{"line":814,"column":57}},"256":{"start":{"line":821,"column":28},"end":{"line":821,"column":62}},"257":{"start":{"line":822,"column":28},"end":{"line":824,"column":29}},"258":{"start":{"line":823,"column":32},"end":{"line":823,"column":74}},"259":{"start":{"line":828,"column":20},"end":{"line":837,"column":21}},"260":{"start":{"line":829,"column":24},"end":{"line":836,"column":25}},"261":{"start":{"line":830,"column":28},"end":{"line":835,"column":29}},"262":{"start":{"line":831,"column":32},"end":{"line":833,"column":33}},"263":{"start":{"line":832,"column":36},"end":{"line":832,"column":49}},"264":{"start":{"line":834,"column":32},"end":{"line":834,"column":38}},"265":{"start":{"line":845,"column":8},"end":{"line":845,"column":20}},"266":{"start":{"line":861,"column":8},"end":{"line":862,"column":33}},"267":{"start":{"line":864,"column":8},"end":{"line":864,"column":68}},"268":{"start":{"line":866,"column":8},"end":{"line":868,"column":9}},"269":{"start":{"line":867,"column":12},"end":{"line":867,"column":40}},"270":{"start":{"line":870,"column":8},"end":{"line":878,"column":10}},"271":{"start":{"line":871,"column":12},"end":{"line":871,"column":33}},"272":{"start":{"line":872,"column":12},"end":{"line":877,"column":15}},"273":{"start":{"line":873,"column":16},"end":{"line":876,"column":31}},"274":{"start":{"line":874,"column":20},"end":{"line":874,"column":53}},"275":{"start":{"line":875,"column":20},"end":{"line":875,"column":38}},"276":{"start":{"line":945,"column":8},"end":{"line":951,"column":31}},"277":{"start":{"line":954,"column":8},"end":{"line":961,"column":9}},"278":{"start":{"line":955,"column":12},"end":{"line":955,"column":23}},"279":{"start":{"line":956,"column":12},"end":{"line":958,"column":13}},"280":{"start":{"line":957,"column":16},"end":{"line":957,"column":75}},"281":{"start":{"line":960,"column":12},"end":{"line":960,"column":28}},"282":{"start":{"line":962,"column":8},"end":{"line":964,"column":9}},"283":{"start":{"line":963,"column":12},"end":{"line":963,"column":27}},"284":{"start":{"line":966,"column":8},"end":{"line":980,"column":9}},"285":{"start":{"line":967,"column":12},"end":{"line":972,"column":13}},"286":{"start":{"line":968,"column":16},"end":{"line":971,"column":17}},"287":{"start":{"line":969,"column":20},"end":{"line":969,"column":40}},"288":{"start":{"line":970,"column":20},"end":{"line":970,"column":26}},"289":{"start":{"line":974,"column":12},"end":{"line":979,"column":13}},"290":{"start":{"line":975,"column":16},"end":{"line":976,"column":17}},"291":{"start":{"line":977,"column":16},"end":{"line":977,"column":56}},"292":{"start":{"line":978,"column":16},"end":{"line":978,"column":25}},"293":{"start":{"line":982,"column":8},"end":{"line":989,"column":9}},"294":{"start":{"line":983,"column":12},"end":{"line":983,"column":55}},"295":{"start":{"line":984,"column":12},"end":{"line":984,"column":46}},"296":{"start":{"line":986,"column":12},"end":{"line":988,"column":15}},"297":{"start":{"line":987,"column":16},"end":{"line":987,"column":52}},"298":{"start":{"line":991,"column":8},"end":{"line":991,"column":17}},"299":{"start":{"line":1013,"column":8},"end":{"line":1014,"column":21}},"300":{"start":{"line":1016,"column":8},"end":{"line":1041,"column":9}},"301":{"start":{"line":1017,"column":12},"end":{"line":1017,"column":34}},"302":{"start":{"line":1021,"column":12},"end":{"line":1040,"column":15}},"303":{"start":{"line":1022,"column":16},"end":{"line":1024,"column":37}},"304":{"start":{"line":1027,"column":16},"end":{"line":1031,"column":17}},"305":{"start":{"line":1028,"column":20},"end":{"line":1030,"column":21}},"306":{"start":{"line":1029,"column":24},"end":{"line":1029,"column":65}},"307":{"start":{"line":1039,"column":16},"end":{"line":1039,"column":57}},"308":{"start":{"line":1050,"column":8},"end":{"line":1050,"column":35}},"309":{"start":{"line":1063,"column":8},"end":{"line":1079,"column":9}},"310":{"start":{"line":1064,"column":12},"end":{"line":1064,"column":79}},"311":{"start":{"line":1065,"column":15},"end":{"line":1079,"column":9}},"312":{"start":{"line":1066,"column":12},"end":{"line":1069,"column":13}},"313":{"start":{"line":1067,"column":16},"end":{"line":1067,"column":77}},"314":{"start":{"line":1068,"column":16},"end":{"line":1068,"column":41}},"315":{"start":{"line":1070,"column":12},"end":{"line":1078,"column":13}},"316":{"start":{"line":1071,"column":16},"end":{"line":1071,"column":41}},"317":{"start":{"line":1073,"column":16},"end":{"line":1077,"column":17}},"318":{"start":{"line":1074,"column":20},"end":{"line":1074,"column":45}},"319":{"start":{"line":1076,"column":20},"end":{"line":1076,"column":62}},"320":{"start":{"line":1094,"column":8},"end":{"line":1096,"column":9}},"321":{"start":{"line":1095,"column":12},"end":{"line":1095,"column":39}},"322":{"start":{"line":1098,"column":8},"end":{"line":1224,"column":14}},"323":{"start":{"line":1117,"column":16},"end":{"line":1117,"column":58}},"324":{"start":{"line":1119,"column":16},"end":{"line":1121,"column":17}},"325":{"start":{"line":1120,"column":20},"end":{"line":1120,"column":27}},"326":{"start":{"line":1123,"column":16},"end":{"line":1133,"column":17}},"327":{"start":{"line":1124,"column":20},"end":{"line":1124,"column":39}},"328":{"start":{"line":1125,"column":20},"end":{"line":1131,"column":21}},"329":{"start":{"line":1126,"column":24},"end":{"line":1130,"column":25}},"330":{"start":{"line":1127,"column":28},"end":{"line":1127,"column":64}},"331":{"start":{"line":1129,"column":28},"end":{"line":1129,"column":45}},"332":{"start":{"line":1132,"column":20},"end":{"line":1132,"column":30}},"333":{"start":{"line":1135,"column":16},"end":{"line":1135,"column":35}},"334":{"start":{"line":1137,"column":16},"end":{"line":1175,"column":17}},"335":{"start":{"line":1138,"column":20},"end":{"line":1138,"column":36}},"336":{"start":{"line":1139,"column":20},"end":{"line":1141,"column":21}},"337":{"start":{"line":1140,"column":24},"end":{"line":1140,"column":37}},"338":{"start":{"line":1144,"column":20},"end":{"line":1146,"column":21}},"339":{"start":{"line":1145,"column":24},"end":{"line":1145,"column":33}},"340":{"start":{"line":1148,"column":20},"end":{"line":1148,"column":35}},"341":{"start":{"line":1149,"column":20},"end":{"line":1149,"column":31}},"342":{"start":{"line":1150,"column":20},"end":{"line":1150,"column":31}},"343":{"start":{"line":1152,"column":20},"end":{"line":1164,"column":21}},"344":{"start":{"line":1153,"column":24},"end":{"line":1153,"column":42}},"345":{"start":{"line":1154,"column":24},"end":{"line":1154,"column":49}},"346":{"start":{"line":1155,"column":24},"end":{"line":1155,"column":44}},"347":{"start":{"line":1159,"column":24},"end":{"line":1163,"column":25}},"348":{"start":{"line":1160,"column":28},"end":{"line":1160,"column":47}},"349":{"start":{"line":1162,"column":28},"end":{"line":1162,"column":46}},"350":{"start":{"line":1167,"column":20},"end":{"line":1169,"column":21}},"351":{"start":{"line":1168,"column":24},"end":{"line":1168,"column":37}},"352":{"start":{"line":1172,"column":20},"end":{"line":1174,"column":21}},"353":{"start":{"line":1173,"column":24},"end":{"line":1173,"column":40}},"354":{"start":{"line":1180,"column":16},"end":{"line":1186,"column":41}},"355":{"start":{"line":1188,"column":16},"end":{"line":1188,"column":35}},"356":{"start":{"line":1190,"column":16},"end":{"line":1202,"column":17}},"357":{"start":{"line":1191,"column":20},"end":{"line":1191,"column":42}},"358":{"start":{"line":1192,"column":20},"end":{"line":1192,"column":33}},"359":{"start":{"line":1193,"column":20},"end":{"line":1193,"column":27}},"360":{"start":{"line":1194,"column":20},"end":{"line":1194,"column":34}},"361":{"start":{"line":1195,"column":20},"end":{"line":1195,"column":42}},"362":{"start":{"line":1196,"column":20},"end":{"line":1201,"column":21}},"363":{"start":{"line":1197,"column":24},"end":{"line":1200,"column":25}},"364":{"start":{"line":1199,"column":28},"end":{"line":1199,"column":41}},"365":{"start":{"line":1204,"column":16},"end":{"line":1218,"column":17}},"366":{"start":{"line":1205,"column":20},"end":{"line":1205,"column":38}},"367":{"start":{"line":1206,"column":20},"end":{"line":1210,"column":23}},"368":{"start":{"line":1207,"column":24},"end":{"line":1209,"column":25}},"369":{"start":{"line":1208,"column":28},"end":{"line":1208,"column":64}},"370":{"start":{"line":1212,"column":20},"end":{"line":1214,"column":21}},"371":{"start":{"line":1213,"column":24},"end":{"line":1213,"column":46}},"372":{"start":{"line":1215,"column":20},"end":{"line":1217,"column":21}},"373":{"start":{"line":1216,"column":24},"end":{"line":1216,"column":60}},"374":{"start":{"line":1220,"column":16},"end":{"line":1222,"column":17}},"375":{"start":{"line":1221,"column":20},"end":{"line":1221,"column":56}},"376":{"start":{"line":1228,"column":8},"end":{"line":1240,"column":9}},"377":{"start":{"line":1229,"column":12},"end":{"line":1229,"column":22}},"378":{"start":{"line":1230,"column":12},"end":{"line":1234,"column":13}},"379":{"start":{"line":1231,"column":16},"end":{"line":1233,"column":17}},"380":{"start":{"line":1232,"column":20},"end":{"line":1232,"column":33}},"381":{"start":{"line":1235,"column":12},"end":{"line":1235,"column":34}},"382":{"start":{"line":1236,"column":12},"end":{"line":1238,"column":13}},"383":{"start":{"line":1237,"column":16},"end":{"line":1237,"column":31}},"384":{"start":{"line":1239,"column":12},"end":{"line":1239,"column":21}},"385":{"start":{"line":1242,"column":8},"end":{"line":1244,"column":9}},"386":{"start":{"line":1243,"column":12},"end":{"line":1243,"column":68}},"387":{"start":{"line":1249,"column":8},"end":{"line":1257,"column":9}},"388":{"start":{"line":1250,"column":12},"end":{"line":1250,"column":34}},"389":{"start":{"line":1251,"column":12},"end":{"line":1251,"column":33}},"390":{"start":{"line":1252,"column":12},"end":{"line":1252,"column":43}},"391":{"start":{"line":1253,"column":12},"end":{"line":1253,"column":32}},"392":{"start":{"line":1254,"column":12},"end":{"line":1254,"column":61}},"393":{"start":{"line":1255,"column":12},"end":{"line":1255,"column":33}},"394":{"start":{"line":1256,"column":12},"end":{"line":1256,"column":33}},"395":{"start":{"line":1259,"column":8},"end":{"line":1259,"column":22}},"396":{"start":{"line":1261,"column":8},"end":{"line":1261,"column":29}},"397":{"start":{"line":1264,"column":8},"end":{"line":1267,"column":9}},"398":{"start":{"line":1265,"column":12},"end":{"line":1265,"column":45}},"399":{"start":{"line":1266,"column":12},"end":{"line":1266,"column":33}},"400":{"start":{"line":1271,"column":8},"end":{"line":1309,"column":9}},"401":{"start":{"line":1272,"column":12},"end":{"line":1272,"column":30}},"402":{"start":{"line":1273,"column":12},"end":{"line":1273,"column":34}},"403":{"start":{"line":1274,"column":12},"end":{"line":1274,"column":40}},"404":{"start":{"line":1275,"column":12},"end":{"line":1275,"column":31}},"405":{"start":{"line":1276,"column":12},"end":{"line":1276,"column":31}},"406":{"start":{"line":1277,"column":12},"end":{"line":1277,"column":44}},"407":{"start":{"line":1278,"column":12},"end":{"line":1278,"column":36}},"408":{"start":{"line":1279,"column":12},"end":{"line":1279,"column":58}},"409":{"start":{"line":1281,"column":15},"end":{"line":1309,"column":9}},"410":{"start":{"line":1283,"column":12},"end":{"line":1283,"column":30}},"411":{"start":{"line":1285,"column":12},"end":{"line":1293,"column":14}},"412":{"start":{"line":1286,"column":16},"end":{"line":1286,"column":35}},"413":{"start":{"line":1287,"column":16},"end":{"line":1287,"column":38}},"414":{"start":{"line":1288,"column":16},"end":{"line":1288,"column":40}},"415":{"start":{"line":1289,"column":16},"end":{"line":1289,"column":45}},"416":{"start":{"line":1290,"column":16},"end":{"line":1292,"column":17}},"417":{"start":{"line":1291,"column":20},"end":{"line":1291,"column":43}},"418":{"start":{"line":1295,"column":12},"end":{"line":1302,"column":13}},"419":{"start":{"line":1296,"column":16},"end":{"line":1296,"column":38}},"420":{"start":{"line":1298,"column":16},"end":{"line":1298,"column":44}},"421":{"start":{"line":1299,"column":16},"end":{"line":1301,"column":19}},"422":{"start":{"line":1305,"column":12},"end":{"line":1305,"column":34}},"423":{"start":{"line":1306,"column":12},"end":{"line":1308,"column":13}},"424":{"start":{"line":1307,"column":16},"end":{"line":1307,"column":31}},"425":{"start":{"line":1311,"column":8},"end":{"line":1311,"column":17}},"426":{"start":{"line":1355,"column":8},"end":{"line":1355,"column":47}},"427":{"start":{"line":1357,"column":8},"end":{"line":1370,"column":9}},"428":{"start":{"line":1358,"column":12},"end":{"line":1358,"column":21}},"429":{"start":{"line":1359,"column":12},"end":{"line":1359,"column":23}},"430":{"start":{"line":1360,"column":12},"end":{"line":1369,"column":13}},"431":{"start":{"line":1361,"column":16},"end":{"line":1361,"column":38}},"432":{"start":{"line":1362,"column":16},"end":{"line":1365,"column":17}},"433":{"start":{"line":1363,"column":20},"end":{"line":1363,"column":44}},"434":{"start":{"line":1364,"column":20},"end":{"line":1364,"column":32}},"435":{"start":{"line":1367,"column":16},"end":{"line":1367,"column":38}},"436":{"start":{"line":1368,"column":16},"end":{"line":1368,"column":27}},"437":{"start":{"line":1371,"column":8},"end":{"line":1371,"column":17}},"438":{"start":{"line":1378,"column":25},"end":{"line":1378,"column":37}},"439":{"start":{"line":1400,"column":8},"end":{"line":1400,"column":26}},"440":{"start":{"line":1402,"column":8},"end":{"line":1404,"column":9}},"441":{"start":{"line":1403,"column":12},"end":{"line":1403,"column":55}},"442":{"start":{"line":1406,"column":8},"end":{"line":1410,"column":9}},"443":{"start":{"line":1407,"column":12},"end":{"line":1407,"column":40}},"444":{"start":{"line":1409,"column":12},"end":{"line":1409,"column":44}},"445":{"start":{"line":1412,"column":8},"end":{"line":1412,"column":17}},"446":{"start":{"line":1424,"column":8},"end":{"line":1424,"column":60}},"447":{"start":{"line":1425,"column":8},"end":{"line":1425,"column":39}},"448":{"start":{"line":1446,"column":8},"end":{"line":1446,"column":16}},"449":{"start":{"line":1447,"column":8},"end":{"line":1449,"column":9}},"450":{"start":{"line":1448,"column":12},"end":{"line":1448,"column":21}},"451":{"start":{"line":1453,"column":8},"end":{"line":1457,"column":9}},"452":{"start":{"line":1454,"column":12},"end":{"line":1454,"column":29}},"453":{"start":{"line":1456,"column":12},"end":{"line":1456,"column":56}},"454":{"start":{"line":1459,"column":8},"end":{"line":1468,"column":9}},"455":{"start":{"line":1460,"column":12},"end":{"line":1460,"column":30}},"456":{"start":{"line":1461,"column":12},"end":{"line":1467,"column":13}},"457":{"start":{"line":1462,"column":16},"end":{"line":1466,"column":17}},"458":{"start":{"line":1463,"column":20},"end":{"line":1463,"column":34}},"459":{"start":{"line":1465,"column":20},"end":{"line":1465,"column":31}},"460":{"start":{"line":1469,"column":8},"end":{"line":1469,"column":19}},"461":{"start":{"line":1479,"column":8},"end":{"line":1479,"column":21}},"462":{"start":{"line":1480,"column":8},"end":{"line":1482,"column":9}},"463":{"start":{"line":1481,"column":12},"end":{"line":1481,"column":30}},"464":{"start":{"line":1483,"column":8},"end":{"line":1483,"column":31}},"465":{"start":{"line":1484,"column":8},"end":{"line":1484,"column":21}},"466":{"start":{"line":1485,"column":8},"end":{"line":1485,"column":24}},"467":{"start":{"line":1502,"column":4},"end":{"line":1502,"column":26}},"468":{"start":{"line":1505,"column":4},"end":{"line":1509,"column":5}},"469":{"start":{"line":1506,"column":8},"end":{"line":1508,"column":9}},"470":{"start":{"line":1507,"column":12},"end":{"line":1507,"column":36}},"471":{"start":{"line":1546,"column":4},"end":{"line":1558,"column":6}},"472":{"start":{"line":1547,"column":8},"end":{"line":1549,"column":9}},"473":{"start":{"line":1548,"column":12},"end":{"line":1548,"column":19}},"474":{"start":{"line":1551,"column":8},"end":{"line":1553,"column":9}},"475":{"start":{"line":1552,"column":12},"end":{"line":1552,"column":68}},"476":{"start":{"line":1555,"column":8},"end":{"line":1555,"column":49}},"477":{"start":{"line":1557,"column":8},"end":{"line":1557,"column":39}},"478":{"start":{"line":1561,"column":4},"end":{"line":1561,"column":16}},"479":{"start":{"line":1563,"column":4},"end":{"line":1573,"column":5}},"480":{"start":{"line":1564,"column":8},"end":{"line":1564,"column":50}},"481":{"start":{"line":1569,"column":8},"end":{"line":1569,"column":40}},"482":{"start":{"line":1571,"column":8},"end":{"line":1571,"column":22}},"483":{"start":{"line":1572,"column":8},"end":{"line":1572,"column":21}},"484":{"start":{"line":1575,"column":4},"end":{"line":1575,"column":22}},"485":{"start":{"line":1576,"column":4},"end":{"line":1576,"column":28}},"486":{"start":{"line":1580,"column":4},"end":{"line":1606,"column":5}},"487":{"start":{"line":1581,"column":8},"end":{"line":1581,"column":26}},"488":{"start":{"line":1595,"column":8},"end":{"line":1597,"column":10}},"489":{"start":{"line":1596,"column":12},"end":{"line":1596,"column":34}},"490":{"start":{"line":1605,"column":8},"end":{"line":1605,"column":32}},"491":{"start":{"line":1608,"column":4},"end":{"line":1608,"column":26}},"492":{"start":{"line":1973,"column":0},"end":{"line":3936,"column":3}},"493":{"start":{"line":1995,"column":0},"end":{"line":2020,"column":61}},"494":{"start":{"line":2049,"column":0},"end":{"line":2051,"column":2}},"495":{"start":{"line":2050,"column":4},"end":{"line":2050,"column":71}},"496":{"start":{"line":2067,"column":0},"end":{"line":2069,"column":2}},"497":{"start":{"line":2068,"column":4},"end":{"line":2068,"column":33}},"498":{"start":{"line":2078,"column":0},"end":{"line":2080,"column":2}},"499":{"start":{"line":2079,"column":4},"end":{"line":2079,"column":34}},"500":{"start":{"line":2089,"column":0},"end":{"line":2091,"column":2}},"501":{"start":{"line":2090,"column":4},"end":{"line":2090,"column":80}},"502":{"start":{"line":2117,"column":0},"end":{"line":2119,"column":2}},"503":{"start":{"line":2118,"column":4},"end":{"line":2118,"column":36}},"504":{"start":{"line":2128,"column":0},"end":{"line":2130,"column":2}},"505":{"start":{"line":2129,"column":4},"end":{"line":2129,"column":22}},"506":{"start":{"line":2139,"column":0},"end":{"line":2141,"column":2}},"507":{"start":{"line":2140,"column":4},"end":{"line":2140,"column":48}},"508":{"start":{"line":2154,"column":0},"end":{"line":2158,"column":2}},"509":{"start":{"line":2155,"column":4},"end":{"line":2155,"column":21}},"510":{"start":{"line":2156,"column":4},"end":{"line":2157,"column":70}},"511":{"start":{"line":2167,"column":0},"end":{"line":2169,"column":2}},"512":{"start":{"line":2168,"column":4},"end":{"line":2168,"column":38}},"513":{"start":{"line":2178,"column":0},"end":{"line":2180,"column":2}},"514":{"start":{"line":2179,"column":4},"end":{"line":2179,"column":33}},"515":{"start":{"line":2189,"column":0},"end":{"line":2191,"column":2}},"516":{"start":{"line":2190,"column":4},"end":{"line":2190,"column":36}},"517":{"start":{"line":2202,"column":0},"end":{"line":2216,"column":2}},"518":{"start":{"line":2203,"column":4},"end":{"line":2203,"column":22}},"519":{"start":{"line":2205,"column":4},"end":{"line":2215,"column":5}},"520":{"start":{"line":2207,"column":12},"end":{"line":2207,"column":31}},"521":{"start":{"line":2211,"column":12},"end":{"line":2211,"column":25}},"522":{"start":{"line":2214,"column":12},"end":{"line":2214,"column":23}},"523":{"start":{"line":2226,"column":0},"end":{"line":2228,"column":2}},"524":{"start":{"line":2227,"column":4},"end":{"line":2227,"column":32}},"525":{"start":{"line":2247,"column":0},"end":{"line":2251,"column":2}},"526":{"start":{"line":2248,"column":4},"end":{"line":2250,"column":11}},"527":{"start":{"line":2249,"column":8},"end":{"line":2249,"column":54}},"528":{"start":{"line":2261,"column":0},"end":{"line":2269,"column":2}},"529":{"start":{"line":2262,"column":4},"end":{"line":2262,"column":38}},"530":{"start":{"line":2264,"column":4},"end":{"line":2268,"column":5}},"531":{"start":{"line":2265,"column":8},"end":{"line":2265,"column":40}},"532":{"start":{"line":2267,"column":8},"end":{"line":2267,"column":17}},"533":{"start":{"line":2278,"column":0},"end":{"line":2282,"column":2}},"534":{"start":{"line":2279,"column":4},"end":{"line":2279,"column":24}},"535":{"start":{"line":2281,"column":4},"end":{"line":2281,"column":42}},"536":{"start":{"line":2291,"column":0},"end":{"line":2295,"column":2}},"537":{"start":{"line":2292,"column":4},"end":{"line":2292,"column":25}},"538":{"start":{"line":2294,"column":4},"end":{"line":2294,"column":43}},"539":{"start":{"line":2324,"column":0},"end":{"line":2326,"column":2}},"540":{"start":{"line":2325,"column":4},"end":{"line":2325,"column":81}},"541":{"start":{"line":2332,"column":0},"end":{"line":2335,"column":45}},"542":{"start":{"line":2365,"column":0},"end":{"line":2387,"column":1}},"543":{"start":{"line":2366,"column":4},"end":{"line":2366,"column":20}},"544":{"start":{"line":2369,"column":4},"end":{"line":2369,"column":35}},"545":{"start":{"line":2371,"column":4},"end":{"line":2384,"column":5}},"546":{"start":{"line":2373,"column":8},"end":{"line":2383,"column":9}},"547":{"start":{"line":2374,"column":12},"end":{"line":2374,"column":56}},"548":{"start":{"line":2376,"column":12},"end":{"line":2376,"column":24}},"549":{"start":{"line":2378,"column":12},"end":{"line":2380,"column":13}},"550":{"start":{"line":2379,"column":16},"end":{"line":2379,"column":47}},"551":{"start":{"line":2382,"column":12},"end":{"line":2382,"column":26}},"552":{"start":{"line":2386,"column":4},"end":{"line":2386,"column":19}},"553":{"start":{"line":2389,"column":0},"end":{"line":2389,"column":17}},"554":{"start":{"line":2408,"column":0},"end":{"line":2438,"column":2}},"555":{"start":{"line":2409,"column":4},"end":{"line":2411,"column":21}},"556":{"start":{"line":2413,"column":4},"end":{"line":2420,"column":5}},"557":{"start":{"line":2414,"column":8},"end":{"line":2414,"column":24}},"558":{"start":{"line":2416,"column":8},"end":{"line":2419,"column":9}},"559":{"start":{"line":2417,"column":12},"end":{"line":2417,"column":27}},"560":{"start":{"line":2418,"column":12},"end":{"line":2418,"column":31}},"561":{"start":{"line":2422,"column":4},"end":{"line":2422,"column":19}},"562":{"start":{"line":2424,"column":4},"end":{"line":2426,"column":21}},"563":{"start":{"line":2428,"column":4},"end":{"line":2435,"column":5}},"564":{"start":{"line":2429,"column":8},"end":{"line":2429,"column":24}},"565":{"start":{"line":2431,"column":8},"end":{"line":2434,"column":9}},"566":{"start":{"line":2432,"column":12},"end":{"line":2432,"column":27}},"567":{"start":{"line":2433,"column":12},"end":{"line":2433,"column":31}},"568":{"start":{"line":2437,"column":4},"end":{"line":2437,"column":19}},"569":{"start":{"line":2455,"column":0},"end":{"line":2466,"column":2}},"570":{"start":{"line":2456,"column":4},"end":{"line":2456,"column":55}},"571":{"start":{"line":2457,"column":4},"end":{"line":2457,"column":13}},"572":{"start":{"line":2459,"column":4},"end":{"line":2463,"column":5}},"573":{"start":{"line":2460,"column":8},"end":{"line":2462,"column":9}},"574":{"start":{"line":2461,"column":12},"end":{"line":2461,"column":54}},"575":{"start":{"line":2465,"column":4},"end":{"line":2465,"column":13}},"576":{"start":{"line":2492,"column":0},"end":{"line":2504,"column":2}},"577":{"start":{"line":2493,"column":4},"end":{"line":2495,"column":15}},"578":{"start":{"line":2497,"column":4},"end":{"line":2501,"column":5}},"579":{"start":{"line":2498,"column":8},"end":{"line":2500,"column":9}},"580":{"start":{"line":2499,"column":12},"end":{"line":2499,"column":71}},"581":{"start":{"line":2503,"column":4},"end":{"line":2503,"column":16}},"582":{"start":{"line":2520,"column":0},"end":{"line":2544,"column":2}},"583":{"start":{"line":2521,"column":4},"end":{"line":2521,"column":51}},"584":{"start":{"line":2524,"column":4},"end":{"line":2524,"column":27}},"585":{"start":{"line":2526,"column":4},"end":{"line":2526,"column":22}},"586":{"start":{"line":2527,"column":4},"end":{"line":2527,"column":57}},"587":{"start":{"line":2529,"column":4},"end":{"line":2535,"column":5}},"588":{"start":{"line":2530,"column":8},"end":{"line":2530,"column":20}},"589":{"start":{"line":2532,"column":8},"end":{"line":2534,"column":9}},"590":{"start":{"line":2533,"column":12},"end":{"line":2533,"column":21}},"591":{"start":{"line":2537,"column":4},"end":{"line":2541,"column":5}},"592":{"start":{"line":2538,"column":8},"end":{"line":2540,"column":9}},"593":{"start":{"line":2539,"column":12},"end":{"line":2539,"column":24}},"594":{"start":{"line":2543,"column":4},"end":{"line":2543,"column":14}},"595":{"start":{"line":2565,"column":0},"end":{"line":2567,"column":2}},"596":{"start":{"line":2566,"column":4},"end":{"line":2566,"column":17}},"597":{"start":{"line":2585,"column":0},"end":{"line":2595,"column":2}},"598":{"start":{"line":2586,"column":4},"end":{"line":2586,"column":48}},"599":{"start":{"line":2588,"column":4},"end":{"line":2592,"column":5}},"600":{"start":{"line":2589,"column":8},"end":{"line":2591,"column":9}},"601":{"start":{"line":2590,"column":12},"end":{"line":2590,"column":24}},"602":{"start":{"line":2594,"column":4},"end":{"line":2594,"column":17}},"603":{"start":{"line":2615,"column":0},"end":{"line":2632,"column":2}},"604":{"start":{"line":2616,"column":4},"end":{"line":2616,"column":19}},"605":{"start":{"line":2618,"column":4},"end":{"line":2629,"column":5}},"606":{"start":{"line":2619,"column":8},"end":{"line":2619,"column":19}},"607":{"start":{"line":2620,"column":11},"end":{"line":2629,"column":5}},"608":{"start":{"line":2621,"column":8},"end":{"line":2628,"column":23}},"609":{"start":{"line":2625,"column":12},"end":{"line":2627,"column":13}},"610":{"start":{"line":2626,"column":16},"end":{"line":2626,"column":27}},"611":{"start":{"line":2631,"column":4},"end":{"line":2631,"column":18}},"612":{"start":{"line":2649,"column":0},"end":{"line":2652,"column":1}},"613":{"start":{"line":2650,"column":4},"end":{"line":2650,"column":17}},"614":{"start":{"line":2651,"column":4},"end":{"line":2651,"column":36}},"615":{"start":{"line":2654,"column":0},"end":{"line":2714,"column":2}},"616":{"start":{"line":2669,"column":8},"end":{"line":2669,"column":21}},"617":{"start":{"line":2679,"column":8},"end":{"line":2679,"column":31}},"618":{"start":{"line":2689,"column":8},"end":{"line":2689,"column":29}},"619":{"start":{"line":2700,"column":8},"end":{"line":2700,"column":47}},"620":{"start":{"line":2702,"column":8},"end":{"line":2702,"column":20}},"621":{"start":{"line":2712,"column":8},"end":{"line":2712,"column":30}},"622":{"start":{"line":2716,"column":0},"end":{"line":2716,"column":16}},"623":{"start":{"line":2718,"column":0},"end":{"line":2718,"column":59}},"624":{"start":{"line":2729,"column":0},"end":{"line":2732,"column":31}},"625":{"start":{"line":2758,"column":0},"end":{"line":2774,"column":2}},"626":{"start":{"line":2760,"column":4},"end":{"line":2760,"column":26}},"627":{"start":{"line":2762,"column":4},"end":{"line":2773,"column":6}},"628":{"start":{"line":2763,"column":8},"end":{"line":2765,"column":28}},"629":{"start":{"line":2768,"column":8},"end":{"line":2770,"column":9}},"630":{"start":{"line":2769,"column":12},"end":{"line":2769,"column":57}},"631":{"start":{"line":2772,"column":8},"end":{"line":2772,"column":26}},"632":{"start":{"line":2792,"column":0},"end":{"line":2803,"column":2}},"633":{"start":{"line":2796,"column":4},"end":{"line":2796,"column":27}},"634":{"start":{"line":2802,"column":4},"end":{"line":2802,"column":31}},"635":{"start":{"line":2817,"column":0},"end":{"line":2835,"column":2}},"636":{"start":{"line":2818,"column":4},"end":{"line":2822,"column":12}},"637":{"start":{"line":2824,"column":4},"end":{"line":2832,"column":5}},"638":{"start":{"line":2825,"column":8},"end":{"line":2825,"column":27}},"639":{"start":{"line":2827,"column":8},"end":{"line":2831,"column":9}},"640":{"start":{"line":2828,"column":12},"end":{"line":2830,"column":13}},"641":{"start":{"line":2829,"column":16},"end":{"line":2829,"column":39}},"642":{"start":{"line":2834,"column":4},"end":{"line":2834,"column":18}},"643":{"start":{"line":2871,"column":0},"end":{"line":2979,"column":2}},"644":{"start":{"line":2872,"column":4},"end":{"line":2872,"column":55}},"645":{"start":{"line":2877,"column":4},"end":{"line":2879,"column":5}},"646":{"start":{"line":2878,"column":8},"end":{"line":2878,"column":29}},"647":{"start":{"line":2881,"column":4},"end":{"line":2904,"column":5}},"648":{"start":{"line":2885,"column":8},"end":{"line":2888,"column":9}},"649":{"start":{"line":2886,"column":12},"end":{"line":2887,"column":41}},"650":{"start":{"line":2892,"column":8},"end":{"line":2892,"column":72}},"651":{"start":{"line":2893,"column":8},"end":{"line":2893,"column":72}},"652":{"start":{"line":2898,"column":8},"end":{"line":2900,"column":9}},"653":{"start":{"line":2899,"column":12},"end":{"line":2899,"column":28}},"654":{"start":{"line":2902,"column":8},"end":{"line":2902,"column":24}},"655":{"start":{"line":2903,"column":8},"end":{"line":2903,"column":24}},"656":{"start":{"line":2908,"column":4},"end":{"line":2908,"column":42}},"657":{"start":{"line":2910,"column":4},"end":{"line":2976,"column":5}},"658":{"start":{"line":2911,"column":8},"end":{"line":2945,"column":9}},"659":{"start":{"line":2912,"column":12},"end":{"line":2912,"column":31}},"660":{"start":{"line":2919,"column":12},"end":{"line":2921,"column":13}},"661":{"start":{"line":2920,"column":16},"end":{"line":2920,"column":25}},"662":{"start":{"line":2926,"column":12},"end":{"line":2926,"column":57}},"663":{"start":{"line":2928,"column":12},"end":{"line":2944,"column":13}},"664":{"start":{"line":2938,"column":16},"end":{"line":2938,"column":69}},"665":{"start":{"line":2939,"column":19},"end":{"line":2944,"column":13}},"666":{"start":{"line":2943,"column":16},"end":{"line":2943,"column":36}},"667":{"start":{"line":2947,"column":8},"end":{"line":2968,"column":9}},"668":{"start":{"line":2953,"column":12},"end":{"line":2955,"column":13}},"669":{"start":{"line":2954,"column":16},"end":{"line":2954,"column":25}},"670":{"start":{"line":2960,"column":12},"end":{"line":2960,"column":57}},"671":{"start":{"line":2962,"column":12},"end":{"line":2967,"column":13}},"672":{"start":{"line":2964,"column":16},"end":{"line":2964,"column":69}},"673":{"start":{"line":2965,"column":19},"end":{"line":2967,"column":13}},"674":{"start":{"line":2966,"column":16},"end":{"line":2966,"column":36}},"675":{"start":{"line":2973,"column":8},"end":{"line":2975,"column":9}},"676":{"start":{"line":2974,"column":12},"end":{"line":2974,"column":73}},"677":{"start":{"line":2978,"column":4},"end":{"line":2978,"column":20}},"678":{"start":{"line":2994,"column":0},"end":{"line":3087,"column":2}},"679":{"start":{"line":3016,"column":4},"end":{"line":3016,"column":30}},"680":{"start":{"line":3019,"column":4},"end":{"line":3019,"column":19}},"681":{"start":{"line":3022,"column":4},"end":{"line":3025,"column":6}},"682":{"start":{"line":3023,"column":8},"end":{"line":3023,"column":26}},"683":{"start":{"line":3024,"column":8},"end":{"line":3024,"column":23}},"684":{"start":{"line":3086,"column":4},"end":{"line":3086,"column":42}},"685":{"start":{"line":3098,"column":0},"end":{"line":3098,"column":16}},"686":{"start":{"line":3123,"column":0},"end":{"line":3156,"column":2}},"687":{"start":{"line":3124,"column":4},"end":{"line":3126,"column":5}},"688":{"start":{"line":3125,"column":8},"end":{"line":3125,"column":66}},"689":{"start":{"line":3128,"column":4},"end":{"line":3129,"column":20}},"690":{"start":{"line":3131,"column":4},"end":{"line":3143,"column":5}},"691":{"start":{"line":3132,"column":8},"end":{"line":3136,"column":9}},"692":{"start":{"line":3133,"column":12},"end":{"line":3135,"column":13}},"693":{"start":{"line":3134,"column":16},"end":{"line":3134,"column":31}},"694":{"start":{"line":3138,"column":8},"end":{"line":3142,"column":9}},"695":{"start":{"line":3139,"column":12},"end":{"line":3141,"column":13}},"696":{"start":{"line":3140,"column":16},"end":{"line":3140,"column":31}},"697":{"start":{"line":3145,"column":4},"end":{"line":3153,"column":5}},"698":{"start":{"line":3146,"column":8},"end":{"line":3152,"column":9}},"699":{"start":{"line":3147,"column":12},"end":{"line":3147,"column":31}},"700":{"start":{"line":3149,"column":12},"end":{"line":3151,"column":13}},"701":{"start":{"line":3150,"column":16},"end":{"line":3150,"column":31}},"702":{"start":{"line":3155,"column":4},"end":{"line":3155,"column":16}},"703":{"start":{"line":3175,"column":0},"end":{"line":3186,"column":2}},"704":{"start":{"line":3176,"column":4},"end":{"line":3179,"column":20}},"705":{"start":{"line":3181,"column":4},"end":{"line":3183,"column":5}},"706":{"start":{"line":3182,"column":8},"end":{"line":3182,"column":34}},"707":{"start":{"line":3185,"column":4},"end":{"line":3185,"column":18}},"708":{"start":{"line":3196,"column":0},"end":{"line":3202,"column":2}},"709":{"start":{"line":3197,"column":4},"end":{"line":3201,"column":5}},"710":{"start":{"line":3198,"column":8},"end":{"line":3198,"column":34}},"711":{"start":{"line":3200,"column":8},"end":{"line":3200,"column":17}},"712":{"start":{"line":3214,"column":0},"end":{"line":3216,"column":2}},"713":{"start":{"line":3215,"column":4},"end":{"line":3215,"column":54}},"714":{"start":{"line":3238,"column":0},"end":{"line":3248,"column":2}},"715":{"start":{"line":3239,"column":4},"end":{"line":3239,"column":12}},"716":{"start":{"line":3241,"column":4},"end":{"line":3245,"column":5}},"717":{"start":{"line":3242,"column":8},"end":{"line":3244,"column":9}},"718":{"start":{"line":3243,"column":12},"end":{"line":3243,"column":54}},"719":{"start":{"line":3247,"column":4},"end":{"line":3247,"column":13}},"720":{"start":{"line":3270,"column":0},"end":{"line":3282,"column":2}},"721":{"start":{"line":3271,"column":4},"end":{"line":3271,"column":12}},"722":{"start":{"line":3273,"column":4},"end":{"line":3279,"column":5}},"723":{"start":{"line":3274,"column":8},"end":{"line":3278,"column":9}},"724":{"start":{"line":3275,"column":12},"end":{"line":3277,"column":13}},"725":{"start":{"line":3276,"column":16},"end":{"line":3276,"column":28}},"726":{"start":{"line":3281,"column":4},"end":{"line":3281,"column":17}},"727":{"start":{"line":3297,"column":0},"end":{"line":3311,"column":2}},"728":{"start":{"line":3298,"column":4},"end":{"line":3300,"column":5}},"729":{"start":{"line":3299,"column":8},"end":{"line":3299,"column":25}},"730":{"start":{"line":3302,"column":4},"end":{"line":3304,"column":21}},"731":{"start":{"line":3306,"column":4},"end":{"line":3308,"column":5}},"732":{"start":{"line":3307,"column":8},"end":{"line":3307,"column":20}},"733":{"start":{"line":3310,"column":4},"end":{"line":3310,"column":13}},"734":{"start":{"line":3327,"column":0},"end":{"line":3346,"column":2}},"735":{"start":{"line":3328,"column":4},"end":{"line":3331,"column":16}},"736":{"start":{"line":3333,"column":4},"end":{"line":3343,"column":5}},"737":{"start":{"line":3334,"column":8},"end":{"line":3336,"column":9}},"738":{"start":{"line":3335,"column":12},"end":{"line":3335,"column":28}},"739":{"start":{"line":3338,"column":8},"end":{"line":3342,"column":9}},"740":{"start":{"line":3339,"column":12},"end":{"line":3339,"column":28}},"741":{"start":{"line":3341,"column":12},"end":{"line":3341,"column":29}},"742":{"start":{"line":3345,"column":4},"end":{"line":3345,"column":13}},"743":{"start":{"line":3357,"column":0},"end":{"line":3359,"column":2}},"744":{"start":{"line":3358,"column":4},"end":{"line":3358,"column":39}},"745":{"start":{"line":3393,"column":0},"end":{"line":3823,"column":2}},"746":{"start":{"line":3395,"column":4},"end":{"line":3624,"column":6}},"747":{"start":{"line":3396,"column":12},"end":{"line":3396,"column":22}},"748":{"start":{"line":3397,"column":12},"end":{"line":3399,"column":16}},"749":{"start":{"line":3398,"column":16},"end":{"line":3398,"column":46}},"750":{"start":{"line":3632,"column":4},"end":{"line":3632,"column":21}},"751":{"start":{"line":3635,"column":4},"end":{"line":3635,"column":67}},"752":{"start":{"line":3637,"column":4},"end":{"line":3798,"column":5}},"753":{"start":{"line":3639,"column":8},"end":{"line":3651,"column":9}},"754":{"start":{"line":3640,"column":12},"end":{"line":3640,"column":29}},"755":{"start":{"line":3641,"column":15},"end":{"line":3651,"column":9}},"756":{"start":{"line":3642,"column":12},"end":{"line":3642,"column":31}},"757":{"start":{"line":3643,"column":15},"end":{"line":3651,"column":9}},"758":{"start":{"line":3644,"column":12},"end":{"line":3644,"column":29}},"759":{"start":{"line":3645,"column":15},"end":{"line":3651,"column":9}},"760":{"start":{"line":3646,"column":12},"end":{"line":3646,"column":28}},"761":{"start":{"line":3647,"column":15},"end":{"line":3651,"column":9}},"762":{"start":{"line":3648,"column":12},"end":{"line":3648,"column":27}},"763":{"start":{"line":3649,"column":15},"end":{"line":3651,"column":9}},"764":{"start":{"line":3650,"column":12},"end":{"line":3650,"column":27}},"765":{"start":{"line":3654,"column":8},"end":{"line":3656,"column":9}},"766":{"start":{"line":3655,"column":12},"end":{"line":3655,"column":25}},"767":{"start":{"line":3657,"column":8},"end":{"line":3659,"column":9}},"768":{"start":{"line":3658,"column":12},"end":{"line":3658,"column":33}},"769":{"start":{"line":3660,"column":8},"end":{"line":3662,"column":9}},"770":{"start":{"line":3661,"column":12},"end":{"line":3661,"column":31}},"771":{"start":{"line":3664,"column":8},"end":{"line":3664,"column":46}},"772":{"start":{"line":3665,"column":8},"end":{"line":3751,"column":9}},"773":{"start":{"line":3666,"column":12},"end":{"line":3666,"column":39}},"774":{"start":{"line":3667,"column":12},"end":{"line":3667,"column":32}},"775":{"start":{"line":3669,"column":12},"end":{"line":3674,"column":13}},"776":{"start":{"line":3670,"column":16},"end":{"line":3670,"column":52}},"777":{"start":{"line":3671,"column":16},"end":{"line":3673,"column":17}},"778":{"start":{"line":3672,"column":20},"end":{"line":3672,"column":50}},"779":{"start":{"line":3677,"column":12},"end":{"line":3728,"column":13}},"780":{"start":{"line":3678,"column":16},"end":{"line":3678,"column":35}},"781":{"start":{"line":3680,"column":16},"end":{"line":3680,"column":44}},"782":{"start":{"line":3681,"column":16},"end":{"line":3683,"column":17}},"783":{"start":{"line":3682,"column":20},"end":{"line":3682,"column":58}},"784":{"start":{"line":3684,"column":16},"end":{"line":3684,"column":26}},"785":{"start":{"line":3685,"column":16},"end":{"line":3685,"column":29}},"786":{"start":{"line":3686,"column":16},"end":{"line":3686,"column":47}},"787":{"start":{"line":3688,"column":16},"end":{"line":3688,"column":49}},"788":{"start":{"line":3689,"column":16},"end":{"line":3691,"column":17}},"789":{"start":{"line":3690,"column":20},"end":{"line":3690,"column":50}},"790":{"start":{"line":3693,"column":16},"end":{"line":3693,"column":59}},"791":{"start":{"line":3694,"column":16},"end":{"line":3697,"column":17}},"792":{"start":{"line":3696,"column":20},"end":{"line":3696,"column":36}},"793":{"start":{"line":3698,"column":16},"end":{"line":3704,"column":17}},"794":{"start":{"line":3699,"column":20},"end":{"line":3699,"column":39}},"795":{"start":{"line":3700,"column":20},"end":{"line":3700,"column":53}},"796":{"start":{"line":3701,"column":20},"end":{"line":3703,"column":21}},"797":{"start":{"line":3702,"column":24},"end":{"line":3702,"column":50}},"798":{"start":{"line":3705,"column":16},"end":{"line":3714,"column":17}},"799":{"start":{"line":3706,"column":20},"end":{"line":3708,"column":21}},"800":{"start":{"line":3707,"column":24},"end":{"line":3707,"column":45}},"801":{"start":{"line":3709,"column":20},"end":{"line":3709,"column":54}},"802":{"start":{"line":3710,"column":20},"end":{"line":3712,"column":21}},"803":{"start":{"line":3711,"column":24},"end":{"line":3711,"column":52}},"804":{"start":{"line":3715,"column":16},"end":{"line":3727,"column":17}},"805":{"start":{"line":3716,"column":20},"end":{"line":3716,"column":51}},"806":{"start":{"line":3717,"column":20},"end":{"line":3719,"column":21}},"807":{"start":{"line":3718,"column":24},"end":{"line":3718,"column":49}},"808":{"start":{"line":3720,"column":20},"end":{"line":3723,"column":21}},"809":{"start":{"line":3721,"column":24},"end":{"line":3721,"column":41}},"810":{"start":{"line":3722,"column":24},"end":{"line":3722,"column":41}},"811":{"start":{"line":3724,"column":20},"end":{"line":3726,"column":21}},"812":{"start":{"line":3725,"column":24},"end":{"line":3725,"column":39}},"813":{"start":{"line":3730,"column":12},"end":{"line":3730,"column":44}},"814":{"start":{"line":3732,"column":12},"end":{"line":3750,"column":13}},"815":{"start":{"line":3734,"column":16},"end":{"line":3734,"column":42}},"816":{"start":{"line":3736,"column":16},"end":{"line":3736,"column":62}},"817":{"start":{"line":3738,"column":16},"end":{"line":3749,"column":17}},"818":{"start":{"line":3739,"column":20},"end":{"line":3739,"column":47}},"819":{"start":{"line":3740,"column":20},"end":{"line":3740,"column":33}},"820":{"start":{"line":3741,"column":20},"end":{"line":3743,"column":21}},"821":{"start":{"line":3742,"column":24},"end":{"line":3742,"column":44}},"822":{"start":{"line":3745,"column":20},"end":{"line":3745,"column":55}},"823":{"start":{"line":3746,"column":20},"end":{"line":3748,"column":21}},"824":{"start":{"line":3747,"column":24},"end":{"line":3747,"column":37}},"825":{"start":{"line":3753,"column":8},"end":{"line":3797,"column":9}},"826":{"start":{"line":3755,"column":12},"end":{"line":3796,"column":13}},"827":{"start":{"line":3756,"column":16},"end":{"line":3756,"column":52}},"828":{"start":{"line":3757,"column":16},"end":{"line":3759,"column":17}},"829":{"start":{"line":3758,"column":20},"end":{"line":3758,"column":46}},"830":{"start":{"line":3760,"column":16},"end":{"line":3760,"column":50}},"831":{"start":{"line":3761,"column":16},"end":{"line":3763,"column":17}},"832":{"start":{"line":3762,"column":20},"end":{"line":3762,"column":46}},"833":{"start":{"line":3765,"column":16},"end":{"line":3771,"column":17}},"834":{"start":{"line":3766,"column":20},"end":{"line":3766,"column":39}},"835":{"start":{"line":3767,"column":20},"end":{"line":3767,"column":77}},"836":{"start":{"line":3768,"column":20},"end":{"line":3770,"column":21}},"837":{"start":{"line":3769,"column":24},"end":{"line":3769,"column":50}},"838":{"start":{"line":3772,"column":16},"end":{"line":3772,"column":48}},"839":{"start":{"line":3774,"column":16},"end":{"line":3776,"column":17}},"840":{"start":{"line":3775,"column":20},"end":{"line":3775,"column":36}},"841":{"start":{"line":3778,"column":16},"end":{"line":3778,"column":69}},"842":{"start":{"line":3780,"column":16},"end":{"line":3795,"column":17}},"843":{"start":{"line":3781,"column":20},"end":{"line":3781,"column":51}},"844":{"start":{"line":3783,"column":20},"end":{"line":3783,"column":52}},"845":{"start":{"line":3785,"column":20},"end":{"line":3794,"column":21}},"846":{"start":{"line":3786,"column":24},"end":{"line":3786,"column":36}},"847":{"start":{"line":3787,"column":24},"end":{"line":3787,"column":54}},"848":{"start":{"line":3788,"column":24},"end":{"line":3793,"column":25}},"849":{"start":{"line":3789,"column":28},"end":{"line":3789,"column":54}},"850":{"start":{"line":3790,"column":28},"end":{"line":3792,"column":29}},"851":{"start":{"line":3791,"column":32},"end":{"line":3791,"column":50}},"852":{"start":{"line":3802,"column":4},"end":{"line":3804,"column":5}},"853":{"start":{"line":3803,"column":8},"end":{"line":3803,"column":114}},"854":{"start":{"line":3807,"column":4},"end":{"line":3820,"column":5}},"855":{"start":{"line":3809,"column":8},"end":{"line":3816,"column":9}},"856":{"start":{"line":3811,"column":12},"end":{"line":3815,"column":13}},"857":{"start":{"line":3813,"column":16},"end":{"line":3813,"column":40}},"858":{"start":{"line":3814,"column":16},"end":{"line":3814,"column":60}},"859":{"start":{"line":3818,"column":8},"end":{"line":3818,"column":23}},"860":{"start":{"line":3822,"column":4},"end":{"line":3822,"column":13}},"861":{"start":{"line":3826,"column":0},"end":{"line":3826,"column":39}},"862":{"start":{"line":3848,"column":0},"end":{"line":3876,"column":2}},"863":{"start":{"line":3849,"column":4},"end":{"line":3849,"column":45}},"864":{"start":{"line":3851,"column":4},"end":{"line":3853,"column":5}},"865":{"start":{"line":3852,"column":8},"end":{"line":3852,"column":17}},"866":{"start":{"line":3855,"column":4},"end":{"line":3855,"column":33}},"867":{"start":{"line":3856,"column":4},"end":{"line":3856,"column":33}},"868":{"start":{"line":3858,"column":4},"end":{"line":3873,"column":5}},"869":{"start":{"line":3859,"column":8},"end":{"line":3859,"column":40}},"870":{"start":{"line":3860,"column":8},"end":{"line":3860,"column":40}},"871":{"start":{"line":3863,"column":8},"end":{"line":3863,"column":36}},"872":{"start":{"line":3864,"column":8},"end":{"line":3864,"column":36}},"873":{"start":{"line":3866,"column":8},"end":{"line":3868,"column":9}},"874":{"start":{"line":3867,"column":12},"end":{"line":3867,"column":22}},"875":{"start":{"line":3870,"column":8},"end":{"line":3872,"column":9}},"876":{"start":{"line":3871,"column":12},"end":{"line":3871,"column":21}},"877":{"start":{"line":3875,"column":4},"end":{"line":3875,"column":13}},"878":{"start":{"line":3877,"column":0},"end":{"line":3920,"column":2}}},"branchMap":{"1":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":0},"end":{"line":12,"column":0}},{"start":{"line":12,"column":0},"end":{"line":12,"column":0}}]},"2":{"line":65,"type":"binary-expr","locations":[{"start":{"line":65,"column":24},"end":{"line":65,"column":25}},{"start":{"line":65,"column":29},"end":{"line":65,"column":45}},{"start":{"line":65,"column":50},"end":{"line":65,"column":67}}]},"3":{"line":67,"type":"binary-expr","locations":[{"start":{"line":67,"column":21},"end":{"line":67,"column":54}},{"start":{"line":67,"column":59},"end":{"line":67,"column":69}}]},"4":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":8}},{"start":{"line":69,"column":8},"end":{"line":69,"column":8}}]},"5":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":12},"end":{"line":100,"column":12}},{"start":{"line":100,"column":12},"end":{"line":100,"column":12}}]},"6":{"line":129,"type":"if","locations":[{"start":{"line":129,"column":12},"end":{"line":129,"column":12}},{"start":{"line":129,"column":12},"end":{"line":129,"column":12}}]},"7":{"line":134,"type":"if","locations":[{"start":{"line":134,"column":12},"end":{"line":134,"column":12}},{"start":{"line":134,"column":12},"end":{"line":134,"column":12}}]},"8":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"9":{"line":175,"type":"cond-expr","locations":[{"start":{"line":175,"column":25},"end":{"line":175,"column":31}},{"start":{"line":175,"column":34},"end":{"line":175,"column":38}}]},"10":{"line":176,"type":"cond-expr","locations":[{"start":{"line":176,"column":25},"end":{"line":176,"column":37}},{"start":{"line":176,"column":40},"end":{"line":176,"column":44}}]},"11":{"line":177,"type":"binary-expr","locations":[{"start":{"line":177,"column":16},"end":{"line":177,"column":19}},{"start":{"line":177,"column":23},"end":{"line":177,"column":42}}]},"12":{"line":178,"type":"binary-expr","locations":[{"start":{"line":178,"column":19},"end":{"line":178,"column":24}},{"start":{"line":178,"column":28},"end":{"line":178,"column":43}}]},"13":{"line":182,"type":"if","locations":[{"start":{"line":182,"column":12},"end":{"line":182,"column":12}},{"start":{"line":182,"column":12},"end":{"line":182,"column":12}}]},"14":{"line":182,"type":"binary-expr","locations":[{"start":{"line":182,"column":16},"end":{"line":182,"column":18}},{"start":{"line":182,"column":22},"end":{"line":182,"column":41}}]},"15":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":19},"end":{"line":184,"column":19}},{"start":{"line":184,"column":19},"end":{"line":184,"column":19}}]},"16":{"line":184,"type":"binary-expr","locations":[{"start":{"line":184,"column":23},"end":{"line":184,"column":25}},{"start":{"line":184,"column":29},"end":{"line":184,"column":43}}]},"17":{"line":189,"type":"if","locations":[{"start":{"line":189,"column":12},"end":{"line":189,"column":12}},{"start":{"line":189,"column":12},"end":{"line":189,"column":12}}]},"18":{"line":189,"type":"binary-expr","locations":[{"start":{"line":189,"column":16},"end":{"line":189,"column":18}},{"start":{"line":189,"column":22},"end":{"line":189,"column":44}}]},"19":{"line":194,"type":"if","locations":[{"start":{"line":194,"column":19},"end":{"line":194,"column":19}},{"start":{"line":194,"column":19},"end":{"line":194,"column":19}}]},"20":{"line":194,"type":"binary-expr","locations":[{"start":{"line":194,"column":23},"end":{"line":194,"column":25}},{"start":{"line":194,"column":29},"end":{"line":194,"column":43}}]},"21":{"line":200,"type":"if","locations":[{"start":{"line":200,"column":12},"end":{"line":200,"column":12}},{"start":{"line":200,"column":12},"end":{"line":200,"column":12}}]},"22":{"line":207,"type":"if","locations":[{"start":{"line":207,"column":12},"end":{"line":207,"column":12}},{"start":{"line":207,"column":12},"end":{"line":207,"column":12}}]},"23":{"line":217,"type":"if","locations":[{"start":{"line":217,"column":12},"end":{"line":217,"column":12}},{"start":{"line":217,"column":12},"end":{"line":217,"column":12}}]},"24":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":12},"end":{"line":228,"column":12}},{"start":{"line":228,"column":12},"end":{"line":228,"column":12}}]},"25":{"line":228,"type":"binary-expr","locations":[{"start":{"line":228,"column":16},"end":{"line":228,"column":20}},{"start":{"line":228,"column":24},"end":{"line":228,"column":35}}]},"26":{"line":238,"type":"if","locations":[{"start":{"line":238,"column":16},"end":{"line":238,"column":16}},{"start":{"line":238,"column":16},"end":{"line":238,"column":16}}]},"27":{"line":248,"type":"if","locations":[{"start":{"line":248,"column":0},"end":{"line":248,"column":0}},{"start":{"line":248,"column":0},"end":{"line":248,"column":0}}]},"28":{"line":248,"type":"binary-expr","locations":[{"start":{"line":248,"column":4},"end":{"line":248,"column":9}},{"start":{"line":248,"column":13},"end":{"line":248,"column":46}}]},"29":{"line":249,"type":"if","locations":[{"start":{"line":249,"column":4},"end":{"line":249,"column":4}},{"start":{"line":249,"column":4},"end":{"line":249,"column":4}}]},"30":{"line":256,"type":"if","locations":[{"start":{"line":256,"column":0},"end":{"line":256,"column":0}},{"start":{"line":256,"column":0},"end":{"line":256,"column":0}}]},"31":{"line":272,"type":"binary-expr","locations":[{"start":{"line":272,"column":12},"end":{"line":272,"column":13}},{"start":{"line":272,"column":17},"end":{"line":272,"column":21}}]},"32":{"line":284,"type":"if","locations":[{"start":{"line":284,"column":12},"end":{"line":284,"column":12}},{"start":{"line":284,"column":12},"end":{"line":284,"column":12}}]},"33":{"line":286,"type":"if","locations":[{"start":{"line":286,"column":16},"end":{"line":286,"column":16}},{"start":{"line":286,"column":16},"end":{"line":286,"column":16}}]},"34":{"line":286,"type":"binary-expr","locations":[{"start":{"line":286,"column":20},"end":{"line":286,"column":24}},{"start":{"line":286,"column":28},"end":{"line":286,"column":45}}]},"35":{"line":288,"type":"if","locations":[{"start":{"line":288,"column":23},"end":{"line":288,"column":23}},{"start":{"line":288,"column":23},"end":{"line":288,"column":23}}]},"36":{"line":288,"type":"binary-expr","locations":[{"start":{"line":288,"column":27},"end":{"line":288,"column":34}},{"start":{"line":288,"column":38},"end":{"line":288,"column":55}}]},"37":{"line":290,"type":"if","locations":[{"start":{"line":290,"column":23},"end":{"line":290,"column":23}},{"start":{"line":290,"column":23},"end":{"line":290,"column":23}}]},"38":{"line":290,"type":"binary-expr","locations":[{"start":{"line":290,"column":27},"end":{"line":290,"column":33}},{"start":{"line":290,"column":37},"end":{"line":290,"column":53}}]},"39":{"line":292,"type":"if","locations":[{"start":{"line":292,"column":23},"end":{"line":292,"column":23}},{"start":{"line":292,"column":23},"end":{"line":292,"column":23}}]},"40":{"line":293,"type":"binary-expr","locations":[{"start":{"line":293,"column":36},"end":{"line":293,"column":40}},{"start":{"line":293,"column":44},"end":{"line":293,"column":62}},{"start":{"line":293,"column":67},"end":{"line":293,"column":71}}]},"41":{"line":294,"type":"cond-expr","locations":[{"start":{"line":294,"column":48},"end":{"line":294,"column":69}},{"start":{"line":294,"column":72},"end":{"line":294,"column":76}}]},"42":{"line":295,"type":"if","locations":[{"start":{"line":295,"column":23},"end":{"line":295,"column":23}},{"start":{"line":295,"column":23},"end":{"line":295,"column":23}}]},"43":{"line":303,"type":"if","locations":[{"start":{"line":303,"column":8},"end":{"line":303,"column":8}},{"start":{"line":303,"column":8},"end":{"line":303,"column":8}}]},"44":{"line":345,"type":"if","locations":[{"start":{"line":345,"column":8},"end":{"line":345,"column":8}},{"start":{"line":345,"column":8},"end":{"line":345,"column":8}}]},"45":{"line":396,"type":"if","locations":[{"start":{"line":396,"column":20},"end":{"line":396,"column":20}},{"start":{"line":396,"column":20},"end":{"line":396,"column":20}}]},"46":{"line":397,"type":"binary-expr","locations":[{"start":{"line":397,"column":31},"end":{"line":397,"column":49}},{"start":{"line":397,"column":53},"end":{"line":397,"column":88}}]},"47":{"line":405,"type":"if","locations":[{"start":{"line":405,"column":24},"end":{"line":405,"column":24}},{"start":{"line":405,"column":24},"end":{"line":405,"column":24}}]},"48":{"line":415,"type":"binary-expr","locations":[{"start":{"line":415,"column":25},"end":{"line":415,"column":30}},{"start":{"line":415,"column":34},"end":{"line":415,"column":47}},{"start":{"line":416,"column":24},"end":{"line":435,"column":25}}]},"49":{"line":417,"type":"binary-expr","locations":[{"start":{"line":417,"column":41},"end":{"line":417,"column":44}},{"start":{"line":417,"column":48},"end":{"line":417,"column":82}},{"start":{"line":417,"column":87},"end":{"line":417,"column":89}}]},"50":{"line":423,"type":"if","locations":[{"start":{"line":423,"column":32},"end":{"line":423,"column":32}},{"start":{"line":423,"column":32},"end":{"line":423,"column":32}}]},"51":{"line":425,"type":"if","locations":[{"start":{"line":425,"column":36},"end":{"line":425,"column":36}},{"start":{"line":425,"column":36},"end":{"line":425,"column":36}}]},"52":{"line":443,"type":"if","locations":[{"start":{"line":443,"column":12},"end":{"line":443,"column":12}},{"start":{"line":443,"column":12},"end":{"line":443,"column":12}}]},"53":{"line":443,"type":"binary-expr","locations":[{"start":{"line":443,"column":16},"end":{"line":443,"column":21}},{"start":{"line":443,"column":25},"end":{"line":443,"column":34}}]},"54":{"line":447,"type":"if","locations":[{"start":{"line":447,"column":19},"end":{"line":447,"column":19}},{"start":{"line":447,"column":19},"end":{"line":447,"column":19}}]},"55":{"line":454,"type":"if","locations":[{"start":{"line":454,"column":20},"end":{"line":454,"column":20}},{"start":{"line":454,"column":20},"end":{"line":454,"column":20}}]},"56":{"line":470,"type":"binary-expr","locations":[{"start":{"line":470,"column":19},"end":{"line":470,"column":27}},{"start":{"line":470,"column":31},"end":{"line":481,"column":9}}]},"57":{"line":484,"type":"if","locations":[{"start":{"line":484,"column":8},"end":{"line":484,"column":8}},{"start":{"line":484,"column":8},"end":{"line":484,"column":8}}]},"58":{"line":484,"type":"binary-expr","locations":[{"start":{"line":484,"column":12},"end":{"line":484,"column":15}},{"start":{"line":484,"column":19},"end":{"line":484,"column":52}}]},"59":{"line":488,"type":"if","locations":[{"start":{"line":488,"column":12},"end":{"line":488,"column":12}},{"start":{"line":488,"column":12},"end":{"line":488,"column":12}}]},"60":{"line":493,"type":"if","locations":[{"start":{"line":493,"column":15},"end":{"line":493,"column":15}},{"start":{"line":493,"column":15},"end":{"line":493,"column":15}}]},"61":{"line":493,"type":"binary-expr","locations":[{"start":{"line":493,"column":19},"end":{"line":493,"column":22}},{"start":{"line":493,"column":26},"end":{"line":493,"column":58}},{"start":{"line":493,"column":62},"end":{"line":493,"column":81}}]},"62":{"line":497,"type":"binary-expr","locations":[{"start":{"line":497,"column":24},"end":{"line":497,"column":37}},{"start":{"line":497,"column":41},"end":{"line":497,"column":48}}]},"63":{"line":499,"type":"binary-expr","locations":[{"start":{"line":499,"column":24},"end":{"line":499,"column":39}},{"start":{"line":499,"column":43},"end":{"line":499,"column":72}}]},"64":{"line":501,"type":"if","locations":[{"start":{"line":501,"column":8},"end":{"line":501,"column":8}},{"start":{"line":501,"column":8},"end":{"line":501,"column":8}}]},"65":{"line":501,"type":"binary-expr","locations":[{"start":{"line":501,"column":12},"end":{"line":501,"column":19}},{"start":{"line":501,"column":24},"end":{"line":501,"column":53}}]},"66":{"line":504,"type":"cond-expr","locations":[{"start":{"line":504,"column":28},"end":{"line":504,"column":40}},{"start":{"line":504,"column":43},"end":{"line":504,"column":49}}]},"67":{"line":505,"type":"binary-expr","locations":[{"start":{"line":505,"column":30},"end":{"line":505,"column":51}},{"start":{"line":505,"column":55},"end":{"line":505,"column":87}}]},"68":{"line":520,"type":"binary-expr","locations":[{"start":{"line":520,"column":21},"end":{"line":520,"column":34}},{"start":{"line":520,"column":38},"end":{"line":520,"column":61}}]},"69":{"line":523,"type":"if","locations":[{"start":{"line":523,"column":12},"end":{"line":523,"column":12}},{"start":{"line":523,"column":12},"end":{"line":523,"column":12}}]},"70":{"line":531,"type":"if","locations":[{"start":{"line":531,"column":8},"end":{"line":531,"column":8}},{"start":{"line":531,"column":8},"end":{"line":531,"column":8}}]},"71":{"line":550,"type":"if","locations":[{"start":{"line":550,"column":8},"end":{"line":550,"column":8}},{"start":{"line":550,"column":8},"end":{"line":550,"column":8}}]},"72":{"line":556,"type":"if","locations":[{"start":{"line":556,"column":8},"end":{"line":556,"column":8}},{"start":{"line":556,"column":8},"end":{"line":556,"column":8}}]},"73":{"line":561,"type":"if","locations":[{"start":{"line":561,"column":16},"end":{"line":561,"column":16}},{"start":{"line":561,"column":16},"end":{"line":561,"column":16}}]},"74":{"line":565,"type":"binary-expr","locations":[{"start":{"line":565,"column":19},"end":{"line":565,"column":20}},{"start":{"line":565,"column":24},"end":{"line":565,"column":47}}]},"75":{"line":619,"type":"binary-expr","locations":[{"start":{"line":619,"column":18},"end":{"line":619,"column":25}},{"start":{"line":619,"column":29},"end":{"line":619,"column":31}}]},"76":{"line":633,"type":"binary-expr","locations":[{"start":{"line":633,"column":28},"end":{"line":633,"column":45}},{"start":{"line":633,"column":49},"end":{"line":633,"column":51}}]},"77":{"line":637,"type":"if","locations":[{"start":{"line":637,"column":12},"end":{"line":637,"column":12}},{"start":{"line":637,"column":12},"end":{"line":637,"column":12}}]},"78":{"line":639,"type":"if","locations":[{"start":{"line":639,"column":16},"end":{"line":639,"column":16}},{"start":{"line":639,"column":16},"end":{"line":639,"column":16}}]},"79":{"line":642,"type":"if","locations":[{"start":{"line":642,"column":20},"end":{"line":642,"column":20}},{"start":{"line":642,"column":20},"end":{"line":642,"column":20}}]},"80":{"line":644,"type":"if","locations":[{"start":{"line":644,"column":24},"end":{"line":644,"column":24}},{"start":{"line":644,"column":24},"end":{"line":644,"column":24}}]},"81":{"line":644,"type":"binary-expr","locations":[{"start":{"line":644,"column":28},"end":{"line":644,"column":36}},{"start":{"line":644,"column":40},"end":{"line":644,"column":52}}]},"82":{"line":686,"type":"if","locations":[{"start":{"line":686,"column":12},"end":{"line":686,"column":12}},{"start":{"line":686,"column":12},"end":{"line":686,"column":12}}]},"83":{"line":686,"type":"binary-expr","locations":[{"start":{"line":686,"column":16},"end":{"line":686,"column":22}},{"start":{"line":686,"column":26},"end":{"line":686,"column":49}}]},"84":{"line":688,"type":"if","locations":[{"start":{"line":688,"column":20},"end":{"line":688,"column":20}},{"start":{"line":688,"column":20},"end":{"line":688,"column":20}}]},"85":{"line":690,"type":"binary-expr","locations":[{"start":{"line":690,"column":29},"end":{"line":690,"column":32}},{"start":{"line":690,"column":38},"end":{"line":690,"column":44}},{"start":{"line":690,"column":48},"end":{"line":690,"column":60}},{"start":{"line":690,"column":66},"end":{"line":690,"column":74}},{"start":{"line":690,"column":78},"end":{"line":690,"column":89}}]},"86":{"line":691,"type":"if","locations":[{"start":{"line":691,"column":24},"end":{"line":691,"column":24}},{"start":{"line":691,"column":24},"end":{"line":691,"column":24}}]},"87":{"line":702,"type":"if","locations":[{"start":{"line":702,"column":12},"end":{"line":702,"column":12}},{"start":{"line":702,"column":12},"end":{"line":702,"column":12}}]},"88":{"line":706,"type":"if","locations":[{"start":{"line":706,"column":16},"end":{"line":706,"column":16}},{"start":{"line":706,"column":16},"end":{"line":706,"column":16}}]},"89":{"line":706,"type":"binary-expr","locations":[{"start":{"line":706,"column":20},"end":{"line":706,"column":27}},{"start":{"line":706,"column":31},"end":{"line":706,"column":44}},{"start":{"line":706,"column":48},"end":{"line":706,"column":52}}]},"90":{"line":710,"type":"if","locations":[{"start":{"line":710,"column":16},"end":{"line":710,"column":16}},{"start":{"line":710,"column":16},"end":{"line":710,"column":16}}]},"91":{"line":711,"type":"binary-expr","locations":[{"start":{"line":711,"column":30},"end":{"line":711,"column":36}},{"start":{"line":711,"column":40},"end":{"line":711,"column":66}}]},"92":{"line":712,"type":"if","locations":[{"start":{"line":712,"column":20},"end":{"line":712,"column":20}},{"start":{"line":712,"column":20},"end":{"line":712,"column":20}}]},"93":{"line":720,"type":"if","locations":[{"start":{"line":720,"column":20},"end":{"line":720,"column":20}},{"start":{"line":720,"column":20},"end":{"line":720,"column":20}}]},"94":{"line":720,"type":"binary-expr","locations":[{"start":{"line":720,"column":24},"end":{"line":720,"column":29}},{"start":{"line":720,"column":33},"end":{"line":720,"column":37}}]},"95":{"line":721,"type":"if","locations":[{"start":{"line":721,"column":24},"end":{"line":721,"column":24}},{"start":{"line":721,"column":24},"end":{"line":721,"column":24}}]},"96":{"line":721,"type":"binary-expr","locations":[{"start":{"line":721,"column":29},"end":{"line":721,"column":57}},{"start":{"line":721,"column":63},"end":{"line":721,"column":89}}]},"97":{"line":732,"type":"if","locations":[{"start":{"line":732,"column":24},"end":{"line":732,"column":24}},{"start":{"line":732,"column":24},"end":{"line":732,"column":24}}]},"98":{"line":742,"type":"if","locations":[{"start":{"line":742,"column":20},"end":{"line":742,"column":20}},{"start":{"line":742,"column":20},"end":{"line":742,"column":20}}]},"99":{"line":742,"type":"binary-expr","locations":[{"start":{"line":742,"column":24},"end":{"line":742,"column":30}},{"start":{"line":742,"column":34},"end":{"line":742,"column":39}},{"start":{"line":742,"column":43},"end":{"line":742,"column":54}},{"start":{"line":742,"column":58},"end":{"line":742,"column":74}}]},"100":{"line":747,"type":"if","locations":[{"start":{"line":747,"column":28},"end":{"line":747,"column":28}},{"start":{"line":747,"column":28},"end":{"line":747,"column":28}}]},"101":{"line":760,"type":"if","locations":[{"start":{"line":760,"column":20},"end":{"line":760,"column":20}},{"start":{"line":760,"column":20},"end":{"line":760,"column":20}}]},"102":{"line":761,"type":"binary-expr","locations":[{"start":{"line":761,"column":30},"end":{"line":761,"column":33}},{"start":{"line":761,"column":37},"end":{"line":761,"column":39}}]},"103":{"line":765,"type":"if","locations":[{"start":{"line":765,"column":20},"end":{"line":765,"column":20}},{"start":{"line":765,"column":20},"end":{"line":765,"column":20}}]},"104":{"line":768,"type":"if","locations":[{"start":{"line":768,"column":28},"end":{"line":768,"column":28}},{"start":{"line":768,"column":28},"end":{"line":768,"column":28}}]},"105":{"line":769,"type":"if","locations":[{"start":{"line":769,"column":32},"end":{"line":769,"column":32}},{"start":{"line":769,"column":32},"end":{"line":769,"column":32}}]},"106":{"line":777,"type":"if","locations":[{"start":{"line":777,"column":20},"end":{"line":777,"column":20}},{"start":{"line":777,"column":20},"end":{"line":777,"column":20}}]},"107":{"line":779,"type":"if","locations":[{"start":{"line":779,"column":28},"end":{"line":779,"column":28}},{"start":{"line":779,"column":28},"end":{"line":779,"column":28}}]},"108":{"line":780,"type":"if","locations":[{"start":{"line":780,"column":32},"end":{"line":780,"column":32}},{"start":{"line":780,"column":32},"end":{"line":780,"column":32}}]},"109":{"line":788,"type":"if","locations":[{"start":{"line":788,"column":20},"end":{"line":788,"column":20}},{"start":{"line":788,"column":20},"end":{"line":788,"column":20}}]},"110":{"line":790,"type":"if","locations":[{"start":{"line":790,"column":24},"end":{"line":790,"column":24}},{"start":{"line":790,"column":24},"end":{"line":790,"column":24}}]},"111":{"line":795,"type":"if","locations":[{"start":{"line":795,"column":28},"end":{"line":795,"column":28}},{"start":{"line":795,"column":28},"end":{"line":795,"column":28}}]},"112":{"line":798,"type":"cond-expr","locations":[{"start":{"line":798,"column":92},"end":{"line":798,"column":108}},{"start":{"line":798,"column":111},"end":{"line":798,"column":112}}]},"113":{"line":802,"type":"if","locations":[{"start":{"line":802,"column":24},"end":{"line":802,"column":24}},{"start":{"line":802,"column":24},"end":{"line":802,"column":24}}]},"114":{"line":803,"type":"cond-expr","locations":[{"start":{"line":803,"column":66},"end":{"line":803,"column":75}},{"start":{"line":803,"column":78},"end":{"line":803,"column":81}}]},"115":{"line":806,"type":"cond-expr","locations":[{"start":{"line":806,"column":70},"end":{"line":806,"column":79}},{"start":{"line":806,"column":82},"end":{"line":806,"column":85}}]},"116":{"line":812,"type":"if","locations":[{"start":{"line":812,"column":24},"end":{"line":812,"column":24}},{"start":{"line":812,"column":24},"end":{"line":812,"column":24}}]},"117":{"line":822,"type":"if","locations":[{"start":{"line":822,"column":28},"end":{"line":822,"column":28}},{"start":{"line":822,"column":28},"end":{"line":822,"column":28}}]},"118":{"line":822,"type":"binary-expr","locations":[{"start":{"line":822,"column":32},"end":{"line":822,"column":41}},{"start":{"line":822,"column":45},"end":{"line":822,"column":73}}]},"119":{"line":828,"type":"if","locations":[{"start":{"line":828,"column":20},"end":{"line":828,"column":20}},{"start":{"line":828,"column":20},"end":{"line":828,"column":20}}]},"120":{"line":830,"type":"if","locations":[{"start":{"line":830,"column":28},"end":{"line":830,"column":28}},{"start":{"line":830,"column":28},"end":{"line":830,"column":28}}]},"121":{"line":831,"type":"if","locations":[{"start":{"line":831,"column":32},"end":{"line":831,"column":32}},{"start":{"line":831,"column":32},"end":{"line":831,"column":32}}]},"122":{"line":864,"type":"cond-expr","locations":[{"start":{"line":864,"column":42},"end":{"line":864,"column":47}},{"start":{"line":864,"column":50},"end":{"line":864,"column":66}}]},"123":{"line":866,"type":"if","locations":[{"start":{"line":866,"column":8},"end":{"line":866,"column":8}},{"start":{"line":866,"column":8},"end":{"line":866,"column":8}}]},"124":{"line":954,"type":"if","locations":[{"start":{"line":954,"column":8},"end":{"line":954,"column":8}},{"start":{"line":954,"column":8},"end":{"line":954,"column":8}}]},"125":{"line":956,"type":"if","locations":[{"start":{"line":956,"column":12},"end":{"line":956,"column":12}},{"start":{"line":956,"column":12},"end":{"line":956,"column":12}}]},"126":{"line":962,"type":"if","locations":[{"start":{"line":962,"column":8},"end":{"line":962,"column":8}},{"start":{"line":962,"column":8},"end":{"line":962,"column":8}}]},"127":{"line":966,"type":"if","locations":[{"start":{"line":966,"column":8},"end":{"line":966,"column":8}},{"start":{"line":966,"column":8},"end":{"line":966,"column":8}}]},"128":{"line":968,"type":"if","locations":[{"start":{"line":968,"column":16},"end":{"line":968,"column":16}},{"start":{"line":968,"column":16},"end":{"line":968,"column":16}}]},"129":{"line":974,"type":"if","locations":[{"start":{"line":974,"column":12},"end":{"line":974,"column":12}},{"start":{"line":974,"column":12},"end":{"line":974,"column":12}}]},"130":{"line":975,"type":"if","locations":[{"start":{"line":975,"column":16},"end":{"line":975,"column":16}},{"start":{"line":975,"column":16},"end":{"line":975,"column":16}}]},"131":{"line":982,"type":"if","locations":[{"start":{"line":982,"column":8},"end":{"line":982,"column":8}},{"start":{"line":982,"column":8},"end":{"line":982,"column":8}}]},"132":{"line":983,"type":"binary-expr","locations":[{"start":{"line":983,"column":26},"end":{"line":983,"column":37}},{"start":{"line":983,"column":41},"end":{"line":983,"column":54}}]},"133":{"line":1016,"type":"if","locations":[{"start":{"line":1016,"column":8},"end":{"line":1016,"column":8}},{"start":{"line":1016,"column":8},"end":{"line":1016,"column":8}}]},"134":{"line":1028,"type":"if","locations":[{"start":{"line":1028,"column":20},"end":{"line":1028,"column":20}},{"start":{"line":1028,"column":20},"end":{"line":1028,"column":20}}]},"135":{"line":1063,"type":"if","locations":[{"start":{"line":1063,"column":8},"end":{"line":1063,"column":8}},{"start":{"line":1063,"column":8},"end":{"line":1063,"column":8}}]},"136":{"line":1063,"type":"binary-expr","locations":[{"start":{"line":1063,"column":12},"end":{"line":1063,"column":29}},{"start":{"line":1063,"column":33},"end":{"line":1063,"column":56}}]},"137":{"line":1065,"type":"if","locations":[{"start":{"line":1065,"column":15},"end":{"line":1065,"column":15}},{"start":{"line":1065,"column":15},"end":{"line":1065,"column":15}}]},"138":{"line":1066,"type":"if","locations":[{"start":{"line":1066,"column":12},"end":{"line":1066,"column":12}},{"start":{"line":1066,"column":12},"end":{"line":1066,"column":12}}]},"139":{"line":1066,"type":"binary-expr","locations":[{"start":{"line":1066,"column":16},"end":{"line":1066,"column":32}},{"start":{"line":1066,"column":36},"end":{"line":1066,"column":59}}]},"140":{"line":1070,"type":"if","locations":[{"start":{"line":1070,"column":12},"end":{"line":1070,"column":12}},{"start":{"line":1070,"column":12},"end":{"line":1070,"column":12}}]},"141":{"line":1094,"type":"if","locations":[{"start":{"line":1094,"column":8},"end":{"line":1094,"column":8}},{"start":{"line":1094,"column":8},"end":{"line":1094,"column":8}}]},"142":{"line":1119,"type":"if","locations":[{"start":{"line":1119,"column":16},"end":{"line":1119,"column":16}},{"start":{"line":1119,"column":16},"end":{"line":1119,"column":16}}]},"143":{"line":1123,"type":"if","locations":[{"start":{"line":1123,"column":16},"end":{"line":1123,"column":16}},{"start":{"line":1123,"column":16},"end":{"line":1123,"column":16}}]},"144":{"line":1126,"type":"if","locations":[{"start":{"line":1126,"column":24},"end":{"line":1126,"column":24}},{"start":{"line":1126,"column":24},"end":{"line":1126,"column":24}}]},"145":{"line":1126,"type":"binary-expr","locations":[{"start":{"line":1126,"column":28},"end":{"line":1126,"column":45}},{"start":{"line":1126,"column":49},"end":{"line":1126,"column":64}}]},"146":{"line":1139,"type":"if","locations":[{"start":{"line":1139,"column":20},"end":{"line":1139,"column":20}},{"start":{"line":1139,"column":20},"end":{"line":1139,"column":20}}]},"147":{"line":1144,"type":"if","locations":[{"start":{"line":1144,"column":20},"end":{"line":1144,"column":20}},{"start":{"line":1144,"column":20},"end":{"line":1144,"column":20}}]},"148":{"line":1152,"type":"if","locations":[{"start":{"line":1152,"column":20},"end":{"line":1152,"column":20}},{"start":{"line":1152,"column":20},"end":{"line":1152,"column":20}}]},"149":{"line":1159,"type":"if","locations":[{"start":{"line":1159,"column":24},"end":{"line":1159,"column":24}},{"start":{"line":1159,"column":24},"end":{"line":1159,"column":24}}]},"150":{"line":1167,"type":"if","locations":[{"start":{"line":1167,"column":20},"end":{"line":1167,"column":20}},{"start":{"line":1167,"column":20},"end":{"line":1167,"column":20}}]},"151":{"line":1167,"type":"binary-expr","locations":[{"start":{"line":1167,"column":24},"end":{"line":1167,"column":27}},{"start":{"line":1167,"column":31},"end":{"line":1167,"column":41}}]},"152":{"line":1172,"type":"if","locations":[{"start":{"line":1172,"column":20},"end":{"line":1172,"column":20}},{"start":{"line":1172,"column":20},"end":{"line":1172,"column":20}}]},"153":{"line":1172,"type":"binary-expr","locations":[{"start":{"line":1172,"column":24},"end":{"line":1172,"column":27}},{"start":{"line":1172,"column":31},"end":{"line":1172,"column":41}}]},"154":{"line":1180,"type":"binary-expr","locations":[{"start":{"line":1180,"column":31},"end":{"line":1180,"column":41}},{"start":{"line":1180,"column":45},"end":{"line":1183,"column":21}}]},"155":{"line":1190,"type":"if","locations":[{"start":{"line":1190,"column":16},"end":{"line":1190,"column":16}},{"start":{"line":1190,"column":16},"end":{"line":1190,"column":16}}]},"156":{"line":1196,"type":"if","locations":[{"start":{"line":1196,"column":20},"end":{"line":1196,"column":20}},{"start":{"line":1196,"column":20},"end":{"line":1196,"column":20}}]},"157":{"line":1197,"type":"if","locations":[{"start":{"line":1197,"column":24},"end":{"line":1197,"column":24}},{"start":{"line":1197,"column":24},"end":{"line":1197,"column":24}}]},"158":{"line":1204,"type":"if","locations":[{"start":{"line":1204,"column":16},"end":{"line":1204,"column":16}},{"start":{"line":1204,"column":16},"end":{"line":1204,"column":16}}]},"159":{"line":1204,"type":"binary-expr","locations":[{"start":{"line":1204,"column":20},"end":{"line":1204,"column":24}},{"start":{"line":1204,"column":28},"end":{"line":1204,"column":32}}]},"160":{"line":1207,"type":"if","locations":[{"start":{"line":1207,"column":24},"end":{"line":1207,"column":24}},{"start":{"line":1207,"column":24},"end":{"line":1207,"column":24}}]},"161":{"line":1212,"type":"if","locations":[{"start":{"line":1212,"column":20},"end":{"line":1212,"column":20}},{"start":{"line":1212,"column":20},"end":{"line":1212,"column":20}}]},"162":{"line":1215,"type":"if","locations":[{"start":{"line":1215,"column":20},"end":{"line":1215,"column":20}},{"start":{"line":1215,"column":20},"end":{"line":1215,"column":20}}]},"163":{"line":1220,"type":"if","locations":[{"start":{"line":1220,"column":16},"end":{"line":1220,"column":16}},{"start":{"line":1220,"column":16},"end":{"line":1220,"column":16}}]},"164":{"line":1220,"type":"binary-expr","locations":[{"start":{"line":1220,"column":20},"end":{"line":1220,"column":31}},{"start":{"line":1220,"column":35},"end":{"line":1220,"column":53}},{"start":{"line":1220,"column":57},"end":{"line":1220,"column":68}}]},"165":{"line":1228,"type":"if","locations":[{"start":{"line":1228,"column":8},"end":{"line":1228,"column":8}},{"start":{"line":1228,"column":8},"end":{"line":1228,"column":8}}]},"166":{"line":1231,"type":"if","locations":[{"start":{"line":1231,"column":16},"end":{"line":1231,"column":16}},{"start":{"line":1231,"column":16},"end":{"line":1231,"column":16}}]},"167":{"line":1236,"type":"if","locations":[{"start":{"line":1236,"column":12},"end":{"line":1236,"column":12}},{"start":{"line":1236,"column":12},"end":{"line":1236,"column":12}}]},"168":{"line":1242,"type":"if","locations":[{"start":{"line":1242,"column":8},"end":{"line":1242,"column":8}},{"start":{"line":1242,"column":8},"end":{"line":1242,"column":8}}]},"169":{"line":1242,"type":"binary-expr","locations":[{"start":{"line":1242,"column":13},"end":{"line":1242,"column":24}},{"start":{"line":1242,"column":28},"end":{"line":1242,"column":47}},{"start":{"line":1242,"column":52},"end":{"line":1242,"column":61}}]},"170":{"line":1243,"type":"cond-expr","locations":[{"start":{"line":1243,"column":52},"end":{"line":1243,"column":59}},{"start":{"line":1243,"column":62},"end":{"line":1243,"column":64}}]},"171":{"line":1249,"type":"if","locations":[{"start":{"line":1249,"column":8},"end":{"line":1249,"column":8}},{"start":{"line":1249,"column":8},"end":{"line":1249,"column":8}}]},"172":{"line":1249,"type":"binary-expr","locations":[{"start":{"line":1249,"column":12},"end":{"line":1249,"column":16}},{"start":{"line":1249,"column":20},"end":{"line":1249,"column":28}},{"start":{"line":1249,"column":32},"end":{"line":1249,"column":43}}]},"173":{"line":1254,"type":"cond-expr","locations":[{"start":{"line":1254,"column":48},"end":{"line":1254,"column":52}},{"start":{"line":1254,"column":55},"end":{"line":1254,"column":59}}]},"174":{"line":1264,"type":"if","locations":[{"start":{"line":1264,"column":8},"end":{"line":1264,"column":8}},{"start":{"line":1264,"column":8},"end":{"line":1264,"column":8}}]},"175":{"line":1271,"type":"if","locations":[{"start":{"line":1271,"column":8},"end":{"line":1271,"column":8}},{"start":{"line":1271,"column":8},"end":{"line":1271,"column":8}}]},"176":{"line":1271,"type":"binary-expr","locations":[{"start":{"line":1271,"column":12},"end":{"line":1271,"column":16}},{"start":{"line":1271,"column":20},"end":{"line":1271,"column":23}},{"start":{"line":1271,"column":27},"end":{"line":1271,"column":35}}]},"177":{"line":1279,"type":"cond-expr","locations":[{"start":{"line":1279,"column":45},"end":{"line":1279,"column":49}},{"start":{"line":1279,"column":52},"end":{"line":1279,"column":56}}]},"178":{"line":1281,"type":"if","locations":[{"start":{"line":1281,"column":15},"end":{"line":1281,"column":15}},{"start":{"line":1281,"column":15},"end":{"line":1281,"column":15}}]},"179":{"line":1281,"type":"binary-expr","locations":[{"start":{"line":1281,"column":19},"end":{"line":1281,"column":23}},{"start":{"line":1281,"column":27},"end":{"line":1281,"column":30}},{"start":{"line":1281,"column":34},"end":{"line":1281,"column":39}},{"start":{"line":1281,"column":43},"end":{"line":1281,"column":60}}]},"180":{"line":1290,"type":"if","locations":[{"start":{"line":1290,"column":16},"end":{"line":1290,"column":16}},{"start":{"line":1290,"column":16},"end":{"line":1290,"column":16}}]},"181":{"line":1295,"type":"if","locations":[{"start":{"line":1295,"column":12},"end":{"line":1295,"column":12}},{"start":{"line":1295,"column":12},"end":{"line":1295,"column":12}}]},"182":{"line":1306,"type":"if","locations":[{"start":{"line":1306,"column":12},"end":{"line":1306,"column":12}},{"start":{"line":1306,"column":12},"end":{"line":1306,"column":12}}]},"183":{"line":1360,"type":"if","locations":[{"start":{"line":1360,"column":12},"end":{"line":1360,"column":12}},{"start":{"line":1360,"column":12},"end":{"line":1360,"column":12}}]},"184":{"line":1363,"type":"binary-expr","locations":[{"start":{"line":1363,"column":30},"end":{"line":1363,"column":37}},{"start":{"line":1363,"column":41},"end":{"line":1363,"column":43}}]},"185":{"line":1367,"type":"binary-expr","locations":[{"start":{"line":1367,"column":25},"end":{"line":1367,"column":31}},{"start":{"line":1367,"column":35},"end":{"line":1367,"column":37}}]},"186":{"line":1402,"type":"if","locations":[{"start":{"line":1402,"column":8},"end":{"line":1402,"column":8}},{"start":{"line":1402,"column":8},"end":{"line":1402,"column":8}}]},"187":{"line":1406,"type":"if","locations":[{"start":{"line":1406,"column":8},"end":{"line":1406,"column":8}},{"start":{"line":1406,"column":8},"end":{"line":1406,"column":8}}]},"188":{"line":1407,"type":"binary-expr","locations":[{"start":{"line":1407,"column":19},"end":{"line":1407,"column":20}},{"start":{"line":1407,"column":24},"end":{"line":1407,"column":38}}]},"189":{"line":1425,"type":"cond-expr","locations":[{"start":{"line":1425,"column":24},"end":{"line":1425,"column":32}},{"start":{"line":1425,"column":36},"end":{"line":1425,"column":38}}]},"190":{"line":1447,"type":"if","locations":[{"start":{"line":1447,"column":8},"end":{"line":1447,"column":8}},{"start":{"line":1447,"column":8},"end":{"line":1447,"column":8}}]},"191":{"line":1453,"type":"if","locations":[{"start":{"line":1453,"column":8},"end":{"line":1453,"column":8}},{"start":{"line":1453,"column":8},"end":{"line":1453,"column":8}}]},"192":{"line":1453,"type":"binary-expr","locations":[{"start":{"line":1453,"column":12},"end":{"line":1453,"column":22}},{"start":{"line":1453,"column":26},"end":{"line":1453,"column":36}},{"start":{"line":1453,"column":40},"end":{"line":1453,"column":56}}]},"193":{"line":1456,"type":"cond-expr","locations":[{"start":{"line":1456,"column":44},"end":{"line":1456,"column":45}},{"start":{"line":1456,"column":48},"end":{"line":1456,"column":55}}]},"194":{"line":1459,"type":"if","locations":[{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}},{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}}]},"195":{"line":1461,"type":"if","locations":[{"start":{"line":1461,"column":12},"end":{"line":1461,"column":12}},{"start":{"line":1461,"column":12},"end":{"line":1461,"column":12}}]},"196":{"line":1480,"type":"if","locations":[{"start":{"line":1480,"column":8},"end":{"line":1480,"column":8}},{"start":{"line":1480,"column":8},"end":{"line":1480,"column":8}}]},"197":{"line":1506,"type":"if","locations":[{"start":{"line":1506,"column":8},"end":{"line":1506,"column":8}},{"start":{"line":1506,"column":8},"end":{"line":1506,"column":8}}]},"198":{"line":1547,"type":"if","locations":[{"start":{"line":1547,"column":8},"end":{"line":1547,"column":8}},{"start":{"line":1547,"column":8},"end":{"line":1547,"column":8}}]},"199":{"line":1551,"type":"if","locations":[{"start":{"line":1551,"column":8},"end":{"line":1551,"column":8}},{"start":{"line":1551,"column":8},"end":{"line":1551,"column":8}}]},"200":{"line":1563,"type":"if","locations":[{"start":{"line":1563,"column":4},"end":{"line":1563,"column":4}},{"start":{"line":1563,"column":4},"end":{"line":1563,"column":4}}]},"201":{"line":1580,"type":"if","locations":[{"start":{"line":1580,"column":4},"end":{"line":1580,"column":4}},{"start":{"line":1580,"column":4},"end":{"line":1580,"column":4}}]},"202":{"line":1995,"type":"binary-expr","locations":[{"start":{"line":1995,"column":8},"end":{"line":1995,"column":14}},{"start":{"line":1995,"column":19},"end":{"line":1995,"column":30}}]},"203":{"line":2050,"type":"binary-expr","locations":[{"start":{"line":2050,"column":14},"end":{"line":2050,"column":35}},{"start":{"line":2050,"column":39},"end":{"line":2050,"column":41}},{"start":{"line":2050,"column":45},"end":{"line":2050,"column":69}}]},"204":{"line":2067,"type":"cond-expr","locations":[{"start":{"line":2067,"column":41},"end":{"line":2067,"column":54}},{"start":{"line":2067,"column":57},"end":{"line":2069,"column":1}}]},"205":{"line":2090,"type":"binary-expr","locations":[{"start":{"line":2090,"column":11},"end":{"line":2090,"column":31}},{"start":{"line":2090,"column":35},"end":{"line":2090,"column":66}},{"start":{"line":2090,"column":70},"end":{"line":2090,"column":79}}]},"206":{"line":2140,"type":"binary-expr","locations":[{"start":{"line":2140,"column":11},"end":{"line":2140,"column":32}},{"start":{"line":2140,"column":36},"end":{"line":2140,"column":47}}]},"207":{"line":2156,"type":"binary-expr","locations":[{"start":{"line":2156,"column":12},"end":{"line":2156,"column":13}},{"start":{"line":2156,"column":18},"end":{"line":2156,"column":32}},{"start":{"line":2157,"column":9},"end":{"line":2157,"column":16}},{"start":{"line":2157,"column":21},"end":{"line":2157,"column":37}},{"start":{"line":2157,"column":41},"end":{"line":2157,"column":56}},{"start":{"line":2157,"column":64},"end":{"line":2157,"column":69}}]},"208":{"line":2205,"type":"switch","locations":[{"start":{"line":2206,"column":8},"end":{"line":2207,"column":31}},{"start":{"line":2209,"column":8},"end":{"line":2209,"column":20}},{"start":{"line":2210,"column":8},"end":{"line":2211,"column":25}},{"start":{"line":2213,"column":8},"end":{"line":2214,"column":23}}]},"209":{"line":2226,"type":"binary-expr","locations":[{"start":{"line":2226,"column":8},"end":{"line":2226,"column":16}},{"start":{"line":2226,"column":20},"end":{"line":2228,"column":1}}]},"210":{"line":2248,"type":"cond-expr","locations":[{"start":{"line":2248,"column":23},"end":{"line":2250,"column":6}},{"start":{"line":2250,"column":9},"end":{"line":2250,"column":10}}]},"211":{"line":2249,"type":"cond-expr","locations":[{"start":{"line":2249,"column":39},"end":{"line":2249,"column":44}},{"start":{"line":2249,"column":47},"end":{"line":2249,"column":53}}]},"212":{"line":2261,"type":"cond-expr","locations":[{"start":{"line":2261,"column":64},"end":{"line":2263,"column":1}},{"start":{"line":2263,"column":4},"end":{"line":2269,"column":1}}]},"213":{"line":2261,"type":"binary-expr","locations":[{"start":{"line":2261,"column":9},"end":{"line":2261,"column":39}},{"start":{"line":2261,"column":43},"end":{"line":2261,"column":61}}]},"214":{"line":2262,"type":"cond-expr","locations":[{"start":{"line":2262,"column":25},"end":{"line":2262,"column":33}},{"start":{"line":2262,"column":36},"end":{"line":2262,"column":37}}]},"215":{"line":2262,"type":"binary-expr","locations":[{"start":{"line":2262,"column":11},"end":{"line":2262,"column":12}},{"start":{"line":2262,"column":16},"end":{"line":2262,"column":22}}]},"216":{"line":2278,"type":"cond-expr","locations":[{"start":{"line":2278,"column":76},"end":{"line":2280,"column":1}},{"start":{"line":2280,"column":4},"end":{"line":2282,"column":1}}]},"217":{"line":2278,"type":"binary-expr","locations":[{"start":{"line":2278,"column":13},"end":{"line":2278,"column":47}},{"start":{"line":2278,"column":51},"end":{"line":2278,"column":73}}]},"218":{"line":2291,"type":"cond-expr","locations":[{"start":{"line":2291,"column":79},"end":{"line":2293,"column":1}},{"start":{"line":2293,"column":4},"end":{"line":2295,"column":1}}]},"219":{"line":2291,"type":"binary-expr","locations":[{"start":{"line":2291,"column":14},"end":{"line":2291,"column":49}},{"start":{"line":2291,"column":53},"end":{"line":2291,"column":76}}]},"220":{"line":2325,"type":"binary-expr","locations":[{"start":{"line":2325,"column":11},"end":{"line":2325,"column":26}},{"start":{"line":2325,"column":30},"end":{"line":2325,"column":53}},{"start":{"line":2325,"column":58},"end":{"line":2325,"column":79}}]},"221":{"line":2325,"type":"cond-expr","locations":[{"start":{"line":2325,"column":62},"end":{"line":2325,"column":70}},{"start":{"line":2325,"column":73},"end":{"line":2325,"column":79}}]},"222":{"line":2369,"type":"binary-expr","locations":[{"start":{"line":2369,"column":4},"end":{"line":2369,"column":14}},{"start":{"line":2369,"column":19},"end":{"line":2369,"column":33}}]},"223":{"line":2371,"type":"if","locations":[{"start":{"line":2371,"column":4},"end":{"line":2371,"column":4}},{"start":{"line":2371,"column":4},"end":{"line":2371,"column":4}}]},"224":{"line":2371,"type":"binary-expr","locations":[{"start":{"line":2371,"column":8},"end":{"line":2371,"column":13}},{"start":{"line":2371,"column":17},"end":{"line":2371,"column":35}}]},"225":{"line":2408,"type":"cond-expr","locations":[{"start":{"line":2408,"column":48},"end":{"line":2423,"column":1}},{"start":{"line":2423,"column":4},"end":{"line":2438,"column":1}}]},"226":{"line":2416,"type":"if","locations":[{"start":{"line":2416,"column":8},"end":{"line":2416,"column":8}},{"start":{"line":2416,"column":8},"end":{"line":2416,"column":8}}]},"227":{"line":2431,"type":"if","locations":[{"start":{"line":2431,"column":8},"end":{"line":2431,"column":8}},{"start":{"line":2431,"column":8},"end":{"line":2431,"column":8}}]},"228":{"line":2455,"type":"cond-expr","locations":[{"start":{"line":2455,"column":64},"end":{"line":2458,"column":1}},{"start":{"line":2458,"column":4},"end":{"line":2466,"column":1}}]},"229":{"line":2456,"type":"binary-expr","locations":[{"start":{"line":2456,"column":24},"end":{"line":2456,"column":29}},{"start":{"line":2456,"column":33},"end":{"line":2456,"column":35}}]},"230":{"line":2456,"type":"binary-expr","locations":[{"start":{"line":2456,"column":41},"end":{"line":2456,"column":48}},{"start":{"line":2456,"column":52},"end":{"line":2456,"column":53}}]},"231":{"line":2460,"type":"if","locations":[{"start":{"line":2460,"column":8},"end":{"line":2460,"column":8}},{"start":{"line":2460,"column":8},"end":{"line":2460,"column":8}}]},"232":{"line":2461,"type":"binary-expr","locations":[{"start":{"line":2461,"column":20},"end":{"line":2461,"column":27}},{"start":{"line":2461,"column":31},"end":{"line":2461,"column":32}}]},"233":{"line":2494,"type":"binary-expr","locations":[{"start":{"line":2494,"column":16},"end":{"line":2494,"column":22}},{"start":{"line":2494,"column":26},"end":{"line":2494,"column":39}},{"start":{"line":2494,"column":44},"end":{"line":2494,"column":45}}]},"234":{"line":2498,"type":"if","locations":[{"start":{"line":2498,"column":8},"end":{"line":2498,"column":8}},{"start":{"line":2498,"column":8},"end":{"line":2498,"column":8}}]},"235":{"line":2499,"type":"cond-expr","locations":[{"start":{"line":2499,"column":54},"end":{"line":2499,"column":63}},{"start":{"line":2499,"column":66},"end":{"line":2499,"column":70}}]},"236":{"line":2499,"type":"binary-expr","locations":[{"start":{"line":2499,"column":28},"end":{"line":2499,"column":36}},{"start":{"line":2499,"column":40},"end":{"line":2499,"column":51}}]},"237":{"line":2520,"type":"cond-expr","locations":[{"start":{"line":2520,"column":50},"end":{"line":2522,"column":1}},{"start":{"line":2522,"column":4},"end":{"line":2544,"column":1}}]},"238":{"line":2526,"type":"binary-expr","locations":[{"start":{"line":2526,"column":11},"end":{"line":2526,"column":16}},{"start":{"line":2526,"column":20},"end":{"line":2526,"column":21}}]},"239":{"line":2527,"type":"binary-expr","locations":[{"start":{"line":2527,"column":12},"end":{"line":2527,"column":20}},{"start":{"line":2527,"column":24},"end":{"line":2527,"column":26}}]},"240":{"line":2529,"type":"if","locations":[{"start":{"line":2529,"column":4},"end":{"line":2529,"column":4}},{"start":{"line":2529,"column":4},"end":{"line":2529,"column":4}}]},"241":{"line":2532,"type":"if","locations":[{"start":{"line":2532,"column":8},"end":{"line":2532,"column":8}},{"start":{"line":2532,"column":8},"end":{"line":2532,"column":8}}]},"242":{"line":2538,"type":"if","locations":[{"start":{"line":2538,"column":8},"end":{"line":2538,"column":8}},{"start":{"line":2538,"column":8},"end":{"line":2538,"column":8}}]},"243":{"line":2538,"type":"binary-expr","locations":[{"start":{"line":2538,"column":12},"end":{"line":2538,"column":25}},{"start":{"line":2538,"column":29},"end":{"line":2538,"column":50}}]},"244":{"line":2585,"type":"cond-expr","locations":[{"start":{"line":2585,"column":44},"end":{"line":2587,"column":1}},{"start":{"line":2587,"column":4},"end":{"line":2595,"column":1}}]},"245":{"line":2589,"type":"if","locations":[{"start":{"line":2589,"column":8},"end":{"line":2589,"column":8}},{"start":{"line":2589,"column":8},"end":{"line":2589,"column":8}}]},"246":{"line":2589,"type":"binary-expr","locations":[{"start":{"line":2589,"column":12},"end":{"line":2589,"column":22}},{"start":{"line":2589,"column":26},"end":{"line":2589,"column":62}}]},"247":{"line":2618,"type":"if","locations":[{"start":{"line":2618,"column":4},"end":{"line":2618,"column":4}},{"start":{"line":2618,"column":4},"end":{"line":2618,"column":4}}]},"248":{"line":2620,"type":"if","locations":[{"start":{"line":2620,"column":11},"end":{"line":2620,"column":11}},{"start":{"line":2620,"column":11},"end":{"line":2620,"column":11}}]},"249":{"line":2625,"type":"if","locations":[{"start":{"line":2625,"column":12},"end":{"line":2625,"column":12}},{"start":{"line":2625,"column":12},"end":{"line":2625,"column":12}}]},"250":{"line":2625,"type":"binary-expr","locations":[{"start":{"line":2625,"column":16},"end":{"line":2625,"column":31}},{"start":{"line":2625,"column":35},"end":{"line":2625,"column":47}},{"start":{"line":2625,"column":51},"end":{"line":2625,"column":82}},{"start":{"line":2625,"column":86},"end":{"line":2625,"column":96}}]},"251":{"line":2625,"type":"binary-expr","locations":[{"start":{"line":2625,"column":53},"end":{"line":2625,"column":65}},{"start":{"line":2625,"column":69},"end":{"line":2625,"column":81}}]},"252":{"line":2718,"type":"binary-expr","locations":[{"start":{"line":2718,"column":23},"end":{"line":2718,"column":43}},{"start":{"line":2718,"column":47},"end":{"line":2718,"column":58}}]},"253":{"line":2760,"type":"binary-expr","locations":[{"start":{"line":2760,"column":4},"end":{"line":2760,"column":9}},{"start":{"line":2760,"column":14},"end":{"line":2760,"column":24}}]},"254":{"line":2763,"type":"cond-expr","locations":[{"start":{"line":2764,"column":16},"end":{"line":2764,"column":70}},{"start":{"line":2765,"column":16},"end":{"line":2765,"column":27}}]},"255":{"line":2768,"type":"if","locations":[{"start":{"line":2768,"column":8},"end":{"line":2768,"column":8}},{"start":{"line":2768,"column":8},"end":{"line":2768,"column":8}}]},"256":{"line":2768,"type":"binary-expr","locations":[{"start":{"line":2768,"column":12},"end":{"line":2768,"column":27}},{"start":{"line":2768,"column":32},"end":{"line":2768,"column":39}},{"start":{"line":2768,"column":43},"end":{"line":2768,"column":64}}]},"257":{"line":2802,"type":"binary-expr","locations":[{"start":{"line":2802,"column":11},"end":{"line":2802,"column":14}},{"start":{"line":2802,"column":18},"end":{"line":2802,"column":30}}]},"258":{"line":2828,"type":"if","locations":[{"start":{"line":2828,"column":12},"end":{"line":2828,"column":12}},{"start":{"line":2828,"column":12},"end":{"line":2828,"column":12}}]},"259":{"line":2877,"type":"if","locations":[{"start":{"line":2877,"column":4},"end":{"line":2877,"column":4}},{"start":{"line":2877,"column":4},"end":{"line":2877,"column":4}}]},"260":{"line":2877,"type":"binary-expr","locations":[{"start":{"line":2877,"column":8},"end":{"line":2877,"column":17}},{"start":{"line":2877,"column":21},"end":{"line":2877,"column":30}}]},"261":{"line":2878,"type":"binary-expr","locations":[{"start":{"line":2878,"column":15},"end":{"line":2878,"column":23}},{"start":{"line":2878,"column":27},"end":{"line":2878,"column":28}}]},"262":{"line":2881,"type":"if","locations":[{"start":{"line":2881,"column":4},"end":{"line":2881,"column":4}},{"start":{"line":2881,"column":4},"end":{"line":2881,"column":4}}]},"263":{"line":2885,"type":"if","locations":[{"start":{"line":2885,"column":8},"end":{"line":2885,"column":8}},{"start":{"line":2885,"column":8},"end":{"line":2885,"column":8}}]},"264":{"line":2892,"type":"cond-expr","locations":[{"start":{"line":2892,"column":42},"end":{"line":2892,"column":60}},{"start":{"line":2892,"column":63},"end":{"line":2892,"column":71}}]},"265":{"line":2892,"type":"binary-expr","locations":[{"start":{"line":2892,"column":15},"end":{"line":2892,"column":25}},{"start":{"line":2892,"column":29},"end":{"line":2892,"column":39}}]},"266":{"line":2893,"type":"cond-expr","locations":[{"start":{"line":2893,"column":42},"end":{"line":2893,"column":60}},{"start":{"line":2893,"column":63},"end":{"line":2893,"column":71}}]},"267":{"line":2893,"type":"binary-expr","locations":[{"start":{"line":2893,"column":15},"end":{"line":2893,"column":25}},{"start":{"line":2893,"column":29},"end":{"line":2893,"column":39}}]},"268":{"line":2898,"type":"if","locations":[{"start":{"line":2898,"column":8},"end":{"line":2898,"column":8}},{"start":{"line":2898,"column":8},"end":{"line":2898,"column":8}}]},"269":{"line":2898,"type":"binary-expr","locations":[{"start":{"line":2898,"column":12},"end":{"line":2898,"column":17}},{"start":{"line":2898,"column":21},"end":{"line":2898,"column":24}}]},"270":{"line":2908,"type":"binary-expr","locations":[{"start":{"line":2908,"column":22},"end":{"line":2908,"column":31}},{"start":{"line":2908,"column":35},"end":{"line":2908,"column":41}}]},"271":{"line":2910,"type":"if","locations":[{"start":{"line":2910,"column":4},"end":{"line":2910,"column":4}},{"start":{"line":2910,"column":4},"end":{"line":2910,"column":4}}]},"272":{"line":2919,"type":"if","locations":[{"start":{"line":2919,"column":12},"end":{"line":2919,"column":12}},{"start":{"line":2919,"column":12},"end":{"line":2919,"column":12}}]},"273":{"line":2926,"type":"cond-expr","locations":[{"start":{"line":2926,"column":39},"end":{"line":2926,"column":44}},{"start":{"line":2926,"column":47},"end":{"line":2926,"column":56}}]},"274":{"line":2928,"type":"if","locations":[{"start":{"line":2928,"column":12},"end":{"line":2928,"column":12}},{"start":{"line":2928,"column":12},"end":{"line":2928,"column":12}}]},"275":{"line":2928,"type":"binary-expr","locations":[{"start":{"line":2928,"column":16},"end":{"line":2928,"column":21}},{"start":{"line":2928,"column":25},"end":{"line":2928,"column":31}},{"start":{"line":2928,"column":35},"end":{"line":2928,"column":58}},{"start":{"line":2929,"column":23},"end":{"line":2929,"column":48}}]},"276":{"line":2939,"type":"if","locations":[{"start":{"line":2939,"column":19},"end":{"line":2939,"column":19}},{"start":{"line":2939,"column":19},"end":{"line":2939,"column":19}}]},"277":{"line":2939,"type":"binary-expr","locations":[{"start":{"line":2939,"column":23},"end":{"line":2939,"column":32}},{"start":{"line":2939,"column":36},"end":{"line":2939,"column":43}}]},"278":{"line":2953,"type":"if","locations":[{"start":{"line":2953,"column":12},"end":{"line":2953,"column":12}},{"start":{"line":2953,"column":12},"end":{"line":2953,"column":12}}]},"279":{"line":2960,"type":"cond-expr","locations":[{"start":{"line":2960,"column":39},"end":{"line":2960,"column":44}},{"start":{"line":2960,"column":47},"end":{"line":2960,"column":56}}]},"280":{"line":2962,"type":"if","locations":[{"start":{"line":2962,"column":12},"end":{"line":2962,"column":12}},{"start":{"line":2962,"column":12},"end":{"line":2962,"column":12}}]},"281":{"line":2962,"type":"binary-expr","locations":[{"start":{"line":2962,"column":16},"end":{"line":2962,"column":21}},{"start":{"line":2962,"column":25},"end":{"line":2962,"column":31}},{"start":{"line":2962,"column":35},"end":{"line":2962,"column":58}},{"start":{"line":2963,"column":23},"end":{"line":2963,"column":48}}]},"282":{"line":2965,"type":"if","locations":[{"start":{"line":2965,"column":19},"end":{"line":2965,"column":19}},{"start":{"line":2965,"column":19},"end":{"line":2965,"column":19}}]},"283":{"line":2965,"type":"binary-expr","locations":[{"start":{"line":2965,"column":23},"end":{"line":2965,"column":32}},{"start":{"line":2965,"column":36},"end":{"line":2965,"column":43}}]},"284":{"line":2973,"type":"if","locations":[{"start":{"line":2973,"column":8},"end":{"line":2973,"column":8}},{"start":{"line":2973,"column":8},"end":{"line":2973,"column":8}}]},"285":{"line":3010,"type":"cond-expr","locations":[{"start":{"line":3010,"column":47},"end":{"line":3017,"column":1}},{"start":{"line":3017,"column":5},"end":{"line":3026,"column":3}}]},"286":{"line":3086,"type":"binary-expr","locations":[{"start":{"line":3086,"column":11},"end":{"line":3086,"column":16}},{"start":{"line":3086,"column":20},"end":{"line":3086,"column":41}}]},"287":{"line":3123,"type":"cond-expr","locations":[{"start":{"line":3123,"column":59},"end":{"line":3123,"column":70}},{"start":{"line":3123,"column":73},"end":{"line":3156,"column":1}}]},"288":{"line":3123,"type":"binary-expr","locations":[{"start":{"line":3123,"column":9},"end":{"line":3123,"column":36}},{"start":{"line":3123,"column":40},"end":{"line":3123,"column":56}}]},"289":{"line":3124,"type":"if","locations":[{"start":{"line":3124,"column":4},"end":{"line":3124,"column":4}},{"start":{"line":3124,"column":4},"end":{"line":3124,"column":4}}]},"290":{"line":3131,"type":"if","locations":[{"start":{"line":3131,"column":4},"end":{"line":3131,"column":4}},{"start":{"line":3131,"column":4},"end":{"line":3131,"column":4}}]},"291":{"line":3131,"type":"binary-expr","locations":[{"start":{"line":3131,"column":8},"end":{"line":3131,"column":23}},{"start":{"line":3131,"column":27},"end":{"line":3131,"column":52}}]},"292":{"line":3133,"type":"if","locations":[{"start":{"line":3133,"column":12},"end":{"line":3133,"column":12}},{"start":{"line":3133,"column":12},"end":{"line":3133,"column":12}}]},"293":{"line":3133,"type":"binary-expr","locations":[{"start":{"line":3133,"column":16},"end":{"line":3133,"column":30}},{"start":{"line":3133,"column":34},"end":{"line":3133,"column":53}}]},"294":{"line":3139,"type":"if","locations":[{"start":{"line":3139,"column":12},"end":{"line":3139,"column":12}},{"start":{"line":3139,"column":12},"end":{"line":3139,"column":12}}]},"295":{"line":3145,"type":"if","locations":[{"start":{"line":3145,"column":4},"end":{"line":3145,"column":4}},{"start":{"line":3145,"column":4},"end":{"line":3145,"column":4}}]},"296":{"line":3149,"type":"if","locations":[{"start":{"line":3149,"column":12},"end":{"line":3149,"column":12}},{"start":{"line":3149,"column":12},"end":{"line":3149,"column":12}}]},"297":{"line":3242,"type":"if","locations":[{"start":{"line":3242,"column":8},"end":{"line":3242,"column":8}},{"start":{"line":3242,"column":8},"end":{"line":3242,"column":8}}]},"298":{"line":3242,"type":"binary-expr","locations":[{"start":{"line":3242,"column":12},"end":{"line":3242,"column":17}},{"start":{"line":3242,"column":21},"end":{"line":3242,"column":35}}]},"299":{"line":3243,"type":"binary-expr","locations":[{"start":{"line":3243,"column":20},"end":{"line":3243,"column":27}},{"start":{"line":3243,"column":31},"end":{"line":3243,"column":32}}]},"300":{"line":3274,"type":"if","locations":[{"start":{"line":3274,"column":8},"end":{"line":3274,"column":8}},{"start":{"line":3274,"column":8},"end":{"line":3274,"column":8}}]},"301":{"line":3274,"type":"binary-expr","locations":[{"start":{"line":3274,"column":12},"end":{"line":3274,"column":17}},{"start":{"line":3274,"column":21},"end":{"line":3274,"column":35}}]},"302":{"line":3275,"type":"if","locations":[{"start":{"line":3275,"column":12},"end":{"line":3275,"column":12}},{"start":{"line":3275,"column":12},"end":{"line":3275,"column":12}}]},"303":{"line":3275,"type":"binary-expr","locations":[{"start":{"line":3275,"column":24},"end":{"line":3275,"column":31}},{"start":{"line":3275,"column":35},"end":{"line":3275,"column":36}}]},"304":{"line":3298,"type":"if","locations":[{"start":{"line":3298,"column":4},"end":{"line":3298,"column":4}},{"start":{"line":3298,"column":4},"end":{"line":3298,"column":4}}]},"305":{"line":3306,"type":"binary-expr","locations":[{"start":{"line":3306,"column":16},"end":{"line":3306,"column":31}},{"start":{"line":3306,"column":35},"end":{"line":3306,"column":40}}]},"306":{"line":3333,"type":"if","locations":[{"start":{"line":3333,"column":4},"end":{"line":3333,"column":4}},{"start":{"line":3333,"column":4},"end":{"line":3333,"column":4}}]},"307":{"line":3334,"type":"binary-expr","locations":[{"start":{"line":3334,"column":20},"end":{"line":3334,"column":37}},{"start":{"line":3334,"column":41},"end":{"line":3334,"column":52}}]},"308":{"line":3338,"type":"if","locations":[{"start":{"line":3338,"column":8},"end":{"line":3338,"column":8}},{"start":{"line":3338,"column":8},"end":{"line":3338,"column":8}}]},"309":{"line":3398,"type":"cond-expr","locations":[{"start":{"line":3398,"column":37},"end":{"line":3398,"column":39}},{"start":{"line":3398,"column":42},"end":{"line":3398,"column":45}}]},"310":{"line":3404,"type":"binary-expr","locations":[{"start":{"line":3404,"column":14},"end":{"line":3404,"column":17}},{"start":{"line":3404,"column":21},"end":{"line":3404,"column":34}}]},"311":{"line":3575,"type":"binary-expr","locations":[{"start":{"line":3575,"column":14},"end":{"line":3575,"column":17}},{"start":{"line":3575,"column":21},"end":{"line":3575,"column":36}}]},"312":{"line":3608,"type":"binary-expr","locations":[{"start":{"line":3608,"column":19},"end":{"line":3608,"column":49}},{"start":{"line":3608,"column":54},"end":{"line":3608,"column":68}}]},"313":{"line":3618,"type":"binary-expr","locations":[{"start":{"line":3618,"column":9},"end":{"line":3618,"column":14}},{"start":{"line":3618,"column":18},"end":{"line":3618,"column":21}},{"start":{"line":3618,"column":25},"end":{"line":3618,"column":38}}]},"314":{"line":3620,"type":"binary-expr","locations":[{"start":{"line":3620,"column":10},"end":{"line":3620,"column":13}},{"start":{"line":3620,"column":17},"end":{"line":3620,"column":29}}]},"315":{"line":3622,"type":"binary-expr","locations":[{"start":{"line":3622,"column":11},"end":{"line":3622,"column":14}},{"start":{"line":3622,"column":18},"end":{"line":3622,"column":26}}]},"316":{"line":3635,"type":"binary-expr","locations":[{"start":{"line":3635,"column":15},"end":{"line":3635,"column":19}},{"start":{"line":3635,"column":24},"end":{"line":3635,"column":65}}]},"317":{"line":3637,"type":"if","locations":[{"start":{"line":3637,"column":4},"end":{"line":3637,"column":4}},{"start":{"line":3637,"column":4},"end":{"line":3637,"column":4}}]},"318":{"line":3639,"type":"if","locations":[{"start":{"line":3639,"column":8},"end":{"line":3639,"column":8}},{"start":{"line":3639,"column":8},"end":{"line":3639,"column":8}}]},"319":{"line":3641,"type":"if","locations":[{"start":{"line":3641,"column":15},"end":{"line":3641,"column":15}},{"start":{"line":3641,"column":15},"end":{"line":3641,"column":15}}]},"320":{"line":3643,"type":"if","locations":[{"start":{"line":3643,"column":15},"end":{"line":3643,"column":15}},{"start":{"line":3643,"column":15},"end":{"line":3643,"column":15}}]},"321":{"line":3645,"type":"if","locations":[{"start":{"line":3645,"column":15},"end":{"line":3645,"column":15}},{"start":{"line":3645,"column":15},"end":{"line":3645,"column":15}}]},"322":{"line":3647,"type":"if","locations":[{"start":{"line":3647,"column":15},"end":{"line":3647,"column":15}},{"start":{"line":3647,"column":15},"end":{"line":3647,"column":15}}]},"323":{"line":3649,"type":"if","locations":[{"start":{"line":3649,"column":15},"end":{"line":3649,"column":15}},{"start":{"line":3649,"column":15},"end":{"line":3649,"column":15}}]},"324":{"line":3654,"type":"if","locations":[{"start":{"line":3654,"column":8},"end":{"line":3654,"column":8}},{"start":{"line":3654,"column":8},"end":{"line":3654,"column":8}}]},"325":{"line":3657,"type":"if","locations":[{"start":{"line":3657,"column":8},"end":{"line":3657,"column":8}},{"start":{"line":3657,"column":8},"end":{"line":3657,"column":8}}]},"326":{"line":3660,"type":"if","locations":[{"start":{"line":3660,"column":8},"end":{"line":3660,"column":8}},{"start":{"line":3660,"column":8},"end":{"line":3660,"column":8}}]},"327":{"line":3665,"type":"if","locations":[{"start":{"line":3665,"column":8},"end":{"line":3665,"column":8}},{"start":{"line":3665,"column":8},"end":{"line":3665,"column":8}}]},"328":{"line":3665,"type":"binary-expr","locations":[{"start":{"line":3665,"column":12},"end":{"line":3665,"column":13}},{"start":{"line":3665,"column":17},"end":{"line":3665,"column":21}}]},"329":{"line":3669,"type":"if","locations":[{"start":{"line":3669,"column":12},"end":{"line":3669,"column":12}},{"start":{"line":3669,"column":12},"end":{"line":3669,"column":12}}]},"330":{"line":3671,"type":"if","locations":[{"start":{"line":3671,"column":16},"end":{"line":3671,"column":16}},{"start":{"line":3671,"column":16},"end":{"line":3671,"column":16}}]},"331":{"line":3671,"type":"binary-expr","locations":[{"start":{"line":3671,"column":20},"end":{"line":3671,"column":21}},{"start":{"line":3671,"column":25},"end":{"line":3671,"column":29}}]},"332":{"line":3677,"type":"if","locations":[{"start":{"line":3677,"column":12},"end":{"line":3677,"column":12}},{"start":{"line":3677,"column":12},"end":{"line":3677,"column":12}}]},"333":{"line":3677,"type":"binary-expr","locations":[{"start":{"line":3677,"column":16},"end":{"line":3677,"column":36}},{"start":{"line":3677,"column":40},"end":{"line":3677,"column":69}}]},"334":{"line":3681,"type":"if","locations":[{"start":{"line":3681,"column":16},"end":{"line":3681,"column":16}},{"start":{"line":3681,"column":16},"end":{"line":3681,"column":16}}]},"335":{"line":3681,"type":"binary-expr","locations":[{"start":{"line":3681,"column":20},"end":{"line":3681,"column":21}},{"start":{"line":3681,"column":25},"end":{"line":3681,"column":29}}]},"336":{"line":3689,"type":"if","locations":[{"start":{"line":3689,"column":16},"end":{"line":3689,"column":16}},{"start":{"line":3689,"column":16},"end":{"line":3689,"column":16}}]},"337":{"line":3689,"type":"binary-expr","locations":[{"start":{"line":3689,"column":20},"end":{"line":3689,"column":21}},{"start":{"line":3689,"column":25},"end":{"line":3689,"column":29}}]},"338":{"line":3694,"type":"if","locations":[{"start":{"line":3694,"column":16},"end":{"line":3694,"column":16}},{"start":{"line":3694,"column":16},"end":{"line":3694,"column":16}}]},"339":{"line":3698,"type":"if","locations":[{"start":{"line":3698,"column":16},"end":{"line":3698,"column":16}},{"start":{"line":3698,"column":16},"end":{"line":3698,"column":16}}]},"340":{"line":3701,"type":"if","locations":[{"start":{"line":3701,"column":20},"end":{"line":3701,"column":20}},{"start":{"line":3701,"column":20},"end":{"line":3701,"column":20}}]},"341":{"line":3701,"type":"binary-expr","locations":[{"start":{"line":3701,"column":24},"end":{"line":3701,"column":25}},{"start":{"line":3701,"column":29},"end":{"line":3701,"column":33}}]},"342":{"line":3705,"type":"if","locations":[{"start":{"line":3705,"column":16},"end":{"line":3705,"column":16}},{"start":{"line":3705,"column":16},"end":{"line":3705,"column":16}}]},"343":{"line":3706,"type":"if","locations":[{"start":{"line":3706,"column":20},"end":{"line":3706,"column":20}},{"start":{"line":3706,"column":20},"end":{"line":3706,"column":20}}]},"344":{"line":3710,"type":"if","locations":[{"start":{"line":3710,"column":20},"end":{"line":3710,"column":20}},{"start":{"line":3710,"column":20},"end":{"line":3710,"column":20}}]},"345":{"line":3710,"type":"binary-expr","locations":[{"start":{"line":3710,"column":24},"end":{"line":3710,"column":25}},{"start":{"line":3710,"column":29},"end":{"line":3710,"column":33}}]},"346":{"line":3715,"type":"if","locations":[{"start":{"line":3715,"column":16},"end":{"line":3715,"column":16}},{"start":{"line":3715,"column":16},"end":{"line":3715,"column":16}}]},"347":{"line":3717,"type":"if","locations":[{"start":{"line":3717,"column":20},"end":{"line":3717,"column":20}},{"start":{"line":3717,"column":20},"end":{"line":3717,"column":20}}]},"348":{"line":3717,"type":"binary-expr","locations":[{"start":{"line":3717,"column":24},"end":{"line":3717,"column":25}},{"start":{"line":3717,"column":29},"end":{"line":3717,"column":33}}]},"349":{"line":3720,"type":"if","locations":[{"start":{"line":3720,"column":20},"end":{"line":3720,"column":20}},{"start":{"line":3720,"column":20},"end":{"line":3720,"column":20}}]},"350":{"line":3724,"type":"if","locations":[{"start":{"line":3724,"column":20},"end":{"line":3724,"column":20}},{"start":{"line":3724,"column":20},"end":{"line":3724,"column":20}}]},"351":{"line":3732,"type":"if","locations":[{"start":{"line":3732,"column":12},"end":{"line":3732,"column":12}},{"start":{"line":3732,"column":12},"end":{"line":3732,"column":12}}]},"352":{"line":3732,"type":"binary-expr","locations":[{"start":{"line":3732,"column":16},"end":{"line":3732,"column":17}},{"start":{"line":3732,"column":21},"end":{"line":3732,"column":25}}]},"353":{"line":3738,"type":"if","locations":[{"start":{"line":3738,"column":16},"end":{"line":3738,"column":16}},{"start":{"line":3738,"column":16},"end":{"line":3738,"column":16}}]},"354":{"line":3738,"type":"binary-expr","locations":[{"start":{"line":3738,"column":20},"end":{"line":3738,"column":21}},{"start":{"line":3738,"column":25},"end":{"line":3738,"column":29}},{"start":{"line":3738,"column":33},"end":{"line":3738,"column":37}}]},"355":{"line":3741,"type":"if","locations":[{"start":{"line":3741,"column":20},"end":{"line":3741,"column":20}},{"start":{"line":3741,"column":20},"end":{"line":3741,"column":20}}]},"356":{"line":3746,"type":"if","locations":[{"start":{"line":3746,"column":20},"end":{"line":3746,"column":20}},{"start":{"line":3746,"column":20},"end":{"line":3746,"column":20}}]},"357":{"line":3753,"type":"if","locations":[{"start":{"line":3753,"column":8},"end":{"line":3753,"column":8}},{"start":{"line":3753,"column":8},"end":{"line":3753,"column":8}}]},"358":{"line":3755,"type":"if","locations":[{"start":{"line":3755,"column":12},"end":{"line":3755,"column":12}},{"start":{"line":3755,"column":12},"end":{"line":3755,"column":12}}]},"359":{"line":3757,"type":"if","locations":[{"start":{"line":3757,"column":16},"end":{"line":3757,"column":16}},{"start":{"line":3757,"column":16},"end":{"line":3757,"column":16}}]},"360":{"line":3757,"type":"binary-expr","locations":[{"start":{"line":3757,"column":20},"end":{"line":3757,"column":21}},{"start":{"line":3757,"column":25},"end":{"line":3757,"column":29}}]},"361":{"line":3761,"type":"if","locations":[{"start":{"line":3761,"column":16},"end":{"line":3761,"column":16}},{"start":{"line":3761,"column":16},"end":{"line":3761,"column":16}}]},"362":{"line":3761,"type":"binary-expr","locations":[{"start":{"line":3761,"column":20},"end":{"line":3761,"column":21}},{"start":{"line":3761,"column":25},"end":{"line":3761,"column":29}}]},"363":{"line":3765,"type":"if","locations":[{"start":{"line":3765,"column":16},"end":{"line":3765,"column":16}},{"start":{"line":3765,"column":16},"end":{"line":3765,"column":16}}]},"364":{"line":3768,"type":"if","locations":[{"start":{"line":3768,"column":20},"end":{"line":3768,"column":20}},{"start":{"line":3768,"column":20},"end":{"line":3768,"column":20}}]},"365":{"line":3768,"type":"binary-expr","locations":[{"start":{"line":3768,"column":24},"end":{"line":3768,"column":25}},{"start":{"line":3768,"column":29},"end":{"line":3768,"column":33}}]},"366":{"line":3774,"type":"if","locations":[{"start":{"line":3774,"column":16},"end":{"line":3774,"column":16}},{"start":{"line":3774,"column":16},"end":{"line":3774,"column":16}}]},"367":{"line":3780,"type":"if","locations":[{"start":{"line":3780,"column":16},"end":{"line":3780,"column":16}},{"start":{"line":3780,"column":16},"end":{"line":3780,"column":16}}]},"368":{"line":3780,"type":"binary-expr","locations":[{"start":{"line":3780,"column":20},"end":{"line":3780,"column":21}},{"start":{"line":3780,"column":26},"end":{"line":3780,"column":30}},{"start":{"line":3780,"column":34},"end":{"line":3780,"column":38}}]},"369":{"line":3781,"type":"binary-expr","locations":[{"start":{"line":3781,"column":37},"end":{"line":3781,"column":41}},{"start":{"line":3781,"column":45},"end":{"line":3781,"column":49}}]},"370":{"line":3785,"type":"if","locations":[{"start":{"line":3785,"column":20},"end":{"line":3785,"column":20}},{"start":{"line":3785,"column":20},"end":{"line":3785,"column":20}}]},"371":{"line":3788,"type":"if","locations":[{"start":{"line":3788,"column":24},"end":{"line":3788,"column":24}},{"start":{"line":3788,"column":24},"end":{"line":3788,"column":24}}]},"372":{"line":3788,"type":"binary-expr","locations":[{"start":{"line":3788,"column":28},"end":{"line":3788,"column":29}},{"start":{"line":3788,"column":33},"end":{"line":3788,"column":37}}]},"373":{"line":3790,"type":"if","locations":[{"start":{"line":3790,"column":28},"end":{"line":3790,"column":28}},{"start":{"line":3790,"column":28},"end":{"line":3790,"column":28}}]},"374":{"line":3802,"type":"if","locations":[{"start":{"line":3802,"column":4},"end":{"line":3802,"column":4}},{"start":{"line":3802,"column":4},"end":{"line":3802,"column":4}}]},"375":{"line":3802,"type":"binary-expr","locations":[{"start":{"line":3802,"column":8},"end":{"line":3802,"column":11}},{"start":{"line":3802,"column":15},"end":{"line":3802,"column":18}},{"start":{"line":3802,"column":22},"end":{"line":3802,"column":49}}]},"376":{"line":3802,"type":"binary-expr","locations":[{"start":{"line":3802,"column":24},"end":{"line":3802,"column":32}},{"start":{"line":3802,"column":36},"end":{"line":3802,"column":48}}]},"377":{"line":3803,"type":"binary-expr","locations":[{"start":{"line":3803,"column":27},"end":{"line":3803,"column":48}},{"start":{"line":3803,"column":55},"end":{"line":3803,"column":80}},{"start":{"line":3803,"column":86},"end":{"line":3803,"column":110}}]},"378":{"line":3807,"type":"if","locations":[{"start":{"line":3807,"column":4},"end":{"line":3807,"column":4}},{"start":{"line":3807,"column":4},"end":{"line":3807,"column":4}}]},"379":{"line":3809,"type":"if","locations":[{"start":{"line":3809,"column":8},"end":{"line":3809,"column":8}},{"start":{"line":3809,"column":8},"end":{"line":3809,"column":8}}]},"380":{"line":3811,"type":"if","locations":[{"start":{"line":3811,"column":12},"end":{"line":3811,"column":12}},{"start":{"line":3811,"column":12},"end":{"line":3811,"column":12}}]},"381":{"line":3811,"type":"binary-expr","locations":[{"start":{"line":3811,"column":16},"end":{"line":3811,"column":32}},{"start":{"line":3811,"column":36},"end":{"line":3811,"column":57}}]},"382":{"line":3826,"type":"binary-expr","locations":[{"start":{"line":3826,"column":7},"end":{"line":3826,"column":17}},{"start":{"line":3826,"column":21},"end":{"line":3826,"column":38}}]},"383":{"line":3851,"type":"if","locations":[{"start":{"line":3851,"column":4},"end":{"line":3851,"column":4}},{"start":{"line":3851,"column":4},"end":{"line":3851,"column":4}}]},"384":{"line":3863,"type":"binary-expr","locations":[{"start":{"line":3863,"column":8},"end":{"line":3863,"column":20}},{"start":{"line":3863,"column":25},"end":{"line":3863,"column":34}}]},"385":{"line":3864,"type":"binary-expr","locations":[{"start":{"line":3864,"column":8},"end":{"line":3864,"column":20}},{"start":{"line":3864,"column":25},"end":{"line":3864,"column":34}}]},"386":{"line":3866,"type":"if","locations":[{"start":{"line":3866,"column":8},"end":{"line":3866,"column":8}},{"start":{"line":3866,"column":8},"end":{"line":3866,"column":8}}]},"387":{"line":3870,"type":"if","locations":[{"start":{"line":3870,"column":8},"end":{"line":3870,"column":8}},{"start":{"line":3870,"column":8},"end":{"line":3870,"column":8}}]}},"code":["(function () { /**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@main yui","@submodule yui-base","**/","","/*jshint eqeqeq: false*/","if (typeof YUI != 'undefined') {"," YUI._YUI = YUI;","}","","/**","The YUI global namespace object. This is the constructor for all YUI instances.","","This is a self-instantiable factory function, meaning you don't need to precede","it with the `new` operator. You can invoke it directly like this:",""," YUI().use('*', function (Y) {"," // Y is a new YUI instance."," });","","But it also works like this:",""," var Y = YUI();","","The `YUI` constructor accepts an optional config object, like this:",""," YUI({"," debug: true,"," combine: false"," }).use('node', function (Y) {"," // Y.Node is ready to use."," });","","See the API docs for the <a href=\"config.html\">Config</a> class for the complete","list of supported configuration properties accepted by the YUI constuctor.","","If a global `YUI` object is already defined, the existing YUI object will not be","overwritten, to ensure that defined namespaces are preserved.","","Each YUI instance has full custom event support, but only if the event system is","available.","","@class YUI","@uses EventTarget","@constructor","@global","@param {Object} [config]* Zero or more optional configuration objects. Config"," values are stored in the `Y.config` property. See the"," <a href=\"config.html\">Config</a> docs for the list of supported properties.","**/",""," /*global YUI*/"," /*global YUI_config*/"," var YUI = function() {"," var i = 0,"," Y = this,"," args = arguments,"," l = args.length,"," instanceOf = function(o, type) {"," return (o && o.hasOwnProperty && (o instanceof type));"," },"," gconf = (typeof YUI_config !== 'undefined') && YUI_config;",""," if (!(instanceOf(Y, YUI))) {"," Y = new YUI();"," } else {"," // set up the core environment"," Y._init();",""," /**"," Master configuration that might span multiple contexts in a non-"," browser environment. It is applied first to all instances in all"," contexts.",""," @example",""," YUI.GlobalConfig = {"," filter: 'debug'"," };",""," YUI().use('node', function (Y) {"," // debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function (Y) {"," // min files used here"," });",""," @property {Object} GlobalConfig"," @global"," @static"," **/"," if (YUI.GlobalConfig) {"," Y.applyConfig(YUI.GlobalConfig);"," }",""," /**"," Page-level config applied to all YUI instances created on the"," current page. This is applied after `YUI.GlobalConfig` and before"," any instance-level configuration.",""," @example",""," // Single global var to include before YUI seed file"," YUI_config = {"," filter: 'debug'"," };",""," YUI().use('node', function (Y) {"," // debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function (Y) {"," // min files used here"," });",""," @property {Object} YUI_config"," @global"," **/"," if (gconf) {"," Y.applyConfig(gconf);"," }",""," // bind the specified additional modules for this instance"," if (!l) {"," Y._setup();"," }"," }",""," if (l) {"," // Each instance can accept one or more configuration objects."," // These are applied after YUI.GlobalConfig and YUI_Config,"," // overriding values set in those config files if there is a"," // matching property."," for (; i < l; i++) {"," Y.applyConfig(args[i]);"," }",""," Y._setup();"," }",""," Y.instanceOf = instanceOf;",""," return Y;"," };","","(function() {",""," var proto, prop,"," VERSION = '3.16.0',"," PERIOD = '.',"," BASE = 'http://yui.yahooapis.com/',"," /*"," These CSS class names can't be generated by"," getClassName since it is not available at the"," time they are being used."," */"," DOC_LABEL = 'yui3-js-enabled',"," CSS_STAMP_EL = 'yui3-css-stamp',"," NOOP = function() {},"," SLICE = Array.prototype.slice,"," APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo"," 'io.xdrResponse': 1, // can call. this should"," 'SWF.eventHandler': 1 }, // be done at build time"," hasWin = (typeof window != 'undefined'),"," win = (hasWin) ? window : null,"," doc = (hasWin) ? win.document : null,"," docEl = doc && doc.documentElement,"," docClass = docEl && docEl.className,"," instances = {},"," time = new Date().getTime(),"," add = function(el, type, fn, capture) {"," if (el && el.addEventListener) {"," el.addEventListener(type, fn, capture);"," } else if (el && el.attachEvent) {"," el.attachEvent('on' + type, fn);"," }"," },"," remove = function(el, type, fn, capture) {"," if (el && el.removeEventListener) {"," // this can throw an uncaught exception in FF"," try {"," el.removeEventListener(type, fn, capture);"," } catch (ex) {}"," } else if (el && el.detachEvent) {"," el.detachEvent('on' + type, fn);"," }"," },"," handleReady = function() {"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(doc, 'DOMContentLoaded', handleReady);"," } "," },"," handleLoad = function() {"," YUI.Env.windowLoaded = true;"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(window, 'load', handleLoad);"," }"," },"," getLoader = function(Y, o) {"," var loader = Y.Env._loader,"," lCore = [ 'loader-base' ],"," G_ENV = YUI.Env,"," mods = G_ENV.mods;",""," if (loader) {"," //loader._config(Y.config);"," loader.ignoreRegistered = false;"," loader.onEnd = null;"," loader.data = null;"," loader.required = [];"," loader.loadType = null;"," } else {"," loader = new Y.Loader(Y.config);"," Y.Env._loader = loader;"," }"," if (mods && mods.loader) {"," lCore = [].concat(lCore, YUI.Env.loaderExtras);"," }"," YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));",""," return loader;"," },",""," clobber = function(r, s) {"," for (var i in s) {"," if (s.hasOwnProperty(i)) {"," r[i] = s[i];"," }"," }"," },",""," ALREADY_DONE = { success: true };","","// Stamp the documentElement (HTML) with a class of \"yui-loaded\" to","// enable styles that need to key off of JS being enabled.","if (docEl && docClass.indexOf(DOC_LABEL) == -1) {"," if (docClass) {"," docClass += ' ';"," }"," docClass += DOC_LABEL;"," docEl.className = docClass;","}","","if (VERSION.indexOf('@') > -1) {"," VERSION = '3.5.0'; // dev time hack for cdn test","}","","proto = {"," /**"," Applies a new configuration object to the config of this YUI instance. This"," will merge new group/module definitions, and will also update the loader"," cache if necessary. Updating `Y.config` directly will not update the cache.",""," @method applyConfig"," @param {Object} o the configuration object."," @since 3.2.0"," **/"," applyConfig: function(o) {",""," o = o || NOOP;",""," var attr,"," name,"," // detail,"," config = this.config,"," mods = config.modules,"," groups = config.groups,"," aliases = config.aliases,"," loader = this.Env._loader;",""," for (name in o) {"," if (o.hasOwnProperty(name)) {"," attr = o[name];"," if (mods && name == 'modules') {"," clobber(mods, attr);"," } else if (aliases && name == 'aliases') {"," clobber(aliases, attr);"," } else if (groups && name == 'groups') {"," clobber(groups, attr);"," } else if (name == 'win') {"," config[name] = (attr && attr.contentWindow) || attr;"," config.doc = config[name] ? config[name].document : null;"," } else if (name == '_yuid') {"," // preserve the guid"," } else {"," config[name] = attr;"," }"," }"," }",""," if (loader) {"," loader._config(o);"," }",""," },",""," /**"," Old way to apply a config to this instance (calls `applyConfig` under the"," hood).",""," @private"," @method _config"," @param {Object} o The config to apply"," **/"," _config: function(o) {"," this.applyConfig(o);"," },",""," /**"," Initializes this YUI instance.",""," @private"," @method _init"," **/"," _init: function() {"," var filter, el,"," Y = this,"," G_ENV = YUI.Env,"," Env = Y.Env,"," prop;",""," /**"," The version number of this YUI instance.",""," This value is typically updated by a script when a YUI release is built,"," so it may not reflect the correct version number when YUI is run from"," the development source tree.",""," @property {String} version"," **/"," Y.version = VERSION;",""," if (!Env) {"," Y.Env = {"," core: ['get', 'features', 'intl-base', 'yui-log', 'yui-log-nodejs', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3'],"," loaderExtras: ['loader-rollup', 'loader-yui3'],"," mods: {}, // flat module map"," versions: {}, // version module map"," base: BASE,"," cdn: BASE + VERSION + '/build/',"," // bootstrapped: false,"," _idx: 0,"," _used: {},"," _attached: {},"," _exported: {},"," _missed: [],"," _yidx: 0,"," _uidx: 0,"," _guidp: 'y',"," _loaded: {},"," // serviced: {},"," // Regex in English:"," // I'll start at the \\b(yui)."," // 1. Look in the test string for \"yui\" or"," // \"yui-base\" or \"yui-davglass\" or \"yui-foobar\" that comes after a word break. That is, it"," // can't match \"foyui\" or \"i_heart_yui\". This can be anywhere in the string."," // 2. After #1 must come a forward slash followed by the string matched in #1, so"," // \"yui-base/yui-base\" or \"yui-pants/yui-pants\"."," // 3. The second occurence of the #1 token can optionally be followed by \"-debug\" or \"-min\","," // so \"yui/yui-min\", \"yui/yui-debug\", \"yui-base/yui-base-debug\". NOT \"yui/yui-tshirt\"."," // 4. This is followed by \".js\", so \"yui/yui.js\"."," // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a \"?\" in the string,"," // then capture the junk between the LAST \"&\" and the string in 1-4. So"," // \"blah?foo/yui/yui.js\" will capture \"foo/\" and \"blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js\""," // will capture \"3.3.0/build/\""," //"," // Regex Exploded:"," // (?:\\? Find a ?"," // (?:[^&]*&) followed by 0..n characters followed by an &"," // * in fact, find as many sets of characters followed by a & as you can"," // ([^&]*) capture the stuff after the last & in \\1"," // )? but it's ok if all this ?junk&more_junk stuff isn't even there"," // \\b( after a word break find either the string"," // yui(?:-\\w+)? \"yui\" optionally followed by a -, then more characters"," // ) and store the yui-* string in \\2"," // \\/\\2 then comes a / followed by the yui-* string in \\2"," // (?:-(min|debug))? optionally followed by \"-min\" or \"-debug\""," // .js and ending in \".js\""," _BASE_RE: /(?:\\?(?:[^&]*&)*([^&]*))?\\b(yui(?:-\\w+)?)\\/\\2(?:-(min|debug))?\\.js/,"," parseBasePath: function(src, pattern) {"," var match = src.match(pattern),"," path, filter;",""," if (match) {"," path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));",""," // this is to set up the path to the loader. The file"," // filter for loader should match the yui include."," filter = match[3];",""," // extract correct path for mixed combo urls"," // http://yuilibrary.com/projects/yui3/ticket/2528423"," if (match[1]) {"," path += '?' + match[1];"," }"," path = {"," filter: filter,"," path: path"," };"," }"," return path;"," },"," getBase: G_ENV && G_ENV.getBase ||"," function(pattern) {"," var nodes = (doc && doc.getElementsByTagName('script')) || [],"," path = Env.cdn, parsed,"," i, len, src;",""," for (i = 0, len = nodes.length; i < len; ++i) {"," src = nodes[i].src;"," if (src) {"," parsed = Y.Env.parseBasePath(src, pattern);"," if (parsed) {"," filter = parsed.filter;"," path = parsed.path;"," break;"," }"," }"," }",""," // use CDN default"," return path;"," }",""," };",""," Env = Y.Env;",""," Env._loaded[VERSION] = {};",""," if (G_ENV && Y !== YUI) {"," Env._yidx = ++G_ENV._yidx;"," Env._guidp = ('yui_' + VERSION + '_' +"," Env._yidx + '_' + time).replace(/[^a-z0-9_]+/g, '_');"," } else if (YUI._YUI) {",""," G_ENV = YUI._YUI.Env;"," Env._yidx += G_ENV._yidx;"," Env._uidx += G_ENV._uidx;",""," for (prop in G_ENV) {"," if (!(prop in Env)) {"," Env[prop] = G_ENV[prop];"," }"," }",""," delete YUI._YUI;"," }",""," Y.id = Y.stamp(Y);"," instances[Y.id] = Y;",""," }",""," Y.constructor = YUI;",""," // configuration defaults"," Y.config = Y.config || {"," bootstrap: true,"," cacheUse: true,"," debug: true,"," doc: doc,"," fetchCSS: true,"," throwFail: true,"," useBrowserConsole: true,"," useNativeES5: true,"," win: win,"," global: Function('return this')()"," };",""," //Register the CSS stamp element"," if (doc && !doc.getElementById(CSS_STAMP_EL)) {"," el = doc.createElement('div');"," el.innerHTML = '<div id=\"' + CSS_STAMP_EL + '\" style=\"position: absolute !important; visibility: hidden !important\"></div>';"," YUI.Env.cssStampEl = el.firstChild;"," if (doc.body) {"," doc.body.appendChild(YUI.Env.cssStampEl);"," } else {"," docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);"," }"," } else if (doc && doc.getElementById(CSS_STAMP_EL) && !YUI.Env.cssStampEl) {"," YUI.Env.cssStampEl = doc.getElementById(CSS_STAMP_EL);"," }",""," Y.config.lang = Y.config.lang || 'en-US';",""," Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);",""," if (!filter || (!('mindebug').indexOf(filter))) {"," filter = 'min';"," }"," filter = (filter) ? '-' + filter : filter;"," Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';",""," },",""," /**"," Finishes the instance setup. Attaches whatever YUI modules were defined"," at the time that this instance was created.",""," @method _setup"," @private"," **/"," _setup: function() {"," var i, Y = this,"," core = [],"," mods = YUI.Env.mods,"," extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..",""," for (i = 0; i < extras.length; i++) {"," if (mods[extras[i]]) {"," core.push(extras[i]);"," }"," }",""," Y._attach(['yui-base']);"," Y._attach(core);",""," if (Y.Loader) {"," getLoader(Y);"," }",""," },",""," /**"," Executes the named method on the specified YUI instance if that method is"," whitelisted.",""," @method applyTo"," @param {String} id YUI instance id."," @param {String} method Name of the method to execute. For example:"," 'Object.keys'."," @param {Array} args Arguments to apply to the method."," @return {Mixed} Return value from the applied method, or `null` if the"," specified instance was not found or the method was not whitelisted."," **/"," applyTo: function(id, method, args) {"," if (!(method in APPLY_TO_AUTH)) {"," this.log(method + ': applyTo not allowed', 'warn', 'yui');"," return null;"," }",""," var instance = instances[id], nest, m, i;"," if (instance) {"," nest = method.split('.');"," m = instance;"," for (i = 0; i < nest.length; i = i + 1) {"," m = m[nest[i]];"," if (!m) {"," this.log('applyTo not found: ' + method, 'warn', 'yui');"," }"," }"," return m && m.apply(instance, args);"," }",""," return null;"," },","","/**","Registers a YUI module and makes it available for use in a `YUI().use()` call or","as a dependency for other modules.","","The easiest way to create a first-class YUI module is to use","<a href=\"http://yui.github.com/shifter/\">Shifter</a>, the YUI component build","tool.","","Shifter will automatically wrap your module code in a `YUI.add()` call along","with any configuration info required for the module.","","@example",""," YUI.add('davglass', function (Y) {"," Y.davglass = function () {"," };"," }, '3.4.0', {"," requires: ['harley-davidson', 'mt-dew']"," });","","@method add","@param {String} name Module name.","@param {Function} fn Function containing module code. This function will be"," executed whenever the module is attached to a specific YUI instance.",""," @param {YUI} fn.Y The YUI instance to which this module is attached."," @param {String} fn.name Name of the module","","@param {String} version Module version number. This is currently used only for"," informational purposes, and is not used internally by YUI.","","@param {Object} [config] Module config."," @param {Array} [config.requires] Array of other module names that must be"," attached before this module can be attached."," @param {Array} [config.optional] Array of optional module names that should"," be attached before this module is attached if they've already been"," loaded. If the `loadOptional` YUI option is `true`, optional modules"," that have not yet been loaded will be loaded just as if they were hard"," requirements."," @param {Array} [config.use] Array of module names that are included within"," or otherwise provided by this module, and which should be attached"," automatically when this module is attached. This makes it possible to"," create \"virtual rollup\" modules that simply attach a collection of other"," modules or submodules.","","@return {YUI} This YUI instance.","**/"," add: function(name, fn, version, details) {"," details = details || {};"," var env = YUI.Env,"," mod = {"," name: name,"," fn: fn,"," version: version,"," details: details"," },"," //Instance hash so we don't apply it to the same instance twice"," applied = {},"," loader, inst, modInfo,"," i, versions = env.versions;",""," env.mods[name] = mod;"," versions[version] = versions[version] || {};"," versions[version][name] = mod;",""," for (i in instances) {"," if (instances.hasOwnProperty(i)) {"," inst = instances[i];"," if (!applied[inst.id]) {"," applied[inst.id] = true;"," loader = inst.Env._loader;"," if (loader) {"," modInfo = loader.getModuleInfo(name);"," if (!modInfo || modInfo.temp) {"," loader.addModule(details, name);"," }"," }"," }"," }"," }",""," return this;"," },",""," /**"," Executes the callback function associated with each required module,"," attaching the module to this YUI instance.",""," @method _attach"," @param {Array} r The array of modules to attach"," @param {Boolean} [moot=false] If `true`, don't throw a warning if the module"," is not attached."," @private"," **/"," _attach: function(r, moot) {"," var i, name, mod, details, req, use, after,"," mods = YUI.Env.mods,"," aliases = YUI.Env.aliases,"," Y = this, j,"," cache = YUI.Env._renderedMods,"," loader = Y.Env._loader,"," done = Y.Env._attached,"," exported = Y.Env._exported,"," len = r.length, loader, def, go,"," c = [],"," modArgs, esCompat, reqlen, modInfo,"," condition,"," __exports__, __imports__;",""," //Check for conditional modules (in a second+ instance) and add their requirements"," //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass"," for (i = 0; i < len; i++) {"," name = r[i];"," mod = mods[name];"," c.push(name);"," if (loader && loader.conditions[name]) {"," for (j in loader.conditions[name]) {"," if (loader.conditions[name].hasOwnProperty(j)) {"," def = loader.conditions[name][j];"," go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));"," if (go) {"," c.push(def.name);"," }"," }"," }"," }"," }"," r = c;"," len = r.length;",""," for (i = 0; i < len; i++) {"," if (!done[r[i]]) {"," name = r[i];"," mod = mods[name];",""," if (aliases && aliases[name] && !mod) {"," Y._attach(aliases[name]);"," continue;"," }"," if (!mod) {"," modInfo = loader && loader.getModuleInfo(name);"," if (modInfo) {"," mod = modInfo;"," moot = true;"," }","",""," //if (!loader || !loader.moduleInfo[name]) {"," //if ((!loader || !loader.moduleInfo[name]) && !moot) {"," if (!moot && name) {"," if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {"," Y.Env._missed.push(name);"," Y.Env._missed = Y.Array.dedupe(Y.Env._missed);"," Y.message('NOT loaded: ' + name, 'warn', 'yui');"," }"," }"," } else {"," done[name] = true;"," //Don't like this, but in case a mod was asked for once, then we fetch it"," //We need to remove it from the missed list ^davglass"," for (j = 0; j < Y.Env._missed.length; j++) {"," if (Y.Env._missed[j] === name) {"," Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');"," Y.Env._missed.splice(j, 1);"," }"," }"," /*"," If it's a temp module, we need to redo it's requirements if it's already loaded"," since it may have been loaded by another instance and it's dependencies might"," have been redefined inside the fetched file."," */"," if (loader && cache && cache[name] && cache[name].temp) {"," loader.getRequires(cache[name]);"," req = [];"," modInfo = loader.getModuleInfo(name);"," for (j in modInfo.expanded_map) {"," if (modInfo.expanded_map.hasOwnProperty(j)) {"," req.push(j);"," }"," }"," Y._attach(req);"," }",""," details = mod.details;"," req = details.requires;"," esCompat = details.es;"," use = details.use;"," after = details.after;"," //Force Intl load if there is a language (Loader logic) @todo fix this shit"," if (details.lang) {"," req = req || [];"," req.unshift('intl');"," }",""," if (req) {"," reqlen = req.length;"," for (j = 0; j < reqlen; j++) {"," if (!done[req[j]]) {"," if (!Y._attach(req)) {"," return false;"," }"," break;"," }"," }"," }",""," if (after) {"," for (j = 0; j < after.length; j++) {"," if (!done[after[j]]) {"," if (!Y._attach(after, true)) {"," return false;"," }"," break;"," }"," }"," }",""," if (mod.fn) {"," modArgs = [Y, name];"," if (esCompat) {"," __imports__ = {};"," __exports__ = {};"," // passing `exports` and `imports` onto the module function"," modArgs.push(__imports__, __exports__);"," if (req) {"," reqlen = req.length;"," for (j = 0; j < reqlen; j++) {"," __imports__[req[j]] = exported.hasOwnProperty(req[j]) ? exported[req[j]] : Y;"," }"," }"," }"," if (Y.config.throwFail) {"," __exports__ = mod.fn.apply(esCompat ? undefined : mod, modArgs);"," } else {"," try {"," __exports__ = mod.fn.apply(esCompat ? undefined : mod, modArgs);"," } catch (e) {"," Y.error('Attach error: ' + name, e, name);"," return false;"," }"," }"," if (esCompat) {"," // store the `exports` in case others `es` modules requires it"," exported[name] = __exports__;",""," // If an ES module is conditionally loaded and set"," // to be used \"instead\" another module, replace the"," // trigger module's content with the conditionally"," // loaded one so the values returned by require()"," // still makes sense"," condition = mod.details.condition;"," if (condition && condition.when === 'instead') {"," exported[condition.trigger] = __exports__;"," }"," }"," }",""," if (use) {"," for (j = 0; j < use.length; j++) {"," if (!done[use[j]]) {"," if (!Y._attach(use)) {"," return false;"," }"," break;"," }"," }"," }","","",""," }"," }"," }",""," return true;"," },",""," /**"," Delays the `use` callback until another event has taken place such as"," `window.onload`, `domready`, `contentready`, or `available`.",""," @private"," @method _delayCallback"," @param {Function} cb The original `use` callback."," @param {String|Object} until Either an event name ('load', 'domready', etc.)"," or an object containing event/args keys for contentready/available."," @return {Function}"," **/"," _delayCallback: function(cb, until) {",""," var Y = this,"," mod = ['event-base'];",""," until = (Y.Lang.isObject(until) ? until : { event: until });",""," if (until.event === 'load') {"," mod.push('event-synthetic');"," }",""," return function() {"," var args = arguments;"," Y._use(mod, function() {"," Y.on(until.event, function() {"," args[1].delayUntil = until.event;"," cb.apply(Y, args);"," }, until.args);"," });"," };"," },",""," /**"," Attaches one or more modules to this YUI instance. When this is executed,"," the requirements of the desired modules are analyzed, and one of several"," things can happen:","",""," * All required modules have already been loaded, and just need to be"," attached to this YUI instance. In this case, the `use()` callback will"," be executed synchronously after the modules are attached.",""," * One or more modules have not yet been loaded, or the Get utility is not"," available, or the `bootstrap` config option is `false`. In this case,"," a warning is issued indicating that modules are missing, but all"," available modules will still be attached and the `use()` callback will"," be executed synchronously.",""," * One or more modules are missing and the Loader is not available but the"," Get utility is, and `bootstrap` is not `false`. In this case, the Get"," utility will be used to load the Loader, and we will then proceed to"," the following state:",""," * One or more modules are missing and the Loader is available. In this"," case, the Loader will be used to resolve the dependency tree for the"," missing modules and load them and their dependencies. When the Loader is"," finished loading modules, the `use()` callback will be executed"," asynchronously.",""," @example",""," // Loads and attaches dd and its dependencies."," YUI().use('dd', function (Y) {"," // ..."," });",""," // Loads and attaches dd and node as well as all of their dependencies."," YUI().use(['dd', 'node'], function (Y) {"," // ..."," });",""," // Attaches all modules that have already been loaded."," YUI().use('*', function (Y) {"," // ..."," });",""," // Attaches a gallery module."," YUI().use('gallery-yql', function (Y) {"," // ..."," });",""," // Attaches a YUI 2in3 module."," YUI().use('yui2-datatable', function (Y) {"," // ..."," });",""," @method use"," @param {String|Array} modules* One or more module names to attach."," @param {Function} [callback] Callback function to be executed once all"," specified modules and their dependencies have been attached."," @param {YUI} callback.Y The YUI instance created for this sandbox."," @param {Object} callback.status Object containing `success`, `msg` and"," `data` properties."," @chainable"," **/"," use: function() {"," var args = SLICE.call(arguments, 0),"," callback = args[args.length - 1],"," Y = this,"," i = 0,"," name,"," Env = Y.Env,"," provisioned = true;",""," // The last argument supplied to use can be a load complete callback"," if (Y.Lang.isFunction(callback)) {"," args.pop();"," if (Y.config.delayUntil) {"," callback = Y._delayCallback(callback, Y.config.delayUntil);"," }"," } else {"," callback = null;"," }"," if (Y.Lang.isArray(args[0])) {"," args = args[0];"," }",""," if (Y.config.cacheUse) {"," while ((name = args[i++])) {"," if (!Env._attached[name]) {"," provisioned = false;"," break;"," }"," }",""," if (provisioned) {"," if (args.length) {"," }"," Y._notify(callback, ALREADY_DONE, args);"," return Y;"," }"," }",""," if (Y._loading) {"," Y._useQueue = Y._useQueue || new Y.Queue();"," Y._useQueue.add([args, callback]);"," } else {"," Y._use(args, function(Y, response) {"," Y._notify(callback, response, args);"," });"," }",""," return Y;"," },",""," /**"," Sugar for loading both legacy and ES6-based YUI modules.",""," @method require"," @param {String} [modules*] List of module names to import or a single"," module name."," @param {Function} callback Callback that gets called once all the modules"," were loaded. Each parameter of the callback is the export value of the"," corresponding module in the list. If the module is a legacy YUI module,"," the YUI instance is used instead of the module exports."," @example"," ```"," YUI().require(['es6-set'], function (Y, imports) {"," var Set = imports.Set,"," set = new Set();"," });"," ```"," **/"," require: function () {"," var args = SLICE.call(arguments),"," callback;",""," if (typeof args[args.length - 1] === 'function') {"," callback = args.pop();",""," // only add the callback if one was provided"," // YUI().require('foo'); is valid"," args.push(function (Y) {"," var i, length = args.length,"," exported = Y.Env._exported,"," __imports__ = {};",""," // Get only the imports requested as arguments"," for (i = 0; i < length; i++) {"," if (exported.hasOwnProperty(args[i])) {"," __imports__[args[i]] = exported[args[i]];"," }"," }",""," // Using `undefined` because:"," // - Using `Y.config.global` would force the value of `this` to be"," // the global object even in strict mode"," // - Using `Y` goes against the goal of moving away from a shared"," // object and start thinking in terms of imported and exported"," // objects"," callback.call(undefined, Y, __imports__);"," });"," }"," // Do not return the Y object. This makes it hard to follow this"," // traditional pattern:"," // var Y = YUI().use(...);"," // This is a good idea in the light of ES6 modules, to avoid working"," // in the global scope."," // This also leaves the door open for returning a promise, once the"," // YUI loader is based on the ES6 loader which uses"," // loader.import(...).then(...)"," this.use.apply(this, args);"," },",""," /**"," Handles Loader notifications about attachment/load errors.",""," @method _notify"," @param {Function} callback Callback to pass to `Y.config.loadErrorFn`."," @param {Object} response Response returned from Loader."," @param {Array} args Arguments passed from Loader."," @private"," **/"," _notify: function(callback, response, args) {"," if (!response.success && this.config.loadErrorFn) {"," this.config.loadErrorFn.call(this, this, callback, response, args);"," } else if (callback) {"," if (this.Env._missed && this.Env._missed.length) {"," response.msg = 'Missing modules: ' + this.Env._missed.join();"," response.success = false;"," }"," if (this.config.throwFail) {"," callback(this, response);"," } else {"," try {"," callback(this, response);"," } catch (e) {"," this.error('use callback error', e, args);"," }"," }"," }"," },",""," /**"," Called from the `use` method queue to ensure that only one set of loading"," logic is performed at a time.",""," @method _use"," @param {String} args* One or more modules to attach."," @param {Function} [callback] Function to call once all required modules have"," been attached."," @private"," **/"," _use: function(args, callback) {",""," if (!this.Array) {"," this._attach(['yui-base']);"," }",""," var len, loader, handleBoot,"," Y = this,"," G_ENV = YUI.Env,"," mods = G_ENV.mods,"," Env = Y.Env,"," used = Env._used,"," aliases = G_ENV.aliases,"," queue = G_ENV._loaderQueue,"," firstArg = args[0],"," YArray = Y.Array,"," config = Y.config,"," boot = config.bootstrap,"," missing = [],"," i,"," r = [],"," ret = true,"," fetchCSS = config.fetchCSS,"," process = function(names, skip) {",""," var i = 0, a = [], name, len, m, req, use;",""," if (!names.length) {"," return;"," }",""," if (aliases) {"," len = names.length;"," for (i = 0; i < len; i++) {"," if (aliases[names[i]] && !mods[names[i]]) {"," a = [].concat(a, aliases[names[i]]);"," } else {"," a.push(names[i]);"," }"," }"," names = a;"," }",""," len = names.length;",""," for (i = 0; i < len; i++) {"," name = names[i];"," if (!skip) {"," r.push(name);"," }",""," // only attach a module once"," if (used[name]) {"," continue;"," }",""," m = mods[name];"," req = null;"," use = null;",""," if (m) {"," used[name] = true;"," req = m.details.requires;"," use = m.details.use;"," } else {"," // CSS files don't register themselves, see if it has"," // been loaded"," if (!G_ENV._loaded[VERSION][name]) {"," missing.push(name);"," } else {"," used[name] = true; // probably css"," }"," }",""," // make sure requirements are attached"," if (req && req.length) {"," process(req);"," }",""," // make sure we grab the submodule dependencies too"," if (use && use.length) {"," process(use, 1);"," }"," }",""," },",""," handleLoader = function(fromLoader) {"," var response = fromLoader || {"," success: true,"," msg: 'not dynamic'"," },"," redo, origMissing,"," ret = true,"," data = response.data;",""," Y._loading = false;",""," if (data) {"," origMissing = missing;"," missing = [];"," r = [];"," process(data);"," redo = missing.length;"," if (redo) {"," if ([].concat(missing).sort().join() =="," origMissing.sort().join()) {"," redo = false;"," }"," }"," }",""," if (redo && data) {"," Y._loading = true;"," Y._use(missing, function() {"," if (Y._attach(data)) {"," Y._notify(callback, response, data);"," }"," });"," } else {"," if (data) {"," ret = Y._attach(data);"," }"," if (ret) {"," Y._notify(callback, response, args);"," }"," }",""," if (Y._useQueue && Y._useQueue.size() && !Y._loading) {"," Y._use.apply(Y, Y._useQueue.next());"," }",""," };","",""," // YUI().use('*'); // bind everything available"," if (firstArg === '*') {"," args = [];"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," args.push(i);"," }"," }"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," return Y;"," }",""," if ((mods.loader || mods['loader-base']) && !Y.Loader) {"," Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);"," }","",""," // use loader to expand dependencies and sort the"," // requirements if it is available."," if (boot && Y.Loader && args.length) {"," loader = getLoader(Y);"," loader.require(args);"," loader.ignoreRegistered = true;"," loader._boot = true;"," loader.calculate(null, (fetchCSS) ? null : 'js');"," args = loader.sorted;"," loader._boot = false;"," }",""," process(args);",""," len = missing.length;","",""," if (len) {"," missing = YArray.dedupe(missing);"," len = missing.length;"," }","",""," // dynamic load"," if (boot && len && Y.Loader) {"," Y._loading = true;"," loader = getLoader(Y);"," loader.onEnd = handleLoader;"," loader.context = Y;"," loader.data = args;"," loader.ignoreRegistered = false;"," loader.require(missing);"," loader.insert(null, (fetchCSS) ? null : 'js');",""," } else if (boot && len && Y.Get && !Env.bootstrapped) {",""," Y._loading = true;",""," handleBoot = function() {"," Y._loading = false;"," queue.running = false;"," Env.bootstrapped = true;"," G_ENV._bootstrapping = false;"," if (Y._attach(['loader'])) {"," Y._use(args, callback);"," }"," };",""," if (G_ENV._bootstrapping) {"," queue.add(handleBoot);"," } else {"," G_ENV._bootstrapping = true;"," Y.Get.script(config.base + config.loaderPath, {"," onEnd: handleBoot"," });"," }",""," } else {"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," }",""," return Y;"," },","",""," /**"," Utility method for safely creating namespaces if they don't already exist."," May be called statically on the YUI global object or as a method on a YUI"," instance.",""," When called statically, a namespace will be created on the YUI global"," object:",""," // Create `YUI.your.namespace.here` as nested objects, preserving any"," // objects that already exist instead of overwriting them."," YUI.namespace('your.namespace.here');",""," When called as a method on a YUI instance, a namespace will be created on"," that instance:",""," // Creates `Y.property.package`."," Y.namespace('property.package');",""," Dots in the input string cause `namespace` to create nested objects for each"," token. If any part of the requested namespace already exists, the current"," object will be left in place and will not be overwritten. This allows"," multiple calls to `namespace` to preserve existing namespaced properties.",""," If the first token in the namespace string is \"YAHOO\", that token is"," discarded. This is legacy behavior for backwards compatibility with YUI 2.",""," Be careful with namespace tokens. Reserved words may work in some browsers"," and not others. For instance, the following will fail in some browsers"," because the supported version of JavaScript reserves the word \"long\":",""," Y.namespace('really.long.nested.namespace');",""," Note: If you pass multiple arguments to create multiple namespaces, only the"," last one created is returned from this function.",""," @method namespace"," @param {String} namespace* One or more namespaces to create."," @return {Object} Reference to the last namespace object created."," **/"," namespace: function() {"," var a = arguments, o, i = 0, j, d, arg;",""," for (; i < a.length; i++) {"," o = this; //Reset base object per argument or it will get reused from the last"," arg = a[i];"," if (arg.indexOf(PERIOD) > -1) { //Skip this if no \".\" is present"," d = arg.split(PERIOD);"," for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {"," o[d[j]] = o[d[j]] || {};"," o = o[d[j]];"," }"," } else {"," o[arg] = o[arg] || {};"," o = o[arg]; //Reset base object to the new object so it's returned"," }"," }"," return o;"," },",""," // this is replaced if the log module is included"," log: NOOP,"," message: NOOP,"," // this is replaced if the dump module is included"," dump: function (o) { return ''+o; },",""," /**"," Reports an error.",""," The reporting mechanism is controlled by the `throwFail` configuration"," attribute. If `throwFail` is falsy, the message is logged. If `throwFail` is"," truthy, a JS exception is thrown.",""," If an `errorFn` is specified in the config it must return `true` to indicate"," that the exception was handled and keep it from being thrown.",""," @method error"," @param {String} msg Error message."," @param {Error|String} [e] JavaScript error object or an error string."," @param {String} [src] Source of the error (such as the name of the module in"," which the error occurred)."," @chainable"," **/"," error: function(msg, e, src) {"," //TODO Add check for window.onerror here",""," var Y = this, ret;",""," if (Y.config.errorFn) {"," ret = Y.config.errorFn.apply(Y, arguments);"," }",""," if (!ret) {"," throw (e || new Error(msg));"," } else {"," Y.message(msg, 'error', ''+src); // don't scrub this one"," }",""," return Y;"," },",""," /**"," Generates an id string that is unique among all YUI instances in this"," execution context.",""," @method guid"," @param {String} [pre] Prefix."," @return {String} Unique id."," **/"," guid: function(pre) {"," var id = this.Env._guidp + '_' + (++this.Env._uidx);"," return (pre) ? (pre + id) : id;"," },",""," /**"," Returns a unique id associated with the given object and (if *readOnly* is"," falsy) stamps the object with that id so it can be identified in the future.",""," Stamping an object involves adding a `_yuid` property to it that contains"," the object's id. One exception to this is that in Internet Explorer, DOM"," nodes have a `uniqueID` property that contains a browser-generated unique"," id, which will be used instead of a YUI-generated id when available.",""," @method stamp"," @param {Object} o Object to stamp."," @param {Boolean} readOnly If truthy and the given object has not already"," been stamped, the object will not be modified and `null` will be"," returned."," @return {String} Object's unique id, or `null` if *readOnly* was truthy and"," the given object was not already stamped."," **/"," stamp: function(o, readOnly) {"," var uid;"," if (!o) {"," return o;"," }",""," // IE generates its own unique ID for dom nodes"," // The uniqueID property of a document node returns a new ID"," if (o.uniqueID && o.nodeType && o.nodeType !== 9) {"," uid = o.uniqueID;"," } else {"," uid = (typeof o === 'string') ? o : o._yuid;"," }",""," if (!uid) {"," uid = this.guid();"," if (!readOnly) {"," try {"," o._yuid = uid;"," } catch (e) {"," uid = null;"," }"," }"," }"," return uid;"," },",""," /**"," Destroys this YUI instance.",""," @method destroy"," @since 3.3.0"," **/"," destroy: function() {"," var Y = this;"," if (Y.Event) {"," Y.Event._unload();"," }"," delete instances[Y.id];"," delete Y.Env;"," delete Y.config;"," }",""," /**"," Safe `instanceof` wrapper that works around a memory leak in IE when the"," object being tested is `window` or `document`.",""," Unless you are testing objects that may be `window` or `document`, you"," should use the native `instanceof` operator instead of this method.",""," @method instanceOf"," @param {Object} o Object to check."," @param {Object} type Class to check against."," @since 3.3.0"," **/","};",""," YUI.prototype = proto;",""," // inheritance utilities are not available yet"," for (prop in proto) {"," if (proto.hasOwnProperty(prop)) {"," YUI[prop] = proto[prop];"," }"," }",""," /**"," Applies a configuration to all YUI instances in this execution context.",""," The main use case for this method is in \"mashups\" where several third-party"," scripts need to write to a global YUI config, but cannot share a single"," centrally-managed config object. This way they can all call"," `YUI.applyConfig({})` instead of overwriting the single global config.",""," @example",""," YUI.applyConfig({"," modules: {"," davglass: {"," fullpath: './davglass.js'"," }"," }"," });",""," YUI.applyConfig({"," modules: {"," foo: {"," fullpath: './foo.js'"," }"," }"," });",""," YUI().use('davglass', function (Y) {"," // Module davglass will be available here."," });",""," @method applyConfig"," @param {Object} o Configuration object to apply."," @static"," @since 3.5.0"," **/"," YUI.applyConfig = function(o) {"," if (!o) {"," return;"," }"," //If there is a GlobalConfig, apply it first to set the defaults"," if (YUI.GlobalConfig) {"," this.prototype.applyConfig.call(this, YUI.GlobalConfig);"," }"," //Apply this config to it"," this.prototype.applyConfig.call(this, o);"," //Reset GlobalConfig to the combined config"," YUI.GlobalConfig = this.config;"," };",""," // set up the environment"," YUI._init();",""," if (hasWin) {"," add(doc, 'DOMContentLoaded', handleReady);",""," // add a window load event at load time so we can capture"," // the case where it fires before dynamic loading is"," // complete."," add(window, 'load', handleLoad);"," } else {"," handleReady();"," handleLoad();"," }",""," YUI.Env.add = add;"," YUI.Env.remove = remove;",""," /*global exports*/"," // Support the CommonJS method for exporting our single global"," if (typeof exports == 'object') {"," exports.YUI = YUI;"," /**"," * Set a method to be called when `Get.script` is called in Node.js"," * `Get` will open the file, then pass it's content and it's path"," * to this method before attaching it. Commonly used for code coverage"," * instrumentation. <strong>Calling this multiple times will only"," * attach the last hook method</strong>. This method is only"," * available in Node.js."," * @method setLoadHook"," * @static"," * @param {Function} fn The function to set"," * @param {String} fn.data The content of the file"," * @param {String} fn.path The file path of the file"," */"," YUI.setLoadHook = function(fn) {"," YUI._getLoadHook = fn;"," };"," /**"," * Load hook for `Y.Get.script` in Node.js, see `YUI.setLoadHook`"," * @method _getLoadHook"," * @private"," * @param {String} data The content of the file"," * @param {String} path The file path of the file"," */"," YUI._getLoadHook = null;"," }",""," YUI.Env[VERSION] = {};","}());","","","/**","Config object that contains all of the configuration options for","this `YUI` instance.","","This object is supplied by the implementer when instantiating YUI. Some","properties have default values if they are not supplied by the implementer.","","This object should not be updated directly because some values are cached. Use","`applyConfig()` to update the config object on a YUI instance that has already","been configured.","","@class config","@static","**/","","/**","If `true` (the default), YUI will \"bootstrap\" the YUI Loader and module metadata","if they're needed to load additional dependencies and aren't already available.","","Setting this to `false` will prevent YUI from automatically loading the Loader","and module metadata, so you will need to manually ensure that they're available","or handle dependency resolution yourself.","","@property {Boolean} bootstrap","@default true","**/","","/**","","@property {Object} filters","**/","","/**","If `true`, YUI will use a combo handler to load multiple modules in as few","requests as possible.","","The YUI CDN (which YUI uses by default) supports combo handling, but other","servers may not. If the server from which you're loading YUI does not support","combo handling, set this to `false`.","","Providing a value for the `base` config property will cause `combine` to default","to `false` instead of `true`.","","@property {Boolean} combine","@default true","*/","","/**","Array of module names that should never be dynamically loaded.","","@property {String[]} ignore","**/","","/**","Array of module names that should always be loaded when required, even if","already present on the page.","","@property {String[]} force","**/","","/**","DOM element or id that should be used as the insertion point for dynamically","added `<script>` and `<link>` nodes.","","@property {HTMLElement|String} insertBefore","**/","","/**","Object hash containing attributes to add to dynamically added `<script>` nodes.","","@property {Object} jsAttributes","**/","","/**","Object hash containing attributes to add to dynamically added `<link>` nodes.","","@property {Object} cssAttributes","**/","","/**","Timeout in milliseconds before a dynamic JS or CSS request will be considered a","failure. If not set, no timeout will be enforced.","","@property {Number} timeout","**/","","/**","A hash of module definitions to add to the list of available YUI modules. These","modules can then be dynamically loaded via the `use()` method.","","This is a hash in which keys are module names and values are objects containing","module metadata.","","See `Loader.addModule()` for the supported module metadata fields. Also see","`groups`, which provides a way to configure the base and combo spec for a set of","modules.","","@example",""," modules: {"," mymod1: {"," requires: ['node'],"," fullpath: '/mymod1/mymod1.js'"," },",""," mymod2: {"," requires: ['mymod1'],"," fullpath: '/mymod2/mymod2.js'"," },",""," mymod3: '/js/mymod3.js',"," mycssmod: '/css/mycssmod.css'"," }","","@property {Object} modules","**/","","/**","Aliases are dynamic groups of modules that can be used as shortcuts.","","@example",""," YUI({"," aliases: {"," davglass: [ 'node', 'yql', 'dd' ],"," mine: [ 'davglass', 'autocomplete']"," }"," }).use('mine', function (Y) {"," // Node, YQL, DD & AutoComplete available here."," });","","@property {Object} aliases","**/","","/**","A hash of module group definitions.","","For each group you can specify a list of modules and the base path and","combo spec to use when dynamically loading the modules.","","@example",""," groups: {"," yui2: {"," // specify whether or not this group has a combo service"," combine: true,",""," // The comboSeperator to use with this group's combo handler"," comboSep: ';',",""," // The maxURLLength for this server"," maxURLLength: 500,",""," // the base path for non-combo paths"," base: 'http://yui.yahooapis.com/2.8.0r4/build/',",""," // the path to the combo service"," comboBase: 'http://yui.yahooapis.com/combo?',",""," // a fragment to prepend to the path attribute when"," // when building combo urls"," root: '2.8.0r4/build/',",""," // the module definitions"," modules: {"," yui2_yde: {"," path: \"yahoo-dom-event/yahoo-dom-event.js\""," },"," yui2_anim: {"," path: \"animation/animation.js\","," requires: ['yui2_yde']"," }"," }"," }"," }","","@property {Object} groups","**/","","/**","Path to the Loader JS file, relative to the `base` path.","","This is used to dynamically bootstrap the Loader when it's needed and isn't yet","available.","","@property {String} loaderPath","@default \"loader/loader-min.js\"","**/","","/**","If `true`, YUI will attempt to load CSS dependencies and skins. Set this to","`false` to prevent YUI from loading any CSS, or set it to the string `\"force\"`","to force CSS dependencies to be loaded even if their associated JS modules are","already loaded.","","@property {Boolean|String} fetchCSS","@default true","**/","","/**","Default gallery version used to build gallery module urls.","","@property {String} gallery","@since 3.1.0","**/","","/**","Default YUI 2 version used to build YUI 2 module urls.","","This is used for intrinsic YUI 2 support via the 2in3 project. Also see the","`2in3` config for pulling different revisions of the wrapped YUI 2 modules.","","@property {String} yui2","@default \"2.9.0\"","@since 3.1.0","**/","","/**","Revision number of YUI 2in3 modules that should be used when loading YUI 2in3.","","@property {String} 2in3","@default \"4\"","@since 3.1.0","**/","","/**","Alternate console log function that should be used in environments without a","supported native console. This function is executed with the YUI instance as its","`this` object.","","@property {Function} logFn","@since 3.1.0","**/","","/**","The minimum log level to log messages for. Log levels are defined","incrementally. Messages greater than or equal to the level specified will","be shown. All others will be discarded. The order of log levels in","increasing priority is:",""," debug"," info"," warn"," error","","@property {String} logLevel","@default 'debug'","@since 3.10.0","**/","","/**","Callback to execute when `Y.error()` is called. It receives the error message","and a JavaScript error object if one was provided.","","This function is executed with the YUI instance as its `this` object.","","Returning `true` from this function will prevent an exception from being thrown.","","@property {Function} errorFn","@param {String} errorFn.msg Error message","@param {Object} [errorFn.err] Error object (if one was provided).","@since 3.2.0","**/","","/**","A callback to execute when Loader fails to load one or more resources.","","This could be because of a script load failure. It could also be because a","module fails to register itself when the `requireRegistration` config is `true`.","","If this function is defined, the `use()` callback will only be called when the","loader succeeds. Otherwise, `use()` will always executes unless there was a","JavaScript error when attaching a module.","","@property {Function} loadErrorFn","@since 3.3.0","**/","","/**","If `true`, Loader will expect all loaded scripts to be first-class YUI modules","that register themselves with the YUI global, and will trigger a failure if a","loaded script does not register a YUI module.","","@property {Boolean} requireRegistration","@default false","@since 3.3.0","**/","","/**","Cache serviced use() requests.","","@property {Boolean} cacheUse","@default true","@since 3.3.0","@deprecated No longer used.","**/","","/**","Whether or not YUI should use native ES5 functionality when available for","features like `Y.Array.each()`, `Y.Object()`, etc.","","When `false`, YUI will always use its own fallback implementations instead of","relying on ES5 functionality, even when ES5 functionality is available.","","@property {Boolean} useNativeES5","@default true","@since 3.5.0","**/","","/**"," * Leverage native JSON stringify if the browser has a native"," * implementation. In general, this is a good idea. See the Known Issues"," * section in the JSON user guide for caveats. The default value is true"," * for browsers with native JSON support."," *"," * @property useNativeJSONStringify"," * @type Boolean"," * @default true"," * @since 3.8.0"," */",""," /**"," * Leverage native JSON parse if the browser has a native implementation."," * In general, this is a good idea. See the Known Issues section in the"," * JSON user guide for caveats. The default value is true for browsers with"," * native JSON support."," *"," * @property useNativeJSONParse"," * @type Boolean"," * @default true"," * @since 3.8.0"," */","","/**","Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)","","@property {Object|String} delayUntil","@since 3.6.0","@example","","You can use `load` or `domready` strings by default:",""," YUI({"," delayUntil: 'domready'"," }, function (Y) {"," // This will not execute until 'domeready' occurs."," });","","Or you can delay until a node is available (with `available` or `contentready`):",""," YUI({"," delayUntil: {"," event: 'available',"," args : '#foo'"," }"," }, function (Y) {"," // This will not execute until a node matching the selector \"#foo\" is"," // available in the DOM."," });","","**/","YUI.add('yui-base', function (Y, NAME) {","","/*"," * YUI stub"," * @module yui"," * @submodule yui-base"," */","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Provides core language utilites and extensions used throughout YUI."," *"," * @class Lang"," * @static"," */","","var L = Y.Lang || (Y.Lang = {}),","","STRING_PROTO = String.prototype,","TOSTRING = Object.prototype.toString,","","TYPES = {"," 'undefined' : 'undefined',"," 'number' : 'number',"," 'boolean' : 'boolean',"," 'string' : 'string',"," '[object Function]': 'function',"," '[object RegExp]' : 'regexp',"," '[object Array]' : 'array',"," '[object Date]' : 'date',"," '[object Error]' : 'error'","},","","SUBREGEX = /\\{\\s*([^|}]+?)\\s*(?:\\|([^}]*))?\\s*\\}/g,","","WHITESPACE = \"\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF\",","WHITESPACE_CLASS = \"[\\x09-\\x0D\\x20\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+\",","TRIM_LEFT_REGEX = new RegExp(\"^\" + WHITESPACE_CLASS),","TRIM_RIGHT_REGEX = new RegExp(WHITESPACE_CLASS + \"$\"),","TRIMREGEX = new RegExp(TRIM_LEFT_REGEX.source + \"|\" + TRIM_RIGHT_REGEX.source, \"g\"),","","NATIVE_FN_REGEX = /\\{\\s*\\[(?:native code|function)\\]\\s*\\}/i;","","// -- Protected Methods --------------------------------------------------------","","/**","Returns `true` if the given function appears to be implemented in native code,","`false` otherwise. Will always return `false` -- even in ES5-capable browsers --","if the `useNativeES5` YUI config option is set to `false`.","","This isn't guaranteed to be 100% accurate and won't work for anything other than","functions, but it can be useful for determining whether a function like","`Array.prototype.forEach` is native or a JS shim provided by another library.","","There's a great article by @kangax discussing certain flaws with this technique:","<http://perfectionkills.com/detecting-built-in-host-methods/>","","While his points are valid, it's still possible to benefit from this function","as long as it's used carefully and sparingly, and in such a way that false","negatives have minimal consequences. It's used internally to avoid using","potentially broken non-native ES5 shims that have been added to the page by","other libraries.","","@method _isNative","@param {Function} fn Function to test.","@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.","@static","@protected","@since 3.5.0","**/","L._isNative = function (fn) {"," return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));","};","","// -- Public Methods -----------------------------------------------------------","","/**"," * Determines whether or not the provided item is an array."," *"," * Returns `false` for array-like collections such as the function `arguments`"," * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to"," * test for an array-like collection."," *"," * @method isArray"," * @param o The object to test."," * @return {boolean} true if o is an array."," * @static"," */","L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {"," return L.type(o) === 'array';","};","","/**"," * Determines whether or not the provided item is a boolean."," * @method isBoolean"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a boolean."," */","L.isBoolean = function(o) {"," return typeof o === 'boolean';","};","","/**"," * Determines whether or not the supplied item is a date instance."," * @method isDate"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a date."," */","L.isDate = function(o) {"," return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);","};","","/**"," * <p>"," * Determines whether or not the provided item is a function."," * Note: Internet Explorer thinks certain functions are objects:"," * </p>"," *"," * <pre>"," * var obj = document.createElement(\"object\");"," * Y.Lang.isFunction(obj.getAttribute) // reports false in IE"," * &nbsp;"," * var input = document.createElement(\"input\"); // append to body"," * Y.Lang.isFunction(input.focus) // reports false in IE"," * </pre>"," *"," * <p>"," * You will have to implement additional tests if these functions"," * matter to you."," * </p>"," *"," * @method isFunction"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a function."," */","L.isFunction = function(o) {"," return L.type(o) === 'function';","};","","/**"," * Determines whether or not the provided item is null."," * @method isNull"," * @static"," * @param o The object to test."," * @return {boolean} true if o is null."," */","L.isNull = function(o) {"," return o === null;","};","","/**"," * Determines whether or not the provided item is a legal number."," * @method isNumber"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a number."," */","L.isNumber = function(o) {"," return typeof o === 'number' && isFinite(o);","};","","/**"," * Determines whether or not the provided item is of type object"," * or function. Note that arrays are also objects, so"," * <code>Y.Lang.isObject([]) === true</code>."," * @method isObject"," * @static"," * @param o The object to test."," * @param failfn {boolean} fail if the input is a function."," * @return {boolean} true if o is an object."," * @see isPlainObject"," */","L.isObject = function(o, failfn) {"," var t = typeof o;"," return (o && (t === 'object' ||"," (!failfn && (t === 'function' || L.isFunction(o))))) || false;","};","","/**"," * Determines whether or not the provided value is a regexp."," * @method isRegExp"," * @static"," * @param value The value or object to test."," * @return {boolean} true if value is a regexp."," */","L.isRegExp = function(value) {"," return L.type(value) === 'regexp';","};","","/**"," * Determines whether or not the provided item is a string."," * @method isString"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a string."," */","L.isString = function(o) {"," return typeof o === 'string';","};","","/**"," * Determines whether or not the provided item is undefined."," * @method isUndefined"," * @static"," * @param o The object to test."," * @return {boolean} true if o is undefined."," */","L.isUndefined = function(o) {"," return typeof o === 'undefined';","};","","/**"," * A convenience method for detecting a legitimate non-null value."," * Returns false for null/undefined/NaN, true for other values,"," * including 0/false/''"," * @method isValue"," * @static"," * @param o The item to test."," * @return {boolean} true if it is not null/undefined/NaN || false."," */","L.isValue = function(o) {"," var t = L.type(o);",""," switch (t) {"," case 'number':"," return isFinite(o);",""," case 'null': // fallthru"," case 'undefined':"," return false;",""," default:"," return !!t;"," }","};","","/**"," * Returns the current time in milliseconds."," *"," * @method now"," * @return {Number} Current time in milliseconds."," * @static"," * @since 3.3.0"," */","L.now = Date.now || function () {"," return new Date().getTime();","};","","/**"," * Performs `{placeholder}` substitution on a string. The object passed as the "," * second parameter provides values to replace the `{placeholder}`s."," * `{placeholder}` token names must match property names of the object. For example,"," * "," *`var greeting = Y.Lang.sub(\"Hello, {who}!\", { who: \"World\" });`"," *"," * `{placeholder}` tokens that are undefined on the object map will be left "," * in tact (leaving unsightly `{placeholder}`'s in the output string). "," *"," * @method sub"," * @param {string} s String to be modified."," * @param {object} o Object containing replacement values."," * @return {string} the substitute result."," * @static"," * @since 3.2.0"," */","L.sub = function(s, o) {"," return s.replace ? s.replace(SUBREGEX, function (match, key) {"," return L.isUndefined(o[key]) ? match : o[key];"," }) : s;","};","","/**"," * Returns a string without any leading or trailing whitespace. If"," * the input is not a string, the input will be returned untouched."," * @method trim"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trim = L._isNative(STRING_PROTO.trim) && !WHITESPACE.trim() ? function(s) {"," return s && s.trim ? s.trim() : s;","} : function (s) {"," try {"," return s.replace(TRIMREGEX, '');"," } catch (e) {"," return s;"," }","};","","/**"," * Returns a string without any leading whitespace."," * @method trimLeft"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimLeft = L._isNative(STRING_PROTO.trimLeft) && !WHITESPACE.trimLeft() ? function (s) {"," return s.trimLeft();","} : function (s) {"," return s.replace(TRIM_LEFT_REGEX, '');","};","","/**"," * Returns a string without any trailing whitespace."," * @method trimRight"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimRight = L._isNative(STRING_PROTO.trimRight) && !WHITESPACE.trimRight() ? function (s) {"," return s.trimRight();","} : function (s) {"," return s.replace(TRIM_RIGHT_REGEX, '');","};","","/**","Returns one of the following strings, representing the type of the item passed","in:",""," * \"array\""," * \"boolean\""," * \"date\""," * \"error\""," * \"function\""," * \"null\""," * \"number\""," * \"object\""," * \"regexp\""," * \"string\""," * \"undefined\"","","Known issues:",""," * `typeof HTMLElementCollection` returns function in Safari, but"," `Y.Lang.type()` reports \"object\", which could be a good thing --"," but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.","","@method type","@param o the item to test.","@return {string} the detected type.","@static","**/","L.type = function(o) {"," return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');","};","/**","@module yui","@submodule yui-base","*/","","var Lang = Y.Lang,"," Native = Array.prototype,",""," hasOwn = Object.prototype.hasOwnProperty;","","/**","Provides utility methods for working with arrays. Additional array helpers can","be found in the `collection` and `array-extras` modules.","","`Y.Array(thing)` returns a native array created from _thing_. Depending on","_thing_'s type, one of the following will happen:",""," * Arrays are returned unmodified unless a non-zero _startIndex_ is"," specified."," * Array-like collections (see `Array.test()`) are converted to arrays."," * For everything else, a new array is created with _thing_ as the sole"," item.","","Note: elements that are also collections, such as `<form>` and `<select>`","elements, are not automatically converted to arrays. To force a conversion,","pass `true` as the value of the _force_ parameter.","","@class Array","@constructor","@param {Any} thing The thing to arrayify.","@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like"," collection, a subset of items starting at the specified index will be"," returned.","@param {Boolean} [force=false] If `true`, _thing_ will be treated as an"," array-like collection no matter what.","@return {Array} A native array created from _thing_, according to the rules"," described above.","**/","function YArray(thing, startIndex, force) {"," var len, result;",""," /*jshint expr: true*/"," startIndex || (startIndex = 0);",""," if (force || YArray.test(thing)) {"," // IE throws when trying to slice HTMLElement collections."," try {"," return Native.slice.call(thing, startIndex);"," } catch (ex) {"," result = [];",""," for (len = thing.length; startIndex < len; ++startIndex) {"," result.push(thing[startIndex]);"," }",""," return result;"," }"," }",""," return [thing];","}","","Y.Array = YArray;","","/**","Dedupes an array of strings, returning an array that's guaranteed to contain","only one copy of a given string.","","This method differs from `Array.unique()` in that it's optimized for use only","with arrays consisting entirely of strings or entirely of numbers, whereas","`unique` may be used with other value types (but is slower).","","Using `dedupe()` with values other than strings or numbers, or with arrays","containing a mix of strings and numbers, may result in unexpected behavior.","","@method dedupe","@param {String[]|Number[]} array Array of strings or numbers to dedupe.","@return {Array} Copy of _array_ containing no duplicate values.","@static","@since 3.4.0","**/","YArray.dedupe = Lang._isNative(Object.create) ? function (array) {"," var hash = Object.create(null),"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hash[item]) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","} : function (array) {"," var hash = {},"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hasOwn.call(hash, item)) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. This method wraps","the native ES5 `Array.forEach()` method if available.","","@method each","@param {Array} array Array to iterate.","@param {Function} fn Function to execute on each item in the array. The function"," will receive the following arguments:"," @param {Any} fn.item Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {YUI} The YUI instance.","@static","**/","YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {"," Native.forEach.call(array || [], fn, thisObj || Y);"," return Y;","} : function (array, fn, thisObj) {"," for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {"," if (i in array) {"," fn.call(thisObj || Y, array[i], i, array);"," }"," }",""," return Y;","};","","/**","Alias for `each()`.","","@method forEach","@static","**/","","/**","Returns an object using the first array as keys and the second as values. If","the second array is not provided, or if it doesn't contain the same number of","values as the first array, then `true` will be used in place of the missing","values.","","@example",""," Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);"," // => {a: 'foo', b: 'bar', c: true}","","@method hash","@param {String[]} keys Array of strings to use as keys.","@param {Array} [values] Array to use as values.","@return {Object} Hash using the first array as keys and the second as values.","@static","**/","YArray.hash = function (keys, values) {"," var hash = {},"," vlen = (values && values.length) || 0,"," i, len;",""," for (i = 0, len = keys.length; i < len; ++i) {"," if (i in keys) {"," hash[keys[i]] = vlen > i && i in values ? values[i] : true;"," }"," }",""," return hash;","};","","/**","Returns the index of the first item in the array that's equal (using a strict","equality check) to the specified _value_, or `-1` if the value isn't found.","","This method wraps the native ES5 `Array.indexOf()` method if available.","","@method indexOf","@param {Array} array Array to search.","@param {Any} value Value to search for.","@param {Number} [from=0] The index at which to begin the search.","@return {Number} Index of the item strictly equal to _value_, or `-1` if not"," found.","@static","**/","YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {"," return Native.indexOf.call(array, value, from);","} : function (array, value, from) {"," // http://es5.github.com/#x15.4.4.14"," var len = array.length;",""," from = +from || 0;"," from = (from > 0 || -1) * Math.floor(Math.abs(from));",""," if (from < 0) {"," from += len;",""," if (from < 0) {"," from = 0;"," }"," }",""," for (; from < len; ++from) {"," if (from in array && array[from] === value) {"," return from;"," }"," }",""," return -1;","};","","/**","Numeric sort convenience function.","","The native `Array.prototype.sort()` function converts values to strings and","sorts them in lexicographic order, which is unsuitable for sorting numeric","values. Provide `Array.numericSort` as a custom sort function when you want","to sort values in numeric order.","","@example",""," [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);"," // => [4, 8, 15, 16, 23, 42]","","@method numericSort","@param {Number} a First value to compare.","@param {Number} b Second value to compare.","@return {Number} Difference between _a_ and _b_.","@static","**/","YArray.numericSort = function (a, b) {"," return a - b;","};","","/**","Executes the supplied function on each item in the array. Returning a truthy","value from the function will stop the processing of remaining items.","","@method some","@param {Array} array Array to iterate over.","@param {Function} fn Function to execute on each item. The function will receive"," the following arguments:"," @param {Any} fn.value Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated over.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {Boolean} `true` if the function returns a truthy value on any of the"," items in the array; `false` otherwise.","@static","**/","YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {"," return Native.some.call(array, fn, thisObj);","} : function (array, fn, thisObj) {"," for (var i = 0, len = array.length; i < len; ++i) {"," if (i in array && fn.call(thisObj, array[i], i, array)) {"," return true;"," }"," }",""," return false;","};","","/**","Evaluates _obj_ to determine if it's an array, an array-like collection, or","something else. This is useful when working with the function `arguments`","collection and `HTMLElement` collections.","","Note: This implementation doesn't consider elements that are also","collections, such as `<form>` and `<select>`, to be array-like.","","@method test","@param {Object} obj Object to test.","@return {Number} A number indicating the results of the test:",""," * 0: Neither an array nor an array-like collection."," * 1: Real array."," * 2: Array-like collection.","","@static","**/","YArray.test = function (obj) {"," var result = 0;",""," if (Lang.isArray(obj)) {"," result = 1;"," } else if (Lang.isObject(obj)) {"," try {"," // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here),"," // or functions without apply/call (Safari"," // HTMLElementCollection bug)."," if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) {"," result = 2;"," }"," } catch (ex) {}"," }",""," return result;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * A simple FIFO queue. Items are added to the Queue with add(1..n items) and"," * removed using next()."," *"," * @class Queue"," * @constructor"," * @param {MIXED} item* 0..n items to seed the queue."," */","function Queue() {"," this._init();"," this.add.apply(this, arguments);","}","","Queue.prototype = {"," /**"," * Initialize the queue"," *"," * @method _init"," * @protected"," */"," _init: function() {"," /**"," * The collection of enqueued items"," *"," * @property _q"," * @type Array"," * @protected"," */"," this._q = [];"," },",""," /**"," * Get the next item in the queue. FIFO support"," *"," * @method next"," * @return {MIXED} the next item in the queue."," */"," next: function() {"," return this._q.shift();"," },",""," /**"," * Get the last in the queue. LIFO support."," *"," * @method last"," * @return {MIXED} the last item in the queue."," */"," last: function() {"," return this._q.pop();"," },",""," /**"," * Add 0..n items to the end of the queue."," *"," * @method add"," * @param {MIXED} item* 0..n items."," * @return {object} this queue."," */"," add: function() {"," this._q.push.apply(this._q, arguments);",""," return this;"," },",""," /**"," * Returns the current number of queued items."," *"," * @method size"," * @return {Number} The size."," */"," size: function() {"," return this._q.length;"," }","};","","Y.Queue = Queue;","","YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();","","/**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@submodule yui-base","**/","","var CACHED_DELIMITER = '__',",""," hasOwn = Object.prototype.hasOwnProperty,"," isObject = Y.Lang.isObject;","","/**","Returns a wrapper for a function which caches the return value of that function,","keyed off of the combined string representation of the argument values provided","when the wrapper is called.","","Calling this function again with the same arguments will return the cached value","rather than executing the wrapped function.","","Note that since the cache is keyed off of the string representation of arguments","passed to the wrapper function, arguments that aren't strings and don't provide","a meaningful `toString()` method may result in unexpected caching behavior. For","example, the objects `{}` and `{foo: 'bar'}` would both be converted to the","string `[object Object]` when used as a cache key.","","@method cached","@param {Function} source The function to memoize.","@param {Object} [cache={}] Object in which to store cached values. You may seed"," this object with pre-existing cached values if desired.","@param {any} [refetch] If supplied, this value is compared with the cached value"," using a `==` comparison. If the values are equal, the wrapped function is"," executed again even though a cached value exists.","@return {Function} Wrapped function.","@for YUI","**/","Y.cached = function (source, cache, refetch) {"," /*jshint expr: true*/"," cache || (cache = {});",""," return function (arg) {"," var key = arguments.length > 1 ?"," Array.prototype.join.call(arguments, CACHED_DELIMITER) :"," String(arg);",""," /*jshint eqeqeq: false*/"," if (!(key in cache) || (refetch && cache[key] == refetch)) {"," cache[key] = source.apply(source, arguments);"," }",""," return cache[key];"," };","};","","/**","Returns the `location` object from the window/frame in which this YUI instance","operates, or `undefined` when executing in a non-browser environment","(e.g. Node.js).","","It is _not_ recommended to hold references to the `window.location` object","outside of the scope of a function in which its properties are being accessed or","its methods are being called. This is because of a nasty bug/issue that exists","in both Safari and MobileSafari browsers:","[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).","","@method getLocation","@return {location} The `location` object from the window/frame in which this YUI"," instance operates.","@since 3.5.0","**/","Y.getLocation = function () {"," // It is safer to look this up every time because yui-base is attached to a"," // YUI instance before a user's config is applied; i.e. `Y.config.win` does"," // not point the correct window object when this file is loaded."," var win = Y.config.win;",""," // It is not safe to hold a reference to the `location` object outside the"," // scope in which it is being used. The WebKit engine used in Safari and"," // MobileSafari will \"disconnect\" the `location` object from the `window`"," // when a page is restored from back/forward history cache."," return win && win.location;","};","","/**","Returns a new object containing all of the properties of all the supplied","objects. The properties from later objects will overwrite those in earlier","objects.","","Passing in a single object will create a shallow copy of it. For a deep copy,","use `clone()`.","","@method merge","@param {Object} objects* One or more objects to merge.","@return {Object} A new merged object.","**/","Y.merge = function () {"," var i = 0,"," len = arguments.length,"," result = {},"," key,"," obj;",""," for (; i < len; ++i) {"," obj = arguments[i];",""," for (key in obj) {"," if (hasOwn.call(obj, key)) {"," result[key] = obj[key];"," }"," }"," }",""," return result;","};","","/**","Mixes _supplier_'s properties into _receiver_.","","Properties on _receiver_ or _receiver_'s prototype will not be overwritten or","shadowed unless the _overwrite_ parameter is `true`, and will not be merged","unless the _merge_ parameter is `true`.","","In the default mode (0), only properties the supplier owns are copied (prototype","properties are not copied). The following copying modes are available:",""," * `0`: _Default_. Object to object."," * `1`: Prototype to prototype."," * `2`: Prototype to prototype and object to object."," * `3`: Prototype to object."," * `4`: Object to prototype.","","@method mix","@param {Function|Object} receiver The object or function to receive the mixed"," properties.","@param {Function|Object} supplier The object or function supplying the"," properties to be mixed.","@param {Boolean} [overwrite=false] If `true`, properties that already exist"," on the receiver will be overwritten with properties from the supplier.","@param {String[]} [whitelist] An array of property names to copy. If"," specified, only the whitelisted properties will be copied, and all others"," will be ignored.","@param {Number} [mode=0] Mix mode to use. See above for available modes.","@param {Boolean} [merge=false] If `true`, objects and arrays that already"," exist on the receiver will have the corresponding object/array from the"," supplier merged into them, rather than being skipped or overwritten. When"," both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.","@return {Function|Object|YUI} The receiver, or the YUI instance if the"," specified receiver is falsy.","**/","Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {"," var alwaysOverwrite, exists, from, i, key, len, to;",""," // If no supplier is given, we return the receiver. If no receiver is given,"," // we return Y. Returning Y doesn't make much sense to me, but it's"," // grandfathered in for backcompat reasons."," if (!receiver || !supplier) {"," return receiver || Y;"," }",""," if (mode) {"," // In mode 2 (prototype to prototype and object to object), we recurse"," // once to do the proto to proto mix. The object to object mix will be"," // handled later on."," if (mode === 2) {"," Y.mix(receiver.prototype, supplier.prototype, overwrite,"," whitelist, 0, merge);"," }",""," // Depending on which mode is specified, we may be copying from or to"," // the prototypes of the supplier and receiver."," from = mode === 1 || mode === 3 ? supplier.prototype : supplier;"," to = mode === 1 || mode === 4 ? receiver.prototype : receiver;",""," // If either the supplier or receiver doesn't actually have a"," // prototype property, then we could end up with an undefined `from`"," // or `to`. If that happens, we abort and return the receiver."," if (!from || !to) {"," return receiver;"," }"," } else {"," from = supplier;"," to = receiver;"," }",""," // If `overwrite` is truthy and `merge` is falsy, then we can skip a"," // property existence check on each iteration and save some time."," alwaysOverwrite = overwrite && !merge;",""," if (whitelist) {"," for (i = 0, len = whitelist.length; i < len; ++i) {"," key = whitelist[i];",""," // We call `Object.prototype.hasOwnProperty` instead of calling"," // `hasOwnProperty` on the object itself, since the object's"," // `hasOwnProperty` method may have been overridden or removed."," // Also, some native objects don't implement a `hasOwnProperty`"," // method."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," // If we're in merge mode, and the key is present on both"," // objects, and the value on both objects is either an object or"," // an array (but not a function), then we recurse to merge the"," // `from` value into the `to` value instead of overwriting it."," //"," // Note: It's intentional that the whitelist isn't passed to the"," // recursive call here. This is legacy behavior that lots of"," // code still depends on."," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," // We're not in merge mode, so we'll only copy the `from` value"," // to the `to` value if we're in overwrite mode or if the"," // current key doesn't exist on the `to` object."," to[key] = from[key];"," }"," }"," } else {"," for (key in from) {"," // The code duplication here is for runtime performance reasons."," // Combining whitelist and non-whitelist operations into a single"," // loop or breaking the shared logic out into a function both result"," // in worse performance, and Y.mix is critical enough that the byte"," // tradeoff is worth it."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," to[key] = from[key];"," }"," }",""," // If this is an IE browser with the JScript enumeration bug, force"," // enumeration of the buggy properties by making a recursive call with"," // the buggy properties as the whitelist."," if (Y.Object._hasEnumBug) {"," Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);"," }"," }",""," return receiver;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Adds utilities to the YUI instance for working with objects."," *"," * @class Object"," */","","var Lang = Y.Lang,"," hasOwn = Object.prototype.hasOwnProperty,",""," UNDEFINED, // <-- Note the comma. We're still declaring vars.","","/**"," * Returns a new object that uses _obj_ as its prototype. This method wraps the"," * native ES5 `Object.create()` method if available, but doesn't currently"," * pass through `Object.create()`'s second argument (properties) in order to"," * ensure compatibility with older browsers."," *"," * @method ()"," * @param {Object} obj Prototype object."," * @return {Object} New object using _obj_ as its prototype."," * @static"," */","O = Y.Object = Lang._isNative(Object.create) ? function (obj) {"," // We currently wrap the native Object.create instead of simply aliasing it"," // to ensure consistency with our fallback shim, which currently doesn't"," // support Object.create()'s second argument (properties). Once we have a"," // safe fallback for the properties arg, we can stop wrapping"," // Object.create()."," return Object.create(obj);","} : (function () {"," // Reusable constructor function for the Object.create() shim."," function F() {}",""," // The actual shim."," return function (obj) {"," F.prototype = obj;"," return new F();"," };","}()),","","/**"," * Property names that IE doesn't enumerate in for..in loops, even when they"," * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to"," * manually enumerate these properties."," *"," * @property _forceEnum"," * @type String[]"," * @protected"," * @static"," */","forceEnum = O._forceEnum = ["," 'hasOwnProperty',"," 'isPrototypeOf',"," 'propertyIsEnumerable',"," 'toString',"," 'toLocaleString',"," 'valueOf'","],","","/**"," * `true` if this browser has the JScript enumeration bug that prevents"," * enumeration of the properties named in the `_forceEnum` array, `false`"," * otherwise."," *"," * See:"," * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>"," * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>"," *"," * @property _hasEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),","","/**"," * `true` if this browser incorrectly considers the `prototype` property of"," * functions to be enumerable. Currently known to affect Opera 11.50 and Android 2.3.x."," *"," * @property _hasProtoEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),","","/**"," * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or"," * exists only on _obj_'s prototype. This is essentially a safer version of"," * `obj.hasOwnProperty()`."," *"," * @method owns"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","owns = O.owns = function (obj, key) {"," return !!obj && hasOwn.call(obj, key);","}; // <-- End of var declarations.","","/**"," * Alias for `owns()`."," *"," * @method hasKey"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","O.hasKey = owns;","","/**"," * Returns an array containing the object's enumerable keys. Does not include"," * prototype keys or non-enumerable keys."," *"," * Note that keys are returned in enumeration order (that is, in the same order"," * that they would be enumerated by a `for-in` loop), which may not be the same"," * as the order in which they were defined."," *"," * This method is an alias for the native ES5 `Object.keys()` method if"," * available and non-buggy. The Opera 11.50 and Android 2.3.x versions of"," * `Object.keys()` have an inconsistency as they consider `prototype` to be"," * enumerable, so a non-native shim is used to rectify the difference."," *"," * @example"," *"," * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['a', 'b', 'c']"," *"," * @method keys"," * @param {Object} obj An object."," * @return {String[]} Array of keys."," * @static"," */","O.keys = Lang._isNative(Object.keys) && !hasProtoEnumBug ? Object.keys : function (obj) {"," if (!Lang.isObject(obj)) {"," throw new TypeError('Object.keys called on a non-object');"," }",""," var keys = [],"," i, key, len;",""," if (hasProtoEnumBug && typeof obj === 'function') {"," for (key in obj) {"," if (owns(obj, key) && key !== 'prototype') {"," keys.push(key);"," }"," }"," } else {"," for (key in obj) {"," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," if (hasEnumBug) {"," for (i = 0, len = forceEnum.length; i < len; ++i) {"," key = forceEnum[i];",""," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," return keys;","};","","/**"," * Returns an array containing the values of the object's enumerable keys."," *"," * Note that values are returned in enumeration order (that is, in the same"," * order that they would be enumerated by a `for-in` loop), which may not be the"," * same as the order in which they were defined."," *"," * @example"," *"," * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['foo', 'bar', 'baz']"," *"," * @method values"," * @param {Object} obj An object."," * @return {Array} Array of values."," * @static"," */","O.values = function (obj) {"," var keys = O.keys(obj),"," i = 0,"," len = keys.length,"," values = [];",""," for (; i < len; ++i) {"," values.push(obj[keys[i]]);"," }",""," return values;","};","","/**"," * Returns the number of enumerable keys owned by an object."," *"," * @method size"," * @param {Object} obj An object."," * @return {Number} The object's size."," * @static"," */","O.size = function (obj) {"," try {"," return O.keys(obj).length;"," } catch (ex) {"," return 0; // Legacy behavior for non-objects."," }","};","","/**"," * Returns `true` if the object owns an enumerable property with the specified"," * value."," *"," * @method hasValue"," * @param {Object} obj An object."," * @param {any} value The value to search for."," * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise."," * @static"," */","O.hasValue = function (obj, value) {"," return Y.Array.indexOf(O.values(obj), value) > -1;","};","","/**"," * Executes a function on each enumerable property in _obj_. The function"," * receives the value, the key, and the object itself as parameters (in that"," * order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method each"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {YUI} the YUI instance."," * @chainable"," * @static"," */","O.each = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," fn.call(thisObj || Y, obj[key], key, obj);"," }"," }",""," return Y;","};","","/**"," * Executes a function on each enumerable property in _obj_, but halts if the"," * function returns a truthy value. The function receives the value, the key,"," * and the object itself as paramters (in that order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method some"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,"," * `false` otherwise."," * @static"," */","O.some = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," if (fn.call(thisObj || Y, obj[key], key, obj)) {"," return true;"," }"," }"," }",""," return false;","};","","/**"," * Retrieves the sub value at the provided path,"," * from the value object provided."," *"," * @method getValue"," * @static"," * @param o The object from which to extract the property value."," * @param path {Array} A path array, specifying the object traversal path"," * from which to obtain the sub value."," * @return {Any} The value stored in the path, undefined if not found,"," * undefined if the source is not an object. Returns the source object"," * if an empty path is provided."," */","O.getValue = function(o, path) {"," if (!Lang.isObject(o)) {"," return UNDEFINED;"," }",""," var i,"," p = Y.Array(path),"," l = p.length;",""," for (i = 0; o !== UNDEFINED && i < l; i++) {"," o = o[p[i]];"," }",""," return o;","};","","/**"," * Sets the sub-attribute value at the provided path on the"," * value object. Returns the modified value object, or"," * undefined if the path is invalid."," *"," * @method setValue"," * @static"," * @param o The object on which to set the sub value."," * @param path {Array} A path array, specifying the object traversal path"," * at which to set the sub value."," * @param val {Any} The new value for the sub-attribute."," * @return {Object} The modified object, with the new sub value set, or"," * undefined, if the path was invalid."," */","O.setValue = function(o, path, val) {"," var i,"," p = Y.Array(path),"," leafIdx = p.length - 1,"," ref = o;",""," if (leafIdx >= 0) {"," for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {"," ref = ref[p[i]];"," }",""," if (ref !== UNDEFINED) {"," ref[p[i]] = val;"," } else {"," return UNDEFINED;"," }"," }",""," return o;","};","","/**"," * Returns `true` if the object has no enumerable properties of its own."," *"," * @method isEmpty"," * @param {Object} obj An object."," * @return {Boolean} `true` if the object is empty."," * @static"," * @since 3.2.0"," */","O.isEmpty = function (obj) {"," return !O.keys(Object(obj)).length;","};","/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and the"," * core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * YUI user agent detection."," * Do not fork for a browser if it can be avoided. Use feature detection when"," * you can. Use the user agent as a last resort. For all fields listed"," * as @type float, UA stores a version number for the browser engine,"," * 0 otherwise. This value may or may not map to the version number of"," * the browser using the engine. The value is presented as a float so"," * that it can easily be used for boolean evaluation as well as for"," * looking for a particular range of versions. Because of this,"," * some of the granularity of the version info may be lost. The fields that"," * are @type string default to null. The API docs list the values that"," * these fields can have."," * @class UA"," * @static"," */","","/**","* Static method on `YUI.Env` for parsing a UA string. Called at instantiation","* to populate `Y.UA`.","*","* @static","* @method parseUA","* @param {String} [subUA=navigator.userAgent] UA string to parse","* @return {Object} The Y.UA object","*/","YUI.Env.parseUA = function(subUA) {",""," var numberify = function(s) {"," var c = 0;"," return parseFloat(s.replace(/\\./g, function() {"," return (c++ === 1) ? '' : '.';"," }));"," },",""," win = Y.config.win,",""," nav = win && win.navigator,",""," o = {",""," /**"," * Internet Explorer version number or 0. Example: 6"," * @property ie"," * @type float"," * @static"," */"," ie: 0,",""," /**"," * Opera version number or 0. Example: 9.2"," * @property opera"," * @type float"," * @static"," */"," opera: 0,",""," /**"," * Gecko engine revision number. Will evaluate to 1 if Gecko"," * is detected but the revision could not be found. Other browsers"," * will be 0. Example: 1.8"," * <pre>"," * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7"," * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8"," * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81"," * Firefox 3.0 <-- 1.9"," * Firefox 3.5 <-- 1.91"," * </pre>"," * @property gecko"," * @type float"," * @static"," */"," gecko: 0,",""," /**"," * AppleWebKit version. KHTML browsers that are not WebKit browsers"," * will evaluate to 1, other browsers 0. Example: 418.9"," * <pre>"," * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the"," * latest available for Mac OSX 10.3."," * Safari 2.0.2: 416 <-- hasOwnProperty introduced"," * Safari 2.0.4: 418 <-- preventDefault fixed"," * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run"," * different versions of webkit"," * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been"," * updated, but not updated"," * to the latest patch."," * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native"," * SVG and many major issues fixed)."," * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic"," * update from 2.x via the 10.4.11 OS patch."," * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event."," * yahoo.com user agent hack removed."," * </pre>"," * http://en.wikipedia.org/wiki/Safari_version_history"," * @property webkit"," * @type float"," * @static"," */"," webkit: 0,",""," /**"," * Safari will be detected as webkit, but this property will also"," * be populated with the Safari version number"," * @property safari"," * @type float"," * @static"," */"," safari: 0,",""," /**"," * Chrome will be detected as webkit, but this property will also"," * be populated with the Chrome version number"," * @property chrome"," * @type float"," * @static"," */"," chrome: 0,",""," /**"," * The mobile property will be set to a string containing any relevant"," * user agent information when a modern mobile browser is detected."," * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series"," * devices with the WebKit-based browser, and Opera Mini."," * @property mobile"," * @type string"," * @default null"," * @static"," */"," mobile: null,",""," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * PhantomJS version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property phantomjs"," * @type float"," */"," phantomjs: 0,"," /**"," * Detects Apple iPad's OS version"," * @property ipad"," * @type float"," * @static"," */"," ipad: 0,"," /**"," * Detects Apple iPhone's OS version"," * @property iphone"," * @type float"," * @static"," */"," iphone: 0,"," /**"," * Detects Apples iPod's OS version"," * @property ipod"," * @type float"," * @static"," */"," ipod: 0,"," /**"," * General truthy check for iPad, iPhone or iPod"," * @property ios"," * @type Boolean"," * @default null"," * @static"," */"," ios: null,"," /**"," * Detects Googles Android OS version"," * @property android"," * @type float"," * @static"," */"," android: 0,"," /**"," * Detects Kindle Silk"," * @property silk"," * @type float"," * @static"," */"," silk: 0,"," /**"," * Detects Kindle Silk Acceleration"," * @property accel"," * @type Boolean"," * @static"," */"," accel: false,"," /**"," * Detects Palms WebOS version"," * @property webos"," * @type float"," * @static"," */"," webos: 0,",""," /**"," * Google Caja version number or 0."," * @property caja"," * @type float"," */"," caja: nav && nav.cajaVersion,",""," /**"," * Set to true if the page appears to be in SSL"," * @property secure"," * @type boolean"," * @static"," */"," secure: false,",""," /**"," * The operating system. Currently only detecting windows or macintosh"," * @property os"," * @type string"," * @default null"," * @static"," */"," os: null,",""," /**"," * The Nodejs Version"," * @property nodejs"," * @type float"," * @default 0"," * @static"," */"," nodejs: 0,"," /**"," * Window8/IE10 Application host environment"," * @property winjs"," * @type Boolean"," * @static"," */"," winjs: !!((typeof Windows !== \"undefined\") && Windows.System),"," /**"," * Are touch/msPointer events available on this device"," * @property touchEnabled"," * @type Boolean"," * @static"," */"," touchEnabled: false"," },",""," ua = subUA || nav && nav.userAgent,",""," loc = win && win.location,",""," href = loc && loc.href,",""," m;",""," /**"," * The User Agent string that was parsed"," * @property userAgent"," * @type String"," * @static"," */"," o.userAgent = ua;","",""," o.secure = href && (href.toLowerCase().indexOf('https') === 0);",""," if (ua) {",""," if ((/windows|win32/i).test(ua)) {"," o.os = 'windows';"," } else if ((/macintosh|mac_powerpc/i).test(ua)) {"," o.os = 'macintosh';"," } else if ((/android/i).test(ua)) {"," o.os = 'android';"," } else if ((/symbos/i).test(ua)) {"," o.os = 'symbos';"," } else if ((/linux/i).test(ua)) {"," o.os = 'linux';"," } else if ((/rhino/i).test(ua)) {"," o.os = 'rhino';"," }",""," // Modern KHTML browsers should qualify as Safari X-Grade"," if ((/KHTML/).test(ua)) {"," o.webkit = 1;"," }"," if ((/IEMobile|XBLWP7/).test(ua)) {"," o.mobile = 'windows';"," }"," if ((/Fennec/).test(ua)) {"," o.mobile = 'gecko';"," }"," // Modern WebKit browsers are at least X-Grade"," m = ua.match(/AppleWebKit\\/([^\\s]*)/);"," if (m && m[1]) {"," o.webkit = numberify(m[1]);"," o.safari = o.webkit;",""," if (/PhantomJS/.test(ua)) {"," m = ua.match(/PhantomJS\\/([^\\s]*)/);"," if (m && m[1]) {"," o.phantomjs = numberify(m[1]);"," }"," }",""," // Mobile browser check"," if (/ Mobile\\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {"," o.mobile = 'Apple'; // iPhone or iPod Touch",""," m = ua.match(/OS ([^\\s]*)/);"," if (m && m[1]) {"," m = numberify(m[1].replace('_', '.'));"," }"," o.ios = m;"," o.os = 'ios';"," o.ipad = o.ipod = o.iphone = 0;",""," m = ua.match(/iPad|iPod|iPhone/);"," if (m && m[0]) {"," o[m[0].toLowerCase()] = o.ios;"," }"," } else {"," m = ua.match(/NokiaN[^\\/]*|webOS\\/\\d\\.\\d/);"," if (m) {"," // Nokia N-series, webOS, ex: NokiaN95"," o.mobile = m[0];"," }"," if (/webOS/.test(ua)) {"," o.mobile = 'WebOS';"," m = ua.match(/webOS\\/([^\\s]*);/);"," if (m && m[1]) {"," o.webos = numberify(m[1]);"," }"," }"," if (/ Android/.test(ua)) {"," if (/Mobile/.test(ua)) {"," o.mobile = 'Android';"," }"," m = ua.match(/Android ([^\\s]*);/);"," if (m && m[1]) {"," o.android = numberify(m[1]);"," }",""," }"," if (/Silk/.test(ua)) {"," m = ua.match(/Silk\\/([^\\s]*)/);"," if (m && m[1]) {"," o.silk = numberify(m[1]);"," }"," if (!o.android) {"," o.android = 2.34; //Hack for desktop mode in Kindle"," o.os = 'Android';"," }"," if (/Accelerated=true/.test(ua)) {"," o.accel = true;"," }"," }"," }",""," m = ua.match(/OPR\\/(\\d+\\.\\d+)/);",""," if (m && m[1]) {"," // Opera 15+ with Blink (pretends to be both Chrome and Safari)"," o.opera = numberify(m[1]);"," } else {"," m = ua.match(/(Chrome|CrMo|CriOS)\\/([^\\s]*)/);",""," if (m && m[1] && m[2]) {"," o.chrome = numberify(m[2]); // Chrome"," o.safari = 0; //Reset safari back to 0"," if (m[1] === 'CrMo') {"," o.mobile = 'chrome';"," }"," } else {"," m = ua.match(/AdobeAIR\\/([^\\s]*)/);"," if (m) {"," o.air = m[0]; // Adobe AIR 1.0 or better"," }"," }"," }"," }",""," if (!o.webkit) { // not webkit","// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)"," if (/Opera/.test(ua)) {"," m = ua.match(/Opera[\\s\\/]([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," m = ua.match(/Version\\/([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]); // opera 10+"," }",""," if (/Opera Mobi/.test(ua)) {"," o.mobile = 'opera';"," m = ua.replace('Opera Mobi', '').match(/Opera ([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," }"," m = ua.match(/Opera Mini[^;]*/);",""," if (m) {"," o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316"," }"," } else { // not opera or webkit"," m = ua.match(/MSIE ([^;]*)|Trident.*; rv:([0-9.]+)/);",""," if (m && (m[1] || m[2])) {"," o.ie = numberify(m[1] || m[2]);"," } else { // not opera, webkit, or ie"," m = ua.match(/Gecko\\/([^\\s]*)/);",""," if (m) {"," o.gecko = 1; // Gecko detected, look for revision"," m = ua.match(/rv:([^\\s\\)]*)/);"," if (m && m[1]) {"," o.gecko = numberify(m[1]);"," if (/Mobile|Tablet/.test(ua)) {"," o.mobile = \"ffos\";"," }"," }"," }"," }"," }"," }"," }",""," //Check for known properties to tell if touch events are enabled on this device or if"," //the number of MSPointer touchpoints on this device is greater than 0."," if (win && nav && !(o.chrome && o.chrome < 6)) {"," o.touchEnabled = ((\"ontouchstart\" in win) || ((\"msMaxTouchPoints\" in nav) && (nav.msMaxTouchPoints > 0)));"," }",""," //It was a parsed UA, do not assign the global value."," if (!subUA) {",""," if (typeof process === 'object') {",""," if (process.versions && process.versions.node) {"," //NodeJS"," o.os = process.platform;"," o.nodejs = numberify(process.versions.node);"," }"," }",""," YUI.Env.UA = o;",""," }",""," return o;","};","","","Y.UA = YUI.Env.UA || YUI.Env.parseUA();","","/**","Performs a simple comparison between two version numbers, accounting for","standard versioning logic such as the fact that \"535.8\" is a lower version than","\"535.24\", even though a simple numerical comparison would indicate that it's","greater. Also accounts for cases such as \"1.1\" vs. \"1.1.0\", which are","considered equivalent.","","Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,","1 if _a_ is higher than _b_.","","Versions may be numbers or strings containing numbers and dots. For example,","both `535` and `\"535.8.10\"` are acceptable. A version string containing","non-numeric characters, like `\"535.8.beta\"`, may produce unexpected results.","","@method compareVersions","@param {Number|String} a First version number to compare.","@param {Number|String} b Second version number to compare.","@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is"," higher than _b_.","**/","Y.UA.compareVersions = function (a, b) {"," var aPart, aParts, bPart, bParts, i, len;",""," if (a === b) {"," return 0;"," }",""," aParts = (a + '').split('.');"," bParts = (b + '').split('.');",""," for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {"," aPart = parseInt(aParts[i], 10);"," bPart = parseInt(bParts[i], 10);",""," /*jshint expr: true*/"," isNaN(aPart) && (aPart = 0);"," isNaN(bPart) && (bPart = 0);",""," if (aPart < bPart) {"," return -1;"," }",""," if (aPart > bPart) {"," return 1;"," }"," }",""," return 0;","};","YUI.Env.aliases = {"," \"anim\": [\"anim-base\",\"anim-color\",\"anim-curve\",\"anim-easing\",\"anim-node-plugin\",\"anim-scroll\",\"anim-xy\"],"," \"anim-shape-transform\": [\"anim-shape\"],"," \"app\": [\"app-base\",\"app-content\",\"app-transitions\",\"lazy-model-list\",\"model\",\"model-list\",\"model-sync-rest\",\"model-sync-local\",\"router\",\"view\",\"view-node-map\"],"," \"attribute\": [\"attribute-base\",\"attribute-complex\"],"," \"attribute-events\": [\"attribute-observable\"],"," \"autocomplete\": [\"autocomplete-base\",\"autocomplete-sources\",\"autocomplete-list\",\"autocomplete-plugin\"],"," \"axes\": [\"axis-numeric\",\"axis-category\",\"axis-time\",\"axis-stacked\"],"," \"axes-base\": [\"axis-numeric-base\",\"axis-category-base\",\"axis-time-base\",\"axis-stacked-base\"],"," \"base\": [\"base-base\",\"base-pluginhost\",\"base-build\"],"," \"cache\": [\"cache-base\",\"cache-offline\",\"cache-plugin\"],"," \"charts\": [\"charts-base\"],"," \"collection\": [\"array-extras\",\"arraylist\",\"arraylist-add\",\"arraylist-filter\",\"array-invoke\"],"," \"color\": [\"color-base\",\"color-hsl\",\"color-harmony\"],"," \"controller\": [\"router\"],"," \"dataschema\": [\"dataschema-base\",\"dataschema-json\",\"dataschema-xml\",\"dataschema-array\",\"dataschema-text\"],"," \"datasource\": [\"datasource-local\",\"datasource-io\",\"datasource-get\",\"datasource-function\",\"datasource-cache\",\"datasource-jsonschema\",\"datasource-xmlschema\",\"datasource-arrayschema\",\"datasource-textschema\",\"datasource-polling\"],"," \"datatable\": [\"datatable-core\",\"datatable-table\",\"datatable-head\",\"datatable-body\",\"datatable-base\",\"datatable-column-widths\",\"datatable-message\",\"datatable-mutable\",\"datatable-sort\",\"datatable-datasource\"],"," \"datatype\": [\"datatype-date\",\"datatype-number\",\"datatype-xml\"],"," \"datatype-date\": [\"datatype-date-parse\",\"datatype-date-format\",\"datatype-date-math\"],"," \"datatype-number\": [\"datatype-number-parse\",\"datatype-number-format\"],"," \"datatype-xml\": [\"datatype-xml-parse\",\"datatype-xml-format\"],"," \"dd\": [\"dd-ddm-base\",\"dd-ddm\",\"dd-ddm-drop\",\"dd-drag\",\"dd-proxy\",\"dd-constrain\",\"dd-drop\",\"dd-scroll\",\"dd-delegate\"],"," \"dom\": [\"dom-base\",\"dom-screen\",\"dom-style\",\"selector-native\",\"selector\"],"," \"editor\": [\"frame\",\"editor-selection\",\"exec-command\",\"editor-base\",\"editor-para\",\"editor-br\",\"editor-bidi\",\"editor-tab\",\"createlink-base\"],"," \"event\": [\"event-base\",\"event-delegate\",\"event-synthetic\",\"event-mousewheel\",\"event-mouseenter\",\"event-key\",\"event-focus\",\"event-resize\",\"event-hover\",\"event-outside\",\"event-touch\",\"event-move\",\"event-flick\",\"event-valuechange\",\"event-tap\"],"," \"event-custom\": [\"event-custom-base\",\"event-custom-complex\"],"," \"event-gestures\": [\"event-flick\",\"event-move\"],"," \"handlebars\": [\"handlebars-compiler\"],"," \"highlight\": [\"highlight-base\",\"highlight-accentfold\"],"," \"history\": [\"history-base\",\"history-hash\",\"history-html5\"],"," \"io\": [\"io-base\",\"io-xdr\",\"io-form\",\"io-upload-iframe\",\"io-queue\"],"," \"json\": [\"json-parse\",\"json-stringify\"],"," \"loader\": [\"loader-base\",\"loader-rollup\",\"loader-yui3\"],"," \"node\": [\"node-base\",\"node-event-delegate\",\"node-pluginhost\",\"node-screen\",\"node-style\"],"," \"pluginhost\": [\"pluginhost-base\",\"pluginhost-config\"],"," \"querystring\": [\"querystring-parse\",\"querystring-stringify\"],"," \"recordset\": [\"recordset-base\",\"recordset-sort\",\"recordset-filter\",\"recordset-indexer\"],"," \"resize\": [\"resize-base\",\"resize-proxy\",\"resize-constrain\"],"," \"slider\": [\"slider-base\",\"slider-value-range\",\"clickable-rail\",\"range-slider\"],"," \"template\": [\"template-base\",\"template-micro\"],"," \"text\": [\"text-accentfold\",\"text-wordbreak\"],"," \"widget\": [\"widget-base\",\"widget-htmlparser\",\"widget-skin\",\"widget-uievents\"]","};","","","}, '3.16.0', {"," \"use\": ["," \"yui-base\","," \"get\","," \"features\","," \"intl-base\","," \"yui-log\","," \"yui-log-nodejs\","," \"yui-later\","," \"loader-base\","," \"loader-rollup\","," \"loader-yui3\""," ]","});","","}());"]}; } var __cov_gn$ukBWAoNv3EfKmD$sSEQ = __coverage__['build/yui-nodejs/yui-nodejs.js']; __cov_gn$ukBWAoNv3EfKmD$sSEQ.s['1']++;if(typeof YUI!='undefined'){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['1'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['2']++;YUI._YUI=YUI;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['1'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['3']++;var YUI=function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['1']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['4']++;var i=0,Y=this,args=arguments,l=args.length,instanceOf=function(o,type){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['2']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['5']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['2'][0]++,o)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['2'][1]++,o.hasOwnProperty)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['2'][2]++,o instanceof type);},gconf=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['3'][0]++,typeof YUI_config!=='undefined')&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['3'][1]++,YUI_config);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['6']++;if(!instanceOf(Y,YUI)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['4'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['7']++;Y=new YUI();}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['4'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['8']++;Y._init();__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['9']++;if(YUI.GlobalConfig){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['5'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['10']++;Y.applyConfig(YUI.GlobalConfig);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['5'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['11']++;if(gconf){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['6'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['12']++;Y.applyConfig(gconf);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['6'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['13']++;if(!l){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['7'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['14']++;Y._setup();}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['7'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['15']++;if(l){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['8'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['16']++;for(;i<l;i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['17']++;Y.applyConfig(args[i]);}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['18']++;Y._setup();}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['8'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['19']++;Y.instanceOf=instanceOf;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['20']++;return Y;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['21']++;(function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['3']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['22']++;var proto,prop,VERSION='3.16.0',PERIOD='.',BASE='http://yui.yahooapis.com/',DOC_LABEL='yui3-js-enabled',CSS_STAMP_EL='yui3-css-stamp',NOOP=function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['4']++;},SLICE=Array.prototype.slice,APPLY_TO_AUTH={'io.xdrReady':1,'io.xdrResponse':1,'SWF.eventHandler':1},hasWin=typeof window!='undefined',win=hasWin?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['9'][0]++,window):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['9'][1]++,null),doc=hasWin?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['10'][0]++,win.document):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['10'][1]++,null),docEl=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['11'][0]++,doc)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['11'][1]++,doc.documentElement),docClass=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['12'][0]++,docEl)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['12'][1]++,docEl.className),instances={},time=new Date().getTime(),add=function(el,type,fn,capture){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['5']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['23']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['14'][0]++,el)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['14'][1]++,el.addEventListener)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['13'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['24']++;el.addEventListener(type,fn,capture);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['13'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['25']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['16'][0]++,el)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['16'][1]++,el.attachEvent)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['15'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['26']++;el.attachEvent('on'+type,fn);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['15'][1]++;}}},remove=function(el,type,fn,capture){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['6']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['27']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['18'][0]++,el)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['18'][1]++,el.removeEventListener)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['17'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['28']++;try{__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['29']++;el.removeEventListener(type,fn,capture);}catch(ex){}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['17'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['30']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['20'][0]++,el)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['20'][1]++,el.detachEvent)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['19'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['31']++;el.detachEvent('on'+type,fn);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['19'][1]++;}}},handleReady=function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['7']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['32']++;YUI.Env.DOMReady=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['33']++;if(hasWin){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['21'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['34']++;remove(doc,'DOMContentLoaded',handleReady);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['21'][1]++;}},handleLoad=function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['8']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['35']++;YUI.Env.windowLoaded=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['36']++;YUI.Env.DOMReady=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['37']++;if(hasWin){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['22'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['38']++;remove(window,'load',handleLoad);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['22'][1]++;}},getLoader=function(Y,o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['9']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['39']++;var loader=Y.Env._loader,lCore=['loader-base'],G_ENV=YUI.Env,mods=G_ENV.mods;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['40']++;if(loader){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['23'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['41']++;loader.ignoreRegistered=false;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['42']++;loader.onEnd=null;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['43']++;loader.data=null;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['44']++;loader.required=[];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['45']++;loader.loadType=null;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['23'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['46']++;loader=new Y.Loader(Y.config);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['47']++;Y.Env._loader=loader;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['48']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['25'][0]++,mods)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['25'][1]++,mods.loader)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['24'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['49']++;lCore=[].concat(lCore,YUI.Env.loaderExtras);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['24'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['50']++;YUI.Env.core=Y.Array.dedupe([].concat(YUI.Env.core,lCore));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['51']++;return loader;},clobber=function(r,s){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['10']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['52']++;for(var i in s){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['53']++;if(s.hasOwnProperty(i)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['26'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['54']++;r[i]=s[i];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['26'][1]++;}}},ALREADY_DONE={success:true};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['55']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['28'][0]++,docEl)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['28'][1]++,docClass.indexOf(DOC_LABEL)==-1)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['27'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['56']++;if(docClass){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['29'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['57']++;docClass+=' ';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['29'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['58']++;docClass+=DOC_LABEL;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['59']++;docEl.className=docClass;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['27'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['60']++;if(VERSION.indexOf('@')>-1){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['30'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['61']++;VERSION='3.5.0';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['30'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['62']++;proto={applyConfig:function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['11']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['63']++;o=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['31'][0]++,o)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['31'][1]++,NOOP);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['64']++;var attr,name,config=this.config,mods=config.modules,groups=config.groups,aliases=config.aliases,loader=this.Env._loader;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['65']++;for(name in o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['66']++;if(o.hasOwnProperty(name)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['32'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['67']++;attr=o[name];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['68']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['34'][0]++,mods)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['34'][1]++,name=='modules')){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['33'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['69']++;clobber(mods,attr);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['33'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['70']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['36'][0]++,aliases)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['36'][1]++,name=='aliases')){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['35'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['71']++;clobber(aliases,attr);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['35'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['72']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['38'][0]++,groups)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['38'][1]++,name=='groups')){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['37'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['73']++;clobber(groups,attr);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['37'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['74']++;if(name=='win'){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['39'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['75']++;config[name]=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['40'][0]++,attr)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['40'][1]++,attr.contentWindow)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['40'][2]++,attr);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['76']++;config.doc=config[name]?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['41'][0]++,config[name].document):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['41'][1]++,null);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['39'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['77']++;if(name=='_yuid'){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['42'][0]++;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['42'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['78']++;config[name]=attr;}}}}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['32'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['79']++;if(loader){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['43'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['80']++;loader._config(o);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['43'][1]++;}},_config:function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['12']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['81']++;this.applyConfig(o);},_init:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['13']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['82']++;var filter,el,Y=this,G_ENV=YUI.Env,Env=Y.Env,prop;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['83']++;Y.version=VERSION;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['84']++;if(!Env){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['44'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['85']++;Y.Env={core:['get','features','intl-base','yui-log','yui-log-nodejs','yui-later','loader-base','loader-rollup','loader-yui3'],loaderExtras:['loader-rollup','loader-yui3'],mods:{},versions:{},base:BASE,cdn:BASE+VERSION+'/build/',_idx:0,_used:{},_attached:{},_exported:{},_missed:[],_yidx:0,_uidx:0,_guidp:'y',_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(src,pattern){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['14']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['86']++;var match=src.match(pattern),path,filter;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['87']++;if(match){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['45'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['88']++;path=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['46'][0]++,RegExp.leftContext)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['46'][1]++,src.slice(0,src.indexOf(match[0])));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['89']++;filter=match[3];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['90']++;if(match[1]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['47'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['91']++;path+='?'+match[1];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['47'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['92']++;path={filter:filter,path:path};}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['45'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['93']++;return path;},getBase:(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['48'][0]++,G_ENV)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['48'][1]++,G_ENV.getBase)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['48'][2]++,function(pattern){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['15']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['94']++;var nodes=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['49'][0]++,doc)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['49'][1]++,doc.getElementsByTagName('script'))||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['49'][2]++,[]),path=Env.cdn,parsed,i,len,src;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['95']++;for(i=0,len=nodes.length;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['96']++;src=nodes[i].src;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['97']++;if(src){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['50'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['98']++;parsed=Y.Env.parseBasePath(src,pattern);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['99']++;if(parsed){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['51'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['100']++;filter=parsed.filter;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['101']++;path=parsed.path;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['102']++;break;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['51'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['50'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['103']++;return path;})};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['104']++;Env=Y.Env;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['105']++;Env._loaded[VERSION]={};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['106']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['53'][0]++,G_ENV)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['53'][1]++,Y!==YUI)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['52'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['107']++;Env._yidx=++G_ENV._yidx;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['108']++;Env._guidp=('yui_'+VERSION+'_'+Env._yidx+'_'+time).replace(/[^a-z0-9_]+/g,'_');}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['52'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['109']++;if(YUI._YUI){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['54'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['110']++;G_ENV=YUI._YUI.Env;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['111']++;Env._yidx+=G_ENV._yidx;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['112']++;Env._uidx+=G_ENV._uidx;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['113']++;for(prop in G_ENV){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['114']++;if(!(prop in Env)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['55'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['115']++;Env[prop]=G_ENV[prop];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['55'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['116']++;delete YUI._YUI;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['54'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['117']++;Y.id=Y.stamp(Y);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['118']++;instances[Y.id]=Y;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['44'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['119']++;Y.constructor=YUI;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['120']++;Y.config=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['56'][0]++,Y.config)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['56'][1]++,{bootstrap:true,cacheUse:true,debug:true,doc:doc,fetchCSS:true,throwFail:true,useBrowserConsole:true,useNativeES5:true,win:win,global:Function('return this')()});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['121']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['58'][0]++,doc)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['58'][1]++,!doc.getElementById(CSS_STAMP_EL))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['57'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['122']++;el=doc.createElement('div');__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['123']++;el.innerHTML='<div id="'+CSS_STAMP_EL+'" style="position: absolute !important; visibility: hidden !important"></div>';__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['124']++;YUI.Env.cssStampEl=el.firstChild;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['125']++;if(doc.body){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['59'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['126']++;doc.body.appendChild(YUI.Env.cssStampEl);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['59'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['127']++;docEl.insertBefore(YUI.Env.cssStampEl,docEl.firstChild);}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['57'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['128']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['61'][0]++,doc)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['61'][1]++,doc.getElementById(CSS_STAMP_EL))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['61'][2]++,!YUI.Env.cssStampEl)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['60'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['129']++;YUI.Env.cssStampEl=doc.getElementById(CSS_STAMP_EL);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['60'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['130']++;Y.config.lang=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['62'][0]++,Y.config.lang)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['62'][1]++,'en-US');__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['131']++;Y.config.base=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['63'][0]++,YUI.config.base)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['63'][1]++,Y.Env.getBase(Y.Env._BASE_RE));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['132']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['65'][0]++,!filter)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['65'][1]++,!'mindebug'.indexOf(filter))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['64'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['133']++;filter='min';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['64'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['134']++;filter=filter?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['66'][0]++,'-'+filter):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['66'][1]++,filter);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['135']++;Y.config.loaderPath=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['67'][0]++,YUI.config.loaderPath)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['67'][1]++,'loader/loader'+filter+'.js');},_setup:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['16']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['136']++;var i,Y=this,core=[],mods=YUI.Env.mods,extras=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['68'][0]++,Y.config.core)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['68'][1]++,[].concat(YUI.Env.core));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['137']++;for(i=0;i<extras.length;i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['138']++;if(mods[extras[i]]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['69'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['139']++;core.push(extras[i]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['69'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['140']++;Y._attach(['yui-base']);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['141']++;Y._attach(core);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['142']++;if(Y.Loader){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['70'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['143']++;getLoader(Y);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['70'][1]++;}},applyTo:function(id,method,args){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['17']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['144']++;if(!(method in APPLY_TO_AUTH)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['71'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['145']++;this.log(method+': applyTo not allowed','warn','yui');__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['146']++;return null;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['71'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['147']++;var instance=instances[id],nest,m,i;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['148']++;if(instance){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['72'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['149']++;nest=method.split('.');__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['150']++;m=instance;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['151']++;for(i=0;i<nest.length;i=i+1){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['152']++;m=m[nest[i]];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['153']++;if(!m){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['73'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['154']++;this.log('applyTo not found: '+method,'warn','yui');}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['73'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['155']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['74'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['74'][1]++,m.apply(instance,args));}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['72'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['156']++;return null;},add:function(name,fn,version,details){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['18']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['157']++;details=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['75'][0]++,details)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['75'][1]++,{});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['158']++;var env=YUI.Env,mod={name:name,fn:fn,version:version,details:details},applied={},loader,inst,modInfo,i,versions=env.versions;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['159']++;env.mods[name]=mod;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['160']++;versions[version]=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['76'][0]++,versions[version])||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['76'][1]++,{});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['161']++;versions[version][name]=mod;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['162']++;for(i in instances){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['163']++;if(instances.hasOwnProperty(i)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['77'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['164']++;inst=instances[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['165']++;if(!applied[inst.id]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['78'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['166']++;applied[inst.id]=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['167']++;loader=inst.Env._loader;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['168']++;if(loader){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['79'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['169']++;modInfo=loader.getModuleInfo(name);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['170']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['81'][0]++,!modInfo)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['81'][1]++,modInfo.temp)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['80'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['171']++;loader.addModule(details,name);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['80'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['79'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['78'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['77'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['172']++;return this;},_attach:function(r,moot){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['19']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['173']++;var i,name,mod,details,req,use,after,mods=YUI.Env.mods,aliases=YUI.Env.aliases,Y=this,j,cache=YUI.Env._renderedMods,loader=Y.Env._loader,done=Y.Env._attached,exported=Y.Env._exported,len=r.length,loader,def,go,c=[],modArgs,esCompat,reqlen,modInfo,condition,__exports__,__imports__;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['174']++;for(i=0;i<len;i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['175']++;name=r[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['176']++;mod=mods[name];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['177']++;c.push(name);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['178']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['83'][0]++,loader)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['83'][1]++,loader.conditions[name])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['82'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['179']++;for(j in loader.conditions[name]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['180']++;if(loader.conditions[name].hasOwnProperty(j)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['84'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['181']++;def=loader.conditions[name][j];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['182']++;go=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['85'][0]++,def)&&((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['85'][1]++,def.ua)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['85'][2]++,Y.UA[def.ua])||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['85'][3]++,def.test)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['85'][4]++,def.test(Y)));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['183']++;if(go){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['86'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['184']++;c.push(def.name);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['86'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['84'][1]++;}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['82'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['185']++;r=c;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['186']++;len=r.length;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['187']++;for(i=0;i<len;i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['188']++;if(!done[r[i]]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['87'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['189']++;name=r[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['190']++;mod=mods[name];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['191']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['89'][0]++,aliases)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['89'][1]++,aliases[name])&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['89'][2]++,!mod)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['88'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['192']++;Y._attach(aliases[name]);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['193']++;continue;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['88'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['194']++;if(!mod){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['90'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['195']++;modInfo=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['91'][0]++,loader)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['91'][1]++,loader.getModuleInfo(name));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['196']++;if(modInfo){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['92'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['197']++;mod=modInfo;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['198']++;moot=true;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['92'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['199']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['94'][0]++,!moot)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['94'][1]++,name)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['93'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['200']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['96'][0]++,name.indexOf('skin-')===-1)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['96'][1]++,name.indexOf('css')===-1)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['95'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['201']++;Y.Env._missed.push(name);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['202']++;Y.Env._missed=Y.Array.dedupe(Y.Env._missed);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['203']++;Y.message('NOT loaded: '+name,'warn','yui');}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['95'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['93'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['90'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['204']++;done[name]=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['205']++;for(j=0;j<Y.Env._missed.length;j++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['206']++;if(Y.Env._missed[j]===name){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['97'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['207']++;Y.message('Found: '+name+' (was reported as missing earlier)','warn','yui');__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['208']++;Y.Env._missed.splice(j,1);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['97'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['209']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['99'][0]++,loader)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['99'][1]++,cache)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['99'][2]++,cache[name])&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['99'][3]++,cache[name].temp)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['98'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['210']++;loader.getRequires(cache[name]);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['211']++;req=[];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['212']++;modInfo=loader.getModuleInfo(name);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['213']++;for(j in modInfo.expanded_map){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['214']++;if(modInfo.expanded_map.hasOwnProperty(j)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['100'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['215']++;req.push(j);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['100'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['216']++;Y._attach(req);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['98'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['217']++;details=mod.details;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['218']++;req=details.requires;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['219']++;esCompat=details.es;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['220']++;use=details.use;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['221']++;after=details.after;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['222']++;if(details.lang){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['101'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['223']++;req=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['102'][0]++,req)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['102'][1]++,[]);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['224']++;req.unshift('intl');}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['101'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['225']++;if(req){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['103'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['226']++;reqlen=req.length;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['227']++;for(j=0;j<reqlen;j++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['228']++;if(!done[req[j]]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['104'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['229']++;if(!Y._attach(req)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['105'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['230']++;return false;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['105'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['231']++;break;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['104'][1]++;}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['103'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['232']++;if(after){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['106'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['233']++;for(j=0;j<after.length;j++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['234']++;if(!done[after[j]]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['107'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['235']++;if(!Y._attach(after,true)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['108'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['236']++;return false;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['108'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['237']++;break;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['107'][1]++;}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['106'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['238']++;if(mod.fn){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['109'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['239']++;modArgs=[Y,name];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['240']++;if(esCompat){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['110'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['241']++;__imports__={};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['242']++;__exports__={};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['243']++;modArgs.push(__imports__,__exports__);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['244']++;if(req){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['111'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['245']++;reqlen=req.length;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['246']++;for(j=0;j<reqlen;j++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['247']++;__imports__[req[j]]=exported.hasOwnProperty(req[j])?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['112'][0]++,exported[req[j]]):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['112'][1]++,Y);}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['111'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['110'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['248']++;if(Y.config.throwFail){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['113'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['249']++;__exports__=mod.fn.apply(esCompat?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['114'][0]++,undefined):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['114'][1]++,mod),modArgs);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['113'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['250']++;try{__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['251']++;__exports__=mod.fn.apply(esCompat?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['115'][0]++,undefined):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['115'][1]++,mod),modArgs);}catch(e){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['252']++;Y.error('Attach error: '+name,e,name);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['253']++;return false;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['254']++;if(esCompat){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['116'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['255']++;exported[name]=__exports__;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['256']++;condition=mod.details.condition;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['257']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['118'][0]++,condition)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['118'][1]++,condition.when==='instead')){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['117'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['258']++;exported[condition.trigger]=__exports__;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['117'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['116'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['109'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['259']++;if(use){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['119'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['260']++;for(j=0;j<use.length;j++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['261']++;if(!done[use[j]]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['120'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['262']++;if(!Y._attach(use)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['121'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['263']++;return false;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['121'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['264']++;break;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['120'][1]++;}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['119'][1]++;}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['87'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['265']++;return true;},_delayCallback:function(cb,until){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['20']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['266']++;var Y=this,mod=['event-base'];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['267']++;until=Y.Lang.isObject(until)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['122'][0]++,until):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['122'][1]++,{event:until});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['268']++;if(until.event==='load'){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['123'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['269']++;mod.push('event-synthetic');}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['123'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['270']++;return function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['21']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['271']++;var args=arguments;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['272']++;Y._use(mod,function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['22']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['273']++;Y.on(until.event,function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['23']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['274']++;args[1].delayUntil=until.event;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['275']++;cb.apply(Y,args);},until.args);});};},use:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['24']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['276']++;var args=SLICE.call(arguments,0),callback=args[args.length-1],Y=this,i=0,name,Env=Y.Env,provisioned=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['277']++;if(Y.Lang.isFunction(callback)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['124'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['278']++;args.pop();__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['279']++;if(Y.config.delayUntil){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['125'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['280']++;callback=Y._delayCallback(callback,Y.config.delayUntil);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['125'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['124'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['281']++;callback=null;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['282']++;if(Y.Lang.isArray(args[0])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['126'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['283']++;args=args[0];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['126'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['284']++;if(Y.config.cacheUse){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['127'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['285']++;while(name=args[i++]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['286']++;if(!Env._attached[name]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['128'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['287']++;provisioned=false;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['288']++;break;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['128'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['289']++;if(provisioned){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['129'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['290']++;if(args.length){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['130'][0]++;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['130'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['291']++;Y._notify(callback,ALREADY_DONE,args);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['292']++;return Y;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['129'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['127'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['293']++;if(Y._loading){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['131'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['294']++;Y._useQueue=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['132'][0]++,Y._useQueue)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['132'][1]++,new Y.Queue());__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['295']++;Y._useQueue.add([args,callback]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['131'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['296']++;Y._use(args,function(Y,response){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['25']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['297']++;Y._notify(callback,response,args);});}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['298']++;return Y;},require:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['26']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['299']++;var args=SLICE.call(arguments),callback;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['300']++;if(typeof args[args.length-1]==='function'){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['133'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['301']++;callback=args.pop();__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['302']++;args.push(function(Y){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['27']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['303']++;var i,length=args.length,exported=Y.Env._exported,__imports__={};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['304']++;for(i=0;i<length;i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['305']++;if(exported.hasOwnProperty(args[i])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['134'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['306']++;__imports__[args[i]]=exported[args[i]];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['134'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['307']++;callback.call(undefined,Y,__imports__);});}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['133'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['308']++;this.use.apply(this,args);},_notify:function(callback,response,args){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['28']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['309']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['136'][0]++,!response.success)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['136'][1]++,this.config.loadErrorFn)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['135'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['310']++;this.config.loadErrorFn.call(this,this,callback,response,args);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['135'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['311']++;if(callback){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['137'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['312']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['139'][0]++,this.Env._missed)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['139'][1]++,this.Env._missed.length)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['138'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['313']++;response.msg='Missing modules: '+this.Env._missed.join();__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['314']++;response.success=false;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['138'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['315']++;if(this.config.throwFail){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['140'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['316']++;callback(this,response);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['140'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['317']++;try{__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['318']++;callback(this,response);}catch(e){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['319']++;this.error('use callback error',e,args);}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['137'][1]++;}}},_use:function(args,callback){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['29']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['320']++;if(!this.Array){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['141'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['321']++;this._attach(['yui-base']);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['141'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['322']++;var len,loader,handleBoot,Y=this,G_ENV=YUI.Env,mods=G_ENV.mods,Env=Y.Env,used=Env._used,aliases=G_ENV.aliases,queue=G_ENV._loaderQueue,firstArg=args[0],YArray=Y.Array,config=Y.config,boot=config.bootstrap,missing=[],i,r=[],ret=true,fetchCSS=config.fetchCSS,process=function(names,skip){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['30']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['323']++;var i=0,a=[],name,len,m,req,use;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['324']++;if(!names.length){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['142'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['325']++;return;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['142'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['326']++;if(aliases){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['143'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['327']++;len=names.length;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['328']++;for(i=0;i<len;i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['329']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['145'][0]++,aliases[names[i]])&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['145'][1]++,!mods[names[i]])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['144'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['330']++;a=[].concat(a,aliases[names[i]]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['144'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['331']++;a.push(names[i]);}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['332']++;names=a;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['143'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['333']++;len=names.length;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['334']++;for(i=0;i<len;i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['335']++;name=names[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['336']++;if(!skip){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['146'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['337']++;r.push(name);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['146'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['338']++;if(used[name]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['147'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['339']++;continue;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['147'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['340']++;m=mods[name];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['341']++;req=null;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['342']++;use=null;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['343']++;if(m){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['148'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['344']++;used[name]=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['345']++;req=m.details.requires;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['346']++;use=m.details.use;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['148'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['347']++;if(!G_ENV._loaded[VERSION][name]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['149'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['348']++;missing.push(name);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['149'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['349']++;used[name]=true;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['350']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['151'][0]++,req)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['151'][1]++,req.length)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['150'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['351']++;process(req);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['150'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['352']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['153'][0]++,use)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['153'][1]++,use.length)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['152'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['353']++;process(use,1);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['152'][1]++;}}},handleLoader=function(fromLoader){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['31']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['354']++;var response=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['154'][0]++,fromLoader)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['154'][1]++,{success:true,msg:'not dynamic'}),redo,origMissing,ret=true,data=response.data;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['355']++;Y._loading=false;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['356']++;if(data){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['155'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['357']++;origMissing=missing;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['358']++;missing=[];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['359']++;r=[];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['360']++;process(data);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['361']++;redo=missing.length;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['362']++;if(redo){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['156'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['363']++;if([].concat(missing).sort().join()==origMissing.sort().join()){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['157'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['364']++;redo=false;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['157'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['156'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['155'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['365']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['159'][0]++,redo)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['159'][1]++,data)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['158'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['366']++;Y._loading=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['367']++;Y._use(missing,function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['32']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['368']++;if(Y._attach(data)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['160'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['369']++;Y._notify(callback,response,data);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['160'][1]++;}});}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['158'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['370']++;if(data){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['161'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['371']++;ret=Y._attach(data);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['161'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['372']++;if(ret){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['162'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['373']++;Y._notify(callback,response,args);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['162'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['374']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['164'][0]++,Y._useQueue)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['164'][1]++,Y._useQueue.size())&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['164'][2]++,!Y._loading)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['163'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['375']++;Y._use.apply(Y,Y._useQueue.next());}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['163'][1]++;}};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['376']++;if(firstArg==='*'){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['165'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['377']++;args=[];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['378']++;for(i in mods){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['379']++;if(mods.hasOwnProperty(i)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['166'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['380']++;args.push(i);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['166'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['381']++;ret=Y._attach(args);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['382']++;if(ret){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['167'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['383']++;handleLoader();}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['167'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['384']++;return Y;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['165'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['385']++;if(((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['169'][0]++,mods.loader)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['169'][1]++,mods['loader-base']))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['169'][2]++,!Y.Loader)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['168'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['386']++;Y._attach(['loader'+(!mods.loader?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['170'][0]++,'-base'):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['170'][1]++,''))]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['168'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['387']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['172'][0]++,boot)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['172'][1]++,Y.Loader)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['172'][2]++,args.length)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['171'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['388']++;loader=getLoader(Y);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['389']++;loader.require(args);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['390']++;loader.ignoreRegistered=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['391']++;loader._boot=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['392']++;loader.calculate(null,fetchCSS?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['173'][0]++,null):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['173'][1]++,'js'));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['393']++;args=loader.sorted;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['394']++;loader._boot=false;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['171'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['395']++;process(args);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['396']++;len=missing.length;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['397']++;if(len){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['174'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['398']++;missing=YArray.dedupe(missing);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['399']++;len=missing.length;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['174'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['400']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['176'][0]++,boot)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['176'][1]++,len)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['176'][2]++,Y.Loader)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['175'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['401']++;Y._loading=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['402']++;loader=getLoader(Y);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['403']++;loader.onEnd=handleLoader;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['404']++;loader.context=Y;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['405']++;loader.data=args;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['406']++;loader.ignoreRegistered=false;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['407']++;loader.require(missing);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['408']++;loader.insert(null,fetchCSS?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['177'][0]++,null):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['177'][1]++,'js'));}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['175'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['409']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['179'][0]++,boot)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['179'][1]++,len)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['179'][2]++,Y.Get)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['179'][3]++,!Env.bootstrapped)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['178'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['410']++;Y._loading=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['411']++;handleBoot=function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['33']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['412']++;Y._loading=false;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['413']++;queue.running=false;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['414']++;Env.bootstrapped=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['415']++;G_ENV._bootstrapping=false;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['416']++;if(Y._attach(['loader'])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['180'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['417']++;Y._use(args,callback);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['180'][1]++;}};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['418']++;if(G_ENV._bootstrapping){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['181'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['419']++;queue.add(handleBoot);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['181'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['420']++;G_ENV._bootstrapping=true;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['421']++;Y.Get.script(config.base+config.loaderPath,{onEnd:handleBoot});}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['178'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['422']++;ret=Y._attach(args);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['423']++;if(ret){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['182'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['424']++;handleLoader();}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['182'][1]++;}}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['425']++;return Y;},namespace:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['34']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['426']++;var a=arguments,o,i=0,j,d,arg;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['427']++;for(;i<a.length;i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['428']++;o=this;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['429']++;arg=a[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['430']++;if(arg.indexOf(PERIOD)>-1){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['183'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['431']++;d=arg.split(PERIOD);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['432']++;for(j=d[0]=='YAHOO'?1:0;j<d.length;j++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['433']++;o[d[j]]=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['184'][0]++,o[d[j]])||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['184'][1]++,{});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['434']++;o=o[d[j]];}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['183'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['435']++;o[arg]=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['185'][0]++,o[arg])||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['185'][1]++,{});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['436']++;o=o[arg];}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['437']++;return o;},log:NOOP,message:NOOP,dump:function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['35']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['438']++;return''+o;},error:function(msg,e,src){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['36']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['439']++;var Y=this,ret;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['440']++;if(Y.config.errorFn){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['186'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['441']++;ret=Y.config.errorFn.apply(Y,arguments);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['186'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['442']++;if(!ret){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['187'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['443']++;throw(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['188'][0]++,e)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['188'][1]++,new Error(msg));}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['187'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['444']++;Y.message(msg,'error',''+src);}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['445']++;return Y;},guid:function(pre){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['37']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['446']++;var id=this.Env._guidp+'_'+ ++this.Env._uidx;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['447']++;return pre?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['189'][0]++,pre+id):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['189'][1]++,id);},stamp:function(o,readOnly){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['38']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['448']++;var uid;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['449']++;if(!o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['190'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['450']++;return o;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['190'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['451']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['192'][0]++,o.uniqueID)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['192'][1]++,o.nodeType)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['192'][2]++,o.nodeType!==9)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['191'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['452']++;uid=o.uniqueID;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['191'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['453']++;uid=typeof o==='string'?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['193'][0]++,o):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['193'][1]++,o._yuid);}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['454']++;if(!uid){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['194'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['455']++;uid=this.guid();__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['456']++;if(!readOnly){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['195'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['457']++;try{__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['458']++;o._yuid=uid;}catch(e){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['459']++;uid=null;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['195'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['194'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['460']++;return uid;},destroy:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['39']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['461']++;var Y=this;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['462']++;if(Y.Event){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['196'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['463']++;Y.Event._unload();}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['196'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['464']++;delete instances[Y.id];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['465']++;delete Y.Env;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['466']++;delete Y.config;}};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['467']++;YUI.prototype=proto;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['468']++;for(prop in proto){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['469']++;if(proto.hasOwnProperty(prop)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['197'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['470']++;YUI[prop]=proto[prop];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['197'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['471']++;YUI.applyConfig=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['40']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['472']++;if(!o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['198'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['473']++;return;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['198'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['474']++;if(YUI.GlobalConfig){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['199'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['475']++;this.prototype.applyConfig.call(this,YUI.GlobalConfig);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['199'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['476']++;this.prototype.applyConfig.call(this,o);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['477']++;YUI.GlobalConfig=this.config;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['478']++;YUI._init();__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['479']++;if(hasWin){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['200'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['480']++;add(doc,'DOMContentLoaded',handleReady);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['481']++;add(window,'load',handleLoad);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['200'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['482']++;handleReady();__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['483']++;handleLoad();}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['484']++;YUI.Env.add=add;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['485']++;YUI.Env.remove=remove;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['486']++;if(typeof exports=='object'){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['201'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['487']++;exports.YUI=YUI;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['488']++;YUI.setLoadHook=function(fn){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['41']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['489']++;YUI._getLoadHook=fn;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['490']++;YUI._getLoadHook=null;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['201'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['491']++;YUI.Env[VERSION]={};}());__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['492']++;YUI.add('yui-base',function(Y,NAME){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['42']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['493']++;var L=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['202'][0]++,Y.Lang)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['202'][1]++,Y.Lang={}),STRING_PROTO=String.prototype,TOSTRING=Object.prototype.toString,TYPES={'undefined':'undefined','number':'number','boolean':'boolean','string':'string','[object Function]':'function','[object RegExp]':'regexp','[object Array]':'array','[object Date]':'date','[object Error]':'error'},SUBREGEX=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,WHITESPACE='\t\n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff',WHITESPACE_CLASS='[\t-\r \xa0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+',TRIM_LEFT_REGEX=new RegExp('^'+WHITESPACE_CLASS),TRIM_RIGHT_REGEX=new RegExp(WHITESPACE_CLASS+'$'),TRIMREGEX=new RegExp(TRIM_LEFT_REGEX.source+'|'+TRIM_RIGHT_REGEX.source,'g'),NATIVE_FN_REGEX=/\{\s*\[(?:native code|function)\]\s*\}/i;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['494']++;L._isNative=function(fn){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['43']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['495']++;return!!((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['203'][0]++,Y.config.useNativeES5)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['203'][1]++,fn)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['203'][2]++,NATIVE_FN_REGEX.test(fn)));};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['496']++;L.isArray=L._isNative(Array.isArray)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['204'][0]++,Array.isArray):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['204'][1]++,function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['44']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['497']++;return L.type(o)==='array';});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['498']++;L.isBoolean=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['45']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['499']++;return typeof o==='boolean';};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['500']++;L.isDate=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['46']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['501']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['205'][0]++,L.type(o)==='date')&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['205'][1]++,o.toString()!=='Invalid Date')&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['205'][2]++,!isNaN(o));};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['502']++;L.isFunction=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['47']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['503']++;return L.type(o)==='function';};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['504']++;L.isNull=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['48']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['505']++;return o===null;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['506']++;L.isNumber=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['49']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['507']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['206'][0]++,typeof o==='number')&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['206'][1]++,isFinite(o));};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['508']++;L.isObject=function(o,failfn){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['50']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['509']++;var t=typeof o;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['510']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['207'][0]++,o)&&((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['207'][1]++,t==='object')||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['207'][2]++,!failfn)&&((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['207'][3]++,t==='function')||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['207'][4]++,L.isFunction(o))))||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['207'][5]++,false);};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['511']++;L.isRegExp=function(value){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['51']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['512']++;return L.type(value)==='regexp';};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['513']++;L.isString=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['52']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['514']++;return typeof o==='string';};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['515']++;L.isUndefined=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['53']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['516']++;return typeof o==='undefined';};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['517']++;L.isValue=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['54']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['518']++;var t=L.type(o);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['519']++;switch(t){case'number':__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['208'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['520']++;return isFinite(o);case'null':__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['208'][1]++;case'undefined':__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['208'][2]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['521']++;return false;default:__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['208'][3]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['522']++;return!!t;}};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['523']++;L.now=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['209'][0]++,Date.now)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['209'][1]++,function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['55']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['524']++;return new Date().getTime();});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['525']++;L.sub=function(s,o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['56']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['526']++;return s.replace?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['210'][0]++,s.replace(SUBREGEX,function(match,key){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['57']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['527']++;return L.isUndefined(o[key])?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['211'][0]++,match):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['211'][1]++,o[key]);})):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['210'][1]++,s);};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['528']++;L.trim=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['213'][0]++,L._isNative(STRING_PROTO.trim))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['213'][1]++,!WHITESPACE.trim())?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['212'][0]++,function(s){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['58']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['529']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['215'][0]++,s)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['215'][1]++,s.trim)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['214'][0]++,s.trim()):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['214'][1]++,s);}):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['212'][1]++,function(s){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['59']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['530']++;try{__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['531']++;return s.replace(TRIMREGEX,'');}catch(e){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['532']++;return s;}});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['533']++;L.trimLeft=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['217'][0]++,L._isNative(STRING_PROTO.trimLeft))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['217'][1]++,!WHITESPACE.trimLeft())?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['216'][0]++,function(s){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['60']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['534']++;return s.trimLeft();}):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['216'][1]++,function(s){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['61']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['535']++;return s.replace(TRIM_LEFT_REGEX,'');});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['536']++;L.trimRight=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['219'][0]++,L._isNative(STRING_PROTO.trimRight))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['219'][1]++,!WHITESPACE.trimRight())?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['218'][0]++,function(s){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['62']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['537']++;return s.trimRight();}):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['218'][1]++,function(s){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['63']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['538']++;return s.replace(TRIM_RIGHT_REGEX,'');});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['539']++;L.type=function(o){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['64']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['540']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['220'][0]++,TYPES[typeof o])||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['220'][1]++,TYPES[TOSTRING.call(o)])||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['220'][2]++,o?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['221'][0]++,'object'):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['221'][1]++,'null'));};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['541']++;var Lang=Y.Lang,Native=Array.prototype,hasOwn=Object.prototype.hasOwnProperty;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['542']++;function YArray(thing,startIndex,force){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['65']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['543']++;var len,result;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['544']++;(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['222'][0]++,startIndex)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['222'][1]++,startIndex=0);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['545']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['224'][0]++,force)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['224'][1]++,YArray.test(thing))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['223'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['546']++;try{__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['547']++;return Native.slice.call(thing,startIndex);}catch(ex){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['548']++;result=[];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['549']++;for(len=thing.length;startIndex<len;++startIndex){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['550']++;result.push(thing[startIndex]);}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['551']++;return result;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['223'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['552']++;return[thing];}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['553']++;Y.Array=YArray;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['554']++;YArray.dedupe=Lang._isNative(Object.create)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['225'][0]++,function(array){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['66']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['555']++;var hash=Object.create(null),results=[],i,item,len;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['556']++;for(i=0,len=array.length;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['557']++;item=array[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['558']++;if(!hash[item]){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['226'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['559']++;hash[item]=1;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['560']++;results.push(item);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['226'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['561']++;return results;}):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['225'][1]++,function(array){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['67']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['562']++;var hash={},results=[],i,item,len;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['563']++;for(i=0,len=array.length;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['564']++;item=array[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['565']++;if(!hasOwn.call(hash,item)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['227'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['566']++;hash[item]=1;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['567']++;results.push(item);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['227'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['568']++;return results;});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['569']++;YArray.each=YArray.forEach=Lang._isNative(Native.forEach)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['228'][0]++,function(array,fn,thisObj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['68']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['570']++;Native.forEach.call((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['229'][0]++,array)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['229'][1]++,[]),fn,(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['230'][0]++,thisObj)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['230'][1]++,Y));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['571']++;return Y;}):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['228'][1]++,function(array,fn,thisObj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['69']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['572']++;for(var i=0,len=array&&array.length||0;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['573']++;if(i in array){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['231'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['574']++;fn.call((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['232'][0]++,thisObj)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['232'][1]++,Y),array[i],i,array);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['231'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['575']++;return Y;});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['576']++;YArray.hash=function(keys,values){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['70']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['577']++;var hash={},vlen=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['233'][0]++,values)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['233'][1]++,values.length)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['233'][2]++,0),i,len;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['578']++;for(i=0,len=keys.length;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['579']++;if(i in keys){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['234'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['580']++;hash[keys[i]]=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['236'][0]++,vlen>i)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['236'][1]++,i in values)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['235'][0]++,values[i]):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['235'][1]++,true);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['234'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['581']++;return hash;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['582']++;YArray.indexOf=Lang._isNative(Native.indexOf)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['237'][0]++,function(array,value,from){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['71']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['583']++;return Native.indexOf.call(array,value,from);}):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['237'][1]++,function(array,value,from){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['72']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['584']++;var len=array.length;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['585']++;from=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['238'][0]++,+from)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['238'][1]++,0);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['586']++;from=((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['239'][0]++,from>0)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['239'][1]++,-1))*Math.floor(Math.abs(from));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['587']++;if(from<0){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['240'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['588']++;from+=len;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['589']++;if(from<0){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['241'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['590']++;from=0;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['241'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['240'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['591']++;for(;from<len;++from){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['592']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['243'][0]++,from in array)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['243'][1]++,array[from]===value)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['242'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['593']++;return from;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['242'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['594']++;return-1;});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['595']++;YArray.numericSort=function(a,b){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['73']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['596']++;return a-b;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['597']++;YArray.some=Lang._isNative(Native.some)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['244'][0]++,function(array,fn,thisObj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['74']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['598']++;return Native.some.call(array,fn,thisObj);}):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['244'][1]++,function(array,fn,thisObj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['75']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['599']++;for(var i=0,len=array.length;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['600']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['246'][0]++,i in array)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['246'][1]++,fn.call(thisObj,array[i],i,array))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['245'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['601']++;return true;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['245'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['602']++;return false;});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['603']++;YArray.test=function(obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['76']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['604']++;var result=0;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['605']++;if(Lang.isArray(obj)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['247'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['606']++;result=1;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['247'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['607']++;if(Lang.isObject(obj)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['248'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['608']++;try{__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['609']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['250'][0]++,'length'in obj)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['250'][1]++,!obj.tagName)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['250'][2]++,!((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['251'][0]++,obj.scrollTo)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['251'][1]++,obj.document)))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['250'][3]++,!obj.apply)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['249'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['610']++;result=2;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['249'][1]++;}}catch(ex){}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['248'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['611']++;return result;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['612']++;function Queue(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['77']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['613']++;this._init();__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['614']++;this.add.apply(this,arguments);}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['615']++;Queue.prototype={_init:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['78']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['616']++;this._q=[];},next:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['79']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['617']++;return this._q.shift();},last:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['80']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['618']++;return this._q.pop();},add:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['81']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['619']++;this._q.push.apply(this._q,arguments);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['620']++;return this;},size:function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['82']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['621']++;return this._q.length;}};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['622']++;Y.Queue=Queue;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['623']++;YUI.Env._loaderQueue=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['252'][0]++,YUI.Env._loaderQueue)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['252'][1]++,new Queue());__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['624']++;var CACHED_DELIMITER='__',hasOwn=Object.prototype.hasOwnProperty,isObject=Y.Lang.isObject;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['625']++;Y.cached=function(source,cache,refetch){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['83']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['626']++;(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['253'][0]++,cache)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['253'][1]++,cache={});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['627']++;return function(arg){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['84']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['628']++;var key=arguments.length>1?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['254'][0]++,Array.prototype.join.call(arguments,CACHED_DELIMITER)):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['254'][1]++,String(arg));__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['629']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['256'][0]++,!(key in cache))||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['256'][1]++,refetch)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['256'][2]++,cache[key]==refetch)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['255'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['630']++;cache[key]=source.apply(source,arguments);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['255'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['631']++;return cache[key];};};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['632']++;Y.getLocation=function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['85']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['633']++;var win=Y.config.win;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['634']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['257'][0]++,win)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['257'][1]++,win.location);};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['635']++;Y.merge=function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['86']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['636']++;var i=0,len=arguments.length,result={},key,obj;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['637']++;for(;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['638']++;obj=arguments[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['639']++;for(key in obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['640']++;if(hasOwn.call(obj,key)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['258'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['641']++;result[key]=obj[key];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['258'][1]++;}}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['642']++;return result;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['643']++;Y.mix=function(receiver,supplier,overwrite,whitelist,mode,merge){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['87']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['644']++;var alwaysOverwrite,exists,from,i,key,len,to;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['645']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['260'][0]++,!receiver)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['260'][1]++,!supplier)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['259'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['646']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['261'][0]++,receiver)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['261'][1]++,Y);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['259'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['647']++;if(mode){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['262'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['648']++;if(mode===2){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['263'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['649']++;Y.mix(receiver.prototype,supplier.prototype,overwrite,whitelist,0,merge);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['263'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['650']++;from=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['265'][0]++,mode===1)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['265'][1]++,mode===3)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['264'][0]++,supplier.prototype):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['264'][1]++,supplier);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['651']++;to=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['267'][0]++,mode===1)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['267'][1]++,mode===4)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['266'][0]++,receiver.prototype):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['266'][1]++,receiver);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['652']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['269'][0]++,!from)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['269'][1]++,!to)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['268'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['653']++;return receiver;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['268'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['262'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['654']++;from=supplier;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['655']++;to=receiver;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['656']++;alwaysOverwrite=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['270'][0]++,overwrite)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['270'][1]++,!merge);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['657']++;if(whitelist){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['271'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['658']++;for(i=0,len=whitelist.length;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['659']++;key=whitelist[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['660']++;if(!hasOwn.call(from,key)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['272'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['661']++;continue;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['272'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['662']++;exists=alwaysOverwrite?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['273'][0]++,false):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['273'][1]++,key in to);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['663']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['275'][0]++,merge)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['275'][1]++,exists)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['275'][2]++,isObject(to[key],true))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['275'][3]++,isObject(from[key],true))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['274'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['664']++;Y.mix(to[key],from[key],overwrite,null,0,merge);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['274'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['665']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['277'][0]++,overwrite)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['277'][1]++,!exists)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['276'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['666']++;to[key]=from[key];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['276'][1]++;}}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['271'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['667']++;for(key in from){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['668']++;if(!hasOwn.call(from,key)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['278'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['669']++;continue;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['278'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['670']++;exists=alwaysOverwrite?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['279'][0]++,false):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['279'][1]++,key in to);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['671']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['281'][0]++,merge)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['281'][1]++,exists)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['281'][2]++,isObject(to[key],true))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['281'][3]++,isObject(from[key],true))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['280'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['672']++;Y.mix(to[key],from[key],overwrite,null,0,merge);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['280'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['673']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['283'][0]++,overwrite)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['283'][1]++,!exists)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['282'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['674']++;to[key]=from[key];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['282'][1]++;}}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['675']++;if(Y.Object._hasEnumBug){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['284'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['676']++;Y.mix(to,from,overwrite,Y.Object._forceEnum,mode,merge);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['284'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['677']++;return receiver;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['678']++;var Lang=Y.Lang,hasOwn=Object.prototype.hasOwnProperty,UNDEFINED,O=Y.Object=Lang._isNative(Object.create)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['285'][0]++,function(obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['88']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['679']++;return Object.create(obj);}):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['285'][1]++,function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['89']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['680']++;function F(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['90']++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['681']++;return function(obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['91']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['682']++;F.prototype=obj;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['683']++;return new F();};}()),forceEnum=O._forceEnum=['hasOwnProperty','isPrototypeOf','propertyIsEnumerable','toString','toLocaleString','valueOf'],hasEnumBug=O._hasEnumBug=!{valueOf:0}.propertyIsEnumerable('valueOf'),hasProtoEnumBug=O._hasProtoEnumBug=function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['92']++;}.propertyIsEnumerable('prototype'),owns=O.owns=function(obj,key){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['93']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['684']++;return(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['286'][0]++,!!obj)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['286'][1]++,hasOwn.call(obj,key));};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['685']++;O.hasKey=owns;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['686']++;O.keys=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['288'][0]++,Lang._isNative(Object.keys))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['288'][1]++,!hasProtoEnumBug)?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['287'][0]++,Object.keys):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['287'][1]++,function(obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['94']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['687']++;if(!Lang.isObject(obj)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['289'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['688']++;throw new TypeError('Object.keys called on a non-object');}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['289'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['689']++;var keys=[],i,key,len;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['690']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['291'][0]++,hasProtoEnumBug)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['291'][1]++,typeof obj==='function')){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['290'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['691']++;for(key in obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['692']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['293'][0]++,owns(obj,key))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['293'][1]++,key!=='prototype')){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['292'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['693']++;keys.push(key);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['292'][1]++;}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['290'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['694']++;for(key in obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['695']++;if(owns(obj,key)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['294'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['696']++;keys.push(key);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['294'][1]++;}}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['697']++;if(hasEnumBug){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['295'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['698']++;for(i=0,len=forceEnum.length;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['699']++;key=forceEnum[i];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['700']++;if(owns(obj,key)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['296'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['701']++;keys.push(key);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['296'][1]++;}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['295'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['702']++;return keys;});__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['703']++;O.values=function(obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['95']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['704']++;var keys=O.keys(obj),i=0,len=keys.length,values=[];__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['705']++;for(;i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['706']++;values.push(obj[keys[i]]);}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['707']++;return values;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['708']++;O.size=function(obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['96']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['709']++;try{__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['710']++;return O.keys(obj).length;}catch(ex){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['711']++;return 0;}};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['712']++;O.hasValue=function(obj,value){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['97']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['713']++;return Y.Array.indexOf(O.values(obj),value)>-1;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['714']++;O.each=function(obj,fn,thisObj,proto){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['98']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['715']++;var key;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['716']++;for(key in obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['717']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['298'][0]++,proto)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['298'][1]++,owns(obj,key))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['297'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['718']++;fn.call((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['299'][0]++,thisObj)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['299'][1]++,Y),obj[key],key,obj);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['297'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['719']++;return Y;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['720']++;O.some=function(obj,fn,thisObj,proto){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['99']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['721']++;var key;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['722']++;for(key in obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['723']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['301'][0]++,proto)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['301'][1]++,owns(obj,key))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['300'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['724']++;if(fn.call((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['303'][0]++,thisObj)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['303'][1]++,Y),obj[key],key,obj)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['302'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['725']++;return true;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['302'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['300'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['726']++;return false;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['727']++;O.getValue=function(o,path){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['100']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['728']++;if(!Lang.isObject(o)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['304'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['729']++;return UNDEFINED;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['304'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['730']++;var i,p=Y.Array(path),l=p.length;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['731']++;for(i=0;(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['305'][0]++,o!==UNDEFINED)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['305'][1]++,i<l);i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['732']++;o=o[p[i]];}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['733']++;return o;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['734']++;O.setValue=function(o,path,val){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['101']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['735']++;var i,p=Y.Array(path),leafIdx=p.length-1,ref=o;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['736']++;if(leafIdx>=0){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['306'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['737']++;for(i=0;(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['307'][0]++,ref!==UNDEFINED)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['307'][1]++,i<leafIdx);i++){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['738']++;ref=ref[p[i]];}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['739']++;if(ref!==UNDEFINED){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['308'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['740']++;ref[p[i]]=val;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['308'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['741']++;return UNDEFINED;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['306'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['742']++;return o;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['743']++;O.isEmpty=function(obj){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['102']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['744']++;return!O.keys(Object(obj)).length;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['745']++;YUI.Env.parseUA=function(subUA){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['103']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['746']++;var numberify=function(s){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['104']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['747']++;var c=0;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['748']++;return parseFloat(s.replace(/\./g,function(){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['105']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['749']++;return c++===1?(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['309'][0]++,''):(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['309'][1]++,'.');}));},win=Y.config.win,nav=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['310'][0]++,win)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['310'][1]++,win.navigator),o={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:false,webos:0,caja:(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['311'][0]++,nav)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['311'][1]++,nav.cajaVersion),secure:false,os:null,nodejs:0,winjs:!!((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['312'][0]++,typeof Windows!=='undefined')&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['312'][1]++,Windows.System)),touchEnabled:false},ua=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['313'][0]++,subUA)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['313'][1]++,nav)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['313'][2]++,nav.userAgent),loc=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['314'][0]++,win)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['314'][1]++,win.location),href=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['315'][0]++,loc)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['315'][1]++,loc.href),m;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['750']++;o.userAgent=ua;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['751']++;o.secure=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['316'][0]++,href)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['316'][1]++,href.toLowerCase().indexOf('https')===0);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['752']++;if(ua){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['317'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['753']++;if(/windows|win32/i.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['318'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['754']++;o.os='windows';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['318'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['755']++;if(/macintosh|mac_powerpc/i.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['319'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['756']++;o.os='macintosh';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['319'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['757']++;if(/android/i.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['320'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['758']++;o.os='android';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['320'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['759']++;if(/symbos/i.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['321'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['760']++;o.os='symbos';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['321'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['761']++;if(/linux/i.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['322'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['762']++;o.os='linux';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['322'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['763']++;if(/rhino/i.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['323'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['764']++;o.os='rhino';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['323'][1]++;}}}}}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['765']++;if(/KHTML/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['324'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['766']++;o.webkit=1;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['324'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['767']++;if(/IEMobile|XBLWP7/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['325'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['768']++;o.mobile='windows';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['325'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['769']++;if(/Fennec/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['326'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['770']++;o.mobile='gecko';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['326'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['771']++;m=ua.match(/AppleWebKit\/([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['772']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['328'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['328'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['327'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['773']++;o.webkit=numberify(m[1]);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['774']++;o.safari=o.webkit;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['775']++;if(/PhantomJS/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['329'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['776']++;m=ua.match(/PhantomJS\/([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['777']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['331'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['331'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['330'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['778']++;o.phantomjs=numberify(m[1]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['330'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['329'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['779']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['333'][0]++,/ Mobile\//.test(ua))||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['333'][1]++,/iPad|iPod|iPhone/.test(ua))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['332'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['780']++;o.mobile='Apple';__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['781']++;m=ua.match(/OS ([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['782']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['335'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['335'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['334'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['783']++;m=numberify(m[1].replace('_','.'));}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['334'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['784']++;o.ios=m;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['785']++;o.os='ios';__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['786']++;o.ipad=o.ipod=o.iphone=0;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['787']++;m=ua.match(/iPad|iPod|iPhone/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['788']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['337'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['337'][1]++,m[0])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['336'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['789']++;o[m[0].toLowerCase()]=o.ios;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['336'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['332'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['790']++;m=ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['791']++;if(m){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['338'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['792']++;o.mobile=m[0];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['338'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['793']++;if(/webOS/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['339'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['794']++;o.mobile='WebOS';__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['795']++;m=ua.match(/webOS\/([^\s]*);/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['796']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['341'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['341'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['340'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['797']++;o.webos=numberify(m[1]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['340'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['339'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['798']++;if(/ Android/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['342'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['799']++;if(/Mobile/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['343'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['800']++;o.mobile='Android';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['343'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['801']++;m=ua.match(/Android ([^\s]*);/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['802']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['345'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['345'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['344'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['803']++;o.android=numberify(m[1]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['344'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['342'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['804']++;if(/Silk/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['346'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['805']++;m=ua.match(/Silk\/([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['806']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['348'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['348'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['347'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['807']++;o.silk=numberify(m[1]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['347'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['808']++;if(!o.android){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['349'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['809']++;o.android=2.34;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['810']++;o.os='Android';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['349'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['811']++;if(/Accelerated=true/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['350'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['812']++;o.accel=true;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['350'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['346'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['813']++;m=ua.match(/OPR\/(\d+\.\d+)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['814']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['352'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['352'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['351'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['815']++;o.opera=numberify(m[1]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['351'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['816']++;m=ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['817']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['354'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['354'][1]++,m[1])&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['354'][2]++,m[2])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['353'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['818']++;o.chrome=numberify(m[2]);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['819']++;o.safari=0;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['820']++;if(m[1]==='CrMo'){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['355'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['821']++;o.mobile='chrome';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['355'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['353'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['822']++;m=ua.match(/AdobeAIR\/([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['823']++;if(m){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['356'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['824']++;o.air=m[0];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['356'][1]++;}}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['327'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['825']++;if(!o.webkit){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['357'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['826']++;if(/Opera/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['358'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['827']++;m=ua.match(/Opera[\s\/]([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['828']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['360'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['360'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['359'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['829']++;o.opera=numberify(m[1]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['359'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['830']++;m=ua.match(/Version\/([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['831']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['362'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['362'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['361'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['832']++;o.opera=numberify(m[1]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['361'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['833']++;if(/Opera Mobi/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['363'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['834']++;o.mobile='opera';__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['835']++;m=ua.replace('Opera Mobi','').match(/Opera ([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['836']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['365'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['365'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['364'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['837']++;o.opera=numberify(m[1]);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['364'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['363'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['838']++;m=ua.match(/Opera Mini[^;]*/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['839']++;if(m){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['366'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['840']++;o.mobile=m[0];}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['366'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['358'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['841']++;m=ua.match(/MSIE ([^;]*)|Trident.*; rv:([0-9.]+)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['842']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['368'][0]++,m)&&((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['368'][1]++,m[1])||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['368'][2]++,m[2]))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['367'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['843']++;o.ie=numberify((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['369'][0]++,m[1])||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['369'][1]++,m[2]));}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['367'][1]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['844']++;m=ua.match(/Gecko\/([^\s]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['845']++;if(m){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['370'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['846']++;o.gecko=1;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['847']++;m=ua.match(/rv:([^\s\)]*)/);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['848']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['372'][0]++,m)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['372'][1]++,m[1])){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['371'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['849']++;o.gecko=numberify(m[1]);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['850']++;if(/Mobile|Tablet/.test(ua)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['373'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['851']++;o.mobile='ffos';}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['373'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['371'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['370'][1]++;}}}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['357'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['317'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['852']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['375'][0]++,win)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['375'][1]++,nav)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['375'][2]++,!((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['376'][0]++,o.chrome)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['376'][1]++,o.chrome<6)))){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['374'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['853']++;o.touchEnabled=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['377'][0]++,'ontouchstart'in win)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['377'][1]++,'msMaxTouchPoints'in nav)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['377'][2]++,nav.msMaxTouchPoints>0);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['374'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['854']++;if(!subUA){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['378'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['855']++;if(typeof process==='object'){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['379'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['856']++;if((__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['381'][0]++,process.versions)&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['381'][1]++,process.versions.node)){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['380'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['857']++;o.os=process.platform;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['858']++;o.nodejs=numberify(process.versions.node);}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['380'][1]++;}}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['379'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['859']++;YUI.Env.UA=o;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['378'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['860']++;return o;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['861']++;Y.UA=(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['382'][0]++,YUI.Env.UA)||(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['382'][1]++,YUI.Env.parseUA());__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['862']++;Y.UA.compareVersions=function(a,b){__cov_gn$ukBWAoNv3EfKmD$sSEQ.f['106']++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['863']++;var aPart,aParts,bPart,bParts,i,len;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['864']++;if(a===b){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['383'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['865']++;return 0;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['383'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['866']++;aParts=(a+'').split('.');__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['867']++;bParts=(b+'').split('.');__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['868']++;for(i=0,len=Math.max(aParts.length,bParts.length);i<len;++i){__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['869']++;aPart=parseInt(aParts[i],10);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['870']++;bPart=parseInt(bParts[i],10);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['871']++;(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['384'][0]++,isNaN(aPart))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['384'][1]++,aPart=0);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['872']++;(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['385'][0]++,isNaN(bPart))&&(__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['385'][1]++,bPart=0);__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['873']++;if(aPart<bPart){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['386'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['874']++;return-1;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['386'][1]++;}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['875']++;if(aPart>bPart){__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['387'][0]++;__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['876']++;return 1;}else{__cov_gn$ukBWAoNv3EfKmD$sSEQ.b['387'][1]++;}}__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['877']++;return 0;};__cov_gn$ukBWAoNv3EfKmD$sSEQ.s['878']++;YUI.Env.aliases={'anim':['anim-base','anim-color','anim-curve','anim-easing','anim-node-plugin','anim-scroll','anim-xy'],'anim-shape-transform':['anim-shape'],'app':['app-base','app-content','app-transitions','lazy-model-list','model','model-list','model-sync-rest','model-sync-local','router','view','view-node-map'],'attribute':['attribute-base','attribute-complex'],'attribute-events':['attribute-observable'],'autocomplete':['autocomplete-base','autocomplete-sources','autocomplete-list','autocomplete-plugin'],'axes':['axis-numeric','axis-category','axis-time','axis-stacked'],'axes-base':['axis-numeric-base','axis-category-base','axis-time-base','axis-stacked-base'],'base':['base-base','base-pluginhost','base-build'],'cache':['cache-base','cache-offline','cache-plugin'],'charts':['charts-base'],'collection':['array-extras','arraylist','arraylist-add','arraylist-filter','array-invoke'],'color':['color-base','color-hsl','color-harmony'],'controller':['router'],'dataschema':['dataschema-base','dataschema-json','dataschema-xml','dataschema-array','dataschema-text'],'datasource':['datasource-local','datasource-io','datasource-get','datasource-function','datasource-cache','datasource-jsonschema','datasource-xmlschema','datasource-arrayschema','datasource-textschema','datasource-polling'],'datatable':['datatable-core','datatable-table','datatable-head','datatable-body','datatable-base','datatable-column-widths','datatable-message','datatable-mutable','datatable-sort','datatable-datasource'],'datatype':['datatype-date','datatype-number','datatype-xml'],'datatype-date':['datatype-date-parse','datatype-date-format','datatype-date-math'],'datatype-number':['datatype-number-parse','datatype-number-format'],'datatype-xml':['datatype-xml-parse','datatype-xml-format'],'dd':['dd-ddm-base','dd-ddm','dd-ddm-drop','dd-drag','dd-proxy','dd-constrain','dd-drop','dd-scroll','dd-delegate'],'dom':['dom-base','dom-screen','dom-style','selector-native','selector'],'editor':['frame','editor-selection','exec-command','editor-base','editor-para','editor-br','editor-bidi','editor-tab','createlink-base'],'event':['event-base','event-delegate','event-synthetic','event-mousewheel','event-mouseenter','event-key','event-focus','event-resize','event-hover','event-outside','event-touch','event-move','event-flick','event-valuechange','event-tap'],'event-custom':['event-custom-base','event-custom-complex'],'event-gestures':['event-flick','event-move'],'handlebars':['handlebars-compiler'],'highlight':['highlight-base','highlight-accentfold'],'history':['history-base','history-hash','history-html5'],'io':['io-base','io-xdr','io-form','io-upload-iframe','io-queue'],'json':['json-parse','json-stringify'],'loader':['loader-base','loader-rollup','loader-yui3'],'node':['node-base','node-event-delegate','node-pluginhost','node-screen','node-style'],'pluginhost':['pluginhost-base','pluginhost-config'],'querystring':['querystring-parse','querystring-stringify'],'recordset':['recordset-base','recordset-sort','recordset-filter','recordset-indexer'],'resize':['resize-base','resize-proxy','resize-constrain'],'slider':['slider-base','slider-value-range','clickable-rail','range-slider'],'template':['template-base','template-micro'],'text':['text-accentfold','text-wordbreak'],'widget':['widget-base','widget-htmlparser','widget-skin','widget-uievents']};},'3.16.0',{'use':['yui-base','get','features','intl-base','yui-log','yui-log-nodejs','yui-later','loader-base','loader-rollup','loader-yui3']});
francescoagati/cdnjs
ajax/libs/yui/3.16.0/yui-nodejs/yui-nodejs-coverage.js
JavaScript
mit
402,002
/* YUI 3.16.0 (build 76f0e08) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/parallel/parallel.js']) { __coverage__['build/parallel/parallel.js'] = {"path":"build/parallel/parallel.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0,0],"4":[0,0],"5":[0,0],"6":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":39}}},"2":{"name":"(anonymous_2)","line":34,"loc":{"start":{"line":34,"column":13},"end":{"line":34,"column":25}}},"3":{"name":"(anonymous_3)","line":67,"loc":{"start":{"line":67,"column":9},"end":{"line":67,"column":23}}},"4":{"name":"(anonymous_4)","line":73,"loc":{"start":{"line":73,"column":15},"end":{"line":73,"column":27}}},"5":{"name":"(anonymous_5)","line":85,"loc":{"start":{"line":85,"column":10},"end":{"line":85,"column":22}}},"6":{"name":"(anonymous_6)","line":99,"loc":{"start":{"line":99,"column":10},"end":{"line":99,"column":36}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":107,"column":41}},"2":{"start":{"line":34,"column":0},"end":{"line":40,"column":2}},"3":{"start":{"line":35,"column":4},"end":{"line":35,"column":26}},"4":{"start":{"line":36,"column":4},"end":{"line":36,"column":22}},"5":{"start":{"line":37,"column":4},"end":{"line":37,"column":44}},"6":{"start":{"line":38,"column":4},"end":{"line":38,"column":19}},"7":{"start":{"line":39,"column":4},"end":{"line":39,"column":22}},"8":{"start":{"line":42,"column":0},"end":{"line":104,"column":2}},"9":{"start":{"line":68,"column":8},"end":{"line":69,"column":31}},"10":{"start":{"line":71,"column":8},"end":{"line":71,"column":24}},"11":{"start":{"line":73,"column":8},"end":{"line":79,"column":10}},"12":{"start":{"line":74,"column":12},"end":{"line":74,"column":28}},"13":{"start":{"line":75,"column":12},"end":{"line":76,"column":77}},"14":{"start":{"line":78,"column":12},"end":{"line":78,"column":24}},"15":{"start":{"line":86,"column":8},"end":{"line":86,"column":24}},"16":{"start":{"line":87,"column":8},"end":{"line":89,"column":9}},"17":{"start":{"line":88,"column":12},"end":{"line":88,"column":70}},"18":{"start":{"line":100,"column":8},"end":{"line":100,"column":33}},"19":{"start":{"line":101,"column":8},"end":{"line":101,"column":25}},"20":{"start":{"line":102,"column":8},"end":{"line":102,"column":20}}},"branchMap":{"1":{"line":35,"type":"binary-expr","locations":[{"start":{"line":35,"column":18},"end":{"line":35,"column":19}},{"start":{"line":35,"column":23},"end":{"line":35,"column":25}}]},"2":{"line":37,"type":"binary-expr","locations":[{"start":{"line":37,"column":19},"end":{"line":37,"column":38}},{"start":{"line":37,"column":42},"end":{"line":37,"column":43}}]},"3":{"line":75,"type":"binary-expr","locations":[{"start":{"line":75,"column":35},"end":{"line":75,"column":37}},{"start":{"line":75,"column":41},"end":{"line":75,"column":74}},{"start":{"line":76,"column":17},"end":{"line":76,"column":75}}]},"4":{"line":76,"type":"cond-expr","locations":[{"start":{"line":76,"column":42},"end":{"line":76,"column":54}},{"start":{"line":76,"column":57},"end":{"line":76,"column":75}}]},"5":{"line":87,"type":"if","locations":[{"start":{"line":87,"column":8},"end":{"line":87,"column":8}},{"start":{"line":87,"column":8},"end":{"line":87,"column":8}}]},"6":{"line":87,"type":"binary-expr","locations":[{"start":{"line":87,"column":12},"end":{"line":87,"column":39}},{"start":{"line":87,"column":43},"end":{"line":87,"column":56}}]}},"code":["(function () { YUI.add('parallel', function (Y, NAME) {","","","/**","* A concurrent parallel processor to help in running several async functions.","* @module parallel","* @main parallel","*/","","/**","A concurrent parallel processor to help in running several async functions.",""," var stack = new Y.Parallel();",""," for (var i = 0; i < 15; i++) {"," Y.io('./api/json/' + i, {"," on: {"," success: stack.add(function() {"," })"," }"," });"," }",""," stack.done(function() {"," });","","@class Parallel","@param {Object} o A config object","@param {Object} [o.context=Y] The execution context of the callback to done","","","*/","","Y.Parallel = function(o) {"," this.config = o || {};"," this.results = [];"," this.context = this.config.context || Y;"," this.total = 0;"," this.finished = 0;","};","","Y.Parallel.prototype = {"," /**"," * An Array of results from all the callbacks in the stack"," * @property results"," * @type Array"," */",""," results: null,"," /**"," * The total items in the stack"," * @property total"," * @type Number"," */"," total: null,"," /**"," * The number of stacked callbacks executed"," * @property finished"," * @type Number"," */"," finished: null,"," /**"," * Add a callback to the stack"," * @method add"," * @param {Function} fn The function callback we are waiting for"," */"," add: function (fn) {"," var self = this,"," index = self.total;",""," self.total += 1;",""," return function () {"," self.finished++;"," self.results[index] = (fn && fn.apply(self.context, arguments)) ||"," (arguments.length === 1 ? arguments[0] : Y.Array(arguments));",""," self.test();"," };"," },"," /**"," * Test to see if all registered items in the stack have completed, if so call the callback to `done`"," * @method test"," */"," test: function () {"," var self = this;"," if (self.finished >= self.total && self.callback) {"," self.callback.call(self.context, self.results, self.data);"," }"," },"," /**"," * The method to call when all the items in the stack are complete."," * @method done"," * @param {Function} callback The callback to execute on complete"," * @param {Mixed} callback.results The results of all the callbacks in the stack"," * @param {Mixed} [callback.data] The data given to the `done` method"," * @param {Mixed} data Mixed data to pass to the success callback"," */"," done: function (callback, data) {"," this.callback = callback;"," this.data = data;"," this.test();"," }","};","","","}, '3.16.0', {\"requires\": [\"yui-base\"]});","","}());"]}; } var __cov_L5sDHvOirn0TVIbpXpofuA = __coverage__['build/parallel/parallel.js']; __cov_L5sDHvOirn0TVIbpXpofuA.s['1']++;YUI.add('parallel',function(Y,NAME){__cov_L5sDHvOirn0TVIbpXpofuA.f['1']++;__cov_L5sDHvOirn0TVIbpXpofuA.s['2']++;Y.Parallel=function(o){__cov_L5sDHvOirn0TVIbpXpofuA.f['2']++;__cov_L5sDHvOirn0TVIbpXpofuA.s['3']++;this.config=(__cov_L5sDHvOirn0TVIbpXpofuA.b['1'][0]++,o)||(__cov_L5sDHvOirn0TVIbpXpofuA.b['1'][1]++,{});__cov_L5sDHvOirn0TVIbpXpofuA.s['4']++;this.results=[];__cov_L5sDHvOirn0TVIbpXpofuA.s['5']++;this.context=(__cov_L5sDHvOirn0TVIbpXpofuA.b['2'][0]++,this.config.context)||(__cov_L5sDHvOirn0TVIbpXpofuA.b['2'][1]++,Y);__cov_L5sDHvOirn0TVIbpXpofuA.s['6']++;this.total=0;__cov_L5sDHvOirn0TVIbpXpofuA.s['7']++;this.finished=0;};__cov_L5sDHvOirn0TVIbpXpofuA.s['8']++;Y.Parallel.prototype={results:null,total:null,finished:null,add:function(fn){__cov_L5sDHvOirn0TVIbpXpofuA.f['3']++;__cov_L5sDHvOirn0TVIbpXpofuA.s['9']++;var self=this,index=self.total;__cov_L5sDHvOirn0TVIbpXpofuA.s['10']++;self.total+=1;__cov_L5sDHvOirn0TVIbpXpofuA.s['11']++;return function(){__cov_L5sDHvOirn0TVIbpXpofuA.f['4']++;__cov_L5sDHvOirn0TVIbpXpofuA.s['12']++;self.finished++;__cov_L5sDHvOirn0TVIbpXpofuA.s['13']++;self.results[index]=(__cov_L5sDHvOirn0TVIbpXpofuA.b['3'][0]++,fn)&&(__cov_L5sDHvOirn0TVIbpXpofuA.b['3'][1]++,fn.apply(self.context,arguments))||(__cov_L5sDHvOirn0TVIbpXpofuA.b['3'][2]++,arguments.length===1?(__cov_L5sDHvOirn0TVIbpXpofuA.b['4'][0]++,arguments[0]):(__cov_L5sDHvOirn0TVIbpXpofuA.b['4'][1]++,Y.Array(arguments)));__cov_L5sDHvOirn0TVIbpXpofuA.s['14']++;self.test();};},test:function(){__cov_L5sDHvOirn0TVIbpXpofuA.f['5']++;__cov_L5sDHvOirn0TVIbpXpofuA.s['15']++;var self=this;__cov_L5sDHvOirn0TVIbpXpofuA.s['16']++;if((__cov_L5sDHvOirn0TVIbpXpofuA.b['6'][0]++,self.finished>=self.total)&&(__cov_L5sDHvOirn0TVIbpXpofuA.b['6'][1]++,self.callback)){__cov_L5sDHvOirn0TVIbpXpofuA.b['5'][0]++;__cov_L5sDHvOirn0TVIbpXpofuA.s['17']++;self.callback.call(self.context,self.results,self.data);}else{__cov_L5sDHvOirn0TVIbpXpofuA.b['5'][1]++;}},done:function(callback,data){__cov_L5sDHvOirn0TVIbpXpofuA.f['6']++;__cov_L5sDHvOirn0TVIbpXpofuA.s['18']++;this.callback=callback;__cov_L5sDHvOirn0TVIbpXpofuA.s['19']++;this.data=data;__cov_L5sDHvOirn0TVIbpXpofuA.s['20']++;this.test();}};},'3.16.0',{'requires':['yui-base']});
robinskumar73/cdnjs
ajax/libs/yui/3.16.0/parallel/parallel-coverage.js
JavaScript
mit
8,974
/** * A JavaScript implementation of the JSON-LD API. * * @author Dave Longley * * BSD 3-Clause License * Copyright (c) 2011-2013 Digital Bazaar, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 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. * * Neither the name of the Digital Bazaar, Inc. nor the names of its * contributors may 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 * HOLDER 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 jsonld API var jsonld = {}; /* Core API */ /** * Performs JSON-LD compaction. * * @param input the JSON-LD input to compact. * @param ctx the context to compact with. * @param [options] options to use: * [base] the base IRI to use. * [strict] use strict mode (default: true). * [optimize] true to optimize the compaction (default: false). * [graph] true to always output a top-level graph (default: false). * [skipExpansion] true to assume the input is expanded and skip * expansion, false not to, defaults to false. * [resolver(url, callback(err, jsonCtx))] the URL resolver to use. * @param callback(err, compacted, ctx) called once the operation completes. */ jsonld.compact = function(input, ctx) { // get arguments var options = {}; var callbackArg = 2; if(arguments.length > 3) { options = arguments[2] || {}; callbackArg += 1; } var callback = arguments[callbackArg]; // nothing to compact if(input === null) { return callback(null, null); } // set default options if(!('base' in options)) { options.base = ''; } if(!('strict' in options)) { options.strict = true; } if(!('optimize' in options)) { options.optimize = false; } if(!('graph' in options)) { options.graph = false; } if(!('skipExpansion' in options)) { options.skipExpansion = false; } if(!('resolver' in options)) { options.resolver = jsonld.urlResolver; } var expand = function(input, options, callback) { if(options.skipExpansion) { return callback(null, input); } jsonld.expand(input, options, callback); }; // expand input then do compaction expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before compaction.', 'jsonld.CompactError', {cause: err})); } // process context var activeCtx = _getInitialContext(options); jsonld.processContext(activeCtx, ctx, options, function(err, activeCtx) { if(err) { return callback(new JsonLdError( 'Could not process context before compaction.', 'jsonld.CompactError', {cause: err})); } try { // create optimize context if(options.optimize) { options.optimizeCtx = {}; } // do compaction var compacted = new Processor().compact( activeCtx, null, expanded, options); cleanup(null, compacted, activeCtx, options); } catch(ex) { callback(ex); } }); }); // performs clean up after compaction function cleanup(err, compacted, activeCtx, options) { if(err) { return callback(err); } // if compacted is an array with 1 entry, remove array unless // graph option is set if(!options.graph && _isArray(compacted) && compacted.length === 1) { compacted = compacted[0]; } // always use array if graph option is on else if(options.graph && _isObject(compacted)) { compacted = [compacted]; } // follow @context key if(_isObject(ctx) && '@context' in ctx) { ctx = ctx['@context']; } // build output context ctx = _clone(ctx); if(!_isArray(ctx)) { ctx = [ctx]; } // add optimize context if(options.optimizeCtx) { ctx.push(options.optimizeCtx); } // remove empty contexts var tmp = ctx; ctx = []; for(var i in tmp) { if(!_isObject(tmp[i]) || Object.keys(tmp[i]).length > 0) { ctx.push(tmp[i]); } } // remove array if only one context var hasContext = (ctx.length > 0); if(ctx.length === 1) { ctx = ctx[0]; } // add context if(hasContext || options.graph) { if(_isArray(compacted)) { // use '@graph' keyword var kwgraph = _compactIri(activeCtx, '@graph'); var graph = compacted; compacted = {}; if(hasContext) { compacted['@context'] = ctx; } compacted[kwgraph] = graph; } else if(_isObject(compacted)) { // reorder keys so @context is first var graph = compacted; compacted = {'@context': ctx}; for(var key in graph) { compacted[key] = graph[key]; } } } callback(null, compacted, activeCtx); } }; /** * Performs JSON-LD expansion. * * @param input the JSON-LD input to expand. * @param [options] the options to use: * [base] the base IRI to use. * [renameBlankNodes] true to rename blank nodes, false not to, * defaults to true. * [keepFreeFloatingNodes] true to keep free-floating nodes, * false not to, defaults to false. * [resolver(url, callback(err, jsonCtx))] the URL resolver to use. * @param callback(err, expanded) called once the operation completes. */ jsonld.expand = function(input) { // get arguments var options = {}; var callback; var callbackArg = 1; if(arguments.length > 2) { options = arguments[1] || {}; callbackArg += 1; } callback = arguments[callbackArg]; // set default options if(!('base' in options)) { options.base = ''; } if(!('resolver' in options)) { options.resolver = jsonld.urlResolver; } if(!('renameBlankNodes' in options)) { options.renameBlankNodes = true; } if(!('keepFreeFloatingNodes' in options)) { options.keepFreeFloatingNodes = false; } // resolve all @context URLs in the input input = _clone(input); _resolveContextUrls(input, options.resolver, function(err, input) { if(err) { return callback(err); } try { // do expansion var activeCtx = _getInitialContext(options); var expanded = new Processor().expand( activeCtx, null, input, options, false); // blank nodes must all be renamed if any were renamed // during expansion ... otherwise there may be conflicts /*if(activeCtx.namer && activeCtx.namer.counter > 0) { _labelBlankNodes(activeCtx.namer, expanded); }*/ // optimize away @graph with no other properties if(_isObject(expanded) && ('@graph' in expanded) && Object.keys(expanded).length === 1) { expanded = expanded['@graph']; } else if(expanded === null) { expanded = []; } // normalize to an array if(!_isArray(expanded)) { expanded = [expanded]; } callback(null, expanded); } catch(ex) { callback(ex); } }); }; /** * Performs JSON-LD flattening. * * @param input the JSON-LD to flatten. * @param context the context to use to compact the flattened output, or null. * @param [options] the options to use: * [base] the base IRI to use. * [resolver(url, callback(err, jsonCtx))] the URL resolver to use. * @param callback(err, flattened) called once the operation completes. */ jsonld.flatten = function(input, context, options, callback) { // get arguments if(typeof options === 'function') { callback = options; options = {}; } // set default options if(!('base' in options)) { options.base = ''; } if(!('resolver' in options)) { options.resolver = jsonld.urlResolver; } // expand input jsonld.expand(input, options, function(err, _input) { if(err) { return callback(new JsonLdError( 'Could not expand input before flattening.', 'jsonld.FlattenError', {cause: err})); } try { // do flattening var flattened = new Processor().flatten(_input); } catch(ex) { return callback(ex); } if(context === null) { return callback(null, flattened); } // compact result (force @graph option to true, skip expansion) options.graph = true; options.skipExpansion = true; jsonld.compact(flattened, ctx, options, function(err, compacted, ctx) { if(err) { return callback(new JsonLdError( 'Could not compact flattened output.', 'jsonld.FlattenError', {cause: err})); } // get graph alias var graph = _compactIri(ctx, '@graph'); // remove @preserve from results compacted[graph] = _removePreserve(ctx, compacted[graph]); callback(null, compacted); }); }); }; /** * Performs JSON-LD framing. * * @param input the JSON-LD input to frame. * @param frame the JSON-LD frame to use. * @param [options] the framing options. * [base] the base IRI to use. * [embed] default @embed flag (default: true). * [explicit] default @explicit flag (default: false). * [omitDefault] default @omitDefault flag (default: false). * [optimize] optimize when compacting (default: false). * [resolver(url, callback(err, jsonCtx))] the URL resolver to use. * @param callback(err, framed) called once the operation completes. */ jsonld.frame = function(input, frame) { // get arguments var options = {}; var callbackArg = 2; if(arguments.length > 3) { options = arguments[2] || {}; callbackArg += 1; } var callback = arguments[callbackArg]; // set default options if(!('base' in options)) { options.base = ''; } if(!('resolver' in options)) { options.resolver = jsonld.urlResolver; } if(!('embed' in options)) { options.embed = true; } options.explicit = options.explicit || false; options.omitDefault = options.omitDefault || false; options.optimize = options.optimize || false; // preserve frame context var ctx = frame['@context'] || {}; // expand input jsonld.expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before framing.', 'jsonld.FrameError', {cause: err})); } // expand frame var opts = _clone(options); opts.keepFreeFloatingNodes = true; jsonld.expand(frame, opts, function(err, expandedFrame) { if(err) { return callback(new JsonLdError( 'Could not expand frame before framing.', 'jsonld.FrameError', {cause: err})); } try { // do framing var framed = new Processor().frame(expanded, expandedFrame, options); } catch(ex) { return callback(ex); } // compact result (force @graph option to true, skip expansion) opts.graph = true; opts.skipExpansion = true; jsonld.compact(framed, ctx, opts, function(err, compacted, ctx) { if(err) { return callback(new JsonLdError( 'Could not compact framed output.', 'jsonld.FrameError', {cause: err})); } // get graph alias var graph = _compactIri(ctx, '@graph'); // remove @preserve from results compacted[graph] = _removePreserve(ctx, compacted[graph]); callback(null, compacted); }); }); }); }; /** * Performs JSON-LD objectification. * * @param input the JSON-LD input to objectify. * @param ctx the JSON-LD context to apply. * @param [options] the framing options. * [base] the base IRI to use. * [resolver(url, callback(err, jsonCtx))] the URL resolver to use. * @param callback(err, objectified) called once the operation completes. */ jsonld.objectify = function(input, ctx) { // get arguments var options = {}; var callbackArg = 2; if(arguments.length > 3) { options = arguments[2] || {}; callbackArg += 1; } var callback = arguments[callbackArg]; // set default options if(!('base' in options)) { options.base = ''; } if(!('resolver' in options)) { options.resolver = jsonld.urlResolver; } // expand input jsonld.expand(input, options, function(err, _input) { if(err) { return callback(new JsonLdError( 'Could not expand input before framing.', 'jsonld.FrameError', {cause: err})); } try { // flatten the graph var flattened = new Processor().flatten(_input); } catch(ex) { return callback(ex); } // compact result (force @graph option to true, skip expansion) options.graph = true; options.skipExpansion = true; jsonld.compact(flattened, ctx, options, function(err, compacted, ctx) { if(err) { return callback(new JsonLdError( 'Could not compact flattened output.', 'jsonld.FrameError', {cause: err})); } // get graph alias var graph = _compactIri(ctx, '@graph'); // remove @preserve from results (named graphs?) compacted[graph] = _removePreserve(ctx, compacted[graph]); var top = compacted[graph][0]; var recurse = function(subject) { // can't replace just a string if(!_isObject(subject) && !_isArray(subject)) { return; } // bottom out recursion on re-visit if(_isObject(subject)) { if(recurse.visited[subject['@id']]) { return; } recurse.visited[subject['@id']] = true; } // each array elementt *or* object key for(var k in subject) { var obj = subject[k]; var isid = (jsonld.getContextValue(ctx, k, '@type') === '@id'); // can't replace a non-object or non-array unless it's an @id if(!_isArray(obj) && !_isObject(obj) && !isid) { continue; } if(_isString(obj) && isid) { subject[k] = obj = top[obj]; recurse(obj); } else if(_isArray(obj)) { for(var i=0; i<obj.length; i++) { if(_isString(obj[i]) && isid) { obj[i] = top[obj[i]]; } else if(_isObject(obj[i]) && '@id' in obj[i]) { obj[i] = top[obj[i]['@id']]; } recurse(obj[i]); } } else if(_isObject(obj)) { var sid = obj['@id']; subject[k] = obj = top[sid]; recurse(obj); } } }; recurse.visited = {}; recurse(top); compacted.of_type = {}; for(var s in top) { if(!('@type' in top[s])) { continue; } var types = top[s]['@type']; if(!_isArray(types)) { types = [types]; } for(var t in types) { if(!(types[t] in compacted.of_type)) { compacted.of_type[types[t]] = []; } compacted.of_type[types[t]].push(top[s]); } } callback(null, compacted); }); }); }; /** * Performs RDF normalization on the given JSON-LD input. The output is * a sorted array of RDF statements unless the 'format' option is used. * * @param input the JSON-LD input to normalize. * @param [options] the options to use: * [base] the base IRI to use. * @param [options] the options to use: * [format] the format if output is a string: * 'application/nquads' for N-Quads. * [resolver(url, callback(err, jsonCtx))] the URL resolver to use. * @param callback(err, normalized) called once the operation completes. */ jsonld.normalize = function(input, callback) { // get arguments var options = {}; var callback; var callbackArg = 1; if(arguments.length > 2) { options = arguments[1] || {}; callbackArg += 1; } callback = arguments[callbackArg]; // set default options if(!('base' in options)) { options.base = ''; } if(!('resolver' in options)) { options.resolver = jsonld.urlResolver; } // expand input then do normalization jsonld.expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before normalization.', 'jsonld.NormalizeError', {cause: err})); } // do normalization new Processor().normalize(expanded, options, callback); }); }; /** * Converts RDF statements into JSON-LD. * * @param statements a serialized string of RDF statements in a format * specified by the format option or an array of the RDF statements * to convert. * @param [options] the options to use: * [format] the format if input is not an array: * 'application/nquads' for N-Quads (default). * [useRdfType] true to use rdf:type, false to use @type * (default: false). * [useNativeTypes] true to convert XSD types into native types * (boolean, integer, double), false not to (default: true). * * @param callback(err, output) called once the operation completes. */ jsonld.fromRDF = function(statements) { // get arguments var options = {}; var callback; var callbackArg = 1; if(arguments.length > 2) { options = arguments[1] || {}; callbackArg += 1; } callback = arguments[callbackArg]; // set default options if(!('useRdfType' in options)) { options.useRdfType = false; } if(!('useNativeTypes' in options)) { options.useNativeTypes = true; } if(!('format' in options) && !_isArray(statements)) { // set default format to nquads if(!('format' in options)) { options.format = 'application/nquads'; } } // handle special format if('format' in options) { // supported formats if(options.format in _rdfParsers) { statements = _rdfParsers[options.format](statements); } else { throw new JsonLdError( 'Unknown input format.', 'jsonld.UnknownFormat', {format: options.format}); } } // convert from RDF new Processor().fromRDF(statements, options, callback); }; /** * Outputs the RDF statements found in the given JSON-LD object. * * @param input the JSON-LD input. * @param [options] the options to use: * [base] the base IRI to use. * [format] the format to use to output a string: * 'application/nquads' for N-Quads (default). * [collate] true to output all statements at once (in an array * or as a formatted string), false to output one statement at * a time (default). * [resolver(url, callback(err, jsonCtx))] the URL resolver to use. * @param callback(err, statement) called when a statement is output, with the * last statement as null. */ jsonld.toRDF = function(input) { // get arguments var options = {}; var callback; var callbackArg = 1; if(arguments.length > 2) { options = arguments[1] || {}; callbackArg += 1; } callback = arguments[callbackArg]; // set default options if(!('base' in options)) { options.base = ''; } if(!('resolver' in options)) { options.resolver = jsonld.urlResolver; } if(!('collate' in options)) { options.collate = false; } if(options.collate) { // output array/string of statements all at once var statements = []; var collateCallback = callback; callback = function(err, statement) { if(err) { return collateCallback(err); } if(statement !== null) { // do not allow duplicate statements for(var i in statements) { if(_compareRdfStatements(statements[i], statement)) { return; } } statements.push(statement); } else { // if outputting a string, sort and join statements if('format' in options) { statements = statements.sort().join(''); } collateCallback(null, statements); } }; } if('format' in options) { // supported formats if(options.format === 'application/nquads') { var statementCallback = callback; callback = function(err, statement) { if(err) { return statementCallback(err); } if(statement !== null) { statement = _toNQuad(statement); } statementCallback(null, statement); }; } else { throw new JsonLdError( 'Unknown output format.', 'jsonld.UnknownFormat', {format: options.format}); } } // expand input jsonld.expand(input, options, function(err, expanded) { if(err) { return callback(new JsonLdError( 'Could not expand input before conversion to RDF.', 'jsonld.RdfError', {cause: err})); } try { // output RDF statements var namer = new UniqueNamer('_:t'); new Processor().toRDF(expanded, namer, null, null, null, callback); } catch(ex) { callback(ex); } }); }; /** * The default URL resolver for external @context URLs. * * @param resolver(url, callback(err, ctx)) the resolver to use. */ jsonld.urlResolver = function(url, callback) { return callback(new JsonLdError( 'Could not resolve @context URL. URL resolution not implemented.', 'jsonld.ContextUrlError')); }; /* Utility API */ /** * Creates a simple context cache. * * @param size the maximum size of the cache. */ jsonld.ContextCache = function(size) { this.order = []; this.cache = {}; this.size = size || 50; this.expires = 30*60*1000; }; jsonld.ContextCache.prototype.get = function(url) { if(url in this.cache) { var entry = this.cache[url]; if(entry.expires >= +new Date()) { return entry.ctx; } delete this.cache[url]; this.order.splice(this.order.indexOf(url), 1); } return null; }; jsonld.ContextCache.prototype.set = function(url, ctx) { if(this.order.length === this.size) { delete this.cache[this.order.shift()]; } this.order.push(url); this.cache[url] = {ctx: ctx, expires: (+new Date() + this.expires)}; }; /** * Creates an active context cache. * * @param size the maximum size of the cache. */ jsonld.ActiveContextCache = function(size) { this.order = []; this.cache = {}; this.size = size || 100; }; jsonld.ActiveContextCache.prototype.get = function(activeCtx, localCtx) { var key1 = JSON.stringify(activeCtx); var key2 = JSON.stringify(localCtx); var level1 = this.cache[key1]; if(level1 && key2 in level1) { // get shareable copy of cached active context return level1[key2].share(); } return null; }; jsonld.ActiveContextCache.prototype.set = function( activeCtx, localCtx, result) { if(this.order.length === this.size) { var entry = this.order.shift(); delete this.cache[entry.activeCtx][entry.localCtx]; } var key1 = JSON.stringify(activeCtx); var key2 = JSON.stringify(localCtx); this.order.push({activeCtx: key1, localCtx: key2}); if(!(key1 in this.cache)) { this.cache[key1] = {}; } this.cache[key1][key2] = result; }; /** * Default JSON-LD cache. */ jsonld.cache = { activeCtx: new jsonld.ActiveContextCache() }; /** * URL resolvers. */ jsonld.urlResolvers = {}; /** * The built-in jquery URL resolver. */ jsonld.urlResolvers['jquery'] = function($) { var cache = new jsonld.ContextCache(); return function(url, callback) { var ctx = cache.get(url); if(ctx !== null) { return callback(null, ctx); } $.ajax({ url: url, dataType: 'json', crossDomain: true, success: function(data, textStatus, jqXHR) { cache.set(url, data); callback(null, data); }, error: function(jqXHR, textStatus, errorThrown) { callback(errorThrown); } }); }; }; /** * The built-in node URL resolver. */ jsonld.urlResolvers['node'] = function() { var request = require('request'); var cache = new jsonld.ContextCache(); return function(url, callback) { var ctx = cache.get(url); if(ctx !== null) { return callback(null, ctx); } request(url, function(err, res, body) { if(!err) { cache.set(url, body); } callback(err, body); }); }; }; /** * Assigns the default URL resolver for external @context URLs to a built-in * default. Supported types currently include: 'jquery'. * * To use the jquery URL resolver, the 'data' parameter must be a reference * to the main jquery object. * * @param type the type to set. * @param [params] the parameters required to use the resolver. */ jsonld.useUrlResolver = function(type) { if(!(type in jsonld.urlResolvers)) { throw new JsonLdError( 'Unknown @context URL resolver type: "' + type + '"', 'jsonld.UnknownUrlResolver', {type: type}); } // set URL resolver jsonld.urlResolver = jsonld.urlResolvers[type].apply( jsonld, Array.prototype.slice.call(arguments, 1)); }; /** * Processes a local context, resolving any URLs as necessary, and returns a * new active context in its callback. * * @param activeCtx the current active context. * @param localCtx the local context to process. * @param [options] the options to use: * [resolver(url, callback(err, jsonCtx))] the URL resolver to use. * @param callback(err, ctx) called once the operation completes. */ jsonld.processContext = function(activeCtx, localCtx) { // get arguments var options = {}; var callbackArg = 2; if(arguments.length > 3) { options = arguments[2] || {}; callbackArg += 1; } var callback = arguments[callbackArg]; // set default options if(!('base' in options)) { options.base = ''; } if(!('resolver' in options)) { options.resolver = jsonld.urlResolver; } // return initial context early for null context if(localCtx === null) { return callback(null, _getInitialContext(options)); } // resolve URLs in localCtx localCtx = _clone(localCtx); if(_isObject(localCtx) && !('@context' in localCtx)) { localCtx = {'@context': localCtx}; } _resolveContextUrls(localCtx, options.resolver, function(err, ctx) { if(err) { return callback(err); } try { // process context ctx = new Processor().processContext(activeCtx, ctx, options); callback(null, ctx); } catch(ex) { callback(ex); } }); }; /** * Returns true if the given subject has the given property. * * @param subject the subject to check. * @param property the property to look for. * * @return true if the subject has the given property, false if not. */ jsonld.hasProperty = function(subject, property) { var rval = false; if(property in subject) { var value = subject[property]; rval = (!_isArray(value) || value.length > 0); } return rval; }; /** * Determines if the given value is a property of the given subject. * * @param subject the subject to check. * @param property the property to check. * @param value the value to check. * * @return true if the value exists, false if not. */ jsonld.hasValue = function(subject, property, value) { var rval = false; if(jsonld.hasProperty(subject, property)) { var val = subject[property]; var isList = _isList(val); if(_isArray(val) || isList) { if(isList) { val = val['@list']; } for(var i in val) { if(jsonld.compareValues(value, val[i])) { rval = true; break; } } } // avoid matching the set of values with an array value parameter else if(!_isArray(value)) { rval = jsonld.compareValues(value, val); } } return rval; }; /** * Adds a value to a subject. If the value is an array, all values in the * array will be added. * * @param subject the subject to add the value to. * @param property the property that relates the value to the subject. * @param value the value to add. * @param [options] the options to use: * [propertyIsArray] true if the property is always an array, false * if not (default: false). * [allowDuplicate] true to allow duplicates, false not to (uses a * simple shallow comparison of subject ID or value) (default: true). */ jsonld.addValue = function(subject, property, value, options) { options = options || {}; if(!('propertyIsArray' in options)) { options.propertyIsArray = false; } if(!('allowDuplicate' in options)) { options.allowDuplicate = true; } if(_isArray(value)) { if(value.length === 0 && options.propertyIsArray && !(property in subject)) { subject[property] = []; } for(var i in value) { jsonld.addValue(subject, property, value[i], options); } } else if(property in subject) { // check if subject already has value if duplicates not allowed var hasValue = (!options.allowDuplicate && jsonld.hasValue(subject, property, value)); // make property an array if value not present or always an array if(!_isArray(subject[property]) && (!hasValue || options.propertyIsArray)) { subject[property] = [subject[property]]; } // add new value if(!hasValue) { subject[property].push(value); } } else { // add new value as set or single value subject[property] = options.propertyIsArray ? [value] : value; } }; /** * Gets all of the values for a subject's property as an array. * * @param subject the subject. * @param property the property. * * @return all of the values for a subject's property as an array. */ jsonld.getValues = function(subject, property) { var rval = subject[property] || []; if(!_isArray(rval)) { rval = [rval]; } return rval; }; /** * Removes a property from a subject. * * @param subject the subject. * @param property the property. */ jsonld.removeProperty = function(subject, property) { delete subject[property]; }; /** * Removes a value from a subject. * * @param subject the subject. * @param property the property that relates the value to the subject. * @param value the value to remove. * @param [options] the options to use: * [propertyIsArray] true if the property is always an array, false * if not (default: false). */ jsonld.removeValue = function(subject, property, value, options) { options = options || {}; if(!('propertyIsArray' in options)) { options.propertyIsArray = false; } // filter out value var values = jsonld.getValues(subject, property).filter(function(e) { return !jsonld.compareValues(e, value); }); if(values.length === 0) { jsonld.removeProperty(subject, property); } else if(values.length === 1 && !options.propertyIsArray) { subject[property] = values[0]; } else { subject[property] = values; } }; /** * Compares two JSON-LD values for equality. Two JSON-LD values will be * considered equal if: * * 1. They are both primitives of the same type and value. * 2. They are both @values with the same @value, @type, @language, * and @index, OR * 3. They are both @lists with the same @list and @index, OR * 4. They both have @ids they are the same. * * @param v1 the first value. * @param v2 the second value. * * @return true if v1 and v2 are considered equal, false if not. */ jsonld.compareValues = function(v1, v2) { // 1. equal primitives if(v1 === v2) { return true; } // 2. equal @values if(_isValue(v1) && _isValue(v2) && v1['@value'] === v2['@value'] && v1['@type'] === v2['@type'] && v1['@language'] === v2['@language'] && v1['@index'] === v2['@index']) { return true; } // 3. equal @lists if(_isList(v1) && _isList(v2)) { if(v1['@index'] !== v2['@index']) { return false; } var list1 = v1['@list']; var list2 = v2['@list']; if(list1.length !== list2.length) { return false; } for(var i = 0; i < list1.length; ++i) { if(!jsonld.compareValues(list1[i], list2[i])) { return false; } } return true; } // 4. equal @ids if(_isObject(v1) && ('@id' in v1) && _isObject(v2) && ('@id' in v2)) { return v1['@id'] === v2['@id']; } return false; }; /** * Gets the value for the given active context key and type, null if none is * set. * * @param ctx the active context. * @param key the context key. * @param [type] the type of value to get (eg: '@id', '@type'), if not * specified gets the entire entry for a key, null if not found. * * @return the value. */ jsonld.getContextValue = function(ctx, key, type) { var rval = null; // return null for invalid key if(key === null) { return rval; } // get default language if(type === '@language' && (type in ctx)) { rval = ctx[type]; } // get specific entry information if(ctx.mappings[key]) { var entry = ctx.mappings[key]; // return whole entry if(_isUndefined(type)) { rval = entry; } // return entry value for type else if(type in entry) { rval = entry[type]; } } return rval; }; /** Registered RDF Statement parsers hashed by content-type. */ var _rdfParsers = {}; /** * Registers an RDF Statement parser by content-type, for use with * jsonld.fromRDF. * * @param contentType the content-type for the parser. * @param parser(input) the parser function (takes a string as a parameter * and returns an array of RDF statements). */ jsonld.registerRDFParser = function(contentType, parser) { _rdfParsers[contentType] = parser; }; /** * Unregisters an RDF Statement parser by content-type. * * @param contentType the content-type for the parser. */ jsonld.unregisterRDFParser = function(contentType) { delete _rdfParsers[contentType]; }; // determine if in-browser or using node.js var _nodejs = (typeof module !== 'undefined'); var _browser = !_nodejs; // export nodejs API if(_nodejs) { module.exports = jsonld; // use node URL resolver by default jsonld.useUrlResolver('node'); // needed for serialization of XML literals if(typeof XMLSerializer === 'undefined') { var XMLSerializer = null; } if(typeof Node === 'undefined') { var Node = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE:12 }; } } // export AMD API if(typeof define === 'function' && define.amd) { define('jsonld', [], function() { return jsonld; }); } // export simple browser API else if(_browser) { window.jsonld = window.jsonld || jsonld; } // constants var XSD_BOOLEAN = 'http://www.w3.org/2001/XMLSchema#boolean'; var XSD_DOUBLE = 'http://www.w3.org/2001/XMLSchema#double'; var XSD_INTEGER = 'http://www.w3.org/2001/XMLSchema#integer'; var XSD_STRING = 'http://www.w3.org/2001/XMLSchema#string'; var RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; var RDF_FIRST = RDF + 'first'; var RDF_REST = RDF + 'rest'; var RDF_NIL = RDF + 'nil'; var RDF_TYPE = RDF + 'type'; var RDF_PLAIN_LITERAL = RDF + 'PlainLiteral'; var RDF_XML_LITERAL = RDF + 'XMLLiteral'; var RDF_OBJECT = RDF + 'object'; var MAX_CONTEXT_URLS = 10; /** * A JSON-LD Error. * * @param msg the error message. * @param type the error type. * @param details the error details. */ var JsonLdError = function(msg, type, details) { if(_nodejs) { Error.call(this); Error.captureStackTrace(this, this.constructor); } this.name = type || 'jsonld.Error'; this.message = msg || 'An unspecified JSON-LD error occurred.'; this.details = details || {}; }; if(_nodejs) { require('util').inherits(JsonLdError, Error); } /** * Constructs a new JSON-LD Processor. */ var Processor = function() {}; /** * Recursively compacts an element using the given active context. All values * must be in expanded form before this method is called. * * @param activeCtx the active context to use. * @param activeProperty the compacted property assoicated with the element * to compact, null for none. * @param element the element to compact. * @param options the compaction options. * * @return the compacted value. */ Processor.prototype.compact = function( activeCtx, activeProperty, element, options) { // recursively compact array if(_isArray(element)) { var rval = []; for(var i in element) { // compact, dropping any null values var compacted = this.compact( activeCtx, activeProperty, element[i], options); if(compacted !== null) { rval.push(compacted); } } if(rval.length === 1) { // use single element if no container is specified var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); if(container === null) { rval = rval[0]; } } return rval; } // recursively compact object if(_isObject(element)) { // do value compaction on @values and subject references if(_isValue(element) || _isSubjectReference(element)) { return _compactValue(activeCtx, activeProperty, element); } // shallow copy element and arrays so keys and values can be removed // during property generator compaction var shallow = {}; for(var expandedProperty in element) { if(_isArray(element[expandedProperty])) { shallow[expandedProperty] = element[expandedProperty].slice(); } else { shallow[expandedProperty] = element[expandedProperty]; } } element = shallow; // process element keys in order var keys = Object.keys(element).sort(); var rval = {}; for(var ki = 0; ki < keys.length; ++ki) { var expandedProperty = keys[ki]; // skip key if removed during property generator duplicate handling if(!(expandedProperty in element)) { continue; } var expandedValue = element[expandedProperty]; // compact @id and @type(s) if(expandedProperty === '@id' || expandedProperty === '@type') { var compactedValue; // compact single @id if(_isString(expandedValue)) { compactedValue = _compactIri( activeCtx, expandedValue, null, {base: true, vocab: (expandedProperty === '@type')}); } // expanded value must be a @type array else { compactedValue = []; for(var vi = 0; vi < expandedValue.length; ++vi) { compactedValue.push(_compactIri( activeCtx, expandedValue[vi], null, {base: true, vocab: true})); } } // use keyword alias and add value var alias = _compactIri(activeCtx, expandedProperty); var isArray = (_isArray(compactedValue) && expandedValue.length === 0); jsonld.addValue( rval, alias, compactedValue, {propertyIsArray: isArray}); continue; } // handle @index property if(expandedProperty === '@index') { // drop @index if inside an @index container var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); if(container === '@index') { continue; } // use keyword alias and add value var alias = _compactIri(activeCtx, expandedProperty); jsonld.addValue(rval, alias, expandedValue); continue; } // Note: expanded value must be an array due to expansion algorithm. // preserve empty arrays if(expandedValue.length === 0) { var activeProperty = _compactIri( activeCtx, expandedProperty, null, {vocab: true}, element); jsonld.addValue(rval, activeProperty, [], {propertyIsArray: true}); } // recusively process array values for(var vi = 0; vi < expandedValue.length; ++vi) { var expandedItem = expandedValue[vi]; // compact property and get container type var activeProperty = _compactIri( activeCtx, expandedProperty, expandedItem, {vocab: true}, element); var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); // remove any duplicates that were (presumably) generated by a // property generator var mapping = activeCtx.mappings[activeProperty]; if(mapping && mapping.propertyGenerator) { _findAndRemovePropertyGeneratorDuplicates( activeCtx, element, expandedProperty, expandedItem, activeProperty); } // get @list value if appropriate var isList = _isList(expandedItem); var list = null; if(isList) { list = expandedItem['@list']; } // recursively compact expanded item var compactedItem = this.compact( activeCtx, activeProperty, isList ? list : expandedItem, options); // handle @list if(isList) { // ensure @list value is an array if(!_isArray(compactedItem)) { compactedItem = [compactedItem]; } if(container !== '@list') { // wrap using @list alias var wrapper = {}; wrapper[_compactIri(activeCtx, '@list')] = compactedItem; compactedItem = wrapper; // include @index from expanded @list, if any if('@index' in expandedItem) { compactedItem[_compactIri(activeCtx, '@index')] = expandedItem['@index']; } } // can't use @list container for more than 1 list else if(activeProperty in rval) { throw new JsonLdError( 'JSON-LD compact error; property has a "@list" @container ' + 'rule but there is more than a single @list that matches ' + 'the compacted term in the document. Compaction might mix ' + 'unwanted items into the list.', 'jsonld.SyntaxError'); } } // handle language and index maps if(container === '@language' || container === '@index') { // get or create the map object var mapObject; if(activeProperty in rval) { mapObject = rval[activeProperty]; } else { rval[activeProperty] = mapObject = {}; } // if container is a language map, simplify compacted value to // a simple string if(container === '@language' && _isValue(compactedItem)) { compactedItem = compactedItem['@value']; } // add compact value to map object using key from expanded value // based on the container type jsonld.addValue(mapObject, expandedItem[container], compactedItem); } else { // use an array if: @container is @set or @list , value is an empty // array, or key is @graph var isArray = (container === '@set' || container === '@list' || (_isArray(compactedItem) && compactedItem.length === 0) || expandedProperty === '@graph'); // add compact value jsonld.addValue( rval, activeProperty, compactedItem, {propertyIsArray: isArray}); } } } return rval; } // only primitives remain which are already compact return element; }; /** * Recursively expands an element using the given context. Any context in * the element will be removed. All context URLs must have been resolved * before calling this method. * * @param activeCtx the context to use. * @param activeProperty the property for the element, null for none. * @param element the element to expand. * @param options the expansion options. * @param insideList true if the element is a list, false if not. * * @return the expanded value. */ Processor.prototype.expand = function( activeCtx, activeProperty, element, options, insideList) { var self = this; if(typeof element === 'undefined') { throw new JsonLdError( 'Invalid JSON-LD syntax; undefined element.', 'jsonld.SyntaxError'); } // nothing to expand if(element === null) { return null; } // recursively expand array if(_isArray(element)) { var rval = []; for(var i in element) { // expand element var e = self.expand( activeCtx, activeProperty, element[i], options, insideList); if(insideList && (_isArray(e) || _isList(e))) { // lists of lists are illegal throw new JsonLdError( 'Invalid JSON-LD syntax; lists of lists are not permitted.', 'jsonld.SyntaxError'); } // drop null values else if(e !== null) { if(_isArray(e)) { rval = rval.concat(e); } else { rval.push(e); } } } return rval; } // recursively expand object if(_isObject(element)) { // if element has a context, process it if('@context' in element) { activeCtx = self.processContext(activeCtx, element['@context'], options); delete element['@context']; } // expand the active property var expandedActiveProperty = _expandIri(activeCtx, activeProperty); var rval = {}; var keys = Object.keys(element).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; var value = element[key]; var expandedProperty; var expandedValue; // expand key using property generator var mapping = activeCtx.mappings[key]; if(mapping && mapping.propertyGenerator) { expandedProperty = mapping['@id']; } // expand key to IRI else { expandedProperty = _expandIri(activeCtx, key, {vocab: true}); } // drop non-absolute IRI keys that aren't keywords if(expandedProperty === null || !(_isArray(expandedProperty) || _isAbsoluteIri(expandedProperty) || _isKeyword(expandedProperty, activeCtx))) { continue; } // syntax error if @id is not a string if(expandedProperty === '@id' && !_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@id" value must a string.', 'jsonld.SyntaxError', {value: value}); } // validate @type value if(expandedProperty === '@type') { _validateTypeValue(value); } // @graph must be an array or an object if(expandedProperty === '@graph' && !(_isObject(value) || _isArray(value))) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@value" value must not be an ' + 'object or an array.', 'jsonld.SyntaxError', {value: value}); } // @value must not be an object or an array if(expandedProperty === '@value' && (_isObject(value) || _isArray(value))) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@value" value must not be an ' + 'object or an array.', 'jsonld.SyntaxError', {value: value}); } // @language must be a string if(expandedProperty === '@language') { if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@language" value must be a string.', 'jsonld.SyntaxError', {value: value}); } // ensure language value is lowercase expandedValue = value.toLowerCase(); } // preserve @index if(expandedProperty === '@index') { if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@index" value must be a string.', 'jsonld.SyntaxError', {value: value}); } } var container = jsonld.getContextValue(activeCtx, key, '@container'); // handle language map container (skip if value is not an object) if(container === '@language' && _isObject(value)) { expandedValue = _expandLanguageMap(value); } // handle index container (skip if value is not an object) else if(container === '@index' && _isObject(value)) { expandedValue = (function _expandIndexMap(activeProperty) { var rval = []; var keys = Object.keys(value).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; var val = value[key]; if(!_isArray(val)) { val = [val]; } val = self.expand(activeCtx, activeProperty, val, options, false); for(var vi = 0; vi < val.length; ++vi) { var item = val[vi]; if(!('@index' in item)) { item['@index'] = key; } rval.push(item); } } return rval; })(key); } else { // recurse into @list or @set var isList = (expandedProperty === '@list'); if(isList || expandedProperty === '@set') { var nextActiveProperty = activeProperty; if(isList && expandedActiveProperty === '@graph') { nextActiveProperty = null; } expandedValue = self.expand( activeCtx, nextActiveProperty, value, options, isList); if(isList && _isList(expandedValue)) { throw new JsonLdError( 'Invalid JSON-LD syntax; lists of lists are not permitted.', 'jsonld.SyntaxError'); } } else { // recursively expand value with key as new active property expandedValue = self.expand(activeCtx, key, value, options, false); } } // drop null values if property is not @value if(expandedValue === null && expandedProperty !== '@value') { continue; } // convert expanded value to @list if container specifies it if(expandedProperty !== '@list' && !_isList(expandedValue) && container === '@list') { // ensure expanded value is an array expandedValue = (_isArray(expandedValue) ? expandedValue : [expandedValue]); expandedValue = {'@list': expandedValue}; } // add copy of value for each property from property generator if(_isArray(expandedProperty)) { _labelBlankNodes(activeCtx.namer, expandedValue); for(var i = 0; i < expandedProperty.length; ++i) { jsonld.addValue( rval, expandedProperty[i], _clone(expandedValue), {propertyIsArray: true}); } } // add value for property else { // use an array except for certain keywords var useArray = ['@index', '@id', '@type', '@value', '@language'].indexOf( expandedProperty) === -1; jsonld.addValue( rval, expandedProperty, expandedValue, {propertyIsArray: useArray}); } } // get property count on expanded output keys = Object.keys(rval); var count = keys.length; if('@value' in rval) { // @value must only have @language or @type if('@type' in rval && '@language' in rval) { throw new JsonLdError( 'Invalid JSON-LD syntax; an element containing "@value" may not ' + 'contain both "@type" and "@language".', 'jsonld.SyntaxError', {element: rval}); } var validCount = count - 1; if('@type' in rval) { validCount -= 1; } if('@index' in rval) { validCount -= 1; } if('@language' in rval) { validCount -= 1; } if(validCount !== 0) { throw new JsonLdError( 'Invalid JSON-LD syntax; an element containing "@value" may only ' + 'have an "@index" property and at most one other property ' + 'which can be "@type" or "@language".', 'jsonld.SyntaxError', {element: rval}); } // drop null @values if(rval['@value'] === null) { rval = null; } // drop @language if @value isn't a string else if('@language' in rval && !_isString(rval['@value'])) { delete rval['@language']; } } // convert @type to an array else if('@type' in rval && !_isArray(rval['@type'])) { rval['@type'] = [rval['@type']]; } // handle @set and @list else if('@set' in rval || '@list' in rval) { if(count > 1 && (count !== 2 && '@index' in rval)) { throw new JsonLdError( 'Invalid JSON-LD syntax; if an element has the property "@set" ' + 'or "@list", then it can have at most one other property that is ' + '"@index".', 'jsonld.SyntaxError', {element: rval}); } // optimize away @set if('@set' in rval) { rval = rval['@set']; keys = Object.keys(rval); count = keys.length; } } // drop objects with only @language else if(count === 1 && '@language' in rval) { rval = null; } // drop certain top-level objects that do not occur in lists if(!options.keepFreeFloatingNodes && !insideList && (activeProperty === null || expandedActiveProperty === '@graph')) { // drop empty object or top-level @value if(count === 0 || ('@value' in rval)) { rval = null; } else { // drop subjects that generate no triples var hasTriples = false; for(var ki = 0; !hasTriples && ki < keys.length; ++ki) { if(!_isKeyword(keys[ki]) || ['@graph', '@type', '@list'].indexOf(keys[ki]) !== -1) { hasTriples = true; } } if(!hasTriples) { rval = null; } } } return rval; } // drop top-level scalars that are not in lists if(!insideList && (activeProperty === null || _expandIri(activeCtx, activeProperty) === '@graph')) { return null; } // expand element according to value expansion rules return _expandValue(activeCtx, activeProperty, element); }; /** * Performs JSON-LD flattening. * * @param input the expanded JSON-LD to flatten. * * @return the flattened output. */ Processor.prototype.flatten = function(input) { // produce a map of all subjects and name each bnode var namer = new UniqueNamer('_:t'); var graphs = {'@default': {}}; _createNodeMap(input, graphs, '@default', namer); // add all non-default graphs to default graph var defaultGraph = graphs['@default']; for(var graphName in graphs) { if(graphName === '@default') { continue; } var subject = defaultGraph[graphName]; if(!subject) { defaultGraph[graphName] = subject = { '@id': graphName, '@graph': [] }; } else if(!('@graph' in subject)) { subject['@graph'] = []; } var graph = subject['@graph']; var nodeMap = graphs[graphName]; var ids = Object.keys(nodeMap).sort(); for(var ii = 0; ii < ids.length; ++ii) { var id = ids[ii]; graph.push(nodeMap[id]); } } // produce flattened output var flattened = []; var keys = Object.keys(defaultGraph).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; flattened.push(defaultGraph[key]); } return flattened; }; /** * Performs JSON-LD framing. * * @param input the expanded JSON-LD to frame. * @param frame the expanded JSON-LD frame to use. * @param options the framing options. * * @return the framed output. */ Processor.prototype.frame = function(input, frame, options) { // create framing state var state = { options: options, graphs: {'@default': {}, '@merged': {}} }; // produce a map of all graphs and name each bnode // FIXME: currently uses subjects from @merged graph only namer = new UniqueNamer('_:t'); _createNodeMap(input, state.graphs, '@merged', namer); state.subjects = state.graphs['@merged']; // frame the subjects var framed = []; _frame(state, Object.keys(state.subjects).sort(), frame, framed, null); return framed; }; /** * Performs RDF normalization on the given JSON-LD input. * * @param input the expanded JSON-LD object to normalize. * @param options the normalization options. * @param callback(err, normalized) called once the operation completes. */ Processor.prototype.normalize = function(input, options, callback) { // map bnodes to RDF statements var statements = []; var bnodes = {}; var namer = new UniqueNamer('_:t'); new Processor().toRDF(input, namer, null, null, null, mapStatements); // maps bnodes to their statements and then start bnode naming function mapStatements(err, statement) { if(err) { return callback(err); } if(statement === null) { // mapping complete, start canonical naming namer = new UniqueNamer('_:c14n'); return hashBlankNodes(Object.keys(bnodes)); } // add statement and do mapping for(var i in statements) { if(_compareRdfStatements(statements[i], statement)) { return; } } statements.push(statement); var nodes = ['subject', 'object']; for(var n in nodes) { var node = nodes[n]; var id = statement[node].nominalValue; if(statement[node].interfaceName === 'BlankNode') { if(id in bnodes) { bnodes[id].statements.push(statement); } else { bnodes[id] = {statements: [statement]}; } } } } // generates unique and duplicate hashes for bnodes function hashBlankNodes(unnamed) { var nextUnnamed = []; var duplicates = {}; var unique = {}; // hash statements for each unnamed bnode setTimeout(function() {hashUnnamed(0);}, 0); function hashUnnamed(i) { if(i === unnamed.length) { // done, name blank nodes return nameBlankNodes(unique, duplicates, nextUnnamed); } // hash unnamed bnode var bnode = unnamed[i]; var hash = _hashStatements(bnode, bnodes, namer); // store hash as unique or a duplicate if(hash in duplicates) { duplicates[hash].push(bnode); nextUnnamed.push(bnode); } else if(hash in unique) { duplicates[hash] = [unique[hash], bnode]; nextUnnamed.push(unique[hash]); nextUnnamed.push(bnode); delete unique[hash]; } else { unique[hash] = bnode; } // hash next unnamed bnode setTimeout(function() {hashUnnamed(i + 1);}, 0); } } // names unique hash bnodes function nameBlankNodes(unique, duplicates, unnamed) { // name unique bnodes in sorted hash order var named = false; var hashes = Object.keys(unique).sort(); for(var i in hashes) { var bnode = unique[hashes[i]]; namer.getName(bnode); named = true; } // continue to hash bnodes if a bnode was assigned a name if(named) { hashBlankNodes(unnamed); } // name the duplicate hash bnodes else { nameDuplicates(duplicates); } } // names duplicate hash bnodes function nameDuplicates(duplicates) { // enumerate duplicate hash groups in sorted order var hashes = Object.keys(duplicates).sort(); // process each group processGroup(0); function processGroup(i) { if(i === hashes.length) { // done, create JSON-LD array return createArray(); } // name each group member var group = duplicates[hashes[i]]; var results = []; nameGroupMember(group, 0); function nameGroupMember(group, n) { if(n === group.length) { // name bnodes in hash order results.sort(function(a, b) { a = a.hash; b = b.hash; return (a < b) ? -1 : ((a > b) ? 1 : 0); }); for(var r in results) { // name all bnodes in path namer in key-entry order // Note: key-order is preserved in javascript for(var key in results[r].pathNamer.existing) { namer.getName(key); } } return processGroup(i + 1); } // skip already-named bnodes var bnode = group[n]; if(namer.isNamed(bnode)) { return nameGroupMember(group, n + 1); } // hash bnode paths var pathNamer = new UniqueNamer('_:t'); pathNamer.getName(bnode); _hashPaths(bnode, bnodes, namer, pathNamer, function(err, result) { if(err) { return callback(err); } results.push(result); nameGroupMember(group, n + 1); }); } } } // creates the sorted array of RDF statements function createArray() { var normalized = []; // update bnode names in each statement and serialize for(var i in statements) { var statement = statements[i]; var nodes = ['subject', 'object']; for(var n in nodes) { var node = nodes[n]; if(statement[node].interfaceName === 'BlankNode') { statement[node].nominalValue = namer.getName( statement[node].nominalValue); } } normalized.push(_toNQuad(statement)); } // sort normalized output normalized.sort(); // handle output format if('format' in options) { if(options.format === 'application/nquads') { return callback(null, normalized.join('')); } else { return callback(new JsonLdError( 'Unknown output format.', 'jsonld.UnknownFormat', {format: options.format})); } } // output parsed RDF statements callback(null, _parseNQuads(normalized.join(''))); } }; /** * Converts RDF statements into JSON-LD. * * @param statements the RDF statements. * @param options the RDF conversion options. * @param callback(err, output) called once the operation completes. */ Processor.prototype.fromRDF = function(statements, options, callback) { // prepare graph map (maps graph name => subjects, lists) var defaultGraph = {subjects: {}, listMap: {}}; var graphs = {'': defaultGraph}; for(var i in statements) { var statement = statements[i]; // get subject, property, object, and graph name (default to '') var s = statement.subject.nominalValue; var p = statement.property.nominalValue; var o = statement.object; var name = ('name' in statement) ? statement.name.nominalValue : ''; // create a graph entry as needed var graph; if(!(name in graphs)) { graph = graphs[name] = {subjects: {}, listMap: {}}; } else { graph = graphs[name]; } // handle element in @list if(p === RDF_FIRST) { // create list entry as needed var listMap = graph.listMap; var entry; if(!(s in listMap)) { entry = listMap[s] = {}; } else { entry = listMap[s]; } // set object value entry.first = _rdfToObject(o, options.useNativeTypes); continue; } // handle other element in @list if(p === RDF_REST) { // set next in list if(o.interfaceName === 'BlankNode') { // create list entry as needed var listMap = graph.listMap; var entry; if(!(s in listMap)) { entry = listMap[s] = {}; } else { entry = listMap[s]; } entry.rest = o.nominalValue; } continue; } // add graph subject to default graph as needed if(name !== '' && !(name in defaultGraph.subjects)) { defaultGraph.subjects[name] = {'@id': name}; } // add subject to graph as needed var subjects = graph.subjects; var value; if(!(s in subjects)) { value = subjects[s] = {'@id': s}; } // use existing subject value else { value = subjects[s]; } // convert to @type unless options indicate to treat rdf:type as property if(p === RDF_TYPE && !options.useRdfType) { // add value of object as @type jsonld.addValue(value, '@type', o.nominalValue, {propertyIsArray: true}); } else { // add property to value as needed var object = _rdfToObject(o, options.useNativeTypes); jsonld.addValue(value, p, object, {propertyIsArray: true}); // a bnode might be the beginning of a list, so add it to the list map if(o.interfaceName === 'BlankNode') { var id = object['@id']; var listMap = graph.listMap; var entry; if(!(id in listMap)) { entry = listMap[id] = {}; } else { entry = listMap[id]; } entry.head = object; } } } // build @lists for(var name in graphs) { var graph = graphs[name]; // find list head var listMap = graph.listMap; for(var subject in listMap) { var entry = listMap[subject]; // head found, build lists if('head' in entry && 'first' in entry) { // replace bnode @id with @list delete entry.head['@id']; var list = entry.head['@list'] = [entry.first]; while('rest' in entry) { var rest = entry.rest; entry = listMap[rest]; if(!('first' in entry)) { throw new JsonLdError( 'Invalid RDF list entry.', 'jsonld.RdfError', {bnode: rest}); } list.push(entry.first); } } } } // build default graph in subject @id order var output = []; var subjects = defaultGraph.subjects; var ids = Object.keys(subjects).sort(); for(var i in ids) { var id = ids[i]; // add subject to default graph var subject = subjects[id]; output.push(subject); // output named graph in subject @id order if(id in graphs) { var graph = subject['@graph'] = []; var _subjects = graphs[id].subjects; var _ids = Object.keys(_subjects).sort(); for(var _i in _ids) { graph.push(_subjects[_ids[_i]]); } } } callback(null, output); }; /** * Outputs the RDF statements found in the given JSON-LD element. * * @param element the JSON-LD element. * @param namer the UniqueNamer for assigning bnode names. * @param subject the active subject. * @param property the active property. * @param graph the graph name. * @param callback(err, statement) called when a statement is output, with the * last statement as null. */ Processor.prototype.toRDF = function( element, namer, subject, property, graph, callback) { _toRDF(element, namer, subject, property, graph, callback); callback(null, null); }; /** * Processes a local context and returns a new active context. * * @param activeCtx the current active context. * @param localCtx the local context to process. * @param options the context processing options. * * @return the new active context. */ Processor.prototype.processContext = function(activeCtx, localCtx, options) { var rval = null; // get context from cache if available if(jsonld.cache.activeCtx) { rval = jsonld.cache.activeCtx.get(activeCtx, localCtx); if(rval) { return rval; } } // initialize the resulting context rval = activeCtx.clone(); // normalize local context to an array of @context objects if(_isObject(localCtx) && '@context' in localCtx && _isArray(localCtx['@context'])) { localCtx = localCtx['@context']; } var ctxs = _isArray(localCtx) ? localCtx : [localCtx]; // process each context in order for(var i in ctxs) { var ctx = ctxs[i]; // reset to initial context, keeping namer if(ctx === null) { rval = _getInitialContext(options); rval.namer = activeCtx.namer; continue; } // dereference @context key if present if(_isObject(ctx) && '@context' in ctx) { ctx = ctx['@context']; } // context must be an object by now, all URLs resolved before this call if(!_isObject(ctx)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context must be an object.', 'jsonld.SyntaxError', {context: ctx}); } // define context mappings for keys in local context var defined = {}; // handle @vocab if('@vocab' in ctx) { var value = ctx['@vocab']; if(value === null) { delete rval['@vocab']; } else if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@vocab" in a ' + '@context must be a string or null.', 'jsonld.SyntaxError', {context: ctx}); } else if(!_isAbsoluteIri(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@vocab" in a ' + '@context must be an absolute IRI.', 'jsonld.SyntaxError', {context: ctx}); } else { rval['@vocab'] = value; } defined['@vocab'] = true; } // handle @language if('@language' in ctx) { var value = ctx['@language']; if(value === null) { delete rval['@language']; } else if(!_isString(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; the value of "@language" in a ' + '@context must be a string or null.', 'jsonld.SyntaxError', {context: ctx}); } else { rval['@language'] = value.toLowerCase(); } defined['@language'] = true; } // process all other keys for(var key in ctx) { _createTermDefinition(rval, ctx, key, defined); } } // cache result if(jsonld.cache.activeCtx) { jsonld.cache.activeCtx.set(activeCtx, localCtx, rval); } return rval; }; /** * Expands a language map. * * @param languageMap the language map to expand. * * @return the expanded language map. */ function _expandLanguageMap(languageMap) { var rval = []; var keys = Object.keys(languageMap).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; var val = languageMap[key]; if(!_isArray(val)) { val = [val]; } for(var vi = 0; vi < val.length; ++vi) { var item = val[vi]; if(!_isString(item)) { throw new JsonLdError( 'Invalid JSON-LD syntax; language map values must be strings.', 'jsonld.SyntaxError', {languageMap: languageMap}); } rval.push({ '@value': item, '@language': key.toLowerCase() }); } } return rval; } /** * Labels the blank nodes in the given value using the given UniqueNamer. * * @param namer the UniqueNamer to use. * @param element the element with blank nodes to rename. * @param isId true if the given element is an @id (or @type). * * @return the element. */ function _labelBlankNodes(namer, element, isId) { if(_isArray(element)) { for(var i = 0; i < element.length; ++i) { element[i] = _labelBlankNodes(namer, element[i], isId); } } else if(_isList(element)) { element['@list'] = _labelBlankNodes(namer, element['@list'], isId); } else if(_isObject(element)) { // rename blank node if(_isBlankNode(element)) { element['@id'] = namer.getName(element['@id']); } // recursively apply to all keys var keys = Object.keys(element).sort(); for(var ki = 0; ki < keys.length; ++ki) { var key = keys[ki]; if(key !== '@id') { element[key] = _labelBlankNodes(namer, element[key], key === '@type'); } } } // rename blank node identifier else if(_isString(element) && isId && element.indexOf('_:') === 0) { element = namer.getName(element); } return element; } /** * Expands the given value by using the coercion and keyword rules in the * given context. * * @param activeCtx the active context to use. * @param activeProperty the active property the value is associated with. * @param value the value to expand. * * @return the expanded value. */ function _expandValue(activeCtx, activeProperty, value) { // nothing to expand if(value === null) { return null; } // special-case expand @id and @type (skips '@id' expansion) var expandedProperty = _expandIri(activeCtx, activeProperty, {vocab: true}); if(expandedProperty === '@id') { return _expandIri(activeCtx, value, {base: true}); } else if(expandedProperty === '@type') { return _expandIri(activeCtx, value, {vocab: true, base: true}); } // get type definition from context var type = jsonld.getContextValue(activeCtx, activeProperty, '@type'); // do @id expansion (automatic for @graph) if(type === '@id' || expandedProperty === '@graph') { return {'@id': _expandIri(activeCtx, value, {base: true})}; } // do not expand keyword values if(_isKeyword(expandedProperty)) { return value; } rval = {}; // other type if(type !== null) { // rename blank node if requested if(activeCtx.namer && type.indexOf('_:') === 0) { type = activeCtx.namer.getName(type); } rval['@type'] = type; } // check for language tagging for strings else if(_isString(value)) { var language = jsonld.getContextValue( activeCtx, activeProperty, '@language'); if(language !== null) { rval['@language'] = language; } } rval['@value'] = value; return rval; } /** * Recursively outputs the RDF statements found in the given JSON-LD element. * * @param element the JSON-LD element. * @param namer the UniqueNamer for assigning bnode names. * @param subject the active subject. * @param property the active property. * @param graph the graph name. * @param callback(err, statement) called when a statement is output, with the * last statement as null. */ function _toRDF(element, namer, subject, property, graph, callback) { // recurse into arrays if(_isArray(element)) { for(var i in element) { _toRDF(element[i], namer, subject, property, graph, callback); } return; } // element must be an rdf:type IRI (@values covered above) if(_isString(element)) { // emit IRI var statement = { subject: _clone(subject), property: _clone(property), object: { nominalValue: element, interfaceName: 'IRI' } }; if(graph !== null) { statement.name = graph; } return callback(null, statement); } // convert @list if(_isList(element)) { var list = _makeLinkedList(element); return _toRDF(list, namer, subject, property, graph, callback); } // convert @value to object if(_isValue(element)) { var value = element['@value']; var datatype = element['@type'] || null; // convert to XSD datatypes as appropriate if(_isBoolean(value)) { value = value.toString(); datatype = datatype || XSD_BOOLEAN; } else if(_isDouble(value)) { // canonical double representation value = value.toExponential(15).replace(/(\d)0*e\+?/, '$1E'); datatype = datatype || XSD_DOUBLE; } else if(_isNumber(value)) { value = value.toFixed(0); datatype = datatype || XSD_INTEGER; } // default to xsd:string datatype datatype = datatype || XSD_STRING; var object = { nominalValue: value, interfaceName: 'LiteralNode', datatype: { nominalValue: datatype, interfaceName: 'IRI' } }; if('@language' in element && datatype === XSD_STRING) { object.language = element['@language']; } // emit literal var statement = { subject: _clone(subject), property: _clone(property), object: object }; if(graph !== null) { statement.name = graph; } return callback(null, statement); } // Note: element must be a subject // get subject @id (generate one if it is a bnode) var isBnode = _isBlankNode(element); var id = isBnode ? namer.getName(element['@id']) : element['@id']; // create object var object = { nominalValue: id, interfaceName: isBnode ? 'BlankNode' : 'IRI' }; // emit statement if subject isn't null if(subject !== null) { var statement = { subject: _clone(subject), property: _clone(property), object: _clone(object) }; if(graph !== null) { statement.name = graph; } callback(null, statement); } // set new active subject to object subject = object; // recurse over subject properties in order var props = Object.keys(element).sort(); for(var pi in props) { var prop = props[pi]; var e = element[prop]; // convert @type to rdf:type if(prop === '@type') { prop = RDF_TYPE; } // recurse into @graph if(prop === '@graph') { _toRDF(e, namer, null, null, subject, callback); continue; } // skip keywords if(_isKeyword(prop)) { continue; } // create new active property property = { nominalValue: prop, interfaceName: 'IRI' }; // recurse into value _toRDF(e, namer, subject, property, graph, callback); } } /** * Converts an RDF statement object to a JSON-LD object. * * @param o the RDF statement object to convert. * @param useNativeTypes true to output native types, false not to. * * @return the JSON-LD object. */ function _rdfToObject(o, useNativeTypes) { // convert empty list if(o.interfaceName === 'IRI' && o.nominalValue === RDF_NIL) { return {'@list': []}; } // convert IRI/BlankNode object to JSON-LD if(o.interfaceName === 'IRI' || o.interfaceName === 'BlankNode') { return {'@id': o.nominalValue}; } // convert literal object to JSON-LD var rval = {'@value': o.nominalValue}; // add datatype if('datatype' in o) { var type = o.datatype.nominalValue; if(useNativeTypes) { // use native types for certain xsd types if(type === XSD_BOOLEAN) { if(rval['@value'] === 'true') { rval['@value'] = true; } else if(rval['@value'] === 'false') { rval['@value'] = false; } } else if(_isNumeric(rval['@value'])) { if(type === XSD_INTEGER) { var i = parseInt(rval['@value']); if(i.toFixed(0) === rval['@value']) { rval['@value'] = i; } } else if(type === XSD_DOUBLE) { rval['@value'] = parseFloat(rval['@value']); } } // do not add native type if([XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING] .indexOf(type) === -1) { rval['@type'] = type; } } else { rval['@type'] = type; } } // add language if('language' in o) { rval['@language'] = o.language; } return rval; } /** * Compares two RDF statements for equality. * * @param s1 the first statement. * @param s2 the second statement. * * @return true if the statements are the same, false if not. */ function _compareRdfStatements(s1, s2) { if(_isString(s1) || _isString(s2)) { return s1 === s2; } var attrs = ['subject', 'property', 'object']; for(var i in attrs) { var attr = attrs[i]; if(s1[attr].interfaceName !== s2[attr].interfaceName || s1[attr].nominalValue !== s2[attr].nominalValue) { return false; } } if(s1.object.language !== s2.object.language) { return false; } if(('datatype' in s1.object) !== ('datatype' in s2.object)) { return false; } if('datatype' in s1.object) { if(s1.object.datatype.interfaceName !== s2.object.datatype.interfaceName || s1.object.datatype.nominalValue !== s2.object.datatype.nominalValue) { return false; } } if(s1.name !== s2.name) { return false; } return true; } /** * Converts a @list value into an embedded linked list of blank nodes in * expanded form. The resulting array can be used as an RDF-replacement for * a property that used a @list. * * @param value the @list value. * * @return the head of the linked list of blank nodes. */ function _makeLinkedList(value) { // convert @list array into embedded blank node linked list in reverse var list = value['@list']; var len = list.length; var tail = {'@id': RDF_NIL}; for(var i = len - 1; i >= 0; --i) { var e = {}; e[RDF_FIRST] = [list[i]]; e[RDF_REST] = [tail]; tail = e; } return tail; } /** * Hashes all of the statements about a blank node. * * @param id the ID of the bnode to hash statements for. * @param bnodes the mapping of bnodes to statements. * @param namer the canonical bnode namer. * * @return the new hash. */ function _hashStatements(id, bnodes, namer) { // return cached hash if('hash' in bnodes[id]) { return bnodes[id].hash; } // serialize all of bnode's statements var statements = bnodes[id].statements; var nquads = []; for(var i in statements) { nquads.push(_toNQuad(statements[i], id)); } // sort serialized quads nquads.sort(); // return hashed quads var hash = bnodes[id].hash = sha1.hash(nquads); return hash; } /** * Produces a hash for the paths of adjacent bnodes for a bnode, * incorporating all information about its subgraph of bnodes. This * method will recursively pick adjacent bnode permutations that produce the * lexicographically-least 'path' serializations. * * @param id the ID of the bnode to hash paths for. * @param bnodes the map of bnode statements. * @param namer the canonical bnode namer. * @param pathNamer the namer used to assign names to adjacent bnodes. * @param callback(err, result) called once the operation completes. */ function _hashPaths(id, bnodes, namer, pathNamer, callback) { // create SHA-1 digest var md = sha1.create(); // group adjacent bnodes by hash, keep properties and references separate var groups = {}; var groupHashes; var statements = bnodes[id].statements; setTimeout(function() {groupNodes(0);}, 0); function groupNodes(i) { if(i === statements.length) { // done, hash groups groupHashes = Object.keys(groups).sort(); return hashGroup(0); } // get adjacent bnode var statement = statements[i]; var bnode = _getAdjacentBlankNodeName(statement.subject, id); var direction = null; if(bnode !== null) { direction = 'p'; } else { bnode = _getAdjacentBlankNodeName(statement.object, id); if(bnode !== null) { direction = 'r'; } } if(bnode !== null) { // get bnode name (try canonical, path, then hash) var name; if(namer.isNamed(bnode)) { name = namer.getName(bnode); } else if(pathNamer.isNamed(bnode)) { name = pathNamer.getName(bnode); } else { name = _hashStatements(bnode, bnodes, namer); } // hash direction, property, and bnode name/hash var md = sha1.create(); md.update(direction); md.update(statement.property.nominalValue); md.update(name); var groupHash = md.digest(); // add bnode to hash group if(groupHash in groups) { groups[groupHash].push(bnode); } else { groups[groupHash] = [bnode]; } } setTimeout(function() {groupNodes(i + 1);}, 0); } // hashes a group of adjacent bnodes function hashGroup(i) { if(i === groupHashes.length) { // done, return SHA-1 digest and path namer return callback(null, {hash: md.digest(), pathNamer: pathNamer}); } // digest group hash var groupHash = groupHashes[i]; md.update(groupHash); // choose a path and namer from the permutations var chosenPath = null; var chosenNamer = null; var permutator = new Permutator(groups[groupHash]); setTimeout(function() {permutate();}, 0); function permutate() { var permutation = permutator.next(); var pathNamerCopy = pathNamer.clone(); // build adjacent path var path = ''; var recurse = []; for(var n in permutation) { var bnode = permutation[n]; // use canonical name if available if(namer.isNamed(bnode)) { path += namer.getName(bnode); } else { // recurse if bnode isn't named in the path yet if(!pathNamerCopy.isNamed(bnode)) { recurse.push(bnode); } path += pathNamerCopy.getName(bnode); } // skip permutation if path is already >= chosen path if(chosenPath !== null && path.length >= chosenPath.length && path > chosenPath) { return nextPermutation(true); } } // does the next recursion nextRecursion(0); function nextRecursion(n) { if(n === recurse.length) { // done, do next permutation return nextPermutation(false); } // do recursion var bnode = recurse[n]; _hashPaths(bnode, bnodes, namer, pathNamerCopy, function(err, result) { if(err) { return callback(err); } path += pathNamerCopy.getName(bnode) + '<' + result.hash + '>'; pathNamerCopy = result.pathNamer; // skip permutation if path is already >= chosen path if(chosenPath !== null && path.length >= chosenPath.length && path > chosenPath) { return nextPermutation(true); } // do next recursion nextRecursion(n + 1); }); } // stores the results of this permutation and runs the next function nextPermutation(skipped) { if(!skipped && (chosenPath === null || path < chosenPath)) { chosenPath = path; chosenNamer = pathNamerCopy; } // do next permutation if(permutator.hasNext()) { setTimeout(function() {permutate();}, 0); } else { // digest chosen path and update namer md.update(chosenPath); pathNamer = chosenNamer; // hash the next group hashGroup(i + 1); } } } } } /** * A helper function that gets the blank node name from an RDF statement node * (subject or object). If the node is a blank node and its nominal value * does not match the given blank node ID, it will be returned. * * @param node the RDF statement node. * @param id the ID of the blank node to look next to. * * @return the adjacent blank node name or null if none was found. */ function _getAdjacentBlankNodeName(node, id) { return (node.interfaceName === 'BlankNode' && node.nominalValue !== id ? node.nominalValue : null); } /** * Recursively flattens the subjects in the given JSON-LD expanded input * into a node map. * * @param input the JSON-LD expanded input. * @param graphs a map of graph name to subject map. * @param graph the name of the current graph. * @param namer the blank node namer. * @param name the name assigned to the current input if it is a bnode. * @param list the list to append to, null for none. */ function _createNodeMap(input, graphs, graph, namer, name, list) { // recurse through array if(_isArray(input)) { for(var i in input) { _createNodeMap(input[i], graphs, graph, namer, undefined, list); } return; } // add non-object to list if(!_isObject(input)) { if(list) { list.push(input); } return; } // add entries for @type if('@type' in input) { var types = input['@type']; if(!_isArray(types)) { types = [types]; } for(var ti = 0; ti < types.length; ++ti) { var type = types[ti]; var id = (type.indexOf('_:') === 0) ? namer.getName(type) : type; if(!(id in graphs[graph])) { graphs[graph][id] = {'@id': id}; } } } // add values to list if(_isValue(input)) { if(list) { list.push(input); } return; } // Note: At this point, input must be a subject. // get name for subject if(_isUndefined(name)) { name = _isBlankNode(input) ? namer.getName(input['@id']) : input['@id']; } // add subject reference to list if(list) { list.push({'@id': name}); } // create new subject or merge into existing one var subjects = graphs[graph]; var subject = subjects[name] = subjects[name] || {}; subject['@id'] = name; var properties = Object.keys(input).sort(); for(var pi = 0; pi < properties.length; ++pi) { var property = properties[pi]; // skip @id if(property === '@id') { continue; } // recurse into graph if(property === '@graph') { // add graph subjects map entry if(!(name in graphs)) { graphs[name] = {}; } var g = (graph === '@merged') ? graph : name; _createNodeMap(input[property], graphs, g, namer); continue; } // copy non-@type keywords if(property !== '@type' && _isKeyword(property)) { subject[property] = input[property]; continue; } // iterate over objects (ensure property is added for empty arrays) var objects = input[property]; if(objects.length === 0) { jsonld.addValue(subject, property, [], {propertyIsArray: true}); continue; } for(var oi = 0; oi < objects.length; ++oi) { var o = objects[oi]; // handle embedded subject or subject reference if(_isSubject(o) || _isSubjectReference(o)) { // rename blank node @id var id = _isBlankNode(o) ? namer.getName(o['@id']) : o['@id']; // add reference and recurse jsonld.addValue( subject, property, {'@id': id}, {propertyIsArray: true}); _createNodeMap(o, graphs, graph, namer, id); } // handle @list else if(_isList(o)) { var _list = []; _createNodeMap(o['@list'], graphs, graph, namer, name, _list); o = {'@list': _list}; jsonld.addValue(subject, property, o, {propertyIsArray: true}); } // handle @value else { _createNodeMap(o, graphs, graph, namer, name); jsonld.addValue(subject, property, o, {propertyIsArray: true}); } } } } /** * Frames subjects according to the given frame. * * @param state the current framing state. * @param subjects the subjects to filter. * @param frame the frame. * @param parent the parent subject or top-level array. * @param property the parent property, initialized to null. */ function _frame(state, subjects, frame, parent, property) { // validate the frame _validateFrame(state, frame); frame = frame[0]; // filter out subjects that match the frame var matches = _filterSubjects(state, subjects, frame); // get flags for current frame var options = state.options; var embedOn = _getFrameFlag(frame, options, 'embed'); var explicitOn = _getFrameFlag(frame, options, 'explicit'); // add matches to output var ids = Object.keys(matches).sort(); for(var idx in ids) { var id = ids[idx]; /* Note: In order to treat each top-level match as a compartmentalized result, create an independent copy of the embedded subjects map when the property is null, which only occurs at the top-level. */ if(property === null) { state.embeds = {}; } // start output var output = {}; output['@id'] = id; // prepare embed meta info var embed = {parent: parent, property: property}; // if embed is on and there is an existing embed if(embedOn && (id in state.embeds)) { // only overwrite an existing embed if it has already been added to its // parent -- otherwise its parent is somewhere up the tree from this // embed and the embed would occur twice once the tree is added embedOn = false; // existing embed's parent is an array var existing = state.embeds[id]; if(_isArray(existing.parent)) { for(var i in existing.parent) { if(jsonld.compareValues(output, existing.parent[i])) { embedOn = true; break; } } } // existing embed's parent is an object else if(jsonld.hasValue(existing.parent, existing.property, output)) { embedOn = true; } // existing embed has already been added, so allow an overwrite if(embedOn) { _removeEmbed(state, id); } } // not embedding, add output without any other properties if(!embedOn) { _addFrameOutput(state, parent, property, output); } else { // add embed meta info state.embeds[id] = embed; // iterate over subject properties var subject = matches[id]; var props = Object.keys(subject).sort(); for(var i in props) { var prop = props[i]; // copy keywords to output if(_isKeyword(prop)) { output[prop] = _clone(subject[prop]); continue; } // if property isn't in the frame if(!(prop in frame)) { // if explicit is off, embed values if(!explicitOn) { _embedValues(state, subject, prop, output); } continue; } // add objects var objects = subject[prop]; for(var i in objects) { var o = objects[i]; // recurse into list if(_isList(o)) { // add empty list var list = {'@list': []}; _addFrameOutput(state, output, prop, list); // add list objects var src = o['@list']; for(var n in src) { o = src[n]; // recurse into subject reference if(_isSubjectReference(o)) { _frame(state, [o['@id']], frame[prop], list, '@list'); } // include other values automatically else { _addFrameOutput(state, list, '@list', _clone(o)); } } continue; } // recurse into subject reference if(_isSubjectReference(o)) { _frame(state, [o['@id']], frame[prop], output, prop); } // include other values automatically else { _addFrameOutput(state, output, prop, _clone(o)); } } } // handle defaults var props = Object.keys(frame).sort(); for(var i in props) { var prop = props[i]; // skip keywords if(_isKeyword(prop)) { continue; } // if omit default is off, then include default values for properties // that appear in the next frame but are not in the matching subject var next = frame[prop][0]; var omitDefaultOn = _getFrameFlag(next, options, 'omitDefault'); if(!omitDefaultOn && !(prop in output)) { var preserve = '@null'; if('@default' in next) { preserve = _clone(next['@default']); } if(!_isArray(preserve)) { preserve = [preserve]; } output[prop] = [{'@preserve': [preserve]}]; } } // add output to parent _addFrameOutput(state, parent, property, output); } } } /** * Gets the frame flag value for the given flag name. * * @param frame the frame. * @param options the framing options. * @param name the flag name. * * @return the flag value. */ function _getFrameFlag(frame, options, name) { var flag = '@' + name; return (flag in frame) ? frame[flag][0] : options[name]; } /** * Validates a JSON-LD frame, throwing an exception if the frame is invalid. * * @param state the current frame state. * @param frame the frame to validate. */ function _validateFrame(state, frame) { if(!_isArray(frame) || frame.length !== 1 || !_isObject(frame[0])) { throw new JsonLdError( 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.', 'jsonld.SyntaxError', {frame: frame}); } } /** * Returns a map of all of the subjects that match a parsed frame. * * @param state the current framing state. * @param subjects the set of subjects to filter. * @param frame the parsed frame. * * @return all of the matched subjects. */ function _filterSubjects(state, subjects, frame) { // filter subjects in @id order var rval = {}; for(var i in subjects) { var id = subjects[i]; var subject = state.subjects[id]; if(_filterSubject(subject, frame)) { rval[id] = subject; } } return rval; } /** * Returns true if the given subject matches the given frame. * * @param subject the subject to check. * @param frame the frame to check. * * @return true if the subject matches, false if not. */ function _filterSubject(subject, frame) { // check @type (object value means 'any' type, fall through to ducktyping) if('@type' in frame && !(frame['@type'].length === 1 && _isObject(frame['@type'][0]))) { var types = frame['@type']; for(var i in types) { // any matching @type is a match if(jsonld.hasValue(subject, '@type', types[i])) { return true; } } return false; } // check ducktype for(var key in frame) { // only not a duck if @id or non-keyword isn't in subject if((key === '@id' || !_isKeyword(key)) && !(key in subject)) { return false; } } return true; } /** * Embeds values for the given subject and property into the given output * during the framing algorithm. * * @param state the current framing state. * @param subject the subject. * @param property the property. * @param output the output. */ function _embedValues(state, subject, property, output) { // embed subject properties in output var objects = subject[property]; for(var i in objects) { var o = objects[i]; // recurse into @list if(_isList(o)) { var list = {'@list': []}; _addFrameOutput(state, output, property, list); return _embedValues(state, o, '@list', list['@list']); } // handle subject reference if(_isSubjectReference(o)) { var id = o['@id']; // embed full subject if isn't already embedded if(!(id in state.embeds)) { // add embed var embed = {parent: output, property: property}; state.embeds[id] = embed; // recurse into subject o = {}; var s = state.subjects[id]; for(var prop in s) { // copy keywords if(_isKeyword(prop)) { o[prop] = _clone(s[prop]); continue; } _embedValues(state, s, prop, o); } } _addFrameOutput(state, output, property, o); } // copy non-subject value else { _addFrameOutput(state, output, property, _clone(o)); } } } /** * Removes an existing embed. * * @param state the current framing state. * @param id the @id of the embed to remove. */ function _removeEmbed(state, id) { // get existing embed var embeds = state.embeds; var embed = embeds[id]; var parent = embed.parent; var property = embed.property; // create reference to replace embed var subject = {'@id': id}; // remove existing embed if(_isArray(parent)) { // replace subject with reference for(var i in parent) { if(jsonld.compareValues(parent[i], subject)) { parent[i] = subject; break; } } } else { // replace subject with reference var useArray = _isArray(parent[property]); jsonld.removeValue(parent, property, subject, {propertyIsArray: useArray}); jsonld.addValue(parent, property, subject, {propertyIsArray: useArray}); } // recursively remove dependent dangling embeds var removeDependents = function(id) { // get embed keys as a separate array to enable deleting keys in map var ids = Object.keys(embeds); for(var i in ids) { var next = ids[i]; if(next in embeds && _isObject(embeds[next].parent) && embeds[next].parent['@id'] === id) { delete embeds[next]; removeDependents(next); } } }; removeDependents(id); } /** * Adds framing output to the given parent. * * @param state the current framing state. * @param parent the parent to add to. * @param property the parent property. * @param output the output to add. */ function _addFrameOutput(state, parent, property, output) { if(_isObject(parent)) { jsonld.addValue(parent, property, output, {propertyIsArray: true}); } else { parent.push(output); } } /** * Removes the @preserve keywords as the last step of the framing algorithm. * * @param ctx the active context used to compact the input. * @param input the framed, compacted output. * * @return the resulting output. */ function _removePreserve(ctx, input) { // recurse through arrays if(_isArray(input)) { var output = []; for(var i in input) { var result = _removePreserve(ctx, input[i]); // drop nulls from arrays if(result !== null) { output.push(result); } } input = output; } else if(_isObject(input)) { // remove @preserve if('@preserve' in input) { if(input['@preserve'] === '@null') { return null; } return input['@preserve']; } // skip @values if(_isValue(input)) { return input; } // recurse through @lists if(_isList(input)) { input['@list'] = _removePreserve(ctx, input['@list']); return input; } // recurse through properties for(var prop in input) { var result = _removePreserve(ctx, input[prop]); var container = jsonld.getContextValue(ctx, prop, '@container'); if(_isArray(result) && result.length === 1 && container === null) { result = result[0]; } input[prop] = result; } } return input; } /** * Compares two strings first based on length and then lexicographically. * * @param a the first string. * @param b the second string. * * @return -1 if a < b, 1 if a > b, 0 if a == b. */ function _compareShortestLeast(a, b) { if(a.length < b.length) { return -1; } else if(b.length < a.length) { return 1; } else if(a === b) { return 0; } return (a.length === b.length && a < b) ? -1 : 1; } /** * Picks the preferred compaction term from the given inverse context entry. * * @param activeCtx the active context. * @param iri the IRI to pick the term for. * @param value the value to pick the term for. * @param parent the parent of the value (required for property generators). * @param containers the preferred containers. * @param typeOrLanguage either '@type' or '@language'. * @param typeOrLanguageValue the preferred value for '@type' or '@language'. * * @return the preferred term. */ function _selectTerm( activeCtx, iri, value, parent, containers, typeOrLanguage, typeOrLanguageValue) { containers.push('@none'); if(typeOrLanguageValue === null) { typeOrLanguageValue = '@null'; } // options for the value of @type or @language var options = [typeOrLanguageValue, '@none']; var term = null; var containerMap = activeCtx.inverse[iri]; for(var ci = 0; term === null && ci < containers.length; ++ci) { // if container not available in the map, continue var container = containers[ci]; if(!(container in containerMap)) { continue; } var typeOrLanguageValueMap = containerMap[container][typeOrLanguage]; for(var oi = 0; term === null && oi < options.length; ++oi) { // if type/language option not available in the map, continue var option = options[oi]; if(!(option in typeOrLanguageValueMap)) { continue; } var termInfo = typeOrLanguageValueMap[option]; // see if a property generator matches if(_isObject(parent) && termInfo.propertyGenerators) { for(var pi = 0; pi < termInfo.propertyGenerators.length; ++pi) { var propertyGenerator = termInfo.propertyGenerators[pi]; var iris = activeCtx.mappings[propertyGenerator]['@id']; var match = true; for(var ii = 0; match && ii < iris.length; ++ii) { match = (iris[ii] in parent); } if(match) { term = propertyGenerator; break; } } } // no matching property generator, use a simple term instead if(term === null) { term = termInfo.term; } } } return term; } /** * Compacts an IRI or keyword into a term or prefix if it can be. If the * IRI has an associated value it may be passed. * * @param activeCtx the active context to use. * @param iri the IRI to compact. * @param value the value to check or null. * @param relativeTo options for how to compact IRIs: * base: true to compact against the base IRI, false not to. * vocab: true to split after @vocab, false not to. * @param parent the parent element for the value. * * @return the compacted term, prefix, keyword alias, or the original IRI. */ function _compactIri(activeCtx, iri, value, relativeTo, parent) { // can't compact null if(iri === null) { return iri; } // term is a keyword if(_isKeyword(iri)) { // return alias if available var aliases = activeCtx.keywords[iri]; return (aliases.length > 0) ? aliases[0] : iri; } // default value and parent to null if(_isUndefined(value)) { value = null; } if(_isUndefined(parent)) { parent = null; } relativeTo = relativeTo || {}; // use inverse context to pick a term var inverseCtx = activeCtx.getInverse(); var defaultLanguage = activeCtx['@language'] || '@none'; if(iri in inverseCtx) { // prefer @index if available in value var containers = []; if(_isObject(value) && '@index' in value) { containers.push('@index'); } // defaults for term selection based on type/language var typeOrLanguage = '@language'; var typeOrLanguageValue = '@null'; // choose the most specific term that works for all elements in @list if(_isList(value)) { // only select @list containers if @index is NOT in value if(!('@index' in value)) { containers.push('@list'); } var list = value['@list']; var commonLanguage = (list.length === 0) ? defaultLanguage : null; var commonType = null; for(var i = 0; i < list.length; ++i) { var item = list[i]; var itemLanguage = '@none'; var itemType = '@none'; if(_isValue(item)) { if('@language' in item) { itemLanguage = item['@language']; } else if('@type' in item) { itemType = item['@type']; } // plain literal else { itemLanguage = '@null'; } } if(commonLanguage === null) { commonLanguage = itemLanguage; } else if(itemLanguage !== commonLanguage && _isValue(item)) { commonLanguage = '@none'; } if(commonType === null) { commonType = itemType; } else if(itemType !== commonType) { commonType = '@none'; } // there are different languages and types in the list, so choose // the most generic term, no need to keep iterating the list if(commonLanguage === '@none' && commonType === '@none') { break; } } commonLanguage = commonLanguage || '@none'; commonType = commonType || '@none'; if(commonType !== '@none') { typeOrLanguage = '@type'; typeOrLanguageValue = commonType; } else { typeOrLanguageValue = commonLanguage; } } else { if(_isValue(value)) { if('@language' in value) { containers.push('@language'); typeOrLanguageValue = value['@language']; } else if('@type' in value) { typeOrLanguage = '@type'; typeOrLanguageValue = value['@type']; } } else { typeOrLanguage = '@type'; typeOrLanguageValue = '@id'; } containers.push('@set'); } // do term selection var term = _selectTerm( activeCtx, iri, value, parent, containers, typeOrLanguage, typeOrLanguageValue); if(term !== null) { return term; } } // no term match, check for possible CURIEs var choice = null; for(var term in activeCtx.mappings) { // skip terms with colons, they can't be prefixes if(term.indexOf(':') !== -1) { continue; } // skip entries with @ids that are not partial matches var definition = activeCtx.mappings[term]; if(!definition || definition.propertyGenerator || definition['@id'] === iri || iri.indexOf(definition['@id']) !== 0) { continue; } // a CURIE is usable if: // 1. it has no mapping, OR // 2. value is null, which means we're not compacting an @value, AND // the mapping matches the IRI) var curie = term + ':' + iri.substr(definition['@id'].length); var isUsableCurie = (!(curie in activeCtx.mappings) || (value === null && activeCtx.mappings[curie] && activeCtx.mappings[curie]['@id'] === iri)); // select curie if it is shorter or the same length but lexicographically // less than the current choice if(isUsableCurie && (choice === null || _compareShortestLeast(curie, choice) < 0)) { choice = curie; } } // return chosen curie if(choice !== null) { return choice; } // no matching terms or curies, use @vocab if available if(relativeTo.vocab && '@vocab' in activeCtx) { // determine if vocab is a prefix of the iri var vocab = activeCtx['@vocab']; if(iri.indexOf(vocab) === 0 && iri !== vocab) { // use suffix as relative iri if it is not a term in the active context var suffix = iri.substr(vocab.length); if(!(suffix in activeCtx.mappings)) { return suffix; } } } // no compaction choices, return IRI as is return iri; } /** * Performs value compaction on an object with '@value' or '@id' as the only * property. * * @param activeCtx the active context. * @param activeProperty the active property that points to the element. * @param value the value to compact. * * @return the compaction result. */ function _compactValue(activeCtx, activeProperty, value) { // value is a @value if(_isValue(value)) { // get context rules var type = jsonld.getContextValue(activeCtx, activeProperty, '@type'); var language = jsonld.getContextValue( activeCtx, activeProperty, '@language'); var container = jsonld.getContextValue( activeCtx, activeProperty, '@container'); // whether or not the value has an @index that must be preserved var preserveIndex = (('@index' in value) && container !== '@index'); // if there's no @index to preserve ... if(!preserveIndex) { // matching @type or @language specified in context, compact value if(value['@type'] === type || value['@language'] === language) { return value['@value']; } } // return just the value of @value if all are true: // 1. @value is the only key or @index isn't being preserved // 2. there is no default language or @value is not a string or // the key has a mapping with a null @language var keyCount = Object.keys(value).length; var isValueOnlyKey = (keyCount === 1 || (keyCount === 2 && ('@index' in value) && !preserveIndex)); var hasDefaultLanguage = ('@language' in activeCtx); var isValueString = _isString(value['@value']); var hasNullMapping = (activeCtx.mappings[activeProperty] && activeCtx.mappings[activeProperty]['@language'] === null); if(isValueOnlyKey && (!hasDefaultLanguage || !isValueString || hasNullMapping)) { return value['@value']; } var rval = {}; // preserve @index if(preserveIndex) { rval[_compactIri(activeCtx, '@index')] = value['@index']; } // compact @type IRI if('@type' in value) { rval[_compactIri(activeCtx, '@type')] = _compactIri( activeCtx, value['@type'], null, {base: true, vocab: true}); } // alias @language else if('@language' in value) { rval[_compactIri(activeCtx, '@language')] = value['@language']; } // alias @value rval[_compactIri(activeCtx, '@value')] = value['@value']; return rval; } // value is a subject reference var expandedProperty = _expandIri(activeCtx, activeProperty); var type = jsonld.getContextValue(activeCtx, activeProperty, '@type'); var term = _compactIri(activeCtx, value['@id'], null, {base: true}); // compact to scalar if(type === '@id' || expandedProperty === '@graph') { return term; } var rval = {}; rval[_compactIri(activeCtx, '@id')] = term; return rval; } /** * Finds and removes any duplicate values that were presumably generated by * a property generator in the given element. * * @param activeCtx the active context. * @param element the element to remove duplicates from. * @param expandedProperty the property to map to a property generator. * @param value the value to compare against when duplicate checking. * @param activeProperty the property generator term. */ function _findAndRemovePropertyGeneratorDuplicates( activeCtx, element, expandedProperty, value, activeProperty) { // get property generator IRIs var iris = activeCtx.mappings[activeProperty]['@id']; // for each IRI that isn't 'expandedProperty', remove a single duplicate // from element, if found for(var i = 0; i < iris.length; ++i) { var iri = iris[i]; if(iri === expandedProperty) { continue; } var prospects = element[iri]; for(var pi = 0; pi < prospects.length; ++pi) { var prospect = prospects[pi]; if(jsonld.compareValues(prospect, value)) { // duplicate found, remove it in place prospects.splice(pi, 1); if(prospects.length === 0) { delete element[iri]; } break; } } } } /** * Creates a term definition during context processing. * * @param activeCtx the current active context. * @param localCtx the local context being processed. * @param term the term in the local context to define the mapping for. * @param defined a map of defining/defined keys to detect cycles and prevent * double definitions. */ function _createTermDefinition(activeCtx, localCtx, term, defined) { if(term in defined) { // term already defined if(defined[term]) { return; } // cycle detected throw new JsonLdError( 'Cyclical context definition detected.', 'jsonld.CyclicalContext', {context: localCtx, term: term}); } // now defining term defined[term] = false; // if term has a prefix, define it first var colon = term.indexOf(':'); var prefix = null; if(colon !== -1) { prefix = term.substr(0, colon); if(prefix in localCtx) { // define parent prefix _createTermDefinition(activeCtx, localCtx, prefix, defined); } } if(_isKeyword(term)) { throw new JsonLdError( 'Invalid JSON-LD syntax; keywords cannot be overridden.', 'jsonld.SyntaxError', {context: localCtx}); } if(activeCtx.mappings[term]) { // if term is a keyword alias, remove it var kw = activeCtx.mappings[term]['@id']; if(_isKeyword(kw)) { var aliases = activeCtx.keywords[kw]; aliases.splice(aliases.indexOf(term), 1); } } // get context term value var value = localCtx[term]; // clear context entry if(value === null || (_isObject(value) && value['@id'] === null)) { activeCtx.mappings[term] = null; defined[term] = true; return; } if(_isString(value)) { if(_isKeyword(value)) { // disallow aliasing @context and @preserve if(value === '@context' || value === '@preserve') { throw new JsonLdError( 'Invalid JSON-LD syntax; @context and @preserve cannot be aliased.', 'jsonld.SyntaxError'); } // uniquely add term as a keyword alias and resort var aliases = activeCtx.keywords[value]; if(aliases.indexOf(term) === -1) { aliases.push(term); aliases.sort(_compareShortestLeast); } } else { // expand value to a full IRI value = _expandIri(activeCtx, value, {base: true}, localCtx, defined); } // define/redefine term to expanded IRI/keyword activeCtx.mappings[term] = {'@id': value}; defined[term] = true; return; } if(!_isObject(value)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context property values must be ' + 'strings or objects.', 'jsonld.SyntaxError', {context: localCtx}); } // create new mapping var mapping = {}; mapping.propertyGenerator = false; // merge onto parent mapping if one exists for a prefix if(prefix !== null && activeCtx.mappings[prefix]) { // FIXME: check to see if additional clone is necessary here mapping = _clone(activeCtx.mappings[prefix]); } if('@id' in value) { var id = value['@id']; // handle property generator if(_isArray(id)) { if(activeCtx.namer === null) { throw new JsonLdError( 'Incompatible JSON-LD options; a property generator was found ' + 'in the @context, but blank node renaming has been disabled; ' + 'it must be enabled to use property generators.', 'jsonld.OptionsError', {context: localCtx}); } var propertyGenerator = []; var ids = id; for(var i = 0; i < ids.length; ++i) { id = ids[i]; if(!_isString(id)) { throw new JsonLdError( 'Invalid JSON-LD syntax; property generators must consist of an ' + '@id array containing only strings.', 'jsonld.SyntaxError', {context: localCtx}); } // expand @id if it is not @type if(id !== '@type') { id = _expandIri(activeCtx, id, {base: true}, localCtx, defined); } propertyGenerator.push(id); } // add sorted property generator as @id in mapping mapping['@id'] = propertyGenerator.sort(); mapping.propertyGenerator = true; } else if(!_isString(id)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context @id value must be an array ' + 'of strings or a string.', 'jsonld.SyntaxError', {context: localCtx}); } else { // add @id to mapping, expanding it if it is not @type if(id !== '@type') { id = _expandIri(activeCtx, id, {base: true}, localCtx, defined); } mapping['@id'] = id; } } else { if(prefix === null) { // non-IRIs *must* define @ids if @vocab is not available if(!('@vocab' in activeCtx)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context terms must define an @id.', 'jsonld.SyntaxError', {context: localCtx, term: term}); } // prepend vocab to term mapping['@id'] = activeCtx['@vocab'] + term; } // set @id based on prefix parent else if(prefix in activeCtx.mappings) { var suffix = term.substr(colon + 1); mapping['@id'] = activeCtx.mappings[prefix]['@id'] + suffix; } // term is an absolute IRI else { mapping['@id'] = term; } } if('@type' in value) { var type = value['@type']; if(!_isString(type)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context @type values must be strings.', 'jsonld.SyntaxError', {context: localCtx}); } if(type !== '@id') { // expand @type to full IRI type = _expandIri( activeCtx, type, {vocab: true, base: true}, localCtx, defined); } // add @type to mapping mapping['@type'] = type; } if('@container' in value) { var container = value['@container']; if(container !== '@list' && container !== '@set' && container !== '@index' && container !== '@language') { throw new JsonLdError( 'Invalid JSON-LD syntax; @context @container value must be ' + 'one of the following: @list, @set, @index, or @language.', 'jsonld.SyntaxError', {context: localCtx}); } // add @container to mapping mapping['@container'] = container; } if('@language' in value && !('@type' in value)) { var language = value['@language']; if(language !== null && !_isString(language)) { throw new JsonLdError( 'Invalid JSON-LD syntax; @context @language value must be ' + 'a string or null.', 'jsonld.SyntaxError', {context: localCtx}); } // add @language to mapping if(language !== null) { language = language.toLowerCase(); } mapping['@language'] = language; } // merge onto parent mapping if one exists for a prefix if(prefix !== null && activeCtx.mappings[prefix]) { // FIXME: check to see if additional clone is necessary here var child = mapping; mapping = _clone(activeCtx.mappings[prefix]); for(var k in child) { mapping[k] = child[k]; } } // define term mapping activeCtx.mappings[term] = mapping; defined[term] = true; } /** * Expands a string to a full IRI. The string may be a term, a prefix, a * relative IRI, or an absolute IRI. The associated absolute IRI will be * returned. * * @param activeCtx the current active context. * @param value the string to expand. * @param relativeTo options for how to resolve relative IRIs: * base: true to resolve against the base IRI, false not to. * vocab: true to concatenate after @vocab, false not to. * @param localCtx the local context being processed (only given if called * during document processing). * @param defined a map for tracking cycles in context definitions (only given * if called during document processing). * * @return the expanded value. */ function _expandIri(activeCtx, value, relativeTo, localCtx, defined) { // nothing to expand if(value === null) { return null; } // define term dependency if not defined if(localCtx && value in localCtx && defined[value] !== true) { _createTermDefinition(activeCtx, localCtx, value, defined); } var mapping = activeCtx.mappings[value]; // value is explicitly ignored with a null mapping if(mapping === null) { return null; } // term dependency cannot be a property generator if(localCtx && mapping && mapping.propertyGenerator) { throw new JsonLdError( 'Invalid JSON-LD syntax; a term definition cannot have a property ' + 'generator as a dependency.', 'jsonld.SyntaxError', {context: localCtx, value: value}); } var isAbsolute = false; var rval = value; // value is a term if(mapping && !mapping.propertyGenerator) { isAbsolute = true; rval = mapping['@id']; } // keywords need no expanding (aliasing already handled by now) if(_isKeyword(rval)) { return rval; } if(!isAbsolute) { // split value into prefix:suffix var colon = rval.indexOf(':'); if(colon !== -1) { isAbsolute = true; var prefix = rval.substr(0, colon); var suffix = rval.substr(colon + 1); // do not expand blank nodes (prefix of '_') or already-absolute // IRIs (suffix of '//') if(prefix !== '_' && suffix.indexOf('//') !== 0) { // prefix dependency not defined, define it if(localCtx && prefix in localCtx && defined[prefix] !== true) { _createTermDefinition(activeCtx, localCtx, prefix, defined); } // use mapping if prefix is defined and not a property generator mapping = activeCtx.mappings[prefix]; if(mapping && !mapping.propertyGenerator) { rval = activeCtx.mappings[prefix]['@id'] + suffix; } } } } relativeTo = relativeTo || {}; if(isAbsolute) { // rename blank node if requested if(!localCtx && rval.indexOf('_:') === 0 && activeCtx.namer) { rval = activeCtx.namer.getName(rval); } } // prepend vocab else if(relativeTo.vocab && '@vocab' in activeCtx) { rval = activeCtx['@vocab'] + rval; } // prepend base else if(relativeTo.base) { rval = _prependBase(activeCtx['@base'], rval); } if(localCtx) { // value must now be an absolute IRI if(!_isAbsoluteIri(rval)) { throw new JsonLdError( 'Invalid JSON-LD syntax; a @context value does not expand to ' + 'an absolute IRI.', 'jsonld.SyntaxError', {context: localCtx, value: value}); } } return rval; } /** * Prepends a base IRI to the given relative IRI. * * @param base the base IRI. * @param iri the relative IRI. * * @return the absolute IRI. */ function _prependBase(base, iri) { var authority = (base.host || ''); var rel = jsonld.url.parse(iri); rel.pathname = (rel.pathname || ''); // per RFC3986 normalize slashes and dots in path var path; // IRI contains authority if(rel.href.indexOf('//') === 0) { path = rel.href.substr(2); authority = path.substr(0, path.lastIndexOf('/')); path = path.substr(authority.length); } // IRI represents an absolue path else if(rel.pathname.indexOf('/') === 0) { path = rel.pathname; } else { path = base.pathname; // prepend last directory for base if(rel.pathname !== '') { path = path.substr(0, path.lastIndexOf('/') + 1) + rel.pathname; } } var segments = path.split('/'); // remove '.' and '' (do not remove trailing empty path) segments = segments.filter(function(e, i) { return e !== '.' && (e !== '' || i === segments.length - 1); }); // remove as many '..' as possible for(var i = 0; i < segments.length;) { var segment = segments[i]; if(segment === '..') { // too many reverse dots if(i === 0) { var last = segments[segments.length - 1]; if(last !== '..') { segments = [last]; } else { segments = []; } break; } // remove '..' and previous segment segments.splice(i - 1, 2); i -= 1; } else { i += 1; } } path = '/' + segments.join('/'); // add query and hash if(rel.query) { path += '?' + rel.query; } if(rel.hash) { path += rel.hash; } return (base.protocol || '') + '//' + authority + path; } /** * Gets the initial context. * * @param options the options to use. * base the document base IRI. * * @return the initial context. */ function _getInitialContext(options) { var namer = null; if(options.renameBlankNodes) { namer = new UniqueNamer('_:t'); } var base = jsonld.url.parse(options.base || ''); base.pathname = base.pathname || ''; return { '@base': base, mappings: {}, keywords: { '@index': [], '@context': [], '@container': [], '@default': [], '@embed': [], '@explicit': [], '@graph': [], '@id': [], '@language': [], '@list': [], '@omitDefault': [], '@preserve': [], '@set': [], '@type': [], '@value': [], '@vocab': [] }, namer: namer, inverse: null, getInverse: _createInverseContext, clone: _cloneActiveContext, share: _shareActiveContext }; /** * Generates an inverse context for use in the compaction algorithm, if * not already generated for the given active context. * * @param activeCtx the active context to create the inverse context from. * * @return the inverse context. */ function _createInverseContext(activeCtx) { if(!activeCtx) { activeCtx = this; } // lazily create inverse if(activeCtx.inverse) { return activeCtx.inverse; } var inverse = activeCtx.inverse = {}; // handle default language var defaultLanguage = activeCtx['@language'] || '@none'; // create term selections for each mapping in the context, ordered by // shortest and then lexicographically least var mappings = activeCtx.mappings; var terms = Object.keys(mappings).sort(_compareShortestLeast); for(var i = 0; i < terms.length; ++i) { var term = terms[i]; var mapping = mappings[term]; if(mapping === null) { continue; } // iterate over every IRI in the mapping var ids = mapping['@id']; if(!_isArray(ids)) { ids = [ids]; } for(var ii = 0; ii < ids.length; ++ii) { var iri = ids[ii]; var entry = inverse[iri]; // initialize entry if(!entry) { inverse[iri] = entry = {}; } // add term selection where it applies var container = mapping['@container'] || '@none'; // add new entry if(!entry[container]) { entry[container] = { '@language': {}, '@type': {} }; entry[container]['@language'][defaultLanguage] = { term: null, propertyGenerators: [] }; } entry = entry[container]; // consider updating @language entry if @type is not specified if(!('@type' in mapping)) { // if a @language is specified, update its specific entry if('@language' in mapping) { var language = mapping['@language'] || '@null'; _addPreferredTerm(mapping, term, entry['@language'], language); } // add an entry for the default language and for no @language else { _addPreferredTerm( mapping, term, entry['@language'], defaultLanguage); _addPreferredTerm(mapping, term, entry['@language'], '@none'); } } // consider updating @type entry if @language is not specified if(!('@language' in mapping)) { var type = mapping['@type'] || '@none'; _addPreferredTerm(mapping, term, entry['@type'], type); } } } return inverse; } /** * Adds or updates the term or property generator for the given entry. * * @param mapping the term mapping. * @param term the term to add. * @param entry the inverse context typeOrLanguage entry to add to. * @param typeOrLanguageValue the key in the entry to add to. */ function _addPreferredTerm(mapping, term, entry, typeOrLanguageValue) { if(!(typeOrLanguageValue in entry)) { entry[typeOrLanguageValue] = {term: null, propertyGenerators: []}; } var e = entry[typeOrLanguageValue]; if(mapping.propertyGenerator) { e.propertyGenerators.push(term); } else if(e.term === null) { e.term = term; } } /** * Clones an active context, creating a child active context. * * @return a clone (child) of the active context. */ function _cloneActiveContext(shallow) { var child = {}; child['@base'] = this['@base']; child.keywords = _clone(this.keywords); child.mappings = _clone(this.mappings); child.namer = this.namer; child.clone = this.clone; child.share = this.share; child.inverse = null; child.getInverse = this.getInverse; return child; } /** * Returns a copy of this active context that can be shared between * different processing algorithms. This method only copies the parts * of the active context that can't be shared. * * @return a shareable copy of this active context. */ function _shareActiveContext() { var rval = {}; rval['@base'] = this['@base']; rval.keywords = this.keywords; rval.mappings = this.mappings; rval.namer = this.namer.clone(); rval.clone = this.clone; rval.share = this.share; rval.inverse = rval.inverse; rval.getInverse = this.getInverse; return rval; } } /** * Returns whether or not the given value is a keyword (or a keyword alias). * * @param v the value to check. * @param [ctx] the active context to check against. * * @return true if the value is a keyword, false if not. */ function _isKeyword(v, ctx) { if(!_isString(v)) { return false; } if(ctx) { if(v in ctx.keywords) { return true; } for(var key in ctx.keywords) { var aliases = ctx.keywords[key]; if(aliases.indexOf(v) !== -1) { return true; } } } else { switch(v) { case '@index': case '@context': case '@container': case '@default': case '@embed': case '@explicit': case '@graph': case '@id': case '@language': case '@list': case '@omitDefault': case '@preserve': case '@set': case '@type': case '@value': case '@vocab': return true; } } return false; } /** * Returns true if the given value is an Object. * * @param v the value to check. * * @return true if the value is an Object, false if not. */ function _isObject(v) { return (Object.prototype.toString.call(v) === '[object Object]'); } /** * Returns true if the given value is an empty Object. * * @param v the value to check. * * @return true if the value is an empty Object, false if not. */ function _isEmptyObject(v) { return _isObject(v) && Object.keys(v).length === 0; } /** * Returns true if the given value is an Array. * * @param v the value to check. * * @return true if the value is an Array, false if not. */ function _isArray(v) { return Array.isArray(v); } /** * Throws an exception if the given value is not a valid @type value. * * @param v the value to check. */ function _validateTypeValue(v) { // can be a string or an empty object if(_isString(v) || _isEmptyObject(v)) { return; } // must be an array var isValid = false; if(_isArray(v)) { // must contain only strings isValid = true; for(var i in v) { if(!(_isString(v[i]))) { isValid = false; break; } } } if(!isValid) { throw new JsonLdError( 'Invalid JSON-LD syntax; "@type" value must a string, an array of ' + 'strings, or an empty object.', 'jsonld.SyntaxError', {value: v}); } } /** * Returns true if the given value is a String. * * @param v the value to check. * * @return true if the value is a String, false if not. */ function _isString(v) { return (typeof v === 'string' || Object.prototype.toString.call(v) === '[object String]'); } /** * Returns true if the given value is a Number. * * @param v the value to check. * * @return true if the value is a Number, false if not. */ function _isNumber(v) { return (typeof v === 'number' || Object.prototype.toString.call(v) === '[object Number]'); } /** * Returns true if the given value is a double. * * @param v the value to check. * * @return true if the value is a double, false if not. */ function _isDouble(v) { return _isNumber(v) && String(v).indexOf('.') !== -1; } /** * Returns true if the given value is numeric. * * @param v the value to check. * * @return true if the value is numeric, false if not. */ function _isNumeric(v) { return !isNaN(parseFloat(v)) && isFinite(v); } /** * Returns true if the given value is a Boolean. * * @param v the value to check. * * @return true if the value is a Boolean, false if not. */ function _isBoolean(v) { return (typeof v === 'boolean' || Object.prototype.toString.call(v) === '[object Boolean]'); } /** * Returns true if the given value is undefined. * * @param v the value to check. * * @return true if the value is undefined, false if not. */ function _isUndefined(v) { return (typeof v === 'undefined'); } /** * Returns true if the given value is a subject with properties. * * @param v the value to check. * * @return true if the value is a subject with properties, false if not. */ function _isSubject(v) { // Note: A value is a subject if all of these hold true: // 1. It is an Object. // 2. It is not a @value, @set, or @list. // 3. It has more than 1 key OR any existing key is not @id. var rval = false; if(_isObject(v) && !(('@value' in v) || ('@set' in v) || ('@list' in v))) { var keyCount = Object.keys(v).length; rval = (keyCount > 1 || !('@id' in v)); } return rval; } /** * Returns true if the given value is a subject reference. * * @param v the value to check. * * @return true if the value is a subject reference, false if not. */ function _isSubjectReference(v) { // Note: A value is a subject reference if all of these hold true: // 1. It is an Object. // 2. It has a single key: @id. return (_isObject(v) && Object.keys(v).length === 1 && ('@id' in v)); } /** * Returns true if the given value is a @value. * * @param v the value to check. * * @return true if the value is a @value, false if not. */ function _isValue(v) { // Note: A value is a @value if all of these hold true: // 1. It is an Object. // 2. It has the @value property. return _isObject(v) && ('@value' in v); } /** * Returns true if the given value is a @list. * * @param v the value to check. * * @return true if the value is a @list, false if not. */ function _isList(v) { // Note: A value is a @list if all of these hold true: // 1. It is an Object. // 2. It has the @list property. return _isObject(v) && ('@list' in v); } /** * Returns true if the given value is a blank node. * * @param v the value to check. * * @return true if the value is a blank node, false if not. */ function _isBlankNode(v) { // Note: A value is a blank node if all of these hold true: // 1. It is an Object. // 2. If it has an @id key its value begins with '_:'. // 3. It has no keys OR is not a @value, @set, or @list. var rval = false; if(_isObject(v)) { if('@id' in v) { rval = (v['@id'].indexOf('_:') === 0); } else { rval = (Object.keys(v).length === 0 || !(('@value' in v) || ('@set' in v) || ('@list' in v))); } } return rval; } /** * Returns true if the given value is an absolute IRI, false if not. * * @param v the value to check. * * @return true if the value is an absolute IRI, false if not. */ function _isAbsoluteIri(v) { return _isString(v) && v.indexOf(':') !== -1; } /** * Clones an object, array, or string/number. * * @param value the value to clone. * * @return the cloned value. */ function _clone(value) { if(value && typeof value === 'object') { var rval = _isArray(value) ? [] : {}; for(var i in value) { rval[i] = _clone(value[i]); } return rval; } return value; } /** * Finds all @context URLs in the given JSON-LD input. * * @param input the JSON-LD input. * @param urls a map of URLs (url => false/@contexts). * @param replace true to replace the URLs in the given input with the * @contexts from the urls map, false not to. * * @return true if new URLs to resolve were found, false if not. */ function _findContextUrls(input, urls, replace) { var count = Object.keys(urls).length; if(_isArray(input)) { for(var i in input) { _findContextUrls(input[i], urls, replace); } return (count < Object.keys(urls).length); } else if(_isObject(input)) { for(var key in input) { if(key !== '@context') { _findContextUrls(input[key], urls, replace); continue; } // get @context var ctx = input[key]; // array @context if(_isArray(ctx)) { var length = ctx.length; for(var i = 0; i < length; ++i) { var _ctx = ctx[i]; if(_isString(_ctx)) { // replace w/@context if requested if(replace) { _ctx = urls[_ctx]; if(_isArray(_ctx)) { // add flattened context Array.prototype.splice.apply(ctx, [i, 1].concat(_ctx)); i += _ctx.length; length += _ctx.length; } else { ctx[i] = _ctx; } } // @context URL found else if(!(_ctx in urls)) { urls[_ctx] = false; } } } } // string @context else if(_isString(ctx)) { // replace w/@context if requested if(replace) { input[key] = urls[ctx]; } // @context URL found else if(!(ctx in urls)) { urls[ctx] = false; } } } return (count < Object.keys(urls).length); } return false; } /** * Resolves external @context URLs using the given URL resolver. Each * instance of @context in the input that refers to a URL will be replaced * with the JSON @context found at that URL. * * @param input the JSON-LD input with possible contexts. * @param resolver(url, callback(err, jsonCtx)) the URL resolver to use. * @param callback(err, input) called once the operation completes. */ function _resolveContextUrls(input, resolver, callback) { // if any error occurs during URL resolution, quit var error = null; var regex = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; // recursive resolver var resolve = function(input, cycles, resolver, callback) { if(Object.keys(cycles).length > MAX_CONTEXT_URLS) { error = new JsonLdError( 'Maximum number of @context URLs exceeded.', 'jsonld.ContextUrlError', {max: MAX_CONTEXT_URLS}); return callback(error); } // for tracking the URLs to resolve var urls = {}; // finished will be called once the URL queue is empty var finished = function() { // replace all URLs in the input _findContextUrls(input, urls, true); callback(null, input); }; // find all URLs in the given input if(!_findContextUrls(input, urls, false)) { // no new URLs in input finished(); } // queue all unresolved URLs var queue = []; for(var url in urls) { if(urls[url] === false) { // validate URL if(!regex.test(url)) { error = new JsonLdError( 'Malformed URL.', 'jsonld.InvalidUrl', {url: url}); return callback(error); } queue.push(url); } } // resolve URLs in queue var count = queue.length; for(var i in queue) { (function(url) { // check for context URL cycle if(url in cycles) { error = new JsonLdError( 'Cyclical @context URLs detected.', 'jsonld.ContextUrlError', {url: url}); return callback(error); } var _cycles = _clone(cycles); _cycles[url] = true; resolver(url, function(err, ctx) { // short-circuit if there was an error with another URL if(error) { return; } // parse string context as JSON if(!err && _isString(ctx)) { try { ctx = JSON.parse(ctx); } catch(ex) { err = ex; } } // ensure ctx is an object if(err || !_isObject(ctx)) { err = new JsonLdError( 'URL does not resolve to a valid JSON-LD object.', 'jsonld.InvalidUrl', {url: url}); } if(err) { error = err; return callback(error); } // use empty context if no @context key is present if(!('@context' in ctx)) { ctx = {'@context': {}}; } // recurse resolve(ctx, _cycles, resolver, function(err, ctx) { if(err) { return callback(err); } urls[url] = ctx['@context']; count -= 1; if(count === 0) { finished(); } }); }); }(queue[i])); } }; resolve(input, {}, resolver, callback); } // define js 1.8.5 Object.keys method if not present if(!Object.keys) { Object.keys = function(o) { if(o !== Object(o)) { throw new TypeError('Object.keys called on non-object'); } var rval = []; for(var p in o) { if(Object.prototype.hasOwnProperty.call(o, p)) { rval.push(p); } } return rval; }; } /** * Parses statements in the form of N-Quads. * * @param input the N-Quads input to parse. * * @return an array of RDF statements. */ function _parseNQuads(input) { // define partial regexes var iri = '(?:<([^:]+:[^>]*)>)'; var bnode = '(_:(?:[A-Za-z][A-Za-z0-9]*))'; var plain = '"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"'; var datatype = '(?:\\^\\^' + iri + ')'; var language = '(?:@([a-z]+(?:-[a-z0-9]+)*))'; var literal = '(?:' + plain + '(?:' + datatype + '|' + language + ')?)'; var ws = '[ \\t]+'; var wso = '[ \\t]*'; var eoln = /(?:\r\n)|(?:\n)|(?:\r)/g; var empty = new RegExp('^' + wso + '$'); // define quad part regexes var subject = '(?:' + iri + '|' + bnode + ')' + ws; var property = iri + ws; var object = '(?:' + iri + '|' + bnode + '|' + literal + ')' + wso; var graph = '(?:\\.|(?:(?:' + iri + '|' + bnode + ')' + wso + '\\.))'; // full quad regex var quad = new RegExp( '^' + wso + subject + property + object + graph + wso + '$'); // build RDF statements var statements = []; // split N-Quad input into lines var lines = input.split(eoln); var lineNumber = 0; for(var i in lines) { var line = lines[i]; lineNumber++; // skip empty lines if(empty.test(line)) { continue; } // parse quad var match = line.match(quad); if(match === null) { throw new JsonLdError( 'Error while parsing N-Quads; invalid quad.', 'jsonld.ParseError', {line: lineNumber}); } // create RDF statement var s = {}; // get subject if(!_isUndefined(match[1])) { s.subject = {nominalValue: match[1], interfaceName: 'IRI'}; } else { s.subject = {nominalValue: match[2], interfaceName: 'BlankNode'}; } // get property s.property = {nominalValue: match[3], interfaceName: 'IRI'}; // get object if(!_isUndefined(match[4])) { s.object = {nominalValue: match[4], interfaceName: 'IRI'}; } else if(!_isUndefined(match[5])) { s.object = {nominalValue: match[5], interfaceName: 'BlankNode'}; } else { var unescaped = match[6] .replace(/\\"/g, '"') .replace(/\\t/g, '\t') .replace(/\\n/g, '\n') .replace(/\\r/g, '\r') .replace(/\\\\/g, '\\'); s.object = {nominalValue: unescaped, interfaceName: 'LiteralNode'}; if(!_isUndefined(match[7])) { s.object.datatype = {nominalValue: match[7], interfaceName: 'IRI'}; } else if(!_isUndefined(match[8])) { s.object.language = match[8]; } } // get graph if(!_isUndefined(match[9])) { s.name = {nominalValue: match[9], interfaceName: 'IRI'}; } else if(!_isUndefined(match[10])) { s.name = {nominalValue: match[10], interfaceName: 'BlankNode'}; } // add unique statement for(var si in statements) { if(_compareRdfStatements(statements[si], s)) { continue; } } statements.push(s); } return statements; } // register the N-Quads RDF parser jsonld.registerRDFParser('application/nquads', _parseNQuads); /** * Converts an RDF statement to an N-Quad string (a single quad). * * @param statement the RDF statement to convert. * @param bnode the bnode the statement is mapped to (optional, for use * during normalization only). * * @return the N-Quad string. */ function _toNQuad(statement, bnode) { var s = statement.subject; var p = statement.property; var o = statement.object; var g = statement.name || null; var quad = ''; // subject is an IRI or bnode if(s.interfaceName === 'IRI') { quad += '<' + s.nominalValue + '>'; } // normalization mode else if(bnode) { quad += (s.nominalValue === bnode) ? '_:a' : '_:z'; } // normal mode else { quad += s.nominalValue; } // property is always an IRI quad += ' <' + p.nominalValue + '> '; // object is IRI, bnode, or literal if(o.interfaceName === 'IRI') { quad += '<' + o.nominalValue + '>'; } else if(o.interfaceName === 'BlankNode') { // normalization mode if(bnode) { quad += (o.nominalValue === bnode) ? '_:a' : '_:z'; } // normal mode else { quad += o.nominalValue; } } else { var escaped = o.nominalValue .replace(/\\/g, '\\\\') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\r/g, '\\r') .replace(/\"/g, '\\"'); quad += '"' + escaped + '"'; if('datatype' in o && o.datatype.nominalValue !== XSD_STRING) { quad += '^^<' + o.datatype.nominalValue + '>'; } else if('language' in o) { quad += '@' + o.language; } } // graph if(g !== null) { if(g.interfaceName === 'IRI') { quad += ' <' + g.nominalValue + '>'; } else if(bnode) { quad += ' _:g'; } else { quad += ' ' + g.nominalValue; } } quad += ' .\n'; return quad; } /** * Parses statements found via the data object from the RDFa API. * * @param data the RDFa API data object. * * @return an array of RDF statements. */ function _parseRdfaApiData(data) { var statements = []; var subjects = data.getSubjects(); for(var si in subjects) { var subject = subjects[si]; if(subject === null) { continue; } // get all related triples var triples = data.getSubjectTriples(subject); if(triples === null) { continue; } var predicates = triples.predicates; for(var p in predicates) { // iterate over objects var objects = predicates[p].objects; for(var oi in objects) { var object = objects[oi]; // create RDF statement var s = {}; // add subject if(subject.indexOf('_:') === 0) { s.subject = {nominalValue: subject, interfaceName: 'BlankNode'}; } else { s.subject = {nominalValue: subject, interfaceName: 'IRI'}; } // add property s.property = {nominalValue: p, interfaceName: 'IRI'}; // serialize XML literal var value = object.value; if(object.type === RDF_XML_LITERAL) { // initialize XMLSerializer if(!XMLSerializer) { _defineXMLSerializer(); } var serializer = new XMLSerializer(); value = ''; for(var x = 0; x < object.value.length; x++) { if(object.value[x].nodeType === Node.ELEMENT_NODE) { value += serializer.serializeToString(object.value[x]); } else if(object.value[x].nodeType === Node.TEXT_NODE) { value += object.value[x].nodeValue; } } } // add object s.object = {nominalValue: value}; // object is an IRI if(object.type === RDF_OBJECT) { if(object.value.indexOf('_:') === 0) { s.object.interfaceName = 'BlankNode'; } else { s.object.interfaceName = 'IRI'; } } // literal else { s.object.interfaceName = 'LiteralNode'; if(object.type === RDF_PLAIN_LITERAL) { if(object.language) { s.object.language = object.language; } } else { s.object.datatype = { nominalValue: object.type, interfaceName: 'IRI' }; } } // add statement statements.push(s); } } } return statements; } // register the RDFa API RDF parser jsonld.registerRDFParser('rdfa-api', _parseRdfaApiData); /** * Creates a new UniqueNamer. A UniqueNamer issues unique names, keeping * track of any previously issued names. * * @param prefix the prefix to use ('<prefix><counter>'). */ function UniqueNamer(prefix) { this.prefix = prefix; this.counter = 0; this.existing = {}; }; /** * Copies this UniqueNamer. * * @return a copy of this UniqueNamer. */ UniqueNamer.prototype.clone = function() { var copy = new UniqueNamer(this.prefix); copy.counter = this.counter; copy.existing = _clone(this.existing); return copy; }; /** * Gets the new name for the given old name, where if no old name is given * a new name will be generated. * * @param [oldName] the old name to get the new name for. * * @return the new name. */ UniqueNamer.prototype.getName = function(oldName) { // return existing old name if(oldName && oldName in this.existing) { return this.existing[oldName]; } // get next name var name = this.prefix + this.counter; this.counter += 1; // save mapping if(oldName) { this.existing[oldName] = name; } return name; }; /** * Returns true if the given oldName has already been assigned a new name. * * @param oldName the oldName to check. * * @return true if the oldName has been assigned a new name, false if not. */ UniqueNamer.prototype.isNamed = function(oldName) { return (oldName in this.existing); }; /** * A Permutator iterates over all possible permutations of the given array * of elements. * * @param list the array of elements to iterate over. */ Permutator = function(list) { // original array this.list = list.sort(); // indicates whether there are more permutations this.done = false; // directional info for permutation algorithm this.left = {}; for(var i in list) { this.left[list[i]] = true; } }; /** * Returns true if there is another permutation. * * @return true if there is another permutation, false if not. */ Permutator.prototype.hasNext = function() { return !this.done; }; /** * Gets the next permutation. Call hasNext() to ensure there is another one * first. * * @return the next permutation. */ Permutator.prototype.next = function() { // copy current permutation var rval = this.list.slice(); /* Calculate the next permutation using the Steinhaus-Johnson-Trotter permutation algorithm. */ // get largest mobile element k // (mobile: element is greater than the one it is looking at) var k = null; var pos = 0; var length = this.list.length; for(var i = 0; i < length; ++i) { var element = this.list[i]; var left = this.left[element]; if((k === null || element > k) && ((left && i > 0 && element > this.list[i - 1]) || (!left && i < (length - 1) && element > this.list[i + 1]))) { k = element; pos = i; } } // no more permutations if(k === null) { this.done = true; } else { // swap k and the element it is looking at var swap = this.left[k] ? pos - 1 : pos + 1; this.list[pos] = this.list[swap]; this.list[swap] = k; // reverse the direction of all elements larger than k for(var i = 0; i < length; ++i) { if(this.list[i] > k) { this.left[this.list[i]] = !this.left[this.list[i]]; } } } return rval; }; // SHA-1 API var sha1 = jsonld.sha1 = {}; if(_nodejs) { var crypto = require('crypto'); sha1.create = function() { var md = crypto.createHash('sha1'); return { update: function(data) { md.update(data, 'utf8'); }, digest: function() { return md.digest('hex'); } }; }; } else { sha1.create = function() { return new sha1.MessageDigest(); }; } /** * Hashes the given array of quads and returns its hexadecimal SHA-1 message * digest. * * @param nquads the list of serialized quads to hash. * * @return the hexadecimal SHA-1 message digest. */ sha1.hash = function(nquads) { var md = sha1.create(); for(var i in nquads) { md.update(nquads[i]); } return md.digest(); }; // only define sha1 MessageDigest for non-nodejs if(!_nodejs) { /** * Creates a simple byte buffer for message digest operations. */ sha1.Buffer = function() { this.data = ''; this.read = 0; }; /** * Puts a 32-bit integer into this buffer in big-endian order. * * @param i the 32-bit integer. */ sha1.Buffer.prototype.putInt32 = function(i) { this.data += ( String.fromCharCode(i >> 24 & 0xFF) + String.fromCharCode(i >> 16 & 0xFF) + String.fromCharCode(i >> 8 & 0xFF) + String.fromCharCode(i & 0xFF)); }; /** * Gets a 32-bit integer from this buffer in big-endian order and * advances the read pointer by 4. * * @return the word. */ sha1.Buffer.prototype.getInt32 = function() { var rval = ( this.data.charCodeAt(this.read) << 24 ^ this.data.charCodeAt(this.read + 1) << 16 ^ this.data.charCodeAt(this.read + 2) << 8 ^ this.data.charCodeAt(this.read + 3)); this.read += 4; return rval; }; /** * Gets the bytes in this buffer. * * @return a string full of UTF-8 encoded characters. */ sha1.Buffer.prototype.bytes = function() { return this.data.slice(this.read); }; /** * Gets the number of bytes in this buffer. * * @return the number of bytes in this buffer. */ sha1.Buffer.prototype.length = function() { return this.data.length - this.read; }; /** * Compacts this buffer. */ sha1.Buffer.prototype.compact = function() { this.data = this.data.slice(this.read); this.read = 0; }; /** * Converts this buffer to a hexadecimal string. * * @return a hexadecimal string. */ sha1.Buffer.prototype.toHex = function() { var rval = ''; for(var i = this.read; i < this.data.length; ++i) { var b = this.data.charCodeAt(i); if(b < 16) { rval += '0'; } rval += b.toString(16); } return rval; }; /** * Creates a SHA-1 message digest object. * * @return a message digest object. */ sha1.MessageDigest = function() { // do initialization as necessary if(!_sha1.initialized) { _sha1.init(); } this.blockLength = 64; this.digestLength = 20; // length of message so far (does not including padding) this.messageLength = 0; // input buffer this.input = new sha1.Buffer(); // for storing words in the SHA-1 algorithm this.words = new Array(80); // SHA-1 state contains five 32-bit integers this.state = { h0: 0x67452301, h1: 0xEFCDAB89, h2: 0x98BADCFE, h3: 0x10325476, h4: 0xC3D2E1F0 }; }; /** * Updates the digest with the given string input. * * @param msg the message input to update with. */ sha1.MessageDigest.prototype.update = function(msg) { // UTF-8 encode message msg = unescape(encodeURIComponent(msg)); // update message length and input buffer this.messageLength += msg.length; this.input.data += msg; // process input _sha1.update(this.state, this.words, this.input); // compact input buffer every 2K or if empty if(this.input.read > 2048 || this.input.length() === 0) { this.input.compact(); } }; /** * Produces the digest. * * @return the digest as a hexadecimal string. */ sha1.MessageDigest.prototype.digest = function() { /* Determine the number of bytes that must be added to the message to ensure its length is congruent to 448 mod 512. In other words, a 64-bit integer that gives the length of the message will be appended to the message and whatever the length of the message is plus 64 bits must be a multiple of 512. So the length of the message must be congruent to 448 mod 512 because 512 - 64 = 448. In order to fill up the message length it must be filled with padding that begins with 1 bit followed by all 0 bits. Padding must *always* be present, so if the message length is already congruent to 448 mod 512, then 512 padding bits must be added. */ // 512 bits == 64 bytes, 448 bits == 56 bytes, 64 bits = 8 bytes // _padding starts with 1 byte with first bit is set in it which // is byte value 128, then there may be up to 63 other pad bytes var len = this.messageLength; var padBytes = new sha1.Buffer(); padBytes.data += this.input.bytes(); padBytes.data += _sha1.padding.substr(0, 64 - ((len + 8) % 64)); /* Now append length of the message. The length is appended in bits as a 64-bit number in big-endian order. Since we store the length in bytes, we must multiply it by 8 (or left shift by 3). So here store the high 3 bits in the low end of the first 32-bits of the 64-bit number and the lower 5 bits in the high end of the second 32-bits. */ padBytes.putInt32((len >>> 29) & 0xFF); padBytes.putInt32((len << 3) & 0xFFFFFFFF); _sha1.update(this.state, this.words, padBytes); var rval = new sha1.Buffer(); rval.putInt32(this.state.h0); rval.putInt32(this.state.h1); rval.putInt32(this.state.h2); rval.putInt32(this.state.h3); rval.putInt32(this.state.h4); return rval.toHex(); }; // private SHA-1 data var _sha1 = { padding: null, initialized: false }; /** * Initializes the constant tables. */ _sha1.init = function() { // create padding _sha1.padding = String.fromCharCode(128); var c = String.fromCharCode(0x00); var n = 64; while(n > 0) { if(n & 1) { _sha1.padding += c; } n >>>= 1; if(n > 0) { c += c; } } // now initialized _sha1.initialized = true; }; /** * Updates a SHA-1 state with the given byte buffer. * * @param s the SHA-1 state to update. * @param w the array to use to store words. * @param input the input byte buffer. */ _sha1.update = function(s, w, input) { // consume 512 bit (64 byte) chunks var t, a, b, c, d, e, f, i; var len = input.length(); while(len >= 64) { // the w array will be populated with sixteen 32-bit big-endian words // and then extended into 80 32-bit words according to SHA-1 algorithm // and for 32-79 using Max Locktyukhin's optimization // initialize hash value for this chunk a = s.h0; b = s.h1; c = s.h2; d = s.h3; e = s.h4; // round 1 for(i = 0; i < 16; ++i) { t = input.getInt32(); w[i] = t; f = d ^ (b & (c ^ d)); t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } for(; i < 20; ++i) { t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); t = (t << 1) | (t >>> 31); w[i] = t; f = d ^ (b & (c ^ d)); t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // round 2 for(; i < 32; ++i) { t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); t = (t << 1) | (t >>> 31); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } for(; i < 40; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // round 3 for(; i < 60; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = (b & c) | (d & (b ^ c)); t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // round 4 for(; i < 80; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t; e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // update hash state s.h0 += a; s.h1 += b; s.h2 += c; s.h3 += d; s.h4 += e; len -= 64; } }; } // end non-nodejs if(!XMLSerializer) { function _defineXMLSerializer() { XMLSerializer = require('xmldom').XMLSerializer; } } // end _defineXMLSerializer // define URL parser jsonld.url = {}; if(_nodejs) { jsonld.url.parse = require('url').parse; } else { // parseUri 1.2.2 // (c) Steven Levithan <stevenlevithan.com> // MIT License var parseUri = {}; parseUri.options = { key: ['href','protocol','host','userInfo','user','password','hostname','port','relative','path','directory','file','query','hash'], parser: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/ }; jsonld.url.parse = function(str) { var o = parseUri.options; var m = o.parser.exec(str); var uri = {}; var i = 14; while(i--) { uri[o.key[i]] = m[i] || ''; } // normalize to node.js API if(uri.host && uri.path === '') { uri.path = '/'; } uri.pathname = uri.path; if(uri.query) { uri.path = uri.path + '?' + uri.query; } uri.protocol += ':'; if(uri.hash) { uri.hash = '#' + uri.hash; } return uri; }; } })();
OnsenUI/cdnjs
ajax/libs/jsonld/0.0.7/jsonld.js
JavaScript
mit
166,041
/** * @license ng-slider - v2.1.5 * (c) 2013 Julien VALERY https://github.com/darul75/ng-slider * License: MIT **/ .jslider .jslider-bg i,.jslider .jslider-pointer{background-image:url(../img/jslider.png) no-repeat 0 0}.jslider.sliderCSS .jslider-pointer{background-color:silver}.jslider.disabled{opacity:.5}.jslider.vertical .jslider-bg i,.jslider.vertical .jslider-pointer{background-image:url(../img/jslider.round.png) no-repeat 0 0}.jslider.vertical.sliderCSS .jslider-bg i,.jslider.vertical.sliderCSS .jslider-pointer{background-color:silver;background-image:none}.jslider{display:block;width:100%;height:1em;position:relative;top:.6em;font-family:Arial,sans-serif}.jslider table{width:100%;border-collapse:collapse;border:0}.jslider td,.jslider th{padding:0;vertical-align:top;text-align:left;border:0}.jslider.vertical{display:block;width:17px;height:100%;position:relative;top:.6em;font-family:Arial,sans-serif}.jslider.vertical table{height:100%;border-collapse:collapse;border:0}.jslider table,.jslider table tr,.jslider table tr td{width:100%;vertical-align:top}.jslider.vertical table,.jslider.vertical table tr,.jslider.vertical table tr td{height:100%;vertical-align:top}.jslider .jslider-bg{position:relative}.jslider .jslider-bg i{height:5px;position:absolute;font-size:0;top:0}.jslider .jslider-bg .l{width:50%;background-position:0 0;left:0}.jslider .jslider-bg .r{width:50%;left:50%;background-position:right 0}.jslider .jslider-bg .v{z-index:1;position:absolute;width:60%;left:20%;top:0;height:5px;background-repeat:repeat-x;background-position:0 -40px}.jslider.sliderCSS .jslider-bg .l{width:100%;left:0;background-color:silver;background-image:none}.jslider.sliderCSS .jslider-bg .p{left:0;width:1px;background-color:transparent;background-image:none}.jslider.sliderCSS .jslider-bg .s{z-index:1;left:0;width:1px;background-color:transparent;background-image:none}.jslider.sliderCSS .jslider-bg .f{left:0;background-color:transparent;background-image:none}.jslider.sliderCSS .jslider-bg .v{z-index:1;position:absolute;width:60%;left:20%;top:0;height:5px;background-image:none;background-color:#777575}.jslider.vertical .jslider-bg{position:relative;height:100%}.jslider.vertical .jslider-bg i{width:5px;position:absolute;font-size:0;top:0}.jslider.vertical .jslider-bg .l{height:50%;top:0;left:12px;background-position:-55px 0;background-repeat:repeat-y}.jslider.vertical .jslider-bg .r{height:50%;top:50%;left:12px;background-position:right 0;background-repeat:repeat-y}.jslider.vertical .jslider-bg .v{z-index:1;position:absolute;width:60%;left:12px;top:0;height:100%;background-repeat:repeat-y;background-position:-35px 16px}.jslider.vertical.sliderCSS .jslider-bg .l{width:5px;height:50%;top:0;background-color:silver;background-image:none}.jslider.vertical.sliderCSS .jslider-bg .r{width:5px;height:50%;top:50%;background-color:silver;background-image:none}.jslider.vertical.sliderCSS .jslider-bg .v{z-index:1;width:5px;height:100%;background-color:#777575;background-image:none}.jslider.vertical.sliderCSS .jslider-bg .p{left:12px;width:5px;background-color:transparent;background-image:none}.jslider.vertical.sliderCSS .jslider-bg .s{left:12px;width:5px;background-color:transparent;background-image:none;z-index:2;height:1px}.jslider.vertical.sliderCSS .jslider-bg .f{left:12px;background-color:transparent;background-image:none}.jslider .jslider-pointer{width:15px;height:15px;background-position:-1px -60px;position:absolute;left:20%;top:-4px;margin-left:-8px;cursor:pointer;cursor:hand}.jslider .jslider-pointer-to{left:80%}.jslider .jslider-pointer-hover{background-position:-21px -60px}.jslider.vertical .jslider-pointer{left:62%;background-position:80px -3px}.jslider.vertical .jslider-pointer.jslider-pointer-hover{background-position:0 -23px}.jslider.vertical .jslider-pointer-to{left:62%}.jslider.vertical .jslider-pointer-to.jslider-pointer-hover{background-position:0 -23px}.jslider .jslider-label{font-size:9px;line-height:12px;color:#000;opacity:.4;white-space:nowrap;padding:0 2px;position:absolute;top:-18px;left:0}.jslider .jslider-label-to{left:auto;right:0}.jslider.vertical .jslider-label{margin-left:10px;top:0}.jslider.vertical .jslider-label-to{top:100%;left:inherit;right:inherit}.jslider .jslider-value{left:0;font-size:9px;white-space:nowrap;padding:1px 2px 0;position:absolute;top:-19px;background:#fff;line-height:12px;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;border-radius:2px}.jslider .jslider-value-to{left:80%}.jslider.vertical .jslider-value{left:0;top:0}.jslider.vertical .jslider-value-to{left:0;top:80%}.jslider .jslider-label small,.jslider .jslider-value small{position:relative;top:-.4em}.jslider .jslider-scale{position:relative;top:9px}.jslider .jslider-scale span{position:absolute;height:5px;border-left:1px solid #999;font-size:0}.jslider.vertical .jslider-scale span{position:absolute;width:5px;height:1px;border-left:0;font-size:0;border-top:1px solid #999}.jslider .jslider-scale ins{font-size:9px;text-decoration:none;position:absolute;left:0;top:5px;color:#999}.jslider.vertical .jslider-scale ins{font-size:9px;text-decoration:none;position:absolute;left:0;top:5px;color:#999}.jslider.vertical .jslider-scale{position:inherit}.jslider-single .jslider-pointer-to,.jslider-single .jslider-value-to,.jslider-single .jslider-bg .v,.jslider-limitless .jslider-label{display:none}.jslider_round .jslider-bg i,.jslider_round .jslider-pointer{background-image:url(../img/jslider.round.png)}.jslider_round.sliderCSS .jslider-bg i,.jslider_round.sliderCSS .jslider-pointer{background-image:none}.jslider_round.sliderCSS .jslider-pointer{z-index:3;background-color:#615959;width:10px;height:10px;border-radius:50%;top:-3px}.jslider_round .jslider-pointer{z-index:2;width:20px;height:17px;top:-6px}.jslider_round.vertical .jslider-bg i,.jslider_round.vertical .jslider-pointer{background-image:url(../img/jslider.round.vertical.png)}.jslider_round.vertical.sliderCSS .jslider-bg i,.jslider_round.vertical.sliderCSS .jslider-pointer{background-image:none}.jslider_round.vertical.sliderCSS .jslider-pointer{left:16px;background-color:#615959;width:10px;height:10px;border-radius:50%}.jslider_round.vertical .jslider-pointer{width:20px;height:17px;top:-6px;margin-left:-7px}
chinakids/cdnjs
ajax/libs/ng-slider/2.1.6/css/ng-slider.min.css
CSS
mit
6,275
/*! * VERSION: 1.14.2 * DATE: 2014-10-18 * UPDATES AND DOCS AT: http://www.greensock.com * * @license Copyright (c) 2008-2014, GreenSock. All rights reserved. * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for * Club GreenSock members, the software agreement that was issued with your membership. * * @author: Jack Doyle, jack@greensock.com */ var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=function(t){e.call(this,t),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var i,s,r=this.vars;for(s in r)i=r[s],o(i)&&-1!==i.join("").indexOf("{self}")&&(r[s]=this._swapSelfInParams(i));o(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},r=1e-10,n=i._internals,a=n.isSelector,o=n.isArray,h=n.lazyTweens,l=n.lazyRender,_=[],u=_gsScope._gsDefine.globals,c=function(t){var e,i={};for(e in t)i[e]=t[e];return i},p=function(t,e,i,s){var r=t._timeline._totalTime;(e||!this._forcingPlayhead)&&(t._timeline.pause(t._startTime),e&&e.apply(s||t._timeline,i||_),this._forcingPlayhead&&t._timeline.seek(r))},f=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},m=s.prototype=new e;return s.version="1.14.2",m.constructor=s,m.kill()._gc=m._forcingPlayhead=!1,m.to=function(t,e,s,r){var n=s.repeat&&u.TweenMax||i;return e?this.add(new n(t,e,s),r):this.set(t,s,r)},m.from=function(t,e,s,r){return this.add((s.repeat&&u.TweenMax||i).from(t,e,s),r)},m.fromTo=function(t,e,s,r,n){var a=r.repeat&&u.TweenMax||i;return e?this.add(a.fromTo(t,e,s,r),n):this.set(t,r,n)},m.staggerTo=function(t,e,r,n,o,h,l,_){var u,p=new s({onComplete:h,onCompleteParams:l,onCompleteScope:_,smoothChildTiming:this.smoothChildTiming});for("string"==typeof t&&(t=i.selector(t)||t),t=t||[],a(t)&&(t=f(t)),n=n||0,0>n&&(t=f(t),t.reverse(),n*=-1),u=0;t.length>u;u++)r.startAt&&(r.startAt=c(r.startAt)),p.to(t[u],e,c(r),u*n);return this.add(p,o)},m.staggerFrom=function(t,e,i,s,r,n,a,o){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,s,r,n,a,o)},m.staggerFromTo=function(t,e,i,s,r,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,s,r,n,a,o,h)},m.call=function(t,e,s,r){return this.add(i.delayedCall(0,t,e,s),r)},m.set=function(t,e,s){return s=this._parseTimeOrLabel(s,0,!0),null==e.immediateRender&&(e.immediateRender=s===this._time&&!this._paused),this.add(new i(t,0,e),s)},s.exportRoot=function(t,e){t=t||{},null==t.smoothChildTiming&&(t.smoothChildTiming=!0);var r,n,a=new s(t),o=a._timeline;for(null==e&&(e=!0),o._remove(a,!0),a._startTime=0,a._rawPrevTime=a._time=a._totalTime=o._time,r=o._first;r;)n=r._next,e&&r instanceof i&&r.target===r.vars.onComplete||a.add(r,r._startTime-r._delay),r=n;return o.add(a,0),a},m.add=function(r,n,a,h){var l,_,u,c,p,f;if("number"!=typeof n&&(n=this._parseTimeOrLabel(n,0,!0,r)),!(r instanceof t)){if(r instanceof Array||r&&r.push&&o(r)){for(a=a||"normal",h=h||0,l=n,_=r.length,u=0;_>u;u++)o(c=r[u])&&(c=new s({tweens:c})),this.add(c,l),"string"!=typeof c&&"function"!=typeof c&&("sequence"===a?l=c._startTime+c.totalDuration()/c._timeScale:"start"===a&&(c._startTime-=c.delay())),l+=h;return this._uncache(!0)}if("string"==typeof r)return this.addLabel(r,n);if("function"!=typeof r)throw"Cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedCall(0,r)}if(e.prototype.add.call(this,r,n),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(p=this,f=p.rawTime()>r._startTime;p._timeline;)f&&p._timeline.smoothChildTiming?p.totalTime(p._totalTime,!0):p._gc&&p._enabled(!0,!1),p=p._timeline;return this},m.remove=function(e){if(e instanceof t)return this._remove(e,!1);if(e instanceof Array||e&&e.push&&o(e)){for(var i=e.length;--i>-1;)this.remove(e[i]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},m._remove=function(t,i){e.prototype._remove.call(this,t,i);var s=this._last;return s?this._time>s._startTime+s._totalDuration/s._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},m.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},m.insert=m.insertMultiple=function(t,e,i,s){return this.add(t,e||0,i,s)},m.appendMultiple=function(t,e,i,s){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,s)},m.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},m.addPause=function(t,e,i,s){return this.call(p,["{self}",e,i,s],this,t)},m.removeLabel=function(t){return delete this._labels[t],this},m.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},m._parseTimeOrLabel=function(e,i,s,r){var n;if(r instanceof t&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&o(r)))for(n=r.length;--n>-1;)r[n]instanceof t&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof i)return this._parseTimeOrLabel(i,s&&"number"==typeof e&&null==this._labels[i]?e-this.duration():0,s);if(i=i||0,"string"!=typeof e||!isNaN(e)&&null==this._labels[e])null==e&&(e=this.duration());else{if(n=e.indexOf("="),-1===n)return null==this._labels[e]?s?this._labels[e]=this.duration()+i:i:this._labels[e]+i;i=parseInt(e.charAt(n-1)+"1",10)*Number(e.substr(n+1)),e=n>1?this._parseTimeOrLabel(e.substr(0,n-1),0,s):this.duration()}return Number(e)+i},m.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),e!==!1)},m.stop=function(){return this.paused(!0)},m.gotoAndPlay=function(t,e){return this.play(t,e)},m.gotoAndStop=function(t,e){return this.pause(t,e)},m.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,n,a,o,u,c=this._dirty?this.totalDuration():this._totalDuration,p=this._time,f=this._startTime,m=this._timeScale,d=this._paused;if(t>=c?(this._totalTime=this._time=c,this._reversed||this._hasPausedChild()||(n=!0,o="onComplete",0===this._duration&&(0===t||0>this._rawPrevTime||this._rawPrevTime===r)&&this._rawPrevTime!==t&&this._first&&(u=!0,this._rawPrevTime>r&&(o="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=c+1e-4):1e-7>t?(this._totalTime=this._time=0,(0!==p||0===this._duration&&this._rawPrevTime!==r&&(this._rawPrevTime>0||0>t&&this._rawPrevTime>=0))&&(o="onReverseComplete",n=this._reversed),0>t?(this._active=!1,this._rawPrevTime>=0&&this._first&&(u=!0),this._rawPrevTime=t):(this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(u=!0))):this._totalTime=this._time=this._rawPrevTime=t,this._time!==p&&this._first||i||u){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==p&&t>0&&(this._active=!0),0===p&&this.vars.onStart&&0!==this._time&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||_)),this._time>=p)for(s=this._first;s&&(a=s._next,!this._paused||d);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;else for(s=this._last;s&&(a=s._prev,!this._paused||d);)(s._active||p>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;this._onUpdate&&(e||(h.length&&l(),this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_))),o&&(this._gc||(f===this._startTime||m!==this._timeScale)&&(0===this._time||c>=this.totalDuration())&&(n&&(h.length&&l(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this.vars[o].apply(this.vars[o+"Scope"]||this,this.vars[o+"Params"]||_)))}},m._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof s&&t._hasPausedChild())return!0;t=t._next}return!1},m.getChildren=function(t,e,s,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)r>a._startTime||(a instanceof i?e!==!1&&(n[o++]=a):(s!==!1&&(n[o++]=a),t!==!1&&(n=n.concat(a.getChildren(!0,e,s)),o=n.length))),a=a._next;return n},m.getTweensOf=function(t,e){var s,r,n=this._gc,a=[],o=0;for(n&&this._enabled(!0,!0),s=i.getTweensOf(t),r=s.length;--r>-1;)(s[r].timeline===this||e&&this._contains(s[r]))&&(a[o++]=s[r]);return n&&this._enabled(!1,!0),a},m.recent=function(){return this._recent},m._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},m.shiftChildren=function(t,e,i){i=i||0;for(var s,r=this._first,n=this._labels;r;)r._startTime>=i&&(r._startTime+=t),r=r._next;if(e)for(s in n)n[s]>=i&&(n[s]+=t);return this._uncache(!0)},m._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),s=i.length,r=!1;--s>-1;)i[s]._kill(t,e)&&(r=!0);return r},m.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;--i>-1;)e[i]._enabled(!1,!1);return t!==!1&&(this._labels={}),this._uncache(!0)},m.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return t.prototype.invalidate.call(this)},m._enabled=function(t,i){if(t===this._gc)for(var s=this._first;s;)s._enabled(t,!0),s=s._next;return e.prototype._enabled.call(this,t,i)},m.totalTime=function(){this._forcingPlayhead=!0;var e=t.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,e},m.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},m.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,s=0,r=this._last,n=999999999999;r;)e=r._prev,r._dirty&&r.totalDuration(),r._startTime>n&&this._sortChildren&&!r._paused?this.add(r,r._startTime-r._delay):n=r._startTime,0>r._startTime&&!r._paused&&(s-=r._startTime,this._timeline.smoothChildTiming&&(this._startTime+=r._startTime/this._timeScale),this.shiftChildren(-r._startTime,!1,-9999999999),n=0),i=r._startTime+r._totalDuration/r._timeScale,i>s&&(s=i),r=e;this._duration=this._totalDuration=s,this._dirty=!1}return this._totalDuration}return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this},m.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===t._rootFramesTimeline},m.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},s},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(t){"use strict";var e=function(){return(_gsScope.GreenSockGlobals||_gsScope)[t]};"function"==typeof define&&define.amd?define(["TweenLite"],e):"undefined"!=typeof module&&module.exports&&(require("./TweenLite.js"),module.exports=e())}("TimelineLite");
cdnjs/cdnjs
ajax/libs/gsap/1.14.2/TimelineLite.min.js
JavaScript
mit
11,139
/* YUI 3.16.0 (build 76f0e08) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/anim-easing/anim-easing.js']) { __coverage__['build/anim-easing/anim-easing.js'] = {"path":"build/anim-easing/anim-easing.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":42}}},"2":{"name":"(anonymous_2)","line":52,"loc":{"start":{"line":52,"column":14},"end":{"line":52,"column":36}}},"3":{"name":"(anonymous_3)","line":65,"loc":{"start":{"line":65,"column":12},"end":{"line":65,"column":34}}},"4":{"name":"(anonymous_4)","line":78,"loc":{"start":{"line":78,"column":13},"end":{"line":78,"column":35}}},"5":{"name":"(anonymous_5)","line":91,"loc":{"start":{"line":91,"column":14},"end":{"line":91,"column":36}}},"6":{"name":"(anonymous_6)","line":108,"loc":{"start":{"line":108,"column":18},"end":{"line":108,"column":40}}},"7":{"name":"(anonymous_7)","line":121,"loc":{"start":{"line":121,"column":19},"end":{"line":121,"column":41}}},"8":{"name":"(anonymous_8)","line":134,"loc":{"start":{"line":134,"column":20},"end":{"line":134,"column":42}}},"9":{"name":"(anonymous_9)","line":154,"loc":{"start":{"line":154,"column":15},"end":{"line":154,"column":43}}},"10":{"name":"(anonymous_10)","line":188,"loc":{"start":{"line":188,"column":16},"end":{"line":188,"column":44}}},"11":{"name":"(anonymous_11)","line":222,"loc":{"start":{"line":222,"column":17},"end":{"line":222,"column":45}}},"12":{"name":"(anonymous_12)","line":263,"loc":{"start":{"line":263,"column":12},"end":{"line":263,"column":37}}},"13":{"name":"(anonymous_13)","line":283,"loc":{"start":{"line":283,"column":13},"end":{"line":283,"column":38}}},"14":{"name":"(anonymous_14)","line":301,"loc":{"start":{"line":301,"column":14},"end":{"line":301,"column":39}}},"15":{"name":"(anonymous_15)","line":321,"loc":{"start":{"line":321,"column":14},"end":{"line":321,"column":36}}},"16":{"name":"(anonymous_16)","line":334,"loc":{"start":{"line":334,"column":15},"end":{"line":334,"column":37}}},"17":{"name":"(anonymous_17)","line":354,"loc":{"start":{"line":354,"column":16},"end":{"line":354,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":365,"column":42}},"2":{"start":{"line":40,"column":0},"end":{"line":360,"column":2}},"3":{"start":{"line":53,"column":8},"end":{"line":53,"column":25}},"4":{"start":{"line":66,"column":8},"end":{"line":66,"column":30}},"5":{"start":{"line":79,"column":8},"end":{"line":79,"column":36}},"6":{"start":{"line":92,"column":8},"end":{"line":94,"column":9}},"7":{"start":{"line":93,"column":12},"end":{"line":93,"column":31}},"8":{"start":{"line":96,"column":8},"end":{"line":96,"column":44}},"9":{"start":{"line":109,"column":8},"end":{"line":109,"column":34}},"10":{"start":{"line":122,"column":8},"end":{"line":122,"column":46}},"11":{"start":{"line":135,"column":8},"end":{"line":137,"column":9}},"12":{"start":{"line":136,"column":12},"end":{"line":136,"column":35}},"13":{"start":{"line":139,"column":8},"end":{"line":139,"column":45}},"14":{"start":{"line":155,"column":8},"end":{"line":155,"column":14}},"15":{"start":{"line":156,"column":8},"end":{"line":158,"column":9}},"16":{"start":{"line":157,"column":12},"end":{"line":157,"column":21}},"17":{"start":{"line":159,"column":8},"end":{"line":161,"column":9}},"18":{"start":{"line":160,"column":12},"end":{"line":160,"column":23}},"19":{"start":{"line":162,"column":8},"end":{"line":164,"column":9}},"20":{"start":{"line":163,"column":12},"end":{"line":163,"column":23}},"21":{"start":{"line":166,"column":8},"end":{"line":172,"column":9}},"22":{"start":{"line":167,"column":12},"end":{"line":167,"column":18}},"23":{"start":{"line":168,"column":12},"end":{"line":168,"column":20}},"24":{"start":{"line":171,"column":12},"end":{"line":171,"column":48}},"25":{"start":{"line":174,"column":8},"end":{"line":174,"column":82}},"26":{"start":{"line":189,"column":8},"end":{"line":189,"column":14}},"27":{"start":{"line":190,"column":8},"end":{"line":192,"column":9}},"28":{"start":{"line":191,"column":12},"end":{"line":191,"column":21}},"29":{"start":{"line":193,"column":8},"end":{"line":195,"column":9}},"30":{"start":{"line":194,"column":12},"end":{"line":194,"column":23}},"31":{"start":{"line":196,"column":8},"end":{"line":198,"column":9}},"32":{"start":{"line":197,"column":12},"end":{"line":197,"column":22}},"33":{"start":{"line":200,"column":8},"end":{"line":206,"column":9}},"34":{"start":{"line":201,"column":12},"end":{"line":201,"column":18}},"35":{"start":{"line":202,"column":12},"end":{"line":202,"column":22}},"36":{"start":{"line":205,"column":12},"end":{"line":205,"column":48}},"37":{"start":{"line":208,"column":8},"end":{"line":208,"column":79}},"38":{"start":{"line":223,"column":8},"end":{"line":223,"column":14}},"39":{"start":{"line":224,"column":8},"end":{"line":226,"column":9}},"40":{"start":{"line":225,"column":12},"end":{"line":225,"column":21}},"41":{"start":{"line":228,"column":8},"end":{"line":230,"column":9}},"42":{"start":{"line":229,"column":12},"end":{"line":229,"column":23}},"43":{"start":{"line":232,"column":8},"end":{"line":234,"column":9}},"44":{"start":{"line":233,"column":12},"end":{"line":233,"column":28}},"45":{"start":{"line":236,"column":8},"end":{"line":242,"column":9}},"46":{"start":{"line":237,"column":12},"end":{"line":237,"column":18}},"47":{"start":{"line":238,"column":12},"end":{"line":238,"column":20}},"48":{"start":{"line":241,"column":12},"end":{"line":241,"column":48}},"49":{"start":{"line":244,"column":8},"end":{"line":247,"column":9}},"50":{"start":{"line":245,"column":12},"end":{"line":246,"column":59}},"51":{"start":{"line":248,"column":8},"end":{"line":249,"column":62}},"52":{"start":{"line":264,"column":8},"end":{"line":266,"column":9}},"53":{"start":{"line":265,"column":12},"end":{"line":265,"column":24}},"54":{"start":{"line":267,"column":8},"end":{"line":269,"column":9}},"55":{"start":{"line":268,"column":12},"end":{"line":268,"column":23}},"56":{"start":{"line":270,"column":8},"end":{"line":270,"column":44}},"57":{"start":{"line":284,"column":8},"end":{"line":286,"column":9}},"58":{"start":{"line":285,"column":12},"end":{"line":285,"column":24}},"59":{"start":{"line":287,"column":8},"end":{"line":287,"column":53}},"60":{"start":{"line":302,"column":8},"end":{"line":304,"column":9}},"61":{"start":{"line":303,"column":12},"end":{"line":303,"column":24}},"62":{"start":{"line":306,"column":8},"end":{"line":308,"column":9}},"63":{"start":{"line":307,"column":12},"end":{"line":307,"column":58}},"64":{"start":{"line":309,"column":8},"end":{"line":309,"column":63}},"65":{"start":{"line":322,"column":8},"end":{"line":322,"column":56}},"66":{"start":{"line":335,"column":8},"end":{"line":341,"column":9}},"67":{"start":{"line":336,"column":16},"end":{"line":336,"column":42}},"68":{"start":{"line":337,"column":15},"end":{"line":341,"column":9}},"69":{"start":{"line":338,"column":16},"end":{"line":338,"column":63}},"70":{"start":{"line":339,"column":15},"end":{"line":341,"column":9}},"71":{"start":{"line":340,"column":16},"end":{"line":340,"column":66}},"72":{"start":{"line":342,"column":8},"end":{"line":342,"column":61}},"73":{"start":{"line":355,"column":8},"end":{"line":357,"column":9}},"74":{"start":{"line":356,"column":12},"end":{"line":356,"column":63}},"75":{"start":{"line":358,"column":8},"end":{"line":358,"column":74}},"76":{"start":{"line":362,"column":0},"end":{"line":362,"column":18}}},"branchMap":{"1":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":8}},{"start":{"line":92,"column":8},"end":{"line":92,"column":8}}]},"2":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]},"3":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"4":{"line":159,"type":"if","locations":[{"start":{"line":159,"column":8},"end":{"line":159,"column":8}},{"start":{"line":159,"column":8},"end":{"line":159,"column":8}}]},"5":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]},"6":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":8},"end":{"line":166,"column":8}},{"start":{"line":166,"column":8},"end":{"line":166,"column":8}}]},"7":{"line":166,"type":"binary-expr","locations":[{"start":{"line":166,"column":12},"end":{"line":166,"column":14}},{"start":{"line":166,"column":18},"end":{"line":166,"column":33}}]},"8":{"line":190,"type":"if","locations":[{"start":{"line":190,"column":8},"end":{"line":190,"column":8}},{"start":{"line":190,"column":8},"end":{"line":190,"column":8}}]},"9":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"10":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]},"11":{"line":200,"type":"if","locations":[{"start":{"line":200,"column":8},"end":{"line":200,"column":8}},{"start":{"line":200,"column":8},"end":{"line":200,"column":8}}]},"12":{"line":200,"type":"binary-expr","locations":[{"start":{"line":200,"column":12},"end":{"line":200,"column":14}},{"start":{"line":200,"column":18},"end":{"line":200,"column":33}}]},"13":{"line":224,"type":"if","locations":[{"start":{"line":224,"column":8},"end":{"line":224,"column":8}},{"start":{"line":224,"column":8},"end":{"line":224,"column":8}}]},"14":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":8},"end":{"line":228,"column":8}},{"start":{"line":228,"column":8},"end":{"line":228,"column":8}}]},"15":{"line":232,"type":"if","locations":[{"start":{"line":232,"column":8},"end":{"line":232,"column":8}},{"start":{"line":232,"column":8},"end":{"line":232,"column":8}}]},"16":{"line":236,"type":"if","locations":[{"start":{"line":236,"column":8},"end":{"line":236,"column":8}},{"start":{"line":236,"column":8},"end":{"line":236,"column":8}}]},"17":{"line":236,"type":"binary-expr","locations":[{"start":{"line":236,"column":13},"end":{"line":236,"column":15}},{"start":{"line":236,"column":19},"end":{"line":236,"column":34}}]},"18":{"line":244,"type":"if","locations":[{"start":{"line":244,"column":8},"end":{"line":244,"column":8}},{"start":{"line":244,"column":8},"end":{"line":244,"column":8}}]},"19":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":8},"end":{"line":264,"column":8}},{"start":{"line":264,"column":8},"end":{"line":264,"column":8}}]},"20":{"line":267,"type":"if","locations":[{"start":{"line":267,"column":8},"end":{"line":267,"column":8}},{"start":{"line":267,"column":8},"end":{"line":267,"column":8}}]},"21":{"line":284,"type":"if","locations":[{"start":{"line":284,"column":8},"end":{"line":284,"column":8}},{"start":{"line":284,"column":8},"end":{"line":284,"column":8}}]},"22":{"line":302,"type":"if","locations":[{"start":{"line":302,"column":8},"end":{"line":302,"column":8}},{"start":{"line":302,"column":8},"end":{"line":302,"column":8}}]},"23":{"line":306,"type":"if","locations":[{"start":{"line":306,"column":8},"end":{"line":306,"column":8}},{"start":{"line":306,"column":8},"end":{"line":306,"column":8}}]},"24":{"line":335,"type":"if","locations":[{"start":{"line":335,"column":8},"end":{"line":335,"column":8}},{"start":{"line":335,"column":8},"end":{"line":335,"column":8}}]},"25":{"line":337,"type":"if","locations":[{"start":{"line":337,"column":15},"end":{"line":337,"column":15}},{"start":{"line":337,"column":15},"end":{"line":337,"column":15}}]},"26":{"line":339,"type":"if","locations":[{"start":{"line":339,"column":15},"end":{"line":339,"column":15}},{"start":{"line":339,"column":15},"end":{"line":339,"column":15}}]},"27":{"line":355,"type":"if","locations":[{"start":{"line":355,"column":8},"end":{"line":355,"column":8}},{"start":{"line":355,"column":8},"end":{"line":355,"column":8}}]}},"code":["(function () { YUI.add('anim-easing', function (Y, NAME) {","","/*","TERMS OF USE - EASING EQUATIONS","Open source under the BSD License.","Copyright 2001 Robert Penner All rights reserved.","","Redistribution and use in source and binary forms, with or without modification,","are permitted provided that the following conditions are met:",""," * Redistributions of source code must retain the above copyright notice, this"," list of conditions and the following disclaimer."," * 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."," * Neither the name of the author nor the names of contributors may 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.","*/","","/**"," * The easing module provides methods for customizing"," * how an animation behaves during each run."," * @class Easing"," * @module anim"," * @submodule anim-easing"," */","","var Easing = {",""," /**"," * Uniform speed between points."," * @for Easing"," * @method easeNone"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeNone: function (t, b, c, d) {"," return c*t/d + b;"," },",""," /**"," * Begins slowly and accelerates towards end. (quadratic)"," * @method easeIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeIn: function (t, b, c, d) {"," return c*(t/=d)*t + b;"," },",""," /**"," * Begins quickly and decelerates towards end. (quadratic)"," * @method easeOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeOut: function (t, b, c, d) {"," return -c *(t/=d)*(t-2) + b;"," },",""," /**"," * Begins slowly and decelerates towards end. (quadratic)"," * @method easeBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeBoth: function (t, b, c, d) {"," if ((t /= d/2) < 1) {"," return c/2*t*t + b;"," }",""," return -c/2 * ((--t)*(t-2) - 1) + b;"," },",""," /**"," * Begins slowly and accelerates towards end. (quartic)"," * @method easeInStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeInStrong: function (t, b, c, d) {"," return c*(t/=d)*t*t*t + b;"," },",""," /**"," * Begins quickly and decelerates towards end. (quartic)"," * @method easeOutStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeOutStrong: function (t, b, c, d) {"," return -c * ((t=t/d-1)*t*t*t - 1) + b;"," },",""," /**"," * Begins slowly and decelerates towards end. (quartic)"," * @method easeBothStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeBothStrong: function (t, b, c, d) {"," if ((t /= d/2) < 1) {"," return c/2*t*t*t*t + b;"," }",""," return -c/2 * ((t-=2)*t*t*t - 2) + b;"," },",""," /**"," * Snap in elastic effect."," * @method elasticIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */",""," elasticIn: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," if ( (t /= d) === 1 ) {"," return b+c;"," }"," if (!p) {"," p = d* 0.3;"," }",""," if (!a || a < Math.abs(c)) {"," a = c;"," s = p/4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }",""," return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;"," },",""," /**"," * Snap out elastic effect."," * @method elasticOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */"," elasticOut: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," if ( (t /= d) === 1 ) {"," return b+c;"," }"," if (!p) {"," p=d * 0.3;"," }",""," if (!a || a < Math.abs(c)) {"," a = c;"," s = p / 4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }",""," return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;"," },",""," /**"," * Snap both elastic effect."," * @method elasticBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */"," elasticBoth: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }",""," if ( (t /= d/2) === 2 ) {"," return b+c;"," }",""," if (!p) {"," p = d*(0.3*1.5);"," }",""," if ( !a || a < Math.abs(c) ) {"," a = c;"," s = p/4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }",""," if (t < 1) {"," return -0.5*(a*Math.pow(2,10*(t-=1)) *"," Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;"," }"," return a*Math.pow(2,-10*(t-=1)) *"," Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;"," },","",""," /**"," * Backtracks slightly, then reverses direction and moves to end."," * @method backIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backIn: function (t, b, c, d, s) {"," if (s === undefined) {"," s = 1.70158;"," }"," if (t === d) {"," t -= 0.001;"," }"," return c*(t/=d)*t*((s+1)*t - s) + b;"," },",""," /**"," * Overshoots end, then reverses and comes back to end."," * @method backOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backOut: function (t, b, c, d, s) {"," if (typeof s === 'undefined') {"," s = 1.70158;"," }"," return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;"," },",""," /**"," * Backtracks slightly, then reverses direction, overshoots end,"," * then reverses and comes back to end."," * @method backBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backBoth: function (t, b, c, d, s) {"," if (typeof s === 'undefined') {"," s = 1.70158;"," }",""," if ((t /= d/2 ) < 1) {"," return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;"," }"," return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;"," },",""," /**"," * Bounce off of start."," * @method bounceIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceIn: function (t, b, c, d) {"," return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;"," },",""," /**"," * Bounces off end."," * @method bounceOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceOut: function (t, b, c, d) {"," if ((t/=d) < (1/2.75)) {"," return c*(7.5625*t*t) + b;"," } else if (t < (2/2.75)) {"," return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;"," } else if (t < (2.5/2.75)) {"," return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;"," }"," return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;"," },",""," /**"," * Bounces off start and end."," * @method bounceBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceBoth: function (t, b, c, d) {"," if (t < d/2) {"," return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;"," }"," return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;"," }","};","","Y.Easing = Easing;","","","}, '3.16.0', {\"requires\": [\"anim-base\"]});","","}());"]}; } var __cov_YIovT6krughe2nlH0KPcnA = __coverage__['build/anim-easing/anim-easing.js']; __cov_YIovT6krughe2nlH0KPcnA.s['1']++;YUI.add('anim-easing',function(Y,NAME){__cov_YIovT6krughe2nlH0KPcnA.f['1']++;__cov_YIovT6krughe2nlH0KPcnA.s['2']++;var Easing={easeNone:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['2']++;__cov_YIovT6krughe2nlH0KPcnA.s['3']++;return c*t/d+b;},easeIn:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['3']++;__cov_YIovT6krughe2nlH0KPcnA.s['4']++;return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['4']++;__cov_YIovT6krughe2nlH0KPcnA.s['5']++;return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['5']++;__cov_YIovT6krughe2nlH0KPcnA.s['6']++;if((t/=d/2)<1){__cov_YIovT6krughe2nlH0KPcnA.b['1'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['7']++;return c/2*t*t+b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['1'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['8']++;return-c/2*(--t*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['6']++;__cov_YIovT6krughe2nlH0KPcnA.s['9']++;return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['7']++;__cov_YIovT6krughe2nlH0KPcnA.s['10']++;return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['8']++;__cov_YIovT6krughe2nlH0KPcnA.s['11']++;if((t/=d/2)<1){__cov_YIovT6krughe2nlH0KPcnA.b['2'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['12']++;return c/2*t*t*t*t+b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['2'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['13']++;return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){__cov_YIovT6krughe2nlH0KPcnA.f['9']++;__cov_YIovT6krughe2nlH0KPcnA.s['14']++;var s;__cov_YIovT6krughe2nlH0KPcnA.s['15']++;if(t===0){__cov_YIovT6krughe2nlH0KPcnA.b['3'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['16']++;return b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['3'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['17']++;if((t/=d)===1){__cov_YIovT6krughe2nlH0KPcnA.b['4'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['18']++;return b+c;}else{__cov_YIovT6krughe2nlH0KPcnA.b['4'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['19']++;if(!p){__cov_YIovT6krughe2nlH0KPcnA.b['5'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['20']++;p=d*0.3;}else{__cov_YIovT6krughe2nlH0KPcnA.b['5'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['21']++;if((__cov_YIovT6krughe2nlH0KPcnA.b['7'][0]++,!a)||(__cov_YIovT6krughe2nlH0KPcnA.b['7'][1]++,a<Math.abs(c))){__cov_YIovT6krughe2nlH0KPcnA.b['6'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['22']++;a=c;__cov_YIovT6krughe2nlH0KPcnA.s['23']++;s=p/4;}else{__cov_YIovT6krughe2nlH0KPcnA.b['6'][1]++;__cov_YIovT6krughe2nlH0KPcnA.s['24']++;s=p/(2*Math.PI)*Math.asin(c/a);}__cov_YIovT6krughe2nlH0KPcnA.s['25']++;return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){__cov_YIovT6krughe2nlH0KPcnA.f['10']++;__cov_YIovT6krughe2nlH0KPcnA.s['26']++;var s;__cov_YIovT6krughe2nlH0KPcnA.s['27']++;if(t===0){__cov_YIovT6krughe2nlH0KPcnA.b['8'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['28']++;return b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['8'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['29']++;if((t/=d)===1){__cov_YIovT6krughe2nlH0KPcnA.b['9'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['30']++;return b+c;}else{__cov_YIovT6krughe2nlH0KPcnA.b['9'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['31']++;if(!p){__cov_YIovT6krughe2nlH0KPcnA.b['10'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['32']++;p=d*0.3;}else{__cov_YIovT6krughe2nlH0KPcnA.b['10'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['33']++;if((__cov_YIovT6krughe2nlH0KPcnA.b['12'][0]++,!a)||(__cov_YIovT6krughe2nlH0KPcnA.b['12'][1]++,a<Math.abs(c))){__cov_YIovT6krughe2nlH0KPcnA.b['11'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['34']++;a=c;__cov_YIovT6krughe2nlH0KPcnA.s['35']++;s=p/4;}else{__cov_YIovT6krughe2nlH0KPcnA.b['11'][1]++;__cov_YIovT6krughe2nlH0KPcnA.s['36']++;s=p/(2*Math.PI)*Math.asin(c/a);}__cov_YIovT6krughe2nlH0KPcnA.s['37']++;return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){__cov_YIovT6krughe2nlH0KPcnA.f['11']++;__cov_YIovT6krughe2nlH0KPcnA.s['38']++;var s;__cov_YIovT6krughe2nlH0KPcnA.s['39']++;if(t===0){__cov_YIovT6krughe2nlH0KPcnA.b['13'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['40']++;return b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['13'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['41']++;if((t/=d/2)===2){__cov_YIovT6krughe2nlH0KPcnA.b['14'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['42']++;return b+c;}else{__cov_YIovT6krughe2nlH0KPcnA.b['14'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['43']++;if(!p){__cov_YIovT6krughe2nlH0KPcnA.b['15'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['44']++;p=d*(0.3*1.5);}else{__cov_YIovT6krughe2nlH0KPcnA.b['15'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['45']++;if((__cov_YIovT6krughe2nlH0KPcnA.b['17'][0]++,!a)||(__cov_YIovT6krughe2nlH0KPcnA.b['17'][1]++,a<Math.abs(c))){__cov_YIovT6krughe2nlH0KPcnA.b['16'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['46']++;a=c;__cov_YIovT6krughe2nlH0KPcnA.s['47']++;s=p/4;}else{__cov_YIovT6krughe2nlH0KPcnA.b['16'][1]++;__cov_YIovT6krughe2nlH0KPcnA.s['48']++;s=p/(2*Math.PI)*Math.asin(c/a);}__cov_YIovT6krughe2nlH0KPcnA.s['49']++;if(t<1){__cov_YIovT6krughe2nlH0KPcnA.b['18'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['50']++;return-0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['18'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['51']++;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;},backIn:function(t,b,c,d,s){__cov_YIovT6krughe2nlH0KPcnA.f['12']++;__cov_YIovT6krughe2nlH0KPcnA.s['52']++;if(s===undefined){__cov_YIovT6krughe2nlH0KPcnA.b['19'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['53']++;s=1.70158;}else{__cov_YIovT6krughe2nlH0KPcnA.b['19'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['54']++;if(t===d){__cov_YIovT6krughe2nlH0KPcnA.b['20'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['55']++;t-=0.001;}else{__cov_YIovT6krughe2nlH0KPcnA.b['20'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['56']++;return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){__cov_YIovT6krughe2nlH0KPcnA.f['13']++;__cov_YIovT6krughe2nlH0KPcnA.s['57']++;if(typeof s==='undefined'){__cov_YIovT6krughe2nlH0KPcnA.b['21'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['58']++;s=1.70158;}else{__cov_YIovT6krughe2nlH0KPcnA.b['21'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['59']++;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){__cov_YIovT6krughe2nlH0KPcnA.f['14']++;__cov_YIovT6krughe2nlH0KPcnA.s['60']++;if(typeof s==='undefined'){__cov_YIovT6krughe2nlH0KPcnA.b['22'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['61']++;s=1.70158;}else{__cov_YIovT6krughe2nlH0KPcnA.b['22'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['62']++;if((t/=d/2)<1){__cov_YIovT6krughe2nlH0KPcnA.b['23'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['63']++;return c/2*(t*t*(((s*=1.525)+1)*t-s))+b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['23'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['64']++;return c/2*((t-=2)*t*(((s*=1.525)+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['15']++;__cov_YIovT6krughe2nlH0KPcnA.s['65']++;return c-Y.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['16']++;__cov_YIovT6krughe2nlH0KPcnA.s['66']++;if((t/=d)<1/2.75){__cov_YIovT6krughe2nlH0KPcnA.b['24'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['67']++;return c*(7.5625*t*t)+b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['24'][1]++;__cov_YIovT6krughe2nlH0KPcnA.s['68']++;if(t<2/2.75){__cov_YIovT6krughe2nlH0KPcnA.b['25'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['69']++;return c*(7.5625*(t-=1.5/2.75)*t+0.75)+b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['25'][1]++;__cov_YIovT6krughe2nlH0KPcnA.s['70']++;if(t<2.5/2.75){__cov_YIovT6krughe2nlH0KPcnA.b['26'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['71']++;return c*(7.5625*(t-=2.25/2.75)*t+0.9375)+b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['26'][1]++;}}}__cov_YIovT6krughe2nlH0KPcnA.s['72']++;return c*(7.5625*(t-=2.625/2.75)*t+0.984375)+b;},bounceBoth:function(t,b,c,d){__cov_YIovT6krughe2nlH0KPcnA.f['17']++;__cov_YIovT6krughe2nlH0KPcnA.s['73']++;if(t<d/2){__cov_YIovT6krughe2nlH0KPcnA.b['27'][0]++;__cov_YIovT6krughe2nlH0KPcnA.s['74']++;return Y.Easing.bounceIn(t*2,0,c,d)*0.5+b;}else{__cov_YIovT6krughe2nlH0KPcnA.b['27'][1]++;}__cov_YIovT6krughe2nlH0KPcnA.s['75']++;return Y.Easing.bounceOut(t*2-d,0,c,d)*0.5+c*0.5+b;}};__cov_YIovT6krughe2nlH0KPcnA.s['76']++;Y.Easing=Easing;},'3.16.0',{'requires':['anim-base']});
sashberd/cdnjs
ajax/libs/yui/3.16.0/anim-easing/anim-easing-coverage.js
JavaScript
mit
34,515
/* YUI 3.16.0 (build 76f0e08) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/test-console/test-console.js']) { __coverage__['build/test-console/test-console.js'] = {"path":"build/test-console/test-console.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0},"b":{"1":[0,0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":43}}},"2":{"name":"TestConsole","line":33,"loc":{"start":{"line":33,"column":0},"end":{"line":33,"column":23}}},"3":{"name":"(anonymous_3)","line":38,"loc":{"start":{"line":38,"column":17},"end":{"line":38,"column":35}}},"4":{"name":"(anonymous_4)","line":66,"loc":{"start":{"line":66,"column":17},"end":{"line":66,"column":32}}},"5":{"name":"(anonymous_5)","line":84,"loc":{"start":{"line":84,"column":26},"end":{"line":84,"column":46}}},"6":{"name":"(anonymous_6)","line":100,"loc":{"start":{"line":100,"column":32},"end":{"line":100,"column":47}}},"7":{"name":"(anonymous_7)","line":123,"loc":{"start":{"line":123,"column":19},"end":{"line":123,"column":31}}},"8":{"name":"(anonymous_8)","line":153,"loc":{"start":{"line":153,"column":28},"end":{"line":153,"column":52}}},"9":{"name":"(anonymous_9)","line":160,"loc":{"start":{"line":160,"column":38},"end":{"line":160,"column":59}}},"10":{"name":"(anonymous_10)","line":177,"loc":{"start":{"line":177,"column":14},"end":{"line":177,"column":40}}},"11":{"name":"(anonymous_11)","line":192,"loc":{"start":{"line":192,"column":26},"end":{"line":192,"column":60}}},"12":{"name":"(anonymous_12)","line":196,"loc":{"start":{"line":196,"column":29},"end":{"line":196,"column":43}}},"13":{"name":"(anonymous_13)","line":211,"loc":{"start":{"line":211,"column":26},"end":{"line":211,"column":50}}},"14":{"name":"(anonymous_14)","line":215,"loc":{"start":{"line":215,"column":29},"end":{"line":215,"column":49}}},"15":{"name":"(anonymous_15)","line":216,"loc":{"start":{"line":216,"column":51},"end":{"line":216,"column":66}}},"16":{"name":"(anonymous_16)","line":228,"loc":{"start":{"line":228,"column":19},"end":{"line":228,"column":39}}},"17":{"name":"(anonymous_17)","line":232,"loc":{"start":{"line":232,"column":32},"end":{"line":232,"column":61}}},"18":{"name":"(anonymous_18)","line":241,"loc":{"start":{"line":241,"column":72},"end":{"line":241,"column":86}}},"19":{"name":"(anonymous_19)","line":254,"loc":{"start":{"line":254,"column":20},"end":{"line":254,"column":31}}},"20":{"name":"(anonymous_20)","line":267,"loc":{"start":{"line":267,"column":14},"end":{"line":267,"column":27}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":307,"column":91}},"2":{"start":{"line":33,"column":0},"end":{"line":35,"column":1}},"3":{"start":{"line":34,"column":4},"end":{"line":34,"column":62}},"4":{"start":{"line":37,"column":0},"end":{"line":304,"column":3}},"5":{"start":{"line":39,"column":8},"end":{"line":39,"column":40}},"6":{"start":{"line":41,"column":8},"end":{"line":54,"column":11}},"7":{"start":{"line":56,"column":8},"end":{"line":56,"column":72}},"8":{"start":{"line":67,"column":8},"end":{"line":68,"column":24}},"9":{"start":{"line":70,"column":8},"end":{"line":72,"column":9}},"10":{"start":{"line":71,"column":12},"end":{"line":71,"column":23}},"11":{"start":{"line":74,"column":8},"end":{"line":76,"column":9}},"12":{"start":{"line":75,"column":12},"end":{"line":75,"column":23}},"13":{"start":{"line":77,"column":8},"end":{"line":77,"column":19}},"14":{"start":{"line":85,"column":8},"end":{"line":98,"column":23}},"15":{"start":{"line":100,"column":8},"end":{"line":110,"column":11}},"16":{"start":{"line":101,"column":12},"end":{"line":101,"column":49}},"17":{"start":{"line":102,"column":12},"end":{"line":102,"column":46}},"18":{"start":{"line":103,"column":12},"end":{"line":103,"column":69}},"19":{"start":{"line":104,"column":12},"end":{"line":104,"column":84}},"20":{"start":{"line":106,"column":12},"end":{"line":106,"column":57}},"21":{"start":{"line":107,"column":12},"end":{"line":107,"column":54}},"22":{"start":{"line":108,"column":12},"end":{"line":108,"column":81}},"23":{"start":{"line":109,"column":12},"end":{"line":109,"column":96}},"24":{"start":{"line":113,"column":8},"end":{"line":113,"column":154}},"25":{"start":{"line":114,"column":8},"end":{"line":114,"column":173}},"26":{"start":{"line":116,"column":8},"end":{"line":116,"column":67}},"27":{"start":{"line":124,"column":8},"end":{"line":145,"column":10}},"28":{"start":{"line":154,"column":8},"end":{"line":156,"column":20}},"29":{"start":{"line":158,"column":8},"end":{"line":168,"column":9}},"30":{"start":{"line":159,"column":12},"end":{"line":159,"column":42}},"31":{"start":{"line":160,"column":12},"end":{"line":167,"column":15}},"32":{"start":{"line":161,"column":16},"end":{"line":163,"column":44}},"33":{"start":{"line":164,"column":16},"end":{"line":166,"column":17}},"34":{"start":{"line":165,"column":20},"end":{"line":165,"column":42}},"35":{"start":{"line":178,"column":8},"end":{"line":178,"column":30}},"36":{"start":{"line":179,"column":8},"end":{"line":182,"column":9}},"37":{"start":{"line":180,"column":12},"end":{"line":180,"column":51}},"38":{"start":{"line":181,"column":12},"end":{"line":181,"column":45}},"39":{"start":{"line":183,"column":8},"end":{"line":183,"column":19}},"40":{"start":{"line":193,"column":8},"end":{"line":194,"column":43}},"41":{"start":{"line":196,"column":8},"end":{"line":201,"column":11}},"42":{"start":{"line":197,"column":12},"end":{"line":197,"column":27}},"43":{"start":{"line":198,"column":12},"end":{"line":200,"column":13}},"44":{"start":{"line":199,"column":16},"end":{"line":199,"column":33}},"45":{"start":{"line":202,"column":8},"end":{"line":202,"column":56}},"46":{"start":{"line":203,"column":8},"end":{"line":203,"column":19}},"47":{"start":{"line":212,"column":8},"end":{"line":213,"column":43}},"48":{"start":{"line":215,"column":8},"end":{"line":219,"column":11}},"49":{"start":{"line":216,"column":12},"end":{"line":216,"column":87}},"50":{"start":{"line":216,"column":68},"end":{"line":216,"column":83}},"51":{"start":{"line":217,"column":12},"end":{"line":217,"column":41}},"52":{"start":{"line":218,"column":12},"end":{"line":218,"column":42}},"53":{"start":{"line":220,"column":8},"end":{"line":220,"column":56}},"54":{"start":{"line":221,"column":8},"end":{"line":221,"column":19}},"55":{"start":{"line":229,"column":8},"end":{"line":230,"column":39}},"56":{"start":{"line":232,"column":8},"end":{"line":245,"column":11}},"57":{"start":{"line":233,"column":12},"end":{"line":233,"column":43}},"58":{"start":{"line":235,"column":12},"end":{"line":235,"column":54}},"59":{"start":{"line":236,"column":12},"end":{"line":236,"column":69}},"60":{"start":{"line":237,"column":12},"end":{"line":237,"column":73}},"61":{"start":{"line":238,"column":12},"end":{"line":238,"column":74}},"62":{"start":{"line":239,"column":12},"end":{"line":239,"column":67}},"63":{"start":{"line":240,"column":12},"end":{"line":240,"column":32}},"64":{"start":{"line":241,"column":12},"end":{"line":243,"column":15}},"65":{"start":{"line":242,"column":16},"end":{"line":242,"column":115}},"66":{"start":{"line":246,"column":8},"end":{"line":246,"column":44}},"67":{"start":{"line":255,"column":8},"end":{"line":255,"column":51}},"68":{"start":{"line":256,"column":8},"end":{"line":258,"column":9}},"69":{"start":{"line":257,"column":12},"end":{"line":257,"column":19}},"70":{"start":{"line":259,"column":8},"end":{"line":263,"column":9}},"71":{"start":{"line":260,"column":12},"end":{"line":260,"column":41}},"72":{"start":{"line":262,"column":12},"end":{"line":262,"column":48}},"73":{"start":{"line":268,"column":8},"end":{"line":268,"column":28}},"74":{"start":{"line":270,"column":8},"end":{"line":275,"column":9}},"75":{"start":{"line":272,"column":12},"end":{"line":272,"column":36}},"76":{"start":{"line":273,"column":15},"end":{"line":275,"column":9}},"77":{"start":{"line":274,"column":12},"end":{"line":274,"column":31}}},"branchMap":{"1":{"line":47,"type":"binary-expr","locations":[{"start":{"line":47,"column":16},"end":{"line":47,"column":22}},{"start":{"line":47,"column":26},"end":{"line":47,"column":40}},{"start":{"line":47,"column":45},"end":{"line":47,"column":47}}]},"2":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":8},"end":{"line":70,"column":8}},{"start":{"line":70,"column":8},"end":{"line":70,"column":8}}]},"3":{"line":70,"type":"binary-expr","locations":[{"start":{"line":70,"column":12},"end":{"line":70,"column":39}},{"start":{"line":70,"column":43},"end":{"line":70,"column":74}}]},"4":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":8},"end":{"line":74,"column":8}},{"start":{"line":74,"column":8},"end":{"line":74,"column":8}}]},"5":{"line":74,"type":"binary-expr","locations":[{"start":{"line":74,"column":12},"end":{"line":74,"column":32}},{"start":{"line":74,"column":36},"end":{"line":74,"column":60}}]},"6":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":8},"end":{"line":158,"column":8}},{"start":{"line":158,"column":8},"end":{"line":158,"column":8}}]},"7":{"line":164,"type":"if","locations":[{"start":{"line":164,"column":16},"end":{"line":164,"column":16}},{"start":{"line":164,"column":16},"end":{"line":164,"column":16}}]},"8":{"line":164,"type":"binary-expr","locations":[{"start":{"line":164,"column":20},"end":{"line":164,"column":50}},{"start":{"line":164,"column":54},"end":{"line":164,"column":69}}]},"9":{"line":179,"type":"if","locations":[{"start":{"line":179,"column":8},"end":{"line":179,"column":8}},{"start":{"line":179,"column":8},"end":{"line":179,"column":8}}]},"10":{"line":198,"type":"if","locations":[{"start":{"line":198,"column":12},"end":{"line":198,"column":12}},{"start":{"line":198,"column":12},"end":{"line":198,"column":12}}]},"11":{"line":256,"type":"if","locations":[{"start":{"line":256,"column":8},"end":{"line":256,"column":8}},{"start":{"line":256,"column":8},"end":{"line":256,"column":8}}]},"12":{"line":259,"type":"if","locations":[{"start":{"line":259,"column":8},"end":{"line":259,"column":8}},{"start":{"line":259,"column":8},"end":{"line":259,"column":8}}]},"13":{"line":270,"type":"if","locations":[{"start":{"line":270,"column":8},"end":{"line":270,"column":8}},{"start":{"line":270,"column":8},"end":{"line":270,"column":8}}]},"14":{"line":270,"type":"binary-expr","locations":[{"start":{"line":270,"column":12},"end":{"line":270,"column":35}},{"start":{"line":271,"column":19},"end":{"line":271,"column":75}}]},"15":{"line":273,"type":"if","locations":[{"start":{"line":273,"column":15},"end":{"line":273,"column":15}},{"start":{"line":273,"column":15},"end":{"line":273,"column":15}}]},"16":{"line":301,"type":"cond-expr","locations":[{"start":{"line":301,"column":44},"end":{"line":301,"column":50}},{"start":{"line":301,"column":53},"end":{"line":301,"column":62}}]},"17":{"line":301,"type":"binary-expr","locations":[{"start":{"line":301,"column":19},"end":{"line":301,"column":26}},{"start":{"line":301,"column":30},"end":{"line":301,"column":41}}]}},"code":["(function () { YUI.add('test-console', function (Y, NAME) {","","/**","Provides a specialized log console widget that's pre-configured to display YUI","Test output with no extra configuration.","","@example",""," <div id=\"log\" class=\"yui3-skin-sam\"></div>",""," <script>"," YUI().use('test-console', function (Y) {"," // ... set up your test cases here ...",""," // Render the console inside the #log div, then run the tests."," new Y.Test.Console().render('#log');"," Y.Test.Runner.run();"," });"," </script>","","@module test-console","@namespace Test","@class Console","@extends Console","@constructor","","@param {Object} [config] Config attributes."," @param {Object} [config.filters] Category filter configuration.","","@since 3.5.0","**/","","function TestConsole() {"," TestConsole.superclass.constructor.apply(this, arguments);","}","","Y.namespace('Test').Console = Y.extend(TestConsole, Y.Console, {"," initializer: function (config) {"," this.on('entry', this._onEntry);",""," this.plug(Y.Plugin.ConsoleFilters, {"," category: Y.merge({"," info : true,"," pass : false,"," fail : true,"," status: false"," }, (config && config.filters) || {}),",""," defaultVisibility: false,",""," source: {"," TestRunner: true"," }"," });",""," Y.Test.Runner.on('complete', Y.bind(this._parseCoverage, this));"," },",""," // -- Protected Coverage Parser ---------------------------------------------"," /**"," * Scans the coverage data to determine if it's an Istanbul coverage object."," * @method _isIstanbul"," * @param {Object} json The coverage data to scan"," * @return {Boolean} True if this is Istanbul Coverage"," */"," _isIstanbul: function(json) {"," var first = Y.Object.keys(json)[0],"," ret = false;",""," if (json[first].s !== undefined && json[first].fnMap !== undefined) {"," ret = true;"," }",""," if (json.s !== undefined && json.fnMap !== undefined) {"," ret = true;"," }"," return ret;"," },"," /**"," * Parses and logs a summary of YUITest coverage data."," * @method parseYUITest"," * @param {Object} coverage The YUITest Coverage JSON data"," */"," parseYUITestCoverage: function (coverage) {"," var cov = {"," lines: {"," hit: 0,"," miss: 0,"," total: 0,"," percent: 0"," },"," functions: {"," hit: 0,"," miss: 0,"," total: 0,"," percent: 0"," }"," }, coverageLog;",""," Y.Object.each(coverage, function(info) {"," cov.lines.total += info.coveredLines;"," cov.lines.hit += info.calledLines;"," cov.lines.miss += (info.coveredLines - info.calledLines);"," cov.lines.percent = Math.floor((cov.lines.hit / cov.lines.total) * 100);",""," cov.functions.total += info.coveredFunctions;"," cov.functions.hit += info.calledFunctions;"," cov.functions.miss += (info.coveredFunctions - info.calledFunctions);"," cov.functions.percent = Math.floor((cov.functions.hit / cov.functions.total) * 100);"," });","",""," coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\\n';"," coverageLog += 'Functions: Hit:' + cov.functions.hit + ' Missed:' + cov.functions.miss + ' Total:' + cov.functions.total + ' Percent:' + cov.functions.percent + '%';",""," this.log('Coverage: ' + coverageLog, 'info', 'TestRunner');"," },"," /**"," * Generates a generic summary object used for Istanbul conversions."," * @method _blankSummary"," * @return {Object} Generic summary object"," */"," _blankSummary: function () {"," return {"," lines: {"," total: 0,"," covered: 0,"," pct: 'Unknown'"," },"," statements: {"," total: 0,"," covered: 0,"," pct: 'Unknown'"," },"," functions: {"," total: 0,"," covered: 0,"," pct: 'Unknown'"," },"," branches: {"," total: 0,"," covered: 0,"," pct: 'Unknown'"," }"," };"," },"," /**"," * Calculates line numbers from statement coverage"," * @method _addDerivedInfoForFile"," * @private"," * @param {Object} fileCoverage JSON coverage data"," */"," _addDerivedInfoForFile: function (fileCoverage) {"," var statementMap = fileCoverage.statementMap,"," statements = fileCoverage.s,"," lineMap;",""," if (!fileCoverage.l) {"," fileCoverage.l = lineMap = {};"," Y.Object.each(statements, function (value, st) {"," var line = statementMap[st].start.line,"," count = statements[st],"," prevVal = lineMap[line];"," if (typeof prevVal === 'undefined' || prevVal < count) {"," lineMap[line] = count;"," }"," });"," }"," },"," /**"," * Generic percent calculator"," * @method _percent"," * @param {Number} covered The covered amount"," * @param {Number} total The total"," * @private"," */"," _percent: function (covered, total) {"," var tmp, pct = 100.00;"," if (total > 0) {"," tmp = 1000 * 100 * covered / total + 5;"," pct = Math.floor(tmp / 10) / 100;"," }"," return pct;"," },"," /**"," * Summarize simple properties in the coverage data"," * @method _computSimpleTotals"," * @private"," * @param {Object} fileCoverage JSON coverage data"," * @param {String} property The property to summarize"," */"," _computeSimpleTotals: function (fileCoverage, property) {"," var stats = fileCoverage[property],"," ret = { total: 0, covered: 0 };",""," Y.Object.each(stats, function(val) {"," ret.total += 1;"," if (val) {"," ret.covered += 1;"," }"," });"," ret.pct = this._percent(ret.covered, ret.total);"," return ret;"," },"," /**"," * Noramlizes branch data from Istanbul"," * @method _computeBranchTotals"," * @private"," * @param {Object} fileCoverage JSON coverage data"," */"," _computeBranchTotals: function (fileCoverage) {"," var stats = fileCoverage.b,"," ret = { total: 0, covered: 0 };",""," Y.Object.each(stats, function (branches) {"," var covered = Y.Array.filter(branches, function (num) { return num > 0; });"," ret.total += branches.length;"," ret.covered += covered.length;"," });"," ret.pct = this._percent(ret.covered, ret.total);"," return ret;"," },"," /**"," * Takes an Istanbul coverage object, normalizes it and prints a log with a summary"," * @method parseInstanbul"," * @param {Object} coverage The coverage object to normalize and log"," */"," parseIstanbul: function (coverage) {"," var self = this,"," str = 'Coverage Report:\\n';",""," Y.Object.each(coverage, function(fileCoverage, file) {"," var ret = self._blankSummary();",""," self._addDerivedInfoForFile(fileCoverage);"," ret.lines = self._computeSimpleTotals(fileCoverage, 'l');"," ret.functions = self._computeSimpleTotals(fileCoverage, 'f');"," ret.statements = self._computeSimpleTotals(fileCoverage, 's');"," ret.branches = self._computeBranchTotals(fileCoverage);"," str += file + ':\\n';"," Y.Array.each(['lines','functions','statements','branches'], function(key) {"," str += ' ' + key +': ' + ret[key].covered + '/' + ret[key].total + ' : ' + ret[key].pct + '%\\n';"," });",""," });"," this.log(str, 'info', 'TestRunner');",""," },"," /**"," * Parses YUITest or Istanbul coverage results if they are available and logs them."," * @method _parseCoverage"," * @private"," */"," _parseCoverage: function() {"," var coverage = Y.Test.Runner.getCoverage();"," if (!coverage) {"," return;"," }"," if (this._isIstanbul(coverage)) {"," this.parseIstanbul(coverage);"," } else {"," this.parseYUITestCoverage(coverage);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------"," _onEntry: function (e) {"," var msg = e.message;",""," if (msg.category === 'info'"," && /\\s(?:case|suite)\\s|yuitests\\d+|began/.test(msg.message)) {"," msg.category = 'status';"," } else if (msg.category === 'fail') {"," this.printBuffer();"," }"," }","}, {"," NAME: 'testConsole',",""," ATTRS: {"," entryTemplate: {"," value:"," '<div class=\"{entry_class} {cat_class} {src_class}\">' +"," '<div class=\"{entry_content_class}\">{message}</div>' +"," '</div>'"," },",""," height: {"," value: '350px'"," },",""," newestOnTop: {"," value: false"," },",""," style: {"," value: 'block'"," },",""," width: {"," value: Y.UA.ie && Y.UA.ie < 9 ? '100%' : 'inherit'"," }"," }","});","","","}, '3.16.0', {\"requires\": [\"console-filters\", \"test\", \"array-extras\"], \"skinnable\": true});","","}());"]}; } var __cov_MvaSoWigy9KT6gyhkkqrYQ = __coverage__['build/test-console/test-console.js']; __cov_MvaSoWigy9KT6gyhkkqrYQ.s['1']++;YUI.add('test-console',function(Y,NAME){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['1']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['2']++;function TestConsole(){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['2']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['3']++;TestConsole.superclass.constructor.apply(this,arguments);}__cov_MvaSoWigy9KT6gyhkkqrYQ.s['4']++;Y.namespace('Test').Console=Y.extend(TestConsole,Y.Console,{initializer:function(config){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['3']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['5']++;this.on('entry',this._onEntry);__cov_MvaSoWigy9KT6gyhkkqrYQ.s['6']++;this.plug(Y.Plugin.ConsoleFilters,{category:Y.merge({info:true,pass:false,fail:true,status:false},(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['1'][0]++,config)&&(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['1'][1]++,config.filters)||(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['1'][2]++,{})),defaultVisibility:false,source:{TestRunner:true}});__cov_MvaSoWigy9KT6gyhkkqrYQ.s['7']++;Y.Test.Runner.on('complete',Y.bind(this._parseCoverage,this));},_isIstanbul:function(json){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['4']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['8']++;var first=Y.Object.keys(json)[0],ret=false;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['9']++;if((__cov_MvaSoWigy9KT6gyhkkqrYQ.b['3'][0]++,json[first].s!==undefined)&&(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['3'][1]++,json[first].fnMap!==undefined)){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['2'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['10']++;ret=true;}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['2'][1]++;}__cov_MvaSoWigy9KT6gyhkkqrYQ.s['11']++;if((__cov_MvaSoWigy9KT6gyhkkqrYQ.b['5'][0]++,json.s!==undefined)&&(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['5'][1]++,json.fnMap!==undefined)){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['4'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['12']++;ret=true;}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['4'][1]++;}__cov_MvaSoWigy9KT6gyhkkqrYQ.s['13']++;return ret;},parseYUITestCoverage:function(coverage){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['5']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['14']++;var cov={lines:{hit:0,miss:0,total:0,percent:0},functions:{hit:0,miss:0,total:0,percent:0}},coverageLog;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['15']++;Y.Object.each(coverage,function(info){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['6']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['16']++;cov.lines.total+=info.coveredLines;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['17']++;cov.lines.hit+=info.calledLines;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['18']++;cov.lines.miss+=info.coveredLines-info.calledLines;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['19']++;cov.lines.percent=Math.floor(cov.lines.hit/cov.lines.total*100);__cov_MvaSoWigy9KT6gyhkkqrYQ.s['20']++;cov.functions.total+=info.coveredFunctions;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['21']++;cov.functions.hit+=info.calledFunctions;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['22']++;cov.functions.miss+=info.coveredFunctions-info.calledFunctions;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['23']++;cov.functions.percent=Math.floor(cov.functions.hit/cov.functions.total*100);});__cov_MvaSoWigy9KT6gyhkkqrYQ.s['24']++;coverageLog='Lines: Hit:'+cov.lines.hit+' Missed:'+cov.lines.miss+' Total:'+cov.lines.total+' Percent:'+cov.lines.percent+'%\n';__cov_MvaSoWigy9KT6gyhkkqrYQ.s['25']++;coverageLog+='Functions: Hit:'+cov.functions.hit+' Missed:'+cov.functions.miss+' Total:'+cov.functions.total+' Percent:'+cov.functions.percent+'%';__cov_MvaSoWigy9KT6gyhkkqrYQ.s['26']++;this.log('Coverage: '+coverageLog,'info','TestRunner');},_blankSummary:function(){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['7']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['27']++;return{lines:{total:0,covered:0,pct:'Unknown'},statements:{total:0,covered:0,pct:'Unknown'},functions:{total:0,covered:0,pct:'Unknown'},branches:{total:0,covered:0,pct:'Unknown'}};},_addDerivedInfoForFile:function(fileCoverage){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['8']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['28']++;var statementMap=fileCoverage.statementMap,statements=fileCoverage.s,lineMap;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['29']++;if(!fileCoverage.l){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['6'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['30']++;fileCoverage.l=lineMap={};__cov_MvaSoWigy9KT6gyhkkqrYQ.s['31']++;Y.Object.each(statements,function(value,st){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['9']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['32']++;var line=statementMap[st].start.line,count=statements[st],prevVal=lineMap[line];__cov_MvaSoWigy9KT6gyhkkqrYQ.s['33']++;if((__cov_MvaSoWigy9KT6gyhkkqrYQ.b['8'][0]++,typeof prevVal==='undefined')||(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['8'][1]++,prevVal<count)){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['7'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['34']++;lineMap[line]=count;}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['7'][1]++;}});}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['6'][1]++;}},_percent:function(covered,total){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['10']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['35']++;var tmp,pct=100;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['36']++;if(total>0){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['9'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['37']++;tmp=1000*100*covered/total+5;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['38']++;pct=Math.floor(tmp/10)/100;}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['9'][1]++;}__cov_MvaSoWigy9KT6gyhkkqrYQ.s['39']++;return pct;},_computeSimpleTotals:function(fileCoverage,property){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['11']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['40']++;var stats=fileCoverage[property],ret={total:0,covered:0};__cov_MvaSoWigy9KT6gyhkkqrYQ.s['41']++;Y.Object.each(stats,function(val){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['12']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['42']++;ret.total+=1;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['43']++;if(val){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['10'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['44']++;ret.covered+=1;}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['10'][1]++;}});__cov_MvaSoWigy9KT6gyhkkqrYQ.s['45']++;ret.pct=this._percent(ret.covered,ret.total);__cov_MvaSoWigy9KT6gyhkkqrYQ.s['46']++;return ret;},_computeBranchTotals:function(fileCoverage){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['13']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['47']++;var stats=fileCoverage.b,ret={total:0,covered:0};__cov_MvaSoWigy9KT6gyhkkqrYQ.s['48']++;Y.Object.each(stats,function(branches){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['14']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['49']++;var covered=Y.Array.filter(branches,function(num){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['15']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['50']++;return num>0;});__cov_MvaSoWigy9KT6gyhkkqrYQ.s['51']++;ret.total+=branches.length;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['52']++;ret.covered+=covered.length;});__cov_MvaSoWigy9KT6gyhkkqrYQ.s['53']++;ret.pct=this._percent(ret.covered,ret.total);__cov_MvaSoWigy9KT6gyhkkqrYQ.s['54']++;return ret;},parseIstanbul:function(coverage){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['16']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['55']++;var self=this,str='Coverage Report:\n';__cov_MvaSoWigy9KT6gyhkkqrYQ.s['56']++;Y.Object.each(coverage,function(fileCoverage,file){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['17']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['57']++;var ret=self._blankSummary();__cov_MvaSoWigy9KT6gyhkkqrYQ.s['58']++;self._addDerivedInfoForFile(fileCoverage);__cov_MvaSoWigy9KT6gyhkkqrYQ.s['59']++;ret.lines=self._computeSimpleTotals(fileCoverage,'l');__cov_MvaSoWigy9KT6gyhkkqrYQ.s['60']++;ret.functions=self._computeSimpleTotals(fileCoverage,'f');__cov_MvaSoWigy9KT6gyhkkqrYQ.s['61']++;ret.statements=self._computeSimpleTotals(fileCoverage,'s');__cov_MvaSoWigy9KT6gyhkkqrYQ.s['62']++;ret.branches=self._computeBranchTotals(fileCoverage);__cov_MvaSoWigy9KT6gyhkkqrYQ.s['63']++;str+=file+':\n';__cov_MvaSoWigy9KT6gyhkkqrYQ.s['64']++;Y.Array.each(['lines','functions','statements','branches'],function(key){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['18']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['65']++;str+=' '+key+': '+ret[key].covered+'/'+ret[key].total+' : '+ret[key].pct+'%\n';});});__cov_MvaSoWigy9KT6gyhkkqrYQ.s['66']++;this.log(str,'info','TestRunner');},_parseCoverage:function(){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['19']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['67']++;var coverage=Y.Test.Runner.getCoverage();__cov_MvaSoWigy9KT6gyhkkqrYQ.s['68']++;if(!coverage){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['11'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['69']++;return;}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['11'][1]++;}__cov_MvaSoWigy9KT6gyhkkqrYQ.s['70']++;if(this._isIstanbul(coverage)){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['12'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['71']++;this.parseIstanbul(coverage);}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['12'][1]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['72']++;this.parseYUITestCoverage(coverage);}},_onEntry:function(e){__cov_MvaSoWigy9KT6gyhkkqrYQ.f['20']++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['73']++;var msg=e.message;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['74']++;if((__cov_MvaSoWigy9KT6gyhkkqrYQ.b['14'][0]++,msg.category==='info')&&(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['14'][1]++,/\s(?:case|suite)\s|yuitests\d+|began/.test(msg.message))){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['13'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['75']++;msg.category='status';}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['13'][1]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['76']++;if(msg.category==='fail'){__cov_MvaSoWigy9KT6gyhkkqrYQ.b['15'][0]++;__cov_MvaSoWigy9KT6gyhkkqrYQ.s['77']++;this.printBuffer();}else{__cov_MvaSoWigy9KT6gyhkkqrYQ.b['15'][1]++;}}}},{NAME:'testConsole',ATTRS:{entryTemplate:{value:'<div class="{entry_class} {cat_class} {src_class}">'+'<div class="{entry_content_class}">{message}</div>'+'</div>'},height:{value:'350px'},newestOnTop:{value:false},style:{value:'block'},width:{value:(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['17'][0]++,Y.UA.ie)&&(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['17'][1]++,Y.UA.ie<9)?(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['16'][0]++,'100%'):(__cov_MvaSoWigy9KT6gyhkkqrYQ.b['16'][1]++,'inherit')}}});},'3.16.0',{'requires':['console-filters','test','array-extras'],'skinnable':true});
juanpasolano/cdnjs
ajax/libs/yui/3.16.0/test-console/test-console-coverage.js
JavaScript
mit
31,609
/* YUI 3.16.0 (build 76f0e08) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ /* Horizontal Slider */ /* Use thumbUrl /build/slider-base/assets/skins/round/thumb-x.png */ /* Alternate thumbUrl /build/slider-base/assets/skins/round/thumb-x-grip.png */ .yui3-skin-round .yui3-slider-x .yui3-slider-rail, .yui3-skin-round .yui3-slider-x .yui3-slider-rail-cap-left, .yui3-skin-round .yui3-slider-x .yui3-slider-rail-cap-right { background-image: url(rail-x.png); background-repeat: repeat-x; } .yui3-skin-round .yui3-slider-x .yui3-slider-rail { height: 25px; background-position: 0 3px; } .yui3-skin-round .yui3-slider-x .yui3-slider-thumb { height: 26px; width: 24px; } .yui3-skin-round .yui3-slider-x .yui3-slider-rail-cap-left { background-position: 0 -17px; height: 20px; left: -2px; width: 5px; } .yui3-skin-round .yui3-slider-x .yui3-slider-rail-cap-right { background-position: 0 -37px; height: 20px; right: -2px; width: 5px; } .yui3-skin-round .yui3-slider-x .yui3-slider-thumb-image { left: 0; top: -7px; } .yui3-skin-round .yui3-slider-x .yui3-slider-thumb-shadow { left: 0; opacity: 0.15; filter: alpha(opacity=15); top: -47px; } /* Vertical Slider */ /* Use thumbUrl /build/slider-base/assets/skins/round/thumb-y.png */ /* Alternate thumbUrl /build/slider-base/assets/skins/round/thumb-y-grip.png */ .yui3-skin-round .yui3-slider-y .yui3-slider-rail, .yui3-skin-round .yui3-slider-y .yui3-slider-rail-cap-top, .yui3-skin-round .yui3-slider-y .yui3-slider-rail-cap-bottom { background-image: url(rail-y.png); background-repeat: repeat-y; } .yui3-skin-round .yui3-slider-y .yui3-slider-rail { width: 25px; background-position: 3px 0; } .yui3-skin-round .yui3-slider-y .yui3-slider-thumb { width: 26px; height: 24px; } .yui3-skin-round .yui3-slider-y .yui3-slider-rail-cap-top { background-position: -17px 0; width: 20px; top: -2px; height: 5px; } .yui3-skin-round .yui3-slider-y .yui3-slider-rail-cap-bottom { background-position: -37px 0; width: 20px; bottom: -2px; height: 5px; } .yui3-skin-round .yui3-slider-y .yui3-slider-thumb-image { top: 0; left: -8px; } .yui3-skin-round .yui3-slider-y .yui3-slider-thumb-shadow { top: 0; left: -48px; opacity: 0.15; filter: alpha(opacity=15); } /* YUI 3.16.0 (build 76f0e08) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ /* Horizontal Slider */ /* Use thumbUrl /build/slider-base/assets/skins/round/thumb-x.png */ /* Alternate thumbUrl /build/slider-base/assets/skins/round/thumb-x-grip.png */ .yui3-skin-round .yui3-slider-x .yui3-slider-rail, .yui3-skin-round .yui3-slider-x .yui3-slider-rail-cap-left, .yui3-skin-round .yui3-slider-x .yui3-slider-rail-cap-right { background-image: url(rail-x.png); background-repeat: repeat-x; } .yui3-skin-round .yui3-slider-x .yui3-slider-rail { height: 25px; background-position: 0 3px; } .yui3-skin-round .yui3-slider-x .yui3-slider-thumb { height: 26px; width: 24px; } .yui3-skin-round .yui3-slider-x .yui3-slider-rail-cap-left { background-position: 0 -17px; height: 20px; left: -2px; width: 5px; } .yui3-skin-round .yui3-slider-x .yui3-slider-rail-cap-right { background-position: 0 -37px; height: 20px; right: -2px; width: 5px; } .yui3-skin-round .yui3-slider-x .yui3-slider-thumb-image { left: 0; top: -7px; } .yui3-skin-round .yui3-slider-x .yui3-slider-thumb-shadow { left: 0; opacity: 0.15; filter: alpha(opacity=15); top: -47px; } /* Vertical Slider */ /* Use thumbUrl /build/slider-base/assets/skins/round/thumb-y.png */ /* Alternate thumbUrl /build/slider-base/assets/skins/round/thumb-y-grip.png */ .yui3-skin-round .yui3-slider-y .yui3-slider-rail, .yui3-skin-round .yui3-slider-y .yui3-slider-rail-cap-top, .yui3-skin-round .yui3-slider-y .yui3-slider-rail-cap-bottom { background-image: url(rail-y.png); background-repeat: repeat-y; } .yui3-skin-round .yui3-slider-y .yui3-slider-rail { width: 25px; background-position: 3px 0; } .yui3-skin-round .yui3-slider-y .yui3-slider-thumb { width: 26px; height: 24px; } .yui3-skin-round .yui3-slider-y .yui3-slider-rail-cap-top { background-position: -17px 0; width: 20px; top: -2px; height: 5px; } .yui3-skin-round .yui3-slider-y .yui3-slider-rail-cap-bottom { background-position: -37px 0; width: 20px; bottom: -2px; height: 5px; } .yui3-skin-round .yui3-slider-y .yui3-slider-thumb-image { top: 0; left: -8px; } .yui3-skin-round .yui3-slider-y .yui3-slider-thumb-shadow { top: 0; left: -48px; opacity: 0.15; filter: alpha(opacity=15); }
sashberd/cdnjs
ajax/libs/yui/3.16.0/assets/skin/round/skin.css
CSS
mit
4,867
pre code{display:block;padding:.5em;color:#000;background:#fff}pre .subst,pre .title{font-weight:normal;color:#000}pre .comment,pre .template_comment,pre .javadoc,pre .diff .header{color:#808080;font-style:italic}pre .annotation,pre .decorator,pre .preprocessor,pre .doctype,pre .pi,pre .chunk,pre .shebang,pre .apache .cbracket,pre .prompt,pre .http .title{color:#808000}pre .tag,pre .pi{background:#efefef}pre .tag .title,pre .id,pre .attr_selector,pre .pseudo,pre .literal,pre .keyword,pre .hexcolor,pre .css .function,pre .ini .title,pre .css .class,pre .list .title,pre .clojure .title,pre .nginx .title,pre .tex .command,pre .request,pre .status{font-weight:bold;color:#000080}pre .attribute,pre .rules .keyword,pre .number,pre .date,pre .regexp,pre .tex .special{font-weight:bold;color:#00f}pre .number,pre .regexp{font-weight:normal}pre .string,pre .value,pre .filter .argument,pre .css .function .params,pre .apache .tag{color:#008000;font-weight:bold}pre .symbol,pre .ruby .symbol .string,pre .char,pre .tex .formula{color:#000;background:#d0eded;font-style:italic}pre .phpdoc,pre .yardoctag,pre .javadoctag{text-decoration:underline}pre .variable,pre .envvar,pre .apache .sqbracket,pre .nginx .built_in{color:#660e7a}pre .addition{background:#baeeba}pre .deletion{background:#ffc8bd}pre .diff .change{background:#bccff9}
dryabov/cdnjs
ajax/libs/highlight.js/7.4/styles/idea.min.css
CSS
mit
1,331
/* * /MathJax/jax/output/SVG/fonts/TeX/Main/Regular/GreekAndCoptic.js * * Copyright (c) 2009-2015 The MathJax Consortium * * 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. */ MathJax.Hub.Insert(MathJax.OutputJax.SVG.FONTDATA.FONTS.MathJax_Main,{915:[680,0,625,25,582,"128 619Q121 626 117 628T101 631T58 634H25V680H554V676Q556 670 568 560T582 444V440H542V444Q542 445 538 478T523 545T492 598Q454 634 349 634H334Q264 634 249 633T233 621Q232 618 232 339L233 61Q240 54 245 52T270 48T333 46H360V0H348Q324 3 182 3Q51 3 36 0H25V46H58Q100 47 109 49T128 61V619"],916:[716,0,833,46,786,"51 0Q46 4 46 7Q46 9 215 357T388 709Q391 716 416 716Q439 716 444 709Q447 705 616 357T786 7Q786 4 781 0H51ZM507 344L384 596L137 92L383 91H630Q630 93 507 344"],920:[705,23,778,56,722,"56 340Q56 423 86 494T164 610T270 680T388 705Q521 705 621 601T722 341Q722 260 693 191T617 75T510 4T388 -22T267 3T160 74T85 189T56 340ZM610 339Q610 428 590 495T535 598T463 651T384 668Q332 668 289 638T221 566Q168 485 168 339Q168 274 176 235Q189 158 228 105T324 28Q356 16 388 16Q415 16 442 24T501 54T555 111T594 205T610 339ZM223 263V422H263V388H514V422H554V263H514V297H263V263H223"],923:[716,0,694,32,661,"320 708Q326 716 340 716H348H355Q367 716 372 708Q374 706 423 547T523 226T575 62Q581 52 591 50T634 46H661V0H653Q644 3 532 3Q411 3 390 0H379V46H392Q464 46 464 65Q463 70 390 305T316 539L246 316Q177 95 177 84Q177 72 198 59T248 46H253V0H245Q230 3 130 3Q47 3 38 0H32V46H45Q112 51 127 91Q128 92 224 399T320 708"],926:[677,0,667,42,624,"47 509L55 676Q55 677 333 677T611 676L619 509Q619 508 599 508T579 510Q579 529 575 557T564 589Q550 594 333 594T102 589Q95 586 91 558T87 510Q87 508 67 508T47 509ZM139 260V445H179V394H487V445H527V260H487V311H179V260H139ZM50 0L42 180H62Q82 180 82 178Q82 133 89 105Q92 93 95 90T108 86Q137 83 333 83Q530 83 558 86Q568 87 571 90T577 105Q584 133 584 178Q584 180 604 180H624L616 0H50"],928:[680,0,750,25,724,"128 619Q121 626 117 628T101 631T58 634H25V680H724V634H691Q651 633 640 631T622 619V61Q628 51 639 49T691 46H724V0H713Q692 3 569 3Q434 3 425 0H414V46H447Q489 47 498 49T517 61V634H232V348L233 61Q239 51 250 49T302 46H335V0H324Q303 3 180 3Q45 3 36 0H25V46H58Q100 47 109 49T128 61V619"],931:[683,0,722,55,666,"666 247Q664 244 652 126T638 4V0H351Q131 0 95 0T57 5V6Q54 12 57 17L73 36Q89 54 121 90T182 159L305 299L56 644L55 658Q55 677 60 681Q63 683 351 683H638V679Q640 674 652 564T666 447V443H626V447Q618 505 604 543T559 605Q529 626 478 631T333 637H294H189L293 494Q314 465 345 422Q400 346 400 340Q400 338 399 337L154 57Q407 57 428 58Q476 60 508 68T551 83T575 103Q595 125 608 162T624 225L626 251H666V247"],933:[705,0,778,55,722,"55 551Q55 604 91 654T194 705Q240 705 277 681T334 624T367 556T385 498L389 474L392 488Q394 501 400 521T414 566T438 615T473 659T521 692T584 705Q620 705 648 689T691 647T714 597T722 551Q722 540 719 538T699 536Q680 536 677 541Q677 542 677 544T676 548Q676 576 650 596T588 616H582Q538 616 505 582Q466 543 454 477T441 318Q441 301 441 269T442 222V61Q448 55 452 53T478 48T542 46H569V0H557Q533 3 389 3T221 0H209V46H236Q256 46 270 46T295 47T311 48T322 51T328 54T332 57T337 61V209Q337 383 333 415Q313 616 189 616Q154 616 128 597T101 548Q101 540 97 538T78 536Q63 536 59 538T55 551"],934:[683,0,722,55,665,"312 622Q310 623 307 625T303 629T297 631T286 634T270 635T246 636T211 637H184V683H196Q220 680 361 680T526 683H538V637H511Q468 637 447 635T422 631T411 622V533L425 531Q525 519 595 466T665 342Q665 301 642 267T583 209T506 172T425 152L411 150V61Q417 55 421 53T447 48T511 46H538V0H526Q502 3 361 3T196 0H184V46H211Q231 46 245 46T270 47T286 48T297 51T303 54T307 57T312 61V150H310Q309 151 289 153T232 166T160 195Q149 201 136 210T103 238T69 284T56 342Q56 414 128 467T294 530Q309 532 310 533H312V622ZM170 342Q170 207 307 188H312V495H309Q301 495 282 491T231 469T186 423Q170 389 170 342ZM415 188Q487 199 519 236T551 342Q551 384 539 414T507 459T470 481T434 491T415 495H410V188H415"],936:[683,0,778,55,722,"340 622Q338 623 335 625T331 629T325 631T314 634T298 635T274 636T239 637H212V683H224Q248 680 389 680T554 683H566V637H539Q479 637 464 635T439 622L438 407Q438 192 439 192Q443 193 449 195T474 207T507 232T536 276T557 344Q560 365 562 417T573 493Q587 536 620 544Q627 546 671 546H715L722 540V515Q714 509 708 509Q680 505 671 476T658 392T644 307Q599 177 451 153L438 151V106L439 61Q446 54 451 52T476 48T539 46H566V0H554Q530 3 389 3T224 0H212V46H239Q259 46 273 46T298 47T314 48T325 51T331 54T335 57T340 61V151Q126 178 117 406Q115 503 69 509Q55 509 55 526Q55 541 59 543T86 546H107H120Q150 546 161 543T184 528Q198 514 204 493Q212 472 213 420T226 316T272 230Q287 216 303 207T330 194L339 192Q340 192 340 407V622"],937:[705,0,722,44,677,"55 454Q55 503 75 546T127 617T197 665T272 695T337 704H352Q396 704 404 703Q527 687 596 615T666 454Q666 392 635 330T559 200T499 83V80H543Q589 81 600 83T617 93Q622 102 629 135T636 172L637 177H677V175L660 89Q645 3 644 2V0H552H488Q461 0 456 3T451 20Q451 89 499 235T548 455Q548 512 530 555T483 622T424 656T361 668Q332 668 303 658T243 626T193 560T174 456Q174 380 222 233T270 20Q270 7 263 0H77V2Q76 3 61 89L44 175V177H84L85 172Q85 171 88 155T96 119T104 93Q109 86 120 84T178 80H222V83Q206 132 162 199T87 329T55 454"]});MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Main/Regular/GreekAndCoptic.js");
CosmicWebServices/cdnjs
ajax/libs/mathjax/2.5.0/jax/output/SVG/fonts/TeX/Main/Regular/GreekAndCoptic.js
JavaScript
mit
5,730
/* This is a compiled file, you should be editing the file in the templates directory */ .pace.pace-inactive { display: none; } .pace { -webkit-pointer-events: none; pointer-events: none; -webkit-user-select: none; -moz-user-select: none; user-select: none; z-index: 2000; position: fixed; height: 60px; width: 100px; margin: auto; top: 0; left: 0; right: 0; bottom: 0; } .pace .pace-progress { z-index: 2000; position: absolute; height: 60px; width: 100px; -webkit-transform: translate3d(0, 0, 0) !important; -ms-transform: translate3d(0, 0, 0) !important; transform: translate3d(0, 0, 0) !important; } .pace .pace-progress:before { content: attr(data-progress-text); text-align: center; color: #fff; background: #d6d6d6; border-radius: 50%; font-family: "Helvetica Neue", sans-serif; font-size: 14px; font-weight: 100; line-height: 1; padding: 20% 0 7px; width: 50%; height: 40%; margin: 10px 0 0 30px; display: block; z-index: 999; position: absolute; } .pace .pace-activity { font-size: 15px; line-height: 1; z-index: 2000; position: absolute; height: 60px; width: 100px; display: block; -webkit-animation: pace-theme-center-atom-spin 2s linear infinite; -moz-animation: pace-theme-center-atom-spin 2s linear infinite; -o-animation: pace-theme-center-atom-spin 2s linear infinite; animation: pace-theme-center-atom-spin 2s linear infinite; } .pace .pace-activity { border-radius: 50%; border: 5px solid #d6d6d6; content: ' '; display: block; position: absolute; top: 0; left: 0; height: 60px; width: 100px; } .pace .pace-activity:after { border-radius: 50%; border: 5px solid #d6d6d6; content: ' '; display: block; position: absolute; top: -5px; left: -5px; height: 60px; width: 100px; -webkit-transform: rotate(60deg); -moz-transform: rotate(60deg); -o-transform: rotate(60deg); transform: rotate(60deg); } .pace .pace-activity:before { border-radius: 50%; border: 5px solid #d6d6d6; content: ' '; display: block; position: absolute; top: -5px; left: -5px; height: 60px; width: 100px; -webkit-transform: rotate(120deg); -moz-transform: rotate(120deg); -o-transform: rotate(120deg); transform: rotate(120deg); } @-webkit-keyframes pace-theme-center-atom-spin { 0% { -webkit-transform: rotate(0deg) } 100% { -webkit-transform: rotate(359deg) } } @-moz-keyframes pace-theme-center-atom-spin { 0% { -moz-transform: rotate(0deg) } 100% { -moz-transform: rotate(359deg) } } @-o-keyframes pace-theme-center-atom-spin { 0% { -o-transform: rotate(0deg) } 100% { -o-transform: rotate(359deg) } } @keyframes pace-theme-center-atom-spin { 0% { transform: rotate(0deg) } 100% { transform: rotate(359deg) } }
tomsoir/cdnjs
ajax/libs/pace/1.0.0/themes/silver/pace-theme-center-atom.css
CSS
mit
2,806
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u0a2a\u0a42.\u0a26\u0a41.", "\u0a2c\u0a3e.\u0a26\u0a41." ], "DAY": [ "\u0a10\u0a24\u0a35\u0a3e\u0a30", "\u0a38\u0a4b\u0a2e\u0a35\u0a3e\u0a30", "\u0a2e\u0a70\u0a17\u0a32\u0a35\u0a3e\u0a30", "\u0a2c\u0a41\u0a71\u0a27\u0a35\u0a3e\u0a30", "\u0a35\u0a40\u0a30\u0a35\u0a3e\u0a30", "\u0a38\u0a3c\u0a41\u0a71\u0a15\u0a30\u0a35\u0a3e\u0a30", "\u0a38\u0a3c\u0a28\u0a3f\u0a71\u0a1a\u0a30\u0a35\u0a3e\u0a30" ], "ERANAMES": [ "\u0a08\u0a38\u0a35\u0a40 \u0a2a\u0a42\u0a30\u0a35", "\u0a08\u0a38\u0a35\u0a40 \u0a38\u0a70\u0a28" ], "ERAS": [ "\u0a08. \u0a2a\u0a42.", "\u0a38\u0a70\u0a28" ], "FIRSTDAYOFWEEK": 6, "MONTH": [ "\u0a1c\u0a28\u0a35\u0a30\u0a40", "\u0a2b\u0a3c\u0a30\u0a35\u0a30\u0a40", "\u0a2e\u0a3e\u0a30\u0a1a", "\u0a05\u0a2a\u0a4d\u0a30\u0a48\u0a32", "\u0a2e\u0a08", "\u0a1c\u0a42\u0a28", "\u0a1c\u0a41\u0a32\u0a3e\u0a08", "\u0a05\u0a17\u0a38\u0a24", "\u0a38\u0a24\u0a70\u0a2c\u0a30", "\u0a05\u0a15\u0a24\u0a42\u0a2c\u0a30", "\u0a28\u0a35\u0a70\u0a2c\u0a30", "\u0a26\u0a38\u0a70\u0a2c\u0a30" ], "SHORTDAY": [ "\u0a10\u0a24", "\u0a38\u0a4b\u0a2e", "\u0a2e\u0a70\u0a17\u0a32", "\u0a2c\u0a41\u0a71\u0a27", "\u0a35\u0a40\u0a30", "\u0a38\u0a3c\u0a41\u0a71\u0a15\u0a30", "\u0a38\u0a3c\u0a28\u0a3f\u0a71\u0a1a\u0a30" ], "SHORTMONTH": [ "\u0a1c\u0a28", "\u0a2b\u0a3c\u0a30", "\u0a2e\u0a3e\u0a30\u0a1a", "\u0a05\u0a2a\u0a4d\u0a30\u0a48", "\u0a2e\u0a08", "\u0a1c\u0a42\u0a28", "\u0a1c\u0a41\u0a32\u0a3e", "\u0a05\u0a17", "\u0a38\u0a24\u0a70", "\u0a05\u0a15\u0a24\u0a42", "\u0a28\u0a35\u0a70", "\u0a26\u0a38\u0a70" ], "STANDALONEMONTH": [ "\u0a1c\u0a28\u0a35\u0a30\u0a40", "\u0a2b\u0a3c\u0a30\u0a35\u0a30\u0a40", "\u0a2e\u0a3e\u0a30\u0a1a", "\u0a05\u0a2a\u0a4d\u0a30\u0a48\u0a32", "\u0a2e\u0a08", "\u0a1c\u0a42\u0a28", "\u0a1c\u0a41\u0a32\u0a3e\u0a08", "\u0a05\u0a17\u0a38\u0a24", "\u0a38\u0a24\u0a70\u0a2c\u0a30", "\u0a05\u0a15\u0a24\u0a42\u0a2c\u0a30", "\u0a28\u0a35\u0a70\u0a2c\u0a30", "\u0a26\u0a38\u0a70\u0a2c\u0a30" ], "WEEKENDRANGE": [ 6, 6 ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y h:mm:ss a", "mediumDate": "d MMM y", "mediumTime": "h:mm:ss a", "short": "d/M/yy h:mm a", "shortDate": "d/M/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20b9", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 2, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 2, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-\u00a4", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "pa-guru", "localeID": "pa_Guru", "pluralCat": function(n, opt_precision) { if (n >= 0 && n <= 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
dlueth/cdnjs
ajax/libs/angular-i18n/1.6.0-rc.0/angular-locale_pa-guru.js
JavaScript
mit
3,602
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "ND", "LK" ], "DAY": [ "Bikua-\u00f4ko", "B\u00efkua-\u00fbse", "B\u00efkua-pt\u00e2", "B\u00efkua-us\u00ef\u00f6", "B\u00efkua-ok\u00fc", "L\u00e2p\u00f4s\u00f6", "L\u00e2yenga" ], "ERANAMES": [ "K\u00f4zo na Kr\u00eestu", "Na pek\u00f4 t\u00ee Kr\u00eestu" ], "ERAS": [ "KnK", "NpK" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "Nyenye", "Fulund\u00efgi", "Mb\u00e4ng\u00fc", "Ngub\u00f9e", "B\u00eal\u00e4w\u00fc", "F\u00f6ndo", "Lengua", "K\u00fck\u00fcr\u00fc", "Mvuka", "Ngberere", "Nab\u00e4nd\u00fcru", "Kakauka" ], "SHORTDAY": [ "Bk1", "Bk2", "Bk3", "Bk4", "Bk5", "L\u00e2p", "L\u00e2y" ], "SHORTMONTH": [ "Nye", "Ful", "Mb\u00e4", "Ngu", "B\u00eal", "F\u00f6n", "Len", "K\u00fck", "Mvu", "Ngb", "Nab", "Kak" ], "STANDALONEMONTH": [ "Nyenye", "Fulund\u00efgi", "Mb\u00e4ng\u00fc", "Ngub\u00f9e", "B\u00eal\u00e4w\u00fc", "F\u00f6ndo", "Lengua", "K\u00fck\u00fcr\u00fc", "Mvuka", "Ngberere", "Nab\u00e4nd\u00fcru", "Kakauka" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE d MMMM y", "longDate": "d MMMM y", "medium": "d MMM, y HH:mm:ss", "mediumDate": "d MMM, y", "mediumTime": "HH:mm:ss", "short": "d/M/y HH:mm", "shortDate": "d/M/y", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "FCFA", "DECIMAL_SEP": ",", "GROUP_SEP": ".", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "sg-cf", "localeID": "sg_CF", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
rlugojr/cdnjs
ajax/libs/angular.js/1.5.7/i18n/angular-locale_sg-cf.js
JavaScript
mit
2,989
YUI.add("resize-constrain",function(e,t){function B(){B.superclass.constructor.apply(this,arguments)}var n=e.Lang,r=n.isBoolean,i=n.isNumber,s=n.isString,o=e.Resize.capitalize,u=function(t){return t instanceof e.Node},a=function(e){return parseFloat(e)||0},f="borderBottomWidth",l="borderLeftWidth",c="borderRightWidth",h="borderTopWidth",p="border",d="bottom",v="con",m="constrain",g="host",y="left",b="maxHeight",w="maxWidth",E="minHeight",S="minWidth",x="node",T="offsetHeight",N="offsetWidth",C="preserveRatio",k="region",L="resizeConstrained",A="right",O="tickX",M="tickY",_="top",D="width",P="view",H="viewportRegion";e.mix(B,{NAME:L,NS:v,ATTRS:{constrain:{setter:function(t){return t&&(u(t)||s(t)||t.nodeType)&&(t=e.one(t)),t}},minHeight:{value:15,validator:i},minWidth:{value:15,validator:i},maxHeight:{value:Infinity,validator:i},maxWidth:{value:Infinity,validator:i},preserveRatio:{value:!1,validator:r},tickX:{value:!1},tickY:{value:!1}}}),e.extend(B,e.Plugin.Base,{constrainSurrounding:null,initializer:function(){var t=this,n=t.get(g);n.delegate.dd.plug(e.Plugin.DDConstrained,{tickX:t.get(O),tickY:t.get(M)}),n.after("resize:align",e.bind(t._handleResizeAlignEvent,t)),n.on("resize:start",e.bind(t._handleResizeStartEvent,t))},_checkConstrain:function(e,t,n){var r=this,i,s,u,f,l=r.get(g),c=l.info,h=r.constrainSurrounding.border,d=r._getConstrainRegion();d&&(i=c[e]+c[n],s=d[t]-a(h[o(p,t,D)]),i>=s&&(c[n]-=i-s),u=c[e],f=d[e]+a(h[o(p,e,D)]),u<=f&&(c[e]+=f-u,c[n]-=f-u))},_checkHeight:function(){var e=this,t=e.get(g),n=t.info,r=e.get(b)+t.totalVSurrounding,i=e.get(E)+t.totalVSurrounding;e._checkConstrain(_,d,T),n.offsetHeight>r&&t._checkSize(T,r),n.offsetHeight<i&&t._checkSize(T,i)},_checkRatio:function(){var t=this,n=t.get(g),r=n.info,s=n.originalInfo,o=s.offsetWidth,u=s.offsetHeight,p=s.top,d=s.left,v=s.bottom,y=s.right,b=function(){return r.offsetWidth/o},w=function(){return r.offsetHeight/u},E=n.changeHeightHandles,S,x,T,N,C,k;t.get(m)&&n.changeHeightHandles&&n.changeWidthHandles&&(T=t._getConstrainRegion(),x=t.constrainSurrounding.border,S=T.bottom-a(x[f])-v,N=d-(T.left+a(x[l])),C=T.right-a(x[c])-y,k=p-(T.top+a(x[h])),n.changeLeftHandles&&n.changeTopHandles?E=k<N:n.changeLeftHandles?E=S<N:n.changeTopHandles?E=k<C:E=S<C),E?(r.offsetWidth=o*w(),t._checkWidth(),r.offsetHeight=u*b()):(r.offsetHeight=u*b(),t._checkHeight(),r.offsetWidth=o*w()),n.changeTopHandles&&(r.top=p+(u-r.offsetHeight)),n.changeLeftHandles&&(r.left=d+(o-r.offsetWidth)),e.each(r,function(e,t){i(e)&&(r[t]=Math.round(e))})},_checkRegion:function(){var t=this,n=t.get(g),r=t._getConstrainRegion();return e.DOM.inRegion(null,r,!0,n.info)},_checkWidth:function(){var e=this,t=e.get(g),n=t.info,r=e.get(w)+t.totalHSurrounding,i=e.get(S)+t.totalHSurrounding;e._checkConstrain(y,A,N),n.offsetWidth<i&&t._checkSize(N,i),n.offsetWidth>r&&t._checkSize(N,r)},_getConstrainRegion:function(){var e=this,t=e.get(g),n=t.get(x),r=e.get(m),i=null;return r&&(r===P?i=n.get(H):u(r)?i=r.get(k):i=r),i},_handleResizeAlignEvent:function(){var e=this,t=e.get(g);e._checkHeight(),e._checkWidth(),e.get(C)&&e._checkRatio(),e.get(m)&&!e._checkRegion()&&(t.info=t.lastInfo)},_handleResizeStartEvent:function(){var e=this,t=e.get(m),n=e.get(g);e.constrainSurrounding=n._getBoxSurroundingInfo(t)}}),e.namespace("Plugin"),e.Plugin.ResizeConstrained=B},"@VERSION@",{requires:["plugin","resize-base"]});
bdukes/cdnjs
ajax/libs/yui/3.11.0/resize-constrain/resize-constrain-min.js
JavaScript
mit
3,375
YUI.add("dd-ddm",function(e,t){e.mix(e.DD.DDM,{_pg:null,_debugShim:!1,_activateTargets:function(){},_deactivateTargets:function(){},_startDrag:function(){this.activeDrag&&this.activeDrag.get("useShim")&&(this._shimming=!0,this._pg_activate(),this._activateTargets())},_endDrag:function(){this._pg_deactivate(),this._deactivateTargets()},_pg_deactivate:function(){this._pg.setStyle("display","none")},_pg_activate:function(){this._pg||this._createPG();var e=this.activeDrag.get("activeHandle"),t="auto";e&&(t=e.getStyle("cursor")),t==="auto"&&(t=this.get("dragCursor")),this._pg_size(),this._pg.setStyles({top:0,left:0,display:"block",opacity:this._debugShim?".5":"0",cursor:t})},_pg_size:function(){if(this.activeDrag){var t=e.one("body"),n=t.get("docHeight"),r=t.get("docWidth");this._pg.setStyles({height:n+"px",width:r+"px"})}},_createPG:function(){var t=e.Node.create("<div></div>"),n=e.one("body"),r;t.setStyles({top:"0",left:"0",position:"absolute",zIndex:"9999",overflow:"hidden",backgroundColor:"red",display:"none",height:"5px",width:"5px"}),t.set("id",e.stamp(t)),t.addClass(e.DD.DDM.CSS_PREFIX+"-shim"),n.prepend(t),this._pg=t,this._pg.on("mousemove",e.throttle(e.bind(this._move,this),this.get("throttleTime"))),this._pg.on("mouseup",e.bind(this._end,this)),r=e.one("win"),e.on("window:resize",e.bind(this._pg_size,this)),r.on("scroll",e.bind(this._pg_size,this))}},!0)},"@VERSION@",{requires:["dd-ddm-base","event-resize"]});
sh4hin/cdnjs
ajax/libs/yui/3.10.2/dd-ddm/dd-ddm-min.js
JavaScript
mit
1,439
var createWrapper = require('../internal/createWrapper'), replaceHolders = require('../internal/replaceHolders'), restParam = require('./restParam'); /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, PARTIAL_FLAG = 32; /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and prepends any additional `_.bind` arguments to those provided to the * bound function. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind` this method does not set the "length" * property of bound functions. * * @static * @memberOf _ * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * var greet = function(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * }; * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // using placeholders * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = restParam(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, bind.placeholder); bitmask |= PARTIAL_FLAG; } return createWrapper(func, bitmask, thisArg, partials, holders); }); // Assign default placeholders. bind.placeholder = {}; module.exports = bind;
BenjamH/post-it-react
node_modules/babel/node_modules/lodash/function/bind.js
JavaScript
mit
1,683
// // M A R S H A L // // () // /\ // ()--' '--() // `. .' // / .. \ // ()' '() // // import Foundation public protocol MarshaledObject { func any(for key: KeyType) throws -> Any func optionalAny(for key: KeyType) -> Any? } public extension MarshaledObject { public func any(for key: KeyType) throws -> Any { let pathComponents = key.stringValue.characters.split(separator: ".").map(String.init) var accumulator: Any = self for component in pathComponents { if let componentData = accumulator as? Self, let value = componentData.optionalAny(for: component) { accumulator = value continue } throw MarshalError.keyNotFound(key: key.stringValue) } if let _ = accumulator as? NSNull { throw MarshalError.nullValue(key: key.stringValue) } return accumulator } public func value<A: ValueType>(for key: KeyType) throws -> A { let any = try self.any(for: key) do { guard let result = try A.value(from: any) as? A else { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: A.self, actual: type(of: any)) } return result } catch let MarshalError.typeMismatch(expected: expected, actual: actual) { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: expected, actual: actual) } } public func value<A: ValueType>(for key: KeyType) throws -> A? { do { return try self.value(for: key) as A } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } public func value<A: ValueType>(for key: KeyType, discardingErrors: Bool = false) throws -> [A] { let any = try self.any(for: key) do { return try Array<A>.value(from: any, discardingErrors: discardingErrors) } catch let MarshalError.typeMismatch(expected: expected, actual: actual) { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: expected, actual: actual) } } public func value<A: ValueType>(for key: KeyType) throws -> [A?] { let any = try self.any(for: key) do { return try Array<A>.value(from: any) } catch let MarshalError.typeMismatch(expected: expected, actual: actual) { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: expected, actual: actual) } } public func value<A: ValueType>(for key: KeyType, discardingErrors: Bool = false) throws -> [A]? { do { return try self.value(for: key, discardingErrors: discardingErrors) as [A] } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } public func value<A: ValueType>(for key: KeyType) throws -> [A?]? { do { return try self.value(for: key) as [A] } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } public func value<A: ValueType>(for key: KeyType) throws -> [String: A] { let any = try self.any(for: key) do { return try [String: A].value(from: any) } catch let MarshalError.typeMismatch(expected: expected, actual: actual) { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: expected, actual: actual) } } public func value<A: ValueType>(for key: KeyType) throws -> [String: A]? { do { let any = try self.any(for: key) return try [String: A].value(from: any) } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } public func value(for key: KeyType) throws -> [MarshalDictionary] { let any = try self.any(for: key) guard let object = any as? [MarshalDictionary] else { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: [MarshalDictionary].self, actual: type(of: any)) } return object } public func value(for key: KeyType) throws -> [MarshalDictionary]? { do { return try value(for: key) as [MarshalDictionary] } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } public func value(for key: KeyType) throws -> MarshalDictionary { let any = try self.any(for: key) guard let object = any as? MarshalDictionary else { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: MarshalDictionary.self, actual: type(of: any)) } return object } public func value(for key: KeyType) throws -> MarshalDictionary? { do { return try value(for: key) as MarshalDictionary } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } public func value<A: ValueType>(for key: KeyType) throws -> Set<A> { let any = try self.any(for: key) do { return try Set<A>.value(from: any) } catch let MarshalError.typeMismatch(expected: expected, actual: actual) { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: expected, actual: actual) } } public func value<A: ValueType>(for key: KeyType) throws -> Set<A>? { do { return try self.value(for: key) as Set<A> } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } public func value<A: RawRepresentable>(for key: KeyType) throws -> A where A.RawValue: ValueType { let raw = try self.value(for: key) as A.RawValue guard let value = A(rawValue: raw) else { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: A.self, actual: raw) } return value } public func value<A: RawRepresentable>(for key: KeyType) throws -> A? where A.RawValue: ValueType { do { return try self.value(for: key) as A } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } public func value<A: RawRepresentable>(for key: KeyType) throws -> [A] where A.RawValue: ValueType { let rawArray = try self.value(for: key) as [A.RawValue] return try rawArray.map({ raw in guard let value = A(rawValue: raw) else { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: A.self, actual: raw) } return value }) } public func value<A: RawRepresentable>(for key: KeyType) throws -> [A]? where A.RawValue: ValueType { do { return try self.value(for: key) as [A] } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } public func value<A: RawRepresentable>(for key: KeyType) throws -> Set<A> where A.RawValue: ValueType { let rawArray = try self.value(for: key) as [A.RawValue] let enumArray: [A] = try rawArray.map({ raw in guard let value = A(rawValue: raw) else { throw MarshalError.typeMismatchWithKey(key: key.stringValue, expected: A.self, actual: raw) } return value }) return Set<A>(enumArray) } public func value<A: RawRepresentable>(for key: KeyType) throws -> Set<A>? where A.RawValue: ValueType { do { return try self.value(for: key) as Set<A> } catch MarshalError.keyNotFound { return nil } catch MarshalError.nullValue { return nil } } }
Raizlabs/SketchyCode
Pods/Marshal/Sources/MarshaledObject.swift
Swift
mit
8,412
// Copyright (c) 2017-2021 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <key_io.h> #include <util/bip32.h> #include <util/strencodings.h> #include <wallet/wallet.h> #include <boost/test/unit_test.hpp> #include <test/util/setup_common.h> #include <wallet/test/wallet_test_fixture.h> namespace wallet { BOOST_FIXTURE_TEST_SUITE(psbt_wallet_tests, WalletTestingSetup) static void import_descriptor(CWallet& wallet, const std::string& descriptor) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) { AssertLockHeld(wallet.cs_wallet); FlatSigningProvider provider; std::string error; std::unique_ptr<Descriptor> desc = Parse(descriptor, provider, error, /* require_checksum=*/ false); assert(desc); WalletDescriptor w_desc(std::move(desc), 0, 0, 10, 0); wallet.AddWalletDescriptor(w_desc, provider, "", false); } BOOST_AUTO_TEST_CASE(psbt_updater_test) { LOCK(m_wallet.cs_wallet); m_wallet.SetWalletFlag(WALLET_FLAG_DESCRIPTORS); // Create prevtxs and add to wallet CDataStream s_prev_tx1(ParseHex("0200000000010158e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd7501000000171600145f275f436b09a8cc9a2eb2a2f528485c68a56323feffffff02d8231f1b0100000017a914aed962d6654f9a2b36608eb9d64d2b260db4f1118700c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e88702483045022100a22edcc6e5bc511af4cc4ae0de0fcd75c7e04d8c1c3a8aa9d820ed4b967384ec02200642963597b9b1bc22c75e9f3e117284a962188bf5e8a74c895089046a20ad770121035509a48eb623e10aace8bfd0212fdb8a8e5af3c94b0b133b95e114cab89e4f7965000000"), SER_NETWORK, PROTOCOL_VERSION); CTransactionRef prev_tx1; s_prev_tx1 >> prev_tx1; m_wallet.mapWallet.emplace(std::piecewise_construct, std::forward_as_tuple(prev_tx1->GetHash()), std::forward_as_tuple(prev_tx1, TxStateInactive{})); CDataStream s_prev_tx2(ParseHex("0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000"), SER_NETWORK, PROTOCOL_VERSION); CTransactionRef prev_tx2; s_prev_tx2 >> prev_tx2; m_wallet.mapWallet.emplace(std::piecewise_construct, std::forward_as_tuple(prev_tx2->GetHash()), std::forward_as_tuple(prev_tx2, TxStateInactive{})); // Import descriptors for keys and scripts import_descriptor(m_wallet, "sh(multi(2,xprv9s21ZrQH143K2LE7W4Xf3jATf9jECxSb7wj91ZnmY4qEJrS66Qru9RFqq8xbkgT32ya6HqYJweFdJUEDf5Q6JFV7jMiUws7kQfe6Tv4RbfN/0h/0h/0h,xprv9s21ZrQH143K2LE7W4Xf3jATf9jECxSb7wj91ZnmY4qEJrS66Qru9RFqq8xbkgT32ya6HqYJweFdJUEDf5Q6JFV7jMiUws7kQfe6Tv4RbfN/0h/0h/1h))"); import_descriptor(m_wallet, "sh(wsh(multi(2,xprv9s21ZrQH143K2LE7W4Xf3jATf9jECxSb7wj91ZnmY4qEJrS66Qru9RFqq8xbkgT32ya6HqYJweFdJUEDf5Q6JFV7jMiUws7kQfe6Tv4RbfN/0h/0h/2h,xprv9s21ZrQH143K2LE7W4Xf3jATf9jECxSb7wj91ZnmY4qEJrS66Qru9RFqq8xbkgT32ya6HqYJweFdJUEDf5Q6JFV7jMiUws7kQfe6Tv4RbfN/0h/0h/3h)))"); import_descriptor(m_wallet, "wpkh(xprv9s21ZrQH143K2LE7W4Xf3jATf9jECxSb7wj91ZnmY4qEJrS66Qru9RFqq8xbkgT32ya6HqYJweFdJUEDf5Q6JFV7jMiUws7kQfe6Tv4RbfN/0h/0h/*h)"); // Call FillPSBT PartiallySignedTransaction psbtx; CDataStream ssData(ParseHex("70736274ff01009a020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd750000000000ffffffff838d0427d0ec650a68aa46bb0b098aea4422c071b2ca78352a077959d07cea1d0100000000ffffffff0270aaf00800000000160014d85c2b71d0060b09c9886aeb815e50991dda124d00e1f5050000000016001400aea9a2e5f0f876a588df5546e8742d1d87008f000000000000000000"), SER_NETWORK, PROTOCOL_VERSION); ssData >> psbtx; // Fill transaction with our data bool complete = true; BOOST_REQUIRE_EQUAL(TransactionError::OK, m_wallet.FillPSBT(psbtx, complete, SIGHASH_ALL, false, true)); // Get the final tx CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << psbtx; std::string final_hex = HexStr(ssTx); BOOST_CHECK_EQUAL(final_hex, "70736274ff01009a020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd750000000000ffffffff838d0427d0ec650a68aa46bb0b098aea4422c071b2ca78352a077959d07cea1d0100000000ffffffff0270aaf00800000000160014d85c2b71d0060b09c9886aeb815e50991dda124d00e1f5050000000016001400aea9a2e5f0f876a588df5546e8742d1d87008f00000000000100bb0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f6187650000000104475221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae2206029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f10d90c6a4f000000800000008000000080220602dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d710d90c6a4f0000008000000080010000800001008a020000000158e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd7501000000171600145f275f436b09a8cc9a2eb2a2f528485c68a56323feffffff02d8231f1b0100000017a914aed962d6654f9a2b36608eb9d64d2b260db4f1118700c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e8876500000001012000c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e88701042200208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903010547522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae2206023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7310d90c6a4f000000800000008003000080220603089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc10d90c6a4f00000080000000800200008000220203a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca5877110d90c6a4f000000800000008004000080002202027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b5005109610d90c6a4f00000080000000800500008000"); // Mutate the transaction so that one of the inputs is invalid psbtx.tx->vin[0].prevout.n = 2; // Try to sign the mutated input SignatureData sigdata; BOOST_CHECK(m_wallet.FillPSBT(psbtx, complete, SIGHASH_ALL, true, true) != TransactionError::OK); //BOOST_CHECK(spk_man->FillPSBT(psbtx, PrecomputePSBTData(psbtx), SIGHASH_ALL, true, true) != TransactionError::OK); } BOOST_AUTO_TEST_CASE(parse_hd_keypath) { std::vector<uint32_t> keypath; BOOST_CHECK(ParseHDKeypath("1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1", keypath)); BOOST_CHECK(!ParseHDKeypath("///////////////////////////", keypath)); BOOST_CHECK(ParseHDKeypath("1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1'/1", keypath)); BOOST_CHECK(!ParseHDKeypath("//////////////////////////'/", keypath)); BOOST_CHECK(ParseHDKeypath("1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/", keypath)); BOOST_CHECK(!ParseHDKeypath("1///////////////////////////", keypath)); BOOST_CHECK(ParseHDKeypath("1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1'/", keypath)); BOOST_CHECK(!ParseHDKeypath("1/'//////////////////////////", keypath)); BOOST_CHECK(ParseHDKeypath("", keypath)); BOOST_CHECK(!ParseHDKeypath(" ", keypath)); BOOST_CHECK(ParseHDKeypath("0", keypath)); BOOST_CHECK(!ParseHDKeypath("O", keypath)); BOOST_CHECK(ParseHDKeypath("0000'/0000'/0000'", keypath)); BOOST_CHECK(!ParseHDKeypath("0000,/0000,/0000,", keypath)); BOOST_CHECK(ParseHDKeypath("01234", keypath)); BOOST_CHECK(!ParseHDKeypath("0x1234", keypath)); BOOST_CHECK(ParseHDKeypath("1", keypath)); BOOST_CHECK(!ParseHDKeypath(" 1", keypath)); BOOST_CHECK(ParseHDKeypath("42", keypath)); BOOST_CHECK(!ParseHDKeypath("m42", keypath)); BOOST_CHECK(ParseHDKeypath("4294967295", keypath)); // 4294967295 == 0xFFFFFFFF (uint32_t max) BOOST_CHECK(!ParseHDKeypath("4294967296", keypath)); // 4294967296 == 0xFFFFFFFF (uint32_t max) + 1 BOOST_CHECK(ParseHDKeypath("m", keypath)); BOOST_CHECK(!ParseHDKeypath("n", keypath)); BOOST_CHECK(ParseHDKeypath("m/", keypath)); BOOST_CHECK(!ParseHDKeypath("n/", keypath)); BOOST_CHECK(ParseHDKeypath("m/0", keypath)); BOOST_CHECK(!ParseHDKeypath("n/0", keypath)); BOOST_CHECK(ParseHDKeypath("m/0'", keypath)); BOOST_CHECK(!ParseHDKeypath("m/0''", keypath)); BOOST_CHECK(ParseHDKeypath("m/0'/0'", keypath)); BOOST_CHECK(!ParseHDKeypath("m/'0/0'", keypath)); BOOST_CHECK(ParseHDKeypath("m/0/0", keypath)); BOOST_CHECK(!ParseHDKeypath("n/0/0", keypath)); BOOST_CHECK(ParseHDKeypath("m/0/0/00", keypath)); BOOST_CHECK(!ParseHDKeypath("m/0/0/f00", keypath)); BOOST_CHECK(ParseHDKeypath("m/0/0/000000000000000000000000000000000000000000000000000000000000000000000000000000000000", keypath)); BOOST_CHECK(!ParseHDKeypath("m/1/1/111111111111111111111111111111111111111111111111111111111111111111111111111111111111", keypath)); BOOST_CHECK(ParseHDKeypath("m/0/00/0", keypath)); BOOST_CHECK(!ParseHDKeypath("m/0'/00/'0", keypath)); BOOST_CHECK(ParseHDKeypath("m/1/", keypath)); BOOST_CHECK(!ParseHDKeypath("m/1//", keypath)); BOOST_CHECK(ParseHDKeypath("m/0/4294967295", keypath)); // 4294967295 == 0xFFFFFFFF (uint32_t max) BOOST_CHECK(!ParseHDKeypath("m/0/4294967296", keypath)); // 4294967296 == 0xFFFFFFFF (uint32_t max) + 1 BOOST_CHECK(ParseHDKeypath("m/4294967295", keypath)); // 4294967295 == 0xFFFFFFFF (uint32_t max) BOOST_CHECK(!ParseHDKeypath("m/4294967296", keypath)); // 4294967296 == 0xFFFFFFFF (uint32_t max) + 1 } BOOST_AUTO_TEST_SUITE_END() } // namespace wallet
kallewoof/bitcoin
src/wallet/test/psbt_wallet_tests.cpp
C++
mit
9,953
/* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is JavaScript Engine testing utilities. * * The Initial Developer of the Original Code is * Mozilla Foundation. * Portions created by the Initial Developer are Copyright (C) 2007 * the Initial Developer. All Rights Reserved. * * Contributor(s): Igor Bukanov * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ gTestfile = 'regress-373072.js'; var BUGNUMBER = 373072; var summary = 'XML.prototype.namespace() does not check for xml list'; var actual = ''; var expect = ''; printBugNumber(BUGNUMBER); START(summary); try { expect = 'TypeError: cannot call namespace method on an XML list with ' + '0 elements'; XML.prototype.function::namespace.call(new XMLList()); } catch(ex) { actual = ex + ''; } TEST(1, expect, actual); END();
jubos/meguro
deps/spidermonkey/tests/e4x/XMLList/regress-373072.js
JavaScript
mit
2,240
/*====================================================== ************ Pull To Refresh ************ ======================================================*/ app.initPullToRefresh = function (pageContainer) { var eventsTarget = $(pageContainer); if (!eventsTarget.hasClass('pull-to-refresh-content')) { eventsTarget = eventsTarget.find('.pull-to-refresh-content'); } if (!eventsTarget || eventsTarget.length === 0) return; var touchId, isTouched, isMoved, touchesStart = {}, isScrolling, touchesDiff, touchStartTime, container, refresh = false, useTranslate = false, startTranslate = 0, translate, scrollTop, wasScrolled, layer, triggerDistance, dynamicTriggerDistance; var page = eventsTarget.hasClass('page') ? eventsTarget : eventsTarget.parents('.page'); var hasNavbar = false; if (page.find('.navbar').length > 0 || page.parents('.navbar-fixed, .navbar-through').length > 0 || page.hasClass('navbar-fixed') || page.hasClass('navbar-through')) hasNavbar = true; if (page.hasClass('no-navbar')) hasNavbar = false; if (!hasNavbar) eventsTarget.addClass('pull-to-refresh-no-navbar'); container = eventsTarget; // Define trigger distance if (container.attr('data-ptr-distance')) { dynamicTriggerDistance = true; } else { triggerDistance = 44; } function handleTouchStart(e) { if (isTouched) { if (app.device.os === 'android') { if ('targetTouches' in e && e.targetTouches.length > 1) return; } else return; } isMoved = false; isTouched = true; isScrolling = undefined; wasScrolled = undefined; if (e.type === 'touchstart') touchId = e.targetTouches[0].identifier; touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX; touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY; touchStartTime = (new Date()).getTime(); /*jshint validthis:true */ container = $(this); } function handleTouchMove(e) { if (!isTouched) return; var pageX, pageY, touch; if (e.type === 'touchmove') { if (touchId && e.touches) { for (var i = 0; i < e.touches.length; i++) { if (e.touches[i].identifier === touchId) { touch = e.touches[i]; } } } if (!touch) touch = e.targetTouches[0]; pageX = touch.pageX; pageY = touch.pageY; } else { pageX = e.pageX; pageY = e.pageY; } if (!pageX || !pageY) return; if (typeof isScrolling === 'undefined') { isScrolling = !!(isScrolling || Math.abs(pageY - touchesStart.y) > Math.abs(pageX - touchesStart.x)); } if (!isScrolling) { isTouched = false; return; } scrollTop = container[0].scrollTop; if (typeof wasScrolled === 'undefined' && scrollTop !== 0) wasScrolled = true; if (!isMoved) { /*jshint validthis:true */ container.removeClass('transitioning'); if (scrollTop > container[0].offsetHeight) { isTouched = false; return; } if (dynamicTriggerDistance) { triggerDistance = container.attr('data-ptr-distance'); if (triggerDistance.indexOf('%') >= 0) triggerDistance = container[0].offsetHeight * parseInt(triggerDistance, 10) / 100; } startTranslate = container.hasClass('refreshing') ? triggerDistance : 0; if (container[0].scrollHeight === container[0].offsetHeight || app.device.os !== 'ios') { useTranslate = true; } else { useTranslate = false; } useTranslate = true; } isMoved = true; touchesDiff = pageY - touchesStart.y; if (touchesDiff > 0 && scrollTop <= 0 || scrollTop < 0) { // iOS 8 fix if (app.device.os === 'ios' && parseInt(app.device.osVersion.split('.')[0], 10) > 7 && scrollTop === 0 && !wasScrolled) useTranslate = true; if (useTranslate) { e.preventDefault(); translate = (Math.pow(touchesDiff, 0.85) + startTranslate); container.transform('translate3d(0,' + translate + 'px,0)'); } else { } if ((useTranslate && Math.pow(touchesDiff, 0.85) > triggerDistance) || (!useTranslate && touchesDiff >= triggerDistance * 2)) { refresh = true; container.addClass('pull-up').removeClass('pull-down'); } else { refresh = false; container.removeClass('pull-up').addClass('pull-down'); } } else { container.removeClass('pull-up pull-down'); refresh = false; return; } } function handleTouchEnd(e) { if (e.type === 'touchend' && e.changedTouches && e.changedTouches.length > 0 && touchId) { if (e.changedTouches[0].identifier !== touchId) return; } if (!isTouched || !isMoved) { isTouched = false; isMoved = false; return; } if (translate) { container.addClass('transitioning'); translate = 0; } container.transform(''); if (refresh) { container.addClass('refreshing'); container.trigger('refresh', { done: function () { app.pullToRefreshDone(container); } }); } else { container.removeClass('pull-down'); } isTouched = false; isMoved = false; } // Attach Events eventsTarget.on(app.touchEvents.start, handleTouchStart); eventsTarget.on(app.touchEvents.move, handleTouchMove); eventsTarget.on(app.touchEvents.end, handleTouchEnd); // Detach Events on page remove if (page.length === 0) return; function destroyPullToRefresh() { eventsTarget.off(app.touchEvents.start, handleTouchStart); eventsTarget.off(app.touchEvents.move, handleTouchMove); eventsTarget.off(app.touchEvents.end, handleTouchEnd); } eventsTarget[0].f7DestroyPullToRefresh = destroyPullToRefresh; function detachEvents() { destroyPullToRefresh(); page.off('pageBeforeRemove', detachEvents); } page.on('pageBeforeRemove', detachEvents); }; app.pullToRefreshDone = function (container) { container = $(container); if (container.length === 0) container = $('.pull-to-refresh-content.refreshing'); container.removeClass('refreshing').addClass('transitioning'); container.transitionEnd(function () { container.removeClass('transitioning pull-up pull-down'); }); }; app.pullToRefreshTrigger = function (container) { container = $(container); if (container.length === 0) container = $('.pull-to-refresh-content'); if (container.hasClass('refreshing')) return; container.addClass('transitioning refreshing'); container.trigger('refresh', { done: function () { app.pullToRefreshDone(container); } }); }; app.destroyPullToRefresh = function (pageContainer) { pageContainer = $(pageContainer); var pullToRefreshContent = pageContainer.hasClass('pull-to-refresh-content') ? pageContainer : pageContainer.find('.pull-to-refresh-content'); if (pullToRefreshContent.length === 0) return; if (pullToRefreshContent[0].f7DestroyPullToRefresh) pullToRefreshContent[0].f7DestroyPullToRefresh(); };
chenbk85/Framework7-Plus
src/js/pull-to-refresh.js
JavaScript
mit
7,901
'use strict' const Buffer = require('safe-buffer').Buffer const checkResponse = require('./check-response.js') const config = require('./config.js') const getAuth = require('./auth.js') const fetch = require('make-fetch-happen') const npa = require('npm-package-arg') const qs = require('querystring') const silentLog = require('./silentlog.js') const url = require('url') module.exports = regFetch function regFetch (uri, opts) { opts = config(Object.assign({ log: silentLog }, opts)) const registry = ( (opts.get('spec') && pickRegistry(opts.get('spec'), opts)) || opts.get('registry') || 'https://registry.npmjs.org/' ) uri = url.parse(uri).protocol ? uri : `${ registry.trim().replace(/\/?$/g, '') }/${ uri.trim().replace(/^\//, '') }` // through that takes into account the scope, the prefix of `uri`, etc const startTime = Date.now() const headers = getHeaders(registry, uri, opts) let body = opts.get('body') const bodyIsStream = body && typeof body === 'object' && typeof body.pipe === 'function' if (body && !bodyIsStream && typeof body !== 'string' && !Buffer.isBuffer(body)) { headers['content-type'] = headers['content-type'] || 'application/json' body = JSON.stringify(body) } else if (body && !headers['content-type']) { headers['content-type'] = 'application/octet-stream' } if (opts.get('query')) { let q = opts.get('query') if (typeof q === 'string') { q = qs.parse(q) } const parsed = url.parse(uri) parsed.search = '?' + qs.stringify( parsed.query ? Object.assign(qs.parse(parsed.query), q) : q ) uri = url.format(parsed) } return fetch(uri, { agent: opts.get('agent'), algorithms: opts.get('algorithms'), body, cache: getCacheMode(opts), cacheManager: opts.get('cache'), ca: opts.get('ca'), cert: opts.get('cert'), headers, integrity: opts.get('integrity'), key: opts.get('key'), localAddress: opts.get('local-address'), maxSockets: opts.get('maxsockets'), memoize: opts.get('memoize'), method: opts.get('method') || 'GET', noProxy: opts.get('noproxy'), Promise: opts.get('Promise'), proxy: opts.get('proxy'), referer: opts.get('refer'), retry: opts.get('retry') || { retries: opts.get('fetch-retries'), factor: opts.get('fetch-retry-factor'), minTimeout: opts.get('fetch-retry-mintimeout'), maxTimeout: opts.get('fetch-retry-maxtimeout') }, strictSSL: !!opts.get('strict-ssl'), timeout: opts.get('timeout'), uid: opts.get('uid'), gid: opts.get('gid') }).then(res => checkResponse( opts.get('method') || 'GET', res, registry, startTime, opts )) } module.exports.json = fetchJSON function fetchJSON (uri, opts) { return regFetch(uri, opts).then(res => res.json()) } module.exports.pickRegistry = pickRegistry function pickRegistry (spec, opts) { spec = npa(spec) opts = config(opts) if (!spec.registry) { throw new Error(`${spec} is not a valid registry dependency spec`) } let registry = spec.scope && opts.get(spec.scope.replace(/^@?/, '@') + ':registry') if (!registry && opts.get('scope')) { registry = opts.get( opts.get('scope').replace(/^@?/, '@') + ':registry' ) } if (!registry) { registry = opts.get('registry') || 'https://registry.npmjs.org/' } return registry } function getCacheMode (opts) { return opts.get('offline') ? 'only-if-cached' : opts.get('prefer-offline') ? 'force-cache' : opts.get('prefer-online') ? 'no-cache' : 'default' } function getHeaders (registry, uri, opts) { const headers = Object.assign({ 'npm-in-ci': !!( opts.get('is-from-ci') || process.env['CI'] === 'true' || process.env['TDDIUM'] || process.env['JENKINS_URL'] || process.env['bamboo.buildKey'] || process.env['GO_PIPELINE_NAME'] ), 'npm-scope': opts.get('project-scope'), 'npm-session': opts.get('npm-session'), 'user-agent': opts.get('user-agent'), 'referer': opts.get('refer') }, opts.get('headers')) const auth = getAuth(registry, opts) // If a tarball is hosted on a different place than the manifest, only send // credentials on `alwaysAuth` const shouldAuth = ( auth.alwaysAuth || url.parse(uri).host === url.parse(registry).host ) if (shouldAuth && auth.token) { headers.authorization = `Bearer ${auth.token}` } else if (shouldAuth && auth.username && auth.password) { const encoded = Buffer.from( `${auth.username}:${auth.password}`, 'utf8' ).toString('base64') headers.authorization = `Basic ${encoded}` } else if (shouldAuth && auth._auth) { headers.authorization = `Basic ${auth._auth}` } if (shouldAuth && auth.otp) { headers['npm-otp'] = auth.otp } return headers }
jamfang/Agora-WebRTC-Live-Broadcasting-Demo
node_modules/npm/node_modules/npm-registry-fetch/index.js
JavaScript
mit
4,896
// Karma configuration // Generated on Wed Dec 24 2014 19:30:10 GMT-0200 (Horário brasileiro de verão) module.exports = function (config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['jasmine'], // list of files / patterns to load in the browser files: [ 'bower_components/jquery/dist/jquery.min.js', 'bower_components/angular/angular.js', 'bower_components/angular-mocks/angular-mocks.js', 'src/module.js', 'src/*.js', 'tests/*_test.js' ], // list of files to exclude exclude: [], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { 'src/*.js': 'coverage' }, coverageReporter: { type: 'lcov', dir: 'coverage' }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress', 'coverage'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: true, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['PhantomJS', 'Chrome', 'IE', 'Safari', 'Firefox', 'FirefoxNightly', 'ChromeCanary'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false }); };
csarkosh/cc-mwc
public/lib/angular-recaptcha/karma.conf.js
JavaScript
mit
2,179
'use strict'; var gutil = require('gulp-util'); var through = require('through2'); var csslint = require('csslint').CSSLint; var RcLoader = require('rcloader'); var formatOutput = function(report, file, options) { if (!report.messages.length) { return { success: true }; } var filePath = (file.path || 'stdin'); // Handle errors var results = report.messages.map(function(err) { if (!err) return; return { file: filePath, error: err }; }).filter(function(err) { return err; }); return { originalReport: report, errorCount: results.length, success: false, results: results, options: options }; }; var cssLintPlugin = function(options) { options = options || {}; var rcLoader = new RcLoader('.csslintrc', options, { loader: 'async' }); return through.obj(function(file, enc, cb) { if (file.isNull()) return cb(null, file); // pass along if (file.isStream()) return cb(new gutil.PluginError('gulp-csslint: Streaming not supported'), file); var ruleset = {}; // Build a list of all available rules csslint.getRules().forEach(function(rule) { ruleset[rule.id] = 1; }); var content = file.contents.toString(enc); if (!content) return cb(null, file); // pass along rcLoader.for(file.path, function(err, opts) { if (err) return cb(err); for (var rule in opts) { if (!opts[rule]) { // Remove rules that are turned off delete ruleset[rule]; } else { ruleset[rule] = opts[rule]; } } var report = csslint.verify(content, ruleset); // send status down-stream file.csslint = formatOutput(report, file, ruleset); cb(null, file); }); }); }; cssLintPlugin.reporter = function(customReporter) { var reporter = csslint.getFormatter('text'); var builtInReporter = true; var output; if (typeof customReporter === 'function') { reporter = customReporter; builtInReporter = false; } else if (typeof customReporter === 'string') { if (customReporter === 'fail') { return cssLintPlugin.failReporter(); } reporter = csslint.getFormatter(customReporter); } if (typeof reporter === 'undefined') { throw new Error('Invalid reporter'); } if (builtInReporter) { output = [reporter.startFormat()]; } return through.obj( function(file, enc, cb) { // Only report if CSSLint was ran and errors were found if (file.csslint && !file.csslint.success) { if (builtInReporter) { output.push(reporter.formatResults(file.csslint.originalReport, file.path)); } else { reporter(file); } } return cb(null, file); }, function(cb) { var report; if (builtInReporter) { output.push(reporter.endFormat()); report = output.join(''); // Only print report if the report is not empty report && gutil.log(report); } return cb(); } ); }; cssLintPlugin.addRule = function(rule) { if (typeof rule !== 'object') { throw new Error('Invalid rule: rules need to be objects.'); } csslint.addRule(rule); }; cssLintPlugin.failReporter = function() { return through.obj(function(file, enc, cb) { // Nothing to report or no errors if (!file.csslint || file.csslint.success) { return cb(null, file); } return cb(new gutil.PluginError('gulp-csslint', 'CSSLint failed for ' + file.relative), file); }); }; module.exports = cssLintPlugin;
guimurgel/gulp
node_modules/gulp-csslint/index.js
JavaScript
mit
3,561
'use strict';"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var lang_1 = require('angular2/src/facade/lang'); var RouteLifecycleHook = (function () { function RouteLifecycleHook(name) { this.name = name; } RouteLifecycleHook = __decorate([ lang_1.CONST(), __metadata('design:paramtypes', [String]) ], RouteLifecycleHook); return RouteLifecycleHook; }()); exports.RouteLifecycleHook = RouteLifecycleHook; var CanActivate = (function () { function CanActivate(fn) { this.fn = fn; } CanActivate = __decorate([ lang_1.CONST(), __metadata('design:paramtypes', [Function]) ], CanActivate); return CanActivate; }()); exports.CanActivate = CanActivate; exports.routerCanReuse = lang_1.CONST_EXPR(new RouteLifecycleHook("routerCanReuse")); exports.routerCanDeactivate = lang_1.CONST_EXPR(new RouteLifecycleHook("routerCanDeactivate")); exports.routerOnActivate = lang_1.CONST_EXPR(new RouteLifecycleHook("routerOnActivate")); exports.routerOnReuse = lang_1.CONST_EXPR(new RouteLifecycleHook("routerOnReuse")); exports.routerOnDeactivate = lang_1.CONST_EXPR(new RouteLifecycleHook("routerOnDeactivate")); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlmZWN5Y2xlX2Fubm90YXRpb25zX2ltcGwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJkaWZmaW5nX3BsdWdpbl93cmFwcGVyLW91dHB1dF9wYXRoLUJSSmVyMUo5LnRtcC9hbmd1bGFyMi9zcmMvcm91dGVyL2xpZmVjeWNsZS9saWZlY3ljbGVfYW5ub3RhdGlvbnNfaW1wbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEscUJBQWdDLDBCQUEwQixDQUFDLENBQUE7QUFHM0Q7SUFDRSw0QkFBbUIsSUFBWTtRQUFaLFNBQUksR0FBSixJQUFJLENBQVE7SUFBRyxDQUFDO0lBRnJDO1FBQUMsWUFBSyxFQUFFOzswQkFBQTtJQUdSLHlCQUFDO0FBQUQsQ0FBQyxBQUZELElBRUM7QUFGWSwwQkFBa0IscUJBRTlCLENBQUE7QUFHRDtJQUNFLHFCQUFtQixFQUFZO1FBQVosT0FBRSxHQUFGLEVBQUUsQ0FBVTtJQUFHLENBQUM7SUFGckM7UUFBQyxZQUFLLEVBQUU7O21CQUFBO0lBR1Isa0JBQUM7QUFBRCxDQUFDLEFBRkQsSUFFQztBQUZZLG1CQUFXLGNBRXZCLENBQUE7QUFFWSxzQkFBYyxHQUN2QixpQkFBVSxDQUFDLElBQUksa0JBQWtCLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxDQUFDO0FBQzVDLDJCQUFtQixHQUM1QixpQkFBVSxDQUFDLElBQUksa0JBQWtCLENBQUMscUJBQXFCLENBQUMsQ0FBQyxDQUFDO0FBQ2pELHdCQUFnQixHQUN6QixpQkFBVSxDQUFDLElBQUksa0JBQWtCLENBQUMsa0JBQWtCLENBQUMsQ0FBQyxDQUFDO0FBQzlDLHFCQUFhLEdBQ3RCLGlCQUFVLENBQUMsSUFBSSxrQkFBa0IsQ0FBQyxlQUFlLENBQUMsQ0FBQyxDQUFDO0FBQzNDLDBCQUFrQixHQUMzQixpQkFBVSxDQUFDLElBQUksa0JBQWtCLENBQUMsb0JBQW9CLENBQUMsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtDT05TVCwgQ09OU1RfRVhQUn0gZnJvbSAnYW5ndWxhcjIvc3JjL2ZhY2FkZS9sYW5nJztcblxuQENPTlNUKClcbmV4cG9ydCBjbGFzcyBSb3V0ZUxpZmVjeWNsZUhvb2sge1xuICBjb25zdHJ1Y3RvcihwdWJsaWMgbmFtZTogc3RyaW5nKSB7fVxufVxuXG5AQ09OU1QoKVxuZXhwb3J0IGNsYXNzIENhbkFjdGl2YXRlIHtcbiAgY29uc3RydWN0b3IocHVibGljIGZuOiBGdW5jdGlvbikge31cbn1cblxuZXhwb3J0IGNvbnN0IHJvdXRlckNhblJldXNlOiBSb3V0ZUxpZmVjeWNsZUhvb2sgPVxuICAgIENPTlNUX0VYUFIobmV3IFJvdXRlTGlmZWN5Y2xlSG9vayhcInJvdXRlckNhblJldXNlXCIpKTtcbmV4cG9ydCBjb25zdCByb3V0ZXJDYW5EZWFjdGl2YXRlOiBSb3V0ZUxpZmVjeWNsZUhvb2sgPVxuICAgIENPTlNUX0VYUFIobmV3IFJvdXRlTGlmZWN5Y2xlSG9vayhcInJvdXRlckNhbkRlYWN0aXZhdGVcIikpO1xuZXhwb3J0IGNvbnN0IHJvdXRlck9uQWN0aXZhdGU6IFJvdXRlTGlmZWN5Y2xlSG9vayA9XG4gICAgQ09OU1RfRVhQUihuZXcgUm91dGVMaWZlY3ljbGVIb29rKFwicm91dGVyT25BY3RpdmF0ZVwiKSk7XG5leHBvcnQgY29uc3Qgcm91dGVyT25SZXVzZTogUm91dGVMaWZlY3ljbGVIb29rID1cbiAgICBDT05TVF9FWFBSKG5ldyBSb3V0ZUxpZmVjeWNsZUhvb2soXCJyb3V0ZXJPblJldXNlXCIpKTtcbmV4cG9ydCBjb25zdCByb3V0ZXJPbkRlYWN0aXZhdGU6IFJvdXRlTGlmZWN5Y2xlSG9vayA9XG4gICAgQ09OU1RfRVhQUihuZXcgUm91dGVMaWZlY3ljbGVIb29rKFwicm91dGVyT25EZWFjdGl2YXRlXCIpKTtcbiJdfQ==
liufeng2015/LeifD3
node_modules/angular2/src/router/lifecycle/lifecycle_annotations_impl.js
JavaScript
mit
4,231
require 'date' module SmartAnswer::Calculators class AgriculturalHolidayEntitlementCalculator # created for the agricultural holiday entitlement calculator def calculation_period # Agricultural holiday calculations run from Oct 1 - Oct 1 this_year_period = Date.civil(Date.today.year, 10, 1) if Date.today > this_year_period this_year_period else # last year's Oct 1 Date.civil(Date.today.year.to_i - 1, 10, 1) end end def weeks_worked(holiday_start) days = (holiday_start.to_datetime - calculation_period.to_datetime).to_i days / 7 end def available_days (Date.today.to_datetime - calculation_period.to_datetime).to_i end def holiday_days(days_worked_per_week) days_worked_per_week = days_worked_per_week.to_f if days_worked_per_week > 6 38 elsif days_worked_per_week > 5 35 elsif days_worked_per_week > 4 31 elsif days_worked_per_week > 3 25 elsif days_worked_per_week > 2 20 elsif days_worked_per_week > 1 13 else 7.5 end end end end
keithiopia/smart-answers
lib/smart_answer/calculators/agricultural_holiday_entitlement_calculator.rb
Ruby
mit
1,164
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Struct template result&lt;This(T &amp;)&gt;</title> <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> <link rel="home" href="../../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="../_byval.html#idp142235232" title="Description"> <link rel="prev" href="result_This_bo_idp91087216.html" title="Struct template result&lt;This(boost::reference_wrapper&lt; T &gt;)&gt;"> <link rel="next" href="result_This_T__idp91090832.html" title="Struct template result&lt;This(T)&gt;"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> <td align="center"><a href="../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="result_This_bo_idp91087216.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../_byval.html#idp142235232"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="result_This_T__idp91090832.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="refentry"> <a name="boost.proto._byval.result_This(T__idp91089040"></a><div class="titlepage"></div> <div class="refnamediv"> <h2><span class="refentrytitle">Struct template result&lt;This(T &amp;)&gt;</span></h2> <p>boost::proto::_byval::result&lt;This(T &amp;)&gt;</p> </div> <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../proto/reference.html#header.boost.proto.transform.arg_hpp" title="Header &lt;boost/proto/transform/arg.hpp&gt;">boost/proto/transform/arg.hpp</a>&gt; </span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> This<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="keyword">struct</span> <a class="link" href="result_This_T__idp91089040.html" title="Struct template result&lt;This(T &amp;)&gt;">result</a><span class="special">&lt;</span><span class="identifier">This</span><span class="special">(</span><span class="identifier">T</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">:</span> <span class="keyword"></span> <span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">This</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span> <span class="special">}</span><span class="special">;</span></pre></div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2008 Eric Niebler<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="result_This_bo_idp91087216.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../_byval.html#idp142235232"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="result_This_T__idp91090832.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
goldcoin/gldcoin
BuildDeps/deps/boost/doc/html/boost/proto/_byval/result_This_T__idp91089040.html
HTML
mit
4,598
// SVGPathSeg API polyfill // https://github.com/progers/pathseg // // This is a drop-in replacement for the SVGPathSeg and SVGPathSegList APIs that were removed from // SVG2 (https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html), including the latest spec // changes which were implemented in Firefox 43 and Chrome 46. (function() { "use strict"; if (!("SVGPathSeg" in window)) { // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg window.SVGPathSeg = function(type, typeAsLetter, owningPathSegList) { this.pathSegType = type; this.pathSegTypeAsLetter = typeAsLetter; this._owningPathSegList = owningPathSegList; } SVGPathSeg.PATHSEG_UNKNOWN = 0; SVGPathSeg.PATHSEG_CLOSEPATH = 1; SVGPathSeg.PATHSEG_MOVETO_ABS = 2; SVGPathSeg.PATHSEG_MOVETO_REL = 3; SVGPathSeg.PATHSEG_LINETO_ABS = 4; SVGPathSeg.PATHSEG_LINETO_REL = 5; SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6; SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7; SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8; SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9; SVGPathSeg.PATHSEG_ARC_ABS = 10; SVGPathSeg.PATHSEG_ARC_REL = 11; SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12; SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13; SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14; SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15; SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16; SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17; SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18; SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19; // Notify owning PathSegList on any changes so they can be synchronized back to the path element. SVGPathSeg.prototype._segmentChanged = function() { if (this._owningPathSegList) this._owningPathSegList.segmentChanged(this); } window.SVGPathSegClosePath = function(owningPathSegList) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CLOSEPATH, "z", owningPathSegList); } SVGPathSegClosePath.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegClosePath.prototype.toString = function() { return "[object SVGPathSegClosePath]"; } SVGPathSegClosePath.prototype._asPathString = function() { return this.pathSegTypeAsLetter; } SVGPathSegClosePath.prototype.clone = function() { return new SVGPathSegClosePath(undefined); } window.SVGPathSegMovetoAbs = function(owningPathSegList, x, y) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_MOVETO_ABS, "M", owningPathSegList); this._x = x; this._y = y; } SVGPathSegMovetoAbs.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegMovetoAbs.prototype.toString = function() { return "[object SVGPathSegMovetoAbs]"; } SVGPathSegMovetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } SVGPathSegMovetoAbs.prototype.clone = function() { return new SVGPathSegMovetoAbs(undefined, this._x, this._y); } Object.defineProperty(SVGPathSegMovetoAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegMovetoAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegMovetoRel = function(owningPathSegList, x, y) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_MOVETO_REL, "m", owningPathSegList); this._x = x; this._y = y; } SVGPathSegMovetoRel.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegMovetoRel.prototype.toString = function() { return "[object SVGPathSegMovetoRel]"; } SVGPathSegMovetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } SVGPathSegMovetoRel.prototype.clone = function() { return new SVGPathSegMovetoRel(undefined, this._x, this._y); } Object.defineProperty(SVGPathSegMovetoRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegMovetoRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoAbs = function(owningPathSegList, x, y) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_ABS, "L", owningPathSegList); this._x = x; this._y = y; } SVGPathSegLinetoAbs.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegLinetoAbs.prototype.toString = function() { return "[object SVGPathSegLinetoAbs]"; } SVGPathSegLinetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } SVGPathSegLinetoAbs.prototype.clone = function() { return new SVGPathSegLinetoAbs(undefined, this._x, this._y); } Object.defineProperty(SVGPathSegLinetoAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegLinetoAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoRel = function(owningPathSegList, x, y) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_REL, "l", owningPathSegList); this._x = x; this._y = y; } SVGPathSegLinetoRel.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegLinetoRel.prototype.toString = function() { return "[object SVGPathSegLinetoRel]"; } SVGPathSegLinetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } SVGPathSegLinetoRel.prototype.clone = function() { return new SVGPathSegLinetoRel(undefined, this._x, this._y); } Object.defineProperty(SVGPathSegLinetoRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegLinetoRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoCubicAbs = function(owningPathSegList, x, y, x1, y1, x2, y2) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, "C", owningPathSegList); this._x = x; this._y = y; this._x1 = x1; this._y1 = y1; this._x2 = x2; this._y2 = y2; } SVGPathSegCurvetoCubicAbs.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegCurvetoCubicAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicAbs]"; } SVGPathSegCurvetoCubicAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } SVGPathSegCurvetoCubicAbs.prototype.clone = function() { return new SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); } Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoCubicRel = function(owningPathSegList, x, y, x1, y1, x2, y2) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, "c", owningPathSegList); this._x = x; this._y = y; this._x1 = x1; this._y1 = y1; this._x2 = x2; this._y2 = y2; } SVGPathSegCurvetoCubicRel.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegCurvetoCubicRel.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicRel]"; } SVGPathSegCurvetoCubicRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } SVGPathSegCurvetoCubicRel.prototype.clone = function() { return new SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); } Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoQuadraticAbs = function(owningPathSegList, x, y, x1, y1) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, "Q", owningPathSegList); this._x = x; this._y = y; this._x1 = x1; this._y1 = y1; } SVGPathSegCurvetoQuadraticAbs.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegCurvetoQuadraticAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticAbs]"; } SVGPathSegCurvetoQuadraticAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x + " " + this._y; } SVGPathSegCurvetoQuadraticAbs.prototype.clone = function() { return new SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); } Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoQuadraticRel = function(owningPathSegList, x, y, x1, y1) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, "q", owningPathSegList); this._x = x; this._y = y; this._x1 = x1; this._y1 = y1; } SVGPathSegCurvetoQuadraticRel.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegCurvetoQuadraticRel.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticRel]"; } SVGPathSegCurvetoQuadraticRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x + " " + this._y; } SVGPathSegCurvetoQuadraticRel.prototype.clone = function() { return new SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); } Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegArcAbs = function(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_ARC_ABS, "A", owningPathSegList); this._x = x; this._y = y; this._r1 = r1; this._r2 = r2; this._angle = angle; this._largeArcFlag = largeArcFlag; this._sweepFlag = sweepFlag; } SVGPathSegArcAbs.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegArcAbs.prototype.toString = function() { return "[object SVGPathSegArcAbs]"; } SVGPathSegArcAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._r1 + " " + this._r2 + " " + this._angle + " " + (this._largeArcFlag ? "1" : "0") + " " + (this._sweepFlag ? "1" : "0") + " " + this._x + " " + this._y; } SVGPathSegArcAbs.prototype.clone = function() { return new SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); } Object.defineProperty(SVGPathSegArcAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcAbs.prototype, "r1", { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcAbs.prototype, "r2", { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcAbs.prototype, "angle", { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcAbs.prototype, "largeArcFlag", { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcAbs.prototype, "sweepFlag", { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegArcRel = function(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_ARC_REL, "a", owningPathSegList); this._x = x; this._y = y; this._r1 = r1; this._r2 = r2; this._angle = angle; this._largeArcFlag = largeArcFlag; this._sweepFlag = sweepFlag; } SVGPathSegArcRel.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegArcRel.prototype.toString = function() { return "[object SVGPathSegArcRel]"; } SVGPathSegArcRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._r1 + " " + this._r2 + " " + this._angle + " " + (this._largeArcFlag ? "1" : "0") + " " + (this._sweepFlag ? "1" : "0") + " " + this._x + " " + this._y; } SVGPathSegArcRel.prototype.clone = function() { return new SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); } Object.defineProperty(SVGPathSegArcRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcRel.prototype, "r1", { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcRel.prototype, "r2", { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcRel.prototype, "angle", { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcRel.prototype, "largeArcFlag", { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegArcRel.prototype, "sweepFlag", { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoHorizontalAbs = function(owningPathSegList, x) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, "H", owningPathSegList); this._x = x; } SVGPathSegLinetoHorizontalAbs.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegLinetoHorizontalAbs.prototype.toString = function() { return "[object SVGPathSegLinetoHorizontalAbs]"; } SVGPathSegLinetoHorizontalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x; } SVGPathSegLinetoHorizontalAbs.prototype.clone = function() { return new SVGPathSegLinetoHorizontalAbs(undefined, this._x); } Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoHorizontalRel = function(owningPathSegList, x) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, "h", owningPathSegList); this._x = x; } SVGPathSegLinetoHorizontalRel.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegLinetoHorizontalRel.prototype.toString = function() { return "[object SVGPathSegLinetoHorizontalRel]"; } SVGPathSegLinetoHorizontalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x; } SVGPathSegLinetoHorizontalRel.prototype.clone = function() { return new SVGPathSegLinetoHorizontalRel(undefined, this._x); } Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoVerticalAbs = function(owningPathSegList, y) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, "V", owningPathSegList); this._y = y; } SVGPathSegLinetoVerticalAbs.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegLinetoVerticalAbs.prototype.toString = function() { return "[object SVGPathSegLinetoVerticalAbs]"; } SVGPathSegLinetoVerticalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._y; } SVGPathSegLinetoVerticalAbs.prototype.clone = function() { return new SVGPathSegLinetoVerticalAbs(undefined, this._y); } Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoVerticalRel = function(owningPathSegList, y) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, "v", owningPathSegList); this._y = y; } SVGPathSegLinetoVerticalRel.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegLinetoVerticalRel.prototype.toString = function() { return "[object SVGPathSegLinetoVerticalRel]"; } SVGPathSegLinetoVerticalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._y; } SVGPathSegLinetoVerticalRel.prototype.clone = function() { return new SVGPathSegLinetoVerticalRel(undefined, this._y); } Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoCubicSmoothAbs = function(owningPathSegList, x, y, x2, y2) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, "S", owningPathSegList); this._x = x; this._y = y; this._x2 = x2; this._y2 = y2; } SVGPathSegCurvetoCubicSmoothAbs.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegCurvetoCubicSmoothAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicSmoothAbs]"; } SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } SVGPathSegCurvetoCubicSmoothAbs.prototype.clone = function() { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); } Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoCubicSmoothRel = function(owningPathSegList, x, y, x2, y2) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, "s", owningPathSegList); this._x = x; this._y = y; this._x2 = x2; this._y2 = y2; } SVGPathSegCurvetoCubicSmoothRel.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegCurvetoCubicSmoothRel.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicSmoothRel]"; } SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } SVGPathSegCurvetoCubicSmoothRel.prototype.clone = function() { return new SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); } Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoQuadraticSmoothAbs = function(owningPathSegList, x, y) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, "T", owningPathSegList); this._x = x; this._y = y; } SVGPathSegCurvetoQuadraticSmoothAbs.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticSmoothAbs]"; } SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone = function() { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); } Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoQuadraticSmoothRel = function(owningPathSegList, x, y) { SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, "t", owningPathSegList); this._x = x; this._y = y; } SVGPathSegCurvetoQuadraticSmoothRel.prototype = Object.create(SVGPathSeg.prototype); SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticSmoothRel]"; } SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone = function() { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); } Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); // Add createSVGPathSeg* functions to SVGPathElement. // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathElement. SVGPathElement.prototype.createSVGPathSegClosePath = function() { return new SVGPathSegClosePath(undefined); } SVGPathElement.prototype.createSVGPathSegMovetoAbs = function(x, y) { return new SVGPathSegMovetoAbs(undefined, x, y); } SVGPathElement.prototype.createSVGPathSegMovetoRel = function(x, y) { return new SVGPathSegMovetoRel(undefined, x, y); } SVGPathElement.prototype.createSVGPathSegLinetoAbs = function(x, y) { return new SVGPathSegLinetoAbs(undefined, x, y); } SVGPathElement.prototype.createSVGPathSegLinetoRel = function(x, y) { return new SVGPathSegLinetoRel(undefined, x, y); } SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function(x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2); } SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function(x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2); } SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function(x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1); } SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function(x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1); } SVGPathElement.prototype.createSVGPathSegArcAbs = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); } SVGPathElement.prototype.createSVGPathSegArcRel = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); } SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function(x) { return new SVGPathSegLinetoHorizontalAbs(undefined, x); } SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function(x) { return new SVGPathSegLinetoHorizontalRel(undefined, x); } SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function(y) { return new SVGPathSegLinetoVerticalAbs(undefined, y); } SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function(y) { return new SVGPathSegLinetoVerticalRel(undefined, y); } SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function(x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2); } SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function(x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2); } SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function(x, y) { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y); } SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function(x, y) { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y); } } if (!("SVGPathSegList" in window)) { // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList window.SVGPathSegList = function(pathElement) { this._pathElement = pathElement; this._list = this._parsePath(this._pathElement.getAttribute("d")); // Use a MutationObserver to catch changes to the path's "d" attribute. this._mutationObserverConfig = { "attributes": true, "attributeFilter": ["d"] }; this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this)); this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig); } Object.defineProperty(SVGPathSegList.prototype, "numberOfItems", { get: function() { this._checkPathSynchronizedToList(); return this._list.length; }, enumerable: true }); // Add the pathSegList accessors to SVGPathElement. // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData Object.defineProperty(SVGPathElement.prototype, "pathSegList", { get: function() { if (!this._pathSegList) this._pathSegList = new SVGPathSegList(this); return this._pathSegList; }, enumerable: true }); // FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. Object.defineProperty(SVGPathElement.prototype, "normalizedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true }); Object.defineProperty(SVGPathElement.prototype, "animatedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true }); Object.defineProperty(SVGPathElement.prototype, "animatedNormalizedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true }); // Process any pending mutations to the path element and update the list as needed. // This should be the first call of all public functions and is needed because // MutationObservers are not synchronous so we can have pending asynchronous mutations. SVGPathSegList.prototype._checkPathSynchronizedToList = function() { this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords()); } SVGPathSegList.prototype._updateListFromPathMutations = function(mutationRecords) { if (!this._pathElement) return; var hasPathMutations = false; mutationRecords.forEach(function(record) { if (record.attributeName == "d") hasPathMutations = true; }); if (hasPathMutations) this._list = this._parsePath(this._pathElement.getAttribute("d")); } // Serialize the list and update the path's 'd' attribute. SVGPathSegList.prototype._writeListToPath = function() { this._pathElementMutationObserver.disconnect(); this._pathElement.setAttribute("d", SVGPathSegList._pathSegArrayAsString(this._list)); this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig); } // When a path segment changes the list needs to be synchronized back to the path element. SVGPathSegList.prototype.segmentChanged = function(pathSeg) { this._writeListToPath(); } SVGPathSegList.prototype.clear = function() { this._checkPathSynchronizedToList(); this._list.forEach(function(pathSeg) { pathSeg._owningPathSegList = null; }); this._list = []; this._writeListToPath(); } SVGPathSegList.prototype.initialize = function(newItem) { this._checkPathSynchronizedToList(); this._list = [newItem]; newItem._owningPathSegList = this; this._writeListToPath(); return newItem; } SVGPathSegList.prototype._checkValidIndex = function(index) { if (isNaN(index) || index < 0 || index >= this.numberOfItems) throw "INDEX_SIZE_ERR"; } SVGPathSegList.prototype.getItem = function(index) { this._checkPathSynchronizedToList(); this._checkValidIndex(index); return this._list[index]; } SVGPathSegList.prototype.insertItemBefore = function(newItem, index) { this._checkPathSynchronizedToList(); // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list. if (index > this.numberOfItems) index = this.numberOfItems; if (newItem._owningPathSegList) { // SVG2 spec says to make a copy. newItem = newItem.clone(); } this._list.splice(index, 0, newItem); newItem._owningPathSegList = this; this._writeListToPath(); return newItem; } SVGPathSegList.prototype.replaceItem = function(newItem, index) { this._checkPathSynchronizedToList(); if (newItem._owningPathSegList) { // SVG2 spec says to make a copy. newItem = newItem.clone(); } this._checkValidIndex(index); this._list[index] = newItem; newItem._owningPathSegList = this; this._writeListToPath(); return newItem; } SVGPathSegList.prototype.removeItem = function(index) { this._checkPathSynchronizedToList(); this._checkValidIndex(index); var item = this._list[index]; this._list.splice(index, 1); this._writeListToPath(); return item; } SVGPathSegList.prototype.appendItem = function(newItem) { this._checkPathSynchronizedToList(); if (newItem._owningPathSegList) { // SVG2 spec says to make a copy. newItem = newItem.clone(); } this._list.push(newItem); newItem._owningPathSegList = this; // TODO: Optimize this to just append to the existing attribute. this._writeListToPath(); return newItem; } SVGPathSegList._pathSegArrayAsString = function(pathSegArray) { var string = ""; var first = true; pathSegArray.forEach(function(pathSeg) { if (first) { first = false; string += pathSeg._asPathString(); } else { string += " " + pathSeg._asPathString(); } }); return string; } // This closely follows SVGPathParser::parsePath from Source/core/svg/SVGPathParser.cpp. SVGPathSegList.prototype._parsePath = function(string) { if (!string || string.length == 0) return []; var owningPathSegList = this; var Builder = function() { this.pathSegList = []; } Builder.prototype.appendSegment = function(pathSeg) { this.pathSegList.push(pathSeg); } var Source = function(string) { this._string = string; this._currentIndex = 0; this._endIndex = this._string.length; this._previousCommand = SVGPathSeg.PATHSEG_UNKNOWN; this._skipOptionalSpaces(); } Source.prototype._isCurrentSpace = function() { var character = this._string[this._currentIndex]; return character <= " " && (character == " " || character == "\n" || character == "\t" || character == "\r" || character == "\f"); } Source.prototype._skipOptionalSpaces = function() { while (this._currentIndex < this._endIndex && this._isCurrentSpace()) this._currentIndex++; return this._currentIndex < this._endIndex; } Source.prototype._skipOptionalSpacesOrDelimiter = function() { if (this._currentIndex < this._endIndex && !this._isCurrentSpace() && this._string.charAt(this._currentIndex) != ",") return false; if (this._skipOptionalSpaces()) { if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ",") { this._currentIndex++; this._skipOptionalSpaces(); } } return this._currentIndex < this._endIndex; } Source.prototype.hasMoreData = function() { return this._currentIndex < this._endIndex; } Source.prototype.peekSegmentType = function() { var lookahead = this._string[this._currentIndex]; return this._pathSegTypeFromChar(lookahead); } Source.prototype._pathSegTypeFromChar = function(lookahead) { switch (lookahead) { case "Z": case "z": return SVGPathSeg.PATHSEG_CLOSEPATH; case "M": return SVGPathSeg.PATHSEG_MOVETO_ABS; case "m": return SVGPathSeg.PATHSEG_MOVETO_REL; case "L": return SVGPathSeg.PATHSEG_LINETO_ABS; case "l": return SVGPathSeg.PATHSEG_LINETO_REL; case "C": return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS; case "c": return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL; case "Q": return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS; case "q": return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL; case "A": return SVGPathSeg.PATHSEG_ARC_ABS; case "a": return SVGPathSeg.PATHSEG_ARC_REL; case "H": return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS; case "h": return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL; case "V": return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS; case "v": return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL; case "S": return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; case "s": return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL; case "T": return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; case "t": return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; default: return SVGPathSeg.PATHSEG_UNKNOWN; } } Source.prototype._nextCommandHelper = function(lookahead, previousCommand) { // Check for remaining coordinates in the current command. if ((lookahead == "+" || lookahead == "-" || lookahead == "." || (lookahead >= "0" && lookahead <= "9")) && previousCommand != SVGPathSeg.PATHSEG_CLOSEPATH) { if (previousCommand == SVGPathSeg.PATHSEG_MOVETO_ABS) return SVGPathSeg.PATHSEG_LINETO_ABS; if (previousCommand == SVGPathSeg.PATHSEG_MOVETO_REL) return SVGPathSeg.PATHSEG_LINETO_REL; return previousCommand; } return SVGPathSeg.PATHSEG_UNKNOWN; } Source.prototype.initialCommandIsMoveTo = function() { // If the path is empty it is still valid, so return true. if (!this.hasMoreData()) return true; var command = this.peekSegmentType(); // Path must start with moveTo. return command == SVGPathSeg.PATHSEG_MOVETO_ABS || command == SVGPathSeg.PATHSEG_MOVETO_REL; } // Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp. // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF Source.prototype._parseNumber = function() { var exponent = 0; var integer = 0; var frac = 1; var decimal = 0; var sign = 1; var expsign = 1; var startIndex = this._currentIndex; this._skipOptionalSpaces(); // Read the sign. if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "+") this._currentIndex++; else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "-") { this._currentIndex++; sign = -1; } if (this._currentIndex == this._endIndex || ((this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") && this._string.charAt(this._currentIndex) != ".")) // The first character of a number must be one of [0-9+-.]. return undefined; // Read the integer part, build right-to-left. var startIntPartIndex = this._currentIndex; while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") this._currentIndex++; // Advance to first non-digit. if (this._currentIndex != startIntPartIndex) { var scanIntPartIndex = this._currentIndex - 1; var multiplier = 1; while (scanIntPartIndex >= startIntPartIndex) { integer += multiplier * (this._string.charAt(scanIntPartIndex--) - "0"); multiplier *= 10; } } // Read the decimals. if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ".") { this._currentIndex++; // There must be a least one digit following the . if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") return undefined; while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") decimal += (this._string.charAt(this._currentIndex++) - "0") * (frac *= 0.1); } // Read the exponent part. if (this._currentIndex != startIndex && this._currentIndex + 1 < this._endIndex && (this._string.charAt(this._currentIndex) == "e" || this._string.charAt(this._currentIndex) == "E") && (this._string.charAt(this._currentIndex + 1) != "x" && this._string.charAt(this._currentIndex + 1) != "m")) { this._currentIndex++; // Read the sign of the exponent. if (this._string.charAt(this._currentIndex) == "+") { this._currentIndex++; } else if (this._string.charAt(this._currentIndex) == "-") { this._currentIndex++; expsign = -1; } // There must be an exponent. if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") return undefined; while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") { exponent *= 10; exponent += (this._string.charAt(this._currentIndex) - "0"); this._currentIndex++; } } var number = integer + decimal; number *= sign; if (exponent) number *= Math.pow(10, expsign * exponent); if (startIndex == this._currentIndex) return undefined; this._skipOptionalSpacesOrDelimiter(); return number; } Source.prototype._parseArcFlag = function() { if (this._currentIndex >= this._endIndex) return undefined; var flag = false; var flagChar = this._string.charAt(this._currentIndex++); if (flagChar == "0") flag = false; else if (flagChar == "1") flag = true; else return undefined; this._skipOptionalSpacesOrDelimiter(); return flag; } Source.prototype.parseSegment = function() { var lookahead = this._string[this._currentIndex]; var command = this._pathSegTypeFromChar(lookahead); if (command == SVGPathSeg.PATHSEG_UNKNOWN) { // Possibly an implicit command. Not allowed if this is the first command. if (this._previousCommand == SVGPathSeg.PATHSEG_UNKNOWN) return null; command = this._nextCommandHelper(lookahead, this._previousCommand); if (command == SVGPathSeg.PATHSEG_UNKNOWN) return null; } else { this._currentIndex++; } this._previousCommand = command; switch (command) { case SVGPathSeg.PATHSEG_MOVETO_REL: return new SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber()); case SVGPathSeg.PATHSEG_MOVETO_ABS: return new SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); case SVGPathSeg.PATHSEG_LINETO_REL: return new SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber()); case SVGPathSeg.PATHSEG_LINETO_ABS: return new SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL: return new SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber()); case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS: return new SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber()); case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL: return new SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber()); case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS: return new SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber()); case SVGPathSeg.PATHSEG_CLOSEPATH: this._skipOptionalSpaces(); return new SVGPathSegClosePath(owningPathSegList); case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL: var points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; return new SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2); case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS: var points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; return new SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2); case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL: var points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; return new SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2); case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: var points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; return new SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2); case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL: var points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; return new SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1); case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS: var points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; return new SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1); case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: return new SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber()); case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: return new SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); case SVGPathSeg.PATHSEG_ARC_REL: var points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()}; return new SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep); case SVGPathSeg.PATHSEG_ARC_ABS: var points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()}; return new SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep); default: throw "Unknown path seg type." } } var builder = new Builder(); var source = new Source(string); if (!source.initialCommandIsMoveTo()) return []; while (source.hasMoreData()) { var pathSeg = source.parseSegment(); if (!pathSeg) return []; builder.appendSegment(pathSeg); } return builder.pathSegList; } } }());
jvail/crop-rotation-ui
lib/pathseg.js
JavaScript
mit
55,189
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>type_mat4x3.hpp Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="logo.png"/></td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_934f46a345653ef2b3014a1b37a162c1.html">G:</a></li><li class="navelem"><a class="el" href="dir_bf513233250988b6ff3b72f8482c1597.html">Repository</a></li><li class="navelem"><a class="el" href="dir_e217bba5d90990da93f61f0ea8b942dc.html">glm</a></li><li class="navelem"><a class="el" href="dir_a844bf6d5a07b8853f8463b41029861e.html">glm</a></li><li class="navelem"><a class="el" href="dir_61748fa02e1156ca28a06d1638c8a86e.html">core</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">type_mat4x3.hpp</div> </div> </div><!--header--> <div class="contents"> <a href="a00106.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div> <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;</div> <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;</div> <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;</div> <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;</div> <div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;</div> <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;</div> <div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;</div> <div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;</div> <div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;</div> <div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;</div> <div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;</div> <div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;</div> <div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;</div> <div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;</div> <div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;</div> <div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div> <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div> <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div> <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;</div> <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div> <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div> <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div> <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div> <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;</div> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div> <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div> <div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div> <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#ifndef glm_core_type_mat4x3</span></div> <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define glm_core_type_mat4x3</span></div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00098.html" title="OpenGL Mathematics (glm.g-truc.net)">type_mat.hpp</a>&quot;</span></div> <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div> <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">namespace </span>glm{</div> <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">namespace </span>detail</div> <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;{</div> <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tvec1;</div> <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tvec2;</div> <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tvec3;</div> <div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tvec4;</div> <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tmat2x2;</div> <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tmat2x3;</div> <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tmat2x4;</div> <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tmat3x2;</div> <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tmat3x3;</div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tmat3x4;</div> <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tmat4x2;</div> <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tmat4x3;</div> <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span>tmat4x4;</div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keyword">struct </span>tmat4x3</div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; {</div> <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keyword">enum</span> ctor{null};</div> <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">typedef</span> T value_type;</div> <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keyword">typedef</span> std::size_t size_type;</div> <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keyword">typedef</span> tvec3&lt;T&gt; col_type;</div> <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keyword">typedef</span> tvec4&lt;T&gt; row_type;</div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keyword">typedef</span> tmat4x3&lt;T&gt; type;</div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keyword">typedef</span> tmat3x4&lt;T&gt; transpose_type;</div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keyword">static</span> GLM_FUNC_DECL size_type col_size();</div> <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keyword">static</span> GLM_FUNC_DECL size_type row_size();</div> <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div> <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; GLM_FUNC_DECL GLM_CONSTEXPR size_type <a class="code" href="a00131.html#ga282360c8bb80b80d3c7f5bc00766d873" title="Returns the length of x, i.e., sqrt(x * x).">length</a>() <span class="keyword">const</span>;</div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;</div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">private</span>:</div> <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="comment">// Data </span></div> <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; col_type value[4];</div> <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div> <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keyword">public</span>:</div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="comment">// Constructors</span></div> <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; GLM_FUNC_DECL tmat4x3();</div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; GLM_FUNC_DECL tmat4x3(tmat4x3 <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div> <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(</div> <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; ctor Null);</div> <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(</div> <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; value_type <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(</div> <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; value_type <span class="keyword">const</span> &amp; x0, value_type <span class="keyword">const</span> &amp; y0, value_type <span class="keyword">const</span> &amp; z0,</div> <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; value_type <span class="keyword">const</span> &amp; x1, value_type <span class="keyword">const</span> &amp; y1, value_type <span class="keyword">const</span> &amp; z1,</div> <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; value_type <span class="keyword">const</span> &amp; x2, value_type <span class="keyword">const</span> &amp; y2, value_type <span class="keyword">const</span> &amp; z2,</div> <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; value_type <span class="keyword">const</span> &amp; x3, value_type <span class="keyword">const</span> &amp; y3, value_type <span class="keyword">const</span> &amp; z3);</div> <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(</div> <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; col_type <span class="keyword">const</span> &amp; v0, </div> <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; col_type <span class="keyword">const</span> &amp; v1,</div> <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; col_type <span class="keyword">const</span> &amp; v2,</div> <div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; col_type <span class="keyword">const</span> &amp; v3);</div> <div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div> <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// Conversions</span></div> <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(</div> <div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; U <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;</div> <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keyword">template</span> &lt;</div> <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keyword">typename</span> X1, <span class="keyword">typename</span> Y1, <span class="keyword">typename</span> Z1, </div> <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keyword">typename</span> X2, <span class="keyword">typename</span> Y2, <span class="keyword">typename</span> Z2, </div> <div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keyword">typename</span> X3, <span class="keyword">typename</span> Y3, <span class="keyword">typename</span> Z3, </div> <div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keyword">typename</span> X4, <span class="keyword">typename</span> Y4, <span class="keyword">typename</span> Z4&gt; </div> <div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(</div> <div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; X1 <span class="keyword">const</span> &amp; x1, Y1 <span class="keyword">const</span> &amp; y1, Z1 <span class="keyword">const</span> &amp; z1, </div> <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; X2 <span class="keyword">const</span> &amp; x2, Y2 <span class="keyword">const</span> &amp; y2, Z2 <span class="keyword">const</span> &amp; z2, </div> <div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; X3 <span class="keyword">const</span> &amp; x3, Y3 <span class="keyword">const</span> &amp; y3, Z3 <span class="keyword">const</span> &amp; z3, </div> <div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; X4 <span class="keyword">const</span> &amp; x4, Y4 <span class="keyword">const</span> &amp; y4, Z4 <span class="keyword">const</span> &amp; z4);</div> <div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; </div> <div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> V1, <span class="keyword">typename</span> V2, <span class="keyword">typename</span> V3, <span class="keyword">typename</span> V4&gt; </div> <div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(</div> <div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; tvec3&lt;V1&gt; <span class="keyword">const</span> &amp; v1, </div> <div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; tvec3&lt;V2&gt; <span class="keyword">const</span> &amp; v2,</div> <div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; tvec3&lt;V3&gt; <span class="keyword">const</span> &amp; v3,</div> <div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; tvec3&lt;V4&gt; <span class="keyword">const</span> &amp; v4);</div> <div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;</div> <div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="comment">// Matrix conversions</span></div> <div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(tmat4x3&lt;U&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; </div> <div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(tmat2x2&lt;T&gt; <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(tmat3x3&lt;T&gt; <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(tmat4x4&lt;T&gt; <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(tmat2x3&lt;T&gt; <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(tmat3x2&lt;T&gt; <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(tmat2x4&lt;T&gt; <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(tmat4x2&lt;T&gt; <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; GLM_FUNC_DECL <span class="keyword">explicit</span> tmat4x3(tmat3x4&lt;T&gt; <span class="keyword">const</span> &amp; x);</div> <div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div> <div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">// Accesses</span></div> <div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; col_type &amp; operator[](size_type i);</div> <div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; col_type <span class="keyword">const</span> &amp; operator[](size_type i) <span class="keyword">const</span>;</div> <div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div> <div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">// Unary updatable operators</span></div> <div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator= (tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator= (tmat4x3&lt;U&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator+= (U <span class="keyword">const</span> &amp; s);</div> <div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator+= (tmat4x3&lt;U&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator-= (U <span class="keyword">const</span> &amp; s);</div> <div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator-= (tmat4x3&lt;U&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator*= (U <span class="keyword">const</span> &amp; s);</div> <div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator*= (tmat4x3&lt;U&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt; </div> <div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator/= (U <span class="keyword">const</span> &amp; s);</div> <div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;</div> <div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator++ ();</div> <div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; GLM_FUNC_DECL tmat4x3&lt;T&gt; &amp; operator-- ();</div> <div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; };</div> <div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;</div> <div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="comment">// Binary operators</span></div> <div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; tmat4x3&lt;T&gt; operator+ (</div> <div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m, </div> <div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::value_type <span class="keyword">const</span> &amp; s);</div> <div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div> <div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; tmat4x3&lt;T&gt; operator+ (</div> <div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m1, </div> <div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m2);</div> <div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;</div> <div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; tmat4x3&lt;T&gt; operator- (</div> <div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m, </div> <div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::value_type <span class="keyword">const</span> &amp; s);</div> <div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;</div> <div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; tmat4x3&lt;T&gt; operator- (</div> <div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m1, </div> <div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m2);</div> <div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div> <div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; tmat4x3&lt;T&gt; operator* (</div> <div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m, </div> <div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::value_type <span class="keyword">const</span> &amp; s);</div> <div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;</div> <div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; tmat4x3&lt;T&gt; operator* (</div> <div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::value_type <span class="keyword">const</span> &amp; s, </div> <div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;</div> <div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div> <div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::col_type operator* (</div> <div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m, </div> <div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::row_type <span class="keyword">const</span> &amp; v);</div> <div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div> <div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::row_type operator* (</div> <div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::col_type <span class="keyword">const</span> &amp; v, </div> <div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;</div> <div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; tmat2x3&lt;T&gt; operator* (</div> <div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m1, </div> <div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; tmat2x4&lt;T&gt; <span class="keyword">const</span> &amp; m2);</div> <div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;</div> <div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; tmat3x3&lt;T&gt; operator* (</div> <div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m1, </div> <div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; tmat3x4&lt;T&gt; <span class="keyword">const</span> &amp; m2);</div> <div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; </div> <div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div> <div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; tmat4x3&lt;T&gt; operator* (</div> <div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m1, </div> <div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; tmat4x4&lt;T&gt; <span class="keyword">const</span> &amp; m2);</div> <div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;</div> <div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; tmat4x3&lt;T&gt; operator/ (</div> <div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m, </div> <div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::value_type <span class="keyword">const</span> &amp; s);</div> <div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;</div> <div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; tmat4x3&lt;T&gt; operator/ (</div> <div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="keyword">typename</span> tmat4x3&lt;T&gt;::value_type <span class="keyword">const</span> &amp; s, </div> <div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;</div> <div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="comment">// Unary constant operators</span></div> <div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> operator- (</div> <div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m);</div> <div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;</div> <div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> operator-- (</div> <div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m, </div> <div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordtype">int</span>);</div> <div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;</div> <div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; </div> <div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> operator++ (</div> <div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; tmat4x3&lt;T&gt; <span class="keyword">const</span> &amp; m, </div> <div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="keywordtype">int</span>);</div> <div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;}<span class="comment">//namespace detail</span></div> <div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;</div> <div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;</div> <div class="line"><a name="l00245"></a><span class="lineno"><a class="code" href="a00143.html#ga0072cb659f9360a7bb2c3e6646609ad7"> 245</a></span>&#160; <span class="keyword">typedef</span> detail::tmat4x3&lt;lowp_float&gt; <a class="code" href="a00143.html#ga0072cb659f9360a7bb2c3e6646609ad7" title="4 columns of 3 components matrix of low precision floating-point numbers.">lowp_mat4x3</a>;</div> <div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;</div> <div class="line"><a name="l00252"></a><span class="lineno"><a class="code" href="a00143.html#ga236d4c1060c1ce9908d3de61b3d9334e"> 252</a></span>&#160; <span class="keyword">typedef</span> detail::tmat4x3&lt;mediump_float&gt; <a class="code" href="a00143.html#ga236d4c1060c1ce9908d3de61b3d9334e" title="4 columns of 3 components matrix of medium precision floating-point numbers.">mediump_mat4x3</a>;</div> <div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;</div> <div class="line"><a name="l00259"></a><span class="lineno"><a class="code" href="a00143.html#ga00d8bf8ebaab7d6647a3b7f73ae324af"> 259</a></span>&#160; <span class="keyword">typedef</span> detail::tmat4x3&lt;highp_float&gt; <a class="code" href="a00143.html#ga00d8bf8ebaab7d6647a3b7f73ae324af" title="4 columns of 3 components matrix of high precision floating-point numbers.">highp_mat4x3</a>;</div> <div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;</div> <div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;}<span class="comment">//namespace glm</span></div> <div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;</div> <div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="preprocessor">#ifndef GLM_EXTERNAL_TEMPLATE</span></div> <div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#include &quot;type_mat4x3.inl&quot;</span></div> <div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;<span class="preprocessor">#endif //GLM_EXTERNAL_TEMPLATE</span></div> <div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;<span class="preprocessor">#endif//glm_core_type_mat4x3</span></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.2 </small></address> </body> </html>
llq664301573/rubick
rubick/externals/glm/doc/api/a00106_source.html
HTML
mit
41,832
/* * classList.js: Cross-browser full element.classList implementation. * 1.1.20170427 * * By Eli Grey, http://eligrey.com * License: Dedicated to the public domain. * See https://github.com/eligrey/classList.js/blob/master/LICENSE.md */ /*global self, document, DOMException */ /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */ if ("document" in window.self) { // Full polyfill for browsers with no classList support // Including IE < Edge missing SVGElement.classList if (!("classList" in document.createElement("_")) || document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg","g"))) { (function (view) { "use strict"; if (!('Element' in view)) return; var classListProp = "classList" , protoProp = "prototype" , elemCtrProto = view.Element[protoProp] , objCtr = Object , strTrim = String[protoProp].trim || function () { return this.replace(/^\s+|\s+$/g, ""); } , arrIndexOf = Array[protoProp].indexOf || function (item) { var i = 0 , len = this.length ; for (; i < len; i++) { if (i in this && this[i] === item) { return i; } } return -1; } // Vendors: please allow content code to instantiate DOMExceptions , DOMEx = function (type, message) { this.name = type; this.code = DOMException[type]; this.message = message; } , checkTokenAndGetIndex = function (classList, token) { if (token === "") { throw new DOMEx( "SYNTAX_ERR" , "An invalid or illegal string was specified" ); } if (/\s/.test(token)) { throw new DOMEx( "INVALID_CHARACTER_ERR" , "String contains an invalid character" ); } return arrIndexOf.call(classList, token); } , ClassList = function (elem) { var trimmedClasses = strTrim.call(elem.getAttribute("class") || "") , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : [] , i = 0 , len = classes.length ; for (; i < len; i++) { this.push(classes[i]); } this._updateClassName = function () { elem.setAttribute("class", this.toString()); }; } , classListProto = ClassList[protoProp] = [] , classListGetter = function () { return new ClassList(this); } ; // Most DOMException implementations don't allow calling DOMException's toString() // on non-DOMExceptions. Error's toString() is sufficient here. DOMEx[protoProp] = Error[protoProp]; classListProto.item = function (i) { return this[i] || null; }; classListProto.contains = function (token) { token += ""; return checkTokenAndGetIndex(this, token) !== -1; }; classListProto.add = function () { var tokens = arguments , i = 0 , l = tokens.length , token , updated = false ; do { token = tokens[i] + ""; if (checkTokenAndGetIndex(this, token) === -1) { this.push(token); updated = true; } } while (++i < l); if (updated) { this._updateClassName(); } }; classListProto.remove = function () { var tokens = arguments , i = 0 , l = tokens.length , token , updated = false , index ; do { token = tokens[i] + ""; index = checkTokenAndGetIndex(this, token); while (index !== -1) { this.splice(index, 1); updated = true; index = checkTokenAndGetIndex(this, token); } } while (++i < l); if (updated) { this._updateClassName(); } }; classListProto.toggle = function (token, force) { token += ""; var result = this.contains(token) , method = result ? force !== true && "remove" : force !== false && "add" ; if (method) { this[method](token); } if (force === true || force === false) { return force; } else { return !result; } }; classListProto.toString = function () { return this.join(" "); }; if (objCtr.defineProperty) { var classListPropDesc = { get: classListGetter , enumerable: true , configurable: true }; try { objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); } catch (ex) { // IE 8 doesn't support enumerable:true // adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36 // modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected if (ex.number === undefined || ex.number === -0x7FF5EC54) { classListPropDesc.enumerable = false; objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); } } } else if (objCtr[protoProp].__defineGetter__) { elemCtrProto.__defineGetter__(classListProp, classListGetter); } }(window.self)); } // There is full or partial native classList support, so just check if we need // to normalize the add/remove and toggle APIs. (function () { "use strict"; var testElement = document.createElement("_"); testElement.classList.add("c1", "c2"); // Polyfill for IE 10/11 and Firefox <26, where classList.add and // classList.remove exist but support only one argument at a time. if (!testElement.classList.contains("c2")) { var createMethod = function(method) { var original = DOMTokenList.prototype[method]; DOMTokenList.prototype[method] = function(token) { var i, len = arguments.length; for (i = 0; i < len; i++) { token = arguments[i]; original.call(this, token); } }; }; createMethod('add'); createMethod('remove'); } testElement.classList.toggle("c3", false); // Polyfill for IE 10 and Firefox <24, where classList.toggle does not // support the second argument. if (testElement.classList.contains("c3")) { var _toggle = DOMTokenList.prototype.toggle; DOMTokenList.prototype.toggle = function(token, force) { if (1 in arguments && !this.contains(token) === !force) { return force; } else { return _toggle.call(this, token); } }; } testElement = null; }()); }
maxguillaume20/igem_wiki
node_modules/classlist-polyfill/src/index.js
JavaScript
mit
5,698
using Xunit; namespace AutoMapper.UnitTests.Bug { public class SubclassMappings : AutoMapperSpecBase { public class Source { public string Name { get; set; } } public class Destination { public string Name { get; set; } } public class SubDestination : Destination { public string SubName { get; set; } } protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg => { cfg.CreateMap<Source, Destination>(); }); [Fact] public void TestCase() { var source = new Source() { Name = "Test" }; var destination = new Destination(); Mapper.Map<Source, Destination>(source, destination); // Works var subDestination = new SubDestination(); Mapper.Map<Source, Destination>(source, subDestination); // Fails } } }
jbogard/AutoMapper
src/UnitTests/Bug/SubclassMappings.cs
C#
mit
1,034
.image_gallery { position: relative; max-width: 24em; margin: 5% auto; border: solid 0.5em rgb(30, 30, 30); background-color: rgb(30, 30, 30); overflow-x: hidden; } .thumbs { position: absolute; top: 1em; left: 1em; z-index: 10; } .thumbs label { display: inline-block; width: 3.5em; height: 3.5em; border: solid 0.2em rgb(30, 30, 30); overflow: hidden; } .thumbs label img { width: 100%; cursor: pointer; transition: transform 0.5s; opacity: 1; } .thumbs label:hover img { transform: scale(1.25); } .full_sized_images img { width: 100%; display: none; -webkit-animation: 1s scale-up-center; animation: 1s scale-up-center; /* ------ alternate transition ----------- */ /*animation: 1s slide-in-left;*/ } input[name="thumbs"]:checked + img { display: block; opacity: 1; } @-webkit-keyframes slide-in-left { 0% { display: block; opacity: 0; -webkit-transform: translateX(-100%); transform: translateX(-100%); } 100% { opacity: 1; -webkit-transform: translateX(0); transform: translateX(0) } } @keyframes slide-in-left { 0% { display: block; opacity: 0; -webkit-transform: translateX(-100%); transform: translateX(-100%); } 100% { opacity: 1; -webkit-transform: translateX(0); transform: translateX(0) } } @-webkit-keyframes scale-up-center { 0% { display: block; opacity: 0; -webkit-transform: scale(0.85); transform: scale(0.85); } 100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1) } } @keyframes scale-up-center { 0% { display: block; opacity: 0; -webkit-transform: scale(0.85); transform: scale(0.85); } 100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1) } } @media screen and (max-width: 360px) { .image_gallery { border: solid 0.2em rgb(30, 30, 30); background-color: rgb(30, 30, 30); } .thumbs { top: 0.5em; left: 0.5em; } .thumbs label { width: 2em; height: 2em; border: solid 0.1em rgb(30, 30, 30); } }
sbchittenden/BA-Demos
Mastering-the-DOM/project-2/css/old/image_gallery.css
CSS
mit
2,095
using System; using System.Xml.Serialization; using System.Collections.Generic; namespace Aop.Api.Domain { /// <summary> /// InvoiceModelContent Data Structure. /// </summary> [Serializable] public class InvoiceModelContent : AopObject { /// <summary> /// key=value,每组键值对以回车分割 /// </summary> [XmlElement("extend_fields")] public string ExtendFields { get; set; } /// <summary> /// 下载的发票文件类型 可选值: pdf(发票原文件) jpg(发票原文件缩略图) /// </summary> [XmlElement("file_download_type")] public string FileDownloadType { get; set; } /// <summary> /// 文件下载地址,当同步发票tax_type=PLAIN时,必传; 此处的链接请务必传入可下载PDF的链接 /// </summary> [XmlElement("file_download_url")] public string FileDownloadUrl { get; set; } /// <summary> /// 发票金额,大于0且精确到小数点两位,以元为单位 需要传入税价合计金额 /// </summary> [XmlElement("invoice_amount")] public string InvoiceAmount { get; set; } /// <summary> /// 发票代码,国税局生成的唯一值,不可为空串 /// </summary> [XmlElement("invoice_code")] public string InvoiceCode { get; set; } /// <summary> /// 发票内容项 /// </summary> [XmlArray("invoice_content")] [XmlArrayItem("invoice_item_content")] public List<InvoiceItemContent> InvoiceContent { get; set; } /// <summary> /// 发票日期,用户填写,目前精确到日 /// </summary> [XmlElement("invoice_date")] public string InvoiceDate { get; set; } /// <summary> /// 发票防伪码 /// </summary> [XmlElement("invoice_fake_code")] public string InvoiceFakeCode { get; set; } /// <summary> /// 原始发票PDF文件流 /// </summary> [XmlElement("invoice_file_data")] public string InvoiceFileData { get; set; } /// <summary> /// 发票原始文件jpg文件地址 /// </summary> [XmlElement("invoice_img_url")] public string InvoiceImgUrl { get; set; } /// <summary> /// 发票号码,国税局生成的唯一号码,不可为空串; 使用时请注意,invoice_no+invoice_code唯一,不能重复 /// </summary> [XmlElement("invoice_no")] public string InvoiceNo { get; set; } /// <summary> /// 发票开具操作人 /// </summary> [XmlElement("invoice_operator")] public string InvoiceOperator { get; set; } /// <summary> /// 发票title /// </summary> [XmlElement("invoice_title")] public InvoiceTitleModel InvoiceTitle { get; set; } /// <summary> /// 发票类型,按照可选值只传入英文部分,该字段严格要求大小写 可选值: blue(蓝票) red(红票) /// </summary> [XmlElement("invoice_type")] public string InvoiceType { get; set; } /// <summary> /// 仅用于同步红票,原始蓝票发票代码,同步红票时必传 /// </summary> [XmlElement("original_blue_invoice_code")] public string OriginalBlueInvoiceCode { get; set; } /// <summary> /// 仅用于同步红票,原始蓝票发票号码,同步红票时必传 /// </summary> [XmlElement("original_blue_invoice_no")] public string OriginalBlueInvoiceNo { get; set; } /// <summary> /// 商户交易流水号,不可为空串; 传入红票时请注意,此字段的值要和蓝票保持一致 /// </summary> [XmlElement("out_biz_no")] public string OutBizNo { get; set; } /// <summary> /// 商户唯一开票申请业务流水号,同一个isv下不能重复 /// </summary> [XmlElement("out_invoice_id")] public string OutInvoiceId { get; set; } /// <summary> /// 开票单位地址 /// </summary> [XmlElement("register_address")] public string RegisterAddress { get; set; } /// <summary> /// 开票单位开户行账号 /// </summary> [XmlElement("register_bank_account")] public string RegisterBankAccount { get; set; } /// <summary> /// 开票单位开户行名称 /// </summary> [XmlElement("register_bank_name")] public string RegisterBankName { get; set; } /// <summary> /// 开票单位 /// </summary> [XmlElement("register_name")] public string RegisterName { get; set; } /// <summary> /// 纳税人识别号,不可为空串 /// </summary> [XmlElement("register_no")] public string RegisterNo { get; set; } /// <summary> /// 开票人电话,支持座机和手机两种格式 /// </summary> [XmlElement("register_phone_no")] public string RegisterPhoneNo { get; set; } /// <summary> /// 价税合计 /// </summary> [XmlElement("sum_amount")] public string SumAmount { get; set; } /// <summary> /// 税额 /// </summary> [XmlElement("tax_amount")] public string TaxAmount { get; set; } /// <summary> /// 税种 可选值: PLAIN(普票的情况) SPECIAL(专票的情况) /// </summary> [XmlElement("tax_type")] public string TaxType { get; set; } /// <summary> /// 支付宝用户id,当同步的是蓝票时,必传。红票时不需传。 /// </summary> [XmlElement("user_id")] public string UserId { get; set; } } }
erikzhouxin/CSharpSolution
OSS/Alipay/AopSdk/Domain/InvoiceModelContent.cs
C#
mit
6,017
import InvalidError from "ember-data/system/model/errors/invalid"; /** @module ember-data */ var get = Ember.get; /** An adapter is an object that receives requests from a store and translates them into the appropriate action to take against your persistence layer. The persistence layer is usually an HTTP API, but may be anything, such as the browser's local storage. Typically the adapter is not invoked directly instead its functionality is accessed through the `store`. ### Creating an Adapter Create a new subclass of `DS.Adapter`, then assign it to the `ApplicationAdapter` property of the application. ```javascript var MyAdapter = DS.Adapter.extend({ // ...your code here }); App.ApplicationAdapter = MyAdapter; ``` Model-specific adapters can be created by assigning your adapter class to the `ModelName` + `Adapter` property of the application. ```javascript var MyPostAdapter = DS.Adapter.extend({ // ...Post-specific adapter code goes here }); App.PostAdapter = MyPostAdapter; ``` `DS.Adapter` is an abstract base class that you should override in your application to customize it for your backend. The minimum set of methods that you should implement is: * `find()` * `createRecord()` * `updateRecord()` * `deleteRecord()` * `findAll()` * `findQuery()` To improve the network performance of your application, you can optimize your adapter by overriding these lower-level methods: * `findMany()` For an example implementation, see `DS.RESTAdapter`, the included REST adapter. @class Adapter @namespace DS @extends Ember.Object */ var Adapter = Ember.Object.extend({ /** If you would like your adapter to use a custom serializer you can set the `defaultSerializer` property to be the name of the custom serializer. Note the `defaultSerializer` serializer has a lower priority than a model specific serializer (i.e. `PostSerializer`) or the `application` serializer. ```javascript var DjangoAdapter = DS.Adapter.extend({ defaultSerializer: 'django' }); ``` @property defaultSerializer @type {String} */ /** The `find()` method is invoked when the store is asked for a record that has not previously been loaded. In response to `find()` being called, you should query your persistence layer for a record with the given ID. Once found, you can asynchronously call the store's `push()` method to push the record into the store. Here is an example `find` implementation: ```javascript App.ApplicationAdapter = DS.Adapter.extend({ find: function(store, type, id, snapshot) { var url = [type.modelName, id].join('/'); return new Ember.RSVP.Promise(function(resolve, reject) { jQuery.getJSON(url).then(function(data) { Ember.run(null, resolve, data); }, function(jqXHR) { jqXHR.then = null; // tame jQuery's ill mannered promises Ember.run(null, reject, jqXHR); }); }); } }); ``` @method find @param {DS.Store} store @param {subclass of DS.Model} type @param {String} id @param {DS.Snapshot} snapshot @return {Promise} promise */ find: null, /** The `findAll()` method is called when you call `find` on the store without an ID (i.e. `store.find('post')`). Example ```javascript App.ApplicationAdapter = DS.Adapter.extend({ findAll: function(store, type, sinceToken) { var url = type; var query = { since: sinceToken }; return new Ember.RSVP.Promise(function(resolve, reject) { jQuery.getJSON(url, query).then(function(data) { Ember.run(null, resolve, data); }, function(jqXHR) { jqXHR.then = null; // tame jQuery's ill mannered promises Ember.run(null, reject, jqXHR); }); }); } }); ``` @private @method findAll @param {DS.Store} store @param {subclass of DS.Model} type @param {String} sinceToken @return {Promise} promise */ findAll: null, /** This method is called when you call `find` on the store with a query object as the second parameter (i.e. `store.find('person', { page: 1 })`). Example ```javascript App.ApplicationAdapter = DS.Adapter.extend({ findQuery: function(store, type, query) { var url = type; return new Ember.RSVP.Promise(function(resolve, reject) { jQuery.getJSON(url, query).then(function(data) { Ember.run(null, resolve, data); }, function(jqXHR) { jqXHR.then = null; // tame jQuery's ill mannered promises Ember.run(null, reject, jqXHR); }); }); } }); ``` @private @method findQuery @param {DS.Store} store @param {subclass of DS.Model} type @param {Object} query @param {DS.AdapterPopulatedRecordArray} recordArray @return {Promise} promise */ findQuery: null, /** If the globally unique IDs for your records should be generated on the client, implement the `generateIdForRecord()` method. This method will be invoked each time you create a new record, and the value returned from it will be assigned to the record's `primaryKey`. Most traditional REST-like HTTP APIs will not use this method. Instead, the ID of the record will be set by the server, and your adapter will update the store with the new ID when it calls `didCreateRecord()`. Only implement this method if you intend to generate record IDs on the client-side. The `generateIdForRecord()` method will be invoked with the requesting store as the first parameter and the newly created record as the second parameter: ```javascript generateIdForRecord: function(store, inputProperties) { var uuid = App.generateUUIDWithStatisticallyLowOddsOfCollision(); return uuid; } ``` @method generateIdForRecord @param {DS.Store} store @param {subclass of DS.Model} type the DS.Model class of the record @param {Object} inputProperties a hash of properties to set on the newly created record. @return {String|Number} id */ generateIdForRecord: null, /** Proxies to the serializer's `serialize` method. Example ```javascript App.ApplicationAdapter = DS.Adapter.extend({ createRecord: function(store, type, snapshot) { var data = this.serialize(snapshot, { includeId: true }); var url = type; // ... } }); ``` @method serialize @param {DS.Snapshot} snapshot @param {Object} options @return {Object} serialized snapshot */ serialize: function(snapshot, options) { return get(snapshot.record, 'store').serializerFor(snapshot.modelName).serialize(snapshot, options); }, /** Implement this method in a subclass to handle the creation of new records. Serializes the record and send it to the server. Example ```javascript App.ApplicationAdapter = DS.Adapter.extend({ createRecord: function(store, type, snapshot) { var data = this.serialize(snapshot, { includeId: true }); var url = type; return new Ember.RSVP.Promise(function(resolve, reject) { jQuery.ajax({ type: 'POST', url: url, dataType: 'json', data: data }).then(function(data) { Ember.run(null, resolve, data); }, function(jqXHR) { jqXHR.then = null; // tame jQuery's ill mannered promises Ember.run(null, reject, jqXHR); }); }); } }); ``` @method createRecord @param {DS.Store} store @param {subclass of DS.Model} type the DS.Model class of the record @param {DS.Snapshot} snapshot @return {Promise} promise */ createRecord: null, /** Implement this method in a subclass to handle the updating of a record. Serializes the record update and send it to the server. Example ```javascript App.ApplicationAdapter = DS.Adapter.extend({ updateRecord: function(store, type, snapshot) { var data = this.serialize(snapshot, { includeId: true }); var id = snapshot.id; var url = [type, id].join('/'); return new Ember.RSVP.Promise(function(resolve, reject) { jQuery.ajax({ type: 'PUT', url: url, dataType: 'json', data: data }).then(function(data) { Ember.run(null, resolve, data); }, function(jqXHR) { jqXHR.then = null; // tame jQuery's ill mannered promises Ember.run(null, reject, jqXHR); }); }); } }); ``` @method updateRecord @param {DS.Store} store @param {subclass of DS.Model} type the DS.Model class of the record @param {DS.Snapshot} snapshot @return {Promise} promise */ updateRecord: null, /** Implement this method in a subclass to handle the deletion of a record. Sends a delete request for the record to the server. Example ```javascript App.ApplicationAdapter = DS.Adapter.extend({ deleteRecord: function(store, type, snapshot) { var data = this.serialize(snapshot, { includeId: true }); var id = snapshot.id; var url = [type, id].join('/'); return new Ember.RSVP.Promise(function(resolve, reject) { jQuery.ajax({ type: 'DELETE', url: url, dataType: 'json', data: data }).then(function(data) { Ember.run(null, resolve, data); }, function(jqXHR) { jqXHR.then = null; // tame jQuery's ill mannered promises Ember.run(null, reject, jqXHR); }); }); } }); ``` @method deleteRecord @param {DS.Store} store @param {subclass of DS.Model} type the DS.Model class of the record @param {DS.Snapshot} snapshot @return {Promise} promise */ deleteRecord: null, /** By default the store will try to coalesce all `fetchRecord` calls within the same runloop into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call. You can opt out of this behaviour by either not implementing the findMany hook or by setting coalesceFindRequests to false @property coalesceFindRequests @type {boolean} */ coalesceFindRequests: true, /** Find multiple records at once if coalesceFindRequests is true @method findMany @param {DS.Store} store @param {subclass of DS.Model} type the DS.Model class of the records @param {Array} ids @param {Array} snapshots @return {Promise} promise */ /** Organize records into groups, each of which is to be passed to separate calls to `findMany`. For example, if your api has nested URLs that depend on the parent, you will want to group records by their parent. The default implementation returns the records as a single group. @method groupRecordsForFindMany @param {DS.Store} store @param {Array} snapshots @return {Array} an array of arrays of records, each of which is to be loaded separately by `findMany`. */ groupRecordsForFindMany: function(store, snapshots) { return [snapshots]; } }); export { InvalidError, Adapter }; export default Adapter;
funtusov/data
packages/ember-data/lib/system/adapter.js
JavaScript
mit
11,614
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Class exception</title> <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Contract 1.0.0"> <link rel="up" href="../../reference.html#header.boost.contract.core.exception_hpp" title="Header &lt;boost/contract/core/exception.hpp&gt;"> <link rel="prev" href="constructor_precondition.html" title="Class template constructor_precondition"> <link rel="next" href="bad_virtual_result_cast.html" title="Class bad_virtual_result_cast"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> <td align="center"><a href="../../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="constructor_precondition.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html#header.boost.contract.core.exception_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="bad_virtual_result_cast.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="refentry"> <a name="boost.contract.exception"></a><div class="titlepage"></div> <div class="refnamediv"> <h2><span class="refentrytitle">Class exception</span></h2> <p>boost::contract::exception &#8212; Public base class for all exceptions directly thrown by this library. </p> </div> <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../reference.html#header.boost.contract.core.exception_hpp" title="Header &lt;boost/contract/core/exception.hpp&gt;">boost/contract/core/exception.hpp</a>&gt; </span> <span class="keyword">class</span> <a class="link" href="exception.html" title="Class exception">exception</a> <span class="special">{</span> <span class="keyword">public</span><span class="special">:</span> <span class="comment">// <a class="link" href="exception.html#boost.contract.exceptionconstruct-copy-destruct">construct/copy/destruct</a></span> <a class="link" href="exception.html#idp44528528-bb"><span class="special">~</span><span class="identifier">exception</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> <span class="special">}</span><span class="special">;</span></pre></div> <div class="refsect1"> <a name="idp99316400"></a><h2>Description</h2> <p>This class does not inherit from <code class="computeroutput">std::exception</code> because exceptions deriving from this class will do that (inheriting from <code class="computeroutput">std::exception</code>, <code class="computeroutput">std::bad_cast</code>, etc.).</p> <p><span class="bold"><strong>See Also:</strong></span></p> <p> <code class="computeroutput"><a class="link" href="assertion_failure.html" title="Class assertion_failure">boost::contract::assertion_failure</a></code>, <code class="computeroutput"><a class="link" href="bad_virtual_result_cast.html" title="Class bad_virtual_result_cast">boost::contract::bad_virtual_result_cast</a></code>, etc. </p> <p> </p> <div class="refsect2"> <a name="idp99323008"></a><h3> <a name="boost.contract.exceptionconstruct-copy-destruct"></a><code class="computeroutput">exception</code> public construct/copy/destruct</h3> <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> <pre class="literallayout"><a name="idp44528528-bb"></a><span class="special">~</span><span class="identifier">exception</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Destruct this object. <p><span class="bold"><strong>Throws:</strong></span> This is declared <code class="computeroutput">noexcept</code> (or <code class="computeroutput">throw()</code> before C++11). </p> </li></ol></div> </div> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2008-2018 Lorenzo Caminiti<p> Distributed under the Boost Software License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="constructor_precondition.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html#header.boost.contract.core.exception_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="bad_virtual_result_cast.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
alexhenrie/poedit
deps/boost/libs/contract/doc/html/boost/contract/exception.html
HTML
mit
5,850
<html lang="en"><head></head><body><form id="mainForm" method="post" action="http://plnkr.co/edit/?p=preview" target="_self"><input type="hidden" name="files[app/app.module.ts]" value="import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { TodoAppComponent } from './todo_app'; import { TodoListComponent } from './todo_list'; import { TodoFormComponent } from './todo_form'; @NgModule({ imports: [ BrowserModule, FormsModule ], declarations: [ TodoAppComponent, TodoListComponent, TodoFormComponent ], bootstrap: [ TodoAppComponent ] }) export class AppModule { } /* Copyright 2016 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license */"><input type="hidden" name="files[app/todo_app.ts]" value="import { Component } from '@angular/core'; import { Todo } from './todo'; @Component({ selector: 'todo-app', template: ` <h2>Todo</h2> <span>{{remaining}} of {{todos.length}} remaining</span> [ <a (click)=&quot;archive()&quot;>archive</a> ] <todo-list [todos]=&quot;todos&quot;></todo-list> <todo-form (newTask)=&quot;addTask($event)&quot;></todo-form>`, styles: ['a { cursor: pointer; cursor: hand; }'] }) export class TodoAppComponent { todos: Todo[] = [ {text: 'learn angular', done: true}, {text: 'build an angular app', done: false} ]; get remaining() { return this.todos.filter(todo => !todo.done).length; } archive(): void { let oldTodos = this.todos; this.todos = []; oldTodos.forEach(todo => { if (!todo.done) { this.todos.push(todo); } }); } addTask(task: Todo) { this.todos.push(task); } } /* Copyright 2016 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license */"><input type="hidden" name="files[app/todo_form.ts]" value="import { Component, Output, EventEmitter } from '@angular/core'; import { Todo } from './todo'; @Component({ selector: 'todo-form', template: ` <form (ngSubmit)=&quot;addTodo()&quot;> <input type=&quot;text&quot; [(ngModel)]=&quot;task&quot; size=&quot;30&quot; placeholder=&quot;add new todo here&quot;> <input class=&quot;btn-primary&quot; type=&quot;submit&quot; value=&quot;add&quot;> </form>` }) export class TodoFormComponent { @Output() newTask = new EventEmitter<Todo>(); task: string = ''; addTodo() { if (this.task) { this.newTask.emit({text: this.task, done: false}); } this.task = ''; } } /* Copyright 2016 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license */"><input type="hidden" name="files[app/todo_list.ts]" value="import { Component, Input } from '@angular/core'; import { Todo } from './todo'; @Component({ selector: 'todo-list', styles: [` .done-true { text-decoration: line-through; color: grey; }` ], template: ` <ul class=&quot;list-unstyled&quot;> <li *ngFor=&quot;let todo of todos&quot;> <input type=&quot;checkbox&quot; [(ngModel)]=&quot;todo.done&quot;> <span class=&quot;done-{{todo.done}}&quot;>{{todo.text}}</span> </li> </ul>` }) export class TodoListComponent { @Input() todos: Todo[]; } /* Copyright 2016 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license */"><input type="hidden" name="files[app/todo.ts]" value="// Declare an interaface for type safety export interface Todo { text: string; done: boolean; } /* Copyright 2016 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license */"><input type="hidden" name="files[main.ts]" value="import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; platformBrowserDynamic().bootstrapModule(AppModule); /* Copyright 2016 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license */"><input type="hidden" name="files[styles.css]" value="/* Master Styles */ h1 { color: #369; font-family: Arial, Helvetica, sans-serif; font-size: 250%; } h2, h3 { color: #444; font-family: Arial, Helvetica, sans-serif; font-weight: lighter; } body { margin: 2em; } body, input[text], button { color: #888; font-family: Cambria, Georgia; } a { cursor: pointer; cursor: hand; } button { font-family: Arial; background-color: #eee; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; cursor: hand; } button:hover { background-color: #cfd8dc; } button:disabled { background-color: #eee; color: #aaa; cursor: auto; } /* Navigation link styles */ nav a { padding: 5px 10px; text-decoration: none; margin-right: 10px; margin-top: 10px; display: inline-block; background-color: #eee; border-radius: 4px; } nav a:visited, a:link { color: #607D8B; } nav a:hover { color: #039be5; background-color: #CFD8DC; } nav a.active { color: #039be5; } /* items class */ .items { margin: 0 0 2em 0; list-style-type: none; padding: 0; width: 24em; } .items li { cursor: pointer; position: relative; left: 0; background-color: #EEE; margin: .5em; padding: .3em 0; height: 1.6em; border-radius: 4px; } .items li:hover { color: #607D8B; background-color: #DDD; left: .1em; } .items li.selected { background-color: #CFD8DC; color: white; } .items li.selected:hover { background-color: #BBD8DC; } .items .text { position: relative; top: -3px; } .items .badge { display: inline-block; font-size: small; color: white; padding: 0.8em 0.7em 0 0.7em; background-color: #607D8B; line-height: 1em; position: relative; left: -1px; top: -4px; height: 1.8em; margin-right: .8em; border-radius: 4px 0 0 4px; } /* everywhere else */ * { font-family: Arial, Helvetica, sans-serif; } /* Copyright 2016 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license */"><input type="hidden" name="files[index.html]" value="<!DOCTYPE html> <html> <head> <title>Angular Todos</title> <script>document.write('<base href=&quot;' + document.location + '&quot; />');</script> <meta charset=&quot;UTF-8&quot;> <meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;> <link rel=&quot;stylesheet&quot; href=&quot;https://unpkg.com/bootstrap@3.3.7/dist/css/bootstrap.min.css&quot;> <link rel=&quot;stylesheet&quot; href=&quot;styles.css&quot;> <!-- Polyfills --> <script src=&quot;https://unpkg.com/core-js/client/shim.min.js&quot;></script> <script src=&quot;https://unpkg.com/zone.js@0.7.4?main=browser&quot;></script> <script src=&quot;https://unpkg.com/systemjs@0.19.39/dist/system.src.js&quot;></script> <script src=&quot;https://cdn.rawgit.com/angular/angular.io/b3c65a9/public/docs/_examples/_boilerplate/systemjs.config.web.js&quot;></script> <script> System.import('main.js').catch(function(err){ console.error(err); }); </script> </head> <!-- Display the application --> <body> <todo-app class=&quot;container&quot; style=&quot;display: block&quot;>Loading...</todo-app> </body> </html> <!-- Copyright 2016 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license -->"><input type="hidden" name="tags[0]" value="angular"><input type="hidden" name="tags[1]" value="example"><input type="hidden" name="private" value="true"><input type="hidden" name="description" value="Angular Example - Todo"></form><script>document.getElementById("mainForm").submit();</script></body></html>
SaltyDH/angular
aio/content/examples/homepage-todo/ts/plnkr.no-link.html
HTML
mit
8,288
/**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org http://www.cocos2d-x.org 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. ****************************************************************************/ #include "CCUserDefault.h" #include "platform/CCCommon.h" #include "platform/CCFileUtils.h" #include <libxml/parser.h> #include <libxml/tree.h> // root name of xml #define USERDEFAULT_ROOT_NAME "userDefaultRoot" #define XML_FILE_NAME "UserDefault.xml" using namespace std; NS_CC_BEGIN static xmlDocPtr g_sharedDoc = NULL; /** * define the functions here because we don't want to * export xmlNodePtr and other types in "CCUserDefault.h" */ static xmlNodePtr getXMLNodeForKey(const char* pKey, xmlNodePtr *rootNode) { xmlNodePtr curNode = NULL; // check the key value if (! pKey) { return NULL; } do { // get root node *rootNode = xmlDocGetRootElement(g_sharedDoc); if (NULL == *rootNode) { CCLOG("read root node error"); break; } // find the node curNode = (*rootNode)->xmlChildrenNode; while (NULL != curNode) { if (! xmlStrcmp(curNode->name, BAD_CAST pKey)) { break; } curNode = curNode->next; } } while (0); return curNode; } static inline const char* getValueForKey(const char* pKey) { const char* ret = NULL; xmlNodePtr rootNode; xmlNodePtr node = getXMLNodeForKey(pKey, &rootNode); // find the node if (node) { ret = (const char*)xmlNodeGetContent(node); } return ret; } static void setValueForKey(const char* pKey, const char* pValue) { xmlNodePtr rootNode; xmlNodePtr node; // check the params if (! pKey || ! pValue) { return; } // find the node node = getXMLNodeForKey(pKey, &rootNode); // if node exist, change the content if (node) { xmlNodeSetContent(node, BAD_CAST pValue); } else { if (rootNode) { // the node doesn't exist, add a new one // libxml in android doesn't support xmlNewTextChild, so use this approach xmlNodePtr tmpNode = xmlNewNode(NULL, BAD_CAST pKey); xmlNodePtr content = xmlNewText(BAD_CAST pValue); xmlAddChild(rootNode, tmpNode); xmlAddChild(tmpNode, content); } } } /** * implements of CCUserDefault */ CCUserDefault* CCUserDefault::m_spUserDefault = 0; string CCUserDefault::m_sFilePath = string(""); bool CCUserDefault::m_sbIsFilePathInitialized = false; /** * If the user invoke delete CCUserDefault::sharedUserDefault(), should set m_spUserDefault * to null to avoid error when he invoke CCUserDefault::sharedUserDefault() later. */ CCUserDefault::~CCUserDefault() { flush(); if (g_sharedDoc) { xmlFreeDoc(g_sharedDoc); g_sharedDoc = NULL; } m_spUserDefault = NULL; } CCUserDefault::CCUserDefault() { g_sharedDoc = xmlReadFile(getXMLFilePath().c_str(), "utf-8", XML_PARSE_RECOVER); } void CCUserDefault::purgeSharedUserDefault() { CC_SAFE_DELETE(m_spUserDefault); m_spUserDefault = NULL; } bool CCUserDefault::getBoolForKey(const char* pKey, bool defaultValue) { const char* value = getValueForKey(pKey); bool ret = defaultValue; if (value) { ret = (! strcmp(value, "true")); xmlFree((void*)value); } return ret; } int CCUserDefault::getIntegerForKey(const char* pKey, int defaultValue) { const char* value = getValueForKey(pKey); int ret = defaultValue; if (value) { ret = atoi(value); xmlFree((void*)value); } return ret; } float CCUserDefault::getFloatForKey(const char* pKey, float defaultValue) { float ret = (float)getDoubleForKey(pKey, (double)defaultValue); return ret; } double CCUserDefault::getDoubleForKey(const char* pKey, double defaultValue) { const char* value = getValueForKey(pKey); double ret = defaultValue; if (value) { ret = atof(value); xmlFree((void*)value); } return ret; } string CCUserDefault::getStringForKey(const char* pKey, const std::string & defaultValue) { const char* value = getValueForKey(pKey); string ret = defaultValue; if (value) { ret = string(value); xmlFree((void*)value); } return ret; } void CCUserDefault::setBoolForKey(const char* pKey, bool value) { // save bool value as string if (true == value) { setStringForKey(pKey, "true"); } else { setStringForKey(pKey, "false"); } } void CCUserDefault::setIntegerForKey(const char* pKey, int value) { // check key if (! pKey) { return; } // format the value char tmp[50]; memset(tmp, 0, 50); sprintf(tmp, "%d", value); setValueForKey(pKey, tmp); } void CCUserDefault::setFloatForKey(const char* pKey, float value) { setDoubleForKey(pKey, value); } void CCUserDefault::setDoubleForKey(const char* pKey, double value) { // check key if (! pKey) { return; } // format the value char tmp[50]; memset(tmp, 0, 50); sprintf(tmp, "%f", value); setValueForKey(pKey, tmp); } void CCUserDefault::setStringForKey(const char* pKey, const std::string & value) { // check key if (! pKey) { return; } setValueForKey(pKey, value.c_str()); } CCUserDefault* CCUserDefault::sharedUserDefault() { initXMLFilePath(); // only create xml file one time // the file exists after the program exit if ((! isXMLFileExist()) && (! createXMLFile())) { return NULL; } if (! m_spUserDefault) { m_spUserDefault = new CCUserDefault(); } return m_spUserDefault; } bool CCUserDefault::isXMLFileExist() { FILE *fp = fopen(m_sFilePath.c_str(), "r"); bool bRet = false; if (fp) { bRet = true; fclose(fp); } return bRet; } void CCUserDefault::initXMLFilePath() { if (! m_sbIsFilePathInitialized) { m_sFilePath += CCFileUtils::sharedFileUtils()->getWriteablePath() + XML_FILE_NAME; m_sbIsFilePathInitialized = true; } } // create new xml file bool CCUserDefault::createXMLFile() { bool bRet = false; xmlDocPtr doc = NULL; do { // new doc doc = xmlNewDoc(BAD_CAST"1.0"); if (doc == NULL) { CCLOG("can not create xml doc"); break; } // new root node xmlNodePtr rootNode = xmlNewNode(NULL, BAD_CAST USERDEFAULT_ROOT_NAME); if (rootNode == NULL) { CCLOG("can not create root node"); break; } // set root node xmlDocSetRootElement(doc, rootNode); // save xml file xmlSaveFile(m_sFilePath.c_str(), doc); bRet = true; } while (0); // if doc is not null, free it if (doc) { xmlFreeDoc(doc); } return bRet; } const string& CCUserDefault::getXMLFilePath() { return m_sFilePath; } void CCUserDefault::flush() { // save to file if (g_sharedDoc) { xmlSaveFile(CCUserDefault::sharedUserDefault()->getXMLFilePath().c_str(), g_sharedDoc); } } NS_CC_END
9tong/ScaleMap
PGMap/libs/cocos2dx/support/CCUserDefault.cpp
C++
mit
8,433
#include "vpn-ws.h" uint16_t vpn_ws_be16(uint8_t *buf) { uint16_t *src = (uint16_t *) buf; uint16_t ret = 0; uint8_t *ptr = (uint8_t *) & ret; ptr[0] = (uint8_t) ((*src >> 8) & 0xff); ptr[1] = (uint8_t) (*src & 0xff); return ret; } uint16_t vpn_ws_le16(uint8_t *buf) { uint16_t *src = (uint16_t *) buf; uint16_t ret = 0; uint8_t *ptr = (uint8_t *) & ret; ptr[0] = (uint8_t) (*src & 0xff); ptr[1] = (uint8_t) ((*src >> 8) & 0xff); return ret; } uint64_t vpn_ws_be64(uint8_t *buf) { uint64_t *src = (uint64_t *) buf; uint64_t ret = 0; uint8_t *ptr = (uint8_t *) & ret; ptr[0] = (uint8_t) ((*src >> 56) & 0xff); ptr[1] = (uint8_t) ((*src >> 48) & 0xff); ptr[2] = (uint8_t) ((*src >> 40) & 0xff); ptr[3] = (uint8_t) ((*src >> 32) & 0xff); ptr[4] = (uint8_t) ((*src >> 24) & 0xff); ptr[5] = (uint8_t) ((*src >> 16) & 0xff); ptr[6] = (uint8_t) ((*src >> 8) & 0xff); ptr[7] = (uint8_t) (*src & 0xff); return ret; }
faint32/vpn-ws
src/bits.c
C
mit
1,091
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>const_buffers_1::const_iterator</title> <link rel="stylesheet" href="../../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> <link rel="home" href="../../../index.html" title="Asio"> <link rel="up" href="../const_buffers_1.html" title="const_buffers_1"> <link rel="prev" href="const_buffers_1/overload2.html" title="const_buffers_1::const_buffers_1 (2 of 2 overloads)"> <link rel="next" href="end.html" title="const_buffers_1::end"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../../asio.png"></td></tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="const_buffers_1/overload2.html"><img src="../../../prev.png" alt="Prev"></a><a accesskey="u" href="../const_buffers_1.html"><img src="../../../up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../home.png" alt="Home"></a><a accesskey="n" href="end.html"><img src="../../../next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="asio.reference.const_buffers_1.const_iterator"></a><a class="link" href="const_iterator.html" title="const_buffers_1::const_iterator">const_buffers_1::const_iterator</a> </h4></div></div></div> <p> <a class="indexterm" name="idm106043"></a> A random-access iterator type that may be used to read elements. </p> <pre class="programlisting"><span class="keyword">typedef</span> <span class="keyword">const</span> <span class="identifier">const_buffer</span> <span class="special">*</span> <span class="identifier">const_iterator</span><span class="special">;</span> </pre> <h6> <a name="asio.reference.const_buffers_1.const_iterator.h0"></a> <span><a name="asio.reference.const_buffers_1.const_iterator.requirements"></a></span><a class="link" href="const_iterator.html#asio.reference.const_buffers_1.const_iterator.requirements">Requirements</a> </h6> <p> <span class="emphasis"><em>Header: </em></span><code class="literal">asio/buffer.hpp</code> </p> <p> <span class="emphasis"><em>Convenience header: </em></span><code class="literal">asio.hpp</code> </p> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2016 Christopher M. Kohlhoff<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="const_buffers_1/overload2.html"><img src="../../../prev.png" alt="Prev"></a><a accesskey="u" href="../const_buffers_1.html"><img src="../../../up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../home.png" alt="Home"></a><a accesskey="n" href="end.html"><img src="../../../next.png" alt="Next"></a> </div> </body> </html>
peersio/peerconnect
src/libs/asio/doc/asio/reference/const_buffers_1/const_iterator.html
HTML
mit
3,334
package gocty import ( "fmt" "math/big" "reflect" "testing" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/set" ) func TestIn(t *testing.T) { capsuleANative := &capsuleType1Native{"capsuleA"} tests := []struct { GoValue interface{} Type cty.Type Want cty.Value }{ // Bool { GoValue: true, Type: cty.Bool, Want: cty.True, }, { GoValue: (*bool)(nil), Type: cty.Bool, Want: cty.NullVal(cty.Bool), }, { GoValue: ptrToBool(true), Type: cty.Bool, Want: cty.True, }, // String { GoValue: "hello", Type: cty.String, Want: cty.StringVal("hello"), }, { GoValue: ptrToString("hello"), Type: cty.String, Want: cty.StringVal("hello"), }, { GoValue: ptrToPtrToString("hello"), Type: cty.String, Want: cty.StringVal("hello"), }, { GoValue: (*string)(nil), Type: cty.String, Want: cty.NullVal(cty.String), }, { GoValue: nil, // any nil is convertable to a null of any type Type: cty.String, Want: cty.NullVal(cty.String), }, { GoValue: (*bool)(nil), // any nil is convertable to a null of any type Type: cty.String, Want: cty.NullVal(cty.String), }, // Number { GoValue: int(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: int8(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: int16(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: int32(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: int64(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: uint(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: uint8(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: uint16(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: uint32(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: uint64(1), Type: cty.Number, Want: cty.NumberIntVal(1), }, { GoValue: float32(1.5), Type: cty.Number, Want: cty.NumberFloatVal(1.5), }, { GoValue: float64(1.5), Type: cty.Number, Want: cty.NumberFloatVal(1.5), }, { GoValue: big.NewFloat(1.5), Type: cty.Number, Want: cty.NumberFloatVal(1.5), }, { GoValue: big.NewInt(5), Type: cty.Number, Want: cty.NumberIntVal(5), }, { GoValue: (*int)(nil), Type: cty.Number, Want: cty.NullVal(cty.Number), }, // Lists { GoValue: []int{}, Type: cty.List(cty.Number), Want: cty.ListValEmpty(cty.Number), }, { GoValue: []int{1, 2}, Type: cty.List(cty.Number), Want: cty.ListVal([]cty.Value{ cty.NumberIntVal(1), cty.NumberIntVal(2), }), }, { GoValue: &[]int{1, 2}, Type: cty.List(cty.Number), Want: cty.ListVal([]cty.Value{ cty.NumberIntVal(1), cty.NumberIntVal(2), }), }, { GoValue: []int(nil), Type: cty.List(cty.Number), Want: cty.NullVal(cty.List(cty.Number)), }, { GoValue: (*[]int)(nil), Type: cty.List(cty.Number), Want: cty.NullVal(cty.List(cty.Number)), }, { GoValue: [2]int{1, 2}, Type: cty.List(cty.Number), Want: cty.ListVal([]cty.Value{ cty.NumberIntVal(1), cty.NumberIntVal(2), }), }, { GoValue: [0]int{}, Type: cty.List(cty.Number), Want: cty.ListValEmpty(cty.Number), }, { GoValue: []int{}, Type: cty.Set(cty.Number), Want: cty.SetValEmpty(cty.Number), }, // Sets { GoValue: []int{1, 2}, Type: cty.Set(cty.Number), Want: cty.SetVal([]cty.Value{ cty.NumberIntVal(1), cty.NumberIntVal(2), }), }, { GoValue: []int{2, 2}, Type: cty.Set(cty.Number), Want: cty.SetVal([]cty.Value{ cty.NumberIntVal(2), }), }, { GoValue: &[]int{1, 2}, Type: cty.Set(cty.Number), Want: cty.SetVal([]cty.Value{ cty.NumberIntVal(1), cty.NumberIntVal(2), }), }, { GoValue: []int(nil), Type: cty.Set(cty.Number), Want: cty.NullVal(cty.Set(cty.Number)), }, { GoValue: (*[]int)(nil), Type: cty.Set(cty.Number), Want: cty.NullVal(cty.Set(cty.Number)), }, { GoValue: [2]int{1, 2}, Type: cty.Set(cty.Number), Want: cty.SetVal([]cty.Value{ cty.NumberIntVal(1), cty.NumberIntVal(2), }), }, { GoValue: [0]int{}, Type: cty.Set(cty.Number), Want: cty.SetValEmpty(cty.Number), }, { GoValue: set.NewSet(&testSetRules{}), Type: cty.Set(cty.Number), Want: cty.SetValEmpty(cty.Number), }, { GoValue: set.NewSetFromSlice(&testSetRules{}, []interface{}{1, 2}), Type: cty.Set(cty.Number), Want: cty.SetVal([]cty.Value{ cty.NumberIntVal(1), cty.NumberIntVal(2), }), }, // Maps { GoValue: map[string]int{}, Type: cty.Map(cty.Number), Want: cty.MapValEmpty(cty.Number), }, { GoValue: map[string]int{"one": 1, "two": 2}, Type: cty.Map(cty.Number), Want: cty.MapVal(map[string]cty.Value{ "one": cty.NumberIntVal(1), "two": cty.NumberIntVal(2), }), }, // Objects { GoValue: struct{}{}, Type: cty.EmptyObject, Want: cty.EmptyObjectVal, }, { GoValue: struct{ Ignored int }{1}, Type: cty.EmptyObject, Want: cty.EmptyObjectVal, }, { GoValue: struct{}{}, Type: cty.Object(map[string]cty.Type{ "name": cty.String, }), Want: cty.ObjectVal(map[string]cty.Value{ "name": cty.NullVal(cty.String), }), }, { GoValue: struct { Name string `cty:"name"` Number int `cty:"number"` }{"Steven", 1}, Type: cty.Object(map[string]cty.Type{ "name": cty.String, "number": cty.Number, }), Want: cty.ObjectVal(map[string]cty.Value{ "name": cty.StringVal("Steven"), "number": cty.NumberIntVal(1), }), }, { GoValue: struct { Name string `cty:"name"` Number int }{"Steven", 1}, Type: cty.Object(map[string]cty.Type{ "name": cty.String, "number": cty.Number, }), Want: cty.ObjectVal(map[string]cty.Value{ "name": cty.StringVal("Steven"), "number": cty.NullVal(cty.Number), }), }, { GoValue: map[string]interface{}{ "name": "Steven", "number": 1, }, Type: cty.Object(map[string]cty.Type{ "name": cty.String, "number": cty.Number, }), Want: cty.ObjectVal(map[string]cty.Value{ "name": cty.StringVal("Steven"), "number": cty.NumberIntVal(1), }), }, { GoValue: map[string]interface{}{ "number": 1, }, Type: cty.Object(map[string]cty.Type{ "name": cty.String, "number": cty.Number, }), Want: cty.ObjectVal(map[string]cty.Value{ "name": cty.NullVal(cty.String), "number": cty.NumberIntVal(1), }), }, // Tuples { GoValue: []interface{}{}, Type: cty.EmptyTuple, Want: cty.EmptyTupleVal, }, { GoValue: struct{}{}, Type: cty.EmptyTuple, Want: cty.EmptyTupleVal, }, { GoValue: testTupleStruct{"Stephen", 23}, Type: cty.Tuple([]cty.Type{cty.String, cty.Number}), Want: cty.TupleVal([]cty.Value{ cty.StringVal("Stephen"), cty.NumberIntVal(23), }), }, { GoValue: []interface{}{1, 2, 3}, Type: cty.Tuple([]cty.Type{ cty.Number, cty.Number, cty.Number, }), Want: cty.TupleVal([]cty.Value{ cty.NumberIntVal(1), cty.NumberIntVal(2), cty.NumberIntVal(3), }), }, { GoValue: []interface{}{1, "hello", 3}, Type: cty.Tuple([]cty.Type{ cty.Number, cty.String, cty.Number, }), Want: cty.TupleVal([]cty.Value{ cty.NumberIntVal(1), cty.StringVal("hello"), cty.NumberIntVal(3), }), }, { GoValue: []interface{}(nil), Type: cty.Tuple([]cty.Type{cty.Number}), Want: cty.NullVal(cty.Tuple([]cty.Type{cty.Number})), }, // Capsules { GoValue: capsuleANative, Type: capsuleType1, Want: cty.CapsuleVal(capsuleType1, capsuleANative), }, // Dynamic { GoValue: cty.NumberIntVal(2), Type: cty.DynamicPseudoType, Want: cty.NumberIntVal(2), }, { GoValue: []cty.Value{cty.NumberIntVal(2)}, Type: cty.List(cty.DynamicPseudoType), Want: cty.ListVal([]cty.Value{cty.NumberIntVal(2)}), }, { GoValue: map[string]cty.Value{"number": cty.NumberIntVal(2)}, Type: cty.Map(cty.DynamicPseudoType), Want: cty.MapVal(map[string]cty.Value{"number": cty.NumberIntVal(2)}), }, } for _, test := range tests { t.Run(fmt.Sprintf("%#v into %#v", test.GoValue, test.Type), func(t *testing.T) { got, err := ToCtyValue(test.GoValue, test.Type) if err != nil { t.Fatalf("ToCtyValue returned error: %s", err) } if got == cty.NilVal { t.Fatalf("ToCtyValue returned NilVal with no error") } if !got.RawEquals(test.Want) { t.Errorf("wrong result\ninput: %#v\ntarget type: %#v\ngot: %#v\nwant: %#v", test.GoValue, test.Type, got, test.Want) } }) } } func ptrToBool(val bool) *bool { return &val } func ptrToString(val string) *string { return &val } func ptrToInt(val int) *int { return &val } func ptrToPtrToString(val string) **string { pval := &val return &pval } type testSetRules struct{} func (r testSetRules) Hash(v interface{}) int { return v.(int) } func (r testSetRules) Equivalent(v1 interface{}, v2 interface{}) bool { return v1 == v2 } type capsuleType1Native struct { name string } var capsuleType1 = cty.Capsule("capsule type 1", reflect.TypeOf(capsuleType1Native{}))
runzexia/qingcloud-terraform-provider
vendor/github.com/zclconf/go-cty/cty/gocty/in_test.go
GO
mit
9,704
// <auto-generated> // 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. // </auto-generated> namespace Microsoft.Azure.Batch.Protocol.Models { using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// <summary> /// A reference to a certificate to be installed on compute nodes in a /// pool. /// </summary> public partial class CertificateReference { /// <summary> /// Initializes a new instance of the CertificateReference class. /// </summary> public CertificateReference() { CustomInit(); } /// <summary> /// Initializes a new instance of the CertificateReference class. /// </summary> /// <param name="thumbprint">The thumbprint of the certificate.</param> /// <param name="thumbprintAlgorithm">The algorithm with which the /// thumbprint is associated. This must be sha1.</param> /// <param name="storeLocation">The location of the certificate store /// on the compute node into which to install the certificate.</param> /// <param name="storeName">The name of the certificate store on the /// compute node into which to install the certificate.</param> /// <param name="visibility">Which user accounts on the compute node /// should have access to the private data of the certificate.</param> public CertificateReference(string thumbprint, string thumbprintAlgorithm, CertificateStoreLocation? storeLocation = default(CertificateStoreLocation?), string storeName = default(string), IList<CertificateVisibility> visibility = default(IList<CertificateVisibility>)) { Thumbprint = thumbprint; ThumbprintAlgorithm = thumbprintAlgorithm; StoreLocation = storeLocation; StoreName = storeName; Visibility = visibility; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets or sets the thumbprint of the certificate. /// </summary> [JsonProperty(PropertyName = "thumbprint")] public string Thumbprint { get; set; } /// <summary> /// Gets or sets the algorithm with which the thumbprint is associated. /// This must be sha1. /// </summary> [JsonProperty(PropertyName = "thumbprintAlgorithm")] public string ThumbprintAlgorithm { get; set; } /// <summary> /// Gets or sets the location of the certificate store on the compute /// node into which to install the certificate. /// </summary> /// <remarks> /// The default value is currentuser. This property is applicable only /// for pools configured with Windows nodes (that is, created with /// cloudServiceConfiguration, or with virtualMachineConfiguration /// using a Windows image reference). For Linux compute nodes, the /// certificates are stored in a directory inside the task working /// directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is /// supplied to the task to query for this location. For certificates /// with visibility of 'remoteUser', a 'certs' directory is created in /// the user's home directory (e.g., /home/{user-name}/certs) and /// certificates are placed in that directory. Possible values include: /// 'currentUser', 'localMachine' /// </remarks> [JsonProperty(PropertyName = "storeLocation")] public CertificateStoreLocation? StoreLocation { get; set; } /// <summary> /// Gets or sets the name of the certificate store on the compute node /// into which to install the certificate. /// </summary> /// <remarks> /// This property is applicable only for pools configured with Windows /// nodes (that is, created with cloudServiceConfiguration, or with /// virtualMachineConfiguration using a Windows image reference). /// Common store names include: My, Root, CA, Trust, Disallowed, /// TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any /// custom store name can also be used. The default value is My. /// </remarks> [JsonProperty(PropertyName = "storeName")] public string StoreName { get; set; } /// <summary> /// Gets or sets which user accounts on the compute node should have /// access to the private data of the certificate. /// </summary> /// <remarks> /// You can specify more than one visibility in this collection. The /// default is all accounts. /// </remarks> [JsonProperty(PropertyName = "visibility")] public IList<CertificateVisibility> Visibility { get; set; } /// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Thumbprint == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Thumbprint"); } if (ThumbprintAlgorithm == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ThumbprintAlgorithm"); } } } }
shutchings/azure-sdk-for-net
src/SDKs/Batch/DataPlane/Azure.Batch/GeneratedProtocol/Models/CertificateReference.cs
C#
mit
5,893
// // This file is auto-generated. Please don't modify it! // package org.opencv.calib3d; import java.util.ArrayList; import java.util.List; import org.opencv.core.Mat; import org.opencv.core.MatOfDouble; import org.opencv.core.MatOfPoint2f; import org.opencv.core.MatOfPoint3f; import org.opencv.core.Point; import org.opencv.core.Rect; import org.opencv.core.Size; import org.opencv.core.TermCriteria; import org.opencv.utils.Converters; public class Calib3d { public static final int CALIB_USE_INTRINSIC_GUESS = 1, CALIB_RECOMPUTE_EXTRINSIC = 2, CALIB_CHECK_COND = 4, CALIB_FIX_SKEW = 8, CALIB_FIX_K1 = 16, CALIB_FIX_K2 = 32, CALIB_FIX_K3 = 64, CALIB_FIX_K4 = 128, CALIB_FIX_INTRINSIC = 256, CV_ITERATIVE = 0, CV_EPNP = 1, CV_P3P = 2, CV_DLS = 3, LMEDS = 4, RANSAC = 8, RHO = 16, SOLVEPNP_ITERATIVE = 0, SOLVEPNP_EPNP = 1, SOLVEPNP_P3P = 2, SOLVEPNP_DLS = 3, SOLVEPNP_UPNP = 4, SOLVEPNP_AP3P = 5, SOLVEPNP_MAX_COUNT = 5+1, CALIB_CB_ADAPTIVE_THRESH = 1, CALIB_CB_NORMALIZE_IMAGE = 2, CALIB_CB_FILTER_QUADS = 4, CALIB_CB_FAST_CHECK = 8, CALIB_CB_SYMMETRIC_GRID = 1, CALIB_CB_ASYMMETRIC_GRID = 2, CALIB_CB_CLUSTERING = 4, CALIB_FIX_ASPECT_RATIO = 0x00002, CALIB_FIX_PRINCIPAL_POINT = 0x00004, CALIB_ZERO_TANGENT_DIST = 0x00008, CALIB_FIX_FOCAL_LENGTH = 0x00010, CALIB_FIX_K5 = 0x01000, CALIB_FIX_K6 = 0x02000, CALIB_RATIONAL_MODEL = 0x04000, CALIB_THIN_PRISM_MODEL = 0x08000, CALIB_FIX_S1_S2_S3_S4 = 0x10000, CALIB_TILTED_MODEL = 0x40000, CALIB_FIX_TAUX_TAUY = 0x80000, CALIB_USE_QR = 0x100000, CALIB_FIX_TANGENT_DIST = 0x200000, CALIB_SAME_FOCAL_LENGTH = 0x00200, CALIB_ZERO_DISPARITY = 0x00400, CALIB_USE_LU = (1 << 17), FM_7POINT = 1, FM_8POINT = 2, FM_LMEDS = 4, FM_RANSAC = 8; // // C++: Mat estimateAffine2D(Mat from, Mat to, Mat& inliers = Mat(), int method = RANSAC, double ransacReprojThreshold = 3, size_t maxIters = 2000, double confidence = 0.99, size_t refineIters = 10) // //javadoc: estimateAffine2D(from, to, inliers, method, ransacReprojThreshold, maxIters, confidence, refineIters) public static Mat estimateAffine2D(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters) { Mat retVal = new Mat(estimateAffine2D_0(from.nativeObj, to.nativeObj, inliers.nativeObj, method, ransacReprojThreshold, maxIters, confidence, refineIters)); return retVal; } //javadoc: estimateAffine2D(from, to) public static Mat estimateAffine2D(Mat from, Mat to) { Mat retVal = new Mat(estimateAffine2D_1(from.nativeObj, to.nativeObj)); return retVal; } // // C++: Mat estimateAffinePartial2D(Mat from, Mat to, Mat& inliers = Mat(), int method = RANSAC, double ransacReprojThreshold = 3, size_t maxIters = 2000, double confidence = 0.99, size_t refineIters = 10) // //javadoc: estimateAffinePartial2D(from, to, inliers, method, ransacReprojThreshold, maxIters, confidence, refineIters) public static Mat estimateAffinePartial2D(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters) { Mat retVal = new Mat(estimateAffinePartial2D_0(from.nativeObj, to.nativeObj, inliers.nativeObj, method, ransacReprojThreshold, maxIters, confidence, refineIters)); return retVal; } //javadoc: estimateAffinePartial2D(from, to) public static Mat estimateAffinePartial2D(Mat from, Mat to) { Mat retVal = new Mat(estimateAffinePartial2D_1(from.nativeObj, to.nativeObj)); return retVal; } // // C++: Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix, int method = RANSAC, double prob = 0.999, double threshold = 1.0, Mat& mask = Mat()) // //javadoc: findEssentialMat(points1, points2, cameraMatrix, method, prob, threshold, mask) public static Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold, Mat mask) { Mat retVal = new Mat(findEssentialMat_0(points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, method, prob, threshold, mask.nativeObj)); return retVal; } //javadoc: findEssentialMat(points1, points2, cameraMatrix, method, prob, threshold) public static Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold) { Mat retVal = new Mat(findEssentialMat_1(points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, method, prob, threshold)); return retVal; } //javadoc: findEssentialMat(points1, points2, cameraMatrix) public static Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix) { Mat retVal = new Mat(findEssentialMat_2(points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj)); return retVal; } // // C++: Mat findEssentialMat(Mat points1, Mat points2, double focal = 1.0, Point2d pp = Point2d(0, 0), int method = RANSAC, double prob = 0.999, double threshold = 1.0, Mat& mask = Mat()) // //javadoc: findEssentialMat(points1, points2, focal, pp, method, prob, threshold, mask) public static Mat findEssentialMat(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold, Mat mask) { Mat retVal = new Mat(findEssentialMat_3(points1.nativeObj, points2.nativeObj, focal, pp.x, pp.y, method, prob, threshold, mask.nativeObj)); return retVal; } //javadoc: findEssentialMat(points1, points2, focal, pp, method, prob, threshold) public static Mat findEssentialMat(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold) { Mat retVal = new Mat(findEssentialMat_4(points1.nativeObj, points2.nativeObj, focal, pp.x, pp.y, method, prob, threshold)); return retVal; } //javadoc: findEssentialMat(points1, points2) public static Mat findEssentialMat(Mat points1, Mat points2) { Mat retVal = new Mat(findEssentialMat_5(points1.nativeObj, points2.nativeObj)); return retVal; } // // C++: Mat findFundamentalMat(vector_Point2f points1, vector_Point2f points2, int method = FM_RANSAC, double param1 = 3., double param2 = 0.99, Mat& mask = Mat()) // //javadoc: findFundamentalMat(points1, points2, method, param1, param2, mask) public static Mat findFundamentalMat(MatOfPoint2f points1, MatOfPoint2f points2, int method, double param1, double param2, Mat mask) { Mat points1_mat = points1; Mat points2_mat = points2; Mat retVal = new Mat(findFundamentalMat_0(points1_mat.nativeObj, points2_mat.nativeObj, method, param1, param2, mask.nativeObj)); return retVal; } //javadoc: findFundamentalMat(points1, points2, method, param1, param2) public static Mat findFundamentalMat(MatOfPoint2f points1, MatOfPoint2f points2, int method, double param1, double param2) { Mat points1_mat = points1; Mat points2_mat = points2; Mat retVal = new Mat(findFundamentalMat_1(points1_mat.nativeObj, points2_mat.nativeObj, method, param1, param2)); return retVal; } //javadoc: findFundamentalMat(points1, points2) public static Mat findFundamentalMat(MatOfPoint2f points1, MatOfPoint2f points2) { Mat points1_mat = points1; Mat points2_mat = points2; Mat retVal = new Mat(findFundamentalMat_2(points1_mat.nativeObj, points2_mat.nativeObj)); return retVal; } // // C++: Mat findHomography(vector_Point2f srcPoints, vector_Point2f dstPoints, int method = 0, double ransacReprojThreshold = 3, Mat& mask = Mat(), int maxIters = 2000, double confidence = 0.995) // //javadoc: findHomography(srcPoints, dstPoints, method, ransacReprojThreshold, mask, maxIters, confidence) public static Mat findHomography(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold, Mat mask, int maxIters, double confidence) { Mat srcPoints_mat = srcPoints; Mat dstPoints_mat = dstPoints; Mat retVal = new Mat(findHomography_0(srcPoints_mat.nativeObj, dstPoints_mat.nativeObj, method, ransacReprojThreshold, mask.nativeObj, maxIters, confidence)); return retVal; } //javadoc: findHomography(srcPoints, dstPoints, method, ransacReprojThreshold) public static Mat findHomography(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold) { Mat srcPoints_mat = srcPoints; Mat dstPoints_mat = dstPoints; Mat retVal = new Mat(findHomography_1(srcPoints_mat.nativeObj, dstPoints_mat.nativeObj, method, ransacReprojThreshold)); return retVal; } //javadoc: findHomography(srcPoints, dstPoints) public static Mat findHomography(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints) { Mat srcPoints_mat = srcPoints; Mat dstPoints_mat = dstPoints; Mat retVal = new Mat(findHomography_2(srcPoints_mat.nativeObj, dstPoints_mat.nativeObj)); return retVal; } // // C++: Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize = Size(), Rect* validPixROI = 0, bool centerPrincipalPoint = false) // //javadoc: getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha, newImgSize, validPixROI, centerPrincipalPoint) public static Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize, Rect validPixROI, boolean centerPrincipalPoint) { double[] validPixROI_out = new double[4]; Mat retVal = new Mat(getOptimalNewCameraMatrix_0(cameraMatrix.nativeObj, distCoeffs.nativeObj, imageSize.width, imageSize.height, alpha, newImgSize.width, newImgSize.height, validPixROI_out, centerPrincipalPoint)); if(validPixROI!=null){ validPixROI.x = (int)validPixROI_out[0]; validPixROI.y = (int)validPixROI_out[1]; validPixROI.width = (int)validPixROI_out[2]; validPixROI.height = (int)validPixROI_out[3]; } return retVal; } //javadoc: getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha) public static Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha) { Mat retVal = new Mat(getOptimalNewCameraMatrix_1(cameraMatrix.nativeObj, distCoeffs.nativeObj, imageSize.width, imageSize.height, alpha)); return retVal; } // // C++: Mat initCameraMatrix2D(vector_vector_Point3f objectPoints, vector_vector_Point2f imagePoints, Size imageSize, double aspectRatio = 1.0) // //javadoc: initCameraMatrix2D(objectPoints, imagePoints, imageSize, aspectRatio) public static Mat initCameraMatrix2D(List<MatOfPoint3f> objectPoints, List<MatOfPoint2f> imagePoints, Size imageSize, double aspectRatio) { List<Mat> objectPoints_tmplm = new ArrayList<Mat>((objectPoints != null) ? objectPoints.size() : 0); Mat objectPoints_mat = Converters.vector_vector_Point3f_to_Mat(objectPoints, objectPoints_tmplm); List<Mat> imagePoints_tmplm = new ArrayList<Mat>((imagePoints != null) ? imagePoints.size() : 0); Mat imagePoints_mat = Converters.vector_vector_Point2f_to_Mat(imagePoints, imagePoints_tmplm); Mat retVal = new Mat(initCameraMatrix2D_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, aspectRatio)); return retVal; } //javadoc: initCameraMatrix2D(objectPoints, imagePoints, imageSize) public static Mat initCameraMatrix2D(List<MatOfPoint3f> objectPoints, List<MatOfPoint2f> imagePoints, Size imageSize) { List<Mat> objectPoints_tmplm = new ArrayList<Mat>((objectPoints != null) ? objectPoints.size() : 0); Mat objectPoints_mat = Converters.vector_vector_Point3f_to_Mat(objectPoints, objectPoints_tmplm); List<Mat> imagePoints_tmplm = new ArrayList<Mat>((imagePoints != null) ? imagePoints.size() : 0); Mat imagePoints_mat = Converters.vector_vector_Point2f_to_Mat(imagePoints, imagePoints_tmplm); Mat retVal = new Mat(initCameraMatrix2D_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height)); return retVal; } // // C++: Rect getValidDisparityROI(Rect roi1, Rect roi2, int minDisparity, int numberOfDisparities, int SADWindowSize) // //javadoc: getValidDisparityROI(roi1, roi2, minDisparity, numberOfDisparities, SADWindowSize) public static Rect getValidDisparityROI(Rect roi1, Rect roi2, int minDisparity, int numberOfDisparities, int SADWindowSize) { Rect retVal = new Rect(getValidDisparityROI_0(roi1.x, roi1.y, roi1.width, roi1.height, roi2.x, roi2.y, roi2.width, roi2.height, minDisparity, numberOfDisparities, SADWindowSize)); return retVal; } // // C++: Vec3d RQDecomp3x3(Mat src, Mat& mtxR, Mat& mtxQ, Mat& Qx = Mat(), Mat& Qy = Mat(), Mat& Qz = Mat()) // //javadoc: RQDecomp3x3(src, mtxR, mtxQ, Qx, Qy, Qz) public static double[] RQDecomp3x3(Mat src, Mat mtxR, Mat mtxQ, Mat Qx, Mat Qy, Mat Qz) { double[] retVal = RQDecomp3x3_0(src.nativeObj, mtxR.nativeObj, mtxQ.nativeObj, Qx.nativeObj, Qy.nativeObj, Qz.nativeObj); return retVal; } //javadoc: RQDecomp3x3(src, mtxR, mtxQ) public static double[] RQDecomp3x3(Mat src, Mat mtxR, Mat mtxQ) { double[] retVal = RQDecomp3x3_1(src.nativeObj, mtxR.nativeObj, mtxQ.nativeObj); return retVal; } // // C++: bool findChessboardCorners(Mat image, Size patternSize, vector_Point2f& corners, int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE) // //javadoc: findChessboardCorners(image, patternSize, corners, flags) public static boolean findChessboardCorners(Mat image, Size patternSize, MatOfPoint2f corners, int flags) { Mat corners_mat = corners; boolean retVal = findChessboardCorners_0(image.nativeObj, patternSize.width, patternSize.height, corners_mat.nativeObj, flags); return retVal; } //javadoc: findChessboardCorners(image, patternSize, corners) public static boolean findChessboardCorners(Mat image, Size patternSize, MatOfPoint2f corners) { Mat corners_mat = corners; boolean retVal = findChessboardCorners_1(image.nativeObj, patternSize.width, patternSize.height, corners_mat.nativeObj); return retVal; } // // C++: bool findCirclesGrid(Mat image, Size patternSize, Mat& centers, int flags, Ptr_FeatureDetector blobDetector, CirclesGridFinderParameters parameters) // // Unknown type 'Ptr_FeatureDetector' (I), skipping the function // // C++: bool findCirclesGrid(Mat image, Size patternSize, Mat& centers, int flags = CALIB_CB_SYMMETRIC_GRID, Ptr_FeatureDetector blobDetector = SimpleBlobDetector::create()) // //javadoc: findCirclesGrid(image, patternSize, centers, flags) public static boolean findCirclesGrid(Mat image, Size patternSize, Mat centers, int flags) { boolean retVal = findCirclesGrid_0(image.nativeObj, patternSize.width, patternSize.height, centers.nativeObj, flags); return retVal; } //javadoc: findCirclesGrid(image, patternSize, centers) public static boolean findCirclesGrid(Mat image, Size patternSize, Mat centers) { boolean retVal = findCirclesGrid_1(image.nativeObj, patternSize.width, patternSize.height, centers.nativeObj); return retVal; } // // C++: bool solvePnP(vector_Point3f objectPoints, vector_Point2f imagePoints, Mat cameraMatrix, vector_double distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE) // //javadoc: solvePnP(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess, flags) public static boolean solvePnP(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int flags) { Mat objectPoints_mat = objectPoints; Mat imagePoints_mat = imagePoints; Mat distCoeffs_mat = distCoeffs; boolean retVal = solvePnP_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, useExtrinsicGuess, flags); return retVal; } //javadoc: solvePnP(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec) public static boolean solvePnP(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec) { Mat objectPoints_mat = objectPoints; Mat imagePoints_mat = imagePoints; Mat distCoeffs_mat = distCoeffs; boolean retVal = solvePnP_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, rvec.nativeObj, tvec.nativeObj); return retVal; } // // C++: bool solvePnPRansac(vector_Point3f objectPoints, vector_Point2f imagePoints, Mat cameraMatrix, vector_double distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false, int iterationsCount = 100, float reprojectionError = 8.0, double confidence = 0.99, Mat& inliers = Mat(), int flags = SOLVEPNP_ITERATIVE) // //javadoc: solvePnPRansac(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess, iterationsCount, reprojectionError, confidence, inliers, flags) public static boolean solvePnPRansac(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers, int flags) { Mat objectPoints_mat = objectPoints; Mat imagePoints_mat = imagePoints; Mat distCoeffs_mat = distCoeffs; boolean retVal = solvePnPRansac_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, useExtrinsicGuess, iterationsCount, reprojectionError, confidence, inliers.nativeObj, flags); return retVal; } //javadoc: solvePnPRansac(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec) public static boolean solvePnPRansac(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec) { Mat objectPoints_mat = objectPoints; Mat imagePoints_mat = imagePoints; Mat distCoeffs_mat = distCoeffs; boolean retVal = solvePnPRansac_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, rvec.nativeObj, tvec.nativeObj); return retVal; } // // C++: bool stereoRectifyUncalibrated(Mat points1, Mat points2, Mat F, Size imgSize, Mat& H1, Mat& H2, double threshold = 5) // //javadoc: stereoRectifyUncalibrated(points1, points2, F, imgSize, H1, H2, threshold) public static boolean stereoRectifyUncalibrated(Mat points1, Mat points2, Mat F, Size imgSize, Mat H1, Mat H2, double threshold) { boolean retVal = stereoRectifyUncalibrated_0(points1.nativeObj, points2.nativeObj, F.nativeObj, imgSize.width, imgSize.height, H1.nativeObj, H2.nativeObj, threshold); return retVal; } //javadoc: stereoRectifyUncalibrated(points1, points2, F, imgSize, H1, H2) public static boolean stereoRectifyUncalibrated(Mat points1, Mat points2, Mat F, Size imgSize, Mat H1, Mat H2) { boolean retVal = stereoRectifyUncalibrated_1(points1.nativeObj, points2.nativeObj, F.nativeObj, imgSize.width, imgSize.height, H1.nativeObj, H2.nativeObj); return retVal; } // // C++: double calibrateCamera(vector_Mat objectPoints, vector_Mat imagePoints, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)) // //javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors, flags, criteria) public static double calibrateCameraExtended(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags, TermCriteria criteria) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); double retVal = calibrateCameraExtended_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } //javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors, flags) public static double calibrateCameraExtended(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); double retVal = calibrateCameraExtended_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj, flags); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } //javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors) public static double calibrateCameraExtended(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); double retVal = calibrateCameraExtended_2(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } // // C++: double calibrateCamera(vector_Mat objectPoints, vector_Mat imagePoints, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, int flags = 0, TermCriteria criteria = TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)) // //javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags, criteria) public static double calibrateCamera(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags, TermCriteria criteria) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); double retVal = calibrateCamera_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } //javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags) public static double calibrateCamera(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); double retVal = calibrateCamera_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } //javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs) public static double calibrateCamera(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); double retVal = calibrateCamera_2(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } // // C++: double sampsonDistance(Mat pt1, Mat pt2, Mat F) // //javadoc: sampsonDistance(pt1, pt2, F) public static double sampsonDistance(Mat pt1, Mat pt2, Mat F) { double retVal = sampsonDistance_0(pt1.nativeObj, pt2.nativeObj, F.nativeObj); return retVal; } // // C++: double stereoCalibrate(vector_Mat objectPoints, vector_Mat imagePoints1, vector_Mat imagePoints2, Mat& cameraMatrix1, Mat& distCoeffs1, Mat& cameraMatrix2, Mat& distCoeffs2, Size imageSize, Mat& R, Mat& T, Mat& E, Mat& F, int flags = CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6)) // //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E, F, flags, criteria) public static double stereoCalibrate(List<Mat> objectPoints, List<Mat> imagePoints1, List<Mat> imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat E, Mat F, int flags, TermCriteria criteria) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); double retVal = stereoCalibrate_0(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, E.nativeObj, F.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon); return retVal; } //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E, F, flags) public static double stereoCalibrate(List<Mat> objectPoints, List<Mat> imagePoints1, List<Mat> imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat E, Mat F, int flags) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); double retVal = stereoCalibrate_1(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, E.nativeObj, F.nativeObj, flags); return retVal; } //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E, F) public static double stereoCalibrate(List<Mat> objectPoints, List<Mat> imagePoints1, List<Mat> imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat E, Mat F) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); double retVal = stereoCalibrate_2(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, E.nativeObj, F.nativeObj); return retVal; } // // C++: double calibrate(vector_Mat objectPoints, vector_Mat imagePoints, Size image_size, Mat& K, Mat& D, vector_Mat& rvecs, vector_Mat& tvecs, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)) // //javadoc: calibrate(objectPoints, imagePoints, image_size, K, D, rvecs, tvecs, flags, criteria) public static double calibrate(List<Mat> objectPoints, List<Mat> imagePoints, Size image_size, Mat K, Mat D, List<Mat> rvecs, List<Mat> tvecs, int flags, TermCriteria criteria) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); double retVal = calibrate_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, image_size.width, image_size.height, K.nativeObj, D.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } //javadoc: calibrate(objectPoints, imagePoints, image_size, K, D, rvecs, tvecs, flags) public static double calibrate(List<Mat> objectPoints, List<Mat> imagePoints, Size image_size, Mat K, Mat D, List<Mat> rvecs, List<Mat> tvecs, int flags) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); double retVal = calibrate_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, image_size.width, image_size.height, K.nativeObj, D.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } //javadoc: calibrate(objectPoints, imagePoints, image_size, K, D, rvecs, tvecs) public static double calibrate(List<Mat> objectPoints, List<Mat> imagePoints, Size image_size, Mat K, Mat D, List<Mat> rvecs, List<Mat> tvecs) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); double retVal = calibrate_2(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, image_size.width, image_size.height, K.nativeObj, D.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } // // C++: double stereoCalibrate(vector_Mat objectPoints, vector_Mat imagePoints1, vector_Mat imagePoints2, Mat& K1, Mat& D1, Mat& K2, Mat& D2, Size imageSize, Mat& R, Mat& T, int flags = fisheye::CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)) // //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, K1, D1, K2, D2, imageSize, R, T, flags, criteria) public static double stereoCalibrate(List<Mat> objectPoints, List<Mat> imagePoints1, List<Mat> imagePoints2, Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat T, int flags, TermCriteria criteria) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); double retVal = stereoCalibrate_3(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon); return retVal; } //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, K1, D1, K2, D2, imageSize, R, T, flags) public static double stereoCalibrate(List<Mat> objectPoints, List<Mat> imagePoints1, List<Mat> imagePoints2, Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat T, int flags) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); double retVal = stereoCalibrate_4(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, flags); return retVal; } //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, K1, D1, K2, D2, imageSize, R, T) public static double stereoCalibrate(List<Mat> objectPoints, List<Mat> imagePoints1, List<Mat> imagePoints2, Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat T) { Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); double retVal = stereoCalibrate_5(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj); return retVal; } // // C++: float rectify3Collinear(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat cameraMatrix3, Mat distCoeffs3, vector_Mat imgpt1, vector_Mat imgpt3, Size imageSize, Mat R12, Mat T12, Mat R13, Mat T13, Mat& R1, Mat& R2, Mat& R3, Mat& P1, Mat& P2, Mat& P3, Mat& Q, double alpha, Size newImgSize, Rect* roi1, Rect* roi2, int flags) // //javadoc: rectify3Collinear(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, cameraMatrix3, distCoeffs3, imgpt1, imgpt3, imageSize, R12, T12, R13, T13, R1, R2, R3, P1, P2, P3, Q, alpha, newImgSize, roi1, roi2, flags) public static float rectify3Collinear(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat cameraMatrix3, Mat distCoeffs3, List<Mat> imgpt1, List<Mat> imgpt3, Size imageSize, Mat R12, Mat T12, Mat R13, Mat T13, Mat R1, Mat R2, Mat R3, Mat P1, Mat P2, Mat P3, Mat Q, double alpha, Size newImgSize, Rect roi1, Rect roi2, int flags) { Mat imgpt1_mat = Converters.vector_Mat_to_Mat(imgpt1); Mat imgpt3_mat = Converters.vector_Mat_to_Mat(imgpt3); double[] roi1_out = new double[4]; double[] roi2_out = new double[4]; float retVal = rectify3Collinear_0(cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, cameraMatrix3.nativeObj, distCoeffs3.nativeObj, imgpt1_mat.nativeObj, imgpt3_mat.nativeObj, imageSize.width, imageSize.height, R12.nativeObj, T12.nativeObj, R13.nativeObj, T13.nativeObj, R1.nativeObj, R2.nativeObj, R3.nativeObj, P1.nativeObj, P2.nativeObj, P3.nativeObj, Q.nativeObj, alpha, newImgSize.width, newImgSize.height, roi1_out, roi2_out, flags); if(roi1!=null){ roi1.x = (int)roi1_out[0]; roi1.y = (int)roi1_out[1]; roi1.width = (int)roi1_out[2]; roi1.height = (int)roi1_out[3]; } if(roi2!=null){ roi2.x = (int)roi2_out[0]; roi2.y = (int)roi2_out[1]; roi2.width = (int)roi2_out[2]; roi2.height = (int)roi2_out[3]; } return retVal; } // // C++: int decomposeHomographyMat(Mat H, Mat K, vector_Mat& rotations, vector_Mat& translations, vector_Mat& normals) // //javadoc: decomposeHomographyMat(H, K, rotations, translations, normals) public static int decomposeHomographyMat(Mat H, Mat K, List<Mat> rotations, List<Mat> translations, List<Mat> normals) { Mat rotations_mat = new Mat(); Mat translations_mat = new Mat(); Mat normals_mat = new Mat(); int retVal = decomposeHomographyMat_0(H.nativeObj, K.nativeObj, rotations_mat.nativeObj, translations_mat.nativeObj, normals_mat.nativeObj); Converters.Mat_to_vector_Mat(rotations_mat, rotations); rotations_mat.release(); Converters.Mat_to_vector_Mat(translations_mat, translations); translations_mat.release(); Converters.Mat_to_vector_Mat(normals_mat, normals); normals_mat.release(); return retVal; } // // C++: int estimateAffine3D(Mat src, Mat dst, Mat& out, Mat& inliers, double ransacThreshold = 3, double confidence = 0.99) // //javadoc: estimateAffine3D(src, dst, out, inliers, ransacThreshold, confidence) public static int estimateAffine3D(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold, double confidence) { int retVal = estimateAffine3D_0(src.nativeObj, dst.nativeObj, out.nativeObj, inliers.nativeObj, ransacThreshold, confidence); return retVal; } //javadoc: estimateAffine3D(src, dst, out, inliers) public static int estimateAffine3D(Mat src, Mat dst, Mat out, Mat inliers) { int retVal = estimateAffine3D_1(src.nativeObj, dst.nativeObj, out.nativeObj, inliers.nativeObj); return retVal; } // // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat& R, Mat& t, double focal = 1.0, Point2d pp = Point2d(0, 0), Mat& mask = Mat()) // //javadoc: recoverPose(E, points1, points2, R, t, focal, pp, mask) public static int recoverPose(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal, Point pp, Mat mask) { int retVal = recoverPose_0(E.nativeObj, points1.nativeObj, points2.nativeObj, R.nativeObj, t.nativeObj, focal, pp.x, pp.y, mask.nativeObj); return retVal; } //javadoc: recoverPose(E, points1, points2, R, t, focal, pp) public static int recoverPose(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal, Point pp) { int retVal = recoverPose_1(E.nativeObj, points1.nativeObj, points2.nativeObj, R.nativeObj, t.nativeObj, focal, pp.x, pp.y); return retVal; } //javadoc: recoverPose(E, points1, points2, R, t) public static int recoverPose(Mat E, Mat points1, Mat points2, Mat R, Mat t) { int retVal = recoverPose_2(E.nativeObj, points1.nativeObj, points2.nativeObj, R.nativeObj, t.nativeObj); return retVal; } // // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat& R, Mat& t, Mat& mask = Mat()) // //javadoc: recoverPose(E, points1, points2, cameraMatrix, R, t, mask) public static int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, Mat mask) { int retVal = recoverPose_3(E.nativeObj, points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, R.nativeObj, t.nativeObj, mask.nativeObj); return retVal; } //javadoc: recoverPose(E, points1, points2, cameraMatrix, R, t) public static int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t) { int retVal = recoverPose_4(E.nativeObj, points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, R.nativeObj, t.nativeObj); return retVal; } // // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat& R, Mat& t, double distanceThresh, Mat& mask = Mat(), Mat& triangulatedPoints = Mat()) // //javadoc: recoverPose(E, points1, points2, cameraMatrix, R, t, distanceThresh, mask, triangulatedPoints) public static int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, double distanceThresh, Mat mask, Mat triangulatedPoints) { int retVal = recoverPose_5(E.nativeObj, points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, R.nativeObj, t.nativeObj, distanceThresh, mask.nativeObj, triangulatedPoints.nativeObj); return retVal; } //javadoc: recoverPose(E, points1, points2, cameraMatrix, R, t, distanceThresh) public static int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, double distanceThresh) { int retVal = recoverPose_6(E.nativeObj, points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, R.nativeObj, t.nativeObj, distanceThresh); return retVal; } // // C++: int solveP3P(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, int flags) // //javadoc: solveP3P(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvecs, tvecs, flags) public static int solveP3P(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags) { Mat rvecs_mat = new Mat(); Mat tvecs_mat = new Mat(); int retVal = solveP3P_0(objectPoints.nativeObj, imagePoints.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags); Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); rvecs_mat.release(); Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); tvecs_mat.release(); return retVal; } // // C++: void Rodrigues(Mat src, Mat& dst, Mat& jacobian = Mat()) // //javadoc: Rodrigues(src, dst, jacobian) public static void Rodrigues(Mat src, Mat dst, Mat jacobian) { Rodrigues_0(src.nativeObj, dst.nativeObj, jacobian.nativeObj); return; } //javadoc: Rodrigues(src, dst) public static void Rodrigues(Mat src, Mat dst) { Rodrigues_1(src.nativeObj, dst.nativeObj); return; } // // C++: void calibrationMatrixValues(Mat cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double& fovx, double& fovy, double& focalLength, Point2d& principalPoint, double& aspectRatio) // //javadoc: calibrationMatrixValues(cameraMatrix, imageSize, apertureWidth, apertureHeight, fovx, fovy, focalLength, principalPoint, aspectRatio) public static void calibrationMatrixValues(Mat cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double[] fovx, double[] fovy, double[] focalLength, Point principalPoint, double[] aspectRatio) { double[] fovx_out = new double[1]; double[] fovy_out = new double[1]; double[] focalLength_out = new double[1]; double[] principalPoint_out = new double[2]; double[] aspectRatio_out = new double[1]; calibrationMatrixValues_0(cameraMatrix.nativeObj, imageSize.width, imageSize.height, apertureWidth, apertureHeight, fovx_out, fovy_out, focalLength_out, principalPoint_out, aspectRatio_out); if(fovx!=null) fovx[0] = (double)fovx_out[0]; if(fovy!=null) fovy[0] = (double)fovy_out[0]; if(focalLength!=null) focalLength[0] = (double)focalLength_out[0]; if(principalPoint!=null){ principalPoint.x = principalPoint_out[0]; principalPoint.y = principalPoint_out[1]; } if(aspectRatio!=null) aspectRatio[0] = (double)aspectRatio_out[0]; return; } // // C++: void composeRT(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat& rvec3, Mat& tvec3, Mat& dr3dr1 = Mat(), Mat& dr3dt1 = Mat(), Mat& dr3dr2 = Mat(), Mat& dr3dt2 = Mat(), Mat& dt3dr1 = Mat(), Mat& dt3dt1 = Mat(), Mat& dt3dr2 = Mat(), Mat& dt3dt2 = Mat()) // //javadoc: composeRT(rvec1, tvec1, rvec2, tvec2, rvec3, tvec3, dr3dr1, dr3dt1, dr3dr2, dr3dt2, dt3dr1, dt3dt1, dt3dr2, dt3dt2) public static void composeRT(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1, Mat dt3dt1, Mat dt3dr2, Mat dt3dt2) { composeRT_0(rvec1.nativeObj, tvec1.nativeObj, rvec2.nativeObj, tvec2.nativeObj, rvec3.nativeObj, tvec3.nativeObj, dr3dr1.nativeObj, dr3dt1.nativeObj, dr3dr2.nativeObj, dr3dt2.nativeObj, dt3dr1.nativeObj, dt3dt1.nativeObj, dt3dr2.nativeObj, dt3dt2.nativeObj); return; } //javadoc: composeRT(rvec1, tvec1, rvec2, tvec2, rvec3, tvec3) public static void composeRT(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3) { composeRT_1(rvec1.nativeObj, tvec1.nativeObj, rvec2.nativeObj, tvec2.nativeObj, rvec3.nativeObj, tvec3.nativeObj); return; } // // C++: void computeCorrespondEpilines(Mat points, int whichImage, Mat F, Mat& lines) // //javadoc: computeCorrespondEpilines(points, whichImage, F, lines) public static void computeCorrespondEpilines(Mat points, int whichImage, Mat F, Mat lines) { computeCorrespondEpilines_0(points.nativeObj, whichImage, F.nativeObj, lines.nativeObj); return; } // // C++: void convertPointsFromHomogeneous(Mat src, Mat& dst) // //javadoc: convertPointsFromHomogeneous(src, dst) public static void convertPointsFromHomogeneous(Mat src, Mat dst) { convertPointsFromHomogeneous_0(src.nativeObj, dst.nativeObj); return; } // // C++: void convertPointsToHomogeneous(Mat src, Mat& dst) // //javadoc: convertPointsToHomogeneous(src, dst) public static void convertPointsToHomogeneous(Mat src, Mat dst) { convertPointsToHomogeneous_0(src.nativeObj, dst.nativeObj); return; } // // C++: void correctMatches(Mat F, Mat points1, Mat points2, Mat& newPoints1, Mat& newPoints2) // //javadoc: correctMatches(F, points1, points2, newPoints1, newPoints2) public static void correctMatches(Mat F, Mat points1, Mat points2, Mat newPoints1, Mat newPoints2) { correctMatches_0(F.nativeObj, points1.nativeObj, points2.nativeObj, newPoints1.nativeObj, newPoints2.nativeObj); return; } // // C++: void decomposeEssentialMat(Mat E, Mat& R1, Mat& R2, Mat& t) // //javadoc: decomposeEssentialMat(E, R1, R2, t) public static void decomposeEssentialMat(Mat E, Mat R1, Mat R2, Mat t) { decomposeEssentialMat_0(E.nativeObj, R1.nativeObj, R2.nativeObj, t.nativeObj); return; } // // C++: void decomposeProjectionMatrix(Mat projMatrix, Mat& cameraMatrix, Mat& rotMatrix, Mat& transVect, Mat& rotMatrixX = Mat(), Mat& rotMatrixY = Mat(), Mat& rotMatrixZ = Mat(), Mat& eulerAngles = Mat()) // //javadoc: decomposeProjectionMatrix(projMatrix, cameraMatrix, rotMatrix, transVect, rotMatrixX, rotMatrixY, rotMatrixZ, eulerAngles) public static void decomposeProjectionMatrix(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX, Mat rotMatrixY, Mat rotMatrixZ, Mat eulerAngles) { decomposeProjectionMatrix_0(projMatrix.nativeObj, cameraMatrix.nativeObj, rotMatrix.nativeObj, transVect.nativeObj, rotMatrixX.nativeObj, rotMatrixY.nativeObj, rotMatrixZ.nativeObj, eulerAngles.nativeObj); return; } //javadoc: decomposeProjectionMatrix(projMatrix, cameraMatrix, rotMatrix, transVect) public static void decomposeProjectionMatrix(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect) { decomposeProjectionMatrix_1(projMatrix.nativeObj, cameraMatrix.nativeObj, rotMatrix.nativeObj, transVect.nativeObj); return; } // // C++: void drawChessboardCorners(Mat& image, Size patternSize, vector_Point2f corners, bool patternWasFound) // //javadoc: drawChessboardCorners(image, patternSize, corners, patternWasFound) public static void drawChessboardCorners(Mat image, Size patternSize, MatOfPoint2f corners, boolean patternWasFound) { Mat corners_mat = corners; drawChessboardCorners_0(image.nativeObj, patternSize.width, patternSize.height, corners_mat.nativeObj, patternWasFound); return; } // // C++: void filterSpeckles(Mat& img, double newVal, int maxSpeckleSize, double maxDiff, Mat& buf = Mat()) // //javadoc: filterSpeckles(img, newVal, maxSpeckleSize, maxDiff, buf) public static void filterSpeckles(Mat img, double newVal, int maxSpeckleSize, double maxDiff, Mat buf) { filterSpeckles_0(img.nativeObj, newVal, maxSpeckleSize, maxDiff, buf.nativeObj); return; } //javadoc: filterSpeckles(img, newVal, maxSpeckleSize, maxDiff) public static void filterSpeckles(Mat img, double newVal, int maxSpeckleSize, double maxDiff) { filterSpeckles_1(img.nativeObj, newVal, maxSpeckleSize, maxDiff); return; } // // C++: void matMulDeriv(Mat A, Mat B, Mat& dABdA, Mat& dABdB) // //javadoc: matMulDeriv(A, B, dABdA, dABdB) public static void matMulDeriv(Mat A, Mat B, Mat dABdA, Mat dABdB) { matMulDeriv_0(A.nativeObj, B.nativeObj, dABdA.nativeObj, dABdB.nativeObj); return; } // // C++: void projectPoints(vector_Point3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, vector_double distCoeffs, vector_Point2f& imagePoints, Mat& jacobian = Mat(), double aspectRatio = 0) // //javadoc: projectPoints(objectPoints, rvec, tvec, cameraMatrix, distCoeffs, imagePoints, jacobian, aspectRatio) public static void projectPoints(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints, Mat jacobian, double aspectRatio) { Mat objectPoints_mat = objectPoints; Mat distCoeffs_mat = distCoeffs; Mat imagePoints_mat = imagePoints; projectPoints_0(objectPoints_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, imagePoints_mat.nativeObj, jacobian.nativeObj, aspectRatio); return; } //javadoc: projectPoints(objectPoints, rvec, tvec, cameraMatrix, distCoeffs, imagePoints) public static void projectPoints(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints) { Mat objectPoints_mat = objectPoints; Mat distCoeffs_mat = distCoeffs; Mat imagePoints_mat = imagePoints; projectPoints_1(objectPoints_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, imagePoints_mat.nativeObj); return; } // // C++: void reprojectImageTo3D(Mat disparity, Mat& _3dImage, Mat Q, bool handleMissingValues = false, int ddepth = -1) // //javadoc: reprojectImageTo3D(disparity, _3dImage, Q, handleMissingValues, ddepth) public static void reprojectImageTo3D(Mat disparity, Mat _3dImage, Mat Q, boolean handleMissingValues, int ddepth) { reprojectImageTo3D_0(disparity.nativeObj, _3dImage.nativeObj, Q.nativeObj, handleMissingValues, ddepth); return; } //javadoc: reprojectImageTo3D(disparity, _3dImage, Q, handleMissingValues) public static void reprojectImageTo3D(Mat disparity, Mat _3dImage, Mat Q, boolean handleMissingValues) { reprojectImageTo3D_1(disparity.nativeObj, _3dImage.nativeObj, Q.nativeObj, handleMissingValues); return; } //javadoc: reprojectImageTo3D(disparity, _3dImage, Q) public static void reprojectImageTo3D(Mat disparity, Mat _3dImage, Mat Q) { reprojectImageTo3D_2(disparity.nativeObj, _3dImage.nativeObj, Q.nativeObj); return; } // // C++: void stereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, int flags = CALIB_ZERO_DISPARITY, double alpha = -1, Size newImageSize = Size(), Rect* validPixROI1 = 0, Rect* validPixROI2 = 0) // //javadoc: stereoRectify(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, R1, R2, P1, P2, Q, flags, alpha, newImageSize, validPixROI1, validPixROI2) public static void stereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q, int flags, double alpha, Size newImageSize, Rect validPixROI1, Rect validPixROI2) { double[] validPixROI1_out = new double[4]; double[] validPixROI2_out = new double[4]; stereoRectify_0(cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, R1.nativeObj, R2.nativeObj, P1.nativeObj, P2.nativeObj, Q.nativeObj, flags, alpha, newImageSize.width, newImageSize.height, validPixROI1_out, validPixROI2_out); if(validPixROI1!=null){ validPixROI1.x = (int)validPixROI1_out[0]; validPixROI1.y = (int)validPixROI1_out[1]; validPixROI1.width = (int)validPixROI1_out[2]; validPixROI1.height = (int)validPixROI1_out[3]; } if(validPixROI2!=null){ validPixROI2.x = (int)validPixROI2_out[0]; validPixROI2.y = (int)validPixROI2_out[1]; validPixROI2.width = (int)validPixROI2_out[2]; validPixROI2.height = (int)validPixROI2_out[3]; } return; } //javadoc: stereoRectify(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, R1, R2, P1, P2, Q) public static void stereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q) { stereoRectify_1(cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, R1.nativeObj, R2.nativeObj, P1.nativeObj, P2.nativeObj, Q.nativeObj); return; } // // C++: void triangulatePoints(Mat projMatr1, Mat projMatr2, Mat projPoints1, Mat projPoints2, Mat& points4D) // //javadoc: triangulatePoints(projMatr1, projMatr2, projPoints1, projPoints2, points4D) public static void triangulatePoints(Mat projMatr1, Mat projMatr2, Mat projPoints1, Mat projPoints2, Mat points4D) { triangulatePoints_0(projMatr1.nativeObj, projMatr2.nativeObj, projPoints1.nativeObj, projPoints2.nativeObj, points4D.nativeObj); return; } // // C++: void validateDisparity(Mat& disparity, Mat cost, int minDisparity, int numberOfDisparities, int disp12MaxDisp = 1) // //javadoc: validateDisparity(disparity, cost, minDisparity, numberOfDisparities, disp12MaxDisp) public static void validateDisparity(Mat disparity, Mat cost, int minDisparity, int numberOfDisparities, int disp12MaxDisp) { validateDisparity_0(disparity.nativeObj, cost.nativeObj, minDisparity, numberOfDisparities, disp12MaxDisp); return; } //javadoc: validateDisparity(disparity, cost, minDisparity, numberOfDisparities) public static void validateDisparity(Mat disparity, Mat cost, int minDisparity, int numberOfDisparities) { validateDisparity_1(disparity.nativeObj, cost.nativeObj, minDisparity, numberOfDisparities); return; } // // C++: void distortPoints(Mat undistorted, Mat& distorted, Mat K, Mat D, double alpha = 0) // //javadoc: distortPoints(undistorted, distorted, K, D, alpha) public static void distortPoints(Mat undistorted, Mat distorted, Mat K, Mat D, double alpha) { distortPoints_0(undistorted.nativeObj, distorted.nativeObj, K.nativeObj, D.nativeObj, alpha); return; } //javadoc: distortPoints(undistorted, distorted, K, D) public static void distortPoints(Mat undistorted, Mat distorted, Mat K, Mat D) { distortPoints_1(undistorted.nativeObj, distorted.nativeObj, K.nativeObj, D.nativeObj); return; } // // C++: void estimateNewCameraMatrixForUndistortRectify(Mat K, Mat D, Size image_size, Mat R, Mat& P, double balance = 0.0, Size new_size = Size(), double fov_scale = 1.0) // //javadoc: estimateNewCameraMatrixForUndistortRectify(K, D, image_size, R, P, balance, new_size, fov_scale) public static void estimateNewCameraMatrixForUndistortRectify(Mat K, Mat D, Size image_size, Mat R, Mat P, double balance, Size new_size, double fov_scale) { estimateNewCameraMatrixForUndistortRectify_0(K.nativeObj, D.nativeObj, image_size.width, image_size.height, R.nativeObj, P.nativeObj, balance, new_size.width, new_size.height, fov_scale); return; } //javadoc: estimateNewCameraMatrixForUndistortRectify(K, D, image_size, R, P) public static void estimateNewCameraMatrixForUndistortRectify(Mat K, Mat D, Size image_size, Mat R, Mat P) { estimateNewCameraMatrixForUndistortRectify_1(K.nativeObj, D.nativeObj, image_size.width, image_size.height, R.nativeObj, P.nativeObj); return; } // // C++: void initUndistortRectifyMap(Mat K, Mat D, Mat R, Mat P, Size size, int m1type, Mat& map1, Mat& map2) // //javadoc: initUndistortRectifyMap(K, D, R, P, size, m1type, map1, map2) public static void initUndistortRectifyMap(Mat K, Mat D, Mat R, Mat P, Size size, int m1type, Mat map1, Mat map2) { initUndistortRectifyMap_0(K.nativeObj, D.nativeObj, R.nativeObj, P.nativeObj, size.width, size.height, m1type, map1.nativeObj, map2.nativeObj); return; } // // C++: void projectPoints(vector_Point3f objectPoints, vector_Point2f& imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha = 0, Mat& jacobian = Mat()) // //javadoc: projectPoints(objectPoints, imagePoints, rvec, tvec, K, D, alpha, jacobian) public static void projectPoints(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha, Mat jacobian) { Mat objectPoints_mat = objectPoints; Mat imagePoints_mat = imagePoints; projectPoints_2(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, K.nativeObj, D.nativeObj, alpha, jacobian.nativeObj); return; } //javadoc: projectPoints(objectPoints, imagePoints, rvec, tvec, K, D) public static void projectPoints(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat rvec, Mat tvec, Mat K, Mat D) { Mat objectPoints_mat = objectPoints; Mat imagePoints_mat = imagePoints; projectPoints_3(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, K.nativeObj, D.nativeObj); return; } // // C++: void stereoRectify(Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat tvec, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, int flags, Size newImageSize = Size(), double balance = 0.0, double fov_scale = 1.0) // //javadoc: stereoRectify(K1, D1, K2, D2, imageSize, R, tvec, R1, R2, P1, P2, Q, flags, newImageSize, balance, fov_scale) public static void stereoRectify(Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat tvec, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q, int flags, Size newImageSize, double balance, double fov_scale) { stereoRectify_2(K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, tvec.nativeObj, R1.nativeObj, R2.nativeObj, P1.nativeObj, P2.nativeObj, Q.nativeObj, flags, newImageSize.width, newImageSize.height, balance, fov_scale); return; } //javadoc: stereoRectify(K1, D1, K2, D2, imageSize, R, tvec, R1, R2, P1, P2, Q, flags) public static void stereoRectify(Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat tvec, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q, int flags) { stereoRectify_3(K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, tvec.nativeObj, R1.nativeObj, R2.nativeObj, P1.nativeObj, P2.nativeObj, Q.nativeObj, flags); return; } // // C++: void undistortImage(Mat distorted, Mat& undistorted, Mat K, Mat D, Mat Knew = cv::Mat(), Size new_size = Size()) // //javadoc: undistortImage(distorted, undistorted, K, D, Knew, new_size) public static void undistortImage(Mat distorted, Mat undistorted, Mat K, Mat D, Mat Knew, Size new_size) { undistortImage_0(distorted.nativeObj, undistorted.nativeObj, K.nativeObj, D.nativeObj, Knew.nativeObj, new_size.width, new_size.height); return; } //javadoc: undistortImage(distorted, undistorted, K, D) public static void undistortImage(Mat distorted, Mat undistorted, Mat K, Mat D) { undistortImage_1(distorted.nativeObj, undistorted.nativeObj, K.nativeObj, D.nativeObj); return; } // // C++: void undistortPoints(Mat distorted, Mat& undistorted, Mat K, Mat D, Mat R = Mat(), Mat P = Mat()) // //javadoc: undistortPoints(distorted, undistorted, K, D, R, P) public static void undistortPoints(Mat distorted, Mat undistorted, Mat K, Mat D, Mat R, Mat P) { undistortPoints_0(distorted.nativeObj, undistorted.nativeObj, K.nativeObj, D.nativeObj, R.nativeObj, P.nativeObj); return; } //javadoc: undistortPoints(distorted, undistorted, K, D) public static void undistortPoints(Mat distorted, Mat undistorted, Mat K, Mat D) { undistortPoints_1(distorted.nativeObj, undistorted.nativeObj, K.nativeObj, D.nativeObj); return; } // C++: Mat estimateAffine2D(Mat from, Mat to, Mat& inliers = Mat(), int method = RANSAC, double ransacReprojThreshold = 3, size_t maxIters = 2000, double confidence = 0.99, size_t refineIters = 10) private static native long estimateAffine2D_0(long from_nativeObj, long to_nativeObj, long inliers_nativeObj, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters); private static native long estimateAffine2D_1(long from_nativeObj, long to_nativeObj); // C++: Mat estimateAffinePartial2D(Mat from, Mat to, Mat& inliers = Mat(), int method = RANSAC, double ransacReprojThreshold = 3, size_t maxIters = 2000, double confidence = 0.99, size_t refineIters = 10) private static native long estimateAffinePartial2D_0(long from_nativeObj, long to_nativeObj, long inliers_nativeObj, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters); private static native long estimateAffinePartial2D_1(long from_nativeObj, long to_nativeObj); // C++: Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix, int method = RANSAC, double prob = 0.999, double threshold = 1.0, Mat& mask = Mat()) private static native long findEssentialMat_0(long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, int method, double prob, double threshold, long mask_nativeObj); private static native long findEssentialMat_1(long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, int method, double prob, double threshold); private static native long findEssentialMat_2(long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj); // C++: Mat findEssentialMat(Mat points1, Mat points2, double focal = 1.0, Point2d pp = Point2d(0, 0), int method = RANSAC, double prob = 0.999, double threshold = 1.0, Mat& mask = Mat()) private static native long findEssentialMat_3(long points1_nativeObj, long points2_nativeObj, double focal, double pp_x, double pp_y, int method, double prob, double threshold, long mask_nativeObj); private static native long findEssentialMat_4(long points1_nativeObj, long points2_nativeObj, double focal, double pp_x, double pp_y, int method, double prob, double threshold); private static native long findEssentialMat_5(long points1_nativeObj, long points2_nativeObj); // C++: Mat findFundamentalMat(vector_Point2f points1, vector_Point2f points2, int method = FM_RANSAC, double param1 = 3., double param2 = 0.99, Mat& mask = Mat()) private static native long findFundamentalMat_0(long points1_mat_nativeObj, long points2_mat_nativeObj, int method, double param1, double param2, long mask_nativeObj); private static native long findFundamentalMat_1(long points1_mat_nativeObj, long points2_mat_nativeObj, int method, double param1, double param2); private static native long findFundamentalMat_2(long points1_mat_nativeObj, long points2_mat_nativeObj); // C++: Mat findHomography(vector_Point2f srcPoints, vector_Point2f dstPoints, int method = 0, double ransacReprojThreshold = 3, Mat& mask = Mat(), int maxIters = 2000, double confidence = 0.995) private static native long findHomography_0(long srcPoints_mat_nativeObj, long dstPoints_mat_nativeObj, int method, double ransacReprojThreshold, long mask_nativeObj, int maxIters, double confidence); private static native long findHomography_1(long srcPoints_mat_nativeObj, long dstPoints_mat_nativeObj, int method, double ransacReprojThreshold); private static native long findHomography_2(long srcPoints_mat_nativeObj, long dstPoints_mat_nativeObj); // C++: Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize = Size(), Rect* validPixROI = 0, bool centerPrincipalPoint = false) private static native long getOptimalNewCameraMatrix_0(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, double imageSize_width, double imageSize_height, double alpha, double newImgSize_width, double newImgSize_height, double[] validPixROI_out, boolean centerPrincipalPoint); private static native long getOptimalNewCameraMatrix_1(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, double imageSize_width, double imageSize_height, double alpha); // C++: Mat initCameraMatrix2D(vector_vector_Point3f objectPoints, vector_vector_Point2f imagePoints, Size imageSize, double aspectRatio = 1.0) private static native long initCameraMatrix2D_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, double aspectRatio); private static native long initCameraMatrix2D_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height); // C++: Rect getValidDisparityROI(Rect roi1, Rect roi2, int minDisparity, int numberOfDisparities, int SADWindowSize) private static native double[] getValidDisparityROI_0(int roi1_x, int roi1_y, int roi1_width, int roi1_height, int roi2_x, int roi2_y, int roi2_width, int roi2_height, int minDisparity, int numberOfDisparities, int SADWindowSize); // C++: Vec3d RQDecomp3x3(Mat src, Mat& mtxR, Mat& mtxQ, Mat& Qx = Mat(), Mat& Qy = Mat(), Mat& Qz = Mat()) private static native double[] RQDecomp3x3_0(long src_nativeObj, long mtxR_nativeObj, long mtxQ_nativeObj, long Qx_nativeObj, long Qy_nativeObj, long Qz_nativeObj); private static native double[] RQDecomp3x3_1(long src_nativeObj, long mtxR_nativeObj, long mtxQ_nativeObj); // C++: bool findChessboardCorners(Mat image, Size patternSize, vector_Point2f& corners, int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE) private static native boolean findChessboardCorners_0(long image_nativeObj, double patternSize_width, double patternSize_height, long corners_mat_nativeObj, int flags); private static native boolean findChessboardCorners_1(long image_nativeObj, double patternSize_width, double patternSize_height, long corners_mat_nativeObj); // C++: bool findCirclesGrid(Mat image, Size patternSize, Mat& centers, int flags = CALIB_CB_SYMMETRIC_GRID, Ptr_FeatureDetector blobDetector = SimpleBlobDetector::create()) private static native boolean findCirclesGrid_0(long image_nativeObj, double patternSize_width, double patternSize_height, long centers_nativeObj, int flags); private static native boolean findCirclesGrid_1(long image_nativeObj, double patternSize_width, double patternSize_height, long centers_nativeObj); // C++: bool solvePnP(vector_Point3f objectPoints, vector_Point2f imagePoints, Mat cameraMatrix, vector_double distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE) private static native boolean solvePnP_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, boolean useExtrinsicGuess, int flags); private static native boolean solvePnP_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj); // C++: bool solvePnPRansac(vector_Point3f objectPoints, vector_Point2f imagePoints, Mat cameraMatrix, vector_double distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false, int iterationsCount = 100, float reprojectionError = 8.0, double confidence = 0.99, Mat& inliers = Mat(), int flags = SOLVEPNP_ITERATIVE) private static native boolean solvePnPRansac_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, long inliers_nativeObj, int flags); private static native boolean solvePnPRansac_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj); // C++: bool stereoRectifyUncalibrated(Mat points1, Mat points2, Mat F, Size imgSize, Mat& H1, Mat& H2, double threshold = 5) private static native boolean stereoRectifyUncalibrated_0(long points1_nativeObj, long points2_nativeObj, long F_nativeObj, double imgSize_width, double imgSize_height, long H1_nativeObj, long H2_nativeObj, double threshold); private static native boolean stereoRectifyUncalibrated_1(long points1_nativeObj, long points2_nativeObj, long F_nativeObj, double imgSize_width, double imgSize_height, long H1_nativeObj, long H2_nativeObj); // C++: double calibrateCamera(vector_Mat objectPoints, vector_Mat imagePoints, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)) private static native double calibrateCameraExtended_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, long stdDeviationsIntrinsics_nativeObj, long stdDeviationsExtrinsics_nativeObj, long perViewErrors_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon); private static native double calibrateCameraExtended_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, long stdDeviationsIntrinsics_nativeObj, long stdDeviationsExtrinsics_nativeObj, long perViewErrors_nativeObj, int flags); private static native double calibrateCameraExtended_2(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, long stdDeviationsIntrinsics_nativeObj, long stdDeviationsExtrinsics_nativeObj, long perViewErrors_nativeObj); // C++: double calibrateCamera(vector_Mat objectPoints, vector_Mat imagePoints, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, int flags = 0, TermCriteria criteria = TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)) private static native double calibrateCamera_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon); private static native double calibrateCamera_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, int flags); private static native double calibrateCamera_2(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj); // C++: double sampsonDistance(Mat pt1, Mat pt2, Mat F) private static native double sampsonDistance_0(long pt1_nativeObj, long pt2_nativeObj, long F_nativeObj); // C++: double stereoCalibrate(vector_Mat objectPoints, vector_Mat imagePoints1, vector_Mat imagePoints2, Mat& cameraMatrix1, Mat& distCoeffs1, Mat& cameraMatrix2, Mat& distCoeffs2, Size imageSize, Mat& R, Mat& T, Mat& E, Mat& F, int flags = CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6)) private static native double stereoCalibrate_0(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long E_nativeObj, long F_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon); private static native double stereoCalibrate_1(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long E_nativeObj, long F_nativeObj, int flags); private static native double stereoCalibrate_2(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long E_nativeObj, long F_nativeObj); // C++: double calibrate(vector_Mat objectPoints, vector_Mat imagePoints, Size image_size, Mat& K, Mat& D, vector_Mat& rvecs, vector_Mat& tvecs, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)) private static native double calibrate_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double image_size_width, double image_size_height, long K_nativeObj, long D_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon); private static native double calibrate_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double image_size_width, double image_size_height, long K_nativeObj, long D_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, int flags); private static native double calibrate_2(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double image_size_width, double image_size_height, long K_nativeObj, long D_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj); // C++: double stereoCalibrate(vector_Mat objectPoints, vector_Mat imagePoints1, vector_Mat imagePoints2, Mat& K1, Mat& D1, Mat& K2, Mat& D2, Size imageSize, Mat& R, Mat& T, int flags = fisheye::CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)) private static native double stereoCalibrate_3(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon); private static native double stereoCalibrate_4(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, int flags); private static native double stereoCalibrate_5(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj); // C++: float rectify3Collinear(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat cameraMatrix3, Mat distCoeffs3, vector_Mat imgpt1, vector_Mat imgpt3, Size imageSize, Mat R12, Mat T12, Mat R13, Mat T13, Mat& R1, Mat& R2, Mat& R3, Mat& P1, Mat& P2, Mat& P3, Mat& Q, double alpha, Size newImgSize, Rect* roi1, Rect* roi2, int flags) private static native float rectify3Collinear_0(long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, long cameraMatrix3_nativeObj, long distCoeffs3_nativeObj, long imgpt1_mat_nativeObj, long imgpt3_mat_nativeObj, double imageSize_width, double imageSize_height, long R12_nativeObj, long T12_nativeObj, long R13_nativeObj, long T13_nativeObj, long R1_nativeObj, long R2_nativeObj, long R3_nativeObj, long P1_nativeObj, long P2_nativeObj, long P3_nativeObj, long Q_nativeObj, double alpha, double newImgSize_width, double newImgSize_height, double[] roi1_out, double[] roi2_out, int flags); // C++: int decomposeHomographyMat(Mat H, Mat K, vector_Mat& rotations, vector_Mat& translations, vector_Mat& normals) private static native int decomposeHomographyMat_0(long H_nativeObj, long K_nativeObj, long rotations_mat_nativeObj, long translations_mat_nativeObj, long normals_mat_nativeObj); // C++: int estimateAffine3D(Mat src, Mat dst, Mat& out, Mat& inliers, double ransacThreshold = 3, double confidence = 0.99) private static native int estimateAffine3D_0(long src_nativeObj, long dst_nativeObj, long out_nativeObj, long inliers_nativeObj, double ransacThreshold, double confidence); private static native int estimateAffine3D_1(long src_nativeObj, long dst_nativeObj, long out_nativeObj, long inliers_nativeObj); // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat& R, Mat& t, double focal = 1.0, Point2d pp = Point2d(0, 0), Mat& mask = Mat()) private static native int recoverPose_0(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long R_nativeObj, long t_nativeObj, double focal, double pp_x, double pp_y, long mask_nativeObj); private static native int recoverPose_1(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long R_nativeObj, long t_nativeObj, double focal, double pp_x, double pp_y); private static native int recoverPose_2(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long R_nativeObj, long t_nativeObj); // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat& R, Mat& t, Mat& mask = Mat()) private static native int recoverPose_3(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, long R_nativeObj, long t_nativeObj, long mask_nativeObj); private static native int recoverPose_4(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, long R_nativeObj, long t_nativeObj); // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat& R, Mat& t, double distanceThresh, Mat& mask = Mat(), Mat& triangulatedPoints = Mat()) private static native int recoverPose_5(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, long R_nativeObj, long t_nativeObj, double distanceThresh, long mask_nativeObj, long triangulatedPoints_nativeObj); private static native int recoverPose_6(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, long R_nativeObj, long t_nativeObj, double distanceThresh); // C++: int solveP3P(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, int flags) private static native int solveP3P_0(long objectPoints_nativeObj, long imagePoints_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, int flags); // C++: void Rodrigues(Mat src, Mat& dst, Mat& jacobian = Mat()) private static native void Rodrigues_0(long src_nativeObj, long dst_nativeObj, long jacobian_nativeObj); private static native void Rodrigues_1(long src_nativeObj, long dst_nativeObj); // C++: void calibrationMatrixValues(Mat cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double& fovx, double& fovy, double& focalLength, Point2d& principalPoint, double& aspectRatio) private static native void calibrationMatrixValues_0(long cameraMatrix_nativeObj, double imageSize_width, double imageSize_height, double apertureWidth, double apertureHeight, double[] fovx_out, double[] fovy_out, double[] focalLength_out, double[] principalPoint_out, double[] aspectRatio_out); // C++: void composeRT(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat& rvec3, Mat& tvec3, Mat& dr3dr1 = Mat(), Mat& dr3dt1 = Mat(), Mat& dr3dr2 = Mat(), Mat& dr3dt2 = Mat(), Mat& dt3dr1 = Mat(), Mat& dt3dt1 = Mat(), Mat& dt3dr2 = Mat(), Mat& dt3dt2 = Mat()) private static native void composeRT_0(long rvec1_nativeObj, long tvec1_nativeObj, long rvec2_nativeObj, long tvec2_nativeObj, long rvec3_nativeObj, long tvec3_nativeObj, long dr3dr1_nativeObj, long dr3dt1_nativeObj, long dr3dr2_nativeObj, long dr3dt2_nativeObj, long dt3dr1_nativeObj, long dt3dt1_nativeObj, long dt3dr2_nativeObj, long dt3dt2_nativeObj); private static native void composeRT_1(long rvec1_nativeObj, long tvec1_nativeObj, long rvec2_nativeObj, long tvec2_nativeObj, long rvec3_nativeObj, long tvec3_nativeObj); // C++: void computeCorrespondEpilines(Mat points, int whichImage, Mat F, Mat& lines) private static native void computeCorrespondEpilines_0(long points_nativeObj, int whichImage, long F_nativeObj, long lines_nativeObj); // C++: void convertPointsFromHomogeneous(Mat src, Mat& dst) private static native void convertPointsFromHomogeneous_0(long src_nativeObj, long dst_nativeObj); // C++: void convertPointsToHomogeneous(Mat src, Mat& dst) private static native void convertPointsToHomogeneous_0(long src_nativeObj, long dst_nativeObj); // C++: void correctMatches(Mat F, Mat points1, Mat points2, Mat& newPoints1, Mat& newPoints2) private static native void correctMatches_0(long F_nativeObj, long points1_nativeObj, long points2_nativeObj, long newPoints1_nativeObj, long newPoints2_nativeObj); // C++: void decomposeEssentialMat(Mat E, Mat& R1, Mat& R2, Mat& t) private static native void decomposeEssentialMat_0(long E_nativeObj, long R1_nativeObj, long R2_nativeObj, long t_nativeObj); // C++: void decomposeProjectionMatrix(Mat projMatrix, Mat& cameraMatrix, Mat& rotMatrix, Mat& transVect, Mat& rotMatrixX = Mat(), Mat& rotMatrixY = Mat(), Mat& rotMatrixZ = Mat(), Mat& eulerAngles = Mat()) private static native void decomposeProjectionMatrix_0(long projMatrix_nativeObj, long cameraMatrix_nativeObj, long rotMatrix_nativeObj, long transVect_nativeObj, long rotMatrixX_nativeObj, long rotMatrixY_nativeObj, long rotMatrixZ_nativeObj, long eulerAngles_nativeObj); private static native void decomposeProjectionMatrix_1(long projMatrix_nativeObj, long cameraMatrix_nativeObj, long rotMatrix_nativeObj, long transVect_nativeObj); // C++: void drawChessboardCorners(Mat& image, Size patternSize, vector_Point2f corners, bool patternWasFound) private static native void drawChessboardCorners_0(long image_nativeObj, double patternSize_width, double patternSize_height, long corners_mat_nativeObj, boolean patternWasFound); // C++: void filterSpeckles(Mat& img, double newVal, int maxSpeckleSize, double maxDiff, Mat& buf = Mat()) private static native void filterSpeckles_0(long img_nativeObj, double newVal, int maxSpeckleSize, double maxDiff, long buf_nativeObj); private static native void filterSpeckles_1(long img_nativeObj, double newVal, int maxSpeckleSize, double maxDiff); // C++: void matMulDeriv(Mat A, Mat B, Mat& dABdA, Mat& dABdB) private static native void matMulDeriv_0(long A_nativeObj, long B_nativeObj, long dABdA_nativeObj, long dABdB_nativeObj); // C++: void projectPoints(vector_Point3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, vector_double distCoeffs, vector_Point2f& imagePoints, Mat& jacobian = Mat(), double aspectRatio = 0) private static native void projectPoints_0(long objectPoints_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long imagePoints_mat_nativeObj, long jacobian_nativeObj, double aspectRatio); private static native void projectPoints_1(long objectPoints_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long imagePoints_mat_nativeObj); // C++: void reprojectImageTo3D(Mat disparity, Mat& _3dImage, Mat Q, bool handleMissingValues = false, int ddepth = -1) private static native void reprojectImageTo3D_0(long disparity_nativeObj, long _3dImage_nativeObj, long Q_nativeObj, boolean handleMissingValues, int ddepth); private static native void reprojectImageTo3D_1(long disparity_nativeObj, long _3dImage_nativeObj, long Q_nativeObj, boolean handleMissingValues); private static native void reprojectImageTo3D_2(long disparity_nativeObj, long _3dImage_nativeObj, long Q_nativeObj); // C++: void stereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, int flags = CALIB_ZERO_DISPARITY, double alpha = -1, Size newImageSize = Size(), Rect* validPixROI1 = 0, Rect* validPixROI2 = 0) private static native void stereoRectify_0(long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long R1_nativeObj, long R2_nativeObj, long P1_nativeObj, long P2_nativeObj, long Q_nativeObj, int flags, double alpha, double newImageSize_width, double newImageSize_height, double[] validPixROI1_out, double[] validPixROI2_out); private static native void stereoRectify_1(long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long R1_nativeObj, long R2_nativeObj, long P1_nativeObj, long P2_nativeObj, long Q_nativeObj); // C++: void triangulatePoints(Mat projMatr1, Mat projMatr2, Mat projPoints1, Mat projPoints2, Mat& points4D) private static native void triangulatePoints_0(long projMatr1_nativeObj, long projMatr2_nativeObj, long projPoints1_nativeObj, long projPoints2_nativeObj, long points4D_nativeObj); // C++: void validateDisparity(Mat& disparity, Mat cost, int minDisparity, int numberOfDisparities, int disp12MaxDisp = 1) private static native void validateDisparity_0(long disparity_nativeObj, long cost_nativeObj, int minDisparity, int numberOfDisparities, int disp12MaxDisp); private static native void validateDisparity_1(long disparity_nativeObj, long cost_nativeObj, int minDisparity, int numberOfDisparities); // C++: void distortPoints(Mat undistorted, Mat& distorted, Mat K, Mat D, double alpha = 0) private static native void distortPoints_0(long undistorted_nativeObj, long distorted_nativeObj, long K_nativeObj, long D_nativeObj, double alpha); private static native void distortPoints_1(long undistorted_nativeObj, long distorted_nativeObj, long K_nativeObj, long D_nativeObj); // C++: void estimateNewCameraMatrixForUndistortRectify(Mat K, Mat D, Size image_size, Mat R, Mat& P, double balance = 0.0, Size new_size = Size(), double fov_scale = 1.0) private static native void estimateNewCameraMatrixForUndistortRectify_0(long K_nativeObj, long D_nativeObj, double image_size_width, double image_size_height, long R_nativeObj, long P_nativeObj, double balance, double new_size_width, double new_size_height, double fov_scale); private static native void estimateNewCameraMatrixForUndistortRectify_1(long K_nativeObj, long D_nativeObj, double image_size_width, double image_size_height, long R_nativeObj, long P_nativeObj); // C++: void initUndistortRectifyMap(Mat K, Mat D, Mat R, Mat P, Size size, int m1type, Mat& map1, Mat& map2) private static native void initUndistortRectifyMap_0(long K_nativeObj, long D_nativeObj, long R_nativeObj, long P_nativeObj, double size_width, double size_height, int m1type, long map1_nativeObj, long map2_nativeObj); // C++: void projectPoints(vector_Point3f objectPoints, vector_Point2f& imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha = 0, Mat& jacobian = Mat()) private static native void projectPoints_2(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, long K_nativeObj, long D_nativeObj, double alpha, long jacobian_nativeObj); private static native void projectPoints_3(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, long K_nativeObj, long D_nativeObj); // C++: void stereoRectify(Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat tvec, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, int flags, Size newImageSize = Size(), double balance = 0.0, double fov_scale = 1.0) private static native void stereoRectify_2(long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long tvec_nativeObj, long R1_nativeObj, long R2_nativeObj, long P1_nativeObj, long P2_nativeObj, long Q_nativeObj, int flags, double newImageSize_width, double newImageSize_height, double balance, double fov_scale); private static native void stereoRectify_3(long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long tvec_nativeObj, long R1_nativeObj, long R2_nativeObj, long P1_nativeObj, long P2_nativeObj, long Q_nativeObj, int flags); // C++: void undistortImage(Mat distorted, Mat& undistorted, Mat K, Mat D, Mat Knew = cv::Mat(), Size new_size = Size()) private static native void undistortImage_0(long distorted_nativeObj, long undistorted_nativeObj, long K_nativeObj, long D_nativeObj, long Knew_nativeObj, double new_size_width, double new_size_height); private static native void undistortImage_1(long distorted_nativeObj, long undistorted_nativeObj, long K_nativeObj, long D_nativeObj); // C++: void undistortPoints(Mat distorted, Mat& undistorted, Mat K, Mat D, Mat R = Mat(), Mat P = Mat()) private static native void undistortPoints_0(long distorted_nativeObj, long undistorted_nativeObj, long K_nativeObj, long D_nativeObj, long R_nativeObj, long P_nativeObj); private static native void undistortPoints_1(long distorted_nativeObj, long undistorted_nativeObj, long K_nativeObj, long D_nativeObj); }
monatis/OCVStarter
openCVLibrary330/src/main/java/org/opencv/calib3d/Calib3d.java
Java
mit
96,865
<?php /** * Fluent storage implementation for an OAuth 2.0 Session * * @package lucadegasperi/oauth2-server-laravel * @author Luca Degasperi <luca@lucadegasperi.com> * @copyright Copyright (c) Luca Degasperi * @licence http://mit-license.org/ * @link https://github.com/lucadegasperi/oauth2-server-laravel */ namespace LucaDegasperi\OAuth2Server\Storage; use League\OAuth2\Server\Entity\AccessTokenEntity; use League\OAuth2\Server\Entity\AuthCodeEntity; use League\OAuth2\Server\Storage\SessionInterface; use League\OAuth2\Server\Entity\SessionEntity; use League\OAuth2\Server\Entity\ScopeEntity; use Carbon\Carbon; class FluentSession extends FluentAdapter implements SessionInterface { /** * Get a session from it's identifier * @param string $sessionId * @return \League\OAuth2\Server\Entity\SessionEntity */ public function get($sessionId) { $result = $this->getConnection()->table('oauth_sessions') ->where('oauth_sessions.id', $sessionId) ->first(); if(is_null($result)) { return null; } return (new SessionEntity($this->getServer())) ->setId($result->id) ->setOwner($result->owner_type, $result->owner_id); } /** * Get a session from an access token * @param \League\OAuth2\Server\Entity\AccessTokenEntity $accessToken The access token * @return \League\OAuth2\Server\Entity\SessionEntity */ public function getByAccessToken(AccessTokenEntity $accessToken) { $result = $this->getConnection()->table('oauth_sessions') ->select('oauth_sessions.*') ->join('oauth_access_tokens', 'oauth_sessions.id', '=', 'oauth_access_tokens.session_id') ->where('oauth_access_tokens.id', $accessToken->getId()) ->first(); if (is_null($result)) { return null; } return (new SessionEntity($this->getServer())) ->setId($result->id) ->setOwner($result->owner_type, $result->owner_id); } /** * Get a session's scopes * @param \League\OAuth2\Server\Entity\SessionEntity * @return array Array of \League\OAuth2\Server\Entity\ScopeEntity */ public function getScopes(SessionEntity $session) { // TODO: Check this before pushing $result = $this->getConnection()->table('oauth_session_scopes') ->select('oauth_scopes.*') ->join('oauth_scopes', 'oauth_session_scopes.scope_id', '=', 'oauth_scopes.id') ->where('oauth_session_scopes.session_id', $session->getId()) ->get(); $scopes = []; foreach ($result as $scope) { $scopes[] = (new ScopeEntity($this->getServer()))->hydrate([ 'id' => $scope->id, 'description' => $scope->description, ]); } return $scopes; } /** * Create a new session * @param string $ownerType Session owner's type (user, client) * @param string $ownerId Session owner's ID * @param string $clientId Client ID * @param string $clientRedirectUri Client redirect URI (default = null) * @return integer The session's ID */ public function create($ownerType, $ownerId, $clientId, $clientRedirectUri = null) { return $this->getConnection()->table('oauth_sessions')->insertGetId([ 'client_id' => $clientId, 'owner_type' => $ownerType, 'owner_id' => $ownerId, 'client_redirect_uri' => $clientRedirectUri, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ]); } /** * Associate a scope with a session * @param \League\OAuth2\Server\Entity\SessionEntity $session * @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scopes ID might be an integer or string * @return void */ public function associateScope(SessionEntity $session, ScopeEntity $scope) { $this->getConnection()->table('oauth_session_scopes')->insert([ 'session_id' => $session->getId(), 'scope_id' => $scope->getId(), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ]); } /** * Get a session from an auth code * @param \League\OAuth2\Server\Entity\AuthCodeEntity $authCode The auth code * @return \League\OAuth2\Server\Entity\SessionEntity */ public function getByAuthCode(AuthCodeEntity $authCode) { $result = $this->getConnection()->table('oauth_sessions') ->select('oauth_sessions.*') ->join('oauth_auth_codes', 'oauth_sessions.id', '=', 'oauth_auth_codes.session_id') ->where('oauth_auth_codes.id', $authCode->getId()) ->first(); if (is_null($result)) { return null; } return (new SessionEntity($this->getServer())) ->setId($result->id) ->setOwner($result->owner_type, $result->owner_id); } }
mantvydasb/jotr
apis/vendor/lucadegasperi/oauth2-server-laravel/src/Storage/FluentSession.php
PHP
mit
5,220
/** * jQuery Prompt21 * =============== * A minimalist jQuery prompt plugin for the 21st Century. * Created with JavaScript and <3 by the @jillix developers. * */ (function ($) { /** * unflattenObject * Converts a flat object to an unflatten one * * @name unflattenObject * @function * @param {Object} flat The flat object that should be converted * @return {Object} Unflatten object */ var Utils = {}; Utils.unflattenObject = function(flat) { var result = {}; var parentObj = result; var keys = Object.keys(flat); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var subkeys = key.split('.'); var last = subkeys.pop(); for (var ii = 0; ii < subkeys.length; ++ii) { var subkey = subkeys[ii]; parentObj[subkey] = typeof parentObj[subkey] === 'undefined' ? {} : parentObj[subkey]; parentObj = parentObj[subkey]; } parentObj[last] = flat[key]; parentObj = result; } return result; } /** * prompt21 * Initializes a new instance of Prompt21. * * Example: * * ```js * var p21 = $(".container").prompt21(); * ``` * * @name prompt21 * @function * @param {Object} opt_options The options for Prompt21 instance. * * - `cancel` (String): The cancel button jQuery selector (default: `"button.cancel"`). * - `showFunc` (String): The jQuery function called to show the form (default: `"fadeIn"`). * - `hideFunc` (String): The jQuery function called to hide the form (default: `"fadeOut"`). * - `form` (String): The form jQuery selector (default: `"form"`). * * @return {Prompt21} An object containing: * * - `getData` (Function): The `getData` function. See below. */ var Prompt21 = $.fn.prompt21 = function (opt_options) { var $self = this; var settings = $.extend(opt_options, Prompt21.defaults); var $cancelButton = $(settings.cancel, $self); var $form = $(settings.form, $self); $self.hide(); $cancelButton.on("click", function () { $self[settings.hideFunc](); $form[0].reset(); return false; }); /** * getData * Shows the popup and calls the callback function when the OK button is clicked. * * @name getData * @function * @param {Function} callback The callback function. * @return {undefined} */ function getData (callback) { $self[settings.showFunc].call($self, function () { $(":input:first", $form).focus(); }); $form.on("submit", function () { var data = {}; $("[name]:input", $form).each(function() { var $this = $(this); var name = $this.attr("name"); var value = $this.val(); if ($this.attr("data-parse") === "json") { try { value = JSON.parse(value); } catch (e) {}; } data[name] = value; }); data = Utils.unflattenObject(data); callback(null, data); $self[settings.hideFunc](); return false; }); } return { getData: getData }; }; // Version Prompt21.version = "1.1.0"; // Defaults Prompt21.defaults = { cancel: "button.cancel", showFunc: "fadeIn", hideFunc: "fadeOut", form: "form" }; })($);
kennynaoh/cdnjs
ajax/libs/jquery-prompt21/1.1.0/jquery-prompt21.js
JavaScript
mit
3,832
(function ($) { /*** * A sample AJAX data store implementation. * Right now, it's hooked up to load search results from Octopart, but can * easily be extended to support any JSONP-compatible backend that accepts paging parameters. */ function RemoteModel() { // private var PAGESIZE = 50; var data = {length: 0}; var searchstr = ""; var sortcol = null; var sortdir = 1; var h_request = null; var req = null; // ajax request // events var onDataLoading = new Slick.Event(); var onDataLoaded = new Slick.Event(); function init() { } function isDataLoaded(from, to) { for (var i = from; i <= to; i++) { if (data[i] == undefined || data[i] == null) { return false; } } return true; } function clear() { for (var key in data) { delete data[key]; } data.length = 0; } function ensureData(from, to) { if (req) { req.abort(); for (var i = req.fromPage; i <= req.toPage; i++) data[i * PAGESIZE] = undefined; } if (from < 0) { from = 0; } if (data.length > 0) { to = Math.min(to, data.length - 1); } var fromPage = Math.floor(from / PAGESIZE); var toPage = Math.floor(to / PAGESIZE); while (data[fromPage * PAGESIZE] !== undefined && fromPage < toPage) fromPage++; while (data[toPage * PAGESIZE] !== undefined && fromPage < toPage) toPage--; if (fromPage > toPage || ((fromPage == toPage) && data[fromPage * PAGESIZE] !== undefined)) { // TODO: look-ahead onDataLoaded.notify({from: from, to: to}); return; } var url = "http://octopart.com/api/v3/parts/search?apikey=68b25f31&include[]=short_description&show[]=uid&show[]=manufacturer&show[]=mpn&show[]=brand&show[]=octopart_url&show[]=short_description&q=" + searchstr + "&start=" + (fromPage * PAGESIZE) + "&limit=" + (((toPage - fromPage) * PAGESIZE) + PAGESIZE); if (sortcol != null) { url += ("&sortby=" + sortcol + ((sortdir > 0) ? "+asc" : "+desc")); } if (h_request != null) { clearTimeout(h_request); } h_request = setTimeout(function () { for (var i = fromPage; i <= toPage; i++) data[i * PAGESIZE] = null; // null indicates a 'requested but not available yet' onDataLoading.notify({from: from, to: to}); req = $.jsonp({ url: url, callbackParameter: "callback", cache: true, success: onSuccess, error: function () { onError(fromPage, toPage) } }); req.fromPage = fromPage; req.toPage = toPage; }, 50); } function onError(fromPage, toPage) { alert("error loading pages " + fromPage + " to " + toPage); } function onSuccess(resp) { var from = resp.request.start, to = from + resp.results.length; data.length = Math.min(parseInt(resp.hits),1000); // limitation of the API for (var i = 0; i < resp.results.length; i++) { var item = resp.results[i].item; data[from + i] = item; data[from + i].index = from + i; } req = null; onDataLoaded.notify({from: from, to: to}); } function reloadData(from, to) { for (var i = from; i <= to; i++) delete data[i]; ensureData(from, to); } function setSort(column, dir) { sortcol = column; sortdir = dir; clear(); } function setSearch(str) { searchstr = str; clear(); } init(); return { // properties "data": data, // methods "clear": clear, "isDataLoaded": isDataLoaded, "ensureData": ensureData, "reloadData": reloadData, "setSort": setSort, "setSearch": setSearch, // events "onDataLoading": onDataLoading, "onDataLoaded": onDataLoaded }; } // Slick.Data.RemoteModel $.extend(true, window, { Slick: { Data: { RemoteModel: RemoteModel }}}); })(jQuery);
jonobr1/cdnjs
ajax/libs/6pac-slickgrid/2.3.18/slick.remotemodel.js
JavaScript
mit
4,126
// DATA_TEMPLATE: empty_table oTest.fnStart( "fnRowCallback" ); /* Note - fnRowCallback MUST return the first arguments (modified or not) */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "bDeferRender": true } ); var oSettings = oTable.fnSettings(); var mPass; oTest.fnWaitTest( "Default should be null", null, function () { return oSettings.fnRowCallback == null; } ); oTest.fnWaitTest( "Four arguments passed", function () { oSession.fnRestore(); mPass = -1; $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "bDeferRender": true, "fnRowCallback": function ( nTr ) { mPass = arguments.length; return nTr; } } ); }, function () { return mPass == 4; } ); oTest.fnWaitTest( "fnRowCallback called once for each drawn row", function () { oSession.fnRestore(); mPass = 0; $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "bDeferRender": true, "fnRowCallback": function ( nTr, asData, iDrawIndex, iDataIndex ) { mPass++; return nTr; } } ); }, function () { return mPass == 10; } ); oTest.fnWaitTest( "fnRowCallback allows us to alter row information", function () { oSession.fnRestore(); $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "bDeferRender": true, "fnRowCallback": function ( nTr, asData, iDrawIndex, iDataIndex ) { $(nTr).addClass('unit_test'); return nTr; } } ); }, function () { return $('#example tbody tr:eq(1)').hasClass('unit_test'); } ); oTest.fnWaitTest( "Data array has length matching columns", function () { oSession.fnRestore(); mPass = true; $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "bDeferRender": true, "fnRowCallback": function ( nTr, asData, iDrawIndex, iDataIndex ) { if ( asData.length != 5 ) mPass = false; return nTr; } } ); }, function () { return mPass; } ); oTest.fnWaitTest( "Data array has length matching columns", function () { oSession.fnRestore(); mPass = true; var iCount = 0; $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "bDeferRender": true, "fnRowCallback": function ( nTr, asData, iDrawIndex, iDataIndex ) { if ( iCount != iDrawIndex ) mPass = false; iCount++; return nTr; } } ); }, function () { return mPass; } ); oTest.fnComplete(); } );
nicodee/mestglobalcommunity
scripts/admin/vendors/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnRowCallback.js
JavaScript
mit
2,715
(function(){function e(){var e="Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning",t="ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp spps spsv sv tee cat cd cp h history kill lp ls mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir erase rd ren type % \\?";this.regexList=[{regex:/#.*$/gm,css:"comments"},{regex:/\$[a-zA-Z0-9]+\b/g,css:"value"},{regex:/\-[a-zA-Z]+\b/g,css:"keyword"},{regex:SyntaxHighlighter.regexLib.doubleQuotedString,css:"string"},{regex:SyntaxHighlighter.regexLib.singleQuotedString,css:"string"},{regex:RegExp(this.getKeywords(e),"gmi"),css:"keyword"},{regex:RegExp(this.getKeywords(t),"gmi"),css:"keyword"}]}"undefined"!=typeof require?SyntaxHighlighter=require("shCore").SyntaxHighlighter:null,e.prototype=new SyntaxHighlighter.Highlighter,e.aliases=["powershell","ps"],SyntaxHighlighter.brushes.PowerShell=e,"undefined"!=typeof exports?exports.Brush=e:null})();
brunoksato/cdnjs
ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushPowerShell.min.js
JavaScript
mit
2,810
/* Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ //>>built define("dojo/request/xhr",["../errors/RequestError","./watch","./handlers","./util","../has"],function(_1,_2,_3,_4,_5){ _5.add("native-xhr",function(){ return typeof XMLHttpRequest!=="undefined"; }); _5.add("dojo-force-activex-xhr",function(){ return _5("activex")&&!document.addEventListener&&window.location.protocol==="file:"; }); _5.add("native-xhr2",function(){ if(!_5("native-xhr")){ return; } var x=new XMLHttpRequest(); return typeof x["addEventListener"]!=="undefined"&&(typeof opera==="undefined"||typeof x["upload"]!=="undefined"); }); _5.add("native-formdata",function(){ return typeof FormData==="function"; }); function _6(_7,_8){ var _9=_7.xhr; _7.status=_7.xhr.status; _7.text=_9.responseText; if(_7.options.handleAs==="xml"){ _7.data=_9.responseXML; } if(!_8){ try{ _3(_7); } catch(e){ _8=e; } } if(_8){ this.reject(_8); }else{ if(_4.checkStatus(_9.status)){ this.resolve(_7); }else{ _8=new _1("Unable to load "+_7.url+" status: "+_9.status,_7); this.reject(_8); } } }; var _a,_b,_c,_d; if(_5("native-xhr2")){ _a=function(_e){ return !this.isFulfilled(); }; _d=function(_f,_10){ _10.xhr.abort(); }; _c=function(_11,dfd,_12){ function _13(evt){ dfd.handleResponse(_12); }; function _14(evt){ var _15=evt.target; var _16=new _1("Unable to load "+_12.url+" status: "+_15.status,_12); dfd.handleResponse(_12,_16); }; function _17(evt){ if(evt.lengthComputable){ _12.loaded=evt.loaded; _12.total=evt.total; dfd.progress(_12); } }; _11.addEventListener("load",_13,false); _11.addEventListener("error",_14,false); _11.addEventListener("progress",_17,false); return function(){ _11.removeEventListener("load",_13,false); _11.removeEventListener("error",_14,false); _11.removeEventListener("progress",_17,false); }; }; }else{ _a=function(_18){ return _18.xhr.readyState; }; _b=function(_19){ return 4===_19.xhr.readyState; }; _d=function(dfd,_1a){ var xhr=_1a.xhr; var _1b=typeof xhr.abort; if(_1b==="function"||_1b==="object"||_1b==="unknown"){ xhr.abort(); } }; } var _1c,_1d={data:null,query:null,sync:false,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded"}}; function xhr(url,_1e,_1f){ var _20=_4.parseArgs(url,_4.deepCreate(_1d,_1e),_5("native-formdata")&&_1e&&_1e.data&&_1e.data instanceof FormData); url=_20.url; _1e=_20.options; var _21,_22=function(){ _21&&_21(); }; var dfd=_4.deferred(_20,_d,_a,_b,_6,_22); var _23=_20.xhr=xhr._create(); if(!_23){ dfd.cancel(new _1("XHR was not created")); return _1f?dfd:dfd.promise; } _20.getHeader=function(_24){ return this.xhr.getResponseHeader(_24); }; if(_c){ _21=_c(_23,dfd,_20); } var _25=_1e.data,_26=!_1e.sync,_27=_1e.method; try{ _23.open(_27,url,_26,_1e.user||_1c,_1e.password||_1c); if(_1e.withCredentials){ _23.withCredentials=_1e.withCredentials; } var _28=_1e.headers,_29; if(_28){ for(var hdr in _28){ if(hdr.toLowerCase()==="content-type"){ _29=_28[hdr]; }else{ if(_28[hdr]){ _23.setRequestHeader(hdr,_28[hdr]); } } } } if(_29&&_29!==false){ _23.setRequestHeader("Content-Type",_29); } if(!_28||!("X-Requested-With" in _28)){ _23.setRequestHeader("X-Requested-With","XMLHttpRequest"); } if(_4.notify){ _4.notify.emit("send",_20,dfd.promise.cancel); } _23.send(_25); } catch(e){ dfd.reject(e); } _2(dfd); _23=null; return _1f?dfd:dfd.promise; }; xhr._create=function(){ throw new Error("XMLHTTP not available"); }; if(_5("native-xhr")&&!_5("dojo-force-activex-xhr")){ xhr._create=function(){ return new XMLHttpRequest(); }; }else{ if(_5("activex")){ try{ new ActiveXObject("Msxml2.XMLHTTP"); xhr._create=function(){ return new ActiveXObject("Msxml2.XMLHTTP"); }; } catch(e){ try{ new ActiveXObject("Microsoft.XMLHTTP"); xhr._create=function(){ return new ActiveXObject("Microsoft.XMLHTTP"); }; } catch(e){ } } } } _4.addCommonMethods(xhr); return xhr; });
simudream/cdnjs
ajax/libs/dojo/1.8.2/request/xhr.js
JavaScript
mit
3,957
/* This is a compiled file, you should be editing the file in the templates directory */ .pace.pace-inactive { display: none; } .pace { -webkit-pointer-events: none; pointer-events: none; -webkit-user-select: none; -moz-user-select: none; user-select: none; z-index: 2000; position: fixed; height: 60px; width: 100px; margin: auto; top: 0; left: 0; right: 0; bottom: 0; } .pace .pace-progress { z-index: 2000; position: absolute; height: 60px; width: 100px; -webkit-transform: translate3d(0, 0, 0) !important; -ms-transform: translate3d(0, 0, 0) !important; transform: translate3d(0, 0, 0) !important; } .pace .pace-progress:before { content: attr(data-progress-text); text-align: center; color: #fff; background: #fcd25a; border-radius: 50%; font-family: "Helvetica Neue", sans-serif; font-size: 14px; font-weight: 100; line-height: 1; padding: 20% 0 7px; width: 50%; height: 40%; margin: 10px 0 0 30px; display: block; z-index: 999; position: absolute; } .pace .pace-activity { font-size: 15px; line-height: 1; z-index: 2000; position: absolute; height: 60px; width: 100px; display: block; -webkit-animation: pace-theme-center-atom-spin 2s linear infinite; -moz-animation: pace-theme-center-atom-spin 2s linear infinite; -o-animation: pace-theme-center-atom-spin 2s linear infinite; animation: pace-theme-center-atom-spin 2s linear infinite; } .pace .pace-activity { border-radius: 50%; border: 5px solid #fcd25a; content: ' '; display: block; position: absolute; top: 0; left: 0; height: 60px; width: 100px; } .pace .pace-activity:after { border-radius: 50%; border: 5px solid #fcd25a; content: ' '; display: block; position: absolute; top: -5px; left: -5px; height: 60px; width: 100px; -webkit-transform: rotate(60deg); -moz-transform: rotate(60deg); -o-transform: rotate(60deg); transform: rotate(60deg); } .pace .pace-activity:before { border-radius: 50%; border: 5px solid #fcd25a; content: ' '; display: block; position: absolute; top: -5px; left: -5px; height: 60px; width: 100px; -webkit-transform: rotate(120deg); -moz-transform: rotate(120deg); -o-transform: rotate(120deg); transform: rotate(120deg); } @-webkit-keyframes pace-theme-center-atom-spin { 0% { -webkit-transform: rotate(0deg) } 100% { -webkit-transform: rotate(359deg) } } @-moz-keyframes pace-theme-center-atom-spin { 0% { -moz-transform: rotate(0deg) } 100% { -moz-transform: rotate(359deg) } } @-o-keyframes pace-theme-center-atom-spin { 0% { -o-transform: rotate(0deg) } 100% { -o-transform: rotate(359deg) } } @keyframes pace-theme-center-atom-spin { 0% { transform: rotate(0deg) } 100% { transform: rotate(359deg) } }
melvinsembrano/cdnjs
ajax/libs/pace/1.0.1/themes/yellow/pace-theme-center-atom.css
CSS
mit
2,806
<?php /* * This file is part of the Monolog package. * * (c) Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Acme; class Tester { public function test($handler, $record) { $handler->handle($record); } } function tester($handler, $record) { $handler->handle($record); } namespace Monolog\Processor; use Monolog\Logger; use Monolog\TestCase; use Monolog\Handler\TestHandler; class IntrospectionProcessorTest extends TestCase { public function getHandler() { $processor = new IntrospectionProcessor(); $handler = new TestHandler(); $handler->pushProcessor($processor); return $handler; } public function testProcessorFromClass() { $handler = $this->getHandler(); $tester = new \Acme\Tester; $tester->test($handler, $this->getRecord()); list($record) = $handler->getRecords(); $this->assertEquals(__FILE__, $record['extra']['file']); $this->assertEquals(18, $record['extra']['line']); $this->assertEquals('Acme\Tester', $record['extra']['class']); $this->assertEquals('test', $record['extra']['function']); } public function testProcessorFromFunc() { $handler = $this->getHandler(); \Acme\tester($handler, $this->getRecord()); list($record) = $handler->getRecords(); $this->assertEquals(__FILE__, $record['extra']['file']); $this->assertEquals(24, $record['extra']['line']); $this->assertEquals(null, $record['extra']['class']); $this->assertEquals('Acme\tester', $record['extra']['function']); } public function testLevelTooLow() { $input = array( 'level' => Logger::DEBUG, 'extra' => array(), ); $expected = $input; $processor = new IntrospectionProcessor(Logger::CRITICAL); $actual = $processor($input); $this->assertEquals($expected, $actual); } public function testLevelEqual() { $input = array( 'level' => Logger::CRITICAL, 'extra' => array(), ); $expected = $input; $expected['extra'] = array( 'file' => null, 'line' => null, 'class' => 'ReflectionMethod', 'function' => 'invokeArgs', ); $processor = new IntrospectionProcessor(Logger::CRITICAL); $actual = $processor($input); $this->assertEquals($expected, $actual); } public function testLevelHigher() { $input = array( 'level' => Logger::EMERGENCY, 'extra' => array(), ); $expected = $input; $expected['extra'] = array( 'file' => null, 'line' => null, 'class' => 'ReflectionMethod', 'function' => 'invokeArgs', ); $processor = new IntrospectionProcessor(Logger::CRITICAL); $actual = $processor($input); $this->assertEquals($expected, $actual); } }
DamienChiboub/symfo_tuto
vendor/monolog/monolog/tests/Monolog/Processor/IntrospectionProcessorTest.php
PHP
mit
3,153
/* Copyright 2014 Mozilla 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. */ .textLayer { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; } .textLayer > div { color: transparent; position: absolute; white-space: pre; cursor: text; -webkit-transform-origin: 0% 0%; -moz-transform-origin: 0% 0%; -o-transform-origin: 0% 0%; -ms-transform-origin: 0% 0%; transform-origin: 0% 0%; } .textLayer .highlight { margin: -1px; padding: 1px; background-color: rgb(180, 0, 170); border-radius: 4px; } .textLayer .highlight.begin { border-radius: 4px 0px 0px 4px; } .textLayer .highlight.end { border-radius: 0px 4px 4px 0px; } .textLayer .highlight.middle { border-radius: 0px; } .textLayer .highlight.selected { background-color: rgb(0, 100, 0); } .pdfViewer .canvasWrapper { overflow: hidden; } .pdfViewer .page { direction: ltr; width: 816px; height: 1056px; margin: 1px auto -8px auto; position: relative; overflow: visible; border: 9px solid transparent; background-clip: content-box; border-image: url(images/shadow.png) 9 9 repeat; background-color: white; } .pdfViewer .page canvas { margin: 0; display: block; } .pdfViewer .page .loadingIcon { position: absolute; display: block; left: 0; top: 0; right: 0; bottom: 0; background: url('images/loading-icon.gif') center no-repeat; } .pdfViewer .page .annotLink > a:hover { opacity: 0.2; background: #ff0; box-shadow: 0px 2px 10px #ff0; } :-webkit-full-screen .pdfViewer .page { margin-bottom: 100%; border: 0; } :-moz-full-screen .pdfViewer .page { margin-bottom: 100%; border: 0; } :-ms-fullscreen .pdfViewer .page { margin-bottom: 100% !important; border: 0; } :fullscreen .pdfViewer .page { margin-bottom: 100%; border: 0; } .pdfViewer .page .annotationHighlight { position: absolute; border: 2px #FFFF99 solid; } .pdfViewer .page .annotText > img { position: absolute; cursor: pointer; } .pdfViewer .page .annotTextContentWrapper { position: absolute; width: 20em; } .pdfViewer .page .annotTextContent { z-index: 200; float: left; max-width: 20em; background-color: #FFFF99; box-shadow: 0px 2px 5px #333; border-radius: 2px; padding: 0.6em; cursor: pointer; } .pdfViewer .page .annotTextContent > h1 { font-size: 1em; border-bottom: 1px solid #000000; padding-bottom: 0.2em; } .pdfViewer .page .annotTextContent > p { padding-top: 0.2em; } .pdfViewer .page .annotLink > a { position: absolute; font-size: 1em; top: 0; left: 0; width: 100%; height: 100%; } .pdfViewer .page .annotLink > a /* -ms-a */ { background: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAA\ LAAAAAABAAEAAAIBRAA7") 0 0 repeat; }
ahocevar/cdnjs
ajax/libs/pdf.js/1.0.867/pdf_viewer.css
CSS
mit
3,317
/** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; 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; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { if (ms >= d) { return Math.round(ms / d) + 'd'; } if (ms >= h) { return Math.round(ms / h) + 'h'; } if (ms >= m) { return Math.round(ms / m) + 'm'; } if (ms >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, n, name) { if (ms < n) { return; } if (ms < n * 1.5) { return Math.floor(ms / n) + ' ' + name; } return Math.ceil(ms / n) + ' ' + name + 's'; }
remynguyen96/webpack-layout
grap/node_modules/ms/index.js
JavaScript
mit
2,764
'use strict'; var PENDING = 'pending'; var SETTLED = 'settled'; var FULFILLED = 'fulfilled'; var REJECTED = 'rejected'; var NOOP = function () {}; var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; var asyncQueue = []; var asyncTimer; function asyncFlush() { // run promise callbacks for (var i = 0; i < asyncQueue.length; i++) { asyncQueue[i][0](asyncQueue[i][1]); } // reset async asyncQueue asyncQueue = []; asyncTimer = false; } function asyncCall(callback, arg) { asyncQueue.push([callback, arg]); if (!asyncTimer) { asyncTimer = true; asyncSetTimer(asyncFlush, 0); } } function invokeResolver(resolver, promise) { function resolvePromise(value) { resolve(promise, value); } function rejectPromise(reason) { reject(promise, reason); } try { resolver(resolvePromise, rejectPromise); } catch (e) { rejectPromise(e); } } function invokeCallback(subscriber) { var owner = subscriber.owner; var settled = owner._state; var value = owner._data; var callback = subscriber[settled]; var promise = subscriber.then; if (typeof callback === 'function') { settled = FULFILLED; try { value = callback(value); } catch (e) { reject(promise, e); } } if (!handleThenable(promise, value)) { if (settled === FULFILLED) { resolve(promise, value); } if (settled === REJECTED) { reject(promise, value); } } } function handleThenable(promise, value) { var resolved; try { if (promise === value) { throw new TypeError('A promises callback cannot return that same promise.'); } if (value && (typeof value === 'function' || typeof value === 'object')) { // then should be retrieved only once var then = value.then; if (typeof then === 'function') { then.call(value, function (val) { if (!resolved) { resolved = true; if (value === val) { fulfill(promise, val); } else { resolve(promise, val); } } }, function (reason) { if (!resolved) { resolved = true; reject(promise, reason); } }); return true; } } } catch (e) { if (!resolved) { reject(promise, e); } return true; } return false; } function resolve(promise, value) { if (promise === value || !handleThenable(promise, value)) { fulfill(promise, value); } } function fulfill(promise, value) { if (promise._state === PENDING) { promise._state = SETTLED; promise._data = value; asyncCall(publishFulfillment, promise); } } function reject(promise, reason) { if (promise._state === PENDING) { promise._state = SETTLED; promise._data = reason; asyncCall(publishRejection, promise); } } function publish(promise) { promise._then = promise._then.forEach(invokeCallback); } function publishFulfillment(promise) { promise._state = FULFILLED; publish(promise); } function publishRejection(promise) { promise._state = REJECTED; publish(promise); if (!promise._handled && isNode) { global.process.emit('unhandledRejection', promise._data, promise); } } function notifyRejectionHandled(promise) { global.process.emit('rejectionHandled', promise); } /** * @class */ function Promise(resolver) { if (typeof resolver !== 'function') { throw new TypeError('Promise resolver ' + resolver + ' is not a function'); } if (this instanceof Promise === false) { throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); } this._then = []; invokeResolver(resolver, this); } Promise.prototype = { constructor: Promise, _state: PENDING, _then: null, _data: undefined, _handled: false, then: function (onFulfillment, onRejection) { var subscriber = { owner: this, then: new this.constructor(NOOP), fulfilled: onFulfillment, rejected: onRejection }; if ((onRejection || onFulfillment) && !this._handled) { this._handled = true; if (this._state === REJECTED && isNode) { asyncCall(notifyRejectionHandled, this); } } if (this._state === FULFILLED || this._state === REJECTED) { // already resolved, call callback async asyncCall(invokeCallback, subscriber); } else { // subscribe this._then.push(subscriber); } return subscriber.then; }, catch: function (onRejection) { return this.then(null, onRejection); } }; Promise.all = function (promises) { if (!Array.isArray(promises)) { throw new TypeError('You must pass an array to Promise.all().'); } return new Promise(function (resolve, reject) { var results = []; var remaining = 0; function resolver(index) { remaining++; return function (value) { results[index] = value; if (!--remaining) { resolve(results); } }; } for (var i = 0, promise; i < promises.length; i++) { promise = promises[i]; if (promise && typeof promise.then === 'function') { promise.then(resolver(i), reject); } else { results[i] = promise; } } if (!remaining) { resolve(results); } }); }; Promise.race = function (promises) { if (!Array.isArray(promises)) { throw new TypeError('You must pass an array to Promise.race().'); } return new Promise(function (resolve, reject) { for (var i = 0, promise; i < promises.length; i++) { promise = promises[i]; if (promise && typeof promise.then === 'function') { promise.then(resolve, reject); } else { resolve(promise); } } }); }; Promise.resolve = function (value) { if (value && typeof value === 'object' && value.constructor === Promise) { return value; } return new Promise(function (resolve) { resolve(value); }); }; Promise.reject = function (reason) { return new Promise(function (resolve, reject) { reject(reason); }); }; module.exports = Promise;
etienne212/attendance-app
node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-build/node_modules/decompress/node_modules/decompress-unzip/node_modules/read-all-stream/node_modules/pinkie-promise/node_modules/pinkie/index.js
JavaScript
mit
5,935
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// // Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames // Copyright (C) 2015 Faust Logic, 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. // //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// #include "afx/arcaneFX.h" #include "afx/util/afxAnimCurve.h" afxAnimCurve::afxAnimCurve() : usable( false ), final_value( 0.0f ), start_value( 0.0f ) { evaluator = new afxHermiteEval(); } afxAnimCurve::~afxAnimCurve() { delete evaluator; } void afxAnimCurve::addKey( Point2F &v ) { Key k; k.time = v.x; k.value = v.y; keys.push_back( k ); usable = false; } void afxAnimCurve::addKey( F32 time, F32 value ) { Key k; k.time = time; k.value = value; keys.push_back( k ); usable = false; } void afxAnimCurve::setKeyTime( int index, F32 t ) { if( ( index < 0 ) || ( index >= keys.size() ) ) return; Key &k = keys[index]; k.time = t; usable = false; } void afxAnimCurve::setKeyValue( int index, F32 v ) { if( ( index < 0 ) || ( index >= keys.size() ) ) return; Key &k = keys[index]; k.value = v; if( index == 0 ) start_value = v; else if( index == keys.size()-1 ) final_value = v; } //bool afxAnimCurve::compare_Key( const afxAnimCurve::Key &a, const afxAnimCurve::Key &b ) //{ // return a.time < b.time; //} S32 QSORT_CALLBACK afxAnimCurve::compare_Key( const void* a, const void* b ) { const Key *key_a = (Key *)a; const Key *key_b = (Key *)b; //Con::printf( "*** %f %f", key_a->time, key_b->time ); //return key_a->time < key_b->time; if (key_a->time > key_b->time) return 1; else if (key_a->time < key_b->time) return -1; else return 0; } void afxAnimCurve::sort( ) { if( keys.size() == 0 ) return; //std::sort( keys.begin(), keys.end(), afxAnimCurve::compare_Key ); dQsort( keys.address(), keys.size(), sizeof(Key), afxAnimCurve::compare_Key ); start_value = keys[0].value; final_value = keys[keys.size()-1].value; start_time = keys[0].time; final_time = keys[keys.size()-1].time; usable = true; } int afxAnimCurve::numKeys() { return keys.size(); } F32 afxAnimCurve::getKeyTime( int index ) { if( ( index < 0 ) || ( index >= keys.size() ) ) return 0.0f; Key &k = keys[index]; return k.time; } F32 afxAnimCurve::getKeyValue( int index ) { if( ( index < 0 ) || ( index >= keys.size() ) ) return 0.0f; Key &k = keys[index]; return k.value; } Point2F afxAnimCurve::getSegment( F32 time ) { Point2F segment( 0, 0 ); if( keys.size() == 0 ) return segment; int start_index = 0; for( ; start_index < keys.size()-1; start_index++ ) { if( time < keys[start_index+1].time ) break; } int end_index = start_index+1; segment.x = (F32)start_index; segment.y = (F32)end_index; return segment; } F32 afxAnimCurve::evaluate( F32 time ) { if( !usable ) return 0.0f; if( time <= start_time ) return start_value; if( time >= final_time ) return final_value; if( keys.size() == 1 ) return start_value; int start_index = 0; for( ; start_index < keys.size()-1; start_index++ ) { if( time < keys[start_index+1].time ) break; } int end_index = start_index+1; Key k0 = keys[start_index]; Key k1 = keys[end_index]; Point2F v0( (F32) k0.time, k0.value ); Point2F v1( (F32) k1.time, k1.value ); // Compute tangents Point2F tan0 = computeTangentK0( v0, v1, start_index ); Point2F tan1 = computeTangentK1( v0, v1, end_index ); F32 time_perc = (F32)( time - k0.time ) / (F32)( k1.time - k0.time ); Point2F vnew = evaluator->evaluateCurve( v0, v1, tan0, tan1, time_perc ); return vnew.y; } Point2F afxAnimCurve::computeTangentK0( Point2F &k0, Point2F &k1, int start_index ) { Point2F tan0; Point2F k_prev; Point2F k_next; // tangent for k0 if( start_index == 0 ) { k_prev = k0; // Setting previous point to k0, creating a hidden point in // the same spot k_next = k1; } else { Key &k = keys[start_index-1]; k_prev.set( k.time, k.value ); k_next = k1; } tan0 = k_next-k_prev; //k_next.subtract( k_prev ); tan0 *= .5f; return tan0; } Point2F afxAnimCurve::computeTangentK1( Point2F &k0, Point2F &k1, int end_index ) { Point2F tan1; Point2F k_prev; Point2F k_next; // tangent for k1 if( end_index == keys.size()-1 ) { k_prev = k0; k_next = k1; // Setting next point to k1, creating a hidden point in // the same spot } else { k_prev = k0; Key &k = keys[end_index+1]; k_next.set( k.time, k.value ); } tan1 = k_next-k_prev; //k_next.subtract( k_prev ); tan1 *= .5f; return tan1; } void afxAnimCurve::print() { Con::printf( "afxAnimCurve -------------------------" ); for( int i = 0; i < keys.size(); i++ ) { Key &k = keys[i]; Con::printf( "%f: %f", k.time, k.value ); } Con::printf( "-----------------------------------" ); } void afxAnimCurve::printKey( int index ) { Key &k = keys[index]; Con::printf( "%f: %f", k.time, k.value ); }
ValtoGameEngines/Torque3D
Engine/source/afx/util/afxAnimCurve.cpp
C++
mit
6,153
/* * Copyright (c) 2012 - present Adobe Systems Incorporated. All rights reserved. * * 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. * */ define({ /** * Errors */ // General file io error strings "GENERIC_ERROR" : "(خطا {0})", "NOT_FOUND_ERR" : "پرونده پیدا نشد.", "NOT_READABLE_ERR" : "پرونده قابل خواندن نیست.", "EXCEEDS_MAX_FILE_SIZE" : "فایل های بزرگتر از {0} MB قابل ویرایش در {APP_NAME} نیست.", "NO_MODIFICATION_ALLOWED_ERR" : "دایرکتوری هدف قابل ویرایش نیست.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "دسترسی های تعریف شده برای شما اجازه تغییرات را نمی دهند.", "CONTENTS_MODIFIED_ERR" : "فایل خارج از محیط {APP_NAME} تغییر یافته است.", "UNSUPPORTED_ENCODING_ERR" : "{APP_NAME} فعلا تنها از پرونده ها با ساختار یونیکدی UTF-8 پشتیبانی می کند.", "FILE_EXISTS_ERR" : "پرونده یا پوشه مد نظر موجود می باشد.", "FILE" : "پرونده", "FILE_TITLE" : "پرونده", "DIRECTORY" : "پوشه", "DIRECTORY_TITLE" : "پوشه", "DIRECTORY_NAMES_LEDE" : "نام های پوشه", "FILENAMES_LEDE" : "نام های پرونده", "FILENAME" : "نام پرونده", "DIRECTORY_NAME" : "نام پوشه", // Project error strings "ERROR_LOADING_PROJECT" : "خطا در بارگذاری پروژه", "OPEN_DIALOG_ERROR" : "خطا در باز کردن پرونده خوان. (خطا {0})", "REQUEST_NATIVE_FILE_SYSTEM_ERROR" : "خطا بهنگام بارگذاری پوشه <span class='dialog-filename'>{0}</span>. (خطا {1})", "READ_DIRECTORY_ENTRIES_ERROR" : "بروز خطا در خواندن اطلاعات پوشه <span class='dialog-filename'>{0}</span>. (خطا {1})", // File open/save error string "ERROR_OPENING_FILE_TITLE" : "خطا در باز کردن پرونده", "ERROR_OPENING_FILE" : "خطا بهنگام تلاش برای باز کردن پرونده <span class='dialog-filename'>{0}</span>. {1}", "ERROR_OPENING_FILES" : "خطا بهنگام بارگذاری پرونده های زیر:", "ERROR_RELOADING_FILE_TITLE" : "خطا در بارگذاری تغییرات از حافظه", "ERROR_RELOADING_FILE" : "بروز خطا بهنگام تلاش برای بارگذاری پرونده <span class='dialog-filename'>{0}</span>. {1}", "ERROR_SAVING_FILE_TITLE" : "خطا در ذخیره سازی پرونده", "ERROR_SAVING_FILE" : "بروز خطا بهنگام تلاش جهت ذخیره پرونده <span class='dialog-filename'>{0}</span>. {1}", "ERROR_RENAMING_FILE_TITLE" : "خطا در تغییر نام پرونده {0}", "ERROR_RENAMING_FILE" : "بروز خطا بهنگام تلاش برای تغییر نام پرونده {2} <span class='dialog-filename'>{0}</span>. {1}", "ERROR_DELETING_FILE_TITLE" : "خطا در حذف پرونده {0}", "ERROR_DELETING_FILE" : "بروز خطا بهنگام تلاش برای تغییر نام پرونده {2} <span class='dialog-filename'>{0}</span>. {1}", "INVALID_FILENAME_TITLE" : "غیر مجاز {0}", "INVALID_FILENAME_MESSAGE" : "{0} نمیتوانید از عبارات مورد استفاده نرم افزار, نقطه ها پایانی (.) یا کاراکترهای شامل موارد زیر استفاده کنید: <code class='emphasized'>{1}</code>", "ENTRY_WITH_SAME_NAME_EXISTS" : "پوشه یا پرونده ی با نام <span class='dialog-filename'>{0}</span> هم اکنون موجود است.", "ERROR_CREATING_FILE_TITLE" : "خطا در ایجاد {0}", "ERROR_CREATING_FILE" : "خطا بهنگام ایجاد {0} <span class='dialog-filename'>{1}</span>. {2}", "ERROR_MIXED_DRAGDROP" : "نمی توان یک پوشه را همزمان به عنوان سایر فایل ها باز شده در نظر گرفت", // User key map error strings "ERROR_KEYMAP_TITLE" : "خطا در خواندن نقشه ی کلید مورد استفاده", "ERROR_KEYMAP_CORRUPT" : "فایل نقشه کلید شما در JSON نامعتبر میباشد. زمانی فایل باز خواهد شده که شما آن را به شکل صحیح بنویسید.", "ERROR_LOADING_KEYMAP" : "فایل نقشه کلید شما هست یک فایل متنی غیر معتبر با کدگذاری UTF-8 .و نمی توان بارگذاری شود", "ERROR_RESTRICTED_COMMANDS" : "شما نمی توان با این دستور کلیدهای میانبر را اختصاص دهید: {0}", "ERROR_RESTRICTED_SHORTCUTS" : "شما این میانبرها را نمیتوانید اختصاص دهید: {0}", "ERROR_MULTIPLE_SHORTCUTS" : "شما با این دستور کلید میانبر چندگانه ایجاد کرده اید: {0}", "ERROR_DUPLICATE_SHORTCUTS" : "شما مقادیر متعددی برای این میانبر دارید: {0}", "ERROR_INVALID_SHORTCUTS" : "این میانبر نامعتبر میباشد: {0}", "ERROR_NONEXISTENT_COMMANDS" : "شما در حال اختصاص کلید میانبر برای دستوراتی که وجود ندارند هستید: {0}", // Application preferences corrupt error strings "ERROR_PREFS_CORRUPT_TITLE" : "خطا در خواندن تنظیمات", "ERROR_PREFS_CORRUPT" : "پرونده تنظیمات شما از نوع پرونده JSON معتبر نیست. از آنجایی که پرونده قابل دسترسی و خواندن است، میتواند بصورت دستی توسط شما تصحیح گردد. البته جهت اعمال تغییرات می بایست {APP_NAME} بارگذاری مجدد گردد.", // Application error strings "ERROR_IN_BROWSER_TITLE" : " متاسفم! {APP_NAME}اکنون در این مرورگر اجرا نمیشود .", "ERROR_IN_BROWSER" : "{APP_NAME} در اچ تی ام ال ساخته شده است, اما در حال حاضر آن به عنوان یک نرم افزار در دسکتاپ اجرا میشود بنابراین شما میتوانید جهت ویرایش فایل ها از آن استفاده کنید. لطفا از اپلیکیشن shell در <b>github.com/adobe/brackets-shell</b> جهت اجرای مخازن {APP_NAME} استفاده کنید.", // ProjectManager max files error string "ERROR_MAX_FILES_TITLE" : "خطا در فهرست بندی پرونده ها", "ERROR_MAX_FILES" : "این پروژه شامل بیش از 30000 فایل است. امکانات که در فایل های چندگانه کار می کنند ممکن است غیرفعال و یا به عنوان پروژه خالی در نظر گرفته شوند. <a href='https://github.com/adobe/brackets/wiki/Large-Projects'>اطلاعات بیشتر در مورد کار با پروژه های بزرگ</a>.", // Live Preview error strings "ERROR_LAUNCHING_BROWSER_TITLE" : "خطا در اجرای مرورگر", "ERROR_CANT_FIND_CHROME" : "مرورگر گوگل کروم پیدا نشد. لطفا از نصب بودن آن اطمینان حاصل کنید.", "ERROR_LAUNCHING_BROWSER" : "بروز خطا بهنگام اجرای مرورگر. (error {0})", "LIVE_DEVELOPMENT_ERROR_TITLE" : "خطا در پیش نمایش زنده", "LIVE_DEVELOPMENT_RELAUNCH_TITLE" : "در حال اتصال به مرورگر", "LIVE_DEVELOPMENT_ERROR_MESSAGE" : "به هر صورت بهنگام اتصال به حالت پیش نمایش, مرورگر کروم احتیاج دارد به فعال بودن اشکال زدای راه دور (خطایابی راه دور).<br /><br />آیا تمایل دارید به اجرای دوباره کروم و فعال سازی اشکال زدای راه دور(اشکال زدایی از راه دور)?", "LIVE_DEV_LOADING_ERROR_MESSAGE" : "ناتوان در بارگذاری صفحه توسعه زنده.", "LIVE_DEV_NEED_HTML_MESSAGE" : "باز کنید یک فایل اچ تی ام ال و یا مطمئن شوید که یک فایل index.html در پروژه شما جهت راه اندازی پیش نمایش زنده وجود دارد.", "LIVE_DEV_NEED_BASEURL_MESSAGE" : "جهت اجرای پیش نمایش زنده بصورت پرونده در سمت سرور(server-side), می بایست یک URL پایه برای پروژه تعریف نمایید.", "LIVE_DEV_SERVER_NOT_READY_MESSAGE" : "خطا در اجرای سرویس دهنده HTTP برای توسعه زنده پرونده ها. لطفا دوباره تلاش کنید", "LIVE_DEVELOPMENT_INFO_TITLE" : "به پیش نمایش زنده خوش آمدید!", "LIVE_DEVELOPMENT_INFO_MESSAGE" : "پیش نمایش زنده براکتس به مرورگر متصل شده و یک پیش نمایش از پرونده اچ تی ام ال شما در مرورگرتان نشان خواهد داد, و هرگونه تغییری در کدهایتان را فورا در پیش نمایش اعمال خواهد نمود.<br /><br />در این نسخه موجود براکتس, پیش نمایش تنها با مرورگر <strong>گوگل کروم</strong> برای اعمال فوری مقادیر <strong>فایل های سی اس اس </strong> برای حالت پیش نمایش کار خواهد کرد. هرگونه تغییری در پرونده های اچ تی ام ال یا جاوا اسکریپت بصورت خودکار بعد از ذخیر بارگذاری خواهد شد.<br /><br />(شما این پیغام را برای بار دیگر مشاهده نخواهید کرد.)", "LIVE_DEVELOPMENT_TROUBLESHOOTING" : "برای اطلاعات بیشتر, ببینید <a href='{0}' title='{0}'>عیب یابی خطاهای اتصال پیش نمایش زنده</a>.", "LIVE_DEV_STATUS_TIP_NOT_CONNECTED" : "پیش نمایش زنده", "LIVE_DEV_STATUS_TIP_PROGRESS1" : "پیش نمایش زنده: درحال اتصال\u2026", "LIVE_DEV_STATUS_TIP_PROGRESS2" : "پیش نمایش زنده: درحال مقداردهی اولیه\u2026", "LIVE_DEV_STATUS_TIP_CONNECTED" : "قطع اتصال از پیش نمایش زنده", "LIVE_DEV_STATUS_TIP_OUT_OF_SYNC" : "پیش نمایش زنده (ذخیره فایل ها جهت نوسازی)", "LIVE_DEV_STATUS_TIP_SYNC_ERROR" : "پیش نمایش زنده (به دلیل خطا در سینتکس، بروزرسانی نشده است)", "LIVE_DEV_DETACHED_REPLACED_WITH_DEVTOOLS" : "پیش نمایش زنده لغو شد زیرا از برخی از ابزارهای توسعه مختص مرورگرتان استفاده کرده اید.", "LIVE_DEV_DETACHED_TARGET_CLOSED" : "پیش نمایش زنده لغو شد زیرا پنجره یا زبانه مربوط به صفحه در مرورگر بسته شده.", "LIVE_DEV_NAVIGATED_AWAY" : "پیش نمایش زنده لغو شد زیرا پنجره یا زبانه موجود در مرورگر آدرس دیگری را پیمایش کرده است.", "LIVE_DEV_CLOSED_UNKNOWN_REASON" : "پیش نمایش زنده به دلیل نامشخصی لغو شد ({0})", "SAVE_CLOSE_TITLE" : "ذخیره تغییرات", "SAVE_CLOSE_MESSAGE" : "آیا مایلید تغییرات داده شده در سند ذخیره گردند <span class='dialog-filename'>{0}</span>?", "SAVE_CLOSE_MULTI_MESSAGE" : "آیا مایلید تغییرات داده شده در پرونده های زیر، ذخیره گردند? ", "EXT_MODIFIED_TITLE" : "تغییرات خارجی", "CONFIRM_DELETE_TITLE" : "تایید حذف", "CONFIRM_FOLDER_DELETE" : "آیا مطمئنید می خواهید این پوشه حذف گردد <span class='dialog-filename'>{0}</span>?", "FILE_DELETED_TITLE" : "پرونده حذف گردید", "EXT_MODIFIED_WARNING" : "<span class='dialog-filename'>{0}</span> خارج از براکتس ویرایش شده.<br /><br />آیا می خواهید پرونده را ذخیره و تغییراتی را که داده اید دوباره بر روی پرونده ویرایش شده اعمال نمایید؟", "EXT_MODIFIED_MESSAGE" : "<span class='dialog-filename'>{0}</span> تغییراتی بر روی دیسک انجام شده, ولی تغییرات بر روی براکتس ذخیره نگردیده.<br /><br />کدام نسخه را می خواهید نگه دارید?", "EXT_DELETED_MESSAGE" : "<span class='dialog-filename'>{0}</span> برخی مقادیر از دیسک حذف شده, ولی تغییرات بر روی براکتس اعمال/ذخیره نشده.<br /><br />آیا می خواهید تغییرات را حفظ کنید?", // Generic dialog/button labels "DONE" : "انجام", "OK" : "تائید", "CANCEL" : "لغو", "DONT_SAVE" : "ذخیره نکن", "SAVE" : "ذخیره", "SAVE_AS" : "ذخیر با نام\u2026", "SAVE_AND_OVERWRITE" : "بازنویسی", "DELETE" : "حذف", "BUTTON_YES" : "بله", "BUTTON_NO" : "خیر", // Find, Replace, Find in Files "FIND_MATCH_INDEX" : "{0} از {1}", "FIND_NO_RESULTS" : "بدون نتیجه", "FIND_QUERY_PLACEHOLDER" : "جستجو\u2026", "REPLACE_PLACEHOLDER" : "جایگزینی با\u2026", "BUTTON_REPLACE_ALL" : "همه\u2026", "BUTTON_REPLACE_ALL_IN_FILES" : "جایگزینی\u2026", "BUTTON_REPLACE" : "جایگزینی", "BUTTON_NEXT" : "\u25B6", "BUTTON_PREV" : "\u25C0", "BUTTON_NEXT_HINT" : "مورد بعدی", "BUTTON_PREV_HINT" : "مورد قبلی", "BUTTON_CASESENSITIVE_HINT" : "مورد تطبیق یافته", "BUTTON_REGEXP_HINT" : "عبارت منظم", "REPLACE_WITHOUT_UNDO_WARNING_TITLE" : "جایگزینی بدون امکان بازگشت به قبل", "REPLACE_WITHOUT_UNDO_WARNING" : "بدلیل اعمال تغییر در تعداد {0} پرونده, {APP_NAME} پرونده های باز نشده را نیز ویرایش و تغییر خواهد داد. به همین جهت مقادیر تغییر یافته (جایگزین شده) غیر قابل بازگشت خواهند بود.", "BUTTON_REPLACE_WITHOUT_UNDO" : "جایگزینی بدون بازگشت", "OPEN_FILE" : "باز کردن پرونده", "SAVE_FILE_AS" : "ذخیره پرونده", "CHOOSE_FOLDER" : "انتخاب یک پوشه", "RELEASE_NOTES" : "نکات و یادداشت های انتشار", "NO_UPDATE_TITLE" : "شما بروز هستید!!", "NO_UPDATE_MESSAGE" : "شما درحال استفاده از آخرین نسخه {APP_NAME} هستید.", // Find and Replace "FIND_REPLACE_TITLE_LABEL" : "جایگزینی", "FIND_REPLACE_TITLE_WITH" : "با", "FIND_TITLE_LABEL" : "جستجو", "FIND_TITLE_SUMMARY" : "&mdash; {0} {1} {2} با {3}", // Find in Files "FIND_NUM_FILES" : "{0} {1}", "FIND_IN_FILES_SCOPED" : "در <span class='dialog-filename'>{0}</span>", "FIND_IN_FILES_NO_SCOPE" : "در پروژه", "FIND_IN_FILES_ZERO_FILES" : "فیلترسازی تمامی پرونده های منع شده {0}", "FIND_IN_FILES_FILE" : "پرونده", "FIND_IN_FILES_FILES" : "پرونده ها", "FIND_IN_FILES_MATCH" : "تطبیق", "FIND_IN_FILES_MATCHES" : "تطبیق ها", "FIND_IN_FILES_MORE_THAN" : "بیش تر از ", "FIND_IN_FILES_PAGING" : "{0}&mdash;{1}", "FIND_IN_FILES_FILE_PATH" : "<span class='dialog-filename'>{0}</span> {2} <span class='dialog-path'>{1}</span>", // We should use normal dashes on Windows instead of em dash eventually "FIND_IN_FILES_EXPAND_COLLAPSE" : "جهت بازکردن/بستن منوها کلید Ctrl/Cmd را گرفته و کلیک کنید.", "REPLACE_IN_FILES_ERRORS_TITLE" : "خطاهای جایگزینی مقادیر", "REPLACE_IN_FILES_ERRORS" : "پرونده های زیر قابل ویرایش نبودن. علت می تواند از قابل نوشتن نبودن پرونده های و یا تغییر آن های بعد از جستجو باشد.", "ERROR_FETCHING_UPDATE_INFO_TITLE" : "درحال بروزرسانی اطلاعات خطا", "ERROR_FETCHING_UPDATE_INFO_MSG" : "بروز خطا در هنگام دستیابی به آخرین اطلاعات بروزرسانی از سرویس دهنده. اطمینان حاصل کنید که به اینترنت متصل بوده و دوباره تلاش نمایید.", // File exclusion filters "NEW_FILE_FILTER" : "اعمال یک تصویه(فیلتر) جدید\u2026", "CLEAR_FILE_FILTER" : "رفع نادیده گیری پرونده ها", "NO_FILE_FILTER" : "این پرونده ها از پرونده های نادیده گرفته شده نیستند", "EXCLUDE_FILE_FILTER" : "نادیده گیری {0}", "EDIT_FILE_FILTER" : "ویرایش\u2026", "FILE_FILTER_DIALOG" : "ویرایش نادیده گرفته شده ها", "FILE_FILTER_INSTRUCTIONS" : "نادیده گیری پرونده ها و پوشه های منطبق با عبارات زیر یا برخی / substrings or <a href='{0}' title='{0}'>نویسه های عام</a>. هر عبارت را در یک سطر جدید وارد کنید.", "FILTER_NAME_PLACEHOLDER" : "منع نام (اختیاری)", "FILE_FILTER_CLIPPED_SUFFIX" : "و {0} بیشتر", "FILTER_COUNTING_FILES" : "شمارش پرونده ها\u2026", "FILTER_FILE_COUNT" : "همیشه {0} از {1} پرونده {2}", "FILTER_FILE_COUNT_ALL" : "تایید {0} پرونده {1}", // Quick Edit "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "امکان ویرایش سریع برای مکان فعلی نشانگر موجود نمی باشد", "ERROR_CSSQUICKEDIT_BETWEENCLASSES" : "ویرایشگر سریع CSS: نشانگر را روی یک کلاس قرار دهید", "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "ویرایشگر سریع CSS: صفات/خصوصیات این کلاس کامل نیست", "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "ویرایشگر سریع CSS: صفات/خصوصیات این id کامل نیست", "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "ویرایشگر سریع CSS: نشانگر را بر روی یک تگ، کلاس یا id قرار دهید", "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX" : "تابع زمانبندی ویرایشگر سریع CSS: خطا در نحو", "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND" : "ویرایشگر سریع JS: نشانگر را روی نام تابع قرار دهید", // Quick Docs "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "سند سریع برای مکان فعلی نمایشگر مکان موجود نمی باشد", /** * ProjectManager */ "PROJECT_LOADING" : "درحال بارگذاری\u2026", "UNTITLED" : "عنوان گذاری نشده", "WORKING_FILES" : "پرونده های کاری", /** * MainViewManager */ "TOP" : "بالا", "BOTTOM" : "پایین", "LEFT" : "چپ", "RIGHT" : "راست", "CMD_SPLITVIEW_NONE" : "بدون دو بخشی کردن", "CMD_SPLITVIEW_VERTICAL" : "دو بخشی کردن عمودی", "CMD_SPLITVIEW_HORIZONTAL" : "دو بخشی کردن افقی", "SPLITVIEW_MENU_TOOLTIP" : "دو بخشی کردن ویرایشگر به صورت عمودی یا افقی", "GEAR_MENU_TOOLTIP" : "پیکربندی پرونده های کاری", "SPLITVIEW_INFO_TITLE" : "هم اکنون باز است", "SPLITVIEW_MULTIPANE_WARNING" : "این پرونده هم اکنون در پنجره ای دیگر باز شده است. {APP_NAME} بزودی باز کردن همان پرونده در سایر پنجره ها را پشتیبانی خواهد نمود. تا آن زمان پرونده ها تنها در پنجره ای که باز شده اند نمایش داده خواند شد.<br /><br />(این پیغام تنها یک بار مشاهده خواهد شد.)", /** * Keyboard modifier names */ "KEYBOARD_CTRL" : "Ctrl", "KEYBOARD_SHIFT" : "Shift", "KEYBOARD_SPACE" : "Space", /** * StatusBar strings */ "STATUSBAR_CURSOR_POSITION" : "خط {0}, ستون {1}", "STATUSBAR_SELECTION_CH_SINGULAR" : " \u2014 {0} ستون انتخاب شده", "STATUSBAR_SELECTION_CH_PLURAL" : " \u2014 {0} ستون های انتخاب شده", "STATUSBAR_SELECTION_LINE_SINGULAR" : " \u2014 {0} خط انتخاب شده", "STATUSBAR_SELECTION_LINE_PLURAL" : " \u2014 {0} خط های انتخاب شده", "STATUSBAR_SELECTION_MULTIPLE" : " \u2014 {0} انتخاب شده ها", "STATUSBAR_INDENT_TOOLTIP_SPACES" : "کلیک کنید تا به این فضاها منتقل شوید", "STATUSBAR_INDENT_TOOLTIP_TABS" : "کلیک کنید تا به این زبانه ها منتقل شوید", "STATUSBAR_INDENT_SIZE_TOOLTIP_SPACES" : "جهت تغییر تعداد فضاهای خالی استفاده شده در هنگام فاصله دهی خطوط از چپ، کلیک کنید", "STATUSBAR_INDENT_SIZE_TOOLTIP_TABS" : "کلیک کنید تا طول زبانه کاراکتر ها تغییر کند", "STATUSBAR_SPACES" : "فاصله ها:", "STATUSBAR_TAB_SIZE" : "اندازه زبانه:", "STATUSBAR_LINE_COUNT_SINGULAR" : "\u2014 {0} خط", "STATUSBAR_LINE_COUNT_PLURAL" : "\u2014 {0} خط ها", "STATUSBAR_USER_EXTENSIONS_DISABLED" : "غیرفعال سازی افزونه ها", "STATUSBAR_INSERT" : "واردسازی", "STATUSBAR_OVERWRITE" : "دوباره نویسی", "STATUSBAR_INSOVR_TOOLTIP" : "جهت تغییر حالت از وارد سازی (INS) به بازنویسی (OVR) یا برعکس، کلیک کنید", "STATUSBAR_LANG_TOOLTIP" : "جهت تغییر نوع پرونده، کلیک کنید.", "STATUSBAR_CODE_INSPECTION_TOOLTIP" : "{0}. باز و بسته کردن پنل گزارشات.", "STATUSBAR_DEFAULT_LANG" : "(پیش فرض)", "STATUSBAR_SET_DEFAULT_LANG" : " اعمال بعنوان پیش فرض برای .{0} پرونده ها", // CodeInspection: errors/warnings "ERRORS_PANEL_TITLE_MULTIPLE" : " {0} خطا", "SINGLE_ERROR" : " 1 {0} خطا", "MULTIPLE_ERRORS" : " {1} {0} خطا", "NO_ERRORS" : "هیچ خطایی یافت نشد {0} - کارت خوبه!", "NO_ERRORS_MULTIPLE_PROVIDER" : "خطایی پیدا نشد - کارت خوبه!", "LINT_DISABLED" : "Linting غیرفعال شد", "NO_LINT_AVAILABLE" : "linter برای {0} دردسترس نیست", "NOTHING_TO_LINT" : "linter برای {0} دردسترس نیست", "LINTER_TIMED_OUT" : "فعالیت{0} پس از انتظار بمدت{1} میلی ثانیه خاتمه یافت", "LINTER_FAILED" : "{0} با خطای زیر پایان یافته: {1}", /** * Command Name Constants */ // File menu commands "FILE_MENU" : "فایل", "CMD_FILE_NEW_UNTITLED" : "جدید", "CMD_FILE_NEW" : "فایل جدید", "CMD_FILE_NEW_FOLDER" : "پوشه جدید", "CMD_FILE_OPEN" : "باز کردن\u2026", "CMD_ADD_TO_WORKING_SET" : "افزودن به محیط کاری و باز کردن آن", "CMD_OPEN_DROPPED_FILES" : "باز کردن پرونده های در نظر گرفته نشده", "CMD_OPEN_FOLDER" : "باز کردن پوشه\u2026", "CMD_FILE_CLOSE" : "بستن", "CMD_FILE_CLOSE_ALL" : "بستن همه", "CMD_FILE_CLOSE_LIST" : "بستن لیست", "CMD_FILE_CLOSE_OTHERS" : "بستن سایر موارد", "CMD_FILE_CLOSE_ABOVE" : "بستن موارد بالایی", "CMD_FILE_CLOSE_BELOW" : "بستن موارد پایینی", "CMD_FILE_SAVE" : "ذخیره", "CMD_FILE_SAVE_ALL" : "ذخیره همه", "CMD_FILE_SAVE_AS" : "ذخیره با نام\u2026", "CMD_LIVE_FILE_PREVIEW" : "پیش نمایش زنده", "CMD_TOGGLE_LIVE_PREVIEW_MB_MODE" : "فعال کردن پیش نمایش تجربی", "CMD_RELOAD_LIVE_PREVIEW" : "بارگذاری مجدد پیش نمایش زنده (با فشار)", "CMD_PROJECT_SETTINGS" : "تنظیمات پروژه\u2026", "CMD_FILE_RENAME" : "تغییر نام", "CMD_FILE_DELETE" : "حذف", "CMD_INSTALL_EXTENSION" : "نصب افزونه \u2026", "CMD_EXTENSION_MANAGER" : "مدیریت افزونه\u2026", "CMD_FILE_REFRESH" : "نوسازی درختی پرونده", "CMD_QUIT" : "ترک کردن", // Used in native File menu on Windows "CMD_EXIT" : "خروج", // Edit menu commands "EDIT_MENU" : "ویرایش", "CMD_UNDO" : "یک مرحله به قبل", "CMD_REDO" : "یک مرحله به بعد", "CMD_CUT" : "بریدن", "CMD_COPY" : "رونوشت", "CMD_PASTE" : "چسباندن رو نوشت", "CMD_SELECT_ALL" : "انتخاب همه", "CMD_SELECT_LINE" : "انتخاب خط", "CMD_SPLIT_SEL_INTO_LINES" : "تقسیم انتخاب شده به چند سطر", "CMD_ADD_CUR_TO_NEXT_LINE" : "افزودن نشانگر به سطر بعدی", "CMD_ADD_CUR_TO_PREV_LINE" : "افزودن نشانگر به سطر قبلی", "CMD_INDENT" : "یک فاصله از چپ", "CMD_UNINDENT" : "حذف یک فاصله از چپ", "CMD_DUPLICATE" : "دو نسخه کردن خط", "CMD_DELETE_LINES" : "حذف خط", "CMD_COMMENT" : "تعویض خط به نظر", "CMD_BLOCK_COMMENT" : "تعویض نظر به خط", "CMD_LINE_UP" : "خط را یکی به بالا ببر", "CMD_LINE_DOWN" : "خط را یکی به پایین ببر", "CMD_OPEN_LINE_ABOVE" : "باز کردن خط بالا", "CMD_OPEN_LINE_BELOW" : "باز کردن خط زیرین", "CMD_TOGGLE_CLOSE_BRACKETS" : "پرانتزها را خودکار ببند", "CMD_SHOW_CODE_HINTS" : "نمایش نکات کد", // Search menu commands "FIND_MENU" : "جستجو", "CMD_FIND" : "یافتن", "CMD_FIND_NEXT" : "یافتن بعدی", "CMD_FIND_PREVIOUS" : "یافتن قبلی", "CMD_FIND_ALL_AND_SELECT" : "جستجو برای تمامی موارد و انتخاب آن ها", "CMD_ADD_NEXT_MATCH" : "عبارت انطباق یافته بعدی را به انتخاب شده ها اضافه کن", "CMD_SKIP_CURRENT_MATCH" : "پرش از این مورد و افزودن مورد انطباق یافته بعدی", "CMD_FIND_IN_FILES" : "جستجو در پرونده ها", "CMD_FIND_IN_SUBTREE" : "جستجو در\u2026", "CMD_REPLACE" : "جایگزینی", "CMD_REPLACE_IN_FILES" : "جایگزینی در پرونده ها", "CMD_REPLACE_IN_SUBTREE" : "جایگزینی در\u2026", // View menu commands "VIEW_MENU" : "نمایش", "CMD_HIDE_SIDEBAR" : "پنهان کردن نوار کناری", "CMD_SHOW_SIDEBAR" : "نمایش نوار کناری", "CMD_INCREASE_FONT_SIZE" : "افزایش سایز نوشته ها", "CMD_DECREASE_FONT_SIZE" : "کاهش سایز نوشته ها", "CMD_RESTORE_FONT_SIZE" : "پیشفرض سایز نوشته ها", "CMD_SCROLL_LINE_UP" : "حرکت به بالا", "CMD_SCROLL_LINE_DOWN" : "حرکت به پایین", "CMD_TOGGLE_LINE_NUMBERS" : "شماره گذاری خط ها", "CMD_TOGGLE_ACTIVE_LINE" : "نشانه گذاری خط فعال", "CMD_TOGGLE_WORD_WRAP" : "شکستن عبارات طولانی", "CMD_LIVE_HIGHLIGHT" : "نشانه گذاری پیش نمایش", "CMD_VIEW_TOGGLE_INSPECTION" : "نشانه گذاری پرونده های تغییر یافته برای ذخیره سازی", "CMD_WORKINGSET_SORT_BY_ADDED" : "مرتب سازی بر اساس ترتیب اضافه شدن", "CMD_WORKINGSET_SORT_BY_NAME" : "مرتب سازی بر اساس نام", "CMD_WORKINGSET_SORT_BY_TYPE" : "مرتب سازی بر اساس نوع", "CMD_WORKING_SORT_TOGGLE_AUTO" : "مرتب سازی خودکار", "CMD_THEMES" : "پوسته ها\u2026", // Navigate menu Commands "NAVIGATE_MENU" : "انتقال", "CMD_QUICK_OPEN" : "باز کردن سریع", "CMD_GOTO_LINE" : "برو به خط", "CMD_GOTO_DEFINITION" : "تعریف جستجوی سریع", "CMD_GOTO_FIRST_PROBLEM" : "رجوع به اولین خطا/اخطار", "CMD_TOGGLE_QUICK_EDIT" : "ویرایش سریع", "CMD_TOGGLE_QUICK_DOCS" : "مستند گزاری سریع", "CMD_QUICK_EDIT_PREV_MATCH" : "تطبیق یافته قبلی", "CMD_QUICK_EDIT_NEXT_MATCH" : "تطبیق یافته بعدی", "CMD_CSS_QUICK_EDIT_NEW_RULE" : "قاعده جدید", "CMD_NEXT_DOC" : "سند بعدی", "CMD_PREV_DOC" : "سند قبلی", "CMD_SHOW_IN_TREE" : "نمایش در پرونده ها به صورت درختی", "CMD_SHOW_IN_EXPLORER" : "نمایش در پیمایشگر", "CMD_SHOW_IN_FINDER" : "نمایش در جستجوگر", "CMD_SHOW_IN_OS" : "نمایش در OS", // Help menu commands "HELP_MENU" : "راهنما", "CMD_CHECK_FOR_UPDATE" : "بررسی بروزرسانی ها", "CMD_HOW_TO_USE_BRACKETS" : "چگونگی استفاده از {APP_NAME}", "CMD_SUPPORT" : "{APP_NAME} پشتیبانی", "CMD_SUGGEST" : "پیشنهاد یک امکان جدید", "CMD_RELEASE_NOTES" : "نکات انتشار", "CMD_GET_INVOLVED" : "درگیرش شوید", "CMD_SHOW_EXTENSIONS_FOLDER" : "نمایش پوشه افزونه ها", "CMD_HOMEPAGE" : "{APP_TITLE} صفحه اصلی سایت", "CMD_TWITTER" : "{TWITTER_NAME} در توییتر", "CMD_ABOUT" : "درباره {APP_TITLE}", "CMD_OPEN_PREFERENCES" : "تنظیمات باز کردن فایل", "CMD_OPEN_KEYMAP" : "باز کردن نقشه کلیدهای کاربردی", // Strings for main-view.html "EXPERIMENTAL_BUILD" : "ساخت آزمایشی", "RELEASE_BUILD" : "ساختن و انتشار", "DEVELOPMENT_BUILD" : "ایجاد توسعه", "RELOAD_FROM_DISK" : "بارگذاری مجدد از دیسک", "KEEP_CHANGES_IN_EDITOR" : "نگه داشتن تغییرات در ویرایشگر", "CLOSE_DONT_SAVE" : "بستن (بدون ذخیره سازی)", "RELAUNCH_CHROME" : "اجرای دوباره کروم", "ABOUT" : "پیرامون", "CLOSE" : "بستن", "ABOUT_TEXT_LINE1" : "انتشار {VERSION_MAJOR}.{VERSION_MINOR} {BUILD_TYPE} {VERSION}", "ABOUT_TEXT_BUILD_TIMESTAMP" : "ایجاد برچسب زمان: ", "ABOUT_TEXT_LINE3" : "<div style='direction:rtl;margin-right:3px;'>یادداشت ها، شرایط و ضوابط مربوط به نرم افزار و حقوق شخص ثالث در آدرس<a href='#' class='clickable-link' data-href='http://www.adobe.com/go/thirdparty/'>http://www.adobe.com/go/thirdparty/</a> جهت تلفیق و بعنوان مرجع قرار داده شده.", "ABOUT_TEXT_LINE4" : "اسناد و منابع در <a href='https://github.com/adobe/brackets/'>https://github.com/adobe/brackets/</a>", "ABOUT_TEXT_LINE5" : "ساخته شده با \u2764 و جاوا اسکریپت توسط:", "ABOUT_TEXT_LINE6" : "بسیاری از مردم (اما اکنون در بارگذاری داده ها ما مشکل داریم ).", "ABOUT_TEXT_MDN_DOCS" : "اسناد و مدارک صفحات وب و آرم اصلی گرافیکی تحت مجوز , <a href='#' class='clickable-link' data-href='{MDN_DOCS_LICENSE}'>CC-BY-SA 2.5 .پایه ریزی شده است</a>.", "UPDATE_NOTIFICATION_TOOLTIP" : "ساخته ی جدیدی از {APP_NAME} هم اکنون در دسترس است! جهت مشاهده جزئیات کلیک کنید.", "UPDATE_AVAILABLE_TITLE" : "بروزرسانی جدید در دسترس است", "UPDATE_MESSAGE" : "نسخه جدیدی از {APP_NAME} هم اکنون در دسترس است. برخی از مشخصه های آن:", "GET_IT_NOW" : "اکنون برو به!", "PROJECT_SETTINGS_TITLE" : "تنظیمات پروژه برای: {0}", "PROJECT_SETTING_BASE_URL" : "پیش نمایش URL اصلی/پایه", "PROJECT_SETTING_BASE_URL_HINT" : "جهت استفاده از سرویس دهنده داخلی, از url بمانند http://localhost:8000/ استفاده کنید.", "BASEURL_ERROR_INVALID_PROTOCOL" : "پروتکول {0} با پیش نمایش زنده پشتیبانی نمی شود&mdash;لطفا از http: یا https: استفاده نمایید.", "BASEURL_ERROR_SEARCH_DISALLOWED" : "URL اصلی نمی تواند شامل پارامترهای جستجو بمانند \"{0}\" باشد.", "BASEURL_ERROR_HASH_DISALLOWED" : "URL اصلی نمی تواند hashes مشابه \"{0}\" داشته باشد.", "BASEURL_ERROR_INVALID_CHAR" : "برخی کاراکترهای خاص شبیه '{0}' می بایست %-encoded.", "BASEURL_ERROR_UNKNOWN_ERROR" : "خطای ناشناخته در URL اصلی/پایه", "EMPTY_VIEW_HEADER" : "<em>انتخاب کنید یک فایلی را در حالی که بر روی این قسمت تمرکز شده است</em>", // Strings for themes-settings.html and themes-general.html "CURRENT_THEME" : "پوسته فعلی", "USE_THEME_SCROLLBARS" : "استفاده از نوار شناور پوسته", "FONT_SIZE" : "اندازه قلم", "FONT_FAMILY" : "نوع قلم", "THEMES_SETTINGS" : "تنظیمات پوسته ها", // CSS Quick Edit "BUTTON_NEW_RULE" : "قائده جدید", // Extension Management strings "INSTALL" : "نصب", "UPDATE" : "بروزرسانی", "REMOVE" : "حذف", "OVERWRITE" : "دوباره نویسی", "CANT_REMOVE_DEV" : "افزونه های موجود در پوشه \"dev\" می بایست بصورت دستی حذف گردند.", "CANT_UPDATE" : "بروزرسانی سازگار با این نسخه از {APP_NAME} نیست.", "CANT_UPDATE_DEV" : "افزونه موجود در پوشه \"dev\" قادر به بروزرسانی خودکار نیست", "INSTALL_EXTENSION_TITLE" : "نصب افزونه", "UPDATE_EXTENSION_TITLE" : "بروزرسانی افزونه", "INSTALL_EXTENSION_LABEL" : "URL افزونه", "INSTALL_EXTENSION_HINT" : "URL افزونه های دارای پرونده zip یا مخازن Github", "INSTALLING_FROM" : "نصب افزونه ها از {0}\u2026", "INSTALL_SUCCEEDED" : "نصب با موفقیت به اتمام رسید!", "INSTALL_FAILED" : "نصب ناموفق.", "CANCELING_INSTALL" : "درحال لغو\u2026", "CANCELING_HUNG" : "عملیات لغو نصب زمان طولانی ای به طول خواهد کشید. خطا یا خطاهای داخلی ممکن است رخ دهد.", "INSTALL_CANCELED" : "فرایند نصب لغو گردید.", "VIEW_COMPLETE_DESCRIPTION" : "مشاهده توضیح کامل", "VIEW_TRUNCATED_DESCRIPTION" : "مشاهده توضیح مختصر", // These must match the error codes in ExtensionsDomain.Errors.* : "INVALID_ZIP_FILE" : "محتوای دانلود شده دارای پرونده zip معتبر نمی باشد.", "INVALID_PACKAGE_JSON" : "پرونده package.json معتبر نمی باشد (error was: {0}).", "MISSING_PACKAGE_NAME" : "پرونده package.json دارای خطا در نام می باشد.", "BAD_PACKAGE_NAME" : "نام بسته {0} نامعتبر می باشد.", "MISSING_PACKAGE_VERSION" : "پرونده package.json دارای خطا در نسخه می باشد.", "INVALID_VERSION_NUMBER" : "عدد نسخه این بسته ({0}) نامعتبر می باشد.", "INVALID_BRACKETS_VERSION" : "خطا در سازگاری {APP_NAME} با رشته نامعتبر({0}).", "DISALLOWED_WORDS" : "عبارت ({1}) اجازه وارد سازی در این فیلد را ندارد {0}", "API_NOT_COMPATIBLE" : "افزونه با این نسخه از برنامه {APP_NAME} سازگار نیست. در پوشه افزونه های قابل نمایش نصب نشد.", "MISSING_MAIN" : "بسته حاوی پرونده main.js نیست.", "EXTENSION_ALREADY_INSTALLED" : "نصب این بسته سبب دوباره نویسی پرونده های افزونه قبلی می شود. دوباره نویسی صورت گیرد?", "EXTENSION_SAME_VERSION" : "نسخه این بسته با نسخه بسته ای که هم اکنون نصب می باشد برابر است. آیا افزونه دوباره نویسی گردد?", "EXTENSION_OLDER_VERSION" : "این بسته نسخه {0} هست قبل تر نصب شده({1}). آیا این افزونه دوباره نویسی گردد?", "DOWNLOAD_ID_IN_USE" : "خطای داخلی: این ID دانلود هم اکنون درحال استفاده است.", "NO_SERVER_RESPONSE" : "ناتوان در اتصال به سرویس دهنده.", "BAD_HTTP_STATUS" : "پرونده در سرویس دهنده یافت نشد (HTTP {0}).", "CANNOT_WRITE_TEMP" : "ناتوان در ذخیره دانلود در یک پرونده خالی.", "ERROR_LOADING" : "این افزونه بهنگام شروع با خطا مواجه می شود.", "MALFORMED_URL" : "آدرس URL نامعتبر است. لطفا آن را بررسی کرده و آدرس معتبر وارد سازید.", "UNSUPPORTED_PROTOCOL" : "آدرس URL می بایست http یا https باشد.", "UNKNOWN_ERROR" : "خطای داخلی نامشخص.", // For NOT_FOUND_ERR, see generic strings above "EXTENSION_MANAGER_TITLE" : "مدیریت افزونه ها", "EXTENSION_MANAGER_ERROR_LOAD" : "ناتوان در دسترسی به افزونه های ثبت شده. لطفا بعدا تلاش کنید.", "INSTALL_EXTENSION_DRAG" : "پرونده زیپ را اینجا بکشید و یا", "INSTALL_EXTENSION_DROP" : "پرونده زیپ را رها کنید تا نصب شود", "INSTALL_EXTENSION_DROP_ERROR" : "نصب/بروزرسانی لغو شد، لطفا خطاهای زیر را بررسی کنید:", "INSTALL_FROM_URL" : "نصب کنید از آدرس اینترنتی\u2026", "INSTALL_EXTENSION_VALIDATING" : "بررسی صحت پرونده\u2026", "EXTENSION_AUTHOR" : "نویسنده", "EXTENSION_DATE" : "تاریخ", "EXTENSION_INCOMPATIBLE_NEWER" : "این افزونه نیاز به نسخه جدیدی از {APP_NAME} دارد.", "EXTENSION_INCOMPATIBLE_OLDER" : " نسخه فعلی این افزونه فقط با نسخه های قبلی {APP_NAME} سازگار است.", "EXTENSION_LATEST_INCOMPATIBLE_NEWER" : "نسخه {0} از این افزونه نیازمند نسخه جدیدی از {APP_NAME} می باشد. ولی شما می توانید یک نسخه پایین تر از {1} را نصب کنید.", "EXTENSION_LATEST_INCOMPATIBLE_OLDER" : "نسخه {0} از این افزونه فقط با نسخه قدیمی از {APP_NAME} کار می کند. اما شما به راحتی می توانید نصب کنید نسخه {1} را ", "EXTENSION_NO_DESCRIPTION" : "بدون شرح", "EXTENSION_MORE_INFO" : "اطلاعات بیشتر...", "EXTENSION_ERROR" : "خطای افزونه", "EXTENSION_KEYWORDS" : "کلمات کلیدی", "EXTENSION_TRANSLATED_USER_LANG" : "ترجمه شده به زبان های {0} که زبان شما را نیز در بر دارد", "EXTENSION_TRANSLATED_GENERAL" : "ترجمه شده به زبان های {0}", "EXTENSION_TRANSLATED_LANGS" : " این افزونه تنها برای زبان های زیر ترجمه شده است: {0}", "EXTENSION_INSTALLED" : "نصب شده", "EXTENSION_UPDATE_INSTALLED" : "بروزرسانی این افزونه دانلود و بعد از بارگذاری مجدد {APP_NAME} نصب می شود.", "EXTENSION_SEARCH_PLACEHOLDER" : "جستجو", "EXTENSION_MORE_INFO_LINK" : "بیشتر", "BROWSE_EXTENSIONS" : "پیمایش افزونه ها", "EXTENSION_MANAGER_REMOVE" : "حذف براکتس", "EXTENSION_MANAGER_REMOVE_ERROR" : "ناتوان در حذف یک یا بیشتر از یک افزونه : {0}. {APP_NAME} در حال بارگذاری مجدد.", "EXTENSION_MANAGER_UPDATE" : "بروزرسانی افزونه", "EXTENSION_MANAGER_UPDATE_ERROR" : "ناتوان در بروزرسانی یک افزونه یا بیشتر: {0}. {APP_NAME} در حال برگذاری مجدد.", "MARKED_FOR_REMOVAL" : "نشانه گذاری جهت حذف", "UNDO_REMOVE" : "مرحله قبل", "MARKED_FOR_UPDATE" : "انتخاب شده برای بروزرسانی", "UNDO_UPDATE" : "مرحله قبل", "CHANGE_AND_RELOAD_TITLE" : "تغییر افزونه ها و بارگذاری مجدد", "CHANGE_AND_RELOAD_MESSAGE" : "جهت بروزرسانی یا حذف افزونه ها, {APP_NAME} براکتس احتیاج به بارگذاری مجدد دارد. تغییرات ذخیره نشده شما ذخیره خواهد شد.", "REMOVE_AND_RELOAD" : "حذف افزونه ها و بارگذاری مجدد", "CHANGE_AND_RELOAD" : "تغییر افزونه ها و بارگذاری مجدد", "UPDATE_AND_RELOAD" : "بروزرسانی افزونه ها و بارگذاری مجدد", "PROCESSING_EXTENSIONS" : "درحال پردازش تغییرات\u2026", "EXTENSION_NOT_INSTALLED" : "ناتوان در حذف افزونه {0} زیرا این افزونه به درستی نصب نشده.", "NO_EXTENSIONS" : "هیچ افزونه ای نصب نشده.<br>جهت شروع بر روی زبانه در دسترس بالا کلیک کنید.", "NO_EXTENSION_MATCHES" : "هیچ افزونه ای منطبق با جستجوی شما پیدا نشد", "REGISTRY_SANITY_CHECK_WARNING" : "نکته: این افزونه ها ممکن است از نویسندگان مختلفی که براکتس را خودشان توسعه داده اند و متعلق به خوشان است باشند. افزونه ها بررسی نشده اند و امتیازات کاملا محلی هستند. احتیاط کنید در هنگام نصب افزونه هایی که منبع مشخصی ندارند.", "EXTENSIONS_INSTALLED_TITLE" : "نصب شده", "EXTENSIONS_AVAILABLE_TITLE" : "در دسترس", "EXTENSIONS_THEMES_TITLE" : "پوسته ها", "EXTENSIONS_UPDATES_TITLE" : "بروزرسانی ها", "INLINE_EDITOR_NO_MATCHES" : "هیچ مورد سازگاری در دسترس نیست.", "INLINE_EDITOR_HIDDEN_MATCHES" : "تمام سازگاری ها فرو ریخته هستند. گسترش فایل های ذکر شده در سمت راست جهت نمایش سازگاری.", "CSS_QUICK_EDIT_NO_MATCHES" : "هیچ قائده منطبقی برای CSSها نسبت به موردی که انتخاب کرده اید وجود ندارد.<br> از گزینه \"قائده جدید\" برای تعریف یک قائده جدید استفاده کنید.", "CSS_QUICK_EDIT_NO_STYLESHEETS" : "هیچ شیوه نامه ای-پرونده CSS- در پروژه شما وجود ندارد.<br>جهت تعریف قوائد CSS ابتدا یک پرونده شیوه نامه ایجاد کنید.", // Custom Viewers "IMAGE_VIEWER_LARGEST_ICON" : "بزرگتر", /** * Unit names */ "UNIT_PIXELS" : "پیکسل", // extensions/default/DebugCommands "DEBUG_MENU" : "خطایابی", "ERRORS" : "خطاها", "CMD_SHOW_DEV_TOOLS" : "نمایش ابزار توسعه", "CMD_REFRESH_WINDOW" : "بارگذاری مجدد با افزونه ها", "CMD_RELOAD_WITHOUT_USER_EXTS" : "بارگذاری مجدد بدون افزونه ها", "CMD_NEW_BRACKETS_WINDOW" : "پنجره جدید از {APP_NAME} باز کنید.", "CMD_SWITCH_LANGUAGE" : "تغییر زبان", "CMD_RUN_UNIT_TESTS" : "بررسی برای اجرا", "CMD_SHOW_PERF_DATA" : "نمایش داده های عملکردی", "CMD_ENABLE_NODE_DEBUGGER" : "فعال سازی اشکال زدای گره ای", "CMD_LOG_NODE_STATE" : "ورود گره به حالت کنسول", "CMD_RESTART_NODE" : "شروع دوباره گره", "CMD_SHOW_ERRORS_IN_STATUS_BAR" : "نمایش خطاها در نوار وظیفه", "CMD_OPEN_BRACKETS_SOURCE" : "باز کردن منبع براکتس", "LANGUAGE_TITLE" : "تغییر زبان", "LANGUAGE_MESSAGE" : "زبان:", "LANGUAGE_SUBMIT" : "بارگذاری مجدد {APP_NAME}", "LANGUAGE_CANCEL" : "لغو", "LANGUAGE_SYSTEM_DEFAULT" : "پیشفرض سیستم", // extensions/default/InlineTimingFunctionEditor "INLINE_TIMING_EDITOR_TIME" : "زمان", "INLINE_TIMING_EDITOR_PROGRESSION" : "پیشرفت", "BEZIER_EDITOR_INFO" : "<kbd>↑</kbd><kbd>↓</kbd><kbd>←</kbd><kbd>→</kbd> انتخاب حرکت نشانگر<br><kbd class='text'>شیفت</kbd>حرکت با ده واحد<br><kbd class='text'>تب</kbd> نقاط تغییر", "STEPS_EDITOR_INFO" : "<kbd>↑</kbd><kbd>↓</kbd>افزایش و یا کاهش گام<br><kbd>←</kbd><kbd>→</kbd> 'شروع' or 'پایان'", "INLINE_TIMING_EDITOR_INVALID" : "مقدار سابق <code>{0}</code> دیگر معتبر نمی باشد, زیرا تابع نمایش به مقدار <code>{1}</code> تغییر یافته. سند در اولین ویرایش بروزرسانی خواهد شد.", // extensions/default/InlineColorEditor "COLOR_EDITOR_CURRENT_COLOR_SWATCH_TIP" : "رنگ فعلی", "COLOR_EDITOR_ORIGINAL_COLOR_SWATCH_TIP" : "رنگ اصلی", "COLOR_EDITOR_RGBA_BUTTON_TIP" : "RGBa قالب", "COLOR_EDITOR_HEX_BUTTON_TIP" : "Hex قالب", "COLOR_EDITOR_HSLA_BUTTON_TIP" : "HSLa قالب", "COLOR_EDITOR_USED_COLOR_TIP_SINGULAR" : "{0} ({1} بار استفاده شده)", "COLOR_EDITOR_USED_COLOR_TIP_PLURAL" : "{0} ({1} بار استفاده شده)", // extensions/default/JavaScriptCodeHints "CMD_JUMPTO_DEFINITION" : "پرش جهت تعریف", "CMD_SHOW_PARAMETER_HINT" : "نمایش نکات پارامتر", "NO_ARGUMENTS" : "<بدون پارامترها>", "DETECTED_EXCLUSION_TITLE" : "خطای منطقی در پرونده جاوا اسکریپت", "DETECTED_EXCLUSION_INFO" : "براکتس در حال انجام یک پردازش مشکل دار با پرونده <span class='dialog-filename'>{0}</span> است.<br><br>این پرونده اشاره گرهای کدها را بطور کامل نشان نخواهد داد, برای این منظور میتوانید از حالت تعریف یا ویرایش سریع استفاده نمایید. جهت فعال سازی دوباره این پرونده, <code>.brackets.json</code> را در پروژه خود باز کنید و <code>jscodehints.detectedExclusions</code> را ویرایش نمایید.<br><br>این مشکل میتواند یک Bug در براکتس باشد. اگر مشکلی در ارائه این پرونده به ما ندارید, لطفا گزارش <a href='https://github.com/adobe/brackets/wiki/How-to-Report-an-Issue'>پرونده دارای اشکال</a> را با یک لینک به پرونده جهت بررسی ثبت نمایید.", // extensions/default/JSLint "JSLINT_NAME" : "JSLint", // extensions/default/QuickView "CMD_ENABLE_QUICK_VIEW" : "مشاهده سریع بهنگام اشاره با ماوس", // extensions/default/RecentProjects "CMD_TOGGLE_RECENT_PROJECTS" : "پروژه های اخیر", // extensions/default/MDNDocs "DOCS_MORE_LINK" : "بیشتر بخوانید" }); /* Last translated for eef9c68a1fdff372b9ea6352cacb5e2506e55be9 */
adobe/brackets
src/nls/fa-ir/strings.js
JavaScript
mit
56,474
/************************************************************* * * MathJax/jax/output/SVG/fonts/Neo-Euler/Main/Regular/Main.js * * Copyright (c) 2013-2016 The MathJax Consortium * * 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. */ MathJax.OutputJax['SVG'].FONTDATA.FONTS['NeoEulerMathJax_Main'] = { directory: 'Main/Regular', family: 'NeoEulerMathJax_Main', id: 'NEOEULERMAIN', 0x1: [0,0,333,0,0,''], 0x20: [0,0,333,0,0,''], 0x21: [690,11,295,90,204,'90 46c0 31 26 57 58 57c31 0 56 -26 56 -57s-25 -57 -56 -57c-32 0 -58 26 -58 57zM132 184l-27 383c-2 19 -3 41 -3 58c0 12 1 24 4 36c2 7 5 15 12 20c10 7 22 9 34 9c9 0 18 -2 24 -8c11 -10 13 -24 13 -38c0 -29 -2 -58 -5 -87l-36 -371'], 0x22: [695,-432,214,9,196,'34 432l-20 152c-3 24 -5 49 -5 73c0 10 0 22 9 29c7 6 16 9 25 9c8 0 16 0 22 -5c5 -4 11 -8 11 -15v-52l-21 -191h-21zM155 432l-22 193c-2 14 -5 38 -5 43s2 11 7 15c8 8 20 9 32 9c8 0 17 -1 23 -8c3 -3 6 -7 6 -11c0 -16 0 -32 -1 -47l-19 -194h-21'], 0x23: [690,0,500,4,493,'469 268v-40h-107l-35 -228h-41l35 228h-164l-35 -228h-41l35 228h-112v40h118l26 166h-117v40h123l33 216h41l-33 -216h164l33 216h41l-33 -216h93v-40h-99l-26 -166h101zM327 268l26 166h-164l-26 -166h164'], 0x24: [708,107,557,84,480,'477 555l-58 -51l-12 3c-6 26 -15 53 -34 72c-15 14 -32 24 -51 28v-246l12 -5c34 -15 81 -42 98 -59c28 -27 48 -69 48 -107c0 -48 -22 -92 -56 -126c-29 -29 -64 -51 -102 -64v-99l-40 -8l-1 96c-17 -3 -34 -5 -52 -5c-43 0 -81 11 -111 42c-15 15 -27 33 -34 52l52 61 l16 -1c8 -28 19 -57 39 -77c22 -22 46 -35 76 -35c5 0 9 0 14 1l1 263c-41 18 -93 42 -116 65c-30 30 -47 72 -47 114c0 43 14 87 44 118c33 32 75 49 119 55v58l40 8v-64c45 -1 90 -9 122 -41c14 -14 24 -31 33 -48zM322 268v-229c16 7 30 17 42 29c24 24 35 60 35 94 c0 22 -15 52 -32 71c-11 12 -28 24 -45 35zM281 381v228c-24 -4 -45 -16 -61 -33c-19 -19 -27 -47 -27 -75c0 -33 17 -62 40 -85c13 -13 30 -25 48 -35'], 0x25: [708,20,840,58,789,'656 344c31 -9 60 -26 82 -49c30 -29 51 -67 51 -109c0 -51 -25 -98 -60 -133c-29 -29 -64 -53 -105 -53c-29 0 -56 12 -76 32c-29 29 -41 71 -41 112c0 50 23 96 58 131c27 27 57 51 91 69zM612 293c-16 -10 -24 -20 -30 -30c-16 -23 -22 -55 -22 -84 c0 -39 11 -78 39 -105c16 -16 40 -29 62 -29c20 0 30 1 44 11c26 18 33 67 33 97c0 37 -13 74 -40 101c-19 19 -58 37 -86 39zM208 688c31 -9 60 -26 82 -49c30 -29 51 -67 51 -109c0 -51 -25 -98 -60 -133c-29 -29 -65 -53 -106 -53c-29 0 -56 11 -76 31 c-29 29 -41 71 -41 112c0 50 23 97 58 132c27 27 58 51 92 69zM163 637c-16 -10 -24 -21 -30 -31c-16 -23 -22 -55 -22 -84c0 -39 11 -78 39 -105c16 -16 41 -28 63 -28c20 0 29 1 43 11c26 18 34 67 34 97c0 37 -14 74 -41 101c-19 19 -58 37 -86 39zM603 702l4 -11 l-357 -711l-32 10l-2 14l354 703l11 1'], 0x26: [698,11,737,49,734,'346 356l2 43c56 -3 133 -3 200 -3c52 0 126 0 156 3l-3 -48c-41 7 -98 7 -147 7c5 -21 9 -42 9 -63c0 -67 -33 -127 -74 -180l3 -3c16 -17 34 -32 55 -44c15 -8 32 -15 50 -15c24 0 47 9 64 26c29 29 42 67 52 110l21 -5c-10 -58 -29 -116 -71 -158 c-26 -26 -61 -37 -97 -37c-50 0 -95 25 -130 59l-5 4c-40 -32 -95 -60 -153 -60c-61 0 -123 12 -167 55c-39 40 -62 93 -62 148c0 47 13 89 47 123c24 24 70 54 111 79c-16 39 -26 81 -26 123c0 50 17 99 53 135c29 29 69 43 110 43c29 0 57 -11 77 -32 c16 -15 25 -37 25 -60c0 -44 -14 -81 -47 -111c-30 -28 -104 -71 -121 -79c24 -53 58 -114 92 -163c29 -42 68 -85 104 -122c26 38 38 87 38 135c0 30 -15 58 -36 79c-16 16 -39 16 -61 16c-23 0 -46 -2 -69 -5zM416 68c-37 41 -75 92 -105 138c-35 52 -71 113 -95 170 c-23 -15 -43 -37 -51 -45c-26 -30 -38 -72 -38 -113c0 -54 21 -105 59 -143c28 -28 67 -44 107 -44c53 0 91 11 123 37zM270 435c27 17 56 37 70 51c25 25 34 61 34 96c0 21 -10 42 -25 57c-10 10 -29 24 -42 24c-23 0 -31 -3 -45 -17c-18 -18 -20 -62 -20 -87 c0 -43 11 -84 28 -124'], 0x27: [695,-436,212,68,134,'88 436l-18 193c-1 12 -2 24 -2 37c0 8 3 15 9 20c7 6 17 9 27 9c8 0 16 -1 22 -7c6 -7 8 -17 8 -26c0 -11 -2 -27 -4 -40l-26 -186h-16'], 0x28: [738,187,388,113,301,'301 -163v-24c-48 4 -90 42 -118 79c-31 43 -43 95 -52 146c-14 80 -18 161 -18 242c0 77 5 155 20 230c11 54 27 108 58 154c25 35 69 67 110 74v-27c-32 -8 -65 -38 -81 -72c-22 -47 -33 -98 -41 -150c-11 -71 -14 -143 -14 -215c0 -86 3 -172 17 -256 c6 -29 12 -58 22 -86c7 -20 16 -39 30 -55c17 -20 47 -36 67 -40'], 0x29: [736,189,388,86,276,'86 709v27c34 -7 66 -28 90 -54c40 -44 60 -101 75 -158c20 -83 25 -167 25 -252c0 -84 -4 -169 -20 -252c-11 -53 -26 -106 -61 -148c-27 -33 -78 -57 -109 -61v24c27 7 59 22 79 47c12 15 19 33 25 51c9 27 16 52 20 79c13 87 14 176 14 264c0 79 -5 158 -19 235 c-11 53 -24 106 -55 151c-16 22 -39 38 -64 47'], 0x2A: [692,-448,277,28,239,'157 448h-40c6 38 8 68 9 111c-27 -21 -53 -44 -77 -72l-21 35c34 17 61 35 87 53c-29 21 -56 37 -85 52l27 28c22 -21 43 -40 68 -59c0 32 0 63 -8 96h40c-7 -33 -9 -62 -11 -95c25 20 48 41 68 62l25 -31c-32 -15 -60 -32 -88 -52c31 -23 60 -43 88 -56l-26 -29 c-17 19 -41 41 -67 61c1 -35 3 -68 11 -104'], 0x2B: [586,74,755,46,709,'396 276h313l-5 -40h-308v-303l-40 -7v310h-310l7 40h303v304l40 6v-310'], 0x2C: [138,210,277,67,214,'110 -210l-19 14c20 26 48 68 58 93c5 12 8 29 8 42c0 15 -4 30 -13 42l-70 83c-4 5 -7 16 -7 26c0 13 13 28 23 36c8 6 26 12 36 12c8 0 26 -8 34 -18c15 -20 37 -73 46 -96c6 -16 8 -34 8 -51c0 -25 -10 -47 -22 -69c-18 -32 -39 -64 -82 -114'], 0x2D: [276,-236,544,40,504,'498 236h-458l7 40h457'], 0x2E: [119,15,277,77,211,'77 52c0 37 30 67 67 67s67 -30 67 -67s-30 -67 -67 -67s-67 30 -67 67'], 0x2F: [720,192,501,39,463,'458 715l5 -11l-389 -896l-32 8l-3 14l386 888l11 2'], 0x30: [704,14,499,34,460,'290 704c50 -32 86 -72 115 -122c40 -69 55 -148 55 -226c0 -61 -8 -122 -28 -179c-16 -48 -42 -94 -78 -131c-39 -38 -92 -60 -147 -60c-33 0 -65 13 -89 36c-31 31 -52 72 -63 114c-16 56 -21 109 -21 167c0 120 45 241 130 326c33 33 82 57 126 75zM234 640 c-19 -12 -37 -26 -53 -45c-52 -63 -80 -143 -80 -224c0 -58 5 -117 21 -172c13 -43 31 -84 62 -115c19 -19 48 -32 68 -32c31 0 64 9 85 31c23 23 36 52 46 83c12 38 15 79 15 119c0 90 -24 176 -68 254c-6 12 -51 82 -96 101'], 0x31: [712,5,499,92,314,'308 712l6 -12c-5 -89 -7 -179 -7 -268c0 -136 0 -334 3 -410l-84 -27l-12 5c5 139 8 279 8 419c0 49 0 122 -1 147s-21 46 -46 46h-83v27'], 0x32: [708,-2,499,12,472,'472 80l-23 -78h-437v16c57 58 113 117 166 179c35 41 70 83 98 129c35 56 58 117 58 182c0 29 -6 70 -34 99c-20 22 -50 33 -79 33c-22 0 -44 -4 -63 -14c-28 -15 -50 -30 -74 -50l-20 19c30 33 64 63 104 84c33 18 69 29 107 29c41 0 80 -15 109 -44 c30 -29 42 -70 42 -111c0 -53 -22 -102 -48 -148c-25 -46 -56 -88 -88 -130c-45 -60 -93 -118 -143 -176c-1 -1 -2 -4 -1 -6c2 -4 7 -5 12 -5h309'], 0x33: [702,17,499,18,446,'241 382v-8c34 -3 67 -8 100 -19c23 -8 47 -19 65 -37c27 -27 40 -64 40 -103c0 -59 -27 -114 -69 -156c-52 -51 -123 -76 -196 -76c-57 0 -111 20 -156 55l-7 11l42 72h10c12 -20 25 -38 41 -54c25 -26 59 -44 95 -44c37 0 73 13 100 40c32 32 46 78 46 123 c0 43 -20 83 -49 114c-18 19 -43 28 -68 34c-36 9 -73 11 -110 11l1 26c30 7 61 15 89 28c22 10 43 22 59 38c28 28 43 65 43 103c0 27 -10 52 -29 71c-21 21 -50 28 -80 28c-17 0 -34 -6 -51 -13c-25 -11 -48 -25 -71 -40l-14 22c31 26 65 51 101 70c25 13 52 24 80 24 c39 0 80 -8 108 -37c26 -25 38 -61 38 -97c0 -45 -15 -90 -47 -122c-31 -30 -70 -52 -111 -64'], 0x34: [704,5,499,-1,473,'361 704l7 -6c-1 -27 -1 -299 -1 -454l7 -9h94l5 -7l-16 -37h-82l-8 -8c0 -54 0 -133 3 -155l-80 -33l-5 6c5 35 5 118 5 181l-7 9h-284v44l286 434zM290 243v342c0 2 -1 5 -1 6c-2 3 -7 2 -9 0c-34 -39 -64 -85 -93 -130c-38 -59 -122 -197 -123 -219l5 -7h215'], 0x35: [687,11,499,12,448,'125 594v-181v-7c41 20 86 37 132 37c51 0 102 -14 138 -50c38 -37 53 -90 53 -142c0 -67 -23 -133 -70 -180c-53 -53 -125 -82 -200 -82c-63 0 -124 26 -165 75l-1 12l44 56h11c12 -26 25 -52 46 -73c19 -19 45 -33 73 -33c41 0 82 13 112 43c39 39 54 98 54 154 c0 50 -11 102 -47 138c-24 24 -58 34 -92 34c-44 0 -85 -22 -117 -53l-13 11v327l7 7h335l-27 -78c-87 -2 -213 -5 -261 -5c-6 0 -12 -4 -12 -10'], 0x36: [700,13,499,45,471,'471 688l-20 -54l-9 -4c-20 8 -38 11 -58 11c-61 0 -115 -27 -156 -65c-79 -73 -98 -174 -99 -270l7 -1c53 43 116 72 185 72c38 0 76 -16 103 -43c32 -33 47 -78 47 -123c0 -60 -30 -113 -72 -155c-43 -43 -101 -69 -163 -69c-45 0 -89 15 -121 47 c-53 53 -70 130 -70 204c0 125 45 249 134 338c35 37 75 69 120 92c36 19 76 32 117 32c15 0 40 -6 55 -12zM132 265c0 -41 4 -86 16 -126c9 -29 26 -58 47 -79c18 -17 43 -28 68 -28c32 0 65 8 88 31c29 28 41 68 41 109c0 40 -17 79 -46 107c-23 24 -57 35 -90 35 c-41 0 -102 -28 -124 -49'], 0x37: [694,8,499,49,494,'494 674l-154 -252c-78 -128 -143 -264 -175 -410l-84 -20l-6 8c24 82 109 232 163 324c0 0 98 171 160 270l-6 12h-336l-7 9l21 79c18 -6 171 -8 216 -8h208v-12'], 0x38: [706,10,499,40,461,'238 334c-27 -14 -57 -33 -79 -55c-26 -27 -36 -65 -36 -102c0 -41 13 -82 42 -112c21 -20 51 -33 80 -33c33 0 68 8 92 32c26 26 37 67 37 104c0 41 -21 77 -50 106c-15 13 -64 46 -86 60zM312 385c37 -25 86 -61 103 -78c29 -29 46 -68 46 -110c0 -48 -17 -95 -51 -130 c-50 -50 -119 -77 -191 -77c-48 0 -102 10 -137 45c-32 32 -42 77 -42 122c0 42 12 85 43 115c25 25 75 55 118 80v11c-32 22 -59 46 -82 78c-17 27 -30 57 -30 89c0 40 14 81 45 108c35 31 77 51 120 68c30 1 57 -3 85 -12c21 -7 44 -19 60 -35c24 -24 36 -57 36 -91 s-15 -66 -35 -93c-24 -32 -54 -58 -88 -79v-11zM279 412c42 29 72 78 72 131c0 21 -9 51 -29 75c-23 26 -56 41 -99 41c-15 -10 -33 -25 -41 -36c-12 -17 -16 -41 -16 -61c0 -26 12 -50 28 -71c21 -30 55 -58 85 -79'], 0x39: [702,9,499,40,462,'214 11l-85 -20l-10 8c20 46 68 110 113 168c0 0 85 114 117 169l-5 6c-30 -16 -61 -28 -91 -36c-18 -5 -40 -7 -59 -7c-28 0 -75 18 -102 45c-29 29 -52 75 -52 121c0 52 10 97 39 133s117 82 167 104c50 0 80 -5 99 -11c25 -8 49 -21 68 -40c32 -32 49 -77 49 -123 c0 -38 -13 -75 -28 -111c-23 -52 -52 -100 -84 -147c-34 -50 -67 -101 -95 -155c-18 -33 -35 -67 -41 -104zM351 384c25 25 31 63 31 98c0 47 -19 92 -52 125c-25 25 -69 37 -111 37c-7 0 -10 0 -17 -1c-46 -27 -73 -70 -73 -128c0 -48 15 -96 49 -129c21 -21 52 -34 81 -34 c33 0 68 8 92 32'], 0x3A: [455,12,216,50,164,'50 45c0 31 26 57 58 57c31 0 56 -26 56 -57s-25 -57 -56 -57c-32 0 -58 26 -58 57zM50 398c0 31 26 57 58 57c31 0 56 -26 56 -57s-25 -57 -56 -57c-32 0 -58 26 -58 57'], 0x3B: [457,190,216,48,179,'48 400c0 31 26 57 58 57c31 0 56 -26 56 -57s-25 -57 -56 -57c-32 0 -58 26 -58 57zM89 -190l-15 13c17 23 29 48 40 74c6 13 7 26 7 39c0 14 -5 27 -13 38l-34 51c-5 8 -9 17 -9 26c0 12 1 27 9 35l2 2c9 7 20 11 32 11c8 0 16 -4 21 -11c17 -18 31 -38 40 -60 c6 -16 10 -33 10 -50c0 -27 -10 -52 -23 -75c-19 -33 -43 -63 -67 -93'], 0x3C: [531,36,756,59,680,'680 505l-2 -9l-522 -241v-12l519 -241l5 -10l-11 -23l-10 -5l-600 280v12l601 275l11 -3'], 0x3D: [369,-132,756,54,722,'716 329h-662l7 40h661zM716 132h-662l7 40h661'], 0x3E: [531,36,756,76,698,'78 494l-2 10l10 24l10 3l602 -275v-12l-600 -280l-10 5l-8 24l4 9l518 243v9'], 0x3F: [693,11,362,45,358,'106 46c0 31 25 57 56 57c32 0 58 -26 58 -57s-26 -57 -58 -57c-31 0 -56 26 -56 57zM186 211l-46 -32c-23 14 -42 41 -42 71c0 21 14 38 26 55c22 28 48 52 75 76c49 42 88 98 88 164c0 30 -13 61 -34 82c-17 17 -40 34 -64 34s-45 -8 -62 -25c-10 -11 -19 -31 -19 -47 c0 -24 13 -46 32 -61l-67 -40c-18 16 -28 43 -28 69c0 29 14 55 34 75c40 40 94 61 150 61c33 0 68 -8 92 -32c25 -25 37 -60 37 -96c0 -33 -13 -60 -30 -89c-18 -30 -73 -79 -103 -106c-36 -32 -66 -71 -66 -96c0 -20 11 -40 27 -52v-11'], 0x40: [688,31,744,26,718,'389 20c121 0 208 61 263 133l11 -2l28 -18v-12c-63 -84 -167 -152 -304 -152c-200 0 -361 152 -361 352c0 91 36 182 99 248c70 74 170 118 272 119h3c168 0 318 -118 318 -287c0 -51 -15 -103 -44 -145c-36 -53 -106 -112 -175 -116c-11 0 -24 3 -32 12 c-9 10 -11 22 -13 35l-12 3c-22 -14 -43 -27 -67 -36c-20 -8 -40 -14 -62 -14c-29 0 -59 10 -79 33c-30 36 -37 83 -37 129c0 62 16 126 61 170c34 32 80 46 127 46c25 0 59 -10 84 -28l42 25l4 -4c-5 -89 -5 -180 -3 -269c0 -20 6 -58 31 -53c34 8 84 55 107 99 c16 31 24 66 24 101c0 147 -128 247 -274 247h-3c-85 -1 -169 -37 -229 -98c-56 -57 -89 -136 -89 -216c0 -172 136 -302 310 -302zM368 192c35 0 62 20 84 36v182c0 21 0 41 -13 54c-14 15 -33 26 -53 26c-28 0 -54 -10 -75 -30c-19 -17 -41 -61 -43 -141 c0 -33 4 -66 22 -94c17 -26 49 -33 78 -33'], 0x41: [680,10,770,25,743,'536 76l-54 188c-2 4 -8 9 -11 9h-225c-4 0 -8 -4 -10 -8l-117 -248l-91 -19l-3 10c119 200 234 404 339 612c1 3 1 4 1 7s-3 9 -12 11l-90 15v27h194c15 -83 60 -243 93 -363c22 -81 49 -178 85 -238c9 -15 24 -24 41 -28c7 -1 15 -2 23 -2c14 0 29 2 43 3l1 -26 l-104 -30c-15 -4 -30 -6 -45 -6c-11 0 -20 5 -27 13c-14 13 -24 47 -31 73zM382 572l-116 -244c-1 -2 -1 -8 -1 -9c0 -3 4 -7 7 -7h188c5 0 7 4 7 7c0 0 -2 8 -2 9l-70 244c-1 2 -4 4 -7 4s-6 -3 -6 -4'], 0x42: [686,1,655,50,574,'215 324v-258c0 -13 5 -17 11 -21s32 -6 64 -6c54 0 110 12 149 50c31 32 44 75 44 119c0 33 -8 68 -33 93c-18 18 -42 27 -67 34c-34 9 -70 11 -106 11c-18 0 -47 0 -52 -1c-4 0 -8 -3 -10 -7v-14zM215 411v-20c1 -4 5 -7 8 -8c8 -3 31 -2 46 -2c51 0 101 15 137 50 c30 30 43 72 43 114c0 29 -14 55 -34 75c-12 12 -30 17 -47 21c-26 6 -53 7 -80 7c-20 0 -40 -2 -60 -5c-7 -1 -11 -7 -13 -14v-218zM381 378l-1 -8c31 -4 67 -12 97 -21c20 -6 42 -19 57 -34c31 -31 40 -71 40 -114c0 -50 -18 -98 -53 -133c-55 -56 -136 -69 -212 -69 c-66 1 -197 2 -198 2l-1 10c6 9 18 25 18 26c2 3 3 6 4 10c0 1 1 23 1 34v530c0 17 -15 27 -17 28c-17 8 -41 16 -66 23l1 17l7 7h247c41 0 81 -2 121 -12c27 -7 54 -16 74 -36c22 -23 34 -53 34 -85c0 -41 -14 -81 -43 -110c-30 -31 -70 -48 -110 -65'], 0x43: [699,15,714,87,672,'615 528l-14 1c-12 32 -29 61 -52 84c-33 33 -81 45 -127 45c-61 0 -123 -21 -167 -65c-28 -29 -46 -65 -58 -103c-15 -47 -21 -97 -21 -146c0 -92 48 -190 81 -223c55 -55 97 -83 179 -83c68 0 131 29 187 67l17 -29c-72 -49 -152 -91 -239 -91c-79 0 -161 17 -218 74 c-70 70 -96 169 -96 267c0 96 21 195 91 264c73 73 174 109 278 109c65 0 131 -16 177 -63c15 -15 28 -32 39 -50'], 0x44: [686,-2,828,51,738,'212 575v-405c1 -40 3 -102 18 -117c13 -13 52 -13 79 -13c49 0 98 5 145 20c37 12 73 29 101 57c68 68 89 166 89 260c0 61 -17 158 -73 214c-22 22 -48 35 -90 44c-33 7 -142 10 -189 10c-43 0 -60 -1 -66 -4s-8 -6 -11 -12c-2 -3 -3 -23 -3 -54zM106 2v10 c20 15 21 29 22 67v494c0 16 -1 32 -2 47c-1 10 -8 17 -17 21c-19 7 -39 12 -58 18v19l7 8h313c62 0 124 -5 184 -20c43 -11 85 -27 116 -58c25 -25 40 -57 50 -91c13 -42 17 -87 17 -132c0 -127 -22 -211 -99 -294c-31 -34 -81 -54 -125 -67c-57 -17 -117 -22 -177 -22 h-231'], 0x45: [688,0,604,46,559,'456 336c-39 3 -79 6 -118 6c-38 0 -101 -2 -119 -3c-7 -1 -10 -5 -10 -12v-139c0 -38 1 -87 15 -112c6 -12 18 -20 30 -26c12 -5 38 -6 66 -6c47 0 70 0 234 14l5 -5l-13 -53h-388c-9 5 -15 15 -20 25c-5 12 -6 27 -6 41v492c0 14 0 44 -9 64c-2 6 -10 11 -17 16 c-8 6 -38 13 -59 16l-1 20l7 7l148 1c70 0 171 6 242 6c18 0 33 0 46 -1l-2 -50l-4 -7c-69 4 -202 10 -209 10h-40c-5 -1 -10 -4 -13 -9c-8 -12 -11 -44 -11 -67v-166c0 -7 3 -11 10 -12c39 -3 159 -1 236 5l6 -7'], 0x46: [690,2,499,39,467,'125 360l2 161c0 30 -1 60 -4 90c-1 17 -12 32 -29 36l-55 13v21l7 7c142 0 348 0 421 2v-53l-8 -8c-72 5 -144 20 -216 20c-13 0 -27 -6 -32 -23c-4 -14 -7 -24 -7 -235c0 -5 4 -13 13 -13c73 0 163 9 235 12l-1 -49l-5 -5c-70 4 -158 5 -229 5c-5 0 -12 -4 -12 -11 c0 -101 1 -216 5 -317l-92 -15c4 121 7 241 7 362'], 0x47: [699,17,765,90,676,'376 296l276 11c2 -91 5 -273 5 -274c-88 -23 -196 -50 -269 -50c-76 0 -151 26 -205 80c-68 68 -93 166 -93 261c0 98 22 199 92 269c75 75 180 106 285 106c64 0 128 -20 173 -65c11 -11 25 -31 36 -48l-58 -57l-12 1c-13 26 -28 51 -48 71c-36 36 -85 49 -136 49 c-59 0 -118 -14 -161 -56c-29 -29 -47 -66 -60 -105c-15 -48 -21 -98 -21 -149c0 -88 24 -160 82 -228c44 -52 118 -77 196 -77c32 0 63 3 94 10c10 2 17 11 18 21c2 31 3 62 2 93c0 23 -1 47 -3 69c-1 14 -11 27 -25 28c-44 5 -108 7 -162 9l-6 5v26'], 0x48: [690,2,783,52,744,'744 14l-6 -6l-149 -8l-11 21c2 97 5 216 5 313c0 5 -3 12 -12 12h-343c-7 0 -13 -5 -13 -12c0 -67 -1 -163 0 -230c0 -26 2 -52 5 -78l-92 -28l-6 5c10 113 10 242 10 364c0 83 -1 166 -6 249c-1 9 -3 20 -13 24c-4 1 -40 12 -60 19l-1 19l7 7h162l5 -5 c-4 -22 -6 -46 -7 -69c-2 -65 -6 -149 -6 -214c0 -5 2 -12 12 -12h346c11 0 12 6 12 12c0 86 -3 190 -3 276l88 17l5 -6c-3 -39 -7 -80 -8 -119c-4 -162 -5 -324 1 -486c0 -17 13 -30 29 -34c18 -5 47 -13 48 -13'], 0x49: [683,1,394,78,348,'346 -1h-265v26c20 4 43 9 61 14c13 5 24 17 26 31c1 11 1 43 2 64v363c0 39 0 77 -3 115c-1 13 -9 26 -22 29c-1 0 -45 9 -67 14v22l7 6h250l6 -6v-21l-67 -15c-13 -3 -21 -14 -22 -26c-3 -20 -3 -78 -3 -116c0 -124 -1 -228 2 -330c0 -33 1 -66 4 -99 c1 -16 14 -26 28 -30c22 -5 64 -17 65 -17'], 0x4A: [690,234,402,50,351,'260 608v-517c0 -41 -1 -83 -13 -122c-14 -45 -37 -88 -71 -121c-27 -25 -77 -64 -112 -82l-14 18c22 14 48 37 64 54c21 24 32 55 43 93c10 34 18 105 18 165v512c0 11 -4 34 -16 37l-72 18v21l7 6h250l7 -6l-2 -24l-68 -14c-12 -3 -21 -20 -21 -38'], 0x4B: [683,7,668,49,632,'221 319l-9 -1c0 -98 0 -196 6 -293l-81 -29l-11 5l3 147v447c0 10 -1 21 -5 31c-3 6 -7 13 -14 15c-20 6 -60 18 -61 18l2 17l8 7h158l7 -7c-4 -12 -8 -49 -8 -50c-2 -27 -7 -155 -7 -268l8 -1l287 326h90l-1 -9l-291 -294c-3 -3 -8 -8 -8 -11s1 -5 5 -9 c107 -107 272 -271 333 -325l-1 -11l-85 -31c-105 112 -217 217 -325 326'], 0x4C: [690,5,559,50,534,'534 48l-14 -53c-74 7 -275 7 -413 7v14c7 10 12 22 15 31c4 10 7 82 7 96v478c0 14 -6 30 -21 33c-20 4 -57 12 -58 12l1 17l7 7h237l6 -6v-21c-1 0 -44 -9 -65 -14c-12 -2 -17 -14 -18 -25c-10 -177 -5 -383 1 -568c1 -6 8 -13 13 -13c104 0 286 14 292 15'], 0x4D: [690,6,1044,79,1010,'800 690h103v-12c-6 -3 -15 -10 -19 -19c-6 -15 -6 -51 -6 -76c0 -164 2 -317 18 -481c2 -17 10 -34 24 -45c10 -7 22 -11 34 -11c13 0 38 4 56 6v-24c-44 -16 -96 -34 -136 -34c-14 0 -28 2 -41 6s-22 21 -22 29v182c0 25 -8 271 -10 337c0 8 -3 15 -8 15 c-3 0 -8 -3 -11 -8l-286 -554h-30c-75 180 -169 409 -232 537c-3 5 -7 10 -11 10s-7 -4 -8 -11c-23 -170 -40 -342 -54 -514l-75 -26l-7 3c38 196 73 393 100 591c2 12 2 26 -6 36c-5 7 -12 12 -21 15l-68 19l2 22l7 7h176c55 -161 149 -361 232 -538c2 -4 7 -14 11 -14 s10 5 12 9'], 0x4E: [694,5,829,49,710,'704 694l6 -8c-13 -227 -15 -459 -15 -686h-36c-23 26 -37 42 -67 80l-159 198c-102 126 -184 221 -234 277c-3 4 -8 10 -12 9c-6 -2 -6 -11 -6 -17c0 -129 13 -348 24 -522l-70 -30l-9 9c10 201 16 403 12 604c0 8 0 16 -6 22c-4 5 -9 10 -15 11c-1 0 -43 10 -64 15 l-4 27l8 7h162c133 -176 295 -391 412 -517c3 -3 7 -8 11 -8c5 0 6 6 6 8c0 102 -3 201 -24 505'], 0x4F: [700,18,803,72,726,'72 318c0 129 27 214 101 294c64 68 168 88 261 88c76 0 153 -22 208 -76c29 -30 48 -68 61 -108c16 -48 23 -100 23 -152c0 -65 -1 -131 -41 -212c-47 -98 -177 -170 -334 -170c-66 0 -140 20 -187 68c-71 70 -92 168 -92 268zM165 348c0 -94 17 -180 79 -248 c60 -67 121 -77 160 -77c58 0 106 20 146 59c29 30 47 68 61 108c15 46 21 96 21 146c0 96 -24 202 -93 270c-38 40 -84 54 -137 54c-57 0 -120 -24 -158 -64c-28 -29 -45 -64 -57 -102c-15 -46 -22 -96 -22 -146'], 0x50: [679,6,576,55,550,'281 640h-56c-7 0 -9 -6 -9 -11c-4 -88 -6 -201 -6 -288c0 -9 7 -12 11 -12c35 0 76 4 109 15c27 8 52 20 71 39c33 33 53 77 53 123c0 36 -12 72 -38 98c-14 14 -33 22 -52 27c-27 7 -55 9 -83 9zM217 22l-83 -28l-7 7c2 140 7 281 7 422c0 59 -1 118 -5 177 c-1 18 -9 36 -27 43c-15 6 -31 9 -47 11v18l7 7h257c36 0 73 -2 108 -10c24 -5 49 -12 68 -28c38 -31 55 -79 55 -127c0 -58 -22 -115 -64 -156c-20 -21 -46 -34 -74 -44c-35 -12 -71 -18 -108 -21c-25 -2 -57 -4 -82 -6c-8 -1 -12 -6 -12 -13c0 -25 6 -151 7 -252'], 0x51: [698,235,828,85,774,'767 -174l7 -20c-39 -16 -104 -41 -155 -41c-49 0 -103 28 -137 61c-37 37 -89 114 -116 158c-69 0 -146 18 -195 73c-57 64 -86 156 -85 248c1 135 28 229 101 304c68 70 163 89 258 89c77 0 155 -18 213 -76c63 -63 83 -173 83 -256c0 -97 -5 -115 -19 -156 c-14 -44 -26 -77 -68 -123c-45 -49 -115 -79 -178 -94l-4 -10c16 -30 42 -79 62 -105c15 -21 58 -67 146 -67c16 0 64 9 87 15zM410 22c74 0 112 21 151 58c65 63 85 168 85 258c0 52 -5 97 -21 147c-14 41 -36 86 -68 117c-38 39 -82 58 -136 58c-57 0 -126 -23 -165 -66 c-29 -32 -44 -66 -57 -105c-15 -50 -20 -103 -20 -155c0 -89 23 -178 85 -242c38 -40 93 -70 146 -70'], 0x52: [679,8,609,54,582,'213 370c0 -6 2 -15 9 -15c13 0 26 0 38 1c46 4 94 15 127 49c31 31 51 73 51 118c0 30 -12 60 -33 81c-14 14 -33 22 -52 27c-27 7 -55 9 -82 9h-40c-8 0 -11 -7 -12 -26c-2 -64 -6 -239 -6 -244zM321 331l-2 -8l263 -296v-9l-99 -26c-93 119 -220 282 -249 311 c-5 5 -14 9 -20 9c0 -96 0 -193 5 -289l-83 -29l-11 9c8 145 9 291 9 436c0 15 -2 115 -3 172c0 14 -10 26 -23 30c-18 5 -53 15 -54 15l1 17l6 6h272c34 0 68 -3 100 -12c24 -7 47 -16 64 -34c25 -25 39 -59 39 -94c0 -48 -4 -62 -19 -96c-32 -70 -113 -103 -196 -112'], 0x53: [702,15,557,45,483,'480 606l-63 -56l-13 3c-7 28 -16 58 -37 79c-23 22 -54 33 -85 33s-61 -15 -82 -37c-21 -21 -29 -51 -29 -81c0 -36 19 -68 44 -93c27 -27 70 -48 109 -65c37 -16 89 -45 107 -64c30 -29 52 -75 52 -116c0 -52 -24 -100 -61 -137c-56 -56 -133 -87 -212 -87 c-47 0 -95 12 -128 46c-16 16 -29 35 -37 56l57 66l17 -1c9 -30 20 -61 42 -83c24 -24 58 -38 91 -38c38 0 77 18 105 45c26 26 38 65 38 102c0 24 -16 56 -35 77c-21 22 -58 47 -86 59c-46 20 -106 48 -132 74c-33 33 -51 78 -51 124c0 47 14 94 47 128 c44 43 104 62 165 62c51 0 104 -7 141 -44c15 -15 26 -33 36 -52'], 0x54: [697,10,492,26,575,'575 689l-2 -48l-8 -7c-168 8 -189 10 -210 10c-6 0 -9 -5 -9 -11c-1 -14 -4 -115 -4 -195c0 -121 6 -300 13 -421l-100 -27l-9 9c8 127 13 254 13 381c0 82 -1 226 -2 256c0 4 -4 6 -9 6c-24 0 -103 -3 -214 -7l-8 7v48l7 7c95 -3 95 -11 272 -11c75 0 174 6 262 10'], 0x55: [694,9,774,34,746,'210 542l-8 -273c0 -35 4 -70 14 -104c8 -26 18 -52 38 -71c32 -32 78 -42 124 -42c62 0 122 27 176 59c0 183 2 366 4 548l88 35l6 -7c-15 -114 -16 -323 -16 -485c0 -50 3 -126 18 -143c7 -9 20 -11 30 -11c20 0 38 6 58 8l4 -17l-5 -7c-51 -16 -122 -37 -153 -37 c-12 0 -30 6 -32 21c-1 16 -1 32 -1 48l-8 6c-70 -45 -150 -79 -233 -79c-28 0 -57 3 -84 11c-21 6 -40 16 -56 31c-26 27 -40 74 -44 94c-7 46 -8 120 -8 181c0 97 4 195 2 293c0 19 -14 34 -32 38c-18 5 -54 14 -56 14l-2 20l8 7h169l7 -6c-2 -14 -8 -115 -8 -132'], 0x56: [698,16,646,23,729,'637 680l86 17l6 -19c-64 -79 -128 -188 -139 -210c-38 -69 -56 -103 -90 -177c-42 -89 -79 -185 -112 -281l-68 -26l-10 7l-143 482c-14 46 -29 92 -48 136c-4 8 -8 16 -14 22c-5 5 -11 9 -18 11c-12 5 -42 10 -63 13l-1 27l7 6l175 10c39 -191 94 -378 165 -560 c2 -4 6 -6 8 -7c3 1 6 1 8 4c3 3 36 80 63 139l55 128l64 146c20 45 44 89 69 132'], 0x57: [690,11,986,13,1060,'979 675l81 14v-21l-115 -188c-46 -77 -164 -306 -228 -464l-60 -27l-12 8c-32 181 -69 360 -109 539c-1 5 -2 12 -7 12c-3 0 -7 -7 -9 -12l-28 -63c-54 -121 -135 -300 -182 -455l-64 -29l-11 5c-23 128 -48 255 -78 381c-20 81 -40 162 -70 239c-5 13 -14 24 -27 28 s-30 10 -45 13l-2 24l8 7l156 3c15 -81 74 -351 113 -526c1 -5 5 -6 7 -6c3 0 6 2 7 4c42 83 174 374 219 500l76 29l7 -6c0 -62 31 -213 62 -359c13 -61 26 -121 36 -174c1 -4 6 -12 13 -12c9 0 11 4 13 7l80 170l109 242c22 46 42 86 60 117'], 0x58: [688,11,666,27,636,'632 672l-187 -206c-30 -35 -63 -79 -67 -86c0 -13 117 -200 156 -249l60 -72c7 -7 29 -21 37 -23l5 -4v-16l-110 -27l-14 6c-18 18 -32 40 -46 62l-143 239h-12c-14 -17 -55 -73 -83 -114c-38 -53 -91 -137 -107 -171l-94 -11v16l271 329c-4 1 -99 163 -145 245 c-11 18 -37 37 -55 44c-14 5 -31 10 -50 15v25l7 6c25 1 101 5 146 8l147 -266h9c5 5 70 90 103 135c32 46 77 117 77 117l95 13v-15'], 0x59: [693,11,555,23,615,'258 299l-149 295c-6 12 -13 24 -23 34c-6 7 -14 13 -23 15c-13 3 -26 6 -40 8v28l7 7h145l141 -325c1 -2 6 -8 12 -8c4 0 8 4 11 9s46 75 59 98c8 14 92 159 128 216l85 17l4 -18c-111 -145 -185 -241 -268 -369l9 -288l-90 -29l-11 9c3 100 3 201 3 301'], 0x5A: [695,12,666,46,640,'595 664c-135 -193 -309 -464 -399 -603l6 -7l429 14l9 -9l-18 -71c-129 12 -383 12 -575 12l-1 21l424 606l-7 10c-187 0 -289 -6 -316 -9l-6 5v54l9 8c148 -9 296 -12 445 -12v-19'], 0x5B: [741,125,277,120,279,'279 712l-119 -13v-782l119 -13v-24c-54 0 -107 0 -159 -5v866c39 -5 105 -5 159 -5v-24'], 0x5C: [722,192,501,39,463,'428 -192l-389 896l5 11l31 7l388 -893l-3 -13'], 0x5D: [741,125,277,-1,158,'118 699l-119 13v24c54 0 120 0 159 5v-866c-52 5 -105 5 -159 5v24l119 13v782'], 0x5E: [735,-452,499,0,495,'251 735l244 -249l-39 -27l-208 214l-225 -221l-23 12'], 0x5F: [-60,100,450,-7,457,'451 -100h-458l7 40h457'], 0x60: [677,-506,201,0,201,'201 532l-17 -26l-144 90c-33 21 -40 29 -40 47c0 19 14 34 31 34c15 0 33 -11 55 -33'], 0x61: [466,12,609,87,596,'433 431l53 31l5 -5c-6 -113 -7 -227 -4 -340c0 -18 1 -36 11 -52c5 -9 16 -13 26 -13c14 0 44 10 65 18l7 -24c-40 -24 -94 -58 -126 -58c-14 0 -30 3 -40 15c-11 13 -14 27 -17 44l-15 4c-28 -18 -54 -33 -84 -45c-25 -10 -51 -18 -79 -18c-37 0 -75 13 -100 42 c-38 45 -48 105 -47 163c0 79 21 159 78 215c43 41 101 58 160 58c32 0 75 -12 107 -35zM411 99v230c0 26 0 52 -16 69c-18 19 -43 33 -68 33c-36 0 -69 -13 -95 -38c-24 -21 -51 -77 -54 -178c0 -42 5 -85 28 -120c21 -33 62 -41 99 -41c17 0 40 7 55 14c21 10 31 16 51 31 '], 0x62: [684,10,588,27,523,'27 661l6 5l169 18l6 -7c-9 -93 -16 -184 -14 -278l9 -5c53 40 111 74 179 74c36 0 72 -13 98 -38c35 -34 45 -85 43 -133c-1 -41 -6 -81 -19 -120c-10 -31 -24 -61 -47 -84c-58 -60 -134 -103 -219 -103c-33 0 -60 9 -84 33c-18 18 -33 46 -33 100v476 c0 16 -6 30 -24 32c-1 0 -50 6 -70 9v21zM198 347c-2 -34 -4 -79 -4 -118c0 -62 4 -139 31 -165c21 -20 40 -26 68 -26c33 0 65 12 91 33c20 16 32 38 40 61c11 30 16 63 16 95c0 73 -16 115 -30 136c-13 20 -37 43 -75 43c-53 0 -98 -25 -137 -59'], 0x63: [475,19,486,49,446,'435 114l11 -18c-62 -61 -135 -115 -224 -115c-44 0 -81 8 -110 32c-21 18 -36 44 -46 69c-17 43 -17 89 -17 135c0 67 20 133 65 183c47 52 120 75 188 75c28 0 55 -6 76 -23c24 -19 37 -46 40 -75l-54 -53l-17 6c-5 37 -16 64 -33 82c-13 14 -34 24 -52 24 c-34 0 -57 -10 -85 -43c-35 -40 -45 -93 -45 -145c0 -61 9 -131 57 -172c23 -21 54 -29 84 -29c59 0 109 31 153 69'], 0x64: [684,19,603,86,597,'314 660l5 4l163 20l8 -9v-565c1 -17 4 -34 11 -47c5 -10 15 -15 27 -15c10 0 41 11 61 19l8 -23c-25 -17 -51 -34 -78 -47c-16 -8 -33 -16 -51 -16c-15 0 -31 5 -40 18c-11 16 -18 35 -19 55c-31 -21 -63 -40 -98 -54c-24 -10 -50 -18 -76 -18c-35 0 -71 11 -96 37 c-41 43 -53 103 -53 161c0 80 20 160 76 218c42 44 101 64 161 64c29 0 56 -6 83 -15l7 4c0 53 0 125 -7 151c-4 13 -14 25 -28 29c-20 5 -42 7 -63 7zM409 95l4 215c0 35 -4 73 -30 99c-16 16 -41 19 -64 19c-33 0 -64 -14 -87 -38c-47 -48 -59 -120 -59 -187 c0 -45 9 -93 42 -126c20 -20 49 -29 76 -29c35 0 91 20 118 47'], 0x65: [478,12,499,69,463,'198 396c-39 -42 -46 -87 -46 -136c0 -6 1 -12 2 -18l4 -4l202 80c6 2 13 10 13 26c0 3 0 7 -1 10c-6 25 -22 58 -46 74c-12 7 -25 10 -44 10c-33 0 -63 -16 -84 -42zM438 319l-282 -122c3 -33 17 -84 47 -112c22 -21 52 -29 82 -29c29 0 56 9 82 22c25 13 49 28 72 46 l11 -2l13 -18c-33 -31 -69 -59 -109 -81c-36 -21 -77 -35 -119 -35c-35 0 -70 8 -98 30c-20 16 -33 39 -42 62c-19 46 -26 97 -26 146c0 58 12 117 51 162c49 57 121 90 197 90c33 0 66 -7 92 -28c33 -27 50 -68 50 -110c0 -4 0 -7 -1 -8c-3 -5 -13 -10 -20 -13'], 0x66: [669,12,419,36,422,'47 434h105l6 6c0 35 3 86 18 122c15 34 27 50 54 73c31 25 64 34 99 34c54 0 80 -27 93 -54l-58 -54l-12 4c-2 10 -5 26 -10 34c-6 11 -22 30 -48 30c-13 0 -24 -9 -34 -25c-19 -29 -26 -100 -26 -164l4 -6h124l5 -7l-7 -22l-7 -6h-115l-6 -6v-111c0 -94 3 -189 10 -270 l-79 -24l-17 11c8 99 12 193 13 284v108l-6 8h-112l-5 7l4 22'], 0x67: [465,233,568,83,494,'399 52c-33 -19 -60 -33 -95 -48c-22 -10 -52 -15 -76 -15c-30 0 -64 13 -88 36c-36 34 -57 91 -57 159c0 58 9 92 21 128c12 32 29 65 53 89c41 41 97 64 155 64c41 0 84 -9 117 -34l51 29l14 -6c-5 -91 -9 -163 -9 -372c0 -38 -1 -110 -22 -168 c-15 -44 -53 -78 -73 -93c-51 -39 -101 -54 -162 -54c-44 0 -89 10 -138 56l49 62h14c18 -36 64 -77 100 -77c38 0 76 17 101 47c18 20 29 46 36 72c9 31 17 81 18 118zM408 99v264c-1 14 -9 31 -18 42c-18 19 -44 26 -71 26c-34 0 -66 -17 -91 -41c-22 -21 -37 -49 -45 -77 c-12 -38 -14 -71 -14 -110c0 -27 16 -79 29 -98c23 -33 57 -53 85 -53c46 0 102 29 125 47'], 0x68: [681,10,621,27,637,'624 107l13 -10v-11c-28 -30 -51 -53 -84 -72c-23 -14 -45 -24 -73 -24c-19 0 -38 10 -48 26c-12 20 -18 46 -18 73c0 54 4 141 4 177c0 24 -1 47 -5 72c-3 17 -11 36 -25 48c-17 12 -34 18 -56 18s-50 -8 -70 -16c-28 -14 -47 -26 -72 -44c0 -110 -2 -220 -2 -328 l-72 -22l-6 10c7 132 13 264 14 396c0 52 0 125 -3 156c-2 20 -4 42 -17 60c-8 12 -50 20 -77 26v18l5 4l158 17l6 -7c-4 -85 -4 -184 -4 -276l8 -8c36 22 73 42 113 58c28 10 55 18 88 18c15 0 47 -10 65 -28c13 -12 19 -30 21 -48c3 -28 3 -88 3 -130 c0 -44 -1 -108 1 -132c1 -16 3 -34 13 -50c7 -10 18 -16 30 -16c16 0 32 5 46 12c19 11 32 22 44 33'], 0x69: [683,8,360,14,357,'216 392l-8 -210c0 -41 4 -77 12 -95c6 -13 18 -22 32 -22s30 3 42 9c18 10 34 22 50 36l13 -10v-11c-20 -27 -42 -50 -69 -70c-22 -14 -46 -27 -72 -27c-24 0 -47 7 -64 28c-14 18 -16 40 -16 84l6 221c0 30 -4 56 -11 70c-5 10 -14 15 -24 15c-22 0 -56 -17 -80 -32 l-13 18c24 19 57 42 81 54c18 9 40 21 59 21c14 0 34 -2 46 -18c14 -16 16 -40 16 -61zM230 625c-2 -33 -28 -56 -60 -56s-58 26 -58 58c2 34 34 56 64 56c34 0 54 -28 54 -58'], 0x6A: [683,231,331,-1,226,'27 375l-13 18c27 21 54 40 84 56c18 9 37 19 57 19c15 0 31 -3 41 -13c15 -14 18 -34 20 -54c7 -43 7 -210 7 -247c0 -20 0 -160 -12 -195c-13 -38 -36 -71 -63 -100c-33 -35 -87 -68 -133 -90l-16 16c74 44 114 89 128 139c17 62 20 186 20 230c0 98 0 164 -3 201 c-2 20 -9 35 -13 39c-11 14 -17 14 -28 14c-16 0 -51 -20 -76 -33zM168 683c30 0 58 -22 58 -54c0 -34 -26 -64 -61 -64c-33 0 -56 28 -56 60s27 58 59 58'], 0x6B: [686,7,555,27,565,'202 266l134 123c27 24 77 70 80 73c11 9 21 17 33 23l46 -29v-11c-75 -44 -146 -95 -213 -151c-7 -6 -18 -15 -18 -20c0 -6 5 -11 8 -16c47 -60 100 -112 146 -159c14 -14 38 -26 50 -26c33 0 56 16 78 39l19 -20c-27 -36 -51 -62 -97 -92c-6 -4 -20 -7 -30 -7 c-9 0 -27 3 -34 8c-11 6 -28 22 -45 41c0 0 -89 120 -160 199l-10 -7l-2 -221l-71 -20l-6 7c3 120 7 240 10 359c2 79 5 189 -7 235c-4 15 -15 28 -30 34c-10 3 -37 8 -56 10v21l5 4l160 23l6 -7l-9 -413h13'], 0x6C: [686,11,365,41,360,'338 112h11l11 -12c-19 -31 -42 -59 -71 -81c-24 -17 -52 -29 -81 -30c-19 0 -39 6 -52 19c-23 25 -30 44 -30 122l7 378c0 33 0 76 -5 100c-3 13 -14 22 -27 24c-19 4 -40 5 -60 6v23l6 5l165 20l6 -7c-4 -140 -14 -280 -14 -420c0 -42 0 -102 2 -127 c2 -17 4 -34 13 -49c8 -12 19 -17 33 -18c14 0 29 5 40 12c16 10 31 22 46 35'], 0x6D: [471,18,915,29,922,'422 -4c0 32 10 159 10 273c0 24 0 51 -5 70c-4 16 -11 31 -23 43c-14 14 -34 18 -54 18c-47 0 -108 -38 -117 -44c-5 -113 -7 -229 -3 -342l-67 -24l-14 8c1 92 7 184 7 275c0 44 -2 110 -13 126c-7 10 -16 13 -27 13c-16 0 -52 -16 -75 -29l-12 19c24 19 49 37 76 51 c19 9 40 17 61 18c17 0 34 -6 46 -17c16 -15 16 -37 16 -57l8 -6c33 18 66 37 102 52c22 9 46 16 70 16c37 0 71 -20 90 -52l16 -2c25 13 50 27 85 39c24 9 49 16 75 16c29 0 59 -6 79 -27c14 -14 16 -34 18 -53c2 -20 2 -88 2 -132v-131c0 -13 2 -38 14 -51 c9 -10 24 -14 37 -14c22 1 52 22 77 40h14l7 -21c-26 -25 -53 -48 -84 -65c-24 -13 -49 -23 -76 -24c-16 0 -35 5 -46 17c-15 16 -22 39 -22 60c0 16 5 136 5 210c0 24 0 47 -6 70c-4 17 -12 31 -24 43c-15 14 -35 18 -55 18c-49 0 -84 -18 -112 -34c-3 -115 -3 -233 4 -348 l-74 -28'], 0x6E: [471,10,664,5,656,'210 18l-70 -24l-15 7c2 43 8 170 9 256c1 46 2 112 -10 136c-5 11 -14 20 -27 20c-21 0 -46 -16 -75 -35l-17 22c42 30 99 72 136 71c18 0 37 -4 50 -17c16 -15 18 -32 21 -51l8 -6c34 21 67 39 105 53c27 11 55 19 84 19s59 -7 77 -29c20 -23 20 -120 20 -184 c0 -54 0 -126 1 -145c2 -34 24 -51 47 -51s55 21 80 40h13l9 -21c-29 -28 -56 -49 -89 -68c-20 -11 -55 -21 -68 -21c-26 0 -46 8 -58 27c-12 17 -14 40 -14 61l5 171c0 29 -2 59 -7 87c-3 18 -9 35 -20 48c-17 18 -38 26 -63 26c-20 0 -40 -7 -58 -15 c-26 -12 -49 -28 -71 -46c-2 -47 -5 -99 -5 -151c0 -60 -2 -99 2 -180'], 0x6F: [465,14,563,56,497,'150 316c-6 -25 -8 -51 -8 -77c0 -66 12 -141 63 -186c19 -17 45 -26 72 -26c34 0 65 12 88 37c19 21 29 48 35 75s8 54 8 81c0 64 -8 136 -58 180c-20 19 -47 26 -74 26c-30 0 -68 -14 -94 -42c-18 -19 -26 -43 -32 -68zM250 -14c-44 0 -92 10 -125 40 c-48 43 -65 107 -69 170c0 69 7 143 55 195c47 52 118 74 188 74c47 0 94 -9 130 -41c51 -47 68 -118 68 -185c0 -65 -14 -131 -58 -180c-47 -53 -119 -73 -189 -73'], 0x70: [470,237,589,-12,518,'199 -206l-81 -31l-10 11c5 58 6 263 6 320v221c0 22 -5 66 -14 80c-6 10 -13 17 -25 17c-21 0 -49 -15 -73 -29l-14 19c24 19 50 37 77 50c19 10 38 18 59 18c16 0 32 -3 44 -15c15 -14 19 -36 21 -60l8 -4c33 26 55 39 91 55c30 13 61 19 93 19c31 0 71 -15 93 -37 c36 -40 44 -78 44 -130c0 -44 -9 -96 -25 -135c-13 -31 -37 -71 -57 -89c-28 -25 -59 -47 -93 -63c-27 -13 -55 -22 -85 -22c-20 0 -40 3 -59 8l-10 -8c1 -46 4 -143 10 -195zM191 66c24 -22 55 -37 88 -37c36 0 71 10 98 36c21 20 34 47 43 75c12 35 14 62 14 99 c0 26 -6 61 -14 86c-5 18 -13 33 -26 48c-18 21 -42 30 -63 30c-51 0 -92 -21 -139 -58c0 -6 -3 -82 -3 -93c0 -82 2 -185 2 -186'], 0x71: [504,243,605,88,502,'419 -243l-16 16c3 41 5 185 8 281l-7 5c-51 -38 -109 -66 -172 -66c-32 0 -63 12 -86 33c-44 43 -58 106 -57 166c2 87 25 172 92 230c42 37 100 49 148 49c31 0 71 -14 99 -28l9 2l44 59l21 -4c-18 -223 -19 -528 -2 -714zM411 105v226c0 25 0 55 -16 71 c-18 18 -41 32 -67 32c-33 0 -64 -12 -89 -33c-46 -37 -58 -118 -58 -188c0 -26 4 -52 11 -77c4 -18 13 -32 24 -46c19 -23 49 -35 79 -35c39 0 83 21 116 50'], 0x72: [473,3,432,9,415,'361 339l-12 5c-3 16 -8 32 -19 44c-9 9 -21 14 -34 14c-41 0 -65 -35 -77 -62c-5 -12 -5 -32 -6 -46c-1 -93 -2 -184 2 -276l-70 -21l-15 9c7 70 11 157 12 237c0 53 0 129 -16 154c-6 10 -16 15 -27 15c-23 0 -53 -17 -78 -31l-12 17c25 20 52 40 80 56 c18 9 36 19 55 19c18 0 36 -4 49 -17c14 -14 20 -35 23 -55l10 -4c19 18 40 36 63 51c14 9 29 19 47 19c19 0 42 -4 56 -18s21 -39 23 -61'], 0x73: [466,17,455,52,387,'376 383l-55 -37l-12 7c-1 18 -3 37 -13 53c-11 18 -32 25 -52 25c-22 0 -44 -8 -59 -23c-16 -15 -23 -36 -23 -58s11 -34 26 -50c12 -12 55 -34 84 -46c32 -14 69 -36 83 -50c18 -18 32 -41 32 -66c0 -35 -12 -69 -36 -94c-39 -42 -95 -61 -152 -61c-38 0 -78 7 -107 33 c-16 14 -30 31 -40 50l49 71l14 -1c2 -30 12 -60 35 -81c22 -21 49 -34 79 -34c22 0 49 12 64 28c12 13 21 30 21 48c0 21 -11 41 -26 56c-19 19 -47 31 -73 42c-31 13 -61 27 -84 47c-23 21 -41 49 -41 81c0 35 14 70 41 94c36 33 83 49 132 49c30 0 62 -4 85 -25 c16 -15 27 -36 28 -58'], 0x74: [611,9,416,17,399,'138 582l84 29l7 -5c-5 -57 -10 -108 -11 -166l6 -5h128l5 -4l-8 -26l-6 -5h-119l-6 -6v-189c0 -42 4 -106 26 -130c13 -15 28 -20 45 -20c25 0 61 22 91 41l12 -2l7 -15c-27 -25 -56 -48 -88 -65c-24 -13 -49 -23 -76 -23c-23 0 -54 7 -72 31c-21 27 -23 46 -23 181v190 l-6 7h-112l-5 5l7 24l6 6h104l6 6c0 51 0 115 -2 141'], 0x75: [470,10,642,-1,655,'644 105l11 -19c-30 -26 -61 -50 -94 -70c-21 -12 -43 -24 -67 -24c-18 0 -37 5 -50 18c-14 14 -17 35 -19 54l-8 1c-37 -22 -75 -41 -115 -58c-23 -10 -48 -17 -73 -17c-28 0 -61 7 -80 29c-20 23 -25 72 -25 93c0 33 4 134 4 163c0 91 -4 107 -17 121c-6 7 -16 9 -28 9 c-14 0 -48 -17 -71 -30l-13 20c26 20 53 39 82 55c17 9 35 18 54 18c16 0 34 -3 46 -15c14 -14 16 -34 18 -54s2 -103 2 -155c0 -59 0 -143 27 -170c16 -16 40 -23 63 -23c21 0 41 7 59 15c26 12 47 23 72 38c1 108 3 277 0 331l77 35l13 -11c-8 -93 -12 -186 -12 -278 c0 -36 0 -86 16 -102c9 -9 21 -14 33 -14c13 0 26 6 37 12c18 8 33 18 50 30'], 0x76: [469,11,495,-21,466,'412 460c3 2 6 2 8 2c3 0 7 0 9 -3c18 -14 37 -43 37 -97c0 -55 -27 -104 -55 -150c-45 -72 -100 -135 -159 -195c-11 -11 -25 -25 -30 -28h-24l-69 258c-13 51 -38 122 -51 144c-6 10 -15 17 -27 17c-22 0 -40 -8 -63 -21l-9 24c23 16 47 31 73 43c17 8 34 15 52 15 c15 0 29 -7 39 -17c17 -17 38 -99 54 -159c14 -58 39 -154 55 -201c3 -9 10 -10 13 -10c5 0 16 14 24 22c30 35 58 73 79 114c16 30 28 61 28 94c0 32 -20 68 -37 100c-1 1 -1 3 -1 5c0 3 2 6 4 8'], 0x77: [469,8,812,-13,782,'675 416c-1 2 -1 4 -1 6c0 3 0 6 2 7l57 35c1 1 3 1 6 1s6 0 8 -3c21 -27 35 -58 35 -93c0 -55 -27 -106 -56 -153c-44 -74 -100 -140 -158 -203c-10 -10 -21 -21 -35 -21c-11 0 -23 12 -26 21c-17 48 -62 223 -91 337c-2 4 -4 10 -9 10c-4 0 -10 -2 -11 -5 c-56 -103 -124 -231 -179 -350l-42 -13l-7 6l-24 224c-14 126 -35 171 -48 183c-6 5 -9 7 -17 7c-23 0 -56 -17 -83 -31l-9 20c26 19 52 36 81 51c17 9 34 17 53 17c18 0 34 -6 46 -19c20 -22 27 -49 32 -77c15 -80 19 -162 29 -243l11 -2c57 103 114 207 166 313l52 26 l12 -3c26 -126 53 -250 97 -368c3 -7 10 -15 18 -15c4 0 12 6 15 10c32 40 64 81 88 127c15 29 26 61 26 94c0 15 -5 30 -10 44c-7 21 -17 41 -28 60'], 0x78: [464,12,526,2,512,'422 462l31 -29c1 -1 3 -3 3 -4c0 -3 -1 -4 -3 -5c-56 -39 -120 -104 -172 -165c26 -57 76 -151 107 -178c10 -9 22 -18 37 -18c12 0 23 6 33 11c14 8 25 16 38 27h8l8 -19c-23 -25 -47 -50 -75 -70c-16 -12 -33 -24 -53 -24c-17 0 -31 9 -43 21c-16 14 -27 33 -38 52 c-15 25 -48 87 -70 130h-7c-39 -60 -79 -122 -109 -199l-16 -4l-28 25v8c43 69 93 138 142 202c-29 59 -66 134 -100 169c-9 9 -22 15 -35 15c-21 0 -46 -13 -64 -25l-14 18c23 18 47 34 72 48c15 8 30 16 46 16c17 0 41 -4 54 -19c21 -23 62 -95 91 -151l6 -1 c36 48 95 118 139 169c1 2 3 2 6 2c2 0 4 0 6 -2'], 0x79: [468,233,593,-17,491,'97 -182l-2 11l44 56h13c21 -38 59 -77 104 -77c37 0 76 14 98 42c28 35 38 87 43 116c6 33 7 66 8 98l-6 5c-34 -21 -69 -41 -106 -57c-26 -10 -53 -20 -82 -20c-25 0 -49 6 -67 24c-35 29 -37 101 -37 141c0 20 1 41 2 61c2 62 6 152 -13 178c-7 10 -19 14 -31 14 c-17 0 -48 -16 -71 -28l-11 19c8 6 49 34 85 51c17 8 35 16 54 16c15 0 32 -4 42 -14c14 -14 21 -35 21 -56c0 -56 -4 -114 -4 -172c3 -93 12 -123 28 -144c15 -19 39 -26 63 -26c21 0 42 4 62 14c26 10 52 26 72 38c4 106 2 216 -6 320l79 38l12 -4c-6 -86 -6 -174 -6 -260 c0 -124 2 -177 -15 -251c-12 -43 -35 -83 -59 -109c-48 -51 -119 -75 -187 -75c-47 0 -100 23 -127 51'], 0x7A: [462,27,470,12,479,'408 462h6l14 -13c-83 -88 -191 -221 -290 -355l5 -8c98 -10 196 -13 205 -13c24 0 51 10 64 23c17 17 32 35 45 55l22 -12l-41 -80c-10 -21 -22 -41 -42 -53c-16 -10 -36 -14 -55 -14c-11 0 -86 8 -129 13l-117 11c-24 0 -46 -20 -62 -43h-6l-15 19l295 381 c-10 -2 -19 -2 -30 -2c-16 0 -44 6 -66 11c-18 4 -38 8 -54 8s-32 -7 -44 -17s-31 -35 -45 -54l-20 13l50 89c7 11 15 25 24 31c11 8 25 10 38 10c24 0 58 -9 87 -16s61 -15 88 -15c29 0 52 14 73 31'], 0x7B: [730,178,320,-3,292,'292 -154v-24c-39 0 -92 0 -116 6c-15 4 -28 12 -38 23c-19 21 -23 50 -26 77c-3 24 -3 70 -3 106c0 69 0 174 -25 202c-8 9 -20 15 -33 18c-17 5 -36 5 -54 5v26c39 0 63 1 85 20c16 14 19 37 22 58c4 35 4 100 4 151c0 35 0 96 1 106c3 28 8 56 25 78c9 11 21 20 35 25 c21 7 82 7 123 7v-24c-29 0 -60 0 -87 -8c-12 -3 -19 -9 -25 -20c-8 -12 -12 -27 -15 -42c-6 -39 -6 -78 -6 -118c0 -41 -1 -82 -7 -123c-3 -23 -7 -50 -19 -70c-17 -26 -42 -45 -59 -51v-1c20 -7 38 -18 52 -38c17 -23 24 -49 27 -76c5 -43 6 -86 6 -129 c0 -40 2 -80 8 -119c3 -14 7 -27 15 -39c7 -11 18 -17 30 -20c24 -6 53 -6 80 -6'], 0x7C: [738,167,213,86,126,'126 -159l-40 -8v897l40 8v-897'], 0x7D: [733,175,320,23,318,'23 -175v24c27 0 57 1 80 6c12 3 23 9 30 20c8 12 12 25 15 39c6 39 8 79 8 119c0 43 1 86 6 129c3 27 10 53 27 76c14 20 32 31 52 38v1c-17 6 -42 25 -59 51c-12 20 -16 47 -19 70c-6 41 -7 82 -7 123c0 40 0 79 -6 118c-3 15 -7 30 -15 42c-6 11 -13 17 -25 20 c-28 7 -58 8 -87 8v24c41 0 102 0 123 -7c14 -5 26 -14 35 -25c17 -22 22 -50 25 -78c1 -10 1 -71 1 -106c0 -51 0 -116 4 -151c3 -21 6 -44 22 -58c22 -19 46 -20 85 -20v-26c-18 0 -37 0 -54 -5c-13 -3 -25 -9 -33 -18c-25 -28 -25 -133 -25 -202c0 -36 0 -82 -3 -106 c-3 -27 -7 -56 -26 -77c-10 -11 -23 -19 -38 -23c-24 -6 -77 -6 -116 -6'], 0x7E: [347,-178,551,22,530,'281 291l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18c-12 -11 -28 -37 -40 -59l-22 12c12 24 27 49 42 66 c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42'], 0xA0: [0,0,333,0,0,''], 0xA7: [701,107,515,56,451,'385 166l3 4c13 18 18 40 18 62c0 29 -16 53 -36 73c-21 22 -62 40 -96 56c-47 22 -121 55 -140 81c-14 -18 -24 -45 -24 -69c0 -23 10 -45 26 -61c28 -28 70 -48 108 -66c50 -23 115 -53 141 -80zM56 23l70 27l8 -5c1 -33 10 -66 33 -90c21 -21 56 -36 85 -36 c33 0 55 17 78 40c21 21 27 60 27 89c0 25 -12 47 -30 65c-20 20 -73 44 -112 63c-38 17 -82 38 -107 63c-26 26 -37 63 -37 99c0 46 22 88 48 126c-6 20 -10 40 -10 61c0 47 15 95 49 129c32 31 76 47 121 47c18 0 37 -2 55 -6c13 -4 26 -9 36 -19c15 -14 27 -33 27 -54 c0 -7 -4 -25 -6 -37l-59 -21l-15 11c0 15 -1 31 -5 46c-3 10 -7 21 -14 29c-13 13 -31 21 -49 21c-23 0 -39 -8 -58 -28c-19 -21 -25 -54 -25 -82c0 -25 8 -49 26 -67c5 -6 12 -10 19 -14c29 -17 60 -32 90 -49c38 -22 82 -34 113 -65c22 -22 37 -50 37 -81 c0 -51 -19 -99 -52 -136c13 -21 18 -48 18 -74c0 -48 -18 -94 -52 -128s-80 -54 -128 -54c-52 0 -106 10 -143 47c-22 22 -35 52 -38 83'], 0xA8: [642,-542,299,0,299,'299 592c0 -30 -20 -50 -50 -50s-50 20 -50 50s20 50 51 50c29 0 49 -21 49 -50zM100 592c0 -30 -20 -50 -50 -50s-50 20 -50 50s20 50 51 50c29 0 49 -21 49 -50'], 0xAC: [401,-205,773,30,709,'709 401v-196h-50v146h-629v50h679'], 0xAF: [619,-566,312,0,312,'312 566h-312v53h312v-53'], 0xB1: [586,74,755,46,710,'396 276h313l-5 -40h-308v-270h314l-6 -40h-658l7 40h303v270h-310l7 40h303v304l40 6v-310'], 0xB4: [677,-506,201,0,201,'0 532l17 -26l144 90c33 21 40 29 40 47c0 19 -14 34 -31 34c-15 0 -33 -11 -55 -33'], 0xB5: [466,199,617,96,635,'485 466l8 -11c-3 -41 -6 -92 -6 -123v-167c0 -18 2 -36 6 -54c4 -12 8 -25 18 -34c7 -7 18 -11 28 -11c23 0 53 18 77 33l11 -2l8 -14c-25 -23 -52 -46 -83 -62c-21 -12 -44 -22 -69 -22c-17 0 -36 1 -48 13c-13 13 -18 37 -21 56l-8 5c-58 -33 -134 -76 -183 -76 c-32 0 -45 10 -62 30l-6 -2c0 -66 6 -141 19 -204l-53 -20l-12 6c2 92 4 184 4 276v189c0 55 -13 140 -17 164l83 26l9 -7v-269c0 -41 5 -84 35 -114c15 -15 38 -15 58 -15c21 0 59 11 87 29c16 11 26 18 41 34c1 48 3 121 3 142c0 58 -2 115 -4 172'], 0xB7: [379,-245,277,72,206,'72 312c0 37 30 67 66 67c38 0 68 -30 68 -67s-30 -67 -68 -67c-36 0 -66 30 -66 67'], 0xD7: [505,-7,755,133,623,'376 283l222 222l25 -32l-218 -218l214 -214l-23 -34l-220 220l-219 -220l-23 34l214 214l-215 215l24 32'], 0xF7: [537,36,777,56,720,'714 229h-658l7 40h657zM322 31c0 37 30 67 66 67c38 0 68 -30 68 -67s-30 -67 -68 -67c-36 0 -66 30 -66 67zM322 470c0 37 30 67 66 67c38 0 68 -30 68 -67s-30 -67 -68 -67c-36 0 -66 30 -66 67'], 0x131: [471,8,333,-2,341,'200 392l-8 -210c0 -41 4 -77 12 -95c6 -13 18 -22 32 -22s30 3 42 9c18 10 34 22 50 36l13 -10v-11c-20 -27 -42 -50 -69 -70c-22 -14 -46 -27 -72 -27c-24 0 -47 7 -64 28c-14 18 -16 40 -16 84l6 221c0 30 -4 56 -11 70c-5 10 -14 15 -24 15c-22 0 -56 -17 -80 -32 l-13 18c24 19 57 42 81 54c18 9 40 21 59 21c14 0 34 -2 46 -18c14 -16 16 -40 16 -61'], 0x237: [468,231,331,-1,223,'27 375l-13 18c27 21 54 40 84 56c18 9 37 19 57 19c15 0 31 -3 41 -13c15 -14 18 -34 20 -54c7 -43 7 -210 7 -247c0 -20 0 -160 -12 -195c-13 -38 -36 -71 -63 -100c-33 -35 -87 -68 -133 -90l-16 16c74 44 114 89 128 139c17 62 20 186 20 230c0 98 0 164 -3 201 c-2 20 -9 35 -13 39c-11 14 -17 14 -28 14c-16 0 -51 -20 -76 -33'], 0x2C6: [735,-452,499,0,495,'251 735l244 -249l-39 -27l-208 214l-225 -221l-23 12'], 0x2C7: [735,-452,495,0,495,'251 452l244 249l-39 27l-208 -214l-225 221l-23 -12'], 0x2D8: [671,-513,282,0,282,'282 671c-6 -134 -91 -158 -141 -158c-53 0 -135 25 -141 158h30c3 -57 49 -98 111 -98s108 41 111 98h30'], 0x2D9: [642,-542,100,0,100,'100 592c0 -30 -20 -50 -50 -50s-50 20 -50 50s20 50 51 50c29 0 49 -21 49 -50'], 0x2DA: [692,-492,200,0,200,'200 592c0 -56 -45 -100 -100 -100c-56 0 -100 44 -100 101c0 55 45 99 102 99c53 0 98 -45 98 -100zM162 592c0 38 -25 64 -61 64c-38 0 -63 -25 -63 -63c0 -40 24 -65 62 -65c37 0 62 26 62 64'], 0x2DC: [640,-540,321,0,322,'101 640c53 -3 99 -45 136 -45c28 0 40 14 61 45l24 -13c-21 -43 -49 -87 -106 -87c-55 0 -102 45 -139 45c-24 0 -39 -20 -53 -45l-24 14c32 66 63 88 101 86'], 0x300: [677,-506,0,-385,-184,'-184 532l-17 -26l-144 90c-33 21 -40 29 -40 47c0 19 14 34 31 34c15 0 33 -11 55 -33'], 0x301: [677,-506,0,-315,-114,'-315 532l17 -26l144 90c33 21 40 29 40 47c0 19 -14 34 -31 34c-15 0 -33 -11 -55 -33'], 0x302: [735,-452,499,0,495,'251 735l244 -249l-39 -27l-208 214l-225 -221l-23 12'], 0x303: [640,-540,0,-409,-88,'-308 640c53 -3 99 -45 136 -45c28 0 40 14 60 45l24 -13c-20 -43 -48 -87 -105 -87c-55 0 -101 45 -139 45c-24 0 -38 -20 -53 -45l-24 14c32 66 63 88 101 86'], 0x304: [619,-566,0,-405,-93,'-93 566h-312v53h312v-53'], 0x306: [671,-513,0,-390,-108,'-108 671c-6 -134 -91 -158 -141 -158c-53 0 -135 25 -141 158h30c3 -57 49 -98 111 -98s108 41 111 98h30'], 0x307: [642,-542,0,-300,-200,'-200 592c0 -30 -20 -50 -50 -50s-50 20 -50 50s20 50 51 50c29 0 49 -21 49 -50'], 0x308: [642,-542,0,-399,-100,'-100 592c0 -30 -20 -50 -50 -50s-50 20 -50 50s20 50 51 50c29 0 49 -21 49 -50zM-299 592c0 -30 -20 -50 -50 -50s-50 20 -50 50s20 50 51 50c29 0 49 -21 49 -50'], 0x30A: [692,-492,0,-349,-149,'-149 592c0 -56 -45 -100 -100 -100c-56 0 -100 44 -100 101c0 55 45 99 102 99c53 0 98 -45 98 -100zM-187 592c0 38 -25 64 -61 64c-38 0 -63 -25 -63 -63c0 -40 24 -65 62 -65c37 0 62 26 62 64'], 0x30B: [683,-502,0,-346,-3,'-327 502l-19 25l107 123c17 20 39 33 55 33c17 0 31 -15 31 -33c0 -16 -10 -29 -39 -50zM-177 502l-19 25l107 123c17 20 39 33 55 33c17 0 31 -15 31 -33c0 -16 -10 -29 -39 -50'], 0x30C: [735,-452,499,0,495,'251 452l244 249l-39 27l-208 -214l-225 221l-23 -12'], 0x338: [720,192,0,39,463,'458 715l5 -11l-389 -896l-32 8l-3 14l386 888l11 2'], 0x391: [680,10,770,25,743,'536 76l-54 188c-2 4 -8 9 -11 9h-225c-4 0 -8 -4 -10 -8l-117 -248l-91 -19l-3 10c119 200 234 404 339 612c1 3 1 4 1 7s-3 9 -12 11l-90 15v27h194c15 -83 60 -243 93 -363c22 -81 49 -178 85 -238c9 -15 24 -24 41 -28c7 -1 15 -2 23 -2c14 0 29 2 43 3l1 -26 l-104 -30c-15 -4 -30 -6 -45 -6c-11 0 -20 5 -27 13c-14 13 -24 47 -31 73zM382 572l-116 -244c-1 -2 -1 -8 -1 -9c0 -3 4 -7 7 -7h188c5 0 7 4 7 7c0 0 -2 8 -2 9l-70 244c-1 2 -4 4 -7 4s-6 -3 -6 -4'], 0x392: [686,1,655,50,574,'215 324v-258c0 -13 5 -17 11 -21s32 -6 64 -6c54 0 110 12 149 50c31 32 44 75 44 119c0 33 -8 68 -33 93c-18 18 -42 27 -67 34c-34 9 -70 11 -106 11c-18 0 -47 0 -52 -1c-4 0 -8 -3 -10 -7v-14zM215 411v-20c1 -4 5 -7 8 -8c8 -3 31 -2 46 -2c51 0 101 15 137 50 c30 30 43 72 43 114c0 29 -14 55 -34 75c-12 12 -30 17 -47 21c-26 6 -53 7 -80 7c-20 0 -40 -2 -60 -5c-7 -1 -11 -7 -13 -14v-218zM381 378l-1 -8c31 -4 67 -12 97 -21c20 -6 42 -19 57 -34c31 -31 40 -71 40 -114c0 -50 -18 -98 -53 -133c-55 -56 -136 -69 -212 -69 c-66 1 -197 2 -198 2l-1 10c6 9 18 25 18 26c2 3 3 6 4 10c0 1 1 23 1 34v530c0 17 -15 27 -17 28c-17 8 -41 16 -66 23l1 17l7 7h247c41 0 81 -2 121 -12c27 -7 54 -16 74 -36c22 -23 34 -53 34 -85c0 -41 -14 -81 -43 -110c-30 -31 -70 -48 -110 -65'], 0x393: [697,7,428,74,507,'496 697l11 -145h-27l-19 52c-9 24 -34 36 -58 40c-57 10 -116 9 -174 6c-13 -1 -22 -8 -27 -19c-8 -16 -9 -65 -9 -82c0 -177 0 -355 3 -533l-77 -23l-10 11c3 183 7 457 7 549c0 20 0 41 -2 62c-1 13 -4 27 -14 36l-26 22l3 20h237c61 0 122 1 182 4'], 0x394: [696,4,713,30,689,'363 671l58 25c44 -132 91 -257 143 -385c37 -90 81 -182 125 -267l-1 -16l-61 -32c-198 13 -397 21 -595 7l-2 42zM562 50l6 9c-41 94 -201 494 -201 495h-11c-95 -164 -175 -321 -255 -490l3 -12c152 3 306 -2 458 -2'], 0x395: [688,0,604,46,559,'456 336c-39 3 -79 6 -118 6c-38 0 -101 -2 -119 -3c-7 -1 -10 -5 -10 -12v-139c0 -38 1 -87 15 -112c6 -12 18 -20 30 -26c12 -5 38 -6 66 -6c47 0 70 0 234 14l5 -5l-13 -53h-388c-9 5 -15 15 -20 25c-5 12 -6 27 -6 41v492c0 14 0 44 -9 64c-2 6 -10 11 -17 16 c-8 6 -38 13 -59 16l-1 20l7 7l148 1c70 0 171 6 242 6c18 0 33 0 46 -1l-2 -50l-4 -7c-69 4 -202 10 -209 10h-40c-5 -1 -10 -4 -13 -9c-8 -12 -11 -44 -11 -67v-166c0 -7 3 -11 10 -12c39 -3 159 -1 236 5l6 -7'], 0x396: [694,12,666,46,640,'595 664c-135 -193 -309 -464 -399 -603l6 -7l429 14l9 -9l-18 -71c-129 12 -383 12 -575 12l-1 21l424 606l-7 10c-187 0 -309 -5 -336 -9l-6 6v52l9 8c148 -7 316 -11 465 -11v-19'], 0x397: [690,2,783,52,744,'744 14l-6 -6l-149 -8l-11 21c2 97 5 216 5 313c0 5 -3 12 -12 12h-343c-7 0 -13 -5 -13 -12c0 -67 -1 -163 0 -230c0 -26 2 -52 5 -78l-92 -28l-6 5c10 113 10 242 10 364c0 83 -1 166 -6 249c-1 9 -3 20 -13 24c-4 1 -40 12 -60 19l-1 19l7 7h162l5 -5 c-4 -22 -6 -46 -7 -69c-2 -65 -6 -149 -6 -214c0 -5 2 -12 12 -12h346c11 0 12 6 12 12c0 86 -3 190 -3 276l88 17l5 -6c-3 -39 -7 -80 -8 -119c-4 -162 -5 -324 1 -486c0 -17 13 -30 29 -34c18 -5 47 -13 48 -13'], 0x398: [701,12,757,38,714,'208 350l-1 44c13 -4 35 -6 42 -7c44 -2 104 -3 152 -3c35 0 73 0 105 2c11 1 23 2 43 7v-41v-38c-15 5 -37 8 -48 8c-35 1 -69 4 -104 4c-40 0 -91 -2 -137 -4c-10 0 -26 -1 -52 -6v34zM336 -12c-73 0 -150 17 -203 71c-69 72 -95 173 -95 272c0 96 3 138 44 212 c57 100 191 158 339 158c77 0 157 -20 213 -77c61 -64 80 -155 80 -243c0 -58 -7 -116 -24 -170c-15 -46 -37 -89 -70 -123c-73 -76 -181 -100 -284 -100zM378 31c81 0 131 27 179 77c25 27 40 63 48 99c13 55 14 113 14 170c0 80 -20 162 -74 219c-46 49 -112 67 -177 67 c-75 0 -130 -31 -168 -73c-21 -23 -40 -58 -50 -95c-13 -48 -16 -99 -16 -150c0 -94 24 -188 88 -255c41 -43 99 -59 156 -59'], 0x399: [683,1,394,78,348,'346 -1h-265v26c20 4 43 9 61 14c13 5 24 17 26 31c1 11 1 43 2 64v363c0 39 0 77 -3 115c-1 13 -9 26 -22 29c-1 0 -45 9 -67 14v22l7 6h250l6 -6v-21l-67 -15c-13 -3 -21 -14 -22 -26c-3 -20 -3 -78 -3 -116c0 -124 -1 -228 2 -330c0 -33 1 -66 4 -99 c1 -16 14 -26 28 -30c22 -5 64 -17 65 -17'], 0x39A: [683,7,668,49,632,'221 319l-9 -1c0 -98 0 -196 6 -293l-81 -29l-11 5l3 147v447c0 10 -1 21 -5 31c-3 6 -7 13 -14 15c-20 6 -60 18 -61 18l2 17l8 7h158l7 -7c-4 -12 -8 -49 -8 -50c-2 -27 -7 -155 -7 -268l8 -1l287 326h90l-1 -9l-291 -294c-3 -3 -8 -8 -8 -11s1 -5 5 -9 c107 -107 272 -271 333 -325l-1 -11l-85 -31c-105 112 -217 217 -325 326'], 0x39B: [698,7,770,28,771,'393 673l66 25c54 -215 118 -427 213 -627c6 -12 19 -19 32 -19l67 3l-1 -22c-52 -16 -104 -30 -157 -40l-23 8c-68 186 -127 376 -190 564h-12c-95 -188 -241 -482 -269 -548c-25 -10 -51 -19 -78 -23l-13 10c127 220 250 442 365 669'], 0x39C: [690,6,1044,79,1010,'800 690h103v-12c-6 -3 -15 -10 -19 -19c-6 -15 -6 -51 -6 -76c0 -164 2 -317 18 -481c2 -17 10 -34 24 -45c10 -7 22 -11 34 -11c13 0 38 4 56 6v-24c-44 -16 -96 -34 -136 -34c-14 0 -28 2 -41 6s-22 21 -22 29v182c0 25 -8 271 -10 337c0 8 -3 15 -8 15 c-3 0 -8 -3 -11 -8l-286 -554h-30c-75 180 -169 409 -232 537c-3 5 -7 10 -11 10s-7 -4 -8 -11c-23 -170 -40 -342 -54 -514l-75 -26l-7 3c38 196 73 393 100 591c2 12 2 26 -6 36c-5 7 -12 12 -21 15l-68 19l2 22l7 7h176c55 -161 149 -361 232 -538c2 -4 7 -14 11 -14 s10 5 12 9'], 0x39D: [694,5,829,49,710,'704 694l6 -8c-13 -227 -15 -459 -15 -686h-36c-23 26 -37 42 -67 80l-159 198c-102 126 -184 221 -234 277c-3 4 -8 10 -12 9c-6 -2 -6 -11 -6 -17c0 -129 13 -348 24 -522l-70 -30l-9 9c10 201 16 403 12 604c0 8 0 16 -6 22c-4 5 -9 10 -15 11c-1 0 -43 10 -64 15 l-4 27l8 7h162c133 -176 295 -391 412 -517c3 -3 7 -8 11 -8c5 0 6 6 6 8c0 102 -3 201 -24 505'], 0x39E: [695,6,596,27,569,'547 688l22 -163l-34 -1l-16 61c-1 6 -4 12 -8 17c-10 10 -24 16 -37 16h-346c-10 0 -21 -2 -30 -7s-17 -12 -21 -22l-23 -64l-27 -2c7 57 8 115 13 172zM122 329l17 70c101 -4 201 -2 302 3l-15 -72c-101 2 -203 4 -304 -1zM569 147l-15 -153c-1 0 -344 4 -516 6 c0 1 -7 101 -11 152l26 1l14 -51c2 -9 10 -18 15 -23c6 -5 14 -7 22 -7h301h100c12 0 20 9 23 20c0 1 11 37 16 55h25'], 0x39F: [701,12,803,66,742,'364 -12c-73 0 -150 17 -203 71c-69 72 -95 173 -95 272c0 96 3 138 44 212c57 100 191 158 339 158c77 0 157 -20 213 -77c61 -64 80 -155 80 -243c0 -58 -7 -116 -24 -170c-15 -46 -37 -89 -70 -123c-73 -76 -181 -100 -284 -100zM406 31c81 0 131 27 179 77 c25 27 40 63 48 99c13 55 14 113 14 170c0 80 -20 162 -74 219c-46 49 -112 67 -177 67c-75 0 -130 -31 -168 -73c-21 -23 -40 -58 -50 -95c-13 -48 -16 -99 -16 -150c0 -94 24 -188 88 -255c41 -43 99 -59 156 -59'], 0x3A0: [690,14,722,26,693,'693 658l-76 -17c-5 -1 -9 -3 -13 -6c-3 -4 -4 -14 -4 -21c-3 -30 -3 -134 -3 -202c0 -135 2 -269 12 -404l-80 -22l-14 11c3 98 3 195 3 293c0 108 -1 229 -2 337c0 3 -1 6 -3 8c-3 4 -9 5 -10 5h-289c-1 0 -7 0 -10 -4c-3 -3 -4 -9 -4 -10c-7 -101 -7 -202 -7 -304 c0 -82 3 -204 5 -307l-85 -19l-7 6c5 104 8 208 8 312c0 73 1 147 0 220c0 26 -1 51 -6 77c-1 7 -3 17 -7 21s-11 7 -17 10c-2 0 -38 12 -58 18v30c75 -5 150 -9 225 -9h198c44 0 163 3 244 5v-28'], 0x3A1: [679,6,576,55,550,'281 640h-56c-7 0 -9 -6 -9 -11c-4 -88 -6 -201 -6 -288c0 -9 7 -12 11 -12c35 0 76 4 109 15c27 8 52 20 71 39c33 33 53 77 53 123c0 36 -12 72 -38 98c-14 14 -33 22 -52 27c-27 7 -55 9 -83 9zM217 22l-83 -28l-7 7c2 140 7 281 7 422c0 59 -1 118 -5 177 c-1 18 -9 36 -27 43c-15 6 -31 9 -47 11v18l7 7h257c36 0 73 -2 108 -10c24 -5 49 -12 68 -28c38 -31 55 -79 55 -127c0 -58 -22 -115 -64 -156c-20 -21 -46 -34 -74 -44c-35 -12 -71 -18 -108 -21c-25 -2 -57 -4 -82 -6c-8 -1 -12 -6 -12 -13c0 -25 6 -151 7 -252'], 0x3A3: [695,-2,646,49,600,'340 362l-175 -256l5 -10c89 -2 177 -2 266 -2c65 0 108 5 118 8c6 2 11 6 12 11c5 11 12 41 16 67h18l-5 -175c-89 3 -187 4 -276 4c-90 0 -180 -7 -270 -7c0 1 5 28 9 47l163 216c19 26 44 60 54 85c-8 22 -22 46 -36 66l-152 225l68 47c138 -3 276 0 414 7l4 -11 l-22 -53l-331 4l-11 -13l137 -222c3 -5 5 -10 5 -16s-7 -15 -11 -22'], 0x3A4: [697,10,492,26,575,'575 689l-2 -48l-8 -7c-168 8 -189 10 -210 10c-6 0 -9 -5 -9 -11c-1 -14 -4 -115 -4 -195c0 -121 6 -300 13 -421l-100 -27l-9 9c8 127 13 254 13 381c0 82 -1 226 -2 256c0 4 -4 6 -9 6c-24 0 -103 -3 -214 -7l-8 7v48l7 7c95 -3 95 -11 272 -11c75 0 174 6 262 10'], 0x3A5: [697,11,716,27,682,'682 593l-16 -6c-3 4 -14 13 -21 17c-16 9 -42 14 -58 14c-28 0 -53 -11 -73 -31c-64 -64 -102 -147 -119 -236c-10 -52 -10 -217 -10 -326l-67 -36l-17 7c4 75 4 150 4 225c0 76 -7 152 -27 225c-15 53 -37 106 -76 145c-21 21 -47 34 -77 34c-18 0 -33 -3 -47 -12 c-21 -13 -27 -26 -33 -39l-18 7c9 39 19 61 44 88c22 22 54 28 84 28c38 0 73 -15 99 -41c29 -29 45 -61 57 -100c19 -59 29 -120 35 -181h9c10 57 24 114 46 168c16 41 37 80 69 111c28 29 68 43 109 43c26 0 53 -9 72 -28c13 -13 20 -30 25 -48c2 -6 3 -13 6 -28'], 0x3A6: [721,33,833,73,748,'362 699l92 22l4 -8c-1 -7 -9 -93 -9 -105l7 -7c47 0 95 -6 141 -19c36 -11 72 -28 99 -55c40 -40 52 -98 52 -154c0 -75 -20 -152 -73 -205c-26 -26 -59 -44 -94 -55c-40 -13 -83 -25 -124 -27l-8 -6c0 -34 1 -53 4 -91l-91 -22l-5 9l8 104l-7 6c-82 1 -166 21 -224 80 c-44 43 -61 105 -61 166c0 65 17 132 64 180c58 58 140 87 222 89l7 7c0 18 -2 71 -4 91zM449 565v-443l6 -8c51 1 103 19 140 56c48 48 61 116 61 182c0 33 -2 67 -11 99c-6 23 -15 46 -32 63c-42 42 -100 58 -157 59zM367 121v444l-7 8c-51 -2 -102 -26 -138 -62 c-43 -43 -57 -104 -57 -164c0 -71 27 -139 77 -189c30 -30 76 -43 118 -44'], 0x3A7: [688,11,666,27,636,'632 672l-187 -206c-30 -35 -63 -79 -67 -86c0 -13 117 -200 156 -249l60 -72c7 -7 29 -21 37 -23l5 -4v-16l-110 -27l-14 6c-18 18 -32 40 -46 62l-143 239h-12c-14 -17 -55 -73 -83 -114c-38 -53 -91 -137 -107 -171l-94 -11v16l271 329c-4 1 -99 163 -145 245 c-11 18 -37 37 -55 44c-14 5 -31 10 -50 15v25l7 6c25 1 101 5 146 8l147 -266h9c5 5 70 90 103 135c32 46 77 117 77 117l95 13v-15'], 0x3A8: [694,1,703,-28,698,'409 244l2 -158c1 -21 10 -44 33 -48l58 -12l-1 -27h-266v27l68 12c22 4 29 40 29 49v155l-6 6c-36 0 -71 4 -105 13c-27 8 -53 18 -72 38c-20 19 -29 46 -36 73c-12 41 -18 84 -21 127c-3 33 -8 88 -10 99c-2 13 -4 26 -13 35c-7 7 -17 12 -27 11l-63 -10l-7 22l108 36 c3 2 23 2 35 2s22 -9 31 -18c12 -12 12 -53 12 -81c0 -58 4 -116 17 -173c10 -38 23 -76 51 -104c26 -26 62 -41 100 -43l6 7v83c0 100 0 220 -6 302l86 23l4 -8c-7 -75 -13 -149 -13 -224c0 -59 1 -118 3 -176l7 -6c37 2 71 23 97 49c18 18 26 44 34 69c14 42 22 85 28 129 c7 44 7 89 19 132c34 12 69 20 104 24l3 -18c-24 -15 -35 -44 -42 -71c-5 -18 -13 -68 -19 -102c-6 -40 -14 -80 -28 -118c-8 -24 -17 -48 -35 -66c-42 -42 -101 -52 -159 -53'], 0x3A9: [689,2,875,25,844,'835 60l9 -9l-25 -53c-115 9 -231 9 -346 1l9 58c47 11 90 36 124 70c27 26 43 61 54 97c14 47 19 96 19 144c0 84 -22 169 -82 229c-40 40 -97 57 -153 57c-62 0 -126 -17 -170 -62c-31 -30 -51 -69 -65 -110c-16 -49 -23 -101 -23 -153c0 -81 21 -164 79 -223 c29 -29 69 -45 110 -53l-21 -55c-110 10 -219 14 -329 6l17 61c61 -3 137 -6 190 -11l6 15c-26 14 -50 30 -71 51c-24 25 -40 56 -51 90c-13 41 -18 85 -18 128c0 95 28 190 96 257c70 71 171 94 269 94c44 0 89 -5 131 -19c35 -12 68 -29 94 -55c60 -60 81 -146 81 -230 c0 -93 -23 -189 -90 -256c-29 -28 -58 -51 -95 -66v-12c85 4 181 9 251 9'], 0x3B1: [468,20,658,84,673,'403 212c-17 56 -44 142 -69 167c-18 19 -42 32 -68 32c-24 0 -47 -11 -64 -28c-19 -19 -31 -43 -39 -68c-10 -32 -13 -66 -13 -99c0 -49 7 -100 42 -135c12 -12 28 -19 44 -19c13 0 25 5 37 11c16 9 34 23 47 35c25 26 56 66 83 104zM558 468l51 -23 c-46 -69 -138 -207 -138 -208c10 -38 22 -76 37 -112c10 -21 19 -44 36 -61c7 -7 15 -14 25 -14c25 0 60 25 87 46l10 -1l7 -19c-34 -27 -83 -63 -103 -77c-14 -9 -30 -19 -48 -19c-13 0 -26 5 -36 15c-8 8 -15 17 -18 29l-46 134l-11 2l-65 -78c-5 -6 -12 -14 -18 -20 c-21 -21 -45 -41 -71 -55c-21 -11 -43 -19 -67 -19c-21 0 -40 9 -54 24c-41 41 -52 100 -52 157c0 85 23 171 84 232c40 40 92 67 148 67c28 0 54 -10 73 -29c16 -16 28 -36 37 -56c14 -28 22 -52 28 -75l10 -1'], 0x3B2: [698,202,662,113,569,'381 380c49 -2 104 -14 134 -45c34 -35 54 -85 54 -133c0 -56 -21 -111 -61 -151c-48 -48 -116 -66 -184 -66c-30 0 -59 9 -80 30c-6 6 -10 12 -14 19l49 69l13 -6c-2 -20 5 -39 19 -53s33 -23 53 -23c29 0 54 16 73 35c36 36 47 88 47 138c0 43 -13 87 -43 118 c-32 32 -78 40 -122 40c-21 0 -42 0 -63 -2l2 36c50 0 99 15 134 50c28 27 35 66 35 104c0 56 -41 111 -101 111c-29 0 -60 -9 -81 -30s-30 -49 -37 -76c-10 -42 -14 -85 -15 -129c-1 -31 -1 -138 -1 -208c0 -126 2 -252 9 -377l-76 -33l-12 15c5 190 1 381 9 571 c2 51 10 129 32 176c17 36 30 54 59 82c39 37 93 56 156 56c75 0 136 -60 136 -135c0 -47 -21 -90 -54 -123c-20 -21 -43 -38 -69 -48'], 0x3B3: [470,198,608,-25,582,'522 470l60 -27c-80 -131 -170 -255 -245 -389l-17 -43c1 -60 -2 -123 -8 -183l-34 -26c-21 7 -39 19 -56 33l53 165c0 39 -31 300 -104 372c-19 18 -44 31 -70 31c-28 0 -65 -7 -87 -30l-23 -27l-16 12c15 23 30 47 48 65c32 32 76 46 121 46c31 0 62 -12 85 -35 c34 -34 52 -81 65 -128c17 -65 24 -146 23 -214l8 -2c65 120 147 280 184 375'], 0x3B4: [694,9,501,56,438,'384 687l5 -8l-15 -42c-35 2 -73 9 -139 9c-33 0 -65 -9 -65 -41c0 -14 10 -26 19 -36c4 -5 57 -55 86 -83l95 -91c38 -39 68 -89 68 -144c0 -70 -27 -138 -77 -188c-42 -43 -97 -72 -157 -72c-34 0 -69 6 -93 30c-37 37 -55 87 -55 139c0 47 18 92 41 133 c31 55 72 104 117 149c-25 23 -48 46 -68 72c-11 16 -24 32 -24 51c0 13 5 25 11 37c8 16 19 31 31 44c15 18 35 28 56 35c27 9 55 13 84 13c27 0 51 -3 80 -7zM238 422c-70 -72 -105 -134 -105 -210c0 -53 17 -105 54 -143c18 -17 42 -25 67 -25c30 0 58 18 79 39 c29 29 41 81 41 126c0 34 -17 64 -35 92c-26 43 -65 85 -101 121'], 0x3B5: [471,15,486,78,430,'392 430l-30 -65l-11 1c-5 14 -13 26 -23 36c-20 19 -46 28 -73 28c-26 0 -50 -11 -69 -30c-12 -12 -17 -29 -17 -47c0 -21 3 -41 18 -57c19 -18 45 -20 70 -20c1 0 34 -1 51 -2l-21 -47c-15 4 -30 5 -46 5c-28 0 -55 -10 -75 -30c-14 -13 -18 -33 -18 -51 c0 -33 16 -60 39 -82c27 -25 59 -31 93 -31c22 0 43 7 64 16c24 11 48 27 69 44l9 -2l8 -14c-53 -57 -125 -97 -204 -97c-40 0 -84 12 -113 41c-23 23 -35 52 -35 83c0 33 11 67 34 90c15 14 32 27 51 36v7c-23 14 -43 48 -43 78c0 43 16 77 43 104c32 32 79 47 124 47 c39 0 74 -19 105 -41'], 0x3B6: [695,136,512,84,491,'419 -136l-21 12c15 27 34 59 34 85c0 11 -8 20 -16 27c-10 9 -22 11 -35 11c-18 0 -36 0 -54 -2c-27 -4 -71 -7 -81 -7c-40 0 -82 6 -111 35c-39 39 -51 95 -51 149c0 66 24 129 55 188c41 76 96 143 157 204c17 16 34 32 52 47l-1 7l-91 8c-24 4 -47 10 -67 23 c-1 1 -2 4 -2 4c0 1 0 2 2 4l28 35c2 1 3 1 5 1s1 0 8 -4c71 -47 131 -52 234 -36v-19c-54 -17 -103 -49 -143 -90c-91 -90 -160 -206 -160 -336c0 -48 16 -96 50 -131c26 -26 63 -32 99 -32c18 0 38 0 53 2c16 1 39 4 48 4c14 0 28 -1 41 -4c10 -3 19 -6 26 -13 c8 -8 13 -19 13 -30c0 -22 -9 -43 -19 -62c-14 -29 -33 -55 -53 -80'], 0x3B7: [466,199,560,-32,479,'397 -199l-9 11c1 27 1 208 1 313c0 63 0 158 -3 190c-2 25 -5 51 -23 69c-16 15 -38 18 -59 18c-22 0 -42 -6 -62 -15c-26 -11 -50 -26 -74 -43c-2 -24 -2 -107 -2 -160c0 -46 4 -113 7 -170l-72 -25l-9 10v335c0 22 0 50 -14 64c-7 7 -16 10 -25 10 c-19 0 -47 -19 -69 -33l-16 18c23 19 47 37 74 52c17 9 36 18 56 18c19 0 39 -5 53 -19c13 -13 15 -32 16 -51l11 -2c33 22 68 41 105 56c28 11 57 19 86 19c25 0 50 -6 67 -24c17 -16 20 -41 23 -64c3 -33 3 -116 3 -174c0 -123 2 -246 17 -368'], 0x3B8: [695,11,554,59,486,'231 -11c-36 0 -71 13 -96 38c-31 31 -46 72 -56 114c-16 60 -20 122 -20 184c0 60 2 122 20 180c15 46 37 87 72 122c43 43 105 68 166 68c37 0 73 -14 99 -40c29 -29 42 -69 52 -108c14 -59 18 -119 18 -179s-6 -120 -23 -177c-14 -44 -34 -87 -67 -120 c-45 -45 -101 -82 -165 -82zM142 370h254l5 7c-3 55 -8 108 -20 161c-6 30 -18 62 -40 84c-19 19 -43 26 -69 26c-29 0 -55 -13 -75 -33c-27 -27 -42 -70 -50 -106c-10 -46 -11 -86 -11 -132zM398 333h-255l-7 -7c0 -49 5 -101 18 -147c9 -35 23 -70 49 -95 c23 -23 53 -37 85 -37c27 0 49 17 67 36c23 23 31 56 38 88c10 48 13 103 13 154'], 0x3B9: [474,9,334,101,332,'319 109l13 -14c-23 -29 -49 -56 -79 -77c-21 -14 -45 -27 -71 -27c-23 0 -44 14 -57 33c-17 22 -24 50 -24 78v347l81 25l11 -10c-15 -89 -17 -179 -17 -269c0 -26 2 -52 7 -78c4 -16 8 -32 20 -44c8 -8 21 -9 32 -9c14 0 26 6 38 13c14 9 25 19 37 31'], 0x3BA: [472,4,555,112,516,'504 441l-1 -15c-89 -38 -202 -103 -245 -154c-1 -2 -1 -4 -1 -6l4 -11c80 -75 166 -143 255 -207l-1 -14l-67 -36c-85 72 -175 148 -251 218l-9 -4c0 -61 3 -127 6 -190l-63 -26l-16 5c2 146 3 292 -3 438l79 26l5 -6c-2 -58 -6 -164 -7 -195l6 -2 c76 82 164 150 258 210'], 0x3BB: [690,11,541,21,510,'422 -4l-146 384c-1 3 -4 6 -8 6c-4 -1 -6 -4 -7 -7c-42 -89 -126 -268 -126 -269c-12 -25 -26 -66 -37 -99l-59 -17l-18 13l218 409l13 26c-2 18 -21 79 -42 123c-10 21 -22 41 -39 58c-12 13 -31 23 -49 23c-15 0 -47 -7 -70 -12l-8 25c44 16 94 31 146 31 c33 0 58 -16 90 -78c22 -44 52 -151 76 -216c18 -52 53 -149 154 -369c2 -4 -1 -12 -1 -12l-73 -26'], 0x3BC: [466,199,617,96,635,'485 466l8 -11c-3 -41 -6 -92 -6 -123v-167c0 -18 2 -36 6 -54c4 -12 8 -25 18 -34c7 -7 18 -11 28 -11c23 0 53 18 77 33l11 -2l8 -14c-25 -23 -52 -46 -83 -62c-21 -12 -44 -22 -69 -22c-17 0 -36 1 -48 13c-13 13 -18 37 -21 56l-8 5c-58 -33 -134 -76 -183 -76 c-32 0 -45 10 -62 30l-6 -2c0 -66 6 -141 19 -204l-53 -20l-12 6c2 92 4 184 4 276v189c0 55 -13 140 -17 164l83 26l9 -7v-269c0 -41 5 -84 35 -114c15 -15 38 -15 58 -15c21 0 59 11 87 29c16 11 26 18 41 34c1 48 3 121 3 142c0 58 -2 115 -4 172'], 0x3BD: [471,8,599,15,561,'561 444l-136 -274c-24 -48 -46 -96 -66 -146l-56 -32l-7 7c-12 81 -28 162 -55 239c-18 52 -39 99 -78 138c-16 15 -39 26 -61 26c-31 0 -52 -8 -67 -18l-20 26c35 39 78 61 131 61c30 0 63 -11 84 -32c55 -55 92 -219 118 -338h5c24 50 50 107 69 159 c22 62 39 131 56 198l23 10l57 -16'], 0x3BE: [694,137,553,74,545,'471 -137l-21 15c15 25 34 55 34 79c0 13 -7 25 -16 34c-16 16 -41 17 -63 17s-55 -3 -82 -6c-35 -4 -98 -10 -104 -10c-37 0 -76 7 -103 34s-42 63 -42 100c0 54 24 104 61 141c35 35 79 59 124 73v6c-31 7 -63 19 -87 42c-16 16 -21 40 -21 63c0 35 12 71 38 96 c28 29 62 51 98 65l-1 8c-44 1 -91 6 -132 28l28 46h8c39 -32 90 -45 140 -45c31 0 66 5 98 11v-28c-60 -7 -123 -22 -166 -66c-23 -23 -33 -56 -33 -88c0 -26 6 -53 25 -72c15 -14 34 -24 54 -31c26 -9 53 -14 81 -17v-23c-67 0 -137 -15 -185 -63 c-31 -31 -45 -74 -45 -117c0 -30 11 -58 32 -79c27 -27 67 -30 104 -28c55 4 127 10 163 10c27 0 56 -4 76 -24c8 -7 11 -17 11 -27c0 -21 -9 -41 -19 -60c-15 -30 -35 -57 -55 -84'], 0x3BF: [465,14,563,56,497,'150 316c-6 -25 -8 -51 -8 -77c0 -66 12 -141 63 -186c19 -17 45 -26 72 -26c34 0 65 12 88 37c19 21 29 48 35 75s8 54 8 81c0 64 -8 136 -58 180c-20 19 -47 26 -74 26c-30 0 -68 -14 -94 -42c-18 -19 -26 -43 -32 -68zM250 -14c-44 0 -92 10 -125 40 c-48 43 -65 107 -69 170c0 69 7 143 55 195c47 52 118 74 188 74c47 0 94 -9 130 -41c51 -47 68 -118 68 -185c0 -65 -14 -131 -58 -180c-47 -53 -119 -73 -189 -73'], 0x3C0: [488,5,609,21,628,'186 460h323c39 0 77 10 111 28l8 -7l-35 -59c-34 -16 -71 -27 -109 -28l-7 -7c-2 -35 -6 -71 -6 -105c0 -73 0 -176 34 -209c7 -7 19 -10 29 -10c18 0 34 6 49 16l6 -2l10 -17c-19 -17 -39 -33 -62 -45c-16 -8 -33 -15 -51 -15c-19 0 -41 0 -53 12c-14 13 -19 32 -23 50 c-7 28 -8 57 -8 85c0 81 6 161 16 241l-6 6h-143c-27 -130 -72 -261 -116 -389l-11 -10l-55 15l-1 13c67 116 121 259 146 371h-74c-25 0 -51 0 -69 -18c-14 -14 -22 -33 -29 -51l-18 -46l-21 9l28 113c4 13 11 26 21 35c11 11 26 15 41 18c25 5 50 6 75 6'], 0x3C1: [477,189,548,90,499,'121 -189l-20 8c-6 104 -11 209 -11 314c0 61 3 152 16 197c8 27 24 66 57 95c41 36 98 52 152 52c50 0 99 -18 135 -54c19 -18 29 -43 36 -68c10 -34 13 -69 13 -104c0 -71 -24 -141 -75 -191c-33 -34 -81 -63 -129 -63c-43 0 -77 17 -108 48c-9 9 -16 18 -24 30l-7 -1 c3 -80 7 -152 27 -230c0 -1 -4 -9 -6 -13zM161 231c0 -32 2 -64 11 -95c6 -22 16 -42 30 -58c17 -18 39 -31 64 -31c35 0 68 12 93 37c39 39 52 95 52 150c0 36 -2 73 -11 108c-5 24 -17 52 -32 66c-18 16 -42 33 -68 33c-32 0 -62 -11 -85 -34c-20 -19 -33 -48 -41 -74 c-10 -33 -13 -68 -13 -102'], 0x3C3: [476,5,605,82,608,'261 462l342 14l5 -10l-14 -57l-7 -6c-64 13 -133 21 -199 29l-1 -6c3 -2 21 -13 46 -38c42 -42 56 -101 56 -160s-14 -120 -57 -163c-47 -47 -98 -70 -175 -70c-53 0 -90 21 -122 53c-19 20 -31 44 -39 70c-10 33 -14 68 -14 103c0 62 10 132 52 178c35 39 74 61 127 63 zM280 429c-28 0 -51 -13 -71 -32c-36 -37 -44 -93 -44 -144c0 -35 3 -69 14 -103c8 -26 17 -52 41 -76c23 -23 44 -38 74 -38c31 0 54 15 73 33c15 15 28 45 33 63c7 28 10 56 10 84c0 36 -3 73 -13 108c-7 25 -21 54 -40 73c-20 20 -49 32 -77 32'], 0x3C4: [484,9,513,15,519,'142 461h254c38 0 76 7 110 23l13 -9l-43 -67c-27 -6 -55 -10 -83 -10h-68l-9 -8c-2 -34 -11 -111 -11 -165c0 -17 0 -125 29 -153c9 -8 20 -15 32 -15c19 0 45 15 61 25l9 -2l9 -14c-19 -18 -55 -46 -78 -58c-18 -10 -37 -17 -57 -17c-18 0 -34 9 -47 22 c-12 12 -20 30 -23 47c-6 27 -8 54 -8 82c0 83 8 166 15 249l-7 7h-75c-28 0 -65 -2 -85 -22c-13 -14 -30 -60 -43 -94l-22 3c4 19 26 121 39 141c20 30 59 35 88 35'], 0x3C5: [472,12,587,-12,519,'387 398l-4 18l42 51l20 4c45 -48 74 -109 74 -175c0 -81 -36 -157 -93 -214c-55 -55 -126 -94 -205 -94c-27 0 -55 7 -74 27c-27 27 -34 66 -34 104v211c0 23 -3 54 -12 68c-6 8 -16 16 -26 16c-26 0 -50 -18 -71 -35l-16 22c23 21 47 39 74 53c19 10 40 18 63 18 c17 0 34 -6 46 -18c8 -8 12 -19 15 -30c4 -16 5 -32 5 -48c0 -37 -3 -74 -4 -110c-1 -26 -1 -57 -1 -85c0 -21 2 -42 7 -62c4 -15 10 -29 21 -40c17 -17 41 -28 66 -28c43 0 65 10 90 28c57 41 74 120 74 174s-18 107 -57 145'], 0x3C6: [467,197,763,91,685,'320 -183l2 168l-7 7c-59 6 -109 16 -161 76c-45 52 -63 112 -63 181c0 57 25 110 65 150c33 33 74 55 118 68l12 -22c-26 -12 -47 -22 -67 -42c-34 -33 -48 -88 -48 -136c0 -67 13 -145 61 -193c38 -37 64 -46 83 -46l7 7v205c0 61 8 126 66 176c43 37 94 48 136 48 c41 0 82 -13 111 -42c37 -38 50 -92 50 -145c0 -69 -19 -138 -68 -187c-58 -58 -135 -86 -216 -97l-7 -8c0 -54 3 -107 8 -161l-69 -21zM401 26c54 2 103 26 141 65c21 21 35 48 44 77c12 35 16 72 16 109c0 12 -6 88 -38 120c-17 17 -36 28 -59 28c-26 0 -43 -3 -67 -19 c-30 -22 -44 -93 -44 -141v-232'], 0x3C7: [466,197,576,-18,564,'288 206l187 250l20 4l33 -32l1 -7l-179 -206c-16 -19 -33 -38 -48 -59c43 -95 101 -227 149 -274c9 -10 23 -14 36 -14c24 0 48 4 69 15l8 -23c-27 -16 -54 -31 -83 -42c-18 -8 -36 -15 -55 -15c-18 0 -32 12 -45 24c-21 22 -34 49 -47 76c-20 41 -52 118 -78 180h-10 c-34 -51 -65 -101 -95 -152c-22 -38 -43 -76 -59 -116l-17 -6l-50 30c68 100 137 199 211 295c0 1 -73 143 -109 215c-8 17 -21 36 -34 49c-8 8 -20 13 -31 13c-18 0 -46 -22 -65 -37l-15 21l63 48c19 15 44 23 69 23c15 0 30 -6 40 -17c15 -15 25 -32 34 -51l90 -192h10'], 0x3C8: [695,189,754,-7,684,'353 -182l4 176l-7 8c-40 0 -79 3 -117 11c-26 5 -52 12 -71 30c-33 34 -44 82 -44 129v153c0 16 -2 33 -6 49c-3 11 -7 23 -15 31c-6 6 -14 10 -23 10c-19 0 -44 -17 -64 -30l-17 21c24 19 46 35 73 48c20 10 40 18 62 18c16 0 35 -4 48 -20c10 -13 16 -42 16 -94v-129 c0 -80 12 -121 41 -149c22 -21 73 -44 117 -44l7 6v315c0 96 -6 204 -12 305l80 33l7 -7c-2 -30 -2 -194 -2 -292v-352l6 -7c63 5 116 59 130 77c36 44 47 97 47 153c0 54 -27 103 -63 142l3 13l44 48l21 -3c41 -51 66 -115 66 -181c0 -72 -31 -143 -82 -194 c-46 -46 -98 -74 -165 -88l-7 -8c0 -50 2 -101 9 -150l-76 -35'], 0x3C9: [472,13,851,67,781,'649 421l42 48l14 3c51 -40 76 -102 76 -166c0 -90 -36 -177 -100 -241c-41 -40 -93 -69 -151 -69c-31 0 -62 6 -84 28c-13 13 -26 40 -37 63h-12c-26 -27 -51 -52 -84 -72c-25 -15 -59 -28 -88 -28c-37 0 -73 12 -99 38c-40 39 -59 95 -59 151c0 88 23 178 87 242 c23 23 55 37 87 48l16 -14c-13 -10 -28 -21 -39 -32c-49 -49 -69 -119 -69 -188c0 -29 3 -59 11 -87c7 -22 16 -44 33 -60c20 -20 47 -35 76 -35c34 0 65 18 89 42c16 16 22 37 27 59c8 32 10 65 10 98v189l75 28l6 -7c-9 -59 -9 -130 -9 -195c0 -37 3 -81 13 -116 c7 -26 16 -46 35 -64c16 -16 38 -23 60 -23c36 0 65 15 90 40c36 35 49 93 49 143c0 61 -20 124 -68 165'], 0x3D1: [698,14,552,-16,522,'391 370c0 52 -6 102 -22 151c-13 41 -31 80 -62 110c-16 17 -34 28 -58 28c-18 0 -36 -6 -50 -19c-17 -17 -27 -39 -27 -63c0 -55 26 -106 64 -145c41 -41 93 -62 150 -67zM108 118v110c0 25 0 55 -16 71c-7 7 -17 13 -28 13c-22 0 -47 -15 -69 -28l-11 20 c22 19 47 37 74 50c21 10 43 18 66 18c15 0 32 -9 42 -20c12 -12 16 -38 16 -55v-108c0 -53 1 -80 6 -100c3 -13 8 -26 17 -36c13 -12 28 -19 46 -19c29 0 52 11 73 31c28 29 43 65 54 103c14 52 17 105 17 158l-4 5c-40 4 -75 11 -112 25c-31 12 -61 28 -85 52 c-38 38 -64 89 -64 143c0 39 13 77 41 105c29 28 68 42 108 42c34 0 66 -16 90 -40c33 -33 59 -80 72 -124c18 -56 24 -110 24 -167l4 -5l53 -1v-27h-52l-4 -4c0 -53 -7 -100 -24 -150c-15 -43 -41 -87 -73 -119c-43 -43 -97 -75 -157 -75c-28 0 -58 13 -78 33 c-10 10 -15 24 -19 38c-6 20 -7 40 -7 61'], 0x3D5: [694,192,727,66,659,'405 -156l-72 -36l-17 10c1 57 5 112 5 169l-8 9c-39 1 -75 5 -113 17c-31 9 -61 24 -85 47c-39 40 -49 98 -49 152c0 72 24 142 74 193c21 21 47 37 74 47c32 12 81 21 98 21l9 9c0 57 -2 114 -6 170l82 42l7 -8c-5 -67 -8 -135 -8 -203l8 -10c39 0 77 -4 117 -15 c27 -7 58 -20 78 -40c42 -42 60 -100 60 -159c0 -67 -21 -135 -69 -184c-50 -50 -117 -71 -187 -73l-9 -10c0 -49 4 -99 11 -148zM402 33c47 3 86 29 118 62c44 44 57 106 57 166c0 51 -11 103 -47 140c-34 34 -80 41 -127 42l-9 -9v-392zM312 441c-31 0 -80 -13 -110 -43 c-41 -41 -53 -100 -53 -156c0 -62 16 -124 60 -167c27 -27 65 -46 104 -46l8 9v395'], 0x3D6: [541,12,875,74,790,'478 330l8 -12v-154c0 -30 13 -62 32 -81s43 -27 70 -27c32 0 61 15 84 37c17 18 29 40 36 63c9 30 15 62 15 93c-1 59 -12 104 -64 158c-27 28 -58 41 -94 51c-53 14 -108 19 -162 19c-90 0 -157 -11 -194 -25c-46 -17 -85 -48 -120 -83l-15 16c33 39 63 76 108 104 c42 26 105 52 260 52c61 0 120 -8 178 -24c42 -11 85 -31 116 -62c39 -39 54 -95 54 -149c0 -93 -38 -181 -104 -246c-39 -39 -86 -72 -142 -72c-33 0 -65 11 -89 35c-17 17 -30 37 -38 60l-8 1c-49 -53 -112 -92 -185 -92c-34 0 -65 15 -89 39c-43 42 -54 104 -54 163 c0 58 28 111 69 152c14 14 36 28 55 41l10 -21c-38 -37 -55 -89 -55 -142s9 -109 47 -147c17 -16 47 -30 65 -30c27 0 59 8 82 31c17 18 28 41 35 64c9 31 13 63 13 94c0 22 -3 44 -5 66'], 0x3F5: [471,11,550,88,490,'279 256l119 2l-14 -42c-30 1 -94 1 -141 1c-1 0 -43 -2 -69 -3l-5 -6c2 -49 20 -97 55 -132c11 -11 26 -17 41 -21c21 -6 42 -8 64 -8c51 0 102 16 141 49l8 -1l12 -20c-32 -25 -67 -48 -105 -64c-30 -12 -61 -22 -94 -22c-52 0 -106 12 -144 49c-43 44 -59 105 -59 165 c0 75 28 147 81 199c45 45 105 69 168 69c52 0 101 -22 138 -59l-37 -53l-13 -2c-10 14 -24 34 -32 41c-23 23 -57 30 -89 30c-34 0 -66 -13 -90 -37c-34 -34 -42 -82 -43 -128l6 -6c37 0 101 -1 102 -1'], 0x2016: [738,167,392,86,306,'126 -159l-40 -8v897l40 8v-897zM306 -159l-40 -8v897l40 8v-897'], 0x2018: [709,-406,214,45,167,'119 532l32 -49c5 -8 16 -27 16 -35c0 -10 -11 -20 -19 -28c-8 -7 -22 -14 -29 -14c-8 0 -21 12 -27 20c-26 34 -47 72 -47 115c0 25 12 47 25 68c21 35 45 68 70 100l14 -14c-15 -26 -28 -52 -40 -79c-6 -12 -9 -25 -9 -39c0 -16 5 -31 14 -45'], 0x2019: [695,-395,214,44,163,'74 395l-16 11c14 24 29 49 38 72c6 15 10 31 10 47c0 14 -5 27 -13 39l-35 57c-6 10 -14 26 -14 33c0 8 8 16 14 22c10 9 24 19 34 19c8 0 23 -14 30 -25c15 -21 26 -45 34 -69c5 -12 7 -25 7 -37c0 -29 -13 -55 -27 -80c-18 -31 -42 -59 -62 -89'], 0x2026: [119,15,768,77,691,'77 52c0 37 30 67 67 67s67 -30 67 -67s-30 -67 -67 -67s-67 30 -67 67zM317 52c0 37 30 67 67 67s67 -30 67 -67s-30 -67 -67 -67s-67 30 -67 67zM557 52c0 37 30 67 67 67s67 -30 67 -67s-30 -67 -67 -67s-67 30 -67 67'], 0x2032: [782,-422,257,48,211,'205 723l-124 -290c-4 -9 -5 -11 -9 -11c-6 0 -24 5 -24 13c0 0 3 8 3 9l83 306c5 19 18 32 37 32c22 0 40 -17 40 -37c0 -7 -3 -13 -6 -22'], 0x2033: [782,-422,490,48,404,'205 723l-124 -290c-4 -9 -5 -11 -9 -11c-6 0 -24 5 -24 13c0 0 3 8 3 9l83 306c5 19 18 32 37 32c22 0 40 -17 40 -37c0 -7 -3 -13 -6 -22zM397 723l-124 -290c-4 -9 -5 -11 -9 -11c-5 0 -24 5 -24 13c0 0 3 8 3 9l84 306c5 19 17 32 37 32c21 0 40 -17 40 -37 c0 -7 -3 -13 -7 -22'], 0x2034: [782,-422,724,48,596,'205 723l-124 -290c-4 -9 -5 -11 -9 -11c-6 0 -24 5 -24 13c0 0 3 8 3 9l83 306c5 19 18 32 37 32c22 0 40 -17 40 -37c0 -7 -3 -13 -6 -22zM397 723l-124 -290c-4 -9 -5 -11 -9 -11c-5 0 -24 5 -24 13c0 0 3 8 3 9l84 306c5 19 17 32 37 32c21 0 40 -17 40 -37 c0 -7 -3 -13 -7 -22zM590 723l-124 -290c-4 -9 -5 -11 -9 -11c-6 0 -24 5 -24 13c0 0 3 8 3 9l83 306c5 19 18 32 37 32c22 0 40 -17 40 -37c0 -7 -3 -13 -6 -22'], 0x2035: [782,-422,241,30,193,'36 723c-3 9 -6 15 -6 22c0 20 18 37 40 37c20 0 32 -13 37 -32l83 -306c0 -1 3 -9 3 -9c0 -8 -18 -13 -24 -13c-4 0 -5 2 -9 11'], 0x2044: [720,192,501,39,463,'458 715l5 -11l-389 -896l-32 8l-3 14l386 888l11 2'], 0x2057: [782,-422,958,48,789,'205 723l-124 -290c-4 -9 -5 -11 -9 -11c-6 0 -24 5 -24 13c0 0 3 8 3 9l83 306c5 19 18 32 37 32c22 0 40 -17 40 -37c0 -7 -3 -13 -6 -22zM397 723l-124 -290c-4 -9 -5 -11 -9 -11c-5 0 -24 5 -24 13c0 0 3 8 3 9l84 306c5 19 17 32 37 32c21 0 40 -17 40 -37 c0 -7 -3 -13 -7 -22zM590 723l-124 -290c-4 -9 -5 -11 -9 -11c-6 0 -24 5 -24 13c0 0 3 8 3 9l83 306c5 19 18 32 37 32c22 0 40 -17 40 -37c0 -7 -3 -13 -6 -22zM782 723l-124 -290c-4 -9 -4 -11 -9 -11s-23 5 -23 13c0 0 2 8 2 9l84 306c4 19 17 32 37 32 c21 0 40 -17 40 -37c0 -7 -3 -13 -7 -22'], 0x20D7: [750,-479,287,0,418,'346 595h-346v40h346l-79 94l21 21l130 -136l-130 -135l-21 21'], 0x210F: [681,10,621,20,637,'298 516h-278l7 40h277zM624 107l13 -10v-11c-28 -30 -51 -53 -84 -72c-23 -14 -45 -24 -73 -24c-19 0 -38 10 -48 26c-12 20 -18 46 -18 73c0 54 4 141 4 177c0 24 -1 47 -5 72c-3 17 -11 36 -25 48c-17 12 -34 18 -56 18s-50 -8 -70 -16c-28 -14 -47 -26 -72 -44 c0 -110 -2 -220 -2 -328l-72 -22l-6 10c7 132 13 264 14 396c0 52 0 125 -3 156c-2 20 -4 42 -17 60c-8 12 -50 20 -77 26v18l5 4l158 17l6 -7c-4 -85 -4 -184 -4 -276l8 -8c36 22 73 42 113 58c28 10 55 18 88 18c15 0 47 -10 65 -28c13 -12 19 -30 21 -48 c3 -28 3 -88 3 -130c0 -44 -1 -108 1 -132c1 -16 3 -34 13 -50c7 -10 18 -16 30 -16c16 0 32 5 46 12c19 11 32 22 44 33'], 0x2111: [686,27,554,28,533,'522 671l11 -16c-47 -44 -98 -82 -155 -112c-43 16 -100 37 -129 47c-19 6 -37 11 -57 11c-30 0 -59 -10 -80 -32c-29 -29 -53 -75 -67 -113l-17 11c13 35 32 78 48 112c11 23 26 49 43 67c26 30 56 40 95 40c42 0 104 -29 154 -53c17 -8 34 -16 53 -16c15 0 35 6 47 13 c22 11 39 27 54 41zM43 -16l-5 16c32 44 109 124 114 128c27 -58 32 -68 45 -81c17 -17 45 -29 69 -29c30 0 48 12 68 32c16 16 27 46 33 68c9 29 11 59 11 89c0 48 -5 89 -10 127c-4 33 -8 67 -8 95c0 12 1 23 2 34c40 44 89 90 140 122l12 -7c-20 -18 -39 -41 -53 -64 c-9 -16 -12 -32 -12 -50c0 -22 1 -54 3 -65c7 -51 12 -106 12 -154c0 -62 -14 -126 -59 -171c-57 -57 -131 -101 -213 -101c-37 0 -69 24 -96 48'], 0x2113: [704,9,388,30,355,'338 122l17 -13l-28 -40c-17 -28 -58 -78 -113 -78c-25 0 -50 7 -68 25c-15 15 -28 35 -34 56c-8 33 -10 72 -12 105l-9 3l-46 -44l-15 18l66 74c-5 93 -3 189 16 280c13 62 32 118 75 164c20 20 52 32 80 32c15 0 34 -3 46 -14c19 -18 25 -44 25 -82 c0 -56 -22 -112 -46 -162c-36 -72 -77 -133 -127 -196c5 -61 14 -149 43 -180c12 -13 25 -19 43 -19c20 0 46 24 55 33zM170 302c78 105 119 200 119 304c0 32 -5 45 -12 55c-6 8 -14 11 -26 11c-9 0 -18 -6 -25 -15c-24 -29 -33 -65 -40 -102c-10 -55 -24 -162 -24 -251'], 0x2118: [472,196,604,60,566,'285 59l47 43l7 -1c4 -15 11 -30 20 -38c10 -10 23 -14 36 -14c25 0 46 9 59 23c19 19 30 44 38 70c9 30 14 74 14 109c0 49 -8 99 -43 134c-16 16 -37 25 -59 25c-19 0 -29 -2 -57 -13c-39 -16 -102 -108 -142 -170c26 -45 52 -95 71 -143c3 -8 6 -16 9 -25zM198 464 l14 -10c-26 -33 -51 -69 -51 -112c0 -18 5 -35 11 -52c4 -9 7 -17 11 -25h9l18 26c28 44 79 122 149 159c26 14 58 22 87 22c28 0 57 -8 77 -28c36 -36 43 -89 43 -138c0 -93 -25 -188 -91 -255c-17 -16 -35 -31 -55 -42c-15 -9 -32 -15 -49 -15c-30 0 -57 15 -77 36 c4 -15 6 -29 6 -44c0 -51 -11 -105 -48 -142c-23 -23 -53 -40 -86 -40c-25 0 -49 8 -67 25c-28 28 -39 67 -39 106c0 35 11 69 21 101c15 46 55 129 65 148c-9 17 -17 31 -24 49c-9 24 -17 48 -17 73c0 66 42 121 93 158zM161 144c-30 -52 -51 -124 -51 -174 c0 -37 7 -77 34 -102c10 -10 23 -16 38 -16c18 0 37 5 50 18c20 21 27 51 27 79c0 27 -11 53 -22 77c-19 40 -43 80 -67 118h-9'], 0x211C: [686,27,828,27,826,'432 348c21 11 70 33 115 40l129 75c-13 1 -27 6 -37 16c-7 7 -14 44 -16 69c-1 19 -7 37 -16 53c-8 16 -24 27 -42 27c-25 0 -52 -10 -69 -28c-25 -24 -44 -50 -66 -88c1 -5 5 -48 5 -61c0 -33 0 -69 -3 -103zM418 548l4 5c16 20 34 41 52 59c42 42 95 74 155 74 c22 0 44 -9 58 -26c15 -18 19 -45 22 -69c2 -16 1 -33 5 -50c3 -14 8 -28 47 -28c13 0 26 2 38 4l7 -13c-29 -11 -60 -27 -87 -41c-35 -18 -88 -47 -123 -75c51 0 76 -15 102 -37c3 -66 7 -170 16 -197c7 -22 15 -43 27 -63c7 -10 14 -22 26 -22c5 0 39 13 59 21v-16 l-133 -101l-64 117c1 31 3 60 3 89c0 98 -17 117 -29 129c-21 21 -54 35 -83 35c-23 0 -65 -11 -92 -19c-3 -22 -7 -45 -12 -67c-12 -51 -27 -94 -56 -138c-56 -45 -113 -100 -168 -146c-22 22 -60 53 -81 53c-31 0 -55 -18 -73 -42l-11 16c16 25 34 55 61 78 c16 14 33 28 56 28c12 0 34 -7 48 -17c18 -13 32 -26 46 -41c35 24 63 52 82 90c14 28 19 59 24 90c6 46 10 92 10 139s-1 127 -40 184c-26 39 -71 72 -118 72c-40 0 -56 -7 -79 -30c-16 -15 -18 -35 -18 -57c0 -12 21 -43 36 -60c11 -14 30 -37 40 -54c6 -11 13 -28 13 -38 c0 -29 -14 -52 -32 -72c-22 -25 -59 -46 -91 -62l-15 11c18 10 36 26 49 42c10 12 15 24 15 39c0 10 -7 19 -13 27c-9 13 -21 30 -31 43c-23 28 -41 52 -41 90c0 40 23 70 51 98c24 24 90 86 183 86c46 0 89 -34 119 -71c15 -18 27 -42 36 -67'], 0x2127: [689,2,875,25,844,'34 627l-9 9l25 53c115 -9 231 -9 346 -1l-9 -58c-47 -11 -90 -36 -124 -70c-27 -26 -43 -61 -54 -97c-14 -47 -19 -96 -19 -144c0 -84 22 -169 82 -229c40 -40 97 -57 153 -57c62 0 126 17 170 62c31 30 51 69 65 110c16 49 23 101 23 153c0 81 -21 164 -79 223 c-29 29 -69 45 -110 53l21 55c110 -10 219 -14 329 -6l-17 -61c-61 3 -137 6 -190 11l-6 -15c26 -14 50 -30 71 -51c24 -25 40 -56 51 -90c13 -41 18 -85 18 -128c0 -95 -28 -190 -96 -257c-70 -71 -171 -94 -269 -94c-44 0 -89 5 -131 19c-35 12 -68 29 -94 55 c-60 60 -81 146 -81 230c0 93 23 189 90 256c29 28 58 51 95 66v12c-85 -4 -181 -9 -251 -9'], 0x2135: [689,-1,774,78,689,'325 91l-14 -90h-216l25 90c2 52 3 105 12 147c8 37 57 106 101 150c-48 38 -135 108 -155 145v156h31c6 -66 47 -119 98 -160c80 -65 252 -203 253 -203v44c0 67 32 137 80 190c-24 0 -72 0 -82 11c-11 11 -16 14 -16 29v89h24c3 -11 8 -22 16 -30c9 -9 28 -9 43 -9h120 c23 0 44 -16 44 -39v-72l-15 -5c-11 14 -26 27 -44 27h-48c-23 -16 -54 -76 -60 -93c-14 -41 -16 -66 -16 -112c0 -28 19 -79 39 -99c39 -38 101 -83 144 -114l-21 -142h-17c-45 73 -139 161 -212 220l-183 148c-19 -17 -49 -61 -64 -86c-13 -21 -18 -42 -18 -73 c0 -50 38 -119 66 -119h85'], 0x2190: [500,0,1000,57,945,'945 230h-818c38 -47 90 -126 115 -230h-40c-31 130 -113 220 -145 250c30 28 114 119 145 250h40c-25 -105 -78 -184 -115 -230h818v-40'], 0x2191: [693,194,500,28,472,'270 617v-811h-40v811c-53 -45 -121 -88 -202 -109v40c79 21 161 71 222 145c55 -66 134 -122 222 -145v-40c-79 21 -148 63 -202 109'], 0x2192: [500,0,1000,56,944,'874 230h-818v40h818c-38 47 -90 126 -115 230h40c31 -130 113 -220 145 -250c-30 -28 -114 -119 -145 -250h-40c25 105 78 184 115 230'], 0x2193: [674,193,500,28,472,'270 674v-791c53 45 121 88 202 109v-40c-79 -21 -161 -71 -222 -145c-55 66 -134 122 -222 145v40c79 -21 148 -63 202 -109v791h40'], 0x2194: [500,0,1000,57,944,'874 230h-747c38 -47 90 -126 115 -230h-40c-31 130 -113 220 -145 250c30 28 114 119 145 250h40c-25 -105 -78 -184 -115 -230h747c-38 47 -90 126 -115 230h40c31 -130 113 -220 145 -250c-30 -28 -114 -119 -145 -250h-40c25 105 78 184 115 230'], 0x2195: [771,271,500,28,472,'270 695v-890c53 45 121 88 202 109v-40c-79 -21 -161 -71 -222 -145c-55 66 -134 122 -222 145v40c79 -21 148 -63 202 -109v890c-53 -45 -121 -88 -202 -109v40c79 21 161 71 222 145c55 -66 134 -122 222 -145v-40c-79 21 -148 63 -202 109'], 0x2196: [767,193,1000,-17,943,'121 657l822 -822l-29 -28l-822 822c-11 -120 -62 -213 -81 -243l-28 28c73 122 73 235 73 280c45 0 158 0 280 73l28 -28c-29 -19 -117 -67 -243 -82'], 0x2197: [767,193,1000,58,1018,'908 629l-822 -822l-28 29l822 822c-120 11 -213 62 -243 81l28 28c122 -73 235 -73 280 -73c0 -45 0 -158 73 -280l-28 -28c-19 29 -67 117 -82 243'], 0x2198: [694,267,1000,57,1018,'880 -157l-823 823l29 28l823 -823c11 120 62 213 81 243l28 -28c-73 -122 -73 -235 -73 -280c-45 0 -158 0 -280 -73l-28 28c29 19 117 67 243 82'], 0x2199: [694,267,1000,-17,944,'944 665l-823 -823c120 -11 213 -62 243 -81l-28 -28c-122 73 -235 73 -280 73c0 45 0 158 -73 280l28 28c19 -29 67 -117 82 -243l823 823'], 0x21A6: [500,0,1000,56,944,'56 50v400h40v-180h778c-38 47 -90 126 -115 230h40c31 -130 113 -220 145 -250c-30 -28 -114 -119 -145 -250h-40c25 105 78 184 115 230h-778v-180h-40'], 0x21A9: [554,0,1000,56,944,'782 270c67 0 122 55 122 122s-55 122 -122 122v40c89 0 162 -73 162 -162s-73 -162 -162 -162h-656c38 -47 90 -126 115 -230h-40c-31 130 -113 220 -145 250c30 28 114 119 145 250h40c-25 -105 -78 -184 -115 -230h656'], 0x21AA: [554,0,1000,56,944,'218 270c-67 0 -122 55 -122 122s55 122 122 122v40c-89 0 -162 -73 -162 -162s73 -162 162 -162h656c-38 -47 -90 -126 -115 -230h40c31 130 113 220 145 250c-30 28 -114 119 -145 250h-40c25 -105 78 -184 115 -230h-656'], 0x21BC: [500,-230,1000,56,945,'910 230h-854c0 12 0 17 1 19c1 1 2 2 16 15c29 23 112 102 129 236h40c-13 -110 -67 -187 -105 -230h773c17 0 35 0 35 -20s-17 -20 -35 -20'], 0x21BD: [270,0,1000,56,945,'910 230h-773c34 -39 92 -115 105 -230h-40c-12 95 -60 179 -133 240c-12 11 -13 12 -13 30h854c17 0 35 0 35 -20s-17 -20 -35 -20'], 0x21BE: [693,194,298,28,270,'28 693h20c55 -66 134 -122 222 -145v-40c-79 21 -148 63 -202 109v-776c0 -17 0 -35 -20 -35s-20 17 -20 35v776v76'], 0x21BF: [693,194,298,28,270,'270 693v-76v-776c0 -18 0 -35 -20 -35s-20 18 -20 35v776c-54 -46 -123 -88 -202 -109v40c88 23 167 79 222 145h20'], 0x21C0: [500,-230,1000,56,945,'945 230h-854c-17 0 -35 0 -35 20s17 20 35 20h773c-34 39 -92 115 -105 230h40c12 -95 60 -179 133 -240c12 -11 13 -12 13 -30'], 0x21C1: [270,0,1000,56,945,'864 230h-773c-17 0 -35 0 -35 20s17 20 35 20h854c0 -12 0 -17 -1 -19c-1 -1 -2 -2 -16 -15c-29 -23 -112 -102 -129 -236h-40c13 110 67 187 105 230'], 0x21C2: [693,194,298,28,270,'28 -194v76v776c0 18 0 35 20 35s20 -18 20 -35v-776c54 46 123 88 202 109v-40c-88 -23 -167 -79 -222 -145h-20'], 0x21C3: [693,194,298,28,270,'270 -194h-20c-55 66 -134 122 -222 145v40c79 -21 148 -63 202 -109v776c0 17 0 35 20 35s20 -17 20 -35v-776v-76'], 0x21CB: [599,98,999,55,944,'863 132h-773c-17 0 -35 0 -35 20s17 20 35 20h854c0 -12 0 -17 -1 -19c-1 -1 -2 -2 -16 -15c-29 -23 -112 -102 -129 -236h-40c13 110 67 187 105 230zM909 329h-854c0 12 0 17 1 19c1 1 2 2 16 15c29 23 112 102 129 236h40c-13 -110 -67 -187 -105 -230h773 c17 0 35 0 35 -20s-17 -20 -35 -20'], 0x21CC: [599,98,999,55,944,'136 132h773c17 0 35 0 35 20s-17 20 -35 20h-854c0 -12 0 -17 1 -19c1 -1 2 -2 16 -15c29 -23 112 -102 129 -236h40c-13 110 -67 187 -105 230zM90 329h854c0 12 0 17 -1 19c-1 1 -2 2 -16 15c-29 23 -112 102 -129 236h-40c13 -110 67 -187 105 -230h-773 c-17 0 -35 0 -35 -20s17 -20 35 -20'], 0x21D0: [598,98,1000,55,922,'55 250c146 72 258 196 313 348h40c-31 -85 -78 -163 -138 -230h652v-40h-691c-31 -29 -64 -55 -99 -78c35 -23 68 -49 99 -78h691v-40h-652c60 -67 107 -145 138 -230h-40c-55 152 -167 276 -313 348'], 0x21D1: [694,174,667,12,652,'332 694c61 -143 176 -255 320 -313v-40c-75 30 -143 73 -201 127v-642h-40v682c-30 32 -56 68 -79 106c-22 -38 -49 -74 -78 -106v-682h-40v642c-58 -54 -127 -97 -202 -127v40c145 58 260 170 320 313'], 0x21D2: [598,98,1000,76,943,'943 250c-146 -72 -258 -196 -313 -348h-40c31 85 78 163 138 230h-652v40h691c31 29 64 55 99 78c-35 23 -68 49 -99 78h-691v40h652c-60 67 -107 145 -138 230h40c55 -152 167 -276 313 -348'], 0x21D3: [674,194,667,12,652,'332 -194c-60 143 -175 255 -320 313v40c75 -30 144 -73 202 -127v642h40v-682c29 -32 56 -68 78 -106c23 38 49 74 79 106v682h40v-642c58 54 126 97 201 127v-40c-144 -58 -259 -170 -320 -313'], 0x21D4: [598,98,1000,33,965,'965 250c-123 -83 -214 -206 -257 -348h-41c26 83 66 161 118 230h-572c52 -69 92 -147 118 -230h-41c-43 142 -134 265 -257 348c123 83 214 206 257 348h41c-26 -83 -66 -161 -118 -230h572c-52 69 -92 147 -118 230h41c43 -142 134 -265 257 -348zM818 172 c25 28 52 54 81 78c-29 24 -56 50 -81 78h-638c-25 -28 -52 -54 -81 -78c29 -24 56 -50 81 -78h638'], 0x21D5: [772,272,667,12,652,'332 -272c-72 121 -185 213 -320 257v41c74 -25 142 -62 202 -109v666c-60 -47 -128 -84 -202 -109v41c135 44 248 136 320 257c72 -121 186 -213 320 -257v-41c-73 25 -141 62 -201 109v-666c60 47 128 84 201 109v-41c-134 -44 -248 -136 -320 -257zM254 -117 c28 -26 55 -55 78 -86c24 31 50 60 79 86v734c-29 26 -55 55 -79 86c-23 -31 -50 -60 -78 -86v-734'], 0x2200: [681,9,555,1,552,'126 451h301l88 230l37 -14l-257 -676h-37l-257 676l38 14zM142 411l135 -357l135 357h-270'], 0x2202: [699,7,560,79,485,'101 548l-18 7c13 38 30 76 61 102c31 27 71 42 113 42c54 0 108 -30 142 -71c38 -46 59 -96 73 -155c11 -48 13 -102 13 -151c0 -101 -15 -214 -97 -283c-33 -28 -74 -46 -116 -46c-58 0 -111 9 -146 51c-34 42 -47 112 -47 159c0 76 24 156 83 206c41 34 92 48 144 48 c9 0 17 0 25 -1c11 -1 37 -7 55 -12l4 4c-13 52 -28 98 -59 134c-29 35 -65 60 -111 60c-37 0 -58 -12 -77 -32c-17 -18 -31 -37 -42 -62zM383 125c18 51 25 107 25 161c0 40 -4 80 -12 119c-25 11 -52 20 -79 20c-32 0 -63 -14 -88 -35c-53 -45 -66 -120 -66 -185 c0 -26 7 -92 39 -130c20 -23 51 -42 83 -42c23 0 38 7 56 21c21 18 34 46 42 71'], 0x2203: [694,0,555,75,498,'89 327v40h369v287h-383v40h423v-694h-423v40h383v287h-369'], 0x2204: [800,112,555,65,498,'484 795l5 -11l-39 -90h48v-694h-349l-49 -112l-32 8l-3 14l39 90h-29v40h47l124 287h-157v40h175l125 287h-314v40h331l45 104l11 2zM291 327l-125 -287h292v287h-167zM433 654l-125 -287h150v287h-25'], 0x2205: [720,192,742,55,687,'215 702v-450v450zM55 254c0 174 142 316 316 316c39 0 77 -7 112 -20l73 168l11 2l22 -5l5 -11l-74 -171c99 -54 167 -159 167 -279c0 -174 -142 -316 -316 -316c-36 0 -70 6 -102 17l-64 -147l-32 8l-3 14l61 141c-104 51 -176 159 -176 283zM467 513 c-30 11 -62 17 -96 17c-152 0 -276 -124 -276 -276c0 -108 62 -201 152 -247zM504 496l-219 -504c27 -9 56 -14 86 -14c152 0 276 124 276 276c0 104 -58 195 -143 242'], 0x2207: [696,4,713,30,689,'356 21l-58 -25c-44 132 -91 257 -143 385c-37 90 -81 182 -125 267l1 16l61 32c198 -13 397 -21 595 -7l2 -42zM157 642l-6 -9c41 -94 201 -494 201 -495h11c95 164 175 321 255 490l-3 12c-152 -3 -306 2 -458 2'], 0x2208: [541,41,666,83,561,'561 270v-40h-437c11 -131 126 -231 264 -231h173v-40h-173c-165 0 -305 127 -305 291s140 291 305 291h173v-40h-173c-138 0 -253 -100 -264 -231h437'], 0x2209: [720,192,666,83,561,'561 270v-40h-222l-85 -197c39 -22 85 -34 134 -34h173v-40h-173c-54 0 -106 14 -150 38l-82 -189l-32 8l-3 14l82 189c-72 52 -120 135 -120 231c0 164 140 291 305 291h42l77 177l11 2l22 -5l5 -11l-71 -163h87v-40h-104l-100 -231h204zM312 270l101 231h-25 c-138 0 -253 -100 -264 -231h188zM219 56l76 174h-171c6 -70 42 -132 95 -174'], 0x220B: [541,41,666,103,581,'103 230v40h438c-11 131 -126 231 -264 231h-174v40h174c165 0 304 -127 304 -291s-139 -291 -304 -291h-174v40h174c138 0 253 100 264 231h-438'], 0x2212: [276,-236,756,46,710,'704 236h-658l7 40h657'], 0x2213: [586,74,755,46,710,'396 276h313l-5 -40h-308v-303l-40 -7v310h-310l7 40h303v270h-310l7 40h657l-6 -40h-308v-270'], 0x2215: [720,192,0,39,463,'458 715l5 -11l-389 -896l-32 8l-3 14l386 888l11 2'], 0x2216: [722,192,501,39,463,'428 -192l-389 896l5 11l31 7l388 -893l-3 -13'], 0x2217: [514,-26,482,30,452,'288 26h-80c12 76 16 136 18 222c-54 -42 -106 -88 -154 -144l-42 70c68 34 122 70 174 106c-58 42 -112 74 -170 104l54 56c44 -42 86 -80 136 -118c0 64 0 126 -16 192h80c-14 -66 -18 -124 -22 -190c50 40 96 82 136 124l50 -62c-64 -30 -120 -64 -176 -104 c62 -46 120 -86 176 -112l-52 -58c-34 38 -82 82 -134 122c2 -70 6 -136 22 -208'], 0x2218: [444,-56,500,55,444,'444 250c0 -107 -89 -194 -194 -194c-108 0 -195 88 -195 194c0 105 87 194 195 194c105 0 194 -87 194 -194zM250 96c83 0 154 68 154 154s-71 154 -154 154c-86 0 -155 -70 -155 -154s68 -154 155 -154'], 0x2219: [444,-56,500,55,444,'444 250c0 -107 -89 -194 -194 -194c-108 0 -195 88 -195 194c0 105 87 194 195 194c105 0 194 -87 194 -194'], 0x221A: [988,1,833,70,849,'381 -1h-23l-205 450l-67 -50l-16 16l135 102l185 -406l423 877l36 -17'], 0x221D: [442,11,815,56,760,'462 197l-50 65c-36 46 -95 122 -175 122c-77 0 -139 -72 -139 -169c0 -88 48 -183 143 -183c88 0 163 64 221 165zM760 -10c-5 -1 -11 -1 -16 -1c-82 0 -151 49 -202 106c-20 22 -27 34 -48 60c-36 -60 -117 -166 -240 -166c-116 0 -198 108 -198 226 c0 119 83 227 201 227c82 0 151 -49 202 -106c20 -22 27 -34 48 -60c36 60 117 166 240 166h13v-43c-88 0 -163 -64 -221 -165l50 -65c35 -45 93 -119 171 -122v-57'], 0x221E: [442,11,1000,56,945,'462 197l-50 65c-36 46 -95 122 -175 122c-77 0 -139 -72 -139 -169c0 -88 48 -183 143 -183c88 0 163 64 221 165zM507 276c36 60 117 166 240 166c116 0 198 -108 198 -226c0 -119 -83 -227 -201 -227c-82 0 -151 49 -202 106c-20 22 -27 34 -48 60 c-36 -60 -117 -166 -240 -166c-116 0 -198 108 -198 226c0 119 83 227 201 227c82 0 151 -49 202 -106c20 -22 27 -34 48 -60zM539 234l50 -65c36 -46 95 -122 175 -122c77 0 139 72 139 169c0 88 -48 183 -143 183c-88 0 -163 -64 -221 -165'], 0x2223: [698,97,213,86,126,'126 -89l-40 -8v787l40 8v-787'], 0x2225: [738,167,392,86,306,'126 -159l-40 -8v897l40 8v-897zM306 -159l-40 -8v897l40 8v-897'], 0x2227: [714,4,775,11,768,'404 713l364 -711l-42 -6l-328 641l-347 -636l-29 -2l-11 11l384 704'], 0x2228: [688,12,775,6,756,'756 684l-374 -696h-15l-361 689l42 7l327 -625l338 629h39'], 0x2229: [598,2,666,55,609,'55 384c0 128 129 214 277 214c149 0 277 -86 277 -214v-386h-40v386c0 107 -113 174 -237 174c-123 0 -237 -67 -237 -174v-386h-40v386'], 0x222A: [578,22,666,55,609,'95 191c0 -106 114 -173 237 -173c124 0 237 67 237 173v387h40v-387c0 -128 -128 -213 -277 -213c-148 0 -277 85 -277 213v387h40v-387'], 0x222B: [950,161,556,49,507,'319 401l-1 -201c0 -43 -1 -87 -3 -131c-2 -51 -11 -230 -149 -230c-58 0 -117 25 -117 87c0 53 45 54 49 54c24 0 56 -18 56 -54c0 -18 -6 -34 -22 -44c2 -2 8 -6 12 -7c6 -3 8 -3 15 -4c2 -1 3 -1 9 -1c76 0 78 103 78 214c0 38 -3 205 -3 328c0 81 1 162 2 243 c1 106 3 295 146 295c54 0 116 -23 116 -87c0 -52 -44 -54 -49 -54c-25 0 -56 18 -56 54c0 18 6 34 22 44c-1 1 -6 5 -12 7c-6 3 -8 3 -15 4c-1 1 -3 1 -8 1c-73 0 -73 -101 -73 -223c0 -48 3 -265 3 -295'], 0x2234: [455,12,569,50,517,'228 398c0 31 26 57 58 57c31 0 56 -26 56 -57s-25 -57 -56 -57c-32 0 -58 26 -58 57zM460 -12c-31 0 -57 26 -57 58c0 30 26 56 57 56s57 -26 57 -56c0 -32 -26 -58 -57 -58zM107 -12c-31 0 -57 26 -57 58c0 30 26 56 57 56s57 -26 57 -56c0 -32 -26 -58 -57 -58'], 0x2235: [455,12,569,50,517,'228 44c0 -30 26 -56 58 -56c31 0 56 26 56 56c0 32 -25 58 -56 58c-32 0 -58 -26 -58 -58zM460 455c-31 0 -57 -26 -57 -58c0 -31 26 -56 57 -56s57 25 57 56c0 32 -26 58 -57 58zM107 455c-31 0 -57 -26 -57 -58c0 -31 26 -56 57 -56s57 25 57 56c0 32 -26 58 -57 58'], 0x223C: [347,-178,551,22,530,'281 291l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18c-12 -11 -28 -37 -40 -59l-22 12c12 24 27 49 42 66 c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42'], 0x223D: [347,-178,551,22,530,'271 291l-74 -46c-22 -14 -47 -26 -74 -26c-19 0 -32 7 -44 17c-14 10 -26 32 -36 50l-21 -11c11 -26 28 -52 47 -70c15 -14 41 -27 65 -27c38 0 73 16 105 36l99 63c24 15 51 28 80 28c19 0 35 -5 50 -18c12 -11 28 -37 40 -59l22 12c-12 24 -27 49 -42 66 c-13 15 -28 28 -47 34c-11 4 -23 7 -35 7c-19 0 -38 -6 -56 -14c-28 -11 -54 -26 -79 -42'], 0x2240: [422,77,243,54,189,'150 172l-36 -79c-11 -24 -19 -50 -16 -77c3 -19 11 -31 23 -42c12 -12 35 -21 54 -29l-8 -22c-27 8 -55 21 -76 37c-15 13 -32 38 -35 61c-5 38 6 75 22 109l50 107c11 25 21 54 17 83c-3 18 -10 34 -24 47c-13 10 -41 23 -64 32l9 23c25 -9 52 -20 71 -33 c16 -11 31 -24 40 -42c5 -10 10 -22 11 -34c3 -19 -1 -38 -6 -57c-8 -29 -19 -57 -32 -84'], 0x2241: [454,-32,551,22,530,'372 449l5 -11l-70 -163l48 -30c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-26 16l-85 -198l-32 8l-3 14l86 198l-39 25c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18 c-12 -11 -28 -37 -40 -59l-22 12c12 24 27 49 42 66c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c25 -10 48 -22 70 -36l67 155l11 2'], 0x2242: [397,-103,597,54,563,'557 357h-503l7 40h502zM314 216l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18c-12 -11 -28 -37 -40 -59l-22 12 c12 24 27 49 42 66c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42'], 0x2243: [396,-101,597,54,563,'557 101h-503l7 40h502zM314 340l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18c-12 -11 -28 -37 -40 -59l-22 12 c12 24 27 49 42 66c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42'], 0x2245: [597,-102,597,54,563,'557 299h-503l7 40h502zM557 102h-503l7 40h502zM314 541l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18 c-12 -11 -28 -37 -40 -59l-22 12c12 24 27 49 42 66c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42'], 0x2246: [597,8,597,54,563,'402 409l5 -11l-25 -59h181l-6 -40h-193l-67 -157h266l-6 -40h-278l-47 -110l-32 8l-3 14l38 88h-181l7 40h191l68 157h-266l7 40h276l32 73l11 2zM314 541l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70 c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18c-12 -11 -28 -37 -40 -59l-22 12c12 24 27 49 42 66c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42'], 0x2248: [427,-108,551,22,530,'281 371l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18c-12 -11 -28 -37 -40 -59l-22 12c12 24 27 49 42 66 c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42zM281 221l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63c-24 15 -51 28 -80 28 c-19 0 -35 -5 -50 -18c-12 -11 -28 -37 -40 -59l-22 12c12 24 27 49 42 66c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42'], 0x224A: [546,-101,597,54,563,'557 101h-503l7 40h502zM313 490l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18c-12 -11 -28 -37 -40 -59l-22 12 c12 24 27 49 42 66c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42zM314 340l74 -46c22 -14 47 -26 74 -26c19 0 32 7 44 17c14 10 26 32 36 50l21 -11c-11 -26 -28 -52 -47 -70c-15 -14 -41 -27 -65 -27c-38 0 -73 16 -105 36l-99 63 c-24 15 -51 28 -80 28c-19 0 -35 -5 -50 -18c-12 -11 -28 -37 -40 -59l-22 12c12 24 27 49 42 66c13 15 28 28 47 34c11 4 23 7 35 7c19 0 38 -6 56 -14c28 -11 54 -26 79 -42'], 0x2260: [720,192,756,54,722,'598 715l5 -11l-145 -335h264l-6 -40h-276l-68 -157h350l-6 -40h-361l-141 -324l-32 8l-3 14l131 302h-256l7 40h267l68 157h-342l7 40h352l152 349l11 2'], 0x2261: [465,-33,830,81,749,'90 465h659l-9 -39h-659zM90 268h659l-9 -38h-659zM90 72h659l-9 -39h-659'], 0x2264: [648,150,807,79,700,'680 -150l-572 260l-2 13l11 22l13 2l568 -261l2 -12l-10 -20zM700 622l-2 -9l-522 -241v-12l519 -241l5 -10l-11 -23l-10 -5l-600 280v12l601 275l11 -3'], 0x2265: [647,149,807,102,724,'680 148l10 -4l10 -20l-2 -12l-568 -261l-13 2l-11 22l2 13zM104 610l-2 10l10 24l10 3l602 -275v-12l-600 -280l-10 5l-8 24l4 9l518 243v9'], 0x2266: [800,0,756,54,722,'696 772l-2 -8l-538 -205v-12l535 -206l5 -9l-9 -24l-10 -6l-617 239v26l618 233l11 -4zM716 197h-662l7 40h661zM716 0h-662l7 40h661'], 0x2267: [800,0,756,54,722,'60 772l7 24l11 4l618 -233v-26l-617 -239l-10 6l-9 24l5 9l535 206v12l-538 205zM716 197h-662l7 40h661zM716 0h-662l7 40h661'], 0x2268: [800,93,756,54,722,'696 772l-2 -8l-538 -205v-12l535 -206l5 -9l-9 -24l-10 -6l-617 239v26l618 233l11 -4zM478 324l5 -11l-33 -76h272l-6 -40h-283l-68 -157h357l-6 -40h-368l-40 -93l-32 8l-3 14l31 71h-250l7 40h260l68 157h-335l7 40h345l39 90l11 2'], 0x2269: [800,93,756,54,722,'60 772l7 24l11 4l618 -233v-26l-617 -239l-10 6l-9 24l5 9l535 206v12l-538 205zM478 324l5 -11l-33 -76h272l-6 -40h-283l-68 -157h357l-6 -40h-368l-40 -93l-32 8l-3 14l31 71h-250l7 40h260l68 157h-335l7 40h345l39 90l11 2'], 0x226E: [720,192,756,59,680,'585 715l5 -11l-111 -256l181 83l11 -3l9 -23l-2 -9l-223 -103l-104 -240l324 -151l5 -10l-11 -23l-10 -5l-325 151l-133 -307l-32 8l-3 14l132 303l-239 111v12l365 167l128 295l11 2zM314 170l86 197l-244 -112v-12'], 0x226F: [720,192,756,76,698,'585 715l5 -11l-144 -333l252 -115v-12l-386 -180l-111 -256l-32 8l-3 14l90 208l-158 -74l-10 5l-8 24l4 9l197 92l111 256l-314 144l-2 10l10 24l10 3l313 -143l143 330l11 2zM429 333l-92 -212l265 124v9'], 0x2270: [720,192,807,79,700,'585 715l5 -11l-53 -121l143 65l11 -3l9 -23l-2 -9l-184 -85l-118 -270l299 -139l5 -10l-11 -23l-10 -5l-299 139l-68 -157l386 -177l2 -12l-10 -20l-10 -4l-385 175l-94 -217l-32 8l-3 14l92 212l-150 68l-2 13l11 22l13 2l145 -66l68 157l-264 123v12l403 185l70 160 l11 2zM359 275l99 227l-282 -130v-12'], 0x2271: [720,192,807,102,724,'585 715l5 -11l-98 -226l232 -106v-12l-355 -166l-102 -234l413 188l10 -4l10 -20l-2 -12l-456 -210l-41 -94l-32 8l-3 14l20 47l-56 -26l-13 2l-11 22l2 13l104 47l101 233l-189 -88l-10 5l-8 24l4 9l228 107l100 232l-334 153l-2 10l10 24l10 3l333 -152l97 223l11 2z M475 440l-82 -189l235 110v9'], 0x2272: [663,52,807,79,716,'716 635l-3 -8l-537 -205v-12l534 -206l6 -9l-10 -24l-9 -6l-618 239v26l619 233l11 -4zM390 61l89 -46c26 -14 56 -26 89 -26c23 0 38 7 53 17c16 10 31 32 43 50l25 -11c-13 -26 -34 -52 -56 -70c-18 -14 -50 -27 -78 -27c-46 0 -88 16 -126 36l-119 63 c-29 15 -61 28 -96 28c-23 0 -42 -5 -60 -18c-15 -11 -34 -37 -48 -59l-27 12c15 24 33 49 51 66c15 15 33 28 56 34c13 4 28 7 42 7c23 0 46 -6 67 -14c34 -11 65 -26 95 -42'], 0x2273: [663,52,807,88,725,'88 635l7 24l11 4l619 -233v-26l-618 -239l-9 6l-10 24l6 9l534 206v12l-537 205zM424 61l89 -46c26 -14 56 -26 89 -26c23 0 38 7 53 17c16 10 31 32 43 50l25 -11c-13 -26 -34 -52 -56 -70c-18 -14 -50 -27 -78 -27c-46 0 -88 16 -126 36l-119 63c-29 15 -61 28 -96 28 c-23 0 -42 -5 -60 -18c-15 -11 -34 -37 -48 -59l-27 12c15 24 33 49 51 66c15 15 33 28 56 34c13 4 28 7 42 7c23 0 46 -6 67 -14c34 -11 65 -26 95 -42'], 0x2276: [766,119,807,71,716,'716 738l-3 -8l-537 -205v-12l534 -206l6 -9l-10 -24l-9 -6l-618 239v26l619 233l11 -4zM71 351l7 24l11 4l619 -233v-26l-618 -239l-9 6l-10 24l6 9l534 206v12l-537 205'], 0x2277: [764,120,807,72,716,'72 736l7 24l11 4l619 -233v-26l-618 -239l-9 6l-10 24l6 9l534 206v12l-537 205zM716 350l-3 -8l-537 -205v-12l534 -206l6 -9l-10 -24l-9 -6l-618 239v26l619 233l11 -4'], 0x2282: [541,41,777,83,673,'388 501c-145 0 -265 -111 -265 -251s120 -251 265 -251h285v-40h-285c-165 0 -305 127 -305 291s140 291 305 291h285v-40h-285'], 0x2283: [541,41,777,103,693,'388 541c165 0 305 -127 305 -291s-140 -291 -305 -291h-285v40h285c145 0 265 111 265 251s-120 251 -265 251h-285v40h285'], 0x2286: [636,143,777,83,673,'388 596c-145 0 -265 -111 -265 -251c0 -141 120 -251 265 -251h285v-40h-285c-165 0 -305 127 -305 291s140 291 305 291h285v-40h-285zM123 -143v40h550v-40h-550'], 0x2287: [636,143,777,103,693,'388 636c165 0 305 -127 305 -291s-140 -291 -305 -291h-285v40h285c145 0 265 110 265 251c0 140 -120 251 -265 251h-285v40h285zM652 -103v-40h-549v40h549'], 0x2288: [720,192,777,83,673,'596 715l4 -11l-29 -68h102v-40h-119l-216 -498c16 -3 33 -4 50 -4h285v-40h-285c-23 0 -45 2 -67 7l-71 -164h423v-40h-440l-21 -49l-32 8l-4 14l12 27h-65v40h83l76 175c-115 41 -199 146 -199 273c0 164 140 291 305 291h139l35 82l12 2zM388 596 c-145 0 -265 -111 -265 -251c0 -110 74 -201 175 -236l211 487h-121'], 0x2289: [720,192,777,103,693,'596 715l4 -11l-49 -113c84 -52 142 -141 142 -246c0 -164 -140 -291 -305 -291h-70l-68 -157h402v-40h-419l-21 -49l-32 8l-4 14l12 27h-85v40h103l68 157h-171v40h188l208 479c-34 15 -71 23 -111 23h-285v40h285c45 0 88 -10 127 -27l47 109l12 2zM535 553l-199 -459 h52c145 0 265 110 265 251c0 88 -47 164 -118 208'], 0x228A: [636,222,777,83,673,'123 -143v40h251l33 76l11 2l22 -5l5 -11l-27 -62h255v-40h-272l-34 -79l-32 8l-3 14l25 57h-234zM388 596c-145 0 -265 -111 -265 -251c0 -141 120 -251 265 -251h285v-40h-285c-165 0 -305 127 -305 291s140 291 305 291h285v-40h-285'], 0x228B: [636,222,777,103,693,'652 -103v-40h-251l-34 -79l-32 8l-3 14l25 57h-254v40h271l33 76l11 2l22 -5l5 -11l-27 -62h234zM388 636c165 0 305 -127 305 -291s-140 -291 -305 -291h-285v40h285c145 0 265 110 265 251c0 140 -120 251 -265 251h-285v40h285'], 0x228E: [578,22,665,55,609,'312 482h40v-157h157v-40h-157v-156h-40v156h-156v40h156v157zM95 191c0 -106 114 -173 237 -173c124 0 237 67 237 173v387h40v-387c0 -128 -128 -213 -277 -213c-148 0 -277 85 -277 213v387h40v-387'], 0x2291: [636,143,1000,94,693,'134 596v-502h559v-40h-599v582h599v-40h-559zM103 -143v40h590v-40h-590'], 0x2292: [636,143,1000,83,681,'83 636h598v-582h-598v40h558v502h-558v40zM673 -103v-40h-590v40h590'], 0x2295: [583,83,777,55,722,'722 250c0 -182 -148 -333 -334 -333c-183 0 -333 149 -333 333c0 182 148 333 334 333c183 0 333 -149 333 -333zM80 263h296v295c-156 -8 -286 -127 -296 -295zM401 558v-295h296c-10 167 -139 287 -296 295zM376 -58v296h-296c10 -171 141 -288 296 -296zM697 238 h-296v-296c154 8 286 125 296 296'], 0x2296: [583,83,777,55,722,'722 250c0 -182 -148 -333 -334 -333c-183 0 -333 149 -333 333c0 182 148 333 334 333c183 0 333 -149 333 -333zM80 263h617c-10 176 -152 295 -309 295c-153 0 -298 -117 -308 -295zM697 238h-617c10 -179 154 -296 309 -296c151 0 298 114 308 296'], 0x2297: [583,83,777,55,722,'722 250c0 -182 -148 -333 -334 -333c-183 0 -333 149 -333 333c0 182 148 333 334 333c183 0 333 -149 333 -333zM190 465l199 -198l208 209c-82 77 -174 82 -209 82c-126 0 -207 -78 -207 -82c0 -2 7 -9 9 -11zM161 41l209 209l-209 209c-52 -59 -81 -132 -81 -209 c0 -64 20 -141 81 -209zM615 459l-208 -209l209 -209c52 59 81 132 81 209c0 82 -34 158 -82 209zM587 35l-199 198l-208 -209c82 -77 174 -82 209 -82c126 0 207 78 207 82c0 2 -7 9 -9 11'], 0x2298: [583,83,777,55,722,'722 250c0 -182 -148 -333 -334 -333c-183 0 -333 149 -333 333c0 182 148 333 334 333c183 0 333 -149 333 -333zM171 51l426 425c-82 77 -174 82 -209 82c-168 0 -308 -136 -308 -308c0 -127 79 -207 82 -207c1 0 1 1 9 8zM615 459l-435 -435c82 -77 174 -82 209 -82 c168 0 308 136 308 308c0 82 -34 158 -82 209'], 0x2299: [583,83,777,55,722,'722 250c0 -182 -148 -333 -334 -333c-183 0 -333 149 -333 333c0 182 148 333 334 333c183 0 333 -149 333 -333zM389 -58c168 0 308 136 308 308c0 169 -137 308 -309 308c-168 0 -308 -136 -308 -308c0 -169 137 -308 309 -308zM457 250c0 -36 -29 -69 -69 -69 c-37 0 -68 31 -68 69c0 36 29 69 69 69c37 0 68 -31 68 -69'], 0x22A2: [694,0,673,55,618,'55 694h40v-327h523v-40h-523v-327h-40v694'], 0x22A3: [694,0,673,55,618,'618 694h-40v-327h-523v-40h523v-327h40v694'], 0x22A4: [684,0,875,55,820,'55 644v40l765 -1v-40h-362v-643h-40v644h-363'], 0x22A5: [684,0,875,55,820,'55 40v-40l765 1v40h-362v643h-40v-644h-363'], 0x22C4: [496,-4,500,3,495,'495 250l-246 -246l-246 246l246 246zM438 250l-189 189l-189 -189l189 -189'], 0x22C5: [379,-245,277,72,206,'72 312c0 37 30 67 66 67c38 0 68 -30 68 -67s-30 -67 -68 -67c-36 0 -66 30 -66 67'], 0x22EF: [319,-185,768,77,691,'77 252c0 37 30 67 67 67s67 -30 67 -67s-30 -67 -67 -67s-67 30 -67 67zM317 252c0 37 30 67 67 67s67 -30 67 -67s-30 -67 -67 -67s-67 30 -67 67zM557 252c0 37 30 67 67 67s67 -30 67 -67s-30 -67 -67 -67s-67 30 -67 67'], 0x22F1: [533,-60,627,76,550,'191 419c-26 -26 -68 -26 -94 0c-27 26 -27 69 0 95c26 26 68 26 94 0c27 -26 27 -69 0 -95zM361 250c-26 -27 -69 -27 -95 0c-26 26 -26 68 0 94c26 27 69 27 95 0c26 -26 26 -68 0 -94zM531 80c-26 -26 -69 -26 -95 0s-26 69 0 95s69 26 95 0s26 -69 0 -95'], 0x2308: [980,0,511,174,401,'214 940v-940h-40v980h227v-40h-187'], 0x2309: [980,0,511,41,269,'41 980h228v-980h-40v940h-188v40'], 0x230A: [980,0,511,174,401,'214 40h187v-40h-227v980h40v-940'], 0x230B: [980,0,511,41,269,'269 980v-980h-228v40h188v940h40'], 0x23DC: [770,-582,1037,56,981,'80 582h-24c4 48 42 90 79 118c43 30 95 42 146 52c80 14 161 18 242 18c77 0 155 -6 230 -20c54 -12 108 -28 154 -58c35 -26 67 -70 74 -110h-27c-8 32 -38 64 -72 80c-47 22 -98 34 -150 42c-71 10 -143 14 -215 14c-86 0 -172 -4 -256 -18c-29 -6 -58 -12 -86 -22 c-20 -6 -39 -16 -55 -30c-20 -16 -36 -46 -40 -66'], 0x23DD: [-32,222,1037,56,981,'954 -32h27c-7 -34 -28 -66 -54 -90c-44 -40 -101 -60 -158 -74c-83 -20 -167 -26 -252 -26c-84 0 -169 4 -252 20c-53 12 -106 26 -148 62c-33 26 -57 78 -61 108h24c7 -26 22 -58 47 -78c15 -12 33 -20 51 -26c27 -8 52 -16 79 -20c87 -12 176 -14 264 -14 c79 0 158 6 235 20c53 10 106 24 151 54c22 16 38 40 47 64'], 0x23DE: [824,-528,1020,56,964,'80 528h-24c0 40 0 92 6 116c4 16 12 28 23 38c21 20 50 24 77 26c24 4 70 4 106 4c69 0 174 0 202 24c9 8 15 20 18 34c5 16 5 36 5 54h26c0 -40 1 -64 20 -86c14 -16 37 -18 58 -22c35 -4 100 -4 151 -4h106c28 -4 56 -8 78 -26c11 -8 20 -20 25 -34 c7 -22 7 -82 7 -124h-24c0 30 0 60 -8 88c-3 12 -9 18 -20 24c-12 8 -27 12 -42 16c-39 6 -78 6 -118 6c-41 0 -82 0 -123 6c-23 4 -50 8 -70 20c-26 16 -45 42 -51 58h-1c-7 -20 -18 -38 -38 -52c-23 -16 -49 -24 -76 -26c-43 -6 -86 -6 -129 -6c-40 0 -80 -2 -119 -8 c-14 -4 -27 -8 -39 -16c-11 -6 -17 -18 -20 -30c-6 -24 -6 -52 -6 -80'], 0x23DF: [26,268,1020,56,964,'56 26h24c0 -26 1 -56 6 -80c3 -12 9 -22 20 -30c12 -8 25 -12 39 -14c39 -6 79 -8 119 -8c43 0 86 -2 129 -6c27 -4 53 -10 76 -28c20 -14 31 -32 38 -52h1c6 18 25 42 51 60c20 12 47 16 70 18c41 6 82 8 123 8c40 0 79 0 118 6c15 2 30 6 42 14c11 6 17 14 20 26 c7 28 8 58 8 86h24c0 -40 0 -102 -7 -122c-5 -14 -14 -26 -25 -36c-22 -16 -50 -22 -78 -24c-10 -2 -71 -2 -106 -2c-51 0 -116 0 -151 -4c-21 -2 -44 -6 -58 -22c-19 -22 -20 -46 -20 -84h-26c0 18 0 36 -5 54c-3 12 -9 24 -18 32c-28 26 -133 26 -202 26 c-36 0 -82 0 -106 2c-27 4 -56 8 -77 26c-11 10 -19 24 -23 38c-6 24 -6 78 -6 116'], 0x27E8: [737,237,388,107,330,'150 250l180 -473l-37 -14l-186 487l186 487l37 -14'], 0x27E9: [737,237,388,57,280,'94 737l186 -487l-186 -487l-37 14l180 473l-180 473'], 0x27F5: [500,0,1610,55,1553,'1553 270h-1428c38 47 90 126 115 230h-40c-31 -130 -113 -220 -145 -250c30 -28 114 -119 145 -250h40c-25 105 -78 184 -115 230h1428v40'], 0x27F6: [500,0,1610,55,1553,'55 270h1428c-38 47 -90 126 -115 230h40c31 -130 113 -220 145 -250c-30 -28 -114 -119 -145 -250h-40c25 105 78 184 115 230h-1428v40'], 0x27F7: [500,0,1700,57,1644,'1574 230h-1447c38 -47 90 -126 115 -230h-40c-31 130 -113 220 -145 250c30 28 114 119 145 250h40c-25 -105 -78 -184 -115 -230h1447c-38 47 -90 126 -115 230h40c31 -130 113 -220 145 -250c-30 -28 -114 -119 -145 -250h-40c25 105 78 184 115 230'], 0x27F8: [598,98,1700,55,1622,'55 250c145 72 257 196 312 348h40c-31 -86 -78 -163 -138 -230h1353v-40h-1392c-31 -29 -64 -55 -99 -78c35 -23 68 -49 99 -78h1392v-40h-1353c60 -67 107 -144 138 -230h-40c-55 152 -167 276 -312 348'], 0x27F9: [598,98,1700,55,1622,'1622 250c-145 72 -257 196 -312 348h-40c31 -86 78 -163 138 -230h-1353v-40h1392c31 -29 64 -55 99 -78c-35 -23 -68 -49 -99 -78h-1392v-40h1353c-60 -67 -107 -144 -138 -230h40c55 152 167 276 312 348'], 0x27FA: [598,98,1700,33,1665,'1665 250c-123 -83 -214 -206 -257 -348h-41c26 83 66 161 118 230h-1272c52 -69 92 -147 118 -230h-41c-43 142 -134 265 -257 348c123 83 214 206 257 348h41c-26 -83 -66 -161 -118 -230h1272c-52 69 -92 147 -118 230h41c43 -142 134 -265 257 -348zM1518 172 c25 28 52 54 81 78c-29 24 -56 50 -81 78h-1338c-25 -28 -52 -54 -81 -78c29 -24 56 -50 81 -78h1338'], 0x27FC: [500,0,1690,56,1634,'56 50v400h40v-180h1468c-38 47 -90 126 -115 230h40c31 -130 113 -220 145 -250c-30 -28 -114 -119 -145 -250h-40c25 105 78 184 115 230h-1468v-180h-40'] }; MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Main/Regular/Main.js");
masterfish2015/my_project
electronic/html/js/mathjax/unpacked/jax/output/SVG/fonts/Neo-Euler/Main/Regular/Main.js
JavaScript
mit
107,069
<?php namespace Kunstmaan\PagePartBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; /** * class to add content to a raw html pagepart */ class RawHTMLPagePartAdminType extends AbstractType { /** * @param \Symfony\Component\Form\FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('content', TextareaType::class, array( 'label' => 'pagepart.html.content', 'required' => false, 'attr' => array( 'style' => 'width: 600px', 'rows' => 32, ), )); } /** * @return string */ public function getBlockPrefix() { return 'kunstmaan_pagepartbundle_rawhtmlpageparttype'; } /** * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver */ public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => 'Kunstmaan\PagePartBundle\Entity\RawHTMLPagePart', )); } }
jockri/KunstmaanBundlesCMS
src/Kunstmaan/PagePartBundle/Form/RawHTMLPagePartAdminType.php
PHP
mit
1,327
# This is where parslets name comes from: Small parser atoms. # module Parslet::Atoms # The precedence module controls parenthesis during the #inspect printing # of parslets. It is not relevant to other aspects of the parsing. # module Precedence prec = 0 BASE = (prec+=1) # everything else LOOKAHEAD = (prec+=1) # &SOMETHING REPETITION = (prec+=1) # 'a'+, 'a'? SEQUENCE = (prec+=1) # 'a' 'b' ALTERNATE = (prec+=1) # 'a' | 'b' OUTER = (prec+=1) # printing is done here. end require 'parslet/atoms/can_flatten' require 'parslet/atoms/context' require 'parslet/atoms/dsl' require 'parslet/atoms/base' require 'parslet/atoms/named' require 'parslet/atoms/lookahead' require 'parslet/atoms/alternative' require 'parslet/atoms/sequence' require 'parslet/atoms/repetition' require 'parslet/atoms/re' require 'parslet/atoms/str' require 'parslet/atoms/entity' require 'parslet/atoms/capture' require 'parslet/atoms/dynamic' require 'parslet/atoms/scope' require 'parslet/atoms/infix' end
jweather/sonic-pi
app/server/vendor/parslet/lib/parslet/atoms.rb
Ruby
mit
1,090